[Bugfix] Sort network mounts alphabetically#3695
[Bugfix] Sort network mounts alphabetically#3695xavierjurado wants to merge 1 commit intolinuxmint:masterfrom
Conversation
src/nemo-places-sidebar.c
Outdated
| sort_mounts_func(gconstpointer a, | ||
| gconstpointer b) | ||
| { | ||
| g_autofree gchar *name_a, *name_b = NULL; |
There was a problem hiding this comment.
g_autofree can only be used on one variable at a time - you need to declare name_a and name_b on separate lines, or else name_b won't get freed automatically.
g_autofree gchar *name_a = NULL;
g_autofree gchar *name_b = NULL;though they don't necessarily need to initialize to NULL - in a simple function like this I think it's ok to combine it with the assignment below:
g_autofree gchar *name_a = g_mount_get_name (G_MOUNT(a));
g_autofree gchar *name_b = g_mount_get_name (G_MOUNT(b));The important thing is making sure these get some sort of value before the function exits, for autofree not to crash.
Also, please keep a space between function name and opening parentheses in all changes:
// good
return g_utf8_collate (name_a, name_b);
// bad
return g_utf8_collate(name_a, name_b);There was a problem hiding this comment.
Thanks for the review, I've just updated the PR.
b73634b to
bcc0305
Compare
|
@mtwebster on a somewhat related note, is there a list of issues suitable for new contributors? Not necessarily in this repository I guess, just looking for ways to help Mint. |
This is a fix for #3687, sorting network mounts alphabetically in the sidebar.
I didn't find any contributing guidelines in the repository, so please advice if something isn't quite right.