diff options
author | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2012-09-06 16:43:27 -0300 |
---|---|---|
committer | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2012-09-06 16:43:27 -0300 |
commit | 31f8103187d2e27b1bb76eaed10dc9c9be226c90 (patch) | |
tree | 5b0d6a0a6bf07aaf213c482c61860a2784cd678f /src/QMenuModel/qmenumodel.cpp | |
parent | 0dfd3d4cd4214a732e4a5cda59fd4dfc082b8425 (diff) | |
download | qmenumodel-31f8103187d2e27b1bb76eaed10dc9c9be226c90.tar.gz qmenumodel-31f8103187d2e27b1bb76eaed10dc9c9be226c90.tar.bz2 qmenumodel-31f8103187d2e27b1bb76eaed10dc9c9be226c90.zip |
Implemented QDBusActionGroup.
Diffstat (limited to 'src/QMenuModel/qmenumodel.cpp')
-rw-r--r-- | src/QMenuModel/qmenumodel.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/QMenuModel/qmenumodel.cpp b/src/QMenuModel/qmenumodel.cpp index 173dbbe..c7ccf56 100644 --- a/src/QMenuModel/qmenumodel.cpp +++ b/src/QMenuModel/qmenumodel.cpp @@ -1,7 +1,7 @@ #include "qmenumodel.h" #include <QDebug> -QMenuModel::QMenuModel(QObject *parent, GMenuModel *other) +QMenuModel::QMenuModel(GMenuModel *other, QObject *parent) : QAbstractListModel(parent), m_menuModel(0), m_signalChangedId(0) @@ -66,7 +66,6 @@ QVariant QMenuModel::data(const QModelIndex &index, int role) const int rowCountValue = rowCount(); if ((rowCountValue > 0) && (index.row() >= 0) && (index.row() < rowCountValue)) { - qDebug() << "GetData: " << index.row() << role; if (m_menuModel) { switch (role) { @@ -87,7 +86,6 @@ QVariant QMenuModel::data(const QModelIndex &index, int role) const } } } - qDebug() << "GetData done" << attribute; return attribute; } @@ -129,10 +127,8 @@ QVariant QMenuModel::getLink(const QModelIndex &index, index.row(), linkName.toLatin1()); - if (link) { - qDebug() << "link: " << (void*)link; - QMenuModel *other = new QMenuModel(const_cast<QMenuModel*>(this), link); - qDebug() << "link created: " << (void*)link; + if (link) { + QMenuModel *other = new QMenuModel(link, const_cast<QMenuModel*>(this)); return QVariant::fromValue<QObject*>(other); } @@ -147,8 +143,6 @@ void QMenuModel::onItemsChanged(GMenuModel *, { QMenuModel *self = reinterpret_cast<QMenuModel*>(data); - qDebug() << "model changed" << position << removed << added; - if (removed > 0) { self->beginRemoveRows(QModelIndex(), position, position + removed - 1); self->endRemoveRows(); @@ -158,6 +152,5 @@ void QMenuModel::onItemsChanged(GMenuModel *, self->beginInsertRows(QModelIndex(), position, position + added - 1); self->endInsertRows(); } - qDebug() << "model size: " << self->rowCount(); } |