┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dolphinmodel.cpp')
-rw-r--r--src/dolphinmodel.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/dolphinmodel.cpp b/src/dolphinmodel.cpp
index f399c3304..c5ea06a36 100644
--- a/src/dolphinmodel.cpp
+++ b/src/dolphinmodel.cpp
@@ -70,7 +70,12 @@ bool DolphinModel::setData(const QModelIndex& index, const QVariant& value, int
const QPersistentModelIndex key = index;
const RevisionState state = static_cast<RevisionState>(value.toInt());
if (m_revisionHash.value(key, LocalRevision) != state) {
- m_hasRevisionData = true;
+ if (!m_hasRevisionData) {
+ connect(this, SIGNAL(rowsRemoved (const QModelIndex&, int, int)),
+ this, SLOT(slotRowsRemoved(const QModelIndex&, int, int)));
+ m_hasRevisionData = true;
+ }
+
m_revisionHash.insert(key, state);
emit dataChanged(index, index);
return true;
@@ -138,6 +143,16 @@ bool DolphinModel::hasRevisionData() const
return m_hasRevisionData;
}
+void DolphinModel::slotRowsRemoved(const QModelIndex& parent, int start, int end)
+{
+ Q_ASSERT(hasRevisionData());
+
+ const int column = parent.column();
+ for (int row = start; row <= end; ++row) {
+ m_revisionHash.remove(parent.child(row, column));
+ }
+}
+
QVariant DolphinModel::displayRoleData(const QModelIndex& index) const
{
QString retString;