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

@@ -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(result, tr("Indexing"), Constants::TASK_INDEX);
}
return result;

View File

@@ -112,10 +112,10 @@ bool QmlJSToolsPlugin::initialize(const QStringList &arguments, QString *error)
mqmljstools->addAction(cmd);
// watch task progress
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)));
return true;
}
@@ -130,15 +130,15 @@ ExtensionSystem::IPlugin::ShutdownFlag QmlJSToolsPlugin::aboutToShutdown()
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);
}
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);
}

View File

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