Commit f464de1c authored by Lasse Holmstedt's avatar Lasse Holmstedt
Browse files

Qml JS Inspector: Show "no context" element in crumble path when empty

parent 034798c0
......@@ -7,9 +7,10 @@ namespace QmlJSInspector {
namespace Internal {
ContextCrumblePath::ContextCrumblePath(QWidget *parent)
: CrumblePath(parent)
: CrumblePath(parent), m_isEmpty(true)
{
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
updateContextPath(QStringList());
}
ContextCrumblePath::~ContextCrumblePath()
......@@ -23,6 +24,11 @@ void ContextCrumblePath::updateContextPath(const QStringList &path)
foreach(const QString &pathPart, path) {
pushElement(pathPart);
}
m_isEmpty = path.isEmpty();
if (m_isEmpty) {
pushElement(tr("[no context]"));
}
}
} // namespace Internal
......
......@@ -16,7 +16,8 @@ public:
public slots:
void updateContextPath(const QStringList &path);
private:
bool m_isEmpty;
};
} // namespace Internal
......
......@@ -164,7 +164,6 @@ void Inspector::disconnected()
{
resetViews();
updateMenuActions();
applyChangesToQmlObserverHelper(false);
}
......@@ -324,7 +323,7 @@ void Inspector::startQmlProjectDebugger()
void Inspector::resetViews()
{
m_crumblePath->clear();
m_crumblePath->updateContextPath(QStringList());
}
void Inspector::simultaneouslyDebugQmlCppApplication()
......@@ -572,7 +571,6 @@ void Inspector::setSimpleDockWidgetArrangement()
mainWindow->removeDockWidget(m_crumblePathDock);
mainWindow->addDockWidget(Qt::BottomDockWidgetArea, m_crumblePathDock);
mainWindow->splitDockWidget(mainWindow->toolBarDockWidget(), m_crumblePathDock, Qt::Vertical);
//m_crumblePathDock->setVisible(true);
mainWindow->setTrackingEnabled(true);
}
......
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