diff options
author | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2012-12-16 23:00:41 -0300 |
---|---|---|
committer | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2012-12-16 23:00:41 -0300 |
commit | 64e7281e1de56c45a3cb6a75adbb7bf9a82eff21 (patch) | |
tree | 92a2b81be07368a632354b844675aa8c55b31ead /libqmenumodel/src/qmenumodel.h | |
parent | b601ff786a6c385f0a293e18d5947b4e79b46235 (diff) | |
download | qmenumodel-64e7281e1de56c45a3cb6a75adbb7bf9a82eff21.tar.gz qmenumodel-64e7281e1de56c45a3cb6a75adbb7bf9a82eff21.tar.bz2 qmenumodel-64e7281e1de56c45a3cb6a75adbb7bf9a82eff21.zip |
Fixed model changes and singal.
Try to keep the module unchanged until the function begin[Insert|Remove]Rows is called.
Diffstat (limited to 'libqmenumodel/src/qmenumodel.h')
-rw-r--r-- | libqmenumodel/src/qmenumodel.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libqmenumodel/src/qmenumodel.h b/libqmenumodel/src/qmenumodel.h index b6f2d37..d83a35c 100644 --- a/libqmenumodel/src/qmenumodel.h +++ b/libqmenumodel/src/qmenumodel.h @@ -54,6 +54,7 @@ public: Q_SIGNALS: void countChanged(); + void aboutToRemoveLink(QMenuModel *link, int row); protected: QMenuModel(GMenuModel *other=0, QObject *parent=0); @@ -69,12 +70,18 @@ private: guint m_signalChangedId; guint m_rowCount; - QVariant getStringAttribute(const QModelIndex &index, const QString &attribute) const; - QVariant getLink(const QModelIndex &index, const QString &linkName) const; - QVariant getExtraProperties(const QModelIndex &index) const; + //control variables + int m_currentOperationPosition; + int m_currentOperationAdded; + int m_currentOperationRemoved; + + QVariant getStringAttribute(int row, const QString &attribute) const; + QVariant getLink(int row, const QString &linkName) const; + QVariant getExtraProperties(int row) const; QString parseExtraPropertyName(const QString &name) const; void clearModel(bool destructor=false); int count() const; + int rowIndex(const QModelIndex &index) const; static void onItemsChanged(GMenuModel *model, gint position, gint removed, gint added, gpointer data); }; |