diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2011-06-08 19:37:29 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2011-06-09 00:24:22 +0800 |
commit | 769cf77926d58dc75e1f031b15433522ecd8d9a2 (patch) | |
tree | 9cde7134b351c7b04e2c8aacfa845e88a43290e8 /lib | |
parent | 82088320c652f34543c82b790adf82019320d5a4 (diff) | |
download | gsoc2013-epiphany-769cf77926d58dc75e1f031b15433522ecd8d9a2.tar gsoc2013-epiphany-769cf77926d58dc75e1f031b15433522ecd8d9a2.tar.gz gsoc2013-epiphany-769cf77926d58dc75e1f031b15433522ecd8d9a2.tar.bz2 gsoc2013-epiphany-769cf77926d58dc75e1f031b15433522ecd8d9a2.tar.lz gsoc2013-epiphany-769cf77926d58dc75e1f031b15433522ecd8d9a2.tar.xz gsoc2013-epiphany-769cf77926d58dc75e1f031b15433522ecd8d9a2.tar.zst gsoc2013-epiphany-769cf77926d58dc75e1f031b15433522ecd8d9a2.zip |
Move the save/load accelerators methods to the ephy file utilities
Second patch in an attempt to clean up ephy-main.c
https://bugzilla.gnome.org/show_bug.cgi?id=652119
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ephy-file-helpers.c | 37 | ||||
-rw-r--r-- | lib/ephy-file-helpers.h | 2 |
2 files changed, 39 insertions, 0 deletions
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c index efd35cba4..64ea9179a 100644 --- a/lib/ephy-file-helpers.c +++ b/lib/ephy-file-helpers.c @@ -932,3 +932,40 @@ ephy_file_delete_uri (const char *uri) } g_object_unref (file); } + +static gchar * +get_accels_filename (void) +{ + const char *home; + + home = g_get_home_dir(); + if (!home) + return NULL; + return g_build_filename (home, GNOME_DOT_GNOME, "accels", PACKAGE, NULL); +} + +void +ephy_file_load_accels (void) +{ + char *filename; + + filename = get_accels_filename (); + if (!filename) + return; + + gtk_accel_map_load (filename); + g_free (filename); +} + +void +ephy_file_save_accels (void) +{ + char *filename; + + filename = get_accels_filename (); + if (!filename) + return; + + gtk_accel_map_save (filename); + g_free (filename); +} diff --git a/lib/ephy-file-helpers.h b/lib/ephy-file-helpers.h index e290f38c3..095f7135d 100644 --- a/lib/ephy-file-helpers.h +++ b/lib/ephy-file-helpers.h @@ -84,6 +84,8 @@ gboolean ephy_file_browse_to (GFile *file, void ephy_file_delete_directory (const char *path); void ephy_file_delete_uri (const char *uri); gboolean ephy_has_private_profile (void); +void ephy_file_load_accels (void); +void ephy_file_save_accels (void); G_END_DECLS |