[epiphany/gdbus: 3/6] ephy-file-helpers: move GTK+ accel load/save here
- From: Diego Escalante Urrelo <diegoe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gdbus: 3/6] ephy-file-helpers: move GTK+ accel load/save here
- Date: Sun, 8 May 2011 00:04:59 +0000 (UTC)
commit 7434563757a3f2c5e049725d8f74d77ddeeb0657
Author: Diego Escalante Urrelo <descalante igalia com>
Date: Sat May 7 16:45:59 2011 -0500
ephy-file-helpers: move GTK+ accel load/save here
Remove them from ephy-main, preparing for GtkApplication.
lib/ephy-file-helpers.c | 37 +++++++++++++++++++++++++++++++++++++
lib/ephy-file-helpers.h | 3 +++
src/ephy-main.c | 41 ++---------------------------------------
3 files changed, 42 insertions(+), 39 deletions(-)
---
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index efd35cb..64ea917 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 e290f38..3ecd78e 100644
--- a/lib/ephy-file-helpers.h
+++ b/lib/ephy-file-helpers.h
@@ -85,6 +85,9 @@ 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_save_accels (void);
+void ephy_file_load_accels (void);
+
G_END_DECLS
#endif /* EPHY_FILE_HELPERS_H */
diff --git a/src/ephy-main.c b/src/ephy-main.c
index f59ab23..17ebb8f 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -382,43 +382,6 @@ show_error_message (GError **error)
gtk_dialog_run (GTK_DIALOG (dialog));
}
-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);
-}
-
-static void
-load_accels (void)
-{
- char *filename;
-
- filename = get_accels_filename ();
- if (!filename)
- return;
-
- gtk_accel_map_load (filename);
- g_free (filename);
-}
-
-static void
-save_accels (void)
-{
- char *filename;
-
- filename = get_accels_filename ();
- if (!filename)
- return;
-
- gtk_accel_map_save (filename);
- g_free (filename);
-}
-
static void
shell_quit_cb (EphyShell *shell, gpointer data)
{
@@ -733,7 +696,7 @@ main (int argc,
}
ephy_stock_icons_init ();
- load_accels ();
+ ephy_file_load_accels ();
/* Work-around Flash Player crash */
g_setenv ("XLIB_SKIP_ARGB_VISUALS", "1", FALSE);
@@ -749,7 +712,7 @@ main (int argc,
/* Shutdown */
g_object_unref (ephy_shell);
- save_accels ();
+ ephy_file_save_accels ();
ephy_state_save ();
ephy_settings_shutdown ();
ephy_file_helpers_shutdown ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]