summaryrefslogtreecommitdiffstats
path: root/common/bufferadaptor.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-30 15:13:10 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-30 15:13:10 +0200
commitef9a070c10dffc346b7dee0c7714d7bda7663017 (patch)
tree9b333451c2fdd42df1dd0d6a9586bd44573fbae5 /common/bufferadaptor.h
parentae20c6efd1051d48c367f97b96812f305b4d0819 (diff)
downloadsink-ef9a070c10dffc346b7dee0c7714d7bda7663017.tar.gz
sink-ef9a070c10dffc346b7dee0c7714d7bda7663017.zip
Properly track changes applied by preprocessors
This is necessary so we get the actual changeset during replay, so a mark-as-read action doesn't result in a new mime message, but only the flag change.
Diffstat (limited to 'common/bufferadaptor.h')
-rw-r--r--common/bufferadaptor.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/common/bufferadaptor.h b/common/bufferadaptor.h
index ad50582..2a40d18 100644
--- a/common/bufferadaptor.h
+++ b/common/bufferadaptor.h
@@ -82,15 +82,29 @@ public:
82 } 82 }
83 virtual void setProperty(const QByteArray &key, const QVariant &value) 83 virtual void setProperty(const QByteArray &key, const QVariant &value)
84 { 84 {
85 if (value != mValues.value(key)) {
86 mChanges << key;
87 }
85 mValues.insert(key, value); 88 mValues.insert(key, value);
86 } 89 }
90
87 virtual QByteArrayList availableProperties() const 91 virtual QByteArrayList availableProperties() const
88 { 92 {
89 return mValues.keys(); 93 return mValues.keys();
90 } 94 }
91 95
96 void resetChangedProperties()
97 {
98 mChanges.clear();
99 }
100
101 QList<QByteArray> changedProperties() const
102 {
103 return mChanges;
104 }
92private: 105private:
93 QHash<QByteArray, QVariant> mValues; 106 QHash<QByteArray, QVariant> mValues;
107 QList<QByteArray> mChanges;
94}; 108};
95} 109}
96} 110}