Commit 98917598 authored by hjk's avatar hjk

ProjectManager: Use Core::Id for progress types

Change-Id: I72993fda50ad70ad2d7c2f449923ac6e34b9e737
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 1f340d44
......@@ -235,10 +235,10 @@ void Manager::initialize()
SLOT(onProjectListChanged()), Qt::QueuedConnection);
// connect to the progress manager for signals about Parsing tasks
connect(ProgressManager::instance(), SIGNAL(taskStarted(QString)),
SLOT(onTaskStarted(QString)), Qt::QueuedConnection);
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(QString)),
SLOT(onAllTasksFinished(QString)), Qt::QueuedConnection);
connect(ProgressManager::instance(), SIGNAL(taskStarted(Core::Id)),
SLOT(onTaskStarted(Core::Id)), Qt::QueuedConnection);
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(Core::Id)),
SLOT(onAllTasksFinished(Core::Id)), Qt::QueuedConnection);
// when we signals that really document is updated - sent it to the parser
connect(this, SIGNAL(requestDocumentUpdated(CPlusPlus::Document::Ptr)),
......@@ -379,9 +379,9 @@ void Manager::onProjectListChanged()
\sa CppTools::Constants::TASK_INDEX
*/
void Manager::onTaskStarted(const QString &type)
void Manager::onTaskStarted(Core::Id type)
{
if (type != QLatin1String(CppTools::Constants::TASK_INDEX))
if (type != CppTools::Constants::TASK_INDEX)
return;
// disable tree updates to speed up
......@@ -395,9 +395,9 @@ void Manager::onTaskStarted(const QString &type)
\sa CppTools::Constants::TASK_INDEX
*/
void Manager::onAllTasksFinished(const QString &type)
void Manager::onAllTasksFinished(Core::Id type)
{
if (type != QLatin1String(CppTools::Constants::TASK_INDEX))
if (type != CppTools::Constants::TASK_INDEX)
return;
// parsing is finished, enable tree updates
......
......@@ -34,6 +34,7 @@
#include <QSharedPointer>
#include <QStandardItem>
#include <coreplugin/id.h>
#include <cplusplus/CppDocument.h>
namespace ClassView {
......@@ -85,19 +86,12 @@ public slots:
protected slots:
void onWidgetIsCreated();
void onWidgetVisibilityIsChanged(bool visibility);
void onStateChanged(bool state);
void onProjectListChanged();
void onDocumentUpdated(CPlusPlus::Document::Ptr doc);
void onTaskStarted(const QString &type);
void onAllTasksFinished(const QString &type);
void onTaskStarted(Core::Id type);
void onAllTasksFinished(Core::Id type);
void onTreeDataUpdate(QSharedPointer<QStandardItem> result);
protected:
......
......@@ -371,8 +371,8 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
m_clearcasePluginInstance = this;
connect(ICore::instance(), SIGNAL(coreAboutToClose()), this, SLOT(closing()));
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(QString)),
this, SLOT(tasksFinished(QString)));
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(Core::Id)),
this, SLOT(tasksFinished(Core::Id)));
if (!MimeDatabase::addMimeTypes(QLatin1String(":/clearcase/ClearCase.mimetypes.xml"), errorMessage))
return false;
......@@ -1891,7 +1891,7 @@ void ClearCasePlugin::projectChanged(Project *project)
m_stream.clear();
m_intStream.clear();
disconnect(ICore::mainWindow(), SIGNAL(windowActivated()), this, SLOT(syncSlot()));
ProgressManager::cancelTasks(QLatin1String(Constants::TASK_INDEX));
ProgressManager::cancelTasks(ClearCase::Constants::TASK_INDEX);
if (project) {
QString projDir = project->projectDirectory();
QString topLevel = findTopLevel(projDir);
......@@ -1908,16 +1908,16 @@ void ClearCasePlugin::projectChanged(Project *project)
qDebug() << "stream: " << m_stream << "; intStream: " << m_intStream << "view: " << m_viewData.name;
}
void ClearCasePlugin::tasksFinished(const QString &type)
void ClearCasePlugin::tasksFinished(Core::Id type)
{
if (type == QLatin1String(Constants::TASK_INDEX))
if (type == ClearCase::Constants::TASK_INDEX)
m_checkInAllAction->setEnabled(true);
}
void ClearCasePlugin::updateIndex()
{
QTC_ASSERT(currentState().hasTopLevel(), return);
ProgressManager::cancelTasks(QLatin1String(Constants::TASK_INDEX));
ProgressManager::cancelTasks(ClearCase::Constants::TASK_INDEX);
Project *project = ProjectExplorerPlugin::currentProject();
if (!project)
return;
......@@ -1926,8 +1926,7 @@ void ClearCasePlugin::updateIndex()
QFuture<void> result = QtConcurrent::run(&sync,
project->files(Project::ExcludeGeneratedFiles));
if (!m_settings.disableIndexer)
ProgressManager::addTask(result, tr("CC Indexing"),
QLatin1String(Constants::TASK_INDEX));
ProgressManager::addTask(result, tr("CC Indexing"), ClearCase::Constants::TASK_INDEX);
}
/*! retrieve a \a file (usually of the form path\to\filename.cpp@@\main\ver)
......@@ -2069,7 +2068,7 @@ void ClearCasePlugin::syncSlot()
void ClearCasePlugin::closing()
{
// prevent syncSlot from being called on shutdown
ProgressManager::cancelTasks(QLatin1String(Constants::TASK_INDEX));
ProgressManager::cancelTasks(ClearCase::Constants::TASK_INDEX);
disconnect(ICore::mainWindow(), SIGNAL(windowActivated()), this, SLOT(syncSlot()));
}
......
......@@ -33,7 +33,9 @@
#include "clearcasesettings.h"
#include <coreplugin/id.h>
#include <vcsbase/vcsbaseplugin.h>
#include <QFile>
#include <QPair>
#include <QStringList>
......@@ -191,7 +193,7 @@ private slots:
void updateIndex();
void updateView();
void projectChanged(ProjectExplorer::Project *project);
void tasksFinished(const QString &type);
void tasksFinished(Core::Id type);
void syncSlot();
void closing();
void updateStatusActions();
......
......@@ -48,9 +48,10 @@
using namespace Core;
using namespace Core::Internal;
CorePlugin::CorePlugin() :
m_mainWindow(new MainWindow), m_editMode(0), m_designMode(0)
CorePlugin::CorePlugin() : m_editMode(0), m_designMode(0)
{
qRegisterMetaType<Core::Id>();
m_mainWindow = new MainWindow;
}
CorePlugin::~CorePlugin()
......
......@@ -118,7 +118,7 @@ MainWindow::MainWindow() :
m_actionManager(new ActionManager(this)),
m_editorManager(0),
m_externalToolManager(0),
m_progressManager(new ProgressManagerPrivate()),
m_progressManager(new ProgressManagerPrivate),
m_variableManager(new VariableManager),
m_vcsManager(new VcsManager),
m_statusBarManager(0),
......
......@@ -66,7 +66,7 @@ public:
QWidget *m_widget;
QHBoxLayout *m_widgetLayout;
QWidget *m_statusBarWidget;
QString m_type;
Id m_type;
FutureProgress::KeepOnFinishType m_keep;
bool m_waitingForUserInteraction;
FutureProgress *m_q;
......@@ -304,12 +304,12 @@ bool FutureProgress::hasError() const
return d->m_progress->hasError();
}
void FutureProgress::setType(const QString &type)
void FutureProgress::setType(Id type)
{
d->m_type = type;
}
QString FutureProgress::type() const
Id FutureProgress::type() const
{
return d->m_type;
}
......
......@@ -31,6 +31,7 @@
#define FUTUREPROGRESS_H
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <QString>
#include <QFuture>
......@@ -60,8 +61,8 @@ public:
void setTitle(const QString &title);
QString title() const;
void setType(const QString &type);
QString type() const;
void setType(Id type);
Id type() const;
void setKeepOnFinish(KeepOnFinishType keepType);
bool keepOnFinish() const;
......
......@@ -245,7 +245,7 @@ using namespace Core::Internal;
*/
/*!
\fn void Core::ProgressManager::cancelTasks(const QString &type)
\fn void Core::ProgressManager::cancelTasks(Core::Id type)
Schedules a cancel for all running tasks of the given \a type.
Please note that the cancel functionality depends on the
......@@ -254,13 +254,13 @@ using namespace Core::Internal;
*/
/*!
\fn void Core::ProgressManager::taskStarted(const QString &type)
\fn void Core::ProgressManager::taskStarted(Core::Id type)
Sent whenever a task of a given \a type is started.
*/
/*!
\fn void Core::ProgressManager::allTasksFinished(const QString &type)
\fn void Core::ProgressManager::allTasksFinished(Core::Id type)
Sent when all tasks of a \a type have finished.
*/
......@@ -347,10 +347,10 @@ void ProgressManagerPrivate::init()
initInternal();
}
void ProgressManagerPrivate::doCancelTasks(const QString &type)
void ProgressManagerPrivate::doCancelTasks(Id type)
{
bool found = false;
QMap<QFutureWatcher<void> *, QString>::iterator task = m_runningTasks.begin();
QMap<QFutureWatcher<void> *, Id>::iterator task = m_runningTasks.begin();
while (task != m_runningTasks.end()) {
if (task.value() != type) {
++task;
......@@ -398,7 +398,7 @@ bool ProgressManagerPrivate::eventFilter(QObject *obj, QEvent *event)
void ProgressManagerPrivate::cancelAllRunningTasks()
{
QMap<QFutureWatcher<void> *, QString>::const_iterator task = m_runningTasks.constBegin();
QMap<QFutureWatcher<void> *, Id>::const_iterator task = m_runningTasks.constBegin();
while (task != m_runningTasks.constEnd()) {
disconnect(task.key(), SIGNAL(finished()), this, SLOT(taskFinished()));
if (m_applicationTask == task.key())
......@@ -412,7 +412,7 @@ void ProgressManagerPrivate::cancelAllRunningTasks()
}
FutureProgress *ProgressManagerPrivate::doAddTask(const QFuture<void> &future, const QString &title,
const QString &type, ProgressFlags flags)
Id type, ProgressFlags flags)
{
// watch
QFutureWatcher<void> *watcher = new QFutureWatcher<void>();
......@@ -473,7 +473,7 @@ void ProgressManagerPrivate::taskFinished()
QFutureWatcher<void> *task = static_cast<QFutureWatcher<void> *>(taskObject);
if (m_applicationTask == task)
disconnectApplicationTask();
QString type = m_runningTasks.value(task);
Id type = m_runningTasks.value(task);
m_runningTasks.remove(task);
delete task;
updateSummaryProgressBar();
......@@ -506,7 +506,7 @@ void ProgressManagerPrivate::updateSummaryProgressBar()
stopFadeOfSummaryProgress();
m_summaryProgressBar->setFinished(false);
QMapIterator<QFutureWatcher<void> *, QString> it(m_runningTasks);
QMapIterator<QFutureWatcher<void> *, Id> it(m_runningTasks);
static const int TASK_RANGE = 100;
int value = 0;
while (it.hasNext()) {
......@@ -563,12 +563,12 @@ void ProgressManagerPrivate::slotRemoveTask()
{
FutureProgress *progress = qobject_cast<FutureProgress *>(sender());
QTC_ASSERT(progress, return);
QString type = progress->type();
Id type = progress->type();
removeTask(progress);
removeOldTasks(type, true);
}
void ProgressManagerPrivate::removeOldTasks(const QString &type, bool keepOne)
void ProgressManagerPrivate::removeOldTasks(const Id type, bool keepOne)
{
bool firstFound = !keepOne; // start with false if we want to keep one
QList<FutureProgress *>::iterator i = m_taskList.end();
......@@ -600,7 +600,7 @@ void ProgressManagerPrivate::removeOneOldTask()
}
// no ended process, look for a task type with multiple running tasks and remove the oldest one
for (QList<FutureProgress *>::iterator i = m_taskList.begin(); i != m_taskList.end(); ++i) {
QString type = (*i)->type();
Id type = (*i)->type();
int taskCount = 0;
foreach (FutureProgress *p, m_taskList)
......@@ -735,7 +735,7 @@ QObject *ProgressManager::instance()
return m_instance;
}
FutureProgress *ProgressManager::addTask(const QFuture<void> &future, const QString &title, const QString &type, ProgressFlags flags)
FutureProgress *ProgressManager::addTask(const QFuture<void> &future, const QString &title, Id type, ProgressFlags flags)
{
return m_instance->doAddTask(future, title, type, flags);
}
......@@ -745,7 +745,8 @@ void ProgressManager::setApplicationLabel(const QString &text)
m_instance->doSetApplicationLabel(text);
}
void ProgressManager::cancelTasks(const QString &type)
void ProgressManager::cancelTasks(const Id type)
{
m_instance->doCancelTasks(type);
if (m_instance)
m_instance->doCancelTasks(type);
}
......@@ -31,6 +31,7 @@
#define PROGRESSMANAGER_H
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <QObject>
#include <QFuture>
......@@ -53,20 +54,20 @@ public:
static QObject *instance();
static FutureProgress *addTask(const QFuture<void> &future, const QString &title,
const QString &type, ProgressFlags flags = 0);
Core::Id type, ProgressFlags flags = 0);
static void setApplicationLabel(const QString &text);
public slots:
static void cancelTasks(const QString &type);
static void cancelTasks(const Core::Id type);
signals:
void taskStarted(const QString &type);
void allTasksFinished(const QString &type);
void taskStarted(Core::Id type);
void allTasksFinished(Core::Id type);
protected:
virtual void doCancelTasks(const QString &type) = 0;
virtual void doCancelTasks(Core::Id type) = 0;
virtual FutureProgress *doAddTask(const QFuture<void> &future, const QString &title,
const QString &type, ProgressFlags flags = 0) = 0;
Core::Id type, ProgressFlags flags = 0) = 0;
virtual void doSetApplicationLabel(const QString &text) = 0;
private:
......
......@@ -58,14 +58,14 @@ public:
void init();
void cleanup();
FutureProgress *doAddTask(const QFuture<void> &future, const QString &title, const QString &type,
FutureProgress *doAddTask(const QFuture<void> &future, const QString &title, Id type,
ProgressFlags flags);
void doSetApplicationLabel(const QString &text);
ProgressView *progressView();
public slots:
void doCancelTasks(const QString &type);
void doCancelTasks(Core::Id type);
protected:
bool eventFilter(QObject *obj, QEvent *event);
......@@ -94,14 +94,14 @@ private:
bool hasError() const;
bool isLastFading() const;
void removeOldTasks(const QString &type, bool keepOne = false);
void removeOldTasks(Id type, bool keepOne = false);
void removeOneOldTask();
void removeTask(FutureProgress *task);
void deleteTask(FutureProgress *task);
QPointer<ProgressView> m_progressView;
QList<FutureProgress *> m_taskList;
QMap<QFutureWatcher<void> *, QString> m_runningTasks;
QMap<QFutureWatcher<void> *, Id> m_runningTasks;
QFutureWatcher<void> *m_applicationTask;
Core::StatusBarWidget *m_statusBarWidgetContainer;
QWidget *m_statusBarWidget;
......
......@@ -281,10 +281,10 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
cmd = ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION);
contextMenu->addAction(cmd);
connect(ProgressManager::instance(), SIGNAL(taskStarted(QString)),
this, SLOT(onTaskStarted(QString)));
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(QString)),
this, SLOT(onAllTasksFinished(QString)));
connect(ProgressManager::instance(), SIGNAL(taskStarted(Core::Id)),
this, SLOT(onTaskStarted(Core::Id)));
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(Core::Id)),
this, SLOT(onAllTasksFinished(Core::Id)));
connect(EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)),
SLOT(currentEditorChanged(Core::IEditor*)));
......@@ -341,9 +341,9 @@ void CppEditorPlugin::findUsages()
editor->findUsages();
}
void CppEditorPlugin::onTaskStarted(const QString &type)
void CppEditorPlugin::onTaskStarted(Core::Id type)
{
if (type == QLatin1String(CppTools::Constants::TASK_INDEX)) {
if (type == CppTools::Constants::TASK_INDEX) {
m_renameSymbolUnderCursorAction->setEnabled(false);
m_findUsagesAction->setEnabled(false);
m_updateCodeModelAction->setEnabled(false);
......@@ -351,9 +351,9 @@ void CppEditorPlugin::onTaskStarted(const QString &type)
}
}
void CppEditorPlugin::onAllTasksFinished(const QString &type)
void CppEditorPlugin::onAllTasksFinished(Core::Id type)
{
if (type == QLatin1String(CppTools::Constants::TASK_INDEX)) {
if (type == CppTools::Constants::TASK_INDEX) {
m_renameSymbolUnderCursorAction->setEnabled(true);
m_findUsagesAction->setEnabled(true);
m_updateCodeModelAction->setEnabled(true);
......
......@@ -85,8 +85,8 @@ public slots:
void setSortedOutline(bool sorted);
private slots:
void onTaskStarted(const QString &type);
void onAllTasksFinished(const QString &type);
void onTaskStarted(Core::Id type);
void onAllTasksFinished(Core::Id type);
void currentEditorChanged(Core::IEditor *editor);
#ifdef WITH_TESTS
......
......@@ -193,7 +193,7 @@ QFuture<void> BuiltinIndexingSupport::refreshSourceFiles(const QStringList &sour
if (mode == CppModelManagerInterface::ForcedProgressNotification || sourceFiles.count() > 1) {
Core::ProgressManager::addTask(result, QCoreApplication::translate("CppTools::Internal::BuiltinIndexingSupport", "Parsing"),
QLatin1String(CppTools::Constants::TASK_INDEX));
CppTools::Constants::TASK_INDEX);
}
return result;
......
......@@ -281,7 +281,7 @@ void CppFindReferences::findAll_helper(Find::SearchResult *search)
createWatcher(result, search);
FutureProgress *progress = ProgressManager::addTask(result, tr("Searching"),
QLatin1String(CppTools::Constants::TASK_SEARCH));
CppTools::Constants::TASK_SEARCH);
connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
}
......@@ -664,7 +664,7 @@ void CppFindReferences::findMacroUses(const Macro &macro, const QString &replace
createWatcher(result, search);
FutureProgress *progress = ProgressManager::addTask(result, tr("Searching"),
QLatin1String(CppTools::Constants::TASK_SEARCH));
CppTools::Constants::TASK_SEARCH);
connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
}
......
......@@ -828,8 +828,7 @@ void CppModelManager::onAboutToLoadSession()
void CppModelManager::onAboutToUnloadSession()
{
if (Core::ProgressManager::instance())
Core::ProgressManager::cancelTasks(QLatin1String(CppTools::Constants::TASK_INDEX));
Core::ProgressManager::cancelTasks(CppTools::Constants::TASK_INDEX);
do {
QMutexLocker locker(&m_projectMutex);
m_projectToProjectsInfo.clear();
......
......@@ -61,10 +61,10 @@ SymbolsFindFilter::SymbolsFindFilter(CppModelManager *manager)
m_scope(SymbolSearcher::SearchProjectsOnly)
{
// for disabling while parser is running
connect(ProgressManager::instance(), SIGNAL(taskStarted(QString)),
this, SLOT(onTaskStarted(QString)));
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(QString)),
this, SLOT(onAllTasksFinished(QString)));
connect(ProgressManager::instance(), SIGNAL(taskStarted(Core::Id)),
this, SLOT(onTaskStarted(Core::Id)));
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(Core::Id)),
this, SLOT(onAllTasksFinished(Core::Id)));
}
QString SymbolsFindFilter::id() const
......@@ -150,7 +150,7 @@ void SymbolsFindFilter::startSearch(Find::SearchResult *search)
symbolSearcher, SLOT(deleteLater()));
watcher->setFuture(QtConcurrent::run(&SymbolSearcher::runSearch, symbolSearcher));
FutureProgress *progress = ProgressManager::addTask(watcher->future(), tr("Searching"),
QLatin1String(Find::Constants::TASK_SEARCH));
Find::Constants::TASK_SEARCH);
connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
}
......@@ -213,17 +213,17 @@ void SymbolsFindFilter::readSettings(QSettings *settings)
emit symbolsToSearchChanged();
}
void SymbolsFindFilter::onTaskStarted(const QString &type)
void SymbolsFindFilter::onTaskStarted(Id type)
{
if (type == QLatin1String(CppTools::Constants::TASK_INDEX)) {
if (type == CppTools::Constants::TASK_INDEX) {
m_enabled = false;
emit enabledChanged(m_enabled);
}
}
void SymbolsFindFilter::onAllTasksFinished(const QString &type)
void SymbolsFindFilter::onAllTasksFinished(Core::Id type)
{
if (type == QLatin1String(CppTools::Constants::TASK_INDEX)) {
if (type == CppTools::Constants::TASK_INDEX) {
m_enabled = true;
emit enabledChanged(m_enabled);
}
......
......@@ -82,8 +82,8 @@ private slots:
void finish();
void cancel();
void setPaused(bool paused);
void onTaskStarted(const QString &type);
void onAllTasksFinished(const QString &type);
void onTaskStarted(Core::Id type);
void onAllTasksFinished(Core::Id type);
void searchAgain();
private:
......
......@@ -489,7 +489,7 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
d->m_progress.setProgressRange(0, 1000);
FutureProgress *fp = ProgressManager::addTask(d->m_progress.future(),
tr("Launching"), _("Debugger.Launcher"));
tr("Launching"), "Debugger.Launcher");
fp->setKeepOnFinish(FutureProgress::HideOnFinish);
d->m_progress.reportStarted();
......
......@@ -323,7 +323,7 @@ QueryContext::~QueryContext()
void QueryContext::start()
{
Core::FutureProgress *fp = Core::ProgressManager::addTask(m_progress.future(), tr("Gerrit"),
QLatin1String("gerrit-query"));
"gerrit-query");
fp->setKeepOnFinish(Core::FutureProgress::HideOnFinish);
m_progress.reportStarted();
startQuery(m_queries.front()); // Order: synchronous call to error handling if something goes wrong.
......
......@@ -168,7 +168,7 @@ void FetchContext::start()
{
m_progress.setProgressRange(0, 2);
FutureProgress *fp = ProgressManager::addTask(m_progress.future(), tr("Gerrit Fetch"),
QLatin1String("gerrit-fetch"));
"gerrit-fetch");
fp->setKeepOnFinish(FutureProgress::HideOnFinish);
m_progress.reportStarted();
// Order: initialize future before starting the process in case error handling is invoked.
......
......@@ -194,8 +194,7 @@ void SearchWidget::indexingStarted()
{
Q_ASSERT(!m_progress);
m_progress = new QFutureInterface<void>();
Core::ProgressManager::addTask(m_progress->future(),
tr("Indexing"), QLatin1String("Help.Indexer"));
Core::ProgressManager::addTask(m_progress->future(), tr("Indexing"), "Help.Indexer");
m_progress->setProgressRange(0, 2);
m_progress->setProgressValueAndText(1, tr("Indexing Documentation..."));
m_progress->reportStarted();
......
......@@ -261,7 +261,7 @@ void LocatorPlugin::refresh(QList<ILocatorFilter *> filters)
filters = m_filters;
QFuture<void> task = QtConcurrent::run(&ILocatorFilter::refresh, filters);
FutureProgress *progress =
ProgressManager::addTask(task, tr("Indexing"), QLatin1String(Locator::Constants::TASK_INDEX));
ProgressManager::addTask(task, tr("Indexing"), Locator::Constants::TASK_INDEX);
connect(progress, SIGNAL(finished()), this, SLOT(saveSettings()));
}
......
......@@ -300,8 +300,7 @@ void BuildManager::startBuildQueue(const QStringList &preambleMessage)
TaskHub::clearTasks(Constants::TASK_CATEGORY_DEPLOYMENT);
ProgressManager::setApplicationLabel(QString());
d->m_futureProgress = ProgressManager::addTask(d->m_progressFutureInterface->future(),
QString(),
QLatin1String(Constants::TASK_BUILD),
QString(), "ProjectExplorer.Task.Build",
ProgressManager::KeepOnFinish | ProgressManager::ShowInApplicationIcon);
connect(d->m_futureProgress.data(), SIGNAL(clicked()), this, SLOT(showBuildResults()));
d->m_futureProgress.data()->setWidget(new Internal::BuildProgress(d->m_taskWindow));
......
......@@ -162,8 +162,6 @@ const char ICON_STOP[] = ":/projectexplorer/images/stop.png";
const char ICON_STOP_SMALL[] = ":/projectexplorer/images/stop_small.png";
const char ICON_WINDOW[] = ":/projectexplorer/images/window.png";
const char TASK_BUILD[] = "ProjectExplorer.Task.Build";
// Mime types
const char C_SOURCE_MIMETYPE[] = "text/x-csrc";
const char C_HEADER_MIMETYPE[] = "text/x-chdr";
......
......@@ -857,7 +857,7 @@ bool SessionManager::loadSession(const QString &session)
m_virginSession = false;
ProgressManager::addTask(m_future.future(), tr("Session"),
QLatin1String("ProjectExplorer.SessionFile.Load"));
"ProjectExplorer.SessionFile.Load");
m_future.setProgressRange(0, 1);
m_future.setProgressValue(0);
......
......@@ -467,8 +467,8 @@ void QbsProject::prepareForParsing()
m_currentProgressBase = 0;
m_qbsUpdateFutureInterface = new QFutureInterface<void>();
m_qbsUpdateFutureInterface->setProgressRange(0, 0);
ProgressManager::addTask(m_qbsUpdateFutureInterface->future(), tr("Evaluating"),
QLatin1String(Constants::QBS_EVALUATE));
ProgressManager::addTask(m_qbsUpdateFutureInterface->future(),
tr("Evaluating"), "Qbs.QbsEvaluate");
m_qbsUpdateFutureInterface->reportStarted();
}
......
......@@ -41,9 +41,6 @@ const char PROJECT_ID[] = "Qbs.QbsProject";
// MIME types:
const char MIME_TYPE[] = "application/x-qt.qbs+qml";
// Progress reports:
const char QBS_EVALUATE[] = "Qbs.QbsEvaluate";
// Actions:
const char ACTION_REPARSE_QBS[] = "Qbs.Reparse";
const char ACTION_REPARSE_QBS_CONTEXT[] = "Qbs.ReparseCtx";
......
......@@ -942,7 +942,7 @@ void FindReferences::displayResults(int first, int last)
FutureProgress *progress = ProgressManager::addTask(
m_watcher.future(), tr("Searching"),
QLatin1String(QmlJSEditor::Constants::TASK_SEARCH));
QmlJSEditor::Constants::TASK_SEARCH);
connect(progress, SIGNAL(clicked()), m_currentSearch, SLOT(popup()));
++first;
......
......@@ -380,8 +380,7 @@ QFuture<void> ModelManager::refreshSourceFiles(const QStringList &sourceFiles,
m_synchronizer.addFuture(result);
if (sourceFiles.count() > 1) {
ProgressManager::addTask(result, tr("Indexing"),
QLatin1String(Constants::TASK_INDEX));
ProgressManager::addTask(