ProjectManager: Use Core::Id for progress types

Change-Id: I72993fda50ad70ad2d7c2f449923ac6e34b9e737
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
hjk
2013-09-03 15:18:37 +02:00
parent 1f340d44f7
commit 98917598d3
44 changed files with 121 additions and 133 deletions

View File

@@ -235,10 +235,10 @@ void Manager::initialize()
SLOT(onProjectListChanged()), Qt::QueuedConnection); SLOT(onProjectListChanged()), Qt::QueuedConnection);
// connect to the progress manager for signals about Parsing tasks // connect to the progress manager for signals about Parsing tasks
connect(ProgressManager::instance(), SIGNAL(taskStarted(QString)), connect(ProgressManager::instance(), SIGNAL(taskStarted(Core::Id)),
SLOT(onTaskStarted(QString)), Qt::QueuedConnection); SLOT(onTaskStarted(Core::Id)), Qt::QueuedConnection);
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(QString)), connect(ProgressManager::instance(), SIGNAL(allTasksFinished(Core::Id)),
SLOT(onAllTasksFinished(QString)), Qt::QueuedConnection); SLOT(onAllTasksFinished(Core::Id)), Qt::QueuedConnection);
// when we signals that really document is updated - sent it to the parser // when we signals that really document is updated - sent it to the parser
connect(this, SIGNAL(requestDocumentUpdated(CPlusPlus::Document::Ptr)), connect(this, SIGNAL(requestDocumentUpdated(CPlusPlus::Document::Ptr)),
@@ -379,9 +379,9 @@ void Manager::onProjectListChanged()
\sa CppTools::Constants::TASK_INDEX \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; return;
// disable tree updates to speed up // disable tree updates to speed up
@@ -395,9 +395,9 @@ void Manager::onTaskStarted(const QString &type)
\sa CppTools::Constants::TASK_INDEX \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; return;
// parsing is finished, enable tree updates // parsing is finished, enable tree updates

View File

@@ -34,6 +34,7 @@
#include <QSharedPointer> #include <QSharedPointer>
#include <QStandardItem> #include <QStandardItem>
#include <coreplugin/id.h>
#include <cplusplus/CppDocument.h> #include <cplusplus/CppDocument.h>
namespace ClassView { namespace ClassView {
@@ -85,19 +86,12 @@ public slots:
protected slots: protected slots:
void onWidgetIsCreated(); void onWidgetIsCreated();
void onWidgetVisibilityIsChanged(bool visibility); void onWidgetVisibilityIsChanged(bool visibility);
void onStateChanged(bool state); void onStateChanged(bool state);
void onProjectListChanged(); void onProjectListChanged();
void onDocumentUpdated(CPlusPlus::Document::Ptr doc); void onDocumentUpdated(CPlusPlus::Document::Ptr doc);
void onTaskStarted(Core::Id type);
void onTaskStarted(const QString &type); void onAllTasksFinished(Core::Id type);
void onAllTasksFinished(const QString &type);
void onTreeDataUpdate(QSharedPointer<QStandardItem> result); void onTreeDataUpdate(QSharedPointer<QStandardItem> result);
protected: protected:

View File

@@ -371,8 +371,8 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
m_clearcasePluginInstance = this; m_clearcasePluginInstance = this;
connect(ICore::instance(), SIGNAL(coreAboutToClose()), this, SLOT(closing())); connect(ICore::instance(), SIGNAL(coreAboutToClose()), this, SLOT(closing()));
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(QString)), connect(ProgressManager::instance(), SIGNAL(allTasksFinished(Core::Id)),
this, SLOT(tasksFinished(QString))); this, SLOT(tasksFinished(Core::Id)));
if (!MimeDatabase::addMimeTypes(QLatin1String(":/clearcase/ClearCase.mimetypes.xml"), errorMessage)) if (!MimeDatabase::addMimeTypes(QLatin1String(":/clearcase/ClearCase.mimetypes.xml"), errorMessage))
return false; return false;
@@ -1891,7 +1891,7 @@ void ClearCasePlugin::projectChanged(Project *project)
m_stream.clear(); m_stream.clear();
m_intStream.clear(); m_intStream.clear();
disconnect(ICore::mainWindow(), SIGNAL(windowActivated()), this, SLOT(syncSlot())); disconnect(ICore::mainWindow(), SIGNAL(windowActivated()), this, SLOT(syncSlot()));
ProgressManager::cancelTasks(QLatin1String(Constants::TASK_INDEX)); ProgressManager::cancelTasks(ClearCase::Constants::TASK_INDEX);
if (project) { if (project) {
QString projDir = project->projectDirectory(); QString projDir = project->projectDirectory();
QString topLevel = findTopLevel(projDir); QString topLevel = findTopLevel(projDir);
@@ -1908,16 +1908,16 @@ void ClearCasePlugin::projectChanged(Project *project)
qDebug() << "stream: " << m_stream << "; intStream: " << m_intStream << "view: " << m_viewData.name; 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); m_checkInAllAction->setEnabled(true);
} }
void ClearCasePlugin::updateIndex() void ClearCasePlugin::updateIndex()
{ {
QTC_ASSERT(currentState().hasTopLevel(), return); QTC_ASSERT(currentState().hasTopLevel(), return);
ProgressManager::cancelTasks(QLatin1String(Constants::TASK_INDEX)); ProgressManager::cancelTasks(ClearCase::Constants::TASK_INDEX);
Project *project = ProjectExplorerPlugin::currentProject(); Project *project = ProjectExplorerPlugin::currentProject();
if (!project) if (!project)
return; return;
@@ -1926,8 +1926,7 @@ void ClearCasePlugin::updateIndex()
QFuture<void> result = QtConcurrent::run(&sync, QFuture<void> result = QtConcurrent::run(&sync,
project->files(Project::ExcludeGeneratedFiles)); project->files(Project::ExcludeGeneratedFiles));
if (!m_settings.disableIndexer) if (!m_settings.disableIndexer)
ProgressManager::addTask(result, tr("CC Indexing"), ProgressManager::addTask(result, tr("CC Indexing"), ClearCase::Constants::TASK_INDEX);
QLatin1String(Constants::TASK_INDEX));
} }
/*! retrieve a \a file (usually of the form path\to\filename.cpp@@\main\ver) /*! retrieve a \a file (usually of the form path\to\filename.cpp@@\main\ver)
@@ -2069,7 +2068,7 @@ void ClearCasePlugin::syncSlot()
void ClearCasePlugin::closing() void ClearCasePlugin::closing()
{ {
// prevent syncSlot from being called on shutdown // 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())); disconnect(ICore::mainWindow(), SIGNAL(windowActivated()), this, SLOT(syncSlot()));
} }

View File

@@ -33,7 +33,9 @@
#include "clearcasesettings.h" #include "clearcasesettings.h"
#include <coreplugin/id.h>
#include <vcsbase/vcsbaseplugin.h> #include <vcsbase/vcsbaseplugin.h>
#include <QFile> #include <QFile>
#include <QPair> #include <QPair>
#include <QStringList> #include <QStringList>
@@ -191,7 +193,7 @@ private slots:
void updateIndex(); void updateIndex();
void updateView(); void updateView();
void projectChanged(ProjectExplorer::Project *project); void projectChanged(ProjectExplorer::Project *project);
void tasksFinished(const QString &type); void tasksFinished(Core::Id type);
void syncSlot(); void syncSlot();
void closing(); void closing();
void updateStatusActions(); void updateStatusActions();

View File

@@ -48,9 +48,10 @@
using namespace Core; using namespace Core;
using namespace Core::Internal; using namespace Core::Internal;
CorePlugin::CorePlugin() : CorePlugin::CorePlugin() : m_editMode(0), m_designMode(0)
m_mainWindow(new MainWindow), m_editMode(0), m_designMode(0)
{ {
qRegisterMetaType<Core::Id>();
m_mainWindow = new MainWindow;
} }
CorePlugin::~CorePlugin() CorePlugin::~CorePlugin()

View File

@@ -118,7 +118,7 @@ MainWindow::MainWindow() :
m_actionManager(new ActionManager(this)), m_actionManager(new ActionManager(this)),
m_editorManager(0), m_editorManager(0),
m_externalToolManager(0), m_externalToolManager(0),
m_progressManager(new ProgressManagerPrivate()), m_progressManager(new ProgressManagerPrivate),
m_variableManager(new VariableManager), m_variableManager(new VariableManager),
m_vcsManager(new VcsManager), m_vcsManager(new VcsManager),
m_statusBarManager(0), m_statusBarManager(0),

View File

@@ -66,7 +66,7 @@ public:
QWidget *m_widget; QWidget *m_widget;
QHBoxLayout *m_widgetLayout; QHBoxLayout *m_widgetLayout;
QWidget *m_statusBarWidget; QWidget *m_statusBarWidget;
QString m_type; Id m_type;
FutureProgress::KeepOnFinishType m_keep; FutureProgress::KeepOnFinishType m_keep;
bool m_waitingForUserInteraction; bool m_waitingForUserInteraction;
FutureProgress *m_q; FutureProgress *m_q;
@@ -304,12 +304,12 @@ bool FutureProgress::hasError() const
return d->m_progress->hasError(); return d->m_progress->hasError();
} }
void FutureProgress::setType(const QString &type) void FutureProgress::setType(Id type)
{ {
d->m_type = type; d->m_type = type;
} }
QString FutureProgress::type() const Id FutureProgress::type() const
{ {
return d->m_type; return d->m_type;
} }

View File

@@ -31,6 +31,7 @@
#define FUTUREPROGRESS_H #define FUTUREPROGRESS_H
#include <coreplugin/core_global.h> #include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <QString> #include <QString>
#include <QFuture> #include <QFuture>
@@ -60,8 +61,8 @@ public:
void setTitle(const QString &title); void setTitle(const QString &title);
QString title() const; QString title() const;
void setType(const QString &type); void setType(Id type);
QString type() const; Id type() const;
void setKeepOnFinish(KeepOnFinishType keepType); void setKeepOnFinish(KeepOnFinishType keepType);
bool keepOnFinish() const; bool keepOnFinish() const;

View File

@@ -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. Schedules a cancel for all running tasks of the given \a type.
Please note that the cancel functionality depends on the 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. 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. Sent when all tasks of a \a type have finished.
*/ */
@@ -347,10 +347,10 @@ void ProgressManagerPrivate::init()
initInternal(); initInternal();
} }
void ProgressManagerPrivate::doCancelTasks(const QString &type) void ProgressManagerPrivate::doCancelTasks(Id type)
{ {
bool found = false; 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()) { while (task != m_runningTasks.end()) {
if (task.value() != type) { if (task.value() != type) {
++task; ++task;
@@ -398,7 +398,7 @@ bool ProgressManagerPrivate::eventFilter(QObject *obj, QEvent *event)
void ProgressManagerPrivate::cancelAllRunningTasks() 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()) { while (task != m_runningTasks.constEnd()) {
disconnect(task.key(), SIGNAL(finished()), this, SLOT(taskFinished())); disconnect(task.key(), SIGNAL(finished()), this, SLOT(taskFinished()));
if (m_applicationTask == task.key()) if (m_applicationTask == task.key())
@@ -412,7 +412,7 @@ void ProgressManagerPrivate::cancelAllRunningTasks()
} }
FutureProgress *ProgressManagerPrivate::doAddTask(const QFuture<void> &future, const QString &title, FutureProgress *ProgressManagerPrivate::doAddTask(const QFuture<void> &future, const QString &title,
const QString &type, ProgressFlags flags) Id type, ProgressFlags flags)
{ {
// watch // watch
QFutureWatcher<void> *watcher = new QFutureWatcher<void>(); QFutureWatcher<void> *watcher = new QFutureWatcher<void>();
@@ -473,7 +473,7 @@ void ProgressManagerPrivate::taskFinished()
QFutureWatcher<void> *task = static_cast<QFutureWatcher<void> *>(taskObject); QFutureWatcher<void> *task = static_cast<QFutureWatcher<void> *>(taskObject);
if (m_applicationTask == task) if (m_applicationTask == task)
disconnectApplicationTask(); disconnectApplicationTask();
QString type = m_runningTasks.value(task); Id type = m_runningTasks.value(task);
m_runningTasks.remove(task); m_runningTasks.remove(task);
delete task; delete task;
updateSummaryProgressBar(); updateSummaryProgressBar();
@@ -506,7 +506,7 @@ void ProgressManagerPrivate::updateSummaryProgressBar()
stopFadeOfSummaryProgress(); stopFadeOfSummaryProgress();
m_summaryProgressBar->setFinished(false); m_summaryProgressBar->setFinished(false);
QMapIterator<QFutureWatcher<void> *, QString> it(m_runningTasks); QMapIterator<QFutureWatcher<void> *, Id> it(m_runningTasks);
static const int TASK_RANGE = 100; static const int TASK_RANGE = 100;
int value = 0; int value = 0;
while (it.hasNext()) { while (it.hasNext()) {
@@ -563,12 +563,12 @@ void ProgressManagerPrivate::slotRemoveTask()
{ {
FutureProgress *progress = qobject_cast<FutureProgress *>(sender()); FutureProgress *progress = qobject_cast<FutureProgress *>(sender());
QTC_ASSERT(progress, return); QTC_ASSERT(progress, return);
QString type = progress->type(); Id type = progress->type();
removeTask(progress); removeTask(progress);
removeOldTasks(type, true); 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 bool firstFound = !keepOne; // start with false if we want to keep one
QList<FutureProgress *>::iterator i = m_taskList.end(); 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 // 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) { for (QList<FutureProgress *>::iterator i = m_taskList.begin(); i != m_taskList.end(); ++i) {
QString type = (*i)->type(); Id type = (*i)->type();
int taskCount = 0; int taskCount = 0;
foreach (FutureProgress *p, m_taskList) foreach (FutureProgress *p, m_taskList)
@@ -735,7 +735,7 @@ QObject *ProgressManager::instance()
return m_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); return m_instance->doAddTask(future, title, type, flags);
} }
@@ -745,7 +745,8 @@ void ProgressManager::setApplicationLabel(const QString &text)
m_instance->doSetApplicationLabel(text); m_instance->doSetApplicationLabel(text);
} }
void ProgressManager::cancelTasks(const QString &type) void ProgressManager::cancelTasks(const Id type)
{ {
if (m_instance)
m_instance->doCancelTasks(type); m_instance->doCancelTasks(type);
} }

View File

@@ -31,6 +31,7 @@
#define PROGRESSMANAGER_H #define PROGRESSMANAGER_H
#include <coreplugin/core_global.h> #include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <QObject> #include <QObject>
#include <QFuture> #include <QFuture>
@@ -53,20 +54,20 @@ public:
static QObject *instance(); static QObject *instance();
static FutureProgress *addTask(const QFuture<void> &future, const QString &title, 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); static void setApplicationLabel(const QString &text);
public slots: public slots:
static void cancelTasks(const QString &type); static void cancelTasks(const Core::Id type);
signals: signals:
void taskStarted(const QString &type); void taskStarted(Core::Id type);
void allTasksFinished(const QString &type); void allTasksFinished(Core::Id type);
protected: 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, 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; virtual void doSetApplicationLabel(const QString &text) = 0;
private: private:

View File

@@ -58,14 +58,14 @@ public:
void init(); void init();
void cleanup(); 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); ProgressFlags flags);
void doSetApplicationLabel(const QString &text); void doSetApplicationLabel(const QString &text);
ProgressView *progressView(); ProgressView *progressView();
public slots: public slots:
void doCancelTasks(const QString &type); void doCancelTasks(Core::Id type);
protected: protected:
bool eventFilter(QObject *obj, QEvent *event); bool eventFilter(QObject *obj, QEvent *event);
@@ -94,14 +94,14 @@ private:
bool hasError() const; bool hasError() const;
bool isLastFading() const; bool isLastFading() const;
void removeOldTasks(const QString &type, bool keepOne = false); void removeOldTasks(Id type, bool keepOne = false);
void removeOneOldTask(); void removeOneOldTask();
void removeTask(FutureProgress *task); void removeTask(FutureProgress *task);
void deleteTask(FutureProgress *task); void deleteTask(FutureProgress *task);
QPointer<ProgressView> m_progressView; QPointer<ProgressView> m_progressView;
QList<FutureProgress *> m_taskList; QList<FutureProgress *> m_taskList;
QMap<QFutureWatcher<void> *, QString> m_runningTasks; QMap<QFutureWatcher<void> *, Id> m_runningTasks;
QFutureWatcher<void> *m_applicationTask; QFutureWatcher<void> *m_applicationTask;
Core::StatusBarWidget *m_statusBarWidgetContainer; Core::StatusBarWidget *m_statusBarWidgetContainer;
QWidget *m_statusBarWidget; QWidget *m_statusBarWidget;

View File

@@ -281,10 +281,10 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
cmd = ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION); cmd = ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION);
contextMenu->addAction(cmd); contextMenu->addAction(cmd);
connect(ProgressManager::instance(), SIGNAL(taskStarted(QString)), connect(ProgressManager::instance(), SIGNAL(taskStarted(Core::Id)),
this, SLOT(onTaskStarted(QString))); this, SLOT(onTaskStarted(Core::Id)));
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(QString)), connect(ProgressManager::instance(), SIGNAL(allTasksFinished(Core::Id)),
this, SLOT(onAllTasksFinished(QString))); this, SLOT(onAllTasksFinished(Core::Id)));
connect(EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), connect(EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)),
SLOT(currentEditorChanged(Core::IEditor*))); SLOT(currentEditorChanged(Core::IEditor*)));
@@ -341,9 +341,9 @@ void CppEditorPlugin::findUsages()
editor->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_renameSymbolUnderCursorAction->setEnabled(false);
m_findUsagesAction->setEnabled(false); m_findUsagesAction->setEnabled(false);
m_updateCodeModelAction->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_renameSymbolUnderCursorAction->setEnabled(true);
m_findUsagesAction->setEnabled(true); m_findUsagesAction->setEnabled(true);
m_updateCodeModelAction->setEnabled(true); m_updateCodeModelAction->setEnabled(true);

View File

@@ -85,8 +85,8 @@ public slots:
void setSortedOutline(bool sorted); void setSortedOutline(bool sorted);
private slots: private slots:
void onTaskStarted(const QString &type); void onTaskStarted(Core::Id type);
void onAllTasksFinished(const QString &type); void onAllTasksFinished(Core::Id type);
void currentEditorChanged(Core::IEditor *editor); void currentEditorChanged(Core::IEditor *editor);
#ifdef WITH_TESTS #ifdef WITH_TESTS

View File

@@ -193,7 +193,7 @@ QFuture<void> BuiltinIndexingSupport::refreshSourceFiles(const QStringList &sour
if (mode == CppModelManagerInterface::ForcedProgressNotification || sourceFiles.count() > 1) { if (mode == CppModelManagerInterface::ForcedProgressNotification || sourceFiles.count() > 1) {
Core::ProgressManager::addTask(result, QCoreApplication::translate("CppTools::Internal::BuiltinIndexingSupport", "Parsing"), Core::ProgressManager::addTask(result, QCoreApplication::translate("CppTools::Internal::BuiltinIndexingSupport", "Parsing"),
QLatin1String(CppTools::Constants::TASK_INDEX)); CppTools::Constants::TASK_INDEX);
} }
return result; return result;

View File

@@ -281,7 +281,7 @@ void CppFindReferences::findAll_helper(Find::SearchResult *search)
createWatcher(result, search); createWatcher(result, search);
FutureProgress *progress = ProgressManager::addTask(result, tr("Searching"), FutureProgress *progress = ProgressManager::addTask(result, tr("Searching"),
QLatin1String(CppTools::Constants::TASK_SEARCH)); CppTools::Constants::TASK_SEARCH);
connect(progress, SIGNAL(clicked()), search, SLOT(popup())); connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
} }
@@ -664,7 +664,7 @@ void CppFindReferences::findMacroUses(const Macro &macro, const QString &replace
createWatcher(result, search); createWatcher(result, search);
FutureProgress *progress = ProgressManager::addTask(result, tr("Searching"), FutureProgress *progress = ProgressManager::addTask(result, tr("Searching"),
QLatin1String(CppTools::Constants::TASK_SEARCH)); CppTools::Constants::TASK_SEARCH);
connect(progress, SIGNAL(clicked()), search, SLOT(popup())); connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
} }

View File

@@ -828,8 +828,7 @@ void CppModelManager::onAboutToLoadSession()
void CppModelManager::onAboutToUnloadSession() void CppModelManager::onAboutToUnloadSession()
{ {
if (Core::ProgressManager::instance()) Core::ProgressManager::cancelTasks(CppTools::Constants::TASK_INDEX);
Core::ProgressManager::cancelTasks(QLatin1String(CppTools::Constants::TASK_INDEX));
do { do {
QMutexLocker locker(&m_projectMutex); QMutexLocker locker(&m_projectMutex);
m_projectToProjectsInfo.clear(); m_projectToProjectsInfo.clear();

View File

@@ -61,10 +61,10 @@ SymbolsFindFilter::SymbolsFindFilter(CppModelManager *manager)
m_scope(SymbolSearcher::SearchProjectsOnly) m_scope(SymbolSearcher::SearchProjectsOnly)
{ {
// for disabling while parser is running // for disabling while parser is running
connect(ProgressManager::instance(), SIGNAL(taskStarted(QString)), connect(ProgressManager::instance(), SIGNAL(taskStarted(Core::Id)),
this, SLOT(onTaskStarted(QString))); this, SLOT(onTaskStarted(Core::Id)));
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(QString)), connect(ProgressManager::instance(), SIGNAL(allTasksFinished(Core::Id)),
this, SLOT(onAllTasksFinished(QString))); this, SLOT(onAllTasksFinished(Core::Id)));
} }
QString SymbolsFindFilter::id() const QString SymbolsFindFilter::id() const
@@ -150,7 +150,7 @@ void SymbolsFindFilter::startSearch(Find::SearchResult *search)
symbolSearcher, SLOT(deleteLater())); symbolSearcher, SLOT(deleteLater()));
watcher->setFuture(QtConcurrent::run(&SymbolSearcher::runSearch, symbolSearcher)); watcher->setFuture(QtConcurrent::run(&SymbolSearcher::runSearch, symbolSearcher));
FutureProgress *progress = ProgressManager::addTask(watcher->future(), tr("Searching"), FutureProgress *progress = ProgressManager::addTask(watcher->future(), tr("Searching"),
QLatin1String(Find::Constants::TASK_SEARCH)); Find::Constants::TASK_SEARCH);
connect(progress, SIGNAL(clicked()), search, SLOT(popup())); connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
} }
@@ -213,17 +213,17 @@ void SymbolsFindFilter::readSettings(QSettings *settings)
emit symbolsToSearchChanged(); 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; m_enabled = false;
emit enabledChanged(m_enabled); 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; m_enabled = true;
emit enabledChanged(m_enabled); emit enabledChanged(m_enabled);
} }

View File

@@ -82,8 +82,8 @@ private slots:
void finish(); void finish();
void cancel(); void cancel();
void setPaused(bool paused); void setPaused(bool paused);
void onTaskStarted(const QString &type); void onTaskStarted(Core::Id type);
void onAllTasksFinished(const QString &type); void onAllTasksFinished(Core::Id type);
void searchAgain(); void searchAgain();
private: private:

View File

@@ -489,7 +489,7 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
d->m_progress.setProgressRange(0, 1000); d->m_progress.setProgressRange(0, 1000);
FutureProgress *fp = ProgressManager::addTask(d->m_progress.future(), FutureProgress *fp = ProgressManager::addTask(d->m_progress.future(),
tr("Launching"), _("Debugger.Launcher")); tr("Launching"), "Debugger.Launcher");
fp->setKeepOnFinish(FutureProgress::HideOnFinish); fp->setKeepOnFinish(FutureProgress::HideOnFinish);
d->m_progress.reportStarted(); d->m_progress.reportStarted();

View File

@@ -323,7 +323,7 @@ QueryContext::~QueryContext()
void QueryContext::start() void QueryContext::start()
{ {
Core::FutureProgress *fp = Core::ProgressManager::addTask(m_progress.future(), tr("Gerrit"), Core::FutureProgress *fp = Core::ProgressManager::addTask(m_progress.future(), tr("Gerrit"),
QLatin1String("gerrit-query")); "gerrit-query");
fp->setKeepOnFinish(Core::FutureProgress::HideOnFinish); fp->setKeepOnFinish(Core::FutureProgress::HideOnFinish);
m_progress.reportStarted(); m_progress.reportStarted();
startQuery(m_queries.front()); // Order: synchronous call to error handling if something goes wrong. startQuery(m_queries.front()); // Order: synchronous call to error handling if something goes wrong.

View File

@@ -168,7 +168,7 @@ void FetchContext::start()
{ {
m_progress.setProgressRange(0, 2); m_progress.setProgressRange(0, 2);
FutureProgress *fp = ProgressManager::addTask(m_progress.future(), tr("Gerrit Fetch"), FutureProgress *fp = ProgressManager::addTask(m_progress.future(), tr("Gerrit Fetch"),
QLatin1String("gerrit-fetch")); "gerrit-fetch");
fp->setKeepOnFinish(FutureProgress::HideOnFinish); fp->setKeepOnFinish(FutureProgress::HideOnFinish);
m_progress.reportStarted(); m_progress.reportStarted();
// Order: initialize future before starting the process in case error handling is invoked. // Order: initialize future before starting the process in case error handling is invoked.

View File

@@ -194,8 +194,7 @@ void SearchWidget::indexingStarted()
{ {
Q_ASSERT(!m_progress); Q_ASSERT(!m_progress);
m_progress = new QFutureInterface<void>(); m_progress = new QFutureInterface<void>();
Core::ProgressManager::addTask(m_progress->future(), Core::ProgressManager::addTask(m_progress->future(), tr("Indexing"), "Help.Indexer");
tr("Indexing"), QLatin1String("Help.Indexer"));
m_progress->setProgressRange(0, 2); m_progress->setProgressRange(0, 2);
m_progress->setProgressValueAndText(1, tr("Indexing Documentation...")); m_progress->setProgressValueAndText(1, tr("Indexing Documentation..."));
m_progress->reportStarted(); m_progress->reportStarted();

View File

@@ -261,7 +261,7 @@ void LocatorPlugin::refresh(QList<ILocatorFilter *> filters)
filters = m_filters; filters = m_filters;
QFuture<void> task = QtConcurrent::run(&ILocatorFilter::refresh, filters); QFuture<void> task = QtConcurrent::run(&ILocatorFilter::refresh, filters);
FutureProgress *progress = 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())); connect(progress, SIGNAL(finished()), this, SLOT(saveSettings()));
} }

View File

@@ -300,8 +300,7 @@ void BuildManager::startBuildQueue(const QStringList &preambleMessage)
TaskHub::clearTasks(Constants::TASK_CATEGORY_DEPLOYMENT); TaskHub::clearTasks(Constants::TASK_CATEGORY_DEPLOYMENT);
ProgressManager::setApplicationLabel(QString()); ProgressManager::setApplicationLabel(QString());
d->m_futureProgress = ProgressManager::addTask(d->m_progressFutureInterface->future(), d->m_futureProgress = ProgressManager::addTask(d->m_progressFutureInterface->future(),
QString(), QString(), "ProjectExplorer.Task.Build",
QLatin1String(Constants::TASK_BUILD),
ProgressManager::KeepOnFinish | ProgressManager::ShowInApplicationIcon); ProgressManager::KeepOnFinish | ProgressManager::ShowInApplicationIcon);
connect(d->m_futureProgress.data(), SIGNAL(clicked()), this, SLOT(showBuildResults())); connect(d->m_futureProgress.data(), SIGNAL(clicked()), this, SLOT(showBuildResults()));
d->m_futureProgress.data()->setWidget(new Internal::BuildProgress(d->m_taskWindow)); d->m_futureProgress.data()->setWidget(new Internal::BuildProgress(d->m_taskWindow));

View File

@@ -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_STOP_SMALL[] = ":/projectexplorer/images/stop_small.png";
const char ICON_WINDOW[] = ":/projectexplorer/images/window.png"; const char ICON_WINDOW[] = ":/projectexplorer/images/window.png";
const char TASK_BUILD[] = "ProjectExplorer.Task.Build";
// Mime types // Mime types
const char C_SOURCE_MIMETYPE[] = "text/x-csrc"; const char C_SOURCE_MIMETYPE[] = "text/x-csrc";
const char C_HEADER_MIMETYPE[] = "text/x-chdr"; const char C_HEADER_MIMETYPE[] = "text/x-chdr";

View File

@@ -857,7 +857,7 @@ bool SessionManager::loadSession(const QString &session)
m_virginSession = false; m_virginSession = false;
ProgressManager::addTask(m_future.future(), tr("Session"), ProgressManager::addTask(m_future.future(), tr("Session"),
QLatin1String("ProjectExplorer.SessionFile.Load")); "ProjectExplorer.SessionFile.Load");
m_future.setProgressRange(0, 1); m_future.setProgressRange(0, 1);
m_future.setProgressValue(0); m_future.setProgressValue(0);

View File

@@ -467,8 +467,8 @@ void QbsProject::prepareForParsing()
m_currentProgressBase = 0; m_currentProgressBase = 0;
m_qbsUpdateFutureInterface = new QFutureInterface<void>(); m_qbsUpdateFutureInterface = new QFutureInterface<void>();
m_qbsUpdateFutureInterface->setProgressRange(0, 0); m_qbsUpdateFutureInterface->setProgressRange(0, 0);
ProgressManager::addTask(m_qbsUpdateFutureInterface->future(), tr("Evaluating"), ProgressManager::addTask(m_qbsUpdateFutureInterface->future(),
QLatin1String(Constants::QBS_EVALUATE)); tr("Evaluating"), "Qbs.QbsEvaluate");
m_qbsUpdateFutureInterface->reportStarted(); m_qbsUpdateFutureInterface->reportStarted();
} }

View File

@@ -41,9 +41,6 @@ const char PROJECT_ID[] = "Qbs.QbsProject";
// MIME types: // MIME types:
const char MIME_TYPE[] = "application/x-qt.qbs+qml"; const char MIME_TYPE[] = "application/x-qt.qbs+qml";
// Progress reports:
const char QBS_EVALUATE[] = "Qbs.QbsEvaluate";
// Actions: // Actions:
const char ACTION_REPARSE_QBS[] = "Qbs.Reparse"; const char ACTION_REPARSE_QBS[] = "Qbs.Reparse";
const char ACTION_REPARSE_QBS_CONTEXT[] = "Qbs.ReparseCtx"; const char ACTION_REPARSE_QBS_CONTEXT[] = "Qbs.ReparseCtx";

View File

@@ -942,7 +942,7 @@ void FindReferences::displayResults(int first, int last)
FutureProgress *progress = ProgressManager::addTask( FutureProgress *progress = ProgressManager::addTask(
m_watcher.future(), tr("Searching"), m_watcher.future(), tr("Searching"),
QLatin1String(QmlJSEditor::Constants::TASK_SEARCH)); QmlJSEditor::Constants::TASK_SEARCH);
connect(progress, SIGNAL(clicked()), m_currentSearch, SLOT(popup())); connect(progress, SIGNAL(clicked()), m_currentSearch, SLOT(popup()));
++first; ++first;

View File

@@ -380,8 +380,7 @@ QFuture<void> ModelManager::refreshSourceFiles(const QStringList &sourceFiles,
m_synchronizer.addFuture(result); m_synchronizer.addFuture(result);
if (sourceFiles.count() > 1) { if (sourceFiles.count() > 1) {
ProgressManager::addTask(result, tr("Indexing"), ProgressManager::addTask(result, tr("Indexing"), Constants::TASK_INDEX);
QLatin1String(Constants::TASK_INDEX));
} }
return result; return result;

View File

@@ -112,10 +112,10 @@ bool QmlJSToolsPlugin::initialize(const QStringList &arguments, QString *error)
mqmljstools->addAction(cmd); mqmljstools->addAction(cmd);
// watch task progress // watch task progress
connect(ProgressManager::instance(), SIGNAL(taskStarted(QString)), connect(ProgressManager::instance(), SIGNAL(taskStarted(Core::Id)),
this, SLOT(onTaskStarted(QString))); this, SLOT(onTaskStarted(Core::Id)));
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(QString)), connect(ProgressManager::instance(), SIGNAL(allTasksFinished(Core::Id)),
this, SLOT(onAllTasksFinished(QString))); this, SLOT(onAllTasksFinished(Core::Id)));
return true; return true;
} }
@@ -130,15 +130,15 @@ ExtensionSystem::IPlugin::ShutdownFlag QmlJSToolsPlugin::aboutToShutdown()
return SynchronousShutdown; return SynchronousShutdown;
} }
void QmlJSToolsPlugin::onTaskStarted(const QString &type) void QmlJSToolsPlugin::onTaskStarted(Core::Id type)
{ {
if (type == QLatin1String(QmlJSTools::Constants::TASK_INDEX)) if (type == QmlJSTools::Constants::TASK_INDEX)
m_resetCodeModelAction->setEnabled(false); m_resetCodeModelAction->setEnabled(false);
} }
void QmlJSToolsPlugin::onAllTasksFinished(const QString &type) void QmlJSToolsPlugin::onAllTasksFinished(Core::Id type)
{ {
if (type == QLatin1String(QmlJSTools::Constants::TASK_INDEX)) if (type == QmlJSTools::Constants::TASK_INDEX)
m_resetCodeModelAction->setEnabled(true); m_resetCodeModelAction->setEnabled(true);
} }

View File

@@ -30,6 +30,7 @@
#ifndef QMLJSTOOLS_H #ifndef QMLJSTOOLS_H
#define QMLJSTOOLS_H #define QMLJSTOOLS_H
#include <coreplugin/id.h>
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@@ -64,8 +65,8 @@ public:
ModelManager *modelManager() { return m_modelManager; } ModelManager *modelManager() { return m_modelManager; }
private slots: private slots:
void onTaskStarted(const QString &type); void onTaskStarted(Core::Id type);
void onAllTasksFinished(const QString &type); void onAllTasksFinished(Core::Id type);
#ifdef WITH_TESTS #ifdef WITH_TESTS
void test_basic(); void test_basic();

View File

@@ -859,7 +859,7 @@ void Qt4Project::asyncUpdate()
m_asyncUpdateFutureInterface->setProgressRange(0, 0); m_asyncUpdateFutureInterface->setProgressRange(0, 0);
Core::ProgressManager::addTask(m_asyncUpdateFutureInterface->future(), tr("Evaluating"), Core::ProgressManager::addTask(m_asyncUpdateFutureInterface->future(), tr("Evaluating"),
QLatin1String(Constants::PROFILE_EVALUATE)); Constants::PROFILE_EVALUATE);
if (debug) if (debug)
qDebug()<<" adding task"; qDebug()<<" adding task";

View File

@@ -1517,7 +1517,7 @@ void BaseQtVersion::buildDebuggingHelper(ToolChain *tc, int tools)
QFuture<void> task = QtConcurrent::run(&QtSupport::DebuggingHelperBuildTask::run, buildTask); QFuture<void> task = QtConcurrent::run(&QtSupport::DebuggingHelperBuildTask::run, buildTask);
const QString taskName = QCoreApplication::translate("BaseQtVersion", "Building helpers"); const QString taskName = QCoreApplication::translate("BaseQtVersion", "Building helpers");
ProgressManager::addTask(task, taskName, QLatin1String("Qt::BuildHelpers")); ProgressManager::addTask(task, taskName, "Qt::BuildHelpers");
} }
FileName BaseQtVersion::qtCorePath(const QHash<QString,QString> &versionInfo, const QString &versionString) FileName BaseQtVersion::qtCorePath(const QHash<QString,QString> &versionInfo, const QString &versionString)

View File

@@ -327,7 +327,7 @@ void QmlDumpTool::pathAndEnvironment(Project *project, BaseQtVersion *version,
buildTask->updateProjectWhenDone(project, preferDebug); buildTask->updateProjectWhenDone(project, preferDebug);
QFuture<void> task = QtConcurrent::run(&QmlDumpBuildTask::run, buildTask); QFuture<void> task = QtConcurrent::run(&QmlDumpBuildTask::run, buildTask);
const QString taskName = QmlDumpBuildTask::tr("Building helper"); const QString taskName = QmlDumpBuildTask::tr("Building helper");
Core::ProgressManager::addTask(task, taskName, QLatin1String("Qt4ProjectManager::BuildHelpers")); Core::ProgressManager::addTask(task, taskName, "Qt4ProjectManager::BuildHelpers");
} }
return; return;
} }

View File

@@ -458,7 +458,7 @@ void QtOptionsPageWidget::buildDebuggingHelper(DebuggingHelperBuildTask::Tools t
QFuture<void> task = QtConcurrent::run(&DebuggingHelperBuildTask::run, buildTask); QFuture<void> task = QtConcurrent::run(&DebuggingHelperBuildTask::run, buildTask);
const QString taskName = tr("Building helpers"); const QString taskName = tr("Building helpers");
Core::ProgressManager::addTask(task, taskName, QLatin1String("Qt4ProjectManager::BuildHelpers")); Core::ProgressManager::addTask(task, taskName, "Qt4ProjectManager::BuildHelpers");
} }
void QtOptionsPageWidget::buildGdbHelper() void QtOptionsPageWidget::buildGdbHelper()
{ {

View File

@@ -181,8 +181,9 @@ void BaseFileFind::runSearch(Find::SearchResult *search)
textDocumentFlagsForFindFlags(parameters.flags), textDocumentFlagsForFindFlags(parameters.flags),
ITextEditor::openedTextDocumentContents())); ITextEditor::openedTextDocumentContents()));
} }
FutureProgress *progress = ProgressManager::addTask(watcher->future(), tr("Search"), FutureProgress *progress =
QLatin1String(Constants::TASK_SEARCH)); progress->setWidget(label); ProgressManager::addTask(watcher->future(), tr("Search"), Constants::TASK_SEARCH);
progress->setWidget(label);
progress->setStatusBarWidget(statusLabel); progress->setStatusBarWidget(statusLabel);
connect(progress, SIGNAL(clicked()), search, SLOT(popup())); connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
} }

View File

@@ -367,8 +367,7 @@ bool BaseTextDocument::open(QString *errorString, const QString &fileName, const
} else { } else {
QFutureInterface<void> interface; QFutureInterface<void> interface;
interface.setProgressRange(0, chunks); interface.setProgressRange(0, chunks);
ProgressManager::addTask(interface.future(), ProgressManager::addTask(interface.future(), tr("Opening file"), Constants::TASK_OPEN_FILE);
tr("Opening file"), QLatin1String(Constants::TASK_OPEN_FILE));
interface.reportStarted(); interface.reportStarted();
d->m_document->setUndoRedoEnabled(false); d->m_document->setUndoRedoEnabled(false);
QTextCursor c(d->m_document); QTextCursor c(d->m_document);

View File

@@ -310,8 +310,7 @@ void Manager::registerMimeTypes()
connect(&m_registeringWatcher, SIGNAL(finished()), processor, SLOT(deleteLater())); connect(&m_registeringWatcher, SIGNAL(finished()), processor, SLOT(deleteLater()));
m_registeringWatcher.setFuture(future); m_registeringWatcher.setFuture(future);
ProgressManager::addTask(future, tr("Registering definitions"), ProgressManager::addTask(future, tr("Registering definitions"), "TextEditor.Task.Register");
QLatin1String(Constants::TASK_REGISTER_DEFINITIONS));
} else { } else {
m_hasQueuedRegistration = true; m_hasQueuedRegistration = true;
m_registeringWatcher.cancel(); m_registeringWatcher.cancel();
@@ -444,8 +443,7 @@ void Manager::downloadDefinitions(const QList<QUrl> &urls, const QString &savePa
m_isDownloadingDefinitionsSpec = true; m_isDownloadingDefinitionsSpec = true;
QFuture<void> future = QtConcurrent::map(m_downloaders, DownloaderStarter()); QFuture<void> future = QtConcurrent::map(m_downloaders, DownloaderStarter());
m_downloadWatcher.setFuture(future); m_downloadWatcher.setFuture(future);
ProgressManager::addTask(future, tr("Downloading definitions"), ProgressManager::addTask(future, tr("Downloading definitions"), "TextEditor.Task.Download");
QLatin1String(Constants::TASK_DOWNLOAD_DEFINITIONS));
} }
void Manager::downloadDefinitionsFinished() void Manager::downloadDefinitionsFinished()

View File

@@ -159,8 +159,6 @@ const char GOTO_PREVIOUS_WORD_CAMEL_CASE_WITH_SELECTION[] = "TextEditor.GotoPrev
const char GOTO_NEXT_WORD_CAMEL_CASE_WITH_SELECTION[] = "TextEditor.GotoNextWordCamelCaseWithSelection"; const char GOTO_NEXT_WORD_CAMEL_CASE_WITH_SELECTION[] = "TextEditor.GotoNextWordCamelCaseWithSelection";
const char C_TEXTEDITOR_MIMETYPE_TEXT[] = "text/plain"; const char C_TEXTEDITOR_MIMETYPE_TEXT[] = "text/plain";
const char INFO_SYNTAX_DEFINITION[] = "TextEditor.InfoSyntaxDefinition"; const char INFO_SYNTAX_DEFINITION[] = "TextEditor.InfoSyntaxDefinition";
const char TASK_DOWNLOAD_DEFINITIONS[] = "TextEditor.Task.Download";
const char TASK_REGISTER_DEFINITIONS[] = "TextEditor.Task.Register";
const char TASK_OPEN_FILE[] = "TextEditor.Task.OpenFile"; const char TASK_OPEN_FILE[] = "TextEditor.Task.OpenFile";
const char CIRCULAR_PASTE[] = "TextEditor.CircularPaste"; const char CIRCULAR_PASTE[] = "TextEditor.CircularPaste";
const char SWITCH_UTF8BOM[] = "TextEditor.SwitchUtf8bom"; const char SWITCH_UTF8BOM[] = "TextEditor.SwitchUtf8bom";

View File

@@ -184,7 +184,7 @@ void UpdateInfoPlugin::reactOnUpdaterOutput()
} else { } else {
//added the current almost finished task to the progressmanager //added the current almost finished task to the progressmanager
d->updateInfoProgress = ProgressManager::addTask( d->updateInfoProgress = ProgressManager::addTask(
d->lastCheckUpdateInfoTask, tr("Update"), QLatin1String("Update.GetInfo"), ProgressManager::KeepOnFinish); d->lastCheckUpdateInfoTask, tr("Update"), "Update.GetInfo", ProgressManager::KeepOnFinish);
d->updateInfoProgress->setKeepOnFinish(FutureProgress::KeepOnFinish); d->updateInfoProgress->setKeepOnFinish(FutureProgress::KeepOnFinish);

View File

@@ -86,7 +86,7 @@ bool ValgrindRunControl::startEngine()
emit starting(this); emit starting(this);
FutureProgress *fp = ProgressManager::addTask(m_progress->future(), FutureProgress *fp = ProgressManager::addTask(m_progress->future(),
progressTitle(), QLatin1String("valgrind")); progressTitle(), "valgrind");
fp->setKeepOnFinish(FutureProgress::HideOnFinish); fp->setKeepOnFinish(FutureProgress::HideOnFinish);
m_progress->setProgressRange(0, progressMaximum); m_progress->setProgressRange(0, progressMaximum);
m_progress->reportStarted(); m_progress->reportStarted();

View File

@@ -268,7 +268,7 @@ bool CleanDialog::promptToDelete()
QFuture<void> task = QtConcurrent::run(cleanTask, &Internal::CleanFilesTask::run); QFuture<void> task = QtConcurrent::run(cleanTask, &Internal::CleanFilesTask::run);
const QString taskName = tr("Cleaning %1"). const QString taskName = tr("Cleaning %1").
arg(QDir::toNativeSeparators(d->m_workingDirectory)); arg(QDir::toNativeSeparators(d->m_workingDirectory));
Core::ProgressManager::addTask(task, taskName, QLatin1String("VcsBase.cleanRepository")); Core::ProgressManager::addTask(task, taskName, "VcsBase.cleanRepository");
return true; return true;
} }

View File

@@ -213,7 +213,8 @@ void Command::execute()
binary = binary.replace(0, 1, binary[0].toUpper()); // Upper the first letter binary = binary.replace(0, 1, binary[0].toUpper()); // Upper the first letter
const QString taskName = binary + QLatin1Char(' ') + d->m_jobs.front().arguments.at(0); const QString taskName = binary + QLatin1Char(' ') + d->m_jobs.front().arguments.at(0);
Core::ProgressManager::addTask(task, taskName, binary + QLatin1String(".action")); Core::ProgressManager::addTask(task, taskName,
Core::Id::fromString(binary + QLatin1String(".action")));
} }
void Command::terminate() void Command::terminate()