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

This commit is contained in:
Lasse Holmstedt
2010-08-02 18:03:27 +02:00
parent 034798c0ef
commit f464de1cd5
3 changed files with 10 additions and 5 deletions

View File

@@ -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