1
0
mirror of https://gitlab.gnome.org/GNOME/evince synced 2024-07-04 16:48:55 +00:00

ev-application: remove loading and saving of custom accels file

This is an undocumented feature, since the ability to change shortcuts
was removed somewhere in GTK 3.10, according to the commit that
updated the documentation: 54f43719c6

The shortcuts documentation was later completely removed in
a050ee73d7 since the help-overlay in the
shell takes care of it.

Another reason to drop this is the lack of first-class support in
GTK4:

"There is no direct replacement for loading and saving accelerators
with GtkAccelMap. But since GtkShortcutController implements
GListModel and both GtkShortcutTrigger and GtkShortcutAction can be
serialized to strings, it is relatively easy to implement saving and
loading yourself."

So in GTK4 it's possible, but requires further development. Which is
likely of very little use for an undocumented feature introduced 15
years ago as a copy-paste in 83a7a11ba1

Relates !373
This commit is contained in:
Pablo Correa Gómez 2023-05-20 08:28:46 +02:00 committed by Germán Poo-Caamaño
parent c6251bdead
commit 607dab949e

View File

@ -809,46 +809,6 @@ ev_application_open_uri_list (EvApplication *application,
}
}
static void
ev_application_accel_map_save (EvApplication *application)
{
gchar *accel_map_file;
gchar *tmp_filename;
gint fd;
accel_map_file = g_build_filename (application->dot_dir, "accels", NULL);
tmp_filename = g_strdup_printf ("%s.XXXXXX", accel_map_file);
fd = g_mkstemp (tmp_filename);
if (fd == -1) {
g_free (accel_map_file);
g_free (tmp_filename);
return;
}
gtk_accel_map_save_fd (fd);
close (fd);
g_mkdir_with_parents (application->dot_dir, 0700);
if (g_rename (tmp_filename, accel_map_file) == -1) {
/* FIXME: win32? */
g_unlink (tmp_filename);
}
g_free (accel_map_file);
g_free (tmp_filename);
}
static void
ev_application_accel_map_load (EvApplication *application)
{
gchar *accel_map_file;
accel_map_file = g_build_filename (application->dot_dir, "accels", NULL);
gtk_accel_map_load (accel_map_file);
g_free (accel_map_file);
}
static void
ev_application_startup (GApplication *gapplication)
{
@ -926,8 +886,6 @@ ev_application_shutdown (GApplication *gapplication)
#endif
g_clear_pointer (&application->uri, g_free);
ev_application_accel_map_save (application);
g_clear_pointer (&application->dot_dir, g_free);
G_APPLICATION_CLASS (ev_application_parent_class)->shutdown (gapplication);
@ -1027,8 +985,6 @@ ev_application_init (EvApplication *ev_application)
{
ev_application->dot_dir = g_build_filename (g_get_user_config_dir (),
"evince", NULL);
ev_application_accel_map_load (ev_application);
}
gboolean