aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qtsupport/baseqtversion.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2020-01-15 08:56:11 +0100
committerhjk <hjk@qt.io>2020-01-20 10:11:59 +0000
commit0334b6e491a3688f2455e075595afde87b8f76af (patch)
treecc63a1fae976a46ea6ddc5d2cb956d1d7ac37516 /src/plugins/qtsupport/baseqtversion.cpp
parent7e19d1af7c356dae703e110f9d24b75429ef8fb5 (diff)
ProjectManager: Add convenience Task subclasses
For Compile, BuildSystem and Deployment. Unclutters user code and reduces binary size. Change-Id: Ia18e917bb411754162e9f4ec6056d752a020bb50 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qtsupport/baseqtversion.cpp')
-rw-r--r--src/plugins/qtsupport/baseqtversion.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp
index ce7f56fcc10..5526402dcd3 100644
--- a/src/plugins/qtsupport/baseqtversion.cpp
+++ b/src/plugins/qtsupport/baseqtversion.cpp
@@ -501,12 +501,8 @@ Tasks BaseQtVersion::validateKit(const Kit *k)
const Id dt = DeviceTypeKitAspect::deviceTypeId(k);
const QSet<Id> tdt = targetDeviceTypes();
- if (!tdt.isEmpty() && !tdt.contains(dt)) {
- result << Task(Task::Warning,
- QCoreApplication::translate("BaseQtVersion",
- "Device type is not supported by Qt version."),
- FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
- }
+ if (!tdt.isEmpty() && !tdt.contains(dt))
+ result << BuildSystemTask(Task::Warning, tr("Device type is not supported by Qt version."));
ToolChain *tc = ToolChainKitAspect::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
if (tc) {
@@ -529,21 +525,16 @@ Tasks BaseQtVersion::validateKit(const Kit *k)
QString message;
if (!fullMatch) {
if (!fuzzyMatch)
- message = QCoreApplication::translate("BaseQtVersion",
- "The compiler \"%1\" (%2) cannot produce code for the Qt version \"%3\" (%4).");
+ message = tr("The compiler \"%1\" (%2) cannot produce code for the Qt version \"%3\" (%4).");
else
- message = QCoreApplication::translate("BaseQtVersion",
- "The compiler \"%1\" (%2) may not produce code compatible with the Qt version \"%3\" (%4).");
+ message = tr("The compiler \"%1\" (%2) may not produce code compatible with the Qt version \"%3\" (%4).");
message = message.arg(tc->displayName(), targetAbi.toString(),
version->displayName(), qtAbiString);
- result << Task(fuzzyMatch ? Task::Warning : Task::Error, message, FilePath(), -1,
- ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
+ result << BuildSystemTask(fuzzyMatch ? Task::Warning : Task::Error, message);
}
} else if (ToolChainKitAspect::toolChain(k, ProjectExplorer::Constants::C_LANGUAGE_ID)) {
- const QString message = QCoreApplication::translate("BaseQtVersion",
- "The kit has a Qt version, but no C++ compiler.");
- result << Task(Task::Warning, message, FilePath(), -1,
- ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
+ const QString message = tr("The kit has a Qt version, but no C++ compiler.");
+ result << BuildSystemTask(Task::Warning, message);
}
return result;
}
@@ -1680,8 +1671,7 @@ Tasks BaseQtVersion::reportIssuesImpl(const QString &proFile, const QString &bui
if (!isValid()) {
//: %1: Reason for being invalid
const QString msg = QCoreApplication::translate("QmakeProjectManager::QtVersion", "The Qt version is invalid: %1").arg(invalidReason());
- results.append(Task(Task::Error, msg, FilePath(), -1,
- ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
+ results.append(BuildSystemTask(Task::Error, msg));
}
QFileInfo qmakeInfo = qmakeCommand().toFileInfo();
@@ -1690,8 +1680,7 @@ Tasks BaseQtVersion::reportIssuesImpl(const QString &proFile, const QString &bui
//: %1: Path to qmake executable
const QString msg = QCoreApplication::translate("QmakeProjectManager::QtVersion",
"The qmake command \"%1\" was not found or is not executable.").arg(qmakeCommand().toUserOutput());
- results.append(Task(Task::Error, msg, FilePath(), -1,
- ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
+ results.append(BuildSystemTask(Task::Error, msg));
}
return results;