forked from qt-creator/qt-creator
Qml JS Inspector: Show "no context" element in crumble path when empty
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user