aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qtsupport/gettingstartedwelcomepage.cpp')
-rw-r--r--src/plugins/qtsupport/gettingstartedwelcomepage.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
index db737fb5ac..7a048dfa3e 100644
--- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
+++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
@@ -85,7 +85,7 @@ Id ExamplesWelcomePage::id() const
QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileInfo, QStringList &filesToOpen, const QStringList& dependencies)
{
const QString projectDir = proFileInfo.canonicalPath();
- QDialog d(ICore::mainWindow());
+ QDialog d(ICore::dialogParent());
auto lay = new QGridLayout(&d);
auto descrLbl = new QLabel;
d.setWindowTitle(tr("Copy Project to writable Location?"));
@@ -125,15 +125,17 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI
int code = d.exec();
if (code == Copy) {
QString exampleDirName = proFileInfo.dir().dirName();
- QString destBaseDir = chooser->path();
+ QString destBaseDir = chooser->filePath().toString();
settings->setValue(QString::fromLatin1(C_FALLBACK_ROOT), destBaseDir);
QDir toDirWithExamplesDir(destBaseDir);
if (toDirWithExamplesDir.cd(exampleDirName)) {
toDirWithExamplesDir.cdUp(); // step out, just to not be in the way
- QMessageBox::warning(ICore::mainWindow(), tr("Cannot Use Location"),
+ QMessageBox::warning(ICore::dialogParent(),
+ tr("Cannot Use Location"),
tr("The specified location already exists. "
"Please specify a valid location."),
- QMessageBox::Ok, QMessageBox::NoButton);
+ QMessageBox::Ok,
+ QMessageBox::NoButton);
return QString();
} else {
QString error;
@@ -150,7 +152,9 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI
.pathAppended(QDir(dependency).dirName());
if (!FileUtils::copyRecursively(FilePath::fromString(dependency), targetFile,
&error)) {
- QMessageBox::warning(ICore::mainWindow(), tr("Cannot Copy Project"), error);
+ QMessageBox::warning(ICore::dialogParent(),
+ tr("Cannot Copy Project"),
+ error);
// do not fail, just warn;
}
}
@@ -158,7 +162,7 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI
return targetDir + QLatin1Char('/') + proFileInfo.fileName();
} else {
- QMessageBox::warning(ICore::mainWindow(), tr("Cannot Copy Project"), error);
+ QMessageBox::warning(ICore::dialogParent(), tr("Cannot Copy Project"), error);
}
}