From 8b3091dea7eb0e975f40f8cb7ffaa8bb8a36ffdb Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Tue, 19 Nov 2002 21:25:37 +0000 Subject: Disabled for now. * main.c (upgrade_from_1_0_if_needed): Disabled for now. * e-shell-startup-wizard.c: Removed member config_listener from struct SWData. (e_shell_startup_wizard_create): Updated accordingly, just use GConf, checking the /apps/evolution/mail/account-list key. (finish_func): Use GConf. * e-shell-config-default-folders.c: Removed member config_listener in struct EvolutionDefaultFolderConfig. (e_shell_config_default_folders_create_widget): Do not initialize here. GConfified the paths. (config_control_destroy_notify): No unref of the config_listener anymore. (config_control_apply_cb): Use GConf. (setup_folder_selector): Likewise. * e-shell-config-autocompletion.c: Removed member config_listener from EvolutionAutocompletionConfig. (config_control_destroy_notify): Do not unref. (config_control_apply_callback): Use a GConfClient. * e-folder-list.c (e_folder_list_init): Add missing cast. * main.c (show_development_warning): Use GConf. * e-setup.c (e_setup_check_config): Removed arg @listener. GConfified. * e-shell-view.c (e_shell_view_save_defaults): New. (e_shell_view_save_settings): Removed. (e_shell_view_load_settings): Removed. (setup_defaults): New helper function. (e_shell_view_construct): New arg @uri. (e_shell_view_new): New arg @uri. * e-shell.c: Removed member config_listener in struct EShellPrivate. (impl_dispose): Do not unref. (init): Do not initialize. (get_config_start_offline): New helper function. (e_shell_construct): Use this to get the startup mode in case E_SHELL_STARTUP_LINE_MODE_CONFIG. (save_misc_settings): Changed to use GConfClient instead of EConfigListener. (e_shell_create_view_from_settings): Removed. (e_shell_restore_from_settings): Removed. (e_shell_get_config_listener): Removed. (e_shell_disconnect_db): Removed. (parse_default_uri): Use GConf. * main.c (idle_cb): Simplified the logic here. Always assume that the view will be created with the default folder open by just using e_shell_create_view(). svn path=/trunk/; revision=18844 --- shell/e-setup.c | 83 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 37 deletions(-) (limited to 'shell/e-setup.c') diff --git a/shell/e-setup.c b/shell/e-setup.c index 2ad5c0c151..6befdb8e92 100644 --- a/shell/e-setup.c +++ b/shell/e-setup.c @@ -25,6 +25,21 @@ #include #endif +#include "e-setup.h" + +#include "e-local-folder.h" +#include "e-shell-config.h" +#include "e-shell-constants.h" + +#include + +#include + +#include + +#include +#include + #include #include #include @@ -33,17 +48,6 @@ #include #include -#include -#include -#include -#include - -#include "e-local-folder.h" -#include "e-shell-config.h" -#include "e-shell-constants.h" - -#include "e-setup.h" - static GList * check_dir_recur (const char *evolution_directory, @@ -417,34 +421,39 @@ e_setup (const char *evolution_directory) void -e_setup_check_config (EConfigListener *listener, - const char *evolution_directory) +e_setup_check_config (const char *evolution_directory) { + GConfClient *client; + char *tmp; char *uri; - if (e_config_listener_get_string_with_default (listener, "/DefaultFolders/mail_path", NULL, NULL) == NULL) { - e_config_listener_set_string (listener, "/DefaultFolders/mail_path", E_LOCAL_INBOX_URI); - uri = g_strconcat ("file://", evolution_directory, "/local", - strrchr (E_LOCAL_INBOX_URI, '/'), NULL); - e_config_listener_set_string (listener, "/DefaultFolders/mail_uri", uri); - g_free (uri); - - e_config_listener_set_string (listener, "/DefaultFolders/contacts_path", E_LOCAL_CONTACTS_URI); - uri = g_strconcat ("file://", evolution_directory, "/local", - strrchr (E_LOCAL_CONTACTS_URI, '/'), NULL); - e_config_listener_set_string (listener, "/DefaultFolders/contacts_uri", uri); - g_free (uri); - - e_config_listener_set_string (listener, "/DefaultFolders/calendar_path", E_LOCAL_CALENDAR_URI); - uri = g_strconcat ("file://", evolution_directory, "/local", - strrchr (E_LOCAL_CALENDAR_URI, '/'), NULL); - e_config_listener_set_string (listener, "/DefaultFolders/calendar_uri", uri); - g_free (uri); - - e_config_listener_set_string (listener, "/DefaultFolders/tasks_path", E_LOCAL_TASKS_URI); - uri = g_strconcat ("file://", evolution_directory, "/local", - strrchr (E_LOCAL_TASKS_URI, '/'), NULL); - e_config_listener_set_string (listener, "/DefaultFolders/tasks_uri", uri); - g_free (uri); + client = gconf_client_get_default (); + + tmp = gconf_client_get_string (client, "/apps/evolution/shell/default_folders/mail_path", NULL); + if (tmp != NULL && *tmp != 0) { + g_object_unref (client); + return; } + + gconf_client_set_string (client, "/apps/evolution/shell/default_folders/mail_path", E_LOCAL_INBOX_URI, NULL); + uri = g_strconcat ("file://", evolution_directory, "/local", strrchr (E_LOCAL_INBOX_URI, '/'), NULL); + gconf_client_set_string (client, "/apps/evolution/shell/default_folders/mail_uri", uri, NULL); + g_free (uri); + + gconf_client_set_string (client, "/apps/evolution/shell/default_folders/contacts_path", E_LOCAL_CONTACTS_URI, NULL); + uri = g_strconcat ("file://", evolution_directory, "/local", strrchr (E_LOCAL_CONTACTS_URI, '/'), NULL); + gconf_client_set_string (client, "/apps/evolution/shell/default_folders/contacts_uri", uri, NULL); + g_free (uri); + + gconf_client_set_string (client, "/apps/evolution/shell/default_folders/tasks_path", E_LOCAL_TASKS_URI, NULL); + uri = g_strconcat ("file://", evolution_directory, "/local", strrchr (E_LOCAL_TASKS_URI, '/'), NULL); + gconf_client_set_string (client, "/apps/evolution/shell/default_folders/tasks_uri", uri, NULL); + g_free (uri); + + gconf_client_set_string (client, "/apps/evolution/shell/default_folders/calendar_path", E_LOCAL_CALENDAR_URI, NULL); + uri = g_strconcat ("file://", evolution_directory, "/local", strrchr (E_LOCAL_CALENDAR_URI, '/'), NULL); + gconf_client_set_string (client, "/apps/evolution/shell/default_folders/calendar_uri", uri, NULL); + g_free (uri); + + g_object_unref (client); } -- cgit v1.2.3