Skip to content

Commit 0e4a626

Browse files
committed
#3072 fix: note selection when selecting subfolder in note tree mode
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
1 parent cd89386 commit 0e4a626

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# QOwnNotes Changelog
22

3+
## 24.9.6
4+
- The note selection when selecting a note subfolder in the experimental
5+
[note tree mode](https://github.com/pbek/QOwnNotes/issues/790) was fixed
6+
(for [#3072](https://github.com/pbek/QOwnNotes/issues/3072))
7+
38
## 24.9.5
49
- The name detection of links in checkbox list item for bookmarks for the
510
[Web Companion browser extension](https://github.com/qownnotes/web-companion)

src/mainwindow.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11295,8 +11295,14 @@ void MainWindow::on_noteTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int
1129511295
*/
1129611296
void MainWindow::on_noteTreeWidget_itemSelectionChanged() {
1129711297
qDebug() << __func__;
11298-
if (ui->noteTreeWidget->selectedItems().size() == 1) {
11299-
int noteId = ui->noteTreeWidget->selectedItems()[0]->data(0, Qt::UserRole).toInt();
11298+
const auto &selectedItems = ui->noteTreeWidget->selectedItems();
11299+
if (selectedItems.size() == 1) {
11300+
// Don't tread folders as notes
11301+
if (selectedItems[0]->data(0, Qt::UserRole + 1).toInt() == FolderType) {
11302+
return;
11303+
}
11304+
11305+
int noteId = selectedItems[0]->data(0, Qt::UserRole).toInt();
1130011306
Note note = Note::fetch(noteId);
1130111307
bool currentNoteChanged = currentNote.getId() != noteId;
1130211308
setCurrentNote(std::move(note), true, false);

0 commit comments

Comments
 (0)