diff --git a/doc/api/examples/exampleplugin/exampleplugin.cpp b/doc/api/examples/exampleplugin/exampleplugin.cpp index 147a4274b9c889d015f7b3c787111195d1d6f825..7b2b3c0cead88dc5f3713a44e55415ffbb2ae301 100644 --- a/doc/api/examples/exampleplugin/exampleplugin.cpp +++ b/doc/api/examples/exampleplugin/exampleplugin.cpp @@ -41,19 +41,17 @@ bool ExamplePlugin::initialize(const QStringList &arguments, QString *errorStrin Q_UNUSED(errorString) //! [add action] - Core::ActionManager *am = Core::ICore::instance()->actionManager(); - QAction *action = new QAction(tr("Example action"), this); - Core::Command *cmd = am->registerAction(action, Constants::ACTION_ID, + Core::Command *cmd = Core::ActionManager::registerAction(action, Constants::ACTION_ID, Core::Context(Core::Constants::C_GLOBAL)); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Meta+A"))); connect(action, SIGNAL(triggered()), this, SLOT(triggerAction())); //! [add action] //! [add menu] - Core::ActionContainer *menu = am->createMenu(Constants::MENU_ID); + Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::MENU_ID); menu->menu()->setTitle(tr("Example")); menu->addAction(cmd); - am->actionContainer(Core::Constants::M_TOOLS)->addMenu(menu); + Core::ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(menu); //! [add menu] return true; diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.cpp b/src/plugins/coreplugin/progressmanager/progressmanager.cpp index 444f19296b5706745588106264489b095f04f13b..419d8be0b70e22f0bc84594087775cfa29347260 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager.cpp +++ b/src/plugins/coreplugin/progressmanager/progressmanager.cpp @@ -72,7 +72,7 @@ using namespace Core::Internal; The progress indicator also allows the user to cancel the task. You get the single instance of this class via the - Core::ICore::progressManager() function. + ProgressManager::instance() function. \section1 Registering a task The ProgressManager API uses QtConcurrent as the basis for defining @@ -149,9 +149,8 @@ using namespace Core::Internal; in a different thread, looks like this: \code QFuture<void> task = QtConcurrent::run(&ILocatorFilter::refresh, filters); - Core::FutureProgress *progress = Core::ICore::instance() - ->progressManager()->addTask(task, tr("Indexing"), - Locator::Constants::TASK_INDEX); + Core::FutureProgress *progress = Core::ProgressManager::addTask(task, tr("Indexing"), + Locator::Constants::TASK_INDEX); \endcode First, we tell QtConcurrent to start a thread which calls all the filters' refresh function. After that we register the returned QFuture object @@ -166,9 +165,7 @@ using namespace Core::Internal; // We are already running in a different thread here QFutureInterface<void> *progressObject = new QFutureInterface<void>; progressObject->setProgressRange(0, MAX); - Core::ICore::progressManager()->addTask( - progressObject->future(), - tr("DoIt"), MYTASKTYPE); + Core::ProgressManager::addTask(progressObject->future(), tr("DoIt"), MYTASKTYPE); progressObject->reportStarted(); // Do something ...