Skip to content

Commit

Permalink
itemSync: Fix redundant UI updates
Browse files Browse the repository at this point in the history
Missing comparison operator on custom private data caused triggering
redundant updates because the app incorrectly assumed that the data
always changed.

Fixes #2649
  • Loading branch information
hluk committed Aug 21, 2024
1 parent e689538 commit 52c3d2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/itemsync/filewatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ class SyncDataFile {
return dataMap.value(m_format).toByteArray();
}

bool operator==(const SyncDataFile &other) const {
return m_path == other.m_path
&& m_format == other.m_format;
}

private:
QString m_path;
QString m_format;
Expand Down
4 changes: 4 additions & 0 deletions src/item/serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ class DataFile {
return f.readAll();
}

bool operator==(const DataFile &other) const {
return m_path == other.m_path;
}

private:
QString m_path;
};
Expand Down

0 comments on commit 52c3d2c

Please sign in to comment.