diff options
author | JP Rosevear <jpr@helixcode.com> | 2000-08-04 22:58:43 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2000-08-04 22:58:43 +0800 |
commit | 09e1677c54c2620fe31cefcf18e869beaccba8f3 (patch) | |
tree | efaf5fa560e8f3f3f4387cbe6311508862c427e3 /shell/e-shell-view.c | |
parent | 660a75cc995f416ecc018b6ee278582651240631 (diff) | |
download | gsoc2013-evolution-09e1677c54c2620fe31cefcf18e869beaccba8f3.tar gsoc2013-evolution-09e1677c54c2620fe31cefcf18e869beaccba8f3.tar.gz gsoc2013-evolution-09e1677c54c2620fe31cefcf18e869beaccba8f3.tar.bz2 gsoc2013-evolution-09e1677c54c2620fe31cefcf18e869beaccba8f3.tar.lz gsoc2013-evolution-09e1677c54c2620fe31cefcf18e869beaccba8f3.tar.xz gsoc2013-evolution-09e1677c54c2620fe31cefcf18e869beaccba8f3.tar.zst gsoc2013-evolution-09e1677c54c2620fe31cefcf18e869beaccba8f3.zip |
Actually commit this - I though it went in already.
2000-08-03 JP Rosevear <jpr@helixcode.com>
* configure.in: Remove gconf check
2000-08-03 JP Rosevear <jpr@helixcode.com>
* mail-config.glade: Increase window size slightly, rename
"Transport" to "Mail Transport"
* mail-config.c (init_config): Remove gconf references
(clear_config): ditto
(read_config): ditto
(write_config): ditto
(mail_config): Null provider lists before filling them
(mail_config_druid): ditto
(identity_page_new): Increase spacing of vbox
(service_page_new): ditto
* Makefile.am: Remove gconf references.
2000-08-03 JP Rosevear <jpr@helixcode.com>
* e-shell.h: Remove gconf references
* e-shell-view.h: Remove gconf references
* main.c (idle_cb): Remove gconf references
* Makefile.am: Remove gconf cflags and libs
* e-shell-view.c (e_shell_view_load_settings): Change to use
gnome-config
(e_shell_view_save_settings): ditto
* e-shell.c (e_shell_restore_from_settings): Change to
use gnome_config
(save_settings_for_views): ditto
svn path=/trunk/; revision=4530
Diffstat (limited to 'shell/e-shell-view.c')
-rw-r--r-- | shell/e-shell-view.c | 79 |
1 files changed, 21 insertions, 58 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 414b9ddefc..ddf31747af 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -1128,124 +1128,87 @@ e_shell_view_get_current_uri (EShellView *shell_view) /** * e_shell_view_save_settings: * @shell_view: - * @gconf_client: * @prefix: * - * Save settings for @shell_view at the specified GConf @prefix through - * @gconf_client. + * Save settings for @shell_view at the specified gnome config @prefix * * Return value: TRUE if successful, FALSE if not. **/ gboolean e_shell_view_save_settings (EShellView *shell_view, - GConfClient *gconf_client, const char *prefix) { EShellViewPrivate *priv; - GConfError *err = NULL; const char *uri; - char *path; g_return_val_if_fail (shell_view != NULL, FALSE); g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), FALSE); - g_return_val_if_fail (gconf_client != NULL, FALSE); - g_return_val_if_fail (GCONF_IS_CLIENT (gconf_client), FALSE); g_return_val_if_fail (prefix != NULL, FALSE); - g_return_val_if_fail (g_path_is_absolute (prefix), FALSE); priv = shell_view->priv; -#define SET(type, key, value) \ - path = g_strconcat (prefix, "/", (key), NULL); \ - gconf_client_set_##type (gconf_client, path, (value), &err); \ - g_free (path); \ - if (err != NULL) { \ - gconf_error_destroy (err); \ - return FALSE; \ - } + gnome_config_push_prefix (prefix); - SET (int, "FolderBarMode", e_shell_view_get_folder_bar_mode (shell_view)) - SET (int, "ShortcutBarMode", e_shell_view_get_shortcut_bar_mode (shell_view)); - SET (int, "HPanedPosition", e_paned_get_position (E_PANED (priv->hpaned))); - SET (int, "ViewHPanedPosition", e_paned_get_position (E_PANED (priv->view_hpaned))); + gnome_config_set_int ("FolderBarMode", e_shell_view_get_folder_bar_mode (shell_view)); + gnome_config_set_int ("ShortcutBarMode", e_shell_view_get_shortcut_bar_mode (shell_view)); + gnome_config_set_int ("HPanedPosition", e_paned_get_position (E_PANED (priv->hpaned))); + gnome_config_set_int ("ViewHPanedPosition", e_paned_get_position (E_PANED (priv->view_hpaned))); uri = e_shell_view_get_current_uri (shell_view); - if (uri != NULL) { - SET (string, "DisplayedURI", uri); - } else { - path = g_strconcat (prefix, "/", "DisplayedURI", NULL); - gconf_client_unset (gconf_client, path, &err); - g_free (path); - - if (err != NULL) { - gconf_error_destroy (err); - return FALSE; - } - } - -#undef SET + if (uri != NULL) + gnome_config_set_string ("DisplayedURI", uri); + else + gnome_config_clean_section ("DisplayedURI"); + gnome_config_pop_prefix (); + return TRUE; } /** * e_shell_view_load_settings: * @shell_view: - * @gconf_client: * @prefix: * - * Load settings for @shell_view at the specified GConf @prefix through - * @gconf_client. + * Load settings for @shell_view at the specified gnome config @prefix * * Return value: **/ gboolean e_shell_view_load_settings (EShellView *shell_view, - GConfClient *gconf_client, const char *prefix) { EShellViewPrivate *priv; - GConfError *err = NULL; int val; char *stringval; char *path; g_return_val_if_fail (shell_view != NULL, FALSE); g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), FALSE); - g_return_val_if_fail (gconf_client != NULL, FALSE); - g_return_val_if_fail (GCONF_IS_CLIENT (gconf_client), FALSE); g_return_val_if_fail (prefix != NULL, FALSE); - g_return_val_if_fail (g_path_is_absolute (prefix), FALSE); priv = shell_view->priv; -#define GET(type, key, value) \ - path = g_strconcat (prefix, "/", (key), NULL); \ - (value) = gconf_client_get_##type (gconf_client, path, &err); \ - g_free (path); \ - if (err != NULL) { \ - gconf_error_destroy (err); \ - return FALSE; \ - } + gnome_config_push_prefix (prefix); - GET (int, "FolderBarMode", val); + val = gnome_config_get_int ("FolderBarMode"); e_shell_view_set_folder_bar_mode (shell_view, val); - GET (int, "ShortcutBarMode", val); + val = gnome_config_get_int ("ShortcutBarMode"); e_shell_view_set_shortcut_bar_mode (shell_view, val); - GET (int, "HPanedPosition", val); + val = gnome_config_get_int ("HPanedPosition"); e_paned_set_position (E_PANED (priv->hpaned), val); - GET (int, "ViewHPanedPosition", val); + val = gnome_config_get_int ("ViewHPanedPosition"); e_paned_set_position (E_PANED (priv->view_hpaned), val); - GET (string, "DisplayedURI", stringval); + stringval = gnome_config_get_string ("DisplayedURI"); e_shell_view_display_uri (shell_view, stringval); g_free (stringval); -#undef GET - + gnome_config_pop_prefix (); + return TRUE; } |