summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@nokia.com>2011-09-06 16:30:29 +0200
committerTim Jenssen <tim.jenssen@nokia.com>2011-09-07 15:41:58 +0200
commit312543ba17638924482424d467ea77283e3b24ff (patch)
treece329251a730e06375fa3e3b36fb45121d25533a
parentde7d7adb7f9b8968f04aec33ab987915ac0e6585 (diff)
improve qt patch error messages
Change-Id: If936889d3bdb7572b8897f1624ec0bd4fcf92e30 Reviewed-on: http://codereview.qt.nokia.com/4269 Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
-rw-r--r--installerbuilder/libinstaller/qtpatch.cpp18
-rw-r--r--installerbuilder/libinstaller/qtpatchoperation.cpp5
2 files changed, 17 insertions, 6 deletions
diff --git a/installerbuilder/libinstaller/qtpatch.cpp b/installerbuilder/libinstaller/qtpatch.cpp
index c98aeef4f..655497421 100644
--- a/installerbuilder/libinstaller/qtpatch.cpp
+++ b/installerbuilder/libinstaller/qtpatch.cpp
@@ -86,7 +86,6 @@ namespace {
QHash<QString, QByteArray> QtPatch::qmakeValues(const QString & qmakePath, QByteArray * qmakeOutput)
{
-
QHash<QString, QByteArray> qmakeValueHash;
// in some cases qmake is not runable, because another process is blocking it(filewatcher ...)
@@ -94,8 +93,12 @@ QHash<QString, QByteArray> QtPatch::qmakeValues(const QString & qmakePath, QByte
while (qmakeValueHash.isEmpty() && waitCount < 60) {
QFileInfo qmake(qmakePath);
- if (!qmake.exists() || !qmake.isExecutable()) {
- QInstaller::verbose() << qPrintable( QString(QLatin1String("%1 is not existing or not executable")).arg(qmakePath) ) << std::endl;
+ if (!qmake.exists()) {
+ qmakeOutput->append(QString(QLatin1String("%1 is not existing")).arg(qmakePath));
+ return qmakeValueHash;
+ }
+ if (!qmake.isExecutable()) {
+ qmakeOutput->append(QString(QLatin1String("%1 is not executable")).arg(qmakePath));
return qmakeValueHash;
}
@@ -127,7 +130,14 @@ QHash<QString, QByteArray> QtPatch::qmakeValues(const QString & qmakePath, QByte
static const int waitTimeInMilliSeconds = 500;
uiDetachedWait(waitTimeInMilliSeconds);
}
- } //while (qmakeValueHash.isEmpty() && waitCount < 60)
+ if (process.state() > QProcess::NotRunning ) {
+ QInstaller::verbose() << "qmake process is still running, need to kill it." << std::endl;
+ process.kill();
+ }
+
+ }
+ if (qmakeValueHash.isEmpty())
+ QInstaller::verbose() << "Can't get any query output from qmake." << std::endl;
return qmakeValueHash;
}
diff --git a/installerbuilder/libinstaller/qtpatchoperation.cpp b/installerbuilder/libinstaller/qtpatchoperation.cpp
index 2f17933c7..281e99a3a 100644
--- a/installerbuilder/libinstaller/qtpatchoperation.cpp
+++ b/installerbuilder/libinstaller/qtpatchoperation.cpp
@@ -200,7 +200,8 @@ bool QtPatchOperation::performOperation()
if (! patchFileListFile.open(QFile::ReadOnly)) {
setError(UserDefinedError);
- setErrorString(tr("Qt patch error: Can not open %1.").arg(patchFileListFile.fileName()));
+ setErrorString(tr("Qt patch error: Can not open %1.(%2)").arg(patchFileListFile.fileName(),
+ patchFileListFile.errorString()));
return false;
}
@@ -249,7 +250,7 @@ bool QtPatchOperation::performOperation()
if (!QtPatch::openFileForPatching(&file)) {
setError(UserDefinedError);
- setErrorString(tr("Qt patch error: Can not open %1(%2).").arg(file.fileName())
+ setErrorString(tr("Qt patch error: Can not open %1.(%2)").arg(file.fileName())
.arg(file.errorString()));
return false;
}