diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-24 16:58:48 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-24 16:58:48 +0200 |
| commit | 06cfa9352e1da8ffb44e35a28523755db8dbf7e2 (patch) | |
| tree | a36ee4a5b0d6370148e0a096a5d5cc8e1a484f8e /src/agendaview.cpp | |
| parent | c015b7efe076222d34e1a32e1cfa8457be1cf309 (diff) | |
| download | qtmaildir-06cfa9352e1da8ffb44e35a28523755db8dbf7e2.tar.gz qtmaildir-06cfa9352e1da8ffb44e35a28523755db8dbf7e2.zip | |
fix: swallow the calendar more-line double-click and clear the agenda selection
Diffstat (limited to 'src/agendaview.cpp')
| -rw-r--r-- | src/agendaview.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/agendaview.cpp b/src/agendaview.cpp index 1808906..50f8a3f 100644 --- a/src/agendaview.cpp +++ b/src/agendaview.cpp @@ -73,6 +73,12 @@ void AgendaView::setItems(const QList<CalendarItem> &items) void AgendaView::setSelected(int item) { + // Headers carry -1 in kItemRole, so a bare loop would match the first + // header for "nothing selected" and leave the previous row highlighted. + if (item < 0) { + clearSelection(); + return; + } for (int r = 0; r < count(); ++r) { if (this->item(r)->data(kItemRole).toInt() == item) { setCurrentRow(r); |
