Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -7,9 +7,10 @@ namespace QmlJSInspector { ...@@ -7,9 +7,10 @@ namespace QmlJSInspector {
namespace Internal { namespace Internal {
ContextCrumblePath::ContextCrumblePath(QWidget *parent) ContextCrumblePath::ContextCrumblePath(QWidget *parent)
: CrumblePath(parent) : CrumblePath(parent), m_isEmpty(true)
{ {
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
updateContextPath(QStringList());
} }
ContextCrumblePath::~ContextCrumblePath() ContextCrumblePath::~ContextCrumblePath()
...@@ -23,6 +24,11 @@ void ContextCrumblePath::updateContextPath(const QStringList &path) ...@@ -23,6 +24,11 @@ void ContextCrumblePath::updateContextPath(const QStringList &path)
foreach(const QString &pathPart, path) { foreach(const QString &pathPart, path) {
pushElement(pathPart); pushElement(pathPart);
} }
m_isEmpty = path.isEmpty();
if (m_isEmpty) {
pushElement(tr("[no context]"));
}
} }
} // namespace Internal } // namespace Internal
......
...@@ -16,7 +16,8 @@ public: ...@@ -16,7 +16,8 @@ public:
public slots: public slots:
void updateContextPath(const QStringList &path); void updateContextPath(const QStringList &path);
private:
bool m_isEmpty;
}; };
} // namespace Internal } // namespace Internal
......
...@@ -164,7 +164,6 @@ void Inspector::disconnected() ...@@ -164,7 +164,6 @@ void Inspector::disconnected()
{ {
resetViews(); resetViews();
updateMenuActions(); updateMenuActions();
applyChangesToQmlObserverHelper(false); applyChangesToQmlObserverHelper(false);
} }
...@@ -324,7 +323,7 @@ void Inspector::startQmlProjectDebugger() ...@@ -324,7 +323,7 @@ void Inspector::startQmlProjectDebugger()
void Inspector::resetViews() void Inspector::resetViews()
{ {
m_crumblePath->clear(); m_crumblePath->updateContextPath(QStringList());
} }
void Inspector::simultaneouslyDebugQmlCppApplication() void Inspector::simultaneouslyDebugQmlCppApplication()
...@@ -572,7 +571,6 @@ void Inspector::setSimpleDockWidgetArrangement() ...@@ -572,7 +571,6 @@ void Inspector::setSimpleDockWidgetArrangement()
mainWindow->removeDockWidget(m_crumblePathDock); mainWindow->removeDockWidget(m_crumblePathDock);
mainWindow->addDockWidget(Qt::BottomDockWidgetArea, m_crumblePathDock); mainWindow->addDockWidget(Qt::BottomDockWidgetArea, m_crumblePathDock);
mainWindow->splitDockWidget(mainWindow->toolBarDockWidget(), m_crumblePathDock, Qt::Vertical); mainWindow->splitDockWidget(mainWindow->toolBarDockWidget(), m_crumblePathDock, Qt::Vertical);
//m_crumblePathDock->setVisible(true);
mainWindow->setTrackingEnabled(true); mainWindow->setTrackingEnabled(true);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment