Skip to content

Fix order of actions in context menu #3334

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

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 3 additions & 25 deletions libnemo-private/nemo-action-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,37 +145,13 @@ sort_file_list_cb (gconstpointer a, gconstpointer b)
NemoFile *file_b;
const char *s0;
const char *s1;
gint r;

file_a = (NemoFile *) a;
file_b = (NemoFile *) b;
s0 = nemo_file_peek_name (file_a);
s1 = nemo_file_peek_name (file_b);
//
// Order alphabetically
// Compare ASCII values of file names char by char
// < 0: a < b
// == 0: a == b
// > 0: a > b
//
do {
char c0 = *s0++;
char c1 = *s1++;
if (c0 < c1) {
r = -1;
break;
}
if (c0 > c1) {
r = 1;
break;
}
if (c0 == 0) { // Special case: Both strings are identical and we have hit the \0 char? => Return equal
r = 0;
break;
}
} while (TRUE);

return r;
return g_strcmp0 (s0, s1);
}

static void
Expand Down Expand Up @@ -343,6 +319,8 @@ void_actions_for_directory (NemoActionManager *action_manager, NemoDirectory *di
}
}

new_list = g_list_reverse (new_list);

g_object_unref (dir);

tmp = action_manager->actions;
Expand Down