aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel/src/qmenumodel.h
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-12-17 18:37:53 +0000
committerTarmac <>2012-12-17 18:37:53 +0000
commitdf3cd0cf4d594e4b4693fc1d4c3b08cea8d736d9 (patch)
tree359130c016a58e9d70636ae5d89c6e268a216e2f /libqmenumodel/src/qmenumodel.h
parentc7cd7a43482319d81a2eade26d911b1e05a17441 (diff)
parentc34c5af8a6990f0af95d8dce59991868bfdc62d3 (diff)
downloadqmenumodel-df3cd0cf4d594e4b4693fc1d4c3b08cea8d736d9.tar.gz
qmenumodel-df3cd0cf4d594e4b4693fc1d4c3b08cea8d736d9.tar.bz2
qmenumodel-df3cd0cf4d594e4b4693fc1d4c3b08cea8d736d9.zip
Try to keep the module unchanged until the function begin[Insert|Remove]Rows is called. Fixes: https://bugs.launchpad.net/bugs/1090305.
Approved by Gustavo Pichorim Boiko, Lars Uebernickel, PS Jenkins bot.
Diffstat (limited to 'libqmenumodel/src/qmenumodel.h')
-rw-r--r--libqmenumodel/src/qmenumodel.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/libqmenumodel/src/qmenumodel.h b/libqmenumodel/src/qmenumodel.h
index f186b5f..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);
@@ -67,13 +68,20 @@ private:
QHash<int, QMenuModel*>* m_cache;
GMenuModel *m_menuModel;
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);
};