aboutsummaryrefslogtreecommitdiffstats
path: root/shell/main.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-11-14 11:56:01 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-11-14 11:56:01 +0800
commit8c0bd86d5fdd6d87c3170e2a01423e7c7018a981 (patch)
tree22da2df051cb6f1bc988d15aca08ebb0a5baf7e4 /shell/main.c
parent6760cc72334346b8654fcd9fe1440890db55ac1b (diff)
downloadgsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar
gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar.gz
gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar.bz2
gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar.lz
gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar.xz
gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar.zst
gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.zip
Rearranged some of the addressbook code to try and eliminate some circular
dependencies in our libraries. The circular dependency between the composer and the mail module is still causing me headaches. And it doesn't help that the addressbook and calendar also want to link to the composer. svn path=/branches/kill-bonobo/; revision=36782
Diffstat (limited to 'shell/main.c')
-rw-r--r--shell/main.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/shell/main.c b/shell/main.c
index 5d9405fcfe..47400798ab 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -96,11 +96,13 @@ static gboolean disable_eplugin = FALSE;
static gboolean disable_preview = FALSE;
static gboolean idle_cb (gchar **uris);
-static EShell *global_shell;
static char *requested_view = NULL;
static char *evolution_debug_log = NULL;
static gchar **remaining_args;
+/* Defined in <e-shell.h> */
+extern EShell *default_shell;
+
#ifdef KILL_PROCESS_CMD
static void
@@ -265,12 +267,15 @@ destroy_config (GConfClient *client)
static void
open_uris (gchar **uris)
{
+ EShell *shell;
guint ii;
g_return_if_fail (uris != NULL);
+ shell = e_shell_get_default ();
+
for (ii = 0; uris[ii] != NULL; ii++)
- if (!e_shell_handle_uri (global_shell, uris[ii]))
+ if (!e_shell_handle_uri (shell, uris[ii]))
g_warning ("Invalid URI: %s", uris[ii]);
}
@@ -279,6 +284,7 @@ open_uris (gchar **uris)
static gboolean
idle_cb (gchar **uris)
{
+ EShell *shell;
GtkWidget *shell_window;
const gchar *initial_view;
@@ -293,8 +299,8 @@ idle_cb (gchar **uris)
return FALSE;
}
- initial_view = e_shell_get_canonical_name (
- global_shell, requested_view);
+ shell = e_shell_get_default ();
+ initial_view = e_shell_get_canonical_name (shell, requested_view);
if (initial_view != NULL) {
GConfClient *client;
@@ -306,7 +312,7 @@ idle_cb (gchar **uris)
g_object_unref (client);
}
- shell_window = e_shell_create_window (global_shell);
+ shell_window = e_shell_create_window (shell);
#if 0 /* MBARNES */
if (shell == NULL) {
@@ -481,7 +487,7 @@ master_client_die_cb (GnomeClient *client,
}
static void
-create_shell (void)
+create_default_shell (void)
{
EShell *shell;
GConfClient *conf_client;
@@ -510,7 +516,7 @@ create_shell (void)
}
}
- shell = e_shell_new (online_mode);
+ shell = g_object_new (E_TYPE_SHELL, "online-mode", online_mode, NULL);
g_signal_connect (
shell, "window-destroyed",
@@ -526,7 +532,7 @@ create_shell (void)
g_object_unref (conf_client);
- global_shell = shell;
+ default_shell = shell;
}
int
@@ -662,7 +668,7 @@ main (int argc, char **argv)
g_object_unref (client);
- create_shell ();
+ create_default_shell ();
gtk_main ();