Commit 4a21f0c3 authored by hjk's avatar hjk Committed by hjk

Use new static ICore interface.

Change-Id: I9b690d9b150c8d162b15370f9f8986267c9128f1
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent c14a4756
......@@ -39,7 +39,7 @@ bool %PluginName%Plugin::initialize(const QStringList &arguments, QString *error
Q_UNUSED(arguments)
Q_UNUSED(errorString)
Core::ActionManager *am = Core::ICore::instance()->actionManager();
Core::ActionManager *am = Core::ICore::actionManager();
QAction *action = new QAction(tr("%PluginName% action"), this);
Core::Command *cmd = am->registerAction(action, Constants::ACTION_ID,
......@@ -72,7 +72,7 @@ ExtensionSystem::IPlugin::ShutdownFlag %PluginName%Plugin::aboutToShutdown()
void %PluginName%Plugin::triggerAction()
{
QMessageBox::information(Core::ICore::instance()->mainWindow(),
QMessageBox::information(Core::ICore::mainWindow(),
tr("Action triggered"),
tr("This is an action from %PluginName%."));
}
......
......@@ -261,8 +261,7 @@ AnalyzerManagerPrivate::~AnalyzerManagerPrivate()
void AnalyzerManagerPrivate::setupActions()
{
Core::ICore *core = Core::ICore::instance();
Core::ActionManager *am = core->actionManager();
Core::ActionManager *am = Core::ICore::actionManager();
const Core::Context globalcontext(Core::Constants::C_GLOBAL);
Core::Command *command = 0;
......@@ -340,7 +339,7 @@ void AnalyzerManagerPrivate::delayedInit()
// Populate Windows->Views menu with standard actions.
Core::Context analyzerContext(Constants::C_ANALYZEMODE);
ActionManager *am = ICore::instance()->actionManager();
ActionManager *am = ICore::actionManager();
ActionContainer *viewsMenu =
am->actionContainer(Core::Id(Core::Constants::M_WINDOW_VIEWS));
Command *cmd = am->registerAction(m_mainWindow->menuSeparator1(),
......@@ -435,7 +434,7 @@ void AnalyzerManagerPrivate::activateDock(Qt::DockWidgetArea area, QDockWidget *
Context globalContext(Core::Constants::C_GLOBAL);
ActionManager *am = ICore::instance()->actionManager();
ActionManager *am = ICore::actionManager();
QAction *toggleViewAction = dockWidget->toggleViewAction();
toggleViewAction->setText(dockWidget->windowTitle());
Command *cmd = am->registerAction(toggleViewAction,
......@@ -449,7 +448,7 @@ void AnalyzerManagerPrivate::activateDock(Qt::DockWidgetArea area, QDockWidget *
void AnalyzerManagerPrivate::deactivateDock(QDockWidget *dockWidget)
{
ActionManager *am = ICore::instance()->actionManager();
ActionManager *am = ICore::actionManager();
QAction *toggleViewAction = dockWidget->toggleViewAction();
am->unregisterAction(toggleViewAction, Core::Id("Analyzer." + dockWidget->objectName()));
m_mainWindow->removeDockWidget(dockWidget);
......@@ -477,7 +476,7 @@ bool buildTypeAccepted(IAnalyzerTool::ToolMode toolMode,
bool AnalyzerManagerPrivate::showPromptDialog(const QString &title, const QString &text,
const QString &stopButtonText, const QString &cancelButtonText) const
{
Utils::CheckableMessageBox messageBox(Core::ICore::instance()->mainWindow());
Utils::CheckableMessageBox messageBox(Core::ICore::mainWindow());
messageBox.setWindowTitle(title);
messageBox.setText(text);
messageBox.setStandardButtons(QDialogButtonBox::Yes|QDialogButtonBox::Cancel);
......@@ -523,7 +522,7 @@ void AnalyzerManagerPrivate::startLocalTool(IAnalyzerTool *tool)
const QString currentMode =
buildType == BuildConfiguration::Debug ? tr("Debug") : tr("Release");
QSettings *settings = Core::ICore::instance()->settings();
QSettings *settings = Core::ICore::settings();
const QString configKey = QLatin1String("Analyzer.AnalyzeCorrectMode");
int ret;
if (settings->contains(configKey)) {
......@@ -547,7 +546,7 @@ void AnalyzerManagerPrivate::startLocalTool(IAnalyzerTool *tool)
const QString checkBoxText = tr("&Do not ask again");
bool checkBoxSetting = false;
const QDialogButtonBox::StandardButton button =
Utils::CheckableMessageBox::question(Core::ICore::instance()->mainWindow(),
Utils::CheckableMessageBox::question(Core::ICore::mainWindow(),
title, message, checkBoxText,
&checkBoxSetting, QDialogButtonBox::Yes|QDialogButtonBox::Cancel,
QDialogButtonBox::Cancel);
......@@ -605,7 +604,7 @@ QAction *AnalyzerManagerPrivate::actionFromToolAndMode(IAnalyzerTool *tool, Star
void AnalyzerManagerPrivate::selectSavedTool()
{
const QSettings *settings = Core::ICore::instance()->settings();
const QSettings *settings = Core::ICore::settings();
const Core::Id lastActiveAction(settings->value(QLatin1String(LAST_ACTIVE_TOOL)).toString());
foreach (QAction *action, m_actions) {
IAnalyzerTool *tool = m_toolFromAction.value(action);
......@@ -688,7 +687,7 @@ void AnalyzerManagerPrivate::addTool(IAnalyzerTool *tool, const StartModes &mode
delayedInit(); // Make sure that there is a valid IMode instance.
const bool blocked = m_toolBox->blockSignals(true); // Do not make current.
ActionManager *am = Core::ICore::instance()->actionManager();
ActionManager *am = Core::ICore::actionManager();
foreach (StartMode mode, modes) {
QString actionName = tool->actionName(mode);
Id menuGroup = tool->menuGroup(mode);
......@@ -725,7 +724,7 @@ void AnalyzerManagerPrivate::handleToolFinished()
void AnalyzerManagerPrivate::loadToolSettings(IAnalyzerTool *tool)
{
QTC_ASSERT(m_mainWindow, return);
QSettings *settings = Core::ICore::instance()->settings();
QSettings *settings = Core::ICore::settings();
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + tool->id().toString());
if (settings->value("ToolSettingsSaved", false).toBool())
m_mainWindow->restoreSettings(settings);
......@@ -740,7 +739,7 @@ void AnalyzerManagerPrivate::saveToolSettings(IAnalyzerTool *tool, StartMode mod
return; // no active tool, do nothing
QTC_ASSERT(m_mainWindow, return);
QSettings *settings = Core::ICore::instance()->settings();
QSettings *settings = Core::ICore::settings();
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + tool->id().toString());
m_mainWindow->saveSettings(settings);
settings->setValue("ToolSettingsSaved", true);
......
......@@ -119,7 +119,7 @@ AnalyzerGlobalSettings::~AnalyzerGlobalSettings()
void AnalyzerGlobalSettings::readSettings()
{
QSettings *settings = Core::ICore::instance()->settings();
QSettings *settings = Core::ICore::settings();
QVariantMap map;
......@@ -136,7 +136,7 @@ void AnalyzerGlobalSettings::readSettings()
void AnalyzerGlobalSettings::writeSettings() const
{
QSettings *settings = Core::ICore::instance()->settings();
QSettings *settings = Core::ICore::settings();
settings->beginGroup(QLatin1String(groupC));
const QVariantMap map = toMap();
for (QVariantMap::ConstIterator it = map.begin(); it != map.end(); ++it)
......
......@@ -49,7 +49,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
m_ui->keyFile->setExpectedKind(Utils::PathChooser::File);
QSettings *settings = Core::ICore::instance()->settings();
QSettings *settings = Core::ICore::settings();
settings->beginGroup("AnalyzerStartRemoteDialog");
m_ui->host->setText(settings->value("host").toString());
m_ui->port->setValue(settings->value("port", 22).toInt());
......@@ -91,7 +91,7 @@ StartRemoteDialog::~StartRemoteDialog()
void StartRemoteDialog::accept()
{
QSettings *settings = Core::ICore::instance()->settings();
QSettings *settings = Core::ICore::settings();
settings->beginGroup("AnalyzerStartRemoteDialog");
settings->setValue("host", m_ui->host->text());
settings->setValue("port", m_ui->port->value());
......
......@@ -63,8 +63,7 @@ bool AutotoolsProjectPlugin::initialize(const QStringList &arguments,
{
Q_UNUSED(arguments);
Core::ICore *core = Core::ICore::instance();
if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":autotoolsproject/AutotoolsProject.mimetypes.xml"), errorString))
if (!Core::ICore::mimeDatabase()->addMimeTypes(QLatin1String(":autotoolsproject/AutotoolsProject.mimetypes.xml"), errorString))
return false;
addAutoReleasedObject(new AutotoolsTargetFactory);
......
......@@ -124,7 +124,6 @@ BazaarPlugin::BazaarPlugin()
: VcsBase::VcsBasePlugin(QLatin1String(Constants::COMMIT_ID)),
m_optionsPage(0),
m_client(0),
m_core(0),
m_commandLocator(0),
m_changeLog(0),
m_addAction(0),
......@@ -156,12 +155,11 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag
m_client = new BazaarClient(&m_bazaarSettings);
initializeVcs(new BazaarControl(m_client));
m_core = Core::ICore::instance();
m_actionManager = m_core->actionManager();
m_actionManager = Core::ICore::actionManager();
m_optionsPage = new OptionsPage();
addAutoReleasedObject(m_optionsPage);
m_bazaarSettings.readSettings(m_core->settings());
m_bazaarSettings.readSettings(Core::ICore::settings());
connect(m_client, SIGNAL(changed(QVariant)), versionControl(), SLOT(changed(QVariant)));
......@@ -571,7 +569,7 @@ void BazaarPlugin::showCommitWidget(const QList<VcsBase::VcsBaseClient::StatusIt
return;
}
Core::IEditor *editor = m_core->editorManager()->openEditor(m_changeLog->fileName(),
Core::IEditor *editor = Core::ICore::editorManager()->openEditor(m_changeLog->fileName(),
Constants::COMMIT_ID,
Core::EditorManager::ModeSwitch);
if (!editor) {
......@@ -612,7 +610,7 @@ void BazaarPlugin::commitFromEditor()
return;
//use the same functionality than if the user closes the file without completing the commit
m_core->editorManager()->closeEditors(m_core->editorManager()->editorsForFileName(m_changeLog->fileName()));
Core::ICore::editorManager()->closeEditors(Core::ICore::editorManager()->editorsForFileName(m_changeLog->fileName()));
}
bool BazaarPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor)
......@@ -643,7 +641,7 @@ bool BazaarPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submit
QStringList files = commitEditor->checkedFiles();
if (!files.empty()) {
//save the commit message
if (!m_core->fileManager()->saveFile(editorFile))
if (!Core::ICore::fileManager()->saveFile(editorFile))
return false;
//rewrite entries of the form 'file => newfile' to 'newfile' because
......
......@@ -52,7 +52,6 @@ QT_END_NAMESPACE
namespace Core {
class ActionManager;
class ActionContainer;
class ICore;
class Id;
class IVersionControl;
class IEditorFactory;
......@@ -138,7 +137,6 @@ private:
OptionsPage *m_optionsPage;
BazaarClient *m_client;
Core::ICore *m_core;
Locator::CommandLocator *m_commandLocator;
Core::ActionManager *m_actionManager;
Core::ActionContainer *m_bazaarContainer;
......
......@@ -126,7 +126,7 @@ void OptionsPage::apply()
if (newSettings != plugin->settings()) {
//assume success and emit signal that settings are changed;
plugin->setSettings(newSettings);
newSettings.writeSettings(Core::ICore::instance()->settings());
newSettings.writeSettings(Core::ICore::settings());
emit settingsChanged();
}
}
......
......@@ -245,7 +245,7 @@ public:
if (errorString)
*errorString = errStr;
else
QMessageBox::critical(Core::ICore::instance()->mainWindow(), tr("File Error"), errStr);
QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"), errStr);
return false;
}
......@@ -264,7 +264,7 @@ private slots:
m_editor->addData(block, data);
file.close();
} else {
QMessageBox::critical(Core::ICore::instance()->mainWindow(), tr("File Error"),
QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"),
tr("Cannot open %1: %2").arg(
QDir::toNativeSeparators(m_fileName), file.errorString()));
}
......@@ -477,7 +477,7 @@ BinEditorPlugin::~BinEditorPlugin()
QAction *BinEditorPlugin::registerNewAction(const QString &id, const QString &title)
{
QAction *result = new QAction(title, this);
Core::ICore::instance()->actionManager()->registerAction(result, Core::Id(id), m_context);
Core::ICore::actionManager()->registerAction(result, Core::Id(id), m_context);
return result;
}
......@@ -535,8 +535,7 @@ bool BinEditorPlugin::initialize(const QStringList &arguments, QString *errorMes
Q_UNUSED(arguments)
Q_UNUSED(errorMessage)
Core::ICore *core = Core::ICore::instance();
connect(core, SIGNAL(contextAboutToChange(Core::IContext *)),
connect(Core::ICore::instance(), SIGNAL(contextAboutToChange(Core::IContext *)),
this, SLOT(updateCurrentEditor(Core::IContext *)));
addAutoReleasedObject(new BinEditorFactory(this));
......
......@@ -215,7 +215,7 @@ BookmarkView::BookmarkView(QWidget *parent) :
connect(this, SIGNAL(clicked(const QModelIndex &)),
this, SLOT(gotoBookmark(const QModelIndex &)));
ICore::instance()->addContextObject(m_bookmarkContext);
ICore::addContextObject(m_bookmarkContext);
setItemDelegate(new BookmarkDelegate(this));
setFrameStyle(QFrame::NoFrame);
......@@ -225,7 +225,7 @@ BookmarkView::BookmarkView(QWidget *parent) :
BookmarkView::~BookmarkView()
{
ICore::instance()->removeContextObject(m_bookmarkContext);
ICore::removeContextObject(m_bookmarkContext);
}
void BookmarkView::contextMenuEvent(QContextMenuEvent *event)
......
......@@ -70,8 +70,7 @@ void BookmarksPlugin::extensionsInitialized()
bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
{
Core::ICore *core = Core::ICore::instance();
Core::ActionManager *am = core->actionManager();
Core::ActionManager *am = Core::ICore::actionManager();
Core::Context textcontext(TextEditor::Constants::C_TEXTEDITOR);
Core::Context globalcontext(Core::Constants::C_GLOBAL);
......@@ -148,7 +147,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
this, SLOT(bookmarkMarginActionTriggered()));
// EditorManager
QObject *editorManager = core->editorManager();
QObject *editorManager = Core::ICore::editorManager();
connect(editorManager, SIGNAL(editorAboutToClose(Core::IEditor*)),
this, SLOT(editorAboutToClose(Core::IEditor*)));
connect(editorManager, SIGNAL(editorOpened(Core::IEditor*)),
......
......@@ -150,12 +150,10 @@ void Manager::initialize()
connect(sessionManager, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
SLOT(onProjectListChanged()), Qt::QueuedConnection);
Core::ICore *core = Core::ICore::instance();
// connect to the progress manager for signals about Parsing tasks
connect(core->progressManager(), SIGNAL(taskStarted(QString)),
connect(Core::ICore::progressManager(), SIGNAL(taskStarted(QString)),
SLOT(onTaskStarted(QString)), Qt::QueuedConnection);
connect(core->progressManager(), SIGNAL(allTasksFinished(QString)),
connect(Core::ICore::progressManager(), SIGNAL(allTasksFinished(QString)),
SLOT(onAllTasksFinished(QString)), Qt::QueuedConnection);
// when we signals that really document is updated - sent it to the parser
......
......@@ -111,7 +111,7 @@ void NavigationWidgetFactory::saveSettings(int position, QWidget *widget)
NavigationWidget *pw = qobject_cast<NavigationWidget *>(widget);
QTC_ASSERT(pw, return);
QSettings *settings = Core::ICore::instance()->settings();
QSettings *settings = Core::ICore::settings();
QTC_ASSERT(settings, return);
// .beginGroup is not used - to prevent simultaneous access
......@@ -126,7 +126,7 @@ void NavigationWidgetFactory::restoreSettings(int position, QWidget *widget)
NavigationWidget *pw = qobject_cast<NavigationWidget *>(widget);
QTC_ASSERT(pw, return);
QSettings *settings = Core::ICore::instance()->settings();
QSettings *settings = Core::ICore::settings();
QTC_ASSERT(settings, return);
// .beginGroup is not used - to prevent simultaneous access
......
......@@ -67,7 +67,7 @@ CMakeManager::CMakeManager(CMakeSettingsPage *cmakeSettingsPage)
connect(projectExplorer, SIGNAL(aboutToShowContextMenu(ProjectExplorer::Project*, ProjectExplorer::Node*)),
this, SLOT(updateContextMenu(ProjectExplorer::Project*, ProjectExplorer::Node*)));
Core::ActionManager *am = Core::ICore::instance()->actionManager();
Core::ActionManager *am = Core::ICore::actionManager();
Core::ActionContainer *mbuild =
am->actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT);
......@@ -252,8 +252,7 @@ CMakeSettingsPage::CMakeSettingsPage()
m_pathCmake.process = 0;
m_userCmake.hasCodeBlocksMsvcGenerator = false;
m_pathCmake.hasCodeBlocksMsvcGenerator = false;
Core::ICore *core = Core::ICore::instance();
QSettings * settings = core->settings();
QSettings *settings = Core::ICore::settings();
settings->beginGroup(QLatin1String("CMakeSettings"));
m_userCmake.executable = settings->value(QLatin1String("cmakeExecutable")).toString();
settings->endGroup();
......@@ -404,7 +403,7 @@ void CMakeSettingsPage::updateInfo(CMakeValidator *cmakeValidator)
void CMakeSettingsPage::saveSettings() const
{
QSettings *settings = Core::ICore::instance()->settings();
QSettings *settings = Core::ICore::settings();
settings->beginGroup(QLatin1String("CMakeSettings"));
settings->setValue(QLatin1String("cmakeExecutable"), m_userCmake.executable);
settings->endGroup();
......
......@@ -59,8 +59,7 @@ CMakeProjectPlugin::~CMakeProjectPlugin()
bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage)
{
Core::ICore *core = Core::ICore::instance();
if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":cmakeproject/CMakeProject.mimetypes.xml"), errorMessage))
if (!Core::ICore::mimeDatabase()->addMimeTypes(QLatin1String(":cmakeproject/CMakeProject.mimetypes.xml"), errorMessage))
return false;
CMakeSettingsPage *cmp = new CMakeSettingsPage();
addAutoReleasedObject(cmp);
......
......@@ -64,7 +64,7 @@ namespace {
You get the only implementation of this class from the core interface
ICore::actionManager() method, e.g.
\code
Core::ICore::instance()->actionManager()
Core::ICore::actionManager()
\endcode
The main reasons for the need of this class is to provide a central place where the user
......@@ -99,7 +99,7 @@ namespace {
To register a globally active action "My Action"
put the following in your plugin's IPlugin::initialize method:
\code
Core::ActionManager *am = Core::ICore::instance()->actionManager();
Core::ActionManager *am = Core::ICore::actionManager();
QAction *myAction = new QAction(tr("My Action"), this);
Core::Command *cmd = am->registerAction(myAction,
"myplugin.myaction",
......@@ -505,7 +505,7 @@ static const char sequenceKey[] = "Keysequence";
void ActionManagerPrivate::initialize()
{
QSettings *settings = Core::ICore::instance()->settings();
QSettings *settings = Core::ICore::settings();
const int shortcuts = settings->beginReadArray(QLatin1String(settingsGroup));
for (int i = 0; i < shortcuts; ++i) {
settings->setArrayIndex(i);
......
......@@ -737,7 +737,7 @@ QString BaseFileWizard::buildFileName(const QString &path,
QString BaseFileWizard::preferredSuffix(const QString &mimeType)
{
const QString rc = Core::ICore::instance()->mimeDatabase()->preferredSuffixByType(mimeType);
const QString rc = Core::ICore::mimeDatabase()->preferredSuffixByType(mimeType);
if (rc.isEmpty())
qWarning("%s: WARNING: Unable to find a preferred suffix for %s.",
Q_FUNC_INFO, mimeType.toUtf8().constData());
......
......@@ -260,10 +260,10 @@ void DesignMode::updateContext(Core::IMode *newMode, Core::IMode *oldMode)
{
if (newMode == this) {
// Apply active context
Core::ICore::instance()->updateAdditionalContexts(Context(), d->m_activeContext);
Core::ICore::updateAdditionalContexts(Context(), d->m_activeContext);
} else if (oldMode == this) {
// Remove active context
Core::ICore::instance()->updateAdditionalContexts(d->m_activeContext, Context());
Core::ICore::updateAdditionalContexts(d->m_activeContext, Context());
}
}
......@@ -273,7 +273,7 @@ void DesignMode::setActiveContext(const Context &context)
return;
if (ModeManager::instance()->currentMode() == this)
Core::ICore::instance()->updateAdditionalContexts(d->m_activeContext, context);
Core::ICore::updateAdditionalContexts(d->m_activeContext, context);
d->m_activeContext = context;
}
......
......@@ -332,7 +332,7 @@ void SettingsDialog::showPage(const QString &categoryId, const QString &pageId)
QString initialCategory = categoryId;
QString initialPage = pageId;
if (initialCategory.isEmpty() && initialPage.isEmpty()) {
QSettings *settings = ICore::instance()->settings();
QSettings *settings = ICore::settings();
initialCategory = settings->value(QLatin1String(categoryKeyC), QVariant(QString())).toString();
initialPage = settings->value(QLatin1String(pageKeyC), QVariant(QString())).toString();
}
......@@ -540,7 +540,7 @@ void SettingsDialog::apply()
void SettingsDialog::done(int val)
{
QSettings *settings = ICore::instance()->settings();
QSettings *settings = ICore::settings();
settings->setValue(QLatin1String(categoryKeyC), m_currentCategory);
settings->setValue(QLatin1String(pageKeyC), m_currentPage);
......
......@@ -219,7 +219,7 @@ void ShortcutSettings::removeTargetIdentifier()
void ShortcutSettings::importAction()
{
QString fileName = QFileDialog::getOpenFileName(0, tr("Import Keyboard Mapping Scheme"),
ICore::instance()->resourcePath() + QLatin1String("/schemes/"),
ICore::resourcePath() + QLatin1String("/schemes/"),
tr("Keyboard Mapping Scheme (*.kms)"));
if (!fileName.isEmpty()) {
......@@ -268,7 +268,7 @@ void ShortcutSettings::exportAction()
{
QString fileName = FileManager::instance()->getSaveFileNameWithExtension(
tr("Export Keyboard Mapping Scheme"),
ICore::instance()->resourcePath() + QLatin1String("/schemes/"),
ICore::resourcePath() + QLatin1String("/schemes/"),
tr("Keyboard Mapping Scheme (*.kms)"));
if (!fileName.isEmpty()) {
CommandsFile cf(fileName);
......
......@@ -186,8 +186,9 @@ EditorManagerPlaceHolder* EditorManagerPlaceHolder::current()
namespace Core {
struct EditorManagerPrivate {
explicit EditorManagerPrivate(ICore *core, QWidget *parent);
struct EditorManagerPrivate
{
explicit EditorManagerPrivate(QWidget *parent);
~EditorManagerPrivate();
Internal::EditorView *m_view;
Internal::SplitterOrView *m_splitter;
......@@ -195,9 +196,6 @@ struct EditorManagerPrivate {
QPointer<SplitterOrView> m_currentView;
QTimer *m_autoSaveTimer;
ICore *m_core;
// actions
QAction *m_revertToSavedAction;
QAction *m_saveAction;
......@@ -239,11 +237,10 @@ struct EditorManagerPrivate {
};
}
EditorManagerPrivate::EditorManagerPrivate(ICore *core, QWidget *parent) :
EditorManagerPrivate::EditorManagerPrivate(QWidget *parent) :
m_view(0),
m_splitter(0),
m_autoSaveTimer(0),
m_core(core),
m_revertToSavedAction(new QAction(EditorManager::tr("Revert to Saved"), parent)),
m_saveAction(new QAction(parent)),
m_saveAsAction(new QAction(parent)),
......@@ -286,20 +283,20 @@ static Command *createSeparator(ActionManager *am, QObject *parent,
return cmd;
}
EditorManager::EditorManager(ICore *core, QWidget *parent) :
EditorManager::EditorManager(QWidget *parent) :
QWidget(parent),
d(new EditorManagerPrivate(core, parent))
d(new EditorManagerPrivate(parent))
{
m_instance = this;
connect(d->m_core, SIGNAL(contextAboutToChange(Core::IContext *)),
connect(ICore::instance(), SIGNAL(contextAboutToChange(Core::IContext *)),
this, SLOT(handleContextChange(Core::IContext *)));
const Context editManagerContext(Constants::C_EDITORMANAGER);
// combined context for edit & design modes
const Context editDesignContext(Constants::C_EDITORMANAGER, Constants::C_DESIGN_MODE);
ActionManager *am = d->m_core->actionManager();
ActionManager *am = ICore::actionManager();
ActionContainer *mfile = am->actionContainer(Constants::M_FILE);
// Revert to saved
......@@ -488,7 +485,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
EditorManager::~EditorManager()
{
m_instance = 0;
if (d->m_core) {
if (ICore::instance()) {
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();