diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2011-04-18 14:13:18 +0200 |
---|---|---|
committer | con <qtc-committer@nokia.com> | 2011-04-18 15:38:03 +0200 |
commit | f86c9b65726e879652561e6db04e6688bc48f48c (patch) | |
tree | 955e5213c9faab375f828e344997047638ca7efd /src/libs/utils/buildablehelperlibrary.cpp | |
parent | bf511a2bcb3d462b4c8ee286b6b64ce85a5f8755 (diff) | |
download | qt-creator-f86c9b65726e879652561e6db04e6688bc48f48c.tar.gz |
QmlDump: Ensure that qmldump is found in QtSDKv2.2.0-rc1
We ship a precompiled qmldump in the Qt SDK because the Qt versions
don't have private headers. However, the logic in buildablehelperlibrary
by default rejects any build that is older than the latest changes to the
qmldump source code files; allow Qt Creator to pick up the (maybe
outdated) qmldump nevertheless if no private headers are installed.
Reviewed-by: ckamm
Task-number: QTCREATORBUG-4578
Diffstat (limited to 'src/libs/utils/buildablehelperlibrary.cpp')
-rw-r--r-- | src/libs/utils/buildablehelperlibrary.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/libs/utils/buildablehelperlibrary.cpp b/src/libs/utils/buildablehelperlibrary.cpp index 672e83afc6..24e8f5e90b 100644 --- a/src/libs/utils/buildablehelperlibrary.cpp +++ b/src/libs/utils/buildablehelperlibrary.cpp @@ -297,20 +297,24 @@ bool BuildableHelperLibrary::getHelperFileInfoFor(const QStringList &validBinary QString BuildableHelperLibrary::byInstallDataHelper(const QString &sourcePath, const QStringList &sourceFileNames, const QStringList &installDirectories, - const QStringList &validBinaryFilenames) + const QStringList &validBinaryFilenames, + bool acceptOutdatedHelper) { // find the latest change to the sources QDateTime sourcesModified; - foreach (const QString &sourceFileName, sourceFileNames) { - const QDateTime fileModified = QFileInfo(sourcePath + sourceFileName).lastModified(); - if (fileModified.isValid() && (!sourcesModified.isValid() || fileModified > sourcesModified)) - sourcesModified = fileModified; + if (!acceptOutdatedHelper) { + foreach (const QString &sourceFileName, sourceFileNames) { + const QDateTime fileModified = QFileInfo(sourcePath + sourceFileName).lastModified(); + if (fileModified.isValid() && (!sourcesModified.isValid() || fileModified > sourcesModified)) + sourcesModified = fileModified; + } } // We pretend that the lastmodified of gdbmacros.cpp is 5 minutes before what the file system says // Because afer a installation from the package the modified dates of gdbmacros.cpp // and the actual library are close to each other, but not deterministic in one direction - sourcesModified = sourcesModified.addSecs(-300); + if (sourcesModified.isValid()) + sourcesModified = sourcesModified.addSecs(-300); // look for the newest helper library in the different locations QString newestHelper; @@ -318,7 +322,8 @@ QString BuildableHelperLibrary::byInstallDataHelper(const QString &sourcePath, QFileInfo fileInfo; foreach(const QString &installDirectory, installDirectories) { if (getHelperFileInfoFor(validBinaryFilenames, installDirectory, &fileInfo)) { - if (fileInfo.lastModified() > newestHelperModified) { + if (!newestHelperModified.isValid() + || (fileInfo.lastModified() > newestHelperModified)) { newestHelper = fileInfo.filePath(); newestHelperModified = fileInfo.lastModified(); } |