-
Notifications
You must be signed in to change notification settings - Fork 328
Sidebar treeview for better navigation #3621
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
Conversation
found memory leak in nemo-places-sidebar.c in nemo_places_sidebar_dispose
|
I Started to integrate with nemo-tree-sidebar-model. |
|
I made progress with FMTreeModel (nemo-tree-sidebar-model.*). To use FMTreeModel I made some extensions:
The code of nemo-tree-sidebar-model (FMTreeModel) si completly backward compatible. nemo-tree-sidebar can use the new changes without any change. |
…iles_changed_id);
|
I think, I'm done withe the tree view implementation in nemo-places-sidebar.c It is easy to implement the new feature in a separate file. I decided not to do this, because it doubles the code functionality. Hope to get some feedback if everything is ok so far. |
| g_free (node->display_name); node->display_name=NULL; | ||
| object_unref_if_not_NULL (node->icon); node->icon = NULL; | ||
| object_unref_if_not_NULL (node->closed_icon); node->closed_icon=NULL; | ||
| object_unref_if_not_NULL (node->open_icon); node->open_icon=NULL; |
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.
As I've mentioned in another pull request, g_clear_object() already does what you're trying to do here. That's its reason for existing, to do exactly this here.
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 does, but not for g_free (first line).
It was not in the original code and helps to find dangling pointers if cleared memory is set to NULL. Sure g_clear_object with a reference to the pointer does the same.
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.
Agree, thats the better code:
g_clear_object (&node->file);
g_free (node->display_name); node->display_name=NULL;
g_clear_object (&node->icon);
g_clear_object (&node->closed_icon);
g_clear_object (&node->open_icon);
(and object_unref_if_not_NULL is not needed)
| g_settings_bind (settings, prefs, | ||
| gtk_builder_get_object (builder, widget_name), | ||
| object, | ||
| "active", G_SETTINGS_BIND_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.
Missing objects are a programmer error, there's no point in having a warning here.
|
I tried this, a couple of initial observations:
I'm not really digging this, and it's not something I think is widely asked for. I'd probably add bookmarks and XDG locations to the existing treeview sidebar before overhauling the Places sidebar. It already has devices there. |
|
Following replies:
You think that feature is not really needed? So all Windows users use and like it. Not having a real good tree view for me was a show stopper for usage of Linux Mint. That was the reason, I implemented it, and I think I'm not the only person missing that. |
I had an idea to improve navigation in nemo by extending its functionality. (similar like Windows Explorer)
Currently, toggling between the Tree View and Places sidebar feels inefficient, so I explored ways to enhance this experience. I kept the idea and the existing two levels of the side pane, but extended the tree view in the next levels showing the file system directories.
The feature van easy being switched on/off by setting the boolean sidebar->use_file_treeview = TRUE;
I also fixed some memory leaks in the existing implementation.
Key navigation similar to Windows Explorer is also possible with the arrow keys when the widget is active.
The TreeView supports lazy loading and update when the underlying filesystem changes.
Switching to display hidden files h filters also the displayed tree view.
I added this discussion earlier discussion: https://github.com/orgs/linuxmint/discussions/1169