QtVersionManager: Mark some more qt versions as invalid

Namely versions not having a correct sysroot and where qmake is non
executable. Remove those from reportIssues as they are then already
covered by the isValid() check.

Reviewed-By: hunger
This commit is contained in:
dt
2011-03-11 15:19:25 +01:00
parent 2248990b8a
commit ffc8be6c88
4 changed files with 43 additions and 28 deletions

View File

@@ -44,12 +44,11 @@ using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
QList<ProjectExplorer::Task> QList<ProjectExplorer::Task>
S60ProjectChecker::reportIssues(const QString &proFile, const QtVersion *version) S60ProjectChecker::reportIssues(const QString &proFile)
{ {
QList<ProjectExplorer::Task> results; QList<ProjectExplorer::Task> results;
const QString epocRootDir = version->systemRoot();
QFileInfo cppheader(epocRootDir + QLatin1String("/epoc32/include/stdapis/string.h"));
#if defined (Q_OS_WIN) #if defined (Q_OS_WIN)
const QString epocRootDir = version->systemRoot();
// Report an error if project- and epoc directory are on different drives: // Report an error if project- and epoc directory are on different drives:
if (!epocRootDir.startsWith(proFile.left(3), Qt::CaseInsensitive) && !version->isBuildWithSymbianSbsV2()) { if (!epocRootDir.startsWith(proFile.left(3), Qt::CaseInsensitive) && !version->isBuildWithSymbianSbsV2()) {
results.append(Task(Task::Error, results.append(Task(Task::Error,
@@ -58,19 +57,6 @@ S60ProjectChecker::reportIssues(const QString &proFile, const QtVersion *version
QString(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); QString(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
} }
#endif #endif
// Report an error if EPOC root is not set:
if (epocRootDir.isEmpty() || !QDir(epocRootDir).exists()) {
results.append(Task(Task::Error,
QCoreApplication::translate("ProjectExplorer::Internal::S60ProjectChecker",
"The Symbian SDK was not found for Qt version %1.").arg(version->displayName()),
QString(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
}
if (!cppheader.exists()) {
results.append(Task(Task::Error,
QCoreApplication::translate("ProjectExplorer::Internal::S60ProjectChecker",
"The \"Open C/C++ plugin\" is not installed in the Symbian SDK or the Symbian SDK path is misconfigured for Qt version %1.").arg(version->displayName()),
QString(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
}
// Warn of strange characters in project name and path: // Warn of strange characters in project name and path:
const QString projectName = proFile.mid(proFile.lastIndexOf(QLatin1Char('/')) + 1); const QString projectName = proFile.mid(proFile.lastIndexOf(QLatin1Char('/')) + 1);
@@ -98,8 +84,8 @@ S60ProjectChecker::reportIssues(const QString &proFile, const QtVersion *version
} }
QList<ProjectExplorer::Task> QList<ProjectExplorer::Task>
S60ProjectChecker::reportIssues(const Qt4Project *project, const QtVersion *version) S60ProjectChecker::reportIssues(const Qt4Project *project)
{ {
QString proFile = project->file()->fileName(); QString proFile = project->file()->fileName();
return reportIssues(proFile, version); return reportIssues(proFile);
} }

View File

@@ -50,14 +50,14 @@ public:
/// @return a list of tasks, ordered on severity (errors first, then /// @return a list of tasks, ordered on severity (errors first, then
/// warnings and finally info items. /// warnings and finally info items.
static QList<ProjectExplorer::Task> static QList<ProjectExplorer::Task>
reportIssues(const QString &proFile, const QtVersion *version); reportIssues(const QString &proFile);
/// Check a project/Qt version combination on possible issues with /// Check a project/Qt version combination on possible issues with
/// its symbian setup. /// its symbian setup.
/// @return a list of tasks, ordered on severity (errors first, then /// @return a list of tasks, ordered on severity (errors first, then
/// warnings and finally info items. /// warnings and finally info items.
static QList<ProjectExplorer::Task> static QList<ProjectExplorer::Task>
reportIssues(const Qt4Project *project, const QtVersion *version); reportIssues(const Qt4Project *project);
}; };
} // namespace Internal } // namespace Internal

View File

@@ -612,7 +612,9 @@ QtVersion::QtVersion(const QString &name, const QString &qmakeCommand, int id,
m_defaultConfigIsDebugAndRelease(true), m_defaultConfigIsDebugAndRelease(true),
m_hasExamples(false), m_hasExamples(false),
m_hasDemos(false), m_hasDemos(false),
m_hasDocumentation(false) m_hasDocumentation(false),
m_qmakeIsExecutable(false),
m_validSystemRoot(true)
{ {
if (id == -1) if (id == -1)
m_id = getUniqueId(); m_id = getUniqueId();
@@ -637,7 +639,9 @@ QtVersion::QtVersion(const QString &name, const QString &qmakeCommand,
m_defaultConfigIsDebugAndRelease(true), m_defaultConfigIsDebugAndRelease(true),
m_hasExamples(false), m_hasExamples(false),
m_hasDemos(false), m_hasDemos(false),
m_hasDocumentation(false) m_hasDocumentation(false),
m_qmakeIsExecutable(false),
m_validSystemRoot(true)
{ {
m_id = getUniqueId(); m_id = getUniqueId();
setQMakeCommand(qmakeCommand); setQMakeCommand(qmakeCommand);
@@ -658,7 +662,9 @@ QtVersion::QtVersion(const QString &qmakeCommand, bool isAutodetected, const QSt
m_defaultConfigIsDebugAndRelease(true), m_defaultConfigIsDebugAndRelease(true),
m_hasExamples(false), m_hasExamples(false),
m_hasDemos(false), m_hasDemos(false),
m_hasDocumentation(false) m_hasDocumentation(false),
m_qmakeIsExecutable(false),
m_validSystemRoot(true)
{ {
m_id = getUniqueId(); m_id = getUniqueId();
setQMakeCommand(qmakeCommand); setQMakeCommand(qmakeCommand);
@@ -679,7 +685,9 @@ QtVersion::QtVersion()
m_defaultConfigIsDebugAndRelease(true), m_defaultConfigIsDebugAndRelease(true),
m_hasExamples(false), m_hasExamples(false),
m_hasDemos(false), m_hasDemos(false),
m_hasDocumentation(false) m_hasDocumentation(false) ,
m_qmakeIsExecutable(false),
m_validSystemRoot(true)
{ {
setQMakeCommand(QString()); setQMakeCommand(QString());
} }
@@ -802,7 +810,7 @@ QtVersion::reportIssues(const QString &proFile, const QString &buildDir)
QSet<QString> targets = supportedTargetIds(); QSet<QString> targets = supportedTargetIds();
if (targets.contains(Constants::S60_DEVICE_TARGET_ID) || if (targets.contains(Constants::S60_DEVICE_TARGET_ID) ||
targets.contains(Constants::S60_EMULATOR_TARGET_ID)) targets.contains(Constants::S60_EMULATOR_TARGET_ID))
results.append(S60ProjectChecker::reportIssues(proFile, this)); results.append(S60ProjectChecker::reportIssues(proFile));
return results; return results;
} }
@@ -1153,8 +1161,6 @@ static bool queryQMakeVariables(const QString &binary, QHash<QString, QString> *
{ {
const int timeOutMS = 30000; // Might be slow on some machines. const int timeOutMS = 30000; // Might be slow on some machines.
QFileInfo qmake(binary); QFileInfo qmake(binary);
if (!qmake.exists() || !qmake.isExecutable())
return false;
static const char * const variables[] = { static const char * const variables[] = {
"QT_VERSION", "QT_VERSION",
"QT_INSTALL_DATA", "QT_INSTALL_DATA",
@@ -1217,6 +1223,13 @@ void QtVersion::updateVersionInfo() const
m_hasQmlDump = false; m_hasQmlDump = false;
m_hasQmlDebuggingLibrary = false; m_hasQmlDebuggingLibrary = false;
m_hasQmlObserver = false; m_hasQmlObserver = false;
m_qmakeIsExecutable = true;
QFileInfo fi(qmakeCommand());
if (!fi.exists() || !fi.isExecutable()) {
m_qmakeIsExecutable = false;
return;
}
if (!queryQMakeVariables(qmakeCommand(), &m_versionInfo)) if (!queryQMakeVariables(qmakeCommand(), &m_versionInfo))
return; return;
@@ -1387,6 +1400,7 @@ void QtVersion::updateAbiAndMkspec() const
m_targetIds.clear(); m_targetIds.clear();
m_abis.clear(); m_abis.clear();
m_validSystemRoot = true;
// qDebug()<<"Finding mkspec for"<<qmakeCommand(); // qDebug()<<"Finding mkspec for"<<qmakeCommand();
@@ -1587,8 +1601,15 @@ void QtVersion::updateAbiAndMkspec() const
} }
} else if (supportsTargetId(Constants::S60_DEVICE_TARGET_ID) } else if (supportsTargetId(Constants::S60_DEVICE_TARGET_ID)
|| supportsTargetId(Constants::S60_EMULATOR_TARGET_ID)) { || supportsTargetId(Constants::S60_EMULATOR_TARGET_ID)) {
if (m_systemRoot.isEmpty())
m_validSystemRoot = false;
if (!m_systemRoot.endsWith(QLatin1Char('/'))) if (!m_systemRoot.endsWith(QLatin1Char('/')))
m_systemRoot.append(QLatin1Char('/')); m_systemRoot.append(QLatin1Char('/'));
QFileInfo cppheader(m_systemRoot + QLatin1String("epoc32/include/stdapis/string.h"));
if (!cppheader.exists())
m_validSystemRoot = false;
} else { } else {
m_systemRoot = QLatin1String(""); m_systemRoot = QLatin1String("");
} }
@@ -1759,7 +1780,9 @@ bool QtVersion::isValid() const
&& !m_notInstalled && !m_notInstalled
&& m_versionInfo.contains("QT_INSTALL_BINS") && m_versionInfo.contains("QT_INSTALL_BINS")
&& (!m_mkspecFullPath.isEmpty() || !m_abiUpToDate) && (!m_mkspecFullPath.isEmpty() || !m_abiUpToDate)
&& !m_abis.isEmpty(); && !m_abis.isEmpty()
&& m_qmakeIsExecutable
&& m_validSystemRoot;
} }
bool QtVersion::toolChainAvailable() const bool QtVersion::toolChainAvailable() const
@@ -1778,6 +1801,8 @@ QString QtVersion::invalidReason() const
return QString(); return QString();
if (qmakeCommand().isEmpty()) if (qmakeCommand().isEmpty())
return QCoreApplication::translate("QtVersion", "No qmake path set"); return QCoreApplication::translate("QtVersion", "No qmake path set");
if (!m_qmakeIsExecutable)
return QCoreApplication::translate("QtVersion", "qmake does not exist or is not executable");
if (displayName().isEmpty()) if (displayName().isEmpty())
return QCoreApplication::translate("QtVersion", "Qt version has no name"); return QCoreApplication::translate("QtVersion", "Qt version has no name");
if (m_notInstalled) if (m_notInstalled)
@@ -1789,6 +1814,8 @@ QString QtVersion::invalidReason() const
return QCoreApplication::translate("QtVersion", "The default mkspec symlink is broken."); return QCoreApplication::translate("QtVersion", "The default mkspec symlink is broken.");
if (m_abiUpToDate && m_abis.isEmpty()) if (m_abiUpToDate && m_abis.isEmpty())
return QCoreApplication::translate("QtVersion", "Failed to detect the ABI(s) used by the Qt version."); return QCoreApplication::translate("QtVersion", "Failed to detect the ABI(s) used by the Qt version.");
if (!m_validSystemRoot)
return QCoreApplication::translate("QtVersion", "The \"Open C/C++ plugin\" is not installed in the Symbian SDK or the Symbian SDK path is misconfigured");
return QString(); return QString();
} }

View File

@@ -239,6 +239,8 @@ private:
mutable QSet<QString> m_targetIds; mutable QSet<QString> m_targetIds;
mutable bool m_isBuildUsingSbsV2; mutable bool m_isBuildUsingSbsV2;
mutable bool m_qmakeIsExecutable;
mutable bool m_validSystemRoot;
}; };
struct QMakeAssignment struct QMakeAssignment