From 2b0ab580b3eb16900228375908581254327d7ad7 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 25 Jul 2009 02:38:01 +0200 Subject: Fixing history menu --- src/modelmenu.cpp | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'src/modelmenu.cpp') diff --git a/src/modelmenu.cpp b/src/modelmenu.cpp index 41c197f3..1aa5be16 100644 --- a/src/modelmenu.cpp +++ b/src/modelmenu.cpp @@ -155,15 +155,6 @@ void ModelMenu::createMenu(const QModelIndex &parent, int max, QMenu *parentMenu if (!menu) { -// QString title = parent.data().toString(); -// menu = new QMenu(title, this); -// QIcon icon = qvariant_cast(parent.data(Qt::DecorationRole)); -// menu->setIcon(icon); -// parentMenu->addMenu(menu); -// QVariant v; -// v.setValue(parent); -// menu->menuAction()->setData(v); -// connect(menu, SIGNAL(aboutToShow()), this, SLOT(aboutToShow())); return; } @@ -177,20 +168,11 @@ void ModelMenu::createMenu(const QModelIndex &parent, int max, QMenu *parentMenu for (int i = 0; i < end; ++i) { QModelIndex idx = m_model->index(i, 0, parent); -// if (m_model->hasChildren(idx)) -// { -// createMenu(idx, -1, menu); -// } -// else -// { - if (m_separatorRole != 0 - && idx.data(m_separatorRole).toBool()) - addSeparator(); - else - menu->addAction(makeAction(idx)); -// } - if (menu == this && i == m_firstSeparator - 1) - addSeparator(); + + if( !m_model->hasChildren(idx) && ( m_separatorRole == 0 || !idx.data(m_separatorRole).toBool() ) ) + { + menu->addAction(makeAction(idx)); + } } } -- cgit v1.2.1