forked from qt-creator/qt-creator
Improve debugging of context changes
Add some more information to the core logging category. Change-Id: Ie2b4a473cfb4b5f721860457282ee668d828cefa Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1331,8 +1331,6 @@ static bool hideToolsMenu()
|
|||||||
return Core::ICore::settings()->value(Constants::SETTINGS_MENU_HIDE_TOOLS, false).toBool();
|
return Core::ICore::settings()->value(Constants::SETTINGS_MENU_HIDE_TOOLS, false).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
enum { debugMainWindow = 0 };
|
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
void ICorePrivate::init()
|
void ICorePrivate::init()
|
||||||
@@ -2332,11 +2330,6 @@ void ICorePrivate::updateContextObject(const QList<IContext *> &context)
|
|||||||
emit m_core->contextAboutToChange(context);
|
emit m_core->contextAboutToChange(context);
|
||||||
m_activeContext = context;
|
m_activeContext = context;
|
||||||
updateContext();
|
updateContext();
|
||||||
if (debugMainWindow) {
|
|
||||||
qDebug() << "new context objects =" << context;
|
|
||||||
for (const IContext *c : context)
|
|
||||||
qDebug() << (c ? c->widget() : nullptr) << (c ? c->widget()->metaObject()->className() : nullptr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ICorePrivate::readSettings()
|
void ICorePrivate::readSettings()
|
||||||
@@ -2417,8 +2410,17 @@ void ICorePrivate::updateContext()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (coreLog().isDebugEnabled()) {
|
if (coreLog().isDebugEnabled()) {
|
||||||
qCDebug(coreLog) << "context changed:"
|
qCDebug(coreLog) << "Context changed:";
|
||||||
|
qCDebug(coreLog) << " "
|
||||||
<< Utils::transform<QList<QString>>(uniquecontexts, &Id::toString);
|
<< Utils::transform<QList<QString>>(uniquecontexts, &Id::toString);
|
||||||
|
qCDebug(coreLog) << " "
|
||||||
|
<< Utils::transform<QList<QString>>(m_activeContext, [](IContext *c) {
|
||||||
|
return QString("%1: %2").arg(
|
||||||
|
QString::fromUtf8(c->metaObject()->className()),
|
||||||
|
c->widget()
|
||||||
|
? QString::fromUtf8(c->widget()->metaObject()->className())
|
||||||
|
: QString("<no widget>"));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
ActionManager::setContext(uniquecontexts);
|
ActionManager::setContext(uniquecontexts);
|
||||||
emit m_core->contextChanged(uniquecontexts);
|
emit m_core->contextChanged(uniquecontexts);
|
||||||
|
Reference in New Issue
Block a user