forked from qt-creator/qt-creator
ProjectExplorer: Introduce a alias for QList<Tasks>
Change-Id: I91391ad22b420926b0f512cac23cfe009048b218 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -245,9 +245,9 @@ void CMakeKitAspect::setCMakeTool(Kit *k, const Core::Id id)
|
||||
k->setValue(TOOL_ID, toSet.toSetting());
|
||||
}
|
||||
|
||||
QList<Task> CMakeKitAspect::validate(const Kit *k) const
|
||||
Tasks CMakeKitAspect::validate(const Kit *k) const
|
||||
{
|
||||
QList<Task> result;
|
||||
Tasks result;
|
||||
CMakeTool *tool = CMakeKitAspect::cmakeTool(k);
|
||||
if (tool) {
|
||||
CMakeTool::Version version = tool->version();
|
||||
@@ -650,12 +650,12 @@ QVariant CMakeGeneratorKitAspect::defaultValue(const Kit *k) const
|
||||
return GeneratorInfo({it->name, extraGenerator, QString(), QString()}).toVariant();
|
||||
}
|
||||
|
||||
QList<Task> CMakeGeneratorKitAspect::validate(const Kit *k) const
|
||||
Tasks CMakeGeneratorKitAspect::validate(const Kit *k) const
|
||||
{
|
||||
CMakeTool *tool = CMakeKitAspect::cmakeTool(k);
|
||||
GeneratorInfo info = generatorInfo(k);
|
||||
|
||||
QList<Task> result;
|
||||
Tasks result;
|
||||
if (tool) {
|
||||
if (!tool->isValid()) {
|
||||
result << Task(Task::Warning, tr("CMake Tool is unconfigured, CMake generator will be ignored."),
|
||||
@@ -952,9 +952,9 @@ QVariant CMakeConfigurationKitAspect::defaultValue(const Kit *k) const
|
||||
return tmp;
|
||||
}
|
||||
|
||||
QList<Task> CMakeConfigurationKitAspect::validate(const Kit *k) const
|
||||
Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const
|
||||
{
|
||||
QTC_ASSERT(k, return QList<Task>());
|
||||
QTC_ASSERT(k, return Tasks());
|
||||
|
||||
const QtSupport::BaseQtVersion *const version = QtSupport::QtKitAspect::qtVersion(k);
|
||||
const ToolChain *const tcC = ToolChainKitAspect::toolChain(k, ProjectExplorer::Constants::C_LANGUAGE_ID);
|
||||
@@ -980,7 +980,7 @@ QList<Task> CMakeConfigurationKitAspect::validate(const Kit *k) const
|
||||
qtInstallDirs = CMakeConfigItem::cmakeSplitValue(expandedValue.toString());
|
||||
}
|
||||
|
||||
QList<Task> result;
|
||||
Tasks result;
|
||||
// Validate Qt:
|
||||
if (qmakePath.isEmpty()) {
|
||||
if (version && version->isValid() && isQt4) {
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
static void setCMakeTool(ProjectExplorer::Kit *k, const Core::Id id);
|
||||
|
||||
// KitAspect interface
|
||||
QList<ProjectExplorer::Task> validate(const ProjectExplorer::Kit *k) const final;
|
||||
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final;
|
||||
void setup(ProjectExplorer::Kit *k) final;
|
||||
void fix(ProjectExplorer::Kit *k) final;
|
||||
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
static QStringList generatorArguments(const ProjectExplorer::Kit *k);
|
||||
|
||||
// KitAspect interface
|
||||
QList<ProjectExplorer::Task> validate(const ProjectExplorer::Kit *k) const final;
|
||||
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final;
|
||||
void setup(ProjectExplorer::Kit *k) final;
|
||||
void fix(ProjectExplorer::Kit *k) final;
|
||||
void upgrade(ProjectExplorer::Kit *k) final;
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
static CMakeConfig defaultConfiguration(const ProjectExplorer::Kit *k);
|
||||
|
||||
// KitAspect interface
|
||||
QList<ProjectExplorer::Task> validate(const ProjectExplorer::Kit *k) const final;
|
||||
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final;
|
||||
void setup(ProjectExplorer::Kit *k) final;
|
||||
void fix(ProjectExplorer::Kit *k) final;
|
||||
ItemList toUserOutput(const ProjectExplorer::Kit *k) const final;
|
||||
|
||||
@@ -146,7 +146,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data()
|
||||
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
|
||||
QTest::addColumn<QString>("childStdOutLines");
|
||||
QTest::addColumn<QString>("childStdErrLines");
|
||||
QTest::addColumn<QList<ProjectExplorer::Task> >("tasks");
|
||||
QTest::addColumn<Tasks>("tasks");
|
||||
QTest::addColumn<QString>("outputLines");
|
||||
|
||||
const Core::Id categoryBuild = Constants::TASK_CATEGORY_BUILDSYSTEM;
|
||||
@@ -155,12 +155,12 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data()
|
||||
QTest::newRow("pass-through stdout")
|
||||
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
|
||||
<< QString::fromLatin1("Sometext\n") << QString()
|
||||
<< QList<ProjectExplorer::Task>()
|
||||
<< Tasks()
|
||||
<< QString();
|
||||
QTest::newRow("pass-through stderr")
|
||||
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
|
||||
<< QString() << QString::fromLatin1("Sometext\n")
|
||||
<< QList<ProjectExplorer::Task>()
|
||||
<< Tasks()
|
||||
<< QString();
|
||||
|
||||
// positive tests
|
||||
@@ -177,7 +177,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data()
|
||||
" .hxx .in .txx\n\n")
|
||||
<< OutputParserTester::STDERR
|
||||
<< QString() << QString()
|
||||
<< (QList<ProjectExplorer::Task>()
|
||||
<< (Tasks()
|
||||
<< Task(Task::Error,
|
||||
QLatin1String("Cannot find source file: unknownFile.qml Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx"),
|
||||
Utils::FileName::fromUserInput(QLatin1String("src/1/app/CMakeLists.txt")), 70,
|
||||
@@ -193,7 +193,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data()
|
||||
" add_subdirectory given source \"app1\" which is not an existing directory.\n\n")
|
||||
<< OutputParserTester::STDERR
|
||||
<< QString() << QString()
|
||||
<< (QList<ProjectExplorer::Task>()
|
||||
<< (Tasks()
|
||||
<< Task(Task::Error,
|
||||
QLatin1String("add_subdirectory given source \"app1\" which is not an existing directory."),
|
||||
Utils::FileName::fromUserInput(QLatin1String("src/1/CMakeLists.txt")), 8,
|
||||
@@ -205,7 +205,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data()
|
||||
" Unknown CMake command \"i_am_wrong_command\".\n\n")
|
||||
<< OutputParserTester::STDERR
|
||||
<< QString() << QString()
|
||||
<< (QList<ProjectExplorer::Task>()
|
||||
<< (Tasks()
|
||||
<< Task(Task::Error,
|
||||
QLatin1String("Unknown CMake command \"i_am_wrong_command\"."),
|
||||
Utils::FileName::fromUserInput(QLatin1String("src/1/CMakeLists.txt")), 8,
|
||||
@@ -217,7 +217,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data()
|
||||
" message called with incorrect number of arguments\n\n")
|
||||
<< OutputParserTester::STDERR
|
||||
<< QString() << QString()
|
||||
<< (QList<ProjectExplorer::Task>()
|
||||
<< (Tasks()
|
||||
<< Task(Task::Error,
|
||||
QLatin1String("message called with incorrect number of arguments"),
|
||||
Utils::FileName::fromUserInput(QLatin1String("src/1/CMakeLists.txt")), 8,
|
||||
@@ -231,7 +231,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data()
|
||||
"\".")
|
||||
<< OutputParserTester::STDERR
|
||||
<< QString() << QString()
|
||||
<< (QList<ProjectExplorer::Task>()
|
||||
<< (Tasks()
|
||||
<< Task(Task::Error,
|
||||
QLatin1String("Parse error. Expected \"(\", got newline with text \"\n\"."),
|
||||
Utils::FileName::fromUserInput(QLatin1String("/test/path/CMakeLists.txt")), 9,
|
||||
@@ -244,7 +244,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data()
|
||||
"CMAKE_MAKE_PROGRAM\n")
|
||||
<< OutputParserTester::STDERR
|
||||
<< QString() << QString::fromLatin1("Missing variable is:\nCMAKE_MAKE_PROGRAM\n")
|
||||
<< (QList<ProjectExplorer::Task>()
|
||||
<< (Tasks()
|
||||
<< Task(Task::Error,
|
||||
QLatin1String("Error required internal CMake variable not set, cmake may be not be built correctly."),
|
||||
Utils::FileName(), -1, categoryBuild))
|
||||
@@ -257,7 +257,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data()
|
||||
" \".\n")
|
||||
<< OutputParserTester::STDERR
|
||||
<< QString() << QString()
|
||||
<< (QList<ProjectExplorer::Task>()
|
||||
<< (Tasks()
|
||||
<< Task(Task::Error,
|
||||
QLatin1String("Parse error. Expected \"(\", got newline with text \" \"."),
|
||||
Utils::FileName::fromUserInput(QLatin1String("CMakeLists.txt")), 4,
|
||||
@@ -270,7 +270,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data()
|
||||
"Argument not separated from preceding token by whitespace.")
|
||||
<< OutputParserTester::STDERR
|
||||
<< QString() << QString()
|
||||
<< (QList<ProjectExplorer::Task>()
|
||||
<< (Tasks()
|
||||
<< Task(Task::Warning,
|
||||
QLatin1String("Argument not separated from preceding token by whitespace."),
|
||||
Utils::FileName::fromUserInput(QLatin1String("/test/path/CMakeLists.txt")), 9,
|
||||
@@ -284,7 +284,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser()
|
||||
testbench.appendOutputParser(new CMakeParser);
|
||||
QFETCH(QString, input);
|
||||
QFETCH(OutputParserTester::Channel, inputChannel);
|
||||
QFETCH(QList<Task>, tasks);
|
||||
QFETCH(Tasks, tasks);
|
||||
QFETCH(QString, childStdOutLines);
|
||||
QFETCH(QString, childStdErrLines);
|
||||
QFETCH(QString, outputLines);
|
||||
|
||||
@@ -402,9 +402,9 @@ bool CMakeProject::knowsAllBuildExecutables() const
|
||||
return false;
|
||||
}
|
||||
|
||||
QList<Task> CMakeProject::projectIssues(const Kit *k) const
|
||||
Tasks CMakeProject::projectIssues(const Kit *k) const
|
||||
{
|
||||
QList<Task> result = Project::projectIssues(k);
|
||||
Tasks result = Project::projectIssues(k);
|
||||
|
||||
if (!CMakeKitAspect::cmakeTool(k))
|
||||
result.append(createProjectTask(Task::TaskType::Error, tr("No cmake tool set.")));
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
|
||||
bool knowsAllBuildExecutables() const final;
|
||||
|
||||
QList<ProjectExplorer::Task> projectIssues(const ProjectExplorer::Kit *k) const final;
|
||||
ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final;
|
||||
|
||||
void runCMake();
|
||||
void runCMakeAndScanProjectTree();
|
||||
|
||||
Reference in New Issue
Block a user