aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2010-06-18 18:57:24 +0800
committerFridrich Štrba <fridrich.strba@bluewin.ch>2010-06-18 18:57:24 +0800
commit9d7cb109d3f4bcae4e689c314f8dfb7d3c6bfc56 (patch)
tree46e56ba855f89b9812cc094252866c75deac2ab9
parent002f4def9f6c04273f42b18156b379b435d9dce0 (diff)
downloadgsoc2013-evolution-9d7cb109d3f4bcae4e689c314f8dfb7d3c6bfc56.tar.gz
gsoc2013-evolution-9d7cb109d3f4bcae4e689c314f8dfb7d3c6bfc56.tar.zst
gsoc2013-evolution-9d7cb109d3f4bcae4e689c314f8dfb7d3c6bfc56.zip
[win32] add --register-handlers and --unregister-handlers options
and don't tamper with registry unless asked for it explicitely.
-rw-r--r--e-util/e-win32-defaults.c9
-rw-r--r--e-util/e-win32-defaults.h2
-rw-r--r--shell/main.c18
3 files changed, 27 insertions, 2 deletions
diff --git a/e-util/e-win32-defaults.c b/e-util/e-win32-defaults.c
index 98187c0340..7fe216f5a0 100644
--- a/e-util/e-win32-defaults.c
+++ b/e-util/e-win32-defaults.c
@@ -283,6 +283,10 @@ _e_win32_register_addressbook (void)
_e_win32_register_addressbook_impl (FALSE);
}
+void
+_e_win32_unregister_addressbook (void)
+{
+}
/*
* Mail Client registration
@@ -457,6 +461,11 @@ _e_win32_register_mailer (void)
_e_win32_register_mailer_impl (FALSE);
}
+void
+_e_win32_unregister_mailer (void)
+{
+}
+
static void
_e_win32_set_default_mailer_impl (gboolean system)
{
diff --git a/e-util/e-win32-defaults.h b/e-util/e-win32-defaults.h
index e976d7f414..e265416b33 100644
--- a/e-util/e-win32-defaults.h
+++ b/e-util/e-win32-defaults.h
@@ -28,10 +28,12 @@
G_BEGIN_DECLS
void _e_win32_register_mailer (void);
+void _e_win32_unregister_mailer (void);
void _e_win32_set_default_mailer (void);
void _e_win32_unset_default_mailer (void);
void _e_win32_register_addressbook (void);
+void _e_win32_unregister_addressbook (void);
G_END_DECLS
diff --git a/shell/main.c b/shell/main.c
index 7e58d97aa6..ec53d7fc51 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -80,9 +80,11 @@
/* Command-line options. */
#ifdef G_OS_WIN32
+static gboolean register_handlers = FALSE;
static gboolean reinstall = FALSE;
static gboolean show_icons = FALSE;
static gboolean hide_icons = FALSE;
+static gboolean unregister_handlers = FALSE;
#endif /* G_OS_WIN32 */
static gboolean express_mode = FALSE;
static gboolean start_online = FALSE;
@@ -305,12 +307,16 @@ setup_segv_redirect (void)
static GOptionEntry entries[] = {
#ifdef G_OS_WIN32
+ { "register-handlers", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &register_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 },
#endif /* G_OS_WIN32 */
{ "component", 'c', 0, G_OPTION_ARG_STRING, &requested_view,
N_("Start Evolution activating the specified component"), NULL },
@@ -481,8 +487,10 @@ main (gint argc, gchar **argv)
g_free (path);
- _e_win32_register_mailer ();
- _e_win32_register_addressbook ();
+ if (register_handlers || reinstall || show_icons) {
+ _e_win32_register_mailer ();
+ _e_win32_register_addressbook ();
+ }
if (reinstall) {
_e_win32_set_default_mailer ();
@@ -498,6 +506,12 @@ main (gint argc, gchar **argv)
_e_win32_unset_default_mailer ();
exit (0);
}
+
+ if (unregister_handlers) {
+ _e_win32_unregister_mailer();
+ _e_win32_unregister_addressbook();
+ exit (0);
+ }
if (strcmp (gettext (""), "") == 0) {
/* No message catalog installed for the current locale