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
|
||||
|
||||
Reference in New Issue
Block a user