diff options
author | Samuel Gaist <samuel.gaist@edeltech.ch> | 2014-07-21 21:55:01 +0200 |
---|---|---|
committer | Samuel Gaist <samuel.gaist@edeltech.ch> | 2014-07-30 17:38:17 +0200 |
commit | 22fe880628a2186ef4d66c3b0b670de93ea4bc6f (patch) | |
tree | 227374784ffb3b2588a1919137eedc964420cee5 /src/plugins/qmakeandroidsupport/createandroidmanifestwizard.cpp | |
parent | f130c3c7e5543f8240f16afe17a9a15d94a9c1da (diff) | |
download | qt-creator-22fe880628a2186ef4d66c3b0b670de93ea4bc6f.tar.gz |
Improve AndroidManifest.xml error dialog content
Currently, if the AndroidManifest.xml file is not present in the
installation folder (e.g. failed make install), the error message
shown to the user just tells him that some operation failed. This patch
tries to be more verbose to give the user some clues for the failure
reason.
Task-number: QTCREATORBUG-11503
Change-Id: I013de394c87b3adb53ec86dd97433567d7f63049
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Diffstat (limited to 'src/plugins/qmakeandroidsupport/createandroidmanifestwizard.cpp')
-rw-r--r-- | src/plugins/qmakeandroidsupport/createandroidmanifestwizard.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/plugins/qmakeandroidsupport/createandroidmanifestwizard.cpp b/src/plugins/qmakeandroidsupport/createandroidmanifestwizard.cpp index 10849b8b01..8e2f16239a 100644 --- a/src/plugins/qmakeandroidsupport/createandroidmanifestwizard.cpp +++ b/src/plugins/qmakeandroidsupport/createandroidmanifestwizard.cpp @@ -213,14 +213,21 @@ void CreateAndroidManifestWizard::setDirectory(const QString &directory) m_directory = directory; } -QString CreateAndroidManifestWizard::sourceFileName() const +QString CreateAndroidManifestWizard::sourceFolder() const { - QString result; QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(m_target->kit()); if (!version) - return result; + return QString(); + return version->qmakeProperty("QT_INSTALL_PREFIX"); +} + +QString CreateAndroidManifestWizard::sourceFileName() const +{ + QString srcFolder = sourceFolder(); + if (srcFolder.isEmpty()) + return srcFolder; Utils::FileName srcPath - = Utils::FileName::fromString(version->qmakeProperty("QT_INSTALL_PREFIX")) + = Utils::FileName::fromString(srcFolder) .appendPath(QLatin1String("src/android/java")); srcPath.appendPath(QLatin1String("AndroidManifest.xml")); return srcPath.toString(); @@ -250,9 +257,20 @@ void CreateAndroidManifestWizard::createAndroidManifestFile() } } - if (!QFile::copy(sourceFileName(), fileName)) { + QString srcFileName = sourceFileName(); + + if (!QFileInfo(srcFileName).exists()) { + QMessageBox::warning(this, tr("File Creation Error"), + tr("\"%1\" is missing.\n" + "Check your Qt installation here:\n" + "\"%2\"").arg(fileName).arg(sourceFolder())); + return; + } + + if (!QFile::copy(srcFileName, fileName)) { QMessageBox::warning(this, tr("File Creation Error"), - tr("Could not create file %1.").arg(fileName)); + tr("Could not create file %1.\n" + "Verify that you have writing rights in your project directory.").arg(fileName)); return; } |