CrumblePath: Add check for child count

Change-Id: Ic8f0ceba7b70048d284f0d3bf75c51615ab7d9d4
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Aurindam Jana
2012-04-13 13:19:57 +02:00
committed by Kai Koehne
parent 1378c067a0
commit aa4c3f2332
2 changed files with 3 additions and 1 deletions

View File

@@ -304,6 +304,7 @@ void CrumblePath::sortChildren(Qt::SortOrder order)
QPushButton *lastButton = d->m_buttons.last(); QPushButton *lastButton = d->m_buttons.last();
QMenu *childList = lastButton->menu(); QMenu *childList = lastButton->menu();
QTC_ASSERT(childList, return);
QList<QAction *> actions = childList->actions(); QList<QAction *> actions = childList->actions();
if (order == Qt::AscendingOrder) if (order == Qt::AscendingOrder)

View File

@@ -66,6 +66,7 @@ void ContextCrumblePath::addChildren(const QStringList &childrenNames, const QLi
addChild(childrenNames[i], childrenDebugIds[i]); addChild(childrenNames[i], childrenDebugIds[i]);
//Sort them alphabetically //Sort them alphabetically
if (childrenDebugIds.count())
sortChildren(); sortChildren();
} }