diff --git a/CHANGELOG.md b/CHANGELOG.md index e82540aa6d..c1cbf2d57b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # QOwnNotes Changelog +## 24.9.6 +- The note selection when selecting a note subfolder in the experimental + [note tree mode](https://github.com/pbek/QOwnNotes/issues/790) was fixed + (for [#3072](https://github.com/pbek/QOwnNotes/issues/3072)) + ## 24.9.5 - The name detection of links in checkbox list item for bookmarks for the [Web Companion browser extension](https://github.com/qownnotes/web-companion) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 967188b038..fe1867358f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -11295,8 +11295,14 @@ void MainWindow::on_noteTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int */ void MainWindow::on_noteTreeWidget_itemSelectionChanged() { qDebug() << __func__; - if (ui->noteTreeWidget->selectedItems().size() == 1) { - int noteId = ui->noteTreeWidget->selectedItems()[0]->data(0, Qt::UserRole).toInt(); + const auto &selectedItems = ui->noteTreeWidget->selectedItems(); + if (selectedItems.size() == 1) { + // Don't tread folders as notes + if (selectedItems[0]->data(0, Qt::UserRole + 1).toInt() == FolderType) { + return; + } + + int noteId = selectedItems[0]->data(0, Qt::UserRole).toInt(); Note note = Note::fetch(noteId); bool currentNoteChanged = currentNote.getId() != noteId; setCurrentNote(std::move(note), true, false);