summaryrefslogtreecommitdiff
path: root/src/plugins/qt4projectmanager/qtversionmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qt4projectmanager/qtversionmanager.cpp')
-rw-r--r--src/plugins/qt4projectmanager/qtversionmanager.cpp43
1 files changed, 42 insertions, 1 deletions
diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp
index 02246c7c98..06b9d18ecd 100644
--- a/src/plugins/qt4projectmanager/qtversionmanager.cpp
+++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp
@@ -638,10 +638,14 @@ bool QtVersion::supportsShadowBuilds() const
}
QList<ProjectExplorer::Task>
-QtVersion::reportIssues(const QString &proFile)
+QtVersion::reportIssues(const QString &proFile, const QString &buildDir)
{
QList<ProjectExplorer::Task> results;
+ QString tmpBuildDir = buildDir;
+ if (!buildDir.endsWith(QChar('/')))
+ tmpBuildDir.append(QChar('/'));
+
if (!isValid()) {
//: %1: Reason for being invalid
const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion", "The Qt version is invalid: %1").arg(invalidReason());
@@ -659,6 +663,26 @@ QtVersion::reportIssues(const QString &proFile)
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
}
+ QString sourcePath = QFileInfo(proFile).absolutePath();
+ if (!sourcePath.endsWith(QChar('/')))
+ sourcePath.append(QChar('/'));
+
+ if ((tmpBuildDir.startsWith(sourcePath)) && (tmpBuildDir != sourcePath)) {
+ const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion",
+ "Qmake does not support build directories below the source directory.");
+ results.append(ProjectExplorer::Task(ProjectExplorer::Task::Warning, msg, QString(), -1,
+ QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
+ } else if (tmpBuildDir.count(QChar('/')) != sourcePath.count(QChar('/'))) {
+ // FIXME: We currently are in string freeze, so I have to reuse some existing text!
+ // const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion",
+ // "The build directory needs to be at the same level as the source directory.");
+ const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion",
+ "Qmake does not support build directories below the source directory.");
+
+ results.append(ProjectExplorer::Task(ProjectExplorer::Task::Warning, msg, QString(), -1,
+ QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
+ }
+
QSet<QString> targets = supportedTargetIds();
if (targets.contains(Constants::S60_DEVICE_TARGET_ID) ||
targets.contains(Constants::S60_EMULATOR_TARGET_ID))
@@ -725,6 +749,7 @@ void QtVersion::setQMakeCommand(const QString& qmakeCommand)
#endif
m_designerCommand.clear();
m_linguistCommand.clear();
+ m_qmlviewerCommand.clear();
m_uicCommand.clear();
m_toolChainUpToDate = false;
// TODO do i need to optimize this?
@@ -1178,6 +1203,22 @@ QString QtVersion::linguistCommand() const
return m_linguistCommand;
}
+QString QtVersion::qmlviewerCommand() const
+{
+ if (!isValid())
+ return QString();
+ if (m_qmlviewerCommand.isNull()) {
+#ifdef Q_OS_MAC
+ const QString qmlViewerName = QLatin1String("QMLViewer");
+#else
+ const QString qmlViewerName = QLatin1String("qmlviewer");
+#endif
+
+ m_qmlviewerCommand = findQtBinary(possibleGuiBinaries(qmlViewerName));
+ }
+ return m_qmlviewerCommand;
+}
+
bool QtVersion::supportsTargetId(const QString &id) const
{
updateToolChainAndMkspec();