Commit 4f4bbe98 authored by con's avatar con
Browse files

Change contextChanged signal to also notify about additional contexts.

parent 7daeffbd
...@@ -321,7 +321,7 @@ BookmarkManager::BookmarkManager() : ...@@ -321,7 +321,7 @@ BookmarkManager::BookmarkManager() :
m_bookmarkIcon(QLatin1String(":/bookmarks/images/bookmark.png")), m_bookmarkIcon(QLatin1String(":/bookmarks/images/bookmark.png")),
m_selectionModel(new QItemSelectionModel(this, this)) m_selectionModel(new QItemSelectionModel(this, this))
{ {
connect(Core::ICore::instance(), SIGNAL(contextChanged(Core::IContext*)), connect(Core::ICore::instance(), SIGNAL(contextChanged(Core::IContext*,QList<int>)),
this, SLOT(updateActionStatus())); this, SLOT(updateActionStatus()));
connect(ProjectExplorerPlugin::instance()->session(), SIGNAL(sessionLoaded()), connect(ProjectExplorerPlugin::instance()->session(), SIGNAL(sessionLoaded()),
......
...@@ -149,7 +149,7 @@ FileManager::FileManager(QMainWindow *mw) ...@@ -149,7 +149,7 @@ FileManager::FileManager(QMainWindow *mw)
this, SLOT(changedFile(QString))); this, SLOT(changedFile(QString)));
connect(d->m_mainWindow, SIGNAL(windowActivated()), connect(d->m_mainWindow, SIGNAL(windowActivated()),
this, SLOT(mainWindowActivated())); this, SLOT(mainWindowActivated()));
connect(core, SIGNAL(contextChanged(Core::IContext*)), connect(core, SIGNAL(contextChanged(Core::IContext*,QList<int>)),
this, SLOT(syncWithEditor(Core::IContext*))); this, SLOT(syncWithEditor(Core::IContext*)));
const QSettings *s = core->settings(); const QSettings *s = core->settings();
......
...@@ -374,7 +374,7 @@ ...@@ -374,7 +374,7 @@
*/ */
/*! /*!
\fn void ICore::contextChanged(Core::IContext *context) \fn void ICore::contextChanged(Core::IContext *context, const QList<int> &additionalContexts)
\brief Sent just after a new \a context became the current context \brief Sent just after a new \a context became the current context
(meaning that its widget got focus). (meaning that its widget got focus), or if the additional context ids changed.
*/ */
...@@ -124,7 +124,7 @@ signals: ...@@ -124,7 +124,7 @@ signals:
void optionsDialogRequested(); void optionsDialogRequested();
void coreAboutToClose(); void coreAboutToClose();
void contextAboutToChange(Core::IContext *context); void contextAboutToChange(Core::IContext *context);
void contextChanged(Core::IContext *context); void contextChanged(Core::IContext *context, const QList<int> &additionalContexts);
}; };
} // namespace Core } // namespace Core
......
...@@ -1096,7 +1096,6 @@ void MainWindow::updateContextObject(IContext *context) ...@@ -1096,7 +1096,6 @@ void MainWindow::updateContextObject(IContext *context)
if (debugMainWindow) if (debugMainWindow)
qDebug() << "new context object =" << context << (context ? context->widget() : 0) qDebug() << "new context object =" << context << (context ? context->widget() : 0)
<< (context ? context->widget()->metaObject()->className() : 0); << (context ? context->widget()->metaObject()->className() : 0);
emit m_coreImpl->contextChanged(context);
} }
} }
...@@ -1215,6 +1214,7 @@ void MainWindow::updateContext() ...@@ -1215,6 +1214,7 @@ void MainWindow::updateContext()
} }
m_actionManager->setContext(uniquecontexts); m_actionManager->setContext(uniquecontexts);
emit m_coreImpl->contextChanged(m_activeContext, m_additionalContexts);
} }
void MainWindow::aboutToShowRecentFiles() void MainWindow::aboutToShowRecentFiles()
......
...@@ -173,7 +173,7 @@ StateListener::StateListener(QObject *parent) : ...@@ -173,7 +173,7 @@ StateListener::StateListener(QObject *parent) :
QObject(parent) QObject(parent)
{ {
Core::ICore *core = Core::ICore::instance(); Core::ICore *core = Core::ICore::instance();
connect(core, SIGNAL(contextChanged(Core::IContext *)), connect(core, SIGNAL(contextChanged(Core::IContext*,QList<int>)),
this, SLOT(slotStateChanged())); this, SLOT(slotStateChanged()));
connect(core->fileManager(), SIGNAL(currentFileChanged(QString)), connect(core->fileManager(), SIGNAL(currentFileChanged(QString)),
this, SLOT(slotStateChanged())); this, SLOT(slotStateChanged()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment