aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-module.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-01-29 01:19:34 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-01-29 01:19:34 +0800
commit533d59e2cd30ba79a99a71907ffdda65505e633a (patch)
treeba6f611ce6a1bb9d3dfb98a6a6a670cf99a55b9d /shell/e-shell-module.c
parent3e339d5ecc63d912840c6f885460c58f60eb85e0 (diff)
downloadgsoc2013-evolution-533d59e2cd30ba79a99a71907ffdda65505e633a.tar
gsoc2013-evolution-533d59e2cd30ba79a99a71907ffdda65505e633a.tar.gz
gsoc2013-evolution-533d59e2cd30ba79a99a71907ffdda65505e633a.tar.bz2
gsoc2013-evolution-533d59e2cd30ba79a99a71907ffdda65505e633a.tar.lz
gsoc2013-evolution-533d59e2cd30ba79a99a71907ffdda65505e633a.tar.xz
gsoc2013-evolution-533d59e2cd30ba79a99a71907ffdda65505e633a.tar.zst
gsoc2013-evolution-533d59e2cd30ba79a99a71907ffdda65505e633a.zip
Add unique-1.0 requirement (blessed external dependency).
Make EShell a subclass of UniqueApp and handle single-instance negotiation. When another Evolution process is running: - Running "evolution" will simply present the existing windows. - Running "evolution -c <view>" will open a shell window set to <view>. - Running "evolution <uri>" will open an appropriate window for <uri>. The second process will then terminate immediately. svn path=/branches/kill-bonobo/; revision=37147
Diffstat (limited to 'shell/e-shell-module.c')
-rw-r--r--shell/e-shell-module.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/shell/e-shell-module.c b/shell/e-shell-module.c
index 5ec13e00bc..11226557c2 100644
--- a/shell/e-shell-module.c
+++ b/shell/e-shell-module.c
@@ -44,7 +44,7 @@ struct _EShellModulePrivate {
GModule *module;
gchar *filename;
- EShell *shell;
+ gpointer shell; /* weak pointer */
gchar *config_dir;
gchar *data_dir;
@@ -82,7 +82,12 @@ shell_module_set_shell (EShellModule *shell_module,
EShell *shell)
{
g_return_if_fail (shell_module->priv->shell == NULL);
- shell_module->priv->shell = g_object_ref (shell);
+
+ shell_module->priv->shell = shell;
+
+ g_object_add_weak_pointer (
+ G_OBJECT (shell_module),
+ &shell_module->priv->shell);
}
static void
@@ -132,22 +137,6 @@ shell_module_get_property (GObject *object,
}
static void
-shell_module_dispose (GObject *object)
-{
- EShellModulePrivate *priv;
-
- priv = E_SHELL_MODULE_GET_PRIVATE (object);
-
- if (priv->shell != NULL) {
- g_object_unref (priv->shell);
- priv->shell = NULL;
- }
-
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
shell_module_finalize (GObject *object)
{
EShellModulePrivate *priv;
@@ -217,7 +206,6 @@ shell_module_class_init (EShellModuleClass *class)
object_class = G_OBJECT_CLASS (class);
object_class->set_property = shell_module_set_property;
object_class->get_property = shell_module_get_property;
- object_class->dispose = shell_module_dispose;
object_class->finalize = shell_module_finalize;
type_module_class = G_TYPE_MODULE_CLASS (class);
@@ -420,7 +408,7 @@ e_shell_module_get_shell (EShellModule *shell_module)
{
g_return_val_if_fail (E_IS_SHELL_MODULE (shell_module), NULL);
- return shell_module->priv->shell;
+ return E_SHELL (shell_module->priv->shell);
}
/**