[epiphany] ephy-application: use our private instance property
- From: Xan Lopez <xan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-application: use our private instance property
- Date: Wed, 29 Jun 2011 12:54:31 +0000 (UTC)
commit 7628d25419c00d95da3e104ad6f132f4607b78c0
Author: Xan Lopez <xlopez igalia com>
Date: Wed Jun 29 01:11:09 2011 +0200
ephy-application: use our private instance property
Instead of relying on ephy-file-helpers global method. Down the road
we want to do this everywhere, but first we need some refactoring to
be able to use EphyApplication outside of src/.
src/ephy-application.c | 16 +++++++++++++++-
src/ephy-application.h | 4 +++-
2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-application.c b/src/ephy-application.c
index a3235f8..969b591 100644
--- a/src/ephy-application.c
+++ b/src/ephy-application.c
@@ -159,7 +159,7 @@ ephy_application_startup (GApplication* application)
{
/* We're not remoting; start our services */
/* Migrate profile if we are not running a private instance */
- if (ephy_has_private_profile () == FALSE &&
+ if (!ephy_application_is_private_instance (EPHY_APPLICATION (application)) &&
ephy_profile_utils_get_migration_version () < EPHY_PROFILE_MIGRATION_VERSION) {
GError *error = NULL;
char *argv[1] = { "ephy-profile-migrator" };
@@ -433,3 +433,17 @@ ephy_application_set_startup_context (EphyApplication *application,
application->priv->startup_context = ctx;
}
+
+/**
+ * ephy_application_is_private_instance:
+ * @application: an #EphyApplication
+ *
+ * Returns: whether @application is a private instance
+ **/
+gboolean
+ephy_application_is_private_instance (EphyApplication *application)
+{
+ g_return_val_if_fail (EPHY_IS_APPLICATION (application), FALSE);
+
+ return application->priv->private_instance;
+}
diff --git a/src/ephy-application.h b/src/ephy-application.h
index 04cb376..2bc8cba 100644
--- a/src/ephy-application.h
+++ b/src/ephy-application.h
@@ -73,7 +73,7 @@ typedef struct {
GType ephy_application_get_type (void) G_GNUC_CONST;
-EphyApplication *ephy_application_new (gboolean private_instance);
+EphyApplication *ephy_application_new (gboolean private_instance);
void ephy_application_set_startup_context (EphyApplication *application,
EphyApplicationStartupContext *ctx);
@@ -85,6 +85,8 @@ EphyApplicationStartupContext *ephy_application_startup_context_new (EphyStartup
char **arguments,
guint32 user_time);
+gboolean ephy_application_is_private_instance (EphyApplication *application);
+
G_END_DECLS
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]