diff options
Diffstat (limited to 'src/plugins/projectexplorer/task.cpp')
-rw-r--r-- | src/plugins/projectexplorer/task.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/plugins/projectexplorer/task.cpp b/src/plugins/projectexplorer/task.cpp index 136d4db09a..045e461d43 100644 --- a/src/plugins/projectexplorer/task.cpp +++ b/src/plugins/projectexplorer/task.cpp @@ -62,15 +62,20 @@ unsigned int Task::s_nextId = 1; \sa ProjectExplorer::TaskHub */ -Task::Task(TaskType type_, const QString &description_, - const Utils::FilePath &file_, int line_, Core::Id category_, +Task::Task(TaskType type_, const QString &description, + const Utils::FilePath &file_, int line_, Utils::Id category_, const QIcon &icon, Options options) : - taskId(s_nextId), type(type_), options(options), description(description_), + taskId(s_nextId), type(type_), options(options), summary(description), line(line_), movedLine(line_), category(category_), icon(icon.isNull() ? taskTypeIcon(type_) : icon) { ++s_nextId; setFile(file_); + QStringList desc = description.split('\n'); + if (desc.length() > 1) { + summary = desc.first(); + details = desc.mid(1); + } } Task Task::compilerMissingTask() @@ -81,14 +86,6 @@ Task Task::compilerMissingTask() .arg(Core::Constants::IDE_DISPLAY_NAME)); } -Task Task::buildConfigurationMissingTask() -{ - return BuildSystemTask(Task::Error, - tr("%1 needs a build configuration set up to build. " - "Configure a build configuration in the project settings.") - .arg(Core::Constants::IDE_DISPLAY_NAME)); -} - void Task::setMark(TextEditor::TextMark *mark) { QTC_ASSERT(mark, return); @@ -105,11 +102,12 @@ void Task::clear() { taskId = 0; type = Task::Unknown; - description.clear(); + summary.clear(); + details.clear(); file = Utils::FilePath(); line = -1; movedLine = -1; - category = Core::Id(); + category = Utils::Id(); icon = QIcon(); formats.clear(); m_mark.clear(); @@ -127,6 +125,14 @@ void Task::setFile(const Utils::FilePath &file_) } } +QString Task::description() const +{ + QString desc = summary; + if (!details.isEmpty()) + desc.append('\n').append(details.join('\n')); + return desc; +} + // // functions // @@ -181,7 +187,7 @@ QString toHtml(const Tasks &issues) default: break; } - str << "</b>" << t.description << "<br>"; + str << "</b>" << t.description() << "<br>"; } return result; } |