-
-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: save collapse-state for note tree #2928
Conversation
src/mainwindow.cpp
Outdated
@@ -2123,6 +2123,8 @@ void MainWindow::loadNoteDirectoryList() { | |||
|
|||
ui->noteSubFolderTreeWidget->buildTreeForParentItem(noteFolderItem); | |||
noteFolderItem->setExpanded(true); | |||
connect(ui->noteTreeWidget, &QTreeWidget::itemExpanded, ui->noteSubFolderTreeWidget, &NoteSubFolderTree::onItemExpanded); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since loadNoteDirectoryList()
is called quite often, aren't those connect
statements executed multiple times too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah they should probably be moved someplace better. But I'm wondering why in the firstplace is the note list used for the tree, and not the directory view. Then no extra connect calls would be needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't even make sense to me that the NoteSubFolderTree is involved at all, the notes are also added to the NoteSubFolderTree now. I suspect that might be a big regression from a pull request from two years ago that moved lots of stuff around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the notes are also added to the NoteSubFolderTree now
Ok, the note sub-folder tree is disabled when I restart the application. Still strange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I'm wondering why in the firstplace is the note list used for the tree, and not the directory view.
Because the directory view lacks far more interaction for making notes work there than the notetree widget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the directory view lacks far more interaction for making notes work there than the notetree widget.
Got it. I guess NoteSubFolderTree is involved because the buildTreeForParentItem
method was found useful. It confused me at first since it's getting called on an item that's not a part of the NoteSubFolderTree, and I'm surprised it works. But that's fine. Anyway, I moved the connect() calls to a better place in the last commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a lot got mixed up in the "cleanup contribution" two years ago...
src/mainwindow.cpp
Outdated
@@ -506,6 +506,8 @@ void MainWindow::initTreeWidgets() { | |||
&MainWindow::onMultipleSubfoldersSelected); | |||
connect(ui->noteSubFolderTreeWidget, &NoteSubFolderTree::currentSubFolderChanged, this, | |||
&MainWindow::onCurrentSubFolderChanged); | |||
connect(ui->noteTreeWidget, &QTreeWidget::itemExpanded, ui->noteSubFolderTreeWidget, &NoteSubFolderTree::onItemExpanded); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only should be done in the experimental note tree mode!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the notelist can be expanded if not in experimental note tree mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the note list is a list by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only should be done in the experimental note tree mode!
Do you want to add the check? There is a method for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
69a7413
to
91a58f9
Compare
Part of the feature #790
Fixes #2924, #2520, #2204 and #2181
Woah, four in one!