aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-shell.c
diff options
context:
space:
mode:
authorXan Lopez <xlopez@igalia.com>2011-06-30 08:59:17 +0800
committerXan Lopez <xlopez@igalia.com>2011-06-30 08:59:17 +0800
commit94cb05f6d2b15ad84e7f826c6c4edc7923d1586c (patch)
tree83055c3070d5040739fb070f1f3481a4c8e7d800 /src/ephy-shell.c
parent0ea926b7639db07086101cb9bca0fc10b69c07c9 (diff)
downloadgsoc2013-epiphany-94cb05f6d2b15ad84e7f826c6c4edc7923d1586c.tar
gsoc2013-epiphany-94cb05f6d2b15ad84e7f826c6c4edc7923d1586c.tar.gz
gsoc2013-epiphany-94cb05f6d2b15ad84e7f826c6c4edc7923d1586c.tar.bz2
gsoc2013-epiphany-94cb05f6d2b15ad84e7f826c6c4edc7923d1586c.tar.lz
gsoc2013-epiphany-94cb05f6d2b15ad84e7f826c6c4edc7923d1586c.tar.xz
gsoc2013-epiphany-94cb05f6d2b15ad84e7f826c6c4edc7923d1586c.tar.zst
gsoc2013-epiphany-94cb05f6d2b15ad84e7f826c6c4edc7923d1586c.zip
ephy-shell: set GApplication flags in constructed vmethod
Cleaner than doing it in the constructor.
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r--src/ephy-shell.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 2bd5c8a59..bba574161 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -363,6 +363,22 @@ ephy_shell_before_emit (GApplication *application,
}
static void
+ephy_shell_constructed (GObject *object)
+{
+ if (ephy_embed_shell_is_private_instance (EPHY_EMBED_SHELL (object)))
+ {
+ GApplicationFlags flags;
+
+ flags = g_application_get_flags (G_APPLICATION (object));
+ flags |= G_APPLICATION_NON_UNIQUE;
+ g_application_set_flags (G_APPLICATION (object), flags);
+ }
+
+ if (G_OBJECT_CLASS (ephy_shell_parent_class)->constructed)
+ G_OBJECT_CLASS (ephy_shell_parent_class)->constructed (object);
+}
+
+static void
ephy_shell_class_init (EphyShellClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -371,6 +387,7 @@ ephy_shell_class_init (EphyShellClass *klass)
object_class->dispose = ephy_shell_dispose;
object_class->finalize = ephy_shell_finalize;
+ object_class->constructed = ephy_shell_constructed;
application_class->startup = ephy_shell_startup;
application_class->activate = ephy_shell_activate;
@@ -1073,16 +1090,10 @@ ephy_shell_get_prefs_dialog (EphyShell *shell)
void
_ephy_shell_create_instance (gboolean private_instance)
{
- GApplicationFlags flags = G_APPLICATION_FLAGS_NONE;
-
g_assert (ephy_shell == NULL);
- if (private_instance)
- flags |= G_APPLICATION_NON_UNIQUE;
-
ephy_shell = EPHY_SHELL (g_object_new (EPHY_TYPE_SHELL,
"application-id", "org.gnome.Epiphany",
- "flags", flags,
"private-instance", private_instance,
NULL));
/* FIXME weak ref */