From 15ac6ceed3bdd975f2e8402f5794bd2c49f5a18e Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Sat, 4 Dec 2010 16:10:06 +0100 Subject: Clarify command line parameter string --- shell/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index 7f2bd0673b..b80283b6db 100644 --- a/shell/main.c +++ b/shell/main.c @@ -335,7 +335,8 @@ static GOptionEntry entries[] = { NULL, NULL }, #endif /* G_OS_WIN32 */ { "component", 'c', 0, G_OPTION_ARG_STRING, &requested_view, - N_("Start Evolution activating the specified component"), NULL }, + /* Translators: Do NOT translate the five component names, they MUST remain in English! */ + N_("Start Evolution showing the specified component. Available options are 'mail', 'calendar', 'contacts', 'tasks', and 'memos'"), NULL }, { "geometry", 'g', 0, G_OPTION_ARG_STRING, &geometry, N_("Apply the given geometry to the main window"), "GEOMETRY" }, { "offline", '\0', 0, G_OPTION_ARG_NONE, &start_offline, -- cgit v1.2.3 From e5cade617627dd50cd39d341cc7764fc8809b5c9 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 7 Dec 2010 15:40:32 +0100 Subject: Bug #590245 - 'evolution --force-shutdown' should kill factories --- shell/main.c | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index b80283b6db..da7a235a0a 100644 --- a/shell/main.c +++ b/shell/main.c @@ -317,8 +317,36 @@ setup_segv_redirect (void) g_static_mutex_lock (&segv_mutex); } +static void +quit_signal (gint sig) +{ + EShell *shell; + + g_return_if_fail (sig == SIGQUIT); + + g_print ("Received quit signal...\n"); + + shell = e_shell_get_default (); + if (shell) + e_shell_quit (shell, E_SHELL_QUIT_OPTION); +} + +static void +setup_quit_signal (void) +{ + struct sigaction sa, osa; + + sigaction (SIGQUIT, NULL, &osa); + + sa.sa_flags = 0; + sigemptyset (&sa.sa_mask); + sa.sa_handler = quit_signal; + sigaction (SIGQUIT, &sa, NULL); +} + #else #define setup_segv_redirect() (void)0 +#define setup_quit_signal() (void)0 #endif static GOptionEntry entries[] = { @@ -512,6 +540,17 @@ main (gint argc, gchar **argv) bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); + g_type_init (); + if (!g_thread_get_initialized ()) + g_thread_init (NULL); + + /* do not require Gtk+ for --force-shutdown */ + if (argc == 2 && argv[1] && g_str_equal (argv[1], "--force-shutdown")) { + shell_force_shutdown (); + + return 0; + } + #if HAVE_CLUTTER gtk_clutter_init_with_args ( &argc, &argv, @@ -532,10 +571,6 @@ main (gint argc, gchar **argv) exit (1); } - g_type_init (); - if (!g_thread_get_initialized ()) - g_thread_init (NULL); - #ifdef HAVE_ICAL_UNKNOWN_TOKEN_HANDLING ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN); #endif @@ -623,6 +658,7 @@ main (gint argc, gchar **argv) } setup_segv_redirect (); + setup_quit_signal (); if (evolution_debug_log) { gint fd; -- cgit v1.2.3 From a3ba231fcc2746e664a67c85d88eb49a64813989 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 9 Nov 2010 08:48:33 -0500 Subject: Drop backward-compatibility cruft. --- shell/main.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index da7a235a0a..bad10a3f5a 100644 --- a/shell/main.c +++ b/shell/main.c @@ -171,9 +171,6 @@ show_development_warning (void) gtk_dialog_add_button ( GTK_DIALOG (warning_dialog), GTK_STOCK_OK, GTK_RESPONSE_OK); -#if !GTK_CHECK_VERSION(2,90,7) - g_object_set (warning_dialog, "has-separator", FALSE, NULL); -#endif action_area = gtk_dialog_get_action_area (GTK_DIALOG (warning_dialog)); content_area = gtk_dialog_get_content_area (GTK_DIALOG (warning_dialog)); -- cgit v1.2.3 From 6af0c53b697c6981c1470c177b2c37e081635258 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 29 Jan 2011 10:50:53 -0500 Subject: Coding style and whitespace cleanup. --- shell/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index bad10a3f5a..f9c9651e49 100644 --- a/shell/main.c +++ b/shell/main.c @@ -360,8 +360,11 @@ static GOptionEntry entries[] = { NULL, NULL }, #endif /* G_OS_WIN32 */ { "component", 'c', 0, G_OPTION_ARG_STRING, &requested_view, - /* Translators: Do NOT translate the five component names, they MUST remain in English! */ - N_("Start Evolution showing the specified component. Available options are 'mail', 'calendar', 'contacts', 'tasks', and 'memos'"), NULL }, + /* Translators: Do NOT translate the five component + * names, they MUST remain in English! */ + N_("Start Evolution showing the specified component. " + "Available options are 'mail', 'calendar', 'contacts', " + "'tasks', and 'memos'"), NULL }, { "geometry", 'g', 0, G_OPTION_ARG_STRING, &geometry, N_("Apply the given geometry to the main window"), "GEOMETRY" }, { "offline", '\0', 0, G_OPTION_ARG_NONE, &start_offline, -- cgit v1.2.3 From e9f7d5d0215011d289c2a376548b7f86c22f3cc2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 30 Jan 2011 23:11:14 -0500 Subject: Port EShell to GtkApplication. --- shell/main.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index f9c9651e49..a27b6b9495 100644 --- a/shell/main.c +++ b/shell/main.c @@ -84,6 +84,8 @@ #include #endif +#define APPLICATION_ID "org.gnome.Evolution" + #define SKIP_WARNING_DIALOG_KEY \ "/apps/evolution/shell/skip_warning_dialog" @@ -257,7 +259,7 @@ idle_cb (gchar **uris) } /* If another Evolution process is running, we're done. */ - if (unique_app_is_running (UNIQUE_APP (shell))) + if (g_application_get_is_remote (G_APPLICATION (shell))) gtk_main_quit (); return FALSE; @@ -324,7 +326,8 @@ quit_signal (gint sig) g_print ("Received quit signal...\n"); shell = e_shell_get_default (); - if (shell) + + if (shell != NULL) e_shell_quit (shell, E_SHELL_QUIT_OPTION); } @@ -411,10 +414,12 @@ create_default_shell (void) { EShell *shell; GConfClient *client; - gboolean online = TRUE; + GApplicationFlags flags; const gchar *key; + gboolean online = TRUE; + gboolean is_meego = FALSE; + gboolean small_screen = FALSE; GError *error = NULL; - gboolean is_meego = FALSE, small_screen = FALSE; client = gconf_client_get_default (); @@ -457,9 +462,13 @@ create_default_shell (void) g_clear_error (&error); } - shell = g_object_new ( - E_TYPE_SHELL, - "name", "org.gnome.Evolution", + flags = G_APPLICATION_HANDLES_OPEN | + G_APPLICATION_HANDLES_COMMAND_LINE; + + shell = g_initable_new ( + E_TYPE_SHELL, NULL, &error, + "application-id", APPLICATION_ID, + "flags", flags, "geometry", geometry, "module-directory", EVOLUTION_MODULEDIR, "meego-mode", is_meego, @@ -468,6 +477,10 @@ create_default_shell (void) "online", online, NULL); + /* Failure to register is fatal. */ + if (error != NULL) + g_error ("%s", error->message); + if (force_online) e_shell_lock_network_available (shell); @@ -571,9 +584,9 @@ main (gint argc, gchar **argv) exit (1); } - #ifdef HAVE_ICAL_UNKNOWN_TOKEN_HANDLING +#ifdef HAVE_ICAL_UNKNOWN_TOKEN_HANDLING ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN); - #endif +#endif #ifdef G_OS_WIN32 path = g_build_path (";", _e_get_bindir (), g_getenv ("PATH"), NULL); @@ -622,6 +635,7 @@ main (gint argc, gchar **argv) setlocale (LC_ALL, "C"); } #endif + if (start_online && start_offline) { g_printerr ( _("%s: --online and --offline cannot be used " -- cgit v1.2.3 From 57ea14220ee233c2670743fd128835af2fc163c2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 28 Mar 2011 15:53:39 -0400 Subject: Remove the profiler plugin. This plugin was for developers, but no one uses it anymore. Plus the only profiling hooks left in Evolution were in the MessageList widget, which performs fine. There's better ways to collect profiling data these days anyway (sysprof, systemtap, etc.). --- shell/main.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index a27b6b9495..001d6bd843 100644 --- a/shell/main.c +++ b/shell/main.c @@ -66,7 +66,6 @@ #include "e-util/e-import.h" #include "e-util/e-plugin.h" #include "e-util/e-plugin-ui.h" -#include "e-util/e-profile-event.h" #include "e-util/e-util-private.h" #include "e-util/e-util.h" #ifdef G_OS_WIN32 @@ -721,9 +720,6 @@ main (gint argc, gchar **argv) /* Register built-in plugin hook types. */ es_event_hook_get_type (); e_import_hook_get_type (); -#ifdef ENABLE_PROFILING - e_profile_event_hook_get_type (); -#endif e_plugin_ui_hook_get_type (); /* All EPlugin and EPluginHook subclasses should be -- cgit v1.2.3 From 578214584caa7805edca09b27e2306dc31d80fb6 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 7 May 2011 12:22:36 -0400 Subject: Whitespace and coding style cleanups. --- shell/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index 001d6bd843..62d19259aa 100644 --- a/shell/main.c +++ b/shell/main.c @@ -350,16 +350,16 @@ setup_quit_signal (void) static GOptionEntry entries[] = { #ifdef G_OS_WIN32 - { "register-handlers", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, ®ister_handlers, - NULL, NULL }, + { "register-handlers", '\0', G_OPTION_FLAG_HIDDEN, + G_OPTION_ARG_NONE, ®ister_handlers, NULL, NULL }, { "reinstall", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &reinstall, NULL, NULL }, { "show-icons", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &show_icons, NULL, NULL }, { "hide-icons", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &hide_icons, NULL, NULL }, - { "unregister-handlers", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &unregister_handlers, - NULL, NULL }, + { "unregister-handlers", '\0', G_OPTION_FLAG_HIDDEN, + G_OPTION_ARG_NONE, &unregister_handlers, NULL, NULL }, #endif /* G_OS_WIN32 */ { "component", 'c', 0, G_OPTION_ARG_STRING, &requested_view, /* Translators: Do NOT translate the five component -- cgit v1.2.3 From 5146ff4c535f443fe25290eb96631e91ad44c8ef Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 21 May 2011 10:02:58 -0400 Subject: Coding style and whitespace cleanup. --- shell/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index 62d19259aa..e6ba19a3e4 100644 --- a/shell/main.c +++ b/shell/main.c @@ -393,7 +393,8 @@ static GOptionEntry entries[] = { N_("Import URIs or file names given as rest of arguments."), NULL }, { "quit", 'q', 0, G_OPTION_ARG_NONE, &quit, N_("Request a running Evolution process to quit"), NULL }, - { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &remaining_args, NULL, NULL }, + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, + &remaining_args, NULL, NULL }, { NULL } }; -- cgit v1.2.3 From befa850712a3b3bc147d017a514b9fa43224213e Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 21 May 2011 17:26:46 -0400 Subject: Bug 650525 - Don't install a SEGV handler Assume the operating system ships with a system-wide crash catching service like ABRT or Apport. --- shell/main.c | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index e6ba19a3e4..94064034fa 100644 --- a/shell/main.c +++ b/shell/main.c @@ -266,55 +266,6 @@ idle_cb (gchar **uris) #ifndef G_OS_WIN32 -/* SIGSEGV handling. - - The GNOME SEGV handler will lose if it's not run from the main Gtk - thread. So if we have to redirect the signal if the crash happens in another - thread. */ - -static void (*gnome_segv_handler) (gint); -static GStaticMutex segv_mutex = G_STATIC_MUTEX_INIT; -static GThread *main_thread = NULL; - -static void -segv_redirect (gint sig) -{ - gnome_segv_handler (sig); - - if (g_thread_self () != main_thread) { - /* We can't return from the signal handler or the thread may - SEGV again. But we can't g_thread_exit, because then the - thread may get cleaned up before bug-buddy can get a stack - trace. So we block by trying to lock a mutex we know is - already locked. */ - g_static_mutex_lock (&segv_mutex); - } -} - -static void -setup_segv_redirect (void) -{ - struct sigaction sa, osa; - - sigaction (SIGSEGV, NULL, &osa); - if (osa.sa_handler == SIG_DFL) - return; - - main_thread = g_thread_self (); - - sa.sa_flags = 0; - sigemptyset (&sa.sa_mask); - sa.sa_handler = segv_redirect; - sigaction (SIGSEGV, &sa, NULL); - sigaction (SIGBUS, &sa, NULL); - sigaction (SIGFPE, &sa, NULL); - - sa.sa_handler = SIG_IGN; - sigaction (SIGXFSZ, &sa, NULL); - gnome_segv_handler = osa.sa_handler; - g_static_mutex_lock (&segv_mutex); -} - static void quit_signal (gint sig) { @@ -344,7 +295,6 @@ setup_quit_signal (void) } #else -#define setup_segv_redirect() (void)0 #define setup_quit_signal() (void)0 #endif @@ -671,7 +621,6 @@ main (gint argc, gchar **argv) gconf_client_set_bool (client, key, FALSE, NULL); } - setup_segv_redirect (); setup_quit_signal (); if (evolution_debug_log) { -- cgit v1.2.3 From 794ec7dbb6e7effb40f9d6659bfeb91a321ca10c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 21 May 2011 20:52:17 -0400 Subject: Handle SIGTERM instead of SIGQUIT. SIGQUIT is supposed to produce a core dump. We don't want that. --- shell/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index 94064034fa..cab5ab9717 100644 --- a/shell/main.c +++ b/shell/main.c @@ -267,13 +267,13 @@ idle_cb (gchar **uris) #ifndef G_OS_WIN32 static void -quit_signal (gint sig) +term_signal (gint sig) { EShell *shell; - g_return_if_fail (sig == SIGQUIT); + g_return_if_fail (sig == SIGTERM); - g_print ("Received quit signal...\n"); + g_print ("Received terminate signal...\n"); shell = e_shell_get_default (); @@ -282,20 +282,20 @@ quit_signal (gint sig) } static void -setup_quit_signal (void) +setup_term_signal (void) { struct sigaction sa, osa; - sigaction (SIGQUIT, NULL, &osa); + sigaction (SIGTERM, NULL, &osa); sa.sa_flags = 0; sigemptyset (&sa.sa_mask); - sa.sa_handler = quit_signal; - sigaction (SIGQUIT, &sa, NULL); + sa.sa_handler = term_signal; + sigaction (SIGTERM, &sa, NULL); } #else -#define setup_quit_signal() (void)0 +#define setup_term_signal() (void)0 #endif static GOptionEntry entries[] = { @@ -621,7 +621,7 @@ main (gint argc, gchar **argv) gconf_client_set_bool (client, key, FALSE, NULL); } - setup_quit_signal (); + setup_term_signal (); if (evolution_debug_log) { gint fd; -- cgit v1.2.3 From 2191c224c025580c15e78ca2cee6344cbe22ea42 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 21 May 2011 22:48:51 -0400 Subject: Bug 650524 - Use g_unix_signal_add_watch_full() for SIGTERM We can't call anything safely except write() inside a signal handler, g_unix_signal_add_watch_full() handles this for us nicely. --- shell/main.c | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index cab5ab9717..e1b768187d 100644 --- a/shell/main.c +++ b/shell/main.c @@ -26,6 +26,12 @@ #include #include +#ifdef G_OS_UNIX +#if GLIB_CHECK_VERSION(2,29,5) +#include +#endif +#endif + #if HAVE_CLUTTER #include #include @@ -264,38 +270,23 @@ idle_cb (gchar **uris) return FALSE; } -#ifndef G_OS_WIN32 - -static void -term_signal (gint sig) +#ifdef G_OS_UNIX +#if GLIB_CHECK_VERSION(2,29,5) +static gboolean +handle_term_signal (gpointer data) { EShell *shell; - g_return_if_fail (sig == SIGTERM); - g_print ("Received terminate signal...\n"); shell = e_shell_get_default (); if (shell != NULL) e_shell_quit (shell, E_SHELL_QUIT_OPTION); -} - -static void -setup_term_signal (void) -{ - struct sigaction sa, osa; - - sigaction (SIGTERM, NULL, &osa); - sa.sa_flags = 0; - sigemptyset (&sa.sa_mask); - sa.sa_handler = term_signal; - sigaction (SIGTERM, &sa, NULL); + return FALSE; } - -#else -#define setup_term_signal() (void)0 +#endif #endif static GOptionEntry entries[] = { @@ -621,7 +612,13 @@ main (gint argc, gchar **argv) gconf_client_set_bool (client, key, FALSE, NULL); } - setup_term_signal (); +#ifdef G_OS_UNIX +#if GLIB_CHECK_VERSION(2,29,5) + g_unix_signal_add_watch_full ( + SIGTERM, G_PRIORITY_DEFAULT, + handle_term_signal, NULL, NULL); +#endif +#endif if (evolution_debug_log) { gint fd; -- cgit v1.2.3 From 9a2cffb0570bbde009ef45ae19c00059a9804e02 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 22 May 2011 11:04:27 -0400 Subject: Bug 650491 - Shell handles forwarding uris to existing process wrong This adds a "handle-uris" GAction which takes a string array argument, so the URIs can be passed to the primary process verbatim. --- shell/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index e1b768187d..95dc1b9ff4 100644 --- a/shell/main.c +++ b/shell/main.c @@ -246,7 +246,7 @@ show_development_warning (void) /* This is for doing stuff that requires the GTK+ loop to be running already. */ static gboolean -idle_cb (gchar **uris) +idle_cb (const gchar * const *uris) { EShell *shell; -- cgit v1.2.3 From 508f6cf941d40ad55e15a76e2c90dbef4ac72509 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 31 Aug 2011 12:30:56 -0400 Subject: Bug 657836 - Work around g_unix_signal API changes. Work around GLib API churn with regard to registering UNIX signal callbacks on the main loop. GLib >= 2.29.5 calls the function one thing, GLib >= 2.29.19 calls it another. --- shell/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index 95dc1b9ff4..8e1d533546 100644 --- a/shell/main.c +++ b/shell/main.c @@ -613,7 +613,11 @@ main (gint argc, gchar **argv) } #ifdef G_OS_UNIX -#if GLIB_CHECK_VERSION(2,29,5) +#if GLIB_CHECK_VERSION(2,29,19) + g_unix_signal_add_full ( + G_PRIORITY_DEFAULT, SIGTERM, + handle_term_signal, NULL, NULL); +#elif GLIB_CHECK_VERSION(2,29,5) g_unix_signal_add_watch_full ( SIGTERM, G_PRIORITY_DEFAULT, handle_term_signal, NULL, NULL); -- cgit v1.2.3 From 777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 16 Aug 2011 11:25:56 -0400 Subject: Coding style and whitespace cleanup. --- shell/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index 8e1d533546..fd0b0508e6 100644 --- a/shell/main.c +++ b/shell/main.c @@ -431,7 +431,8 @@ create_default_shell (void) } gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { EShell *shell; GConfClient *client; -- cgit v1.2.3 From d4e8e2f809d4da7dd5ac0b53a7900e5bd39777f9 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Thu, 13 Oct 2011 16:53:51 +0200 Subject: Migrate most of the shell code to GSettings --- shell/main.c | 61 +++++++++++++++++++++++++----------------------------------- 1 file changed, 25 insertions(+), 36 deletions(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index bb056e3ded..7dc285ade3 100644 --- a/shell/main.c +++ b/shell/main.c @@ -52,8 +52,6 @@ #endif #endif -#include - #include #include #include @@ -89,9 +87,6 @@ #define APPLICATION_ID "org.gnome.Evolution" -#define SKIP_WARNING_DIALOG_KEY \ - "/apps/evolution/shell/skip_warning_dialog" - /* STABLE_VERSION is only defined for development versions. */ #ifdef STABLE_VERSION #define DEVELOPMENT 1 @@ -350,31 +345,28 @@ static EShell * create_default_shell (void) { EShell *shell; - GConfClient *client; + GSettings *settings; GApplicationFlags flags; - const gchar *key; gboolean online = TRUE; gboolean is_meego = FALSE; gboolean small_screen = FALSE; GError *error = NULL; - client = gconf_client_get_default (); + settings = g_settings_new ("org.gnome.evolution.shell"); /* Requesting online or offline mode from the command-line * should be persistent, just like selecting it in the UI. */ - key = "/apps/evolution/shell/start_offline"; - if (start_online || force_online) { online = TRUE; - gconf_client_set_bool (client, key, FALSE, &error); + g_settings_set_boolean (settings, "start-offline", FALSE); } else if (start_offline) { online = FALSE; - gconf_client_set_bool (client, key, TRUE, &error); + g_settings_set_boolean (settings, "start-offline", TRUE); } else { gboolean value; - value = gconf_client_get_bool (client, key, &error); + value = g_settings_get_boolean (settings, "start-offline"); if (error == NULL) online = !value; } @@ -386,10 +378,8 @@ create_default_shell (void) /* Determine whether to run Evolution in "express" mode. */ - key = "/apps/evolution/shell/express_mode"; - if (!express_mode) - express_mode = gconf_client_get_bool (client, key, &error); + express_mode = g_settings_get_boolean (settings, "express-mode"); if (express_mode) e_shell_detect_meego (&is_meego, &small_screen); @@ -421,7 +411,7 @@ create_default_shell (void) if (force_online) e_shell_lock_network_available (shell); - g_object_unref (client); + g_object_unref (settings); return shell; } @@ -431,7 +421,7 @@ main (gint argc, gchar **argv) { EShell *shell; - GConfClient *client; + GSettings *settings; #ifdef DEVELOPMENT gboolean skip_warning_dialog; #endif @@ -591,22 +581,21 @@ main (gint argc, if (force_shutdown) shell_force_shutdown (); - client = gconf_client_get_default (); - if (disable_preview) { const gchar *key; - key = "/apps/evolution/mail/display/safe_list"; - gconf_client_set_bool (client, key, TRUE, NULL); - - key = "/apps/evolution/addressbook/display/show_preview"; - gconf_client_set_bool (client, key, FALSE, NULL); + settings = g_settings_new ("org.gnome.evolution.mail"); + g_settings_set_boolean (settings, "safe-list", TRUE); + g_object_unref (settings); - key = "/apps/evolution/calendar/display/show_memo_preview"; - gconf_client_set_bool (client, key, FALSE, NULL); + settings = g_settings_new ("org.gnome.evolution.addressbook"); + g_settings_set_boolean (settings, "show-preview", FALSE); + g_object_unref (settings); - key = "/apps/evolution/calendar/display/show_task_preview"; - gconf_client_set_bool (client, key, FALSE, NULL); + settings = g_settings_new ("org.gnome.evolution.calendar"); + g_settings_set_boolean (settings, "show-memo-preview", FALSE); + g_settings_set_boolean (settings, "show-task-preview", FALSE); + g_object_unref (settings); } #ifdef G_OS_UNIX @@ -638,16 +627,16 @@ main (gint argc, gtk_accel_map_load (e_get_accels_filename ()); #ifdef DEVELOPMENT - skip_warning_dialog = gconf_client_get_bool ( - client, SKIP_WARNING_DIALOG_KEY, NULL); + settings = g_settings_new ("org.gnome.evolution.shell"); + skip_warning_dialog = g_settings_get_boolean ( + settings, "skip-warning-dialog"); if (!skip_warning_dialog && !getenv ("EVOLVE_ME_HARDER")) - gconf_client_set_bool ( - client, SKIP_WARNING_DIALOG_KEY, - show_development_warning (), NULL); -#endif + g_settings_set_boolean ( + settings, "skip-warning-dialog"); - g_object_unref (client); + g_object_unref (settings); +#endif shell = create_default_shell (); -- cgit v1.2.3 From 2dd62937f02126c75c401fce50c6444a376e2f9f Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Thu, 13 Oct 2011 17:23:54 +0200 Subject: Build fixes --- shell/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index 7dc285ade3..5e79c308f7 100644 --- a/shell/main.c +++ b/shell/main.c @@ -582,8 +582,6 @@ main (gint argc, shell_force_shutdown (); if (disable_preview) { - const gchar *key; - settings = g_settings_new ("org.gnome.evolution.mail"); g_settings_set_boolean (settings, "safe-list", TRUE); g_object_unref (settings); @@ -633,7 +631,8 @@ main (gint argc, if (!skip_warning_dialog && !getenv ("EVOLVE_ME_HARDER")) g_settings_set_boolean ( - settings, "skip-warning-dialog"); + settings, "skip-warning-dialog", + show_development_warning ()); g_object_unref (settings); #endif -- cgit v1.2.3