From: Tobias Hunger Date: Wed, 2 Mar 2011 11:25:22 +0000 (+0100) Subject: Also detect QtCore when located next to qmake X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=586d1440bec39f7d88b6720f4999adc450d97687;p=qt-creator-jp%2Fqt-creator-jp.git Also detect QtCore when located next to qmake --- diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 61c23a73be..06b7e14483 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -1587,23 +1587,27 @@ QString QtVersion::resolveLink(const QString &path) const QString QtVersion::qtCorePath() const { - QDir libDir(libraryInstallPath()); - QFileInfoList infoList = libDir.entryInfoList(); - foreach (const QFileInfo &info, infoList) { - const QString file = info.fileName(); - if (info.isDir() - && file.startsWith(QLatin1String("QtCore")) - && file.endsWith(QLatin1String(".framework"))) { - // handle Framework - const QString libName = file.left(file.lastIndexOf('.')); - return libDir.absoluteFilePath(file + '/' + libName); - } - if (info.isReadable() - && (file.startsWith(QLatin1String("libQtCore")) - || file.startsWith(QLatin1String("QtCore"))) - && (file.endsWith(QLatin1String(".dll")) - || file.endsWith(QString::fromLatin1(".so.") + qtVersionString()))) { - return info.absoluteFilePath(); + QList dirs; + dirs << QDir(libraryInstallPath()) << QDir(versionInfo().value(QLatin1String("QT_INSTALL_BINS"))); + foreach (const QDir &d, dirs) { + QFileInfoList infoList = d.entryInfoList(); + foreach (const QFileInfo &info, infoList) { + const QString file = info.fileName(); + if (info.isDir() + && file.startsWith(QLatin1String("QtCore")) + && file.endsWith(QLatin1String(".framework"))) { + // handle Framework + const QString libName = file.left(file.lastIndexOf('.')); + return info.absoluteFilePath() + '/' + libName; + } + if (info.isReadable() + && (file.startsWith(QLatin1String("libQtCore")) + || file.startsWith(QLatin1String("QtCore"))) + && (file.endsWith(QLatin1String(".dll")) + || file.endsWith(QString::fromLatin1(".so.") + qtVersionString()) + || file.endsWith(".la"))) { + return info.absoluteFilePath(); + } } } return QString();