[gnome-calendar] application: do not access instance data on _new
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] application: do not access instance data on _new
- Date: Thu, 4 Dec 2014 22:37:22 +0000 (UTC)
commit ed32e8d624e82159503cf8a8029cf35207f060ff
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Fri Oct 17 00:51:58 2014 -0400
application: do not access instance data on _new
The settings setup could be delayed to _init vfunc of the
application.
src/gcal-application.c | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/src/gcal-application.c b/src/gcal-application.c
index fe71884..0b743e5 100644
--- a/src/gcal-application.c
+++ b/src/gcal-application.c
@@ -106,6 +106,10 @@ gcal_application_class_init (GcalApplicationClass *klass)
static void
gcal_application_init (GcalApplication *self)
{
+ GcalApplicationPrivate *priv;
+
+ priv = gcal_application_get_instance_private (self);
+ priv->settings = g_settings_new ("org.gnome.calendar");
}
static void
@@ -332,19 +336,12 @@ gcal_application_quit (GSimpleAction *simple,
GcalApplication*
gcal_application_new (void)
{
- GcalApplication *app;
- GcalApplicationPrivate *priv;
-
g_set_application_name ("Calendar");
- app = g_object_new (gcal_application_get_type (),
- "application-id", "org.gnome.Calendar",
- "flags", G_APPLICATION_HANDLES_COMMAND_LINE,
- NULL);
-
- priv = gcal_application_get_instance_private (app);
- priv->settings = g_settings_new ("org.gnome.calendar");
- return app;
+ return g_object_new (gcal_application_get_type (),
+ "application-id", "org.gnome.Calendar",
+ "flags", G_APPLICATION_HANDLES_COMMAND_LINE,
+ NULL);
}
GcalManager*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]