Skip to content

Commit 785e4d2

Browse files
committed
#3573 trash: fix local trash date sorting
1 parent 78178d8 commit 785e4d2

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## 26.4.17
44

5+
- Fixed sorting by the **Trashed** date in the **Locally trashed notes** dialog,
6+
which could be ordered incorrectly because the internal millisecond
7+
timestamps were compared as truncated 32-bit integers instead of full 64-bit
8+
values (for [#3573](https://github.com/pbek/QOwnNotes/issues/3573))
59
- Renamed the **Local trash** settings page to **Trash**, added a Qt 5.15+
610
**trash mode** selector for **No trashing**, **System trash**, and
711
**Local trash**, switched note deletion to `QFile::moveToTrash()` when

src/dialogs/localtrashdialog.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ class LocalTrashTreeWidgetItem : public QTreeWidgetItem {
2121

2222
// allow sorting for the date column
2323
if (column == 1) {
24-
return data(column, Qt::UserRole).toInt() < other.data(column, Qt::UserRole).toInt();
24+
return data(column, Qt::UserRole).toLongLong() <
25+
other.data(column, Qt::UserRole).toLongLong();
2526
}
2627

2728
return text(column).toLower() < other.text(column).toLower();

0 commit comments

Comments
 (0)