core/manager: Remove "context" property
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/702>
This commit is contained in:
@@ -163,7 +163,7 @@ gcal_context_constructed (GObject *object)
|
|||||||
|
|
||||||
G_OBJECT_CLASS (gcal_context_parent_class)->constructed (object);
|
G_OBJECT_CLASS (gcal_context_parent_class)->constructed (object);
|
||||||
|
|
||||||
self->manager = gcal_manager_new (self);
|
self->manager = gcal_manager_new ();
|
||||||
self->search_engine = gcal_search_engine_new (self);
|
self->search_engine = gcal_search_engine_new (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-34
@@ -19,7 +19,6 @@
|
|||||||
#define G_LOG_DOMAIN "GcalManager"
|
#define G_LOG_DOMAIN "GcalManager"
|
||||||
|
|
||||||
#include "gcal-application.h"
|
#include "gcal-application.h"
|
||||||
#include "gcal-context.h"
|
|
||||||
#include "gcal-debug.h"
|
#include "gcal-debug.h"
|
||||||
#include "gcal-manager.h"
|
#include "gcal-manager.h"
|
||||||
#include "gcal-timeline.h"
|
#include "gcal-timeline.h"
|
||||||
@@ -74,8 +73,6 @@ struct _GcalManager
|
|||||||
gint clients_synchronizing;
|
gint clients_synchronizing;
|
||||||
|
|
||||||
GcalTimeline *timeline;
|
GcalTimeline *timeline;
|
||||||
|
|
||||||
GcalContext *context;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (GcalManager, gcal_manager, G_TYPE_OBJECT)
|
G_DEFINE_TYPE (GcalManager, gcal_manager, G_TYPE_OBJECT)
|
||||||
@@ -83,7 +80,6 @@ G_DEFINE_TYPE (GcalManager, gcal_manager, G_TYPE_OBJECT)
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_CONTEXT,
|
|
||||||
PROP_DEFAULT_CALENDAR,
|
PROP_DEFAULT_CALENDAR,
|
||||||
PROP_SYNCHRONIZING,
|
PROP_SYNCHRONIZING,
|
||||||
NUM_PROPS
|
NUM_PROPS
|
||||||
@@ -615,12 +611,6 @@ gcal_manager_finalize (GObject *object)
|
|||||||
|
|
||||||
g_clear_object (&self->timeline);
|
g_clear_object (&self->timeline);
|
||||||
|
|
||||||
if (self->context)
|
|
||||||
{
|
|
||||||
g_object_remove_weak_pointer (G_OBJECT (self->context), (gpointer *)&self->context);
|
|
||||||
self->context = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_clear_object (&self->calendars_model);
|
g_clear_object (&self->calendars_model);
|
||||||
g_clear_pointer (&self->clients, g_hash_table_destroy);
|
g_clear_pointer (&self->clients, g_hash_table_destroy);
|
||||||
|
|
||||||
@@ -641,12 +631,6 @@ gcal_manager_set_property (GObject *object,
|
|||||||
|
|
||||||
switch (property_id)
|
switch (property_id)
|
||||||
{
|
{
|
||||||
case PROP_CONTEXT:
|
|
||||||
g_assert (self->context == NULL);
|
|
||||||
self->context = g_value_get_object (value);
|
|
||||||
g_object_add_weak_pointer (G_OBJECT (self->context), (gpointer *)&self->context);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_DEFAULT_CALENDAR:
|
case PROP_DEFAULT_CALENDAR:
|
||||||
gcal_manager_set_default_calendar (self, g_value_get_object (value));
|
gcal_manager_set_default_calendar (self, g_value_get_object (value));
|
||||||
break;
|
break;
|
||||||
@@ -674,10 +658,6 @@ gcal_manager_get_property (GObject *object,
|
|||||||
|
|
||||||
switch (property_id)
|
switch (property_id)
|
||||||
{
|
{
|
||||||
case PROP_CONTEXT:
|
|
||||||
g_value_set_object (value, self->context);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_DEFAULT_CALENDAR:
|
case PROP_DEFAULT_CALENDAR:
|
||||||
g_value_set_object (value, gcal_manager_get_default_calendar (self));
|
g_value_set_object (value, gcal_manager_get_default_calendar (self));
|
||||||
break;
|
break;
|
||||||
@@ -702,17 +682,6 @@ gcal_manager_class_init (GcalManagerClass *klass)
|
|||||||
object_class->set_property = gcal_manager_set_property;
|
object_class->set_property = gcal_manager_set_property;
|
||||||
object_class->get_property = gcal_manager_get_property;
|
object_class->get_property = gcal_manager_get_property;
|
||||||
|
|
||||||
/**
|
|
||||||
* GcalManager:context:
|
|
||||||
*
|
|
||||||
* The #GcalContext.
|
|
||||||
*/
|
|
||||||
properties[PROP_CONTEXT] = g_param_spec_object ("context",
|
|
||||||
"Data context",
|
|
||||||
"Data context",
|
|
||||||
GCAL_TYPE_CONTEXT,
|
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GcalManager:default-calendar:
|
* GcalManager:default-calendar:
|
||||||
*
|
*
|
||||||
@@ -772,17 +741,15 @@ gcal_manager_init (GcalManager *self)
|
|||||||
/* Public API */
|
/* Public API */
|
||||||
/**
|
/**
|
||||||
* gcal_manager_new:
|
* gcal_manager_new:
|
||||||
* @context: a #GcalContext
|
|
||||||
*
|
*
|
||||||
* Creates a new #GcalManager.
|
* Creates a new #GcalManager.
|
||||||
*
|
*
|
||||||
* Returns: (transfer full): a newly created #GcalManager
|
* Returns: (transfer full): a newly created #GcalManager
|
||||||
*/
|
*/
|
||||||
GcalManager*
|
GcalManager*
|
||||||
gcal_manager_new (GcalContext *context)
|
gcal_manager_new (void)
|
||||||
{
|
{
|
||||||
return g_object_new (GCAL_TYPE_MANAGER,
|
return g_object_new (GCAL_TYPE_MANAGER,
|
||||||
"context", context,
|
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
|
|||||||
#define GCAL_TYPE_MANAGER (gcal_manager_get_type ())
|
#define GCAL_TYPE_MANAGER (gcal_manager_get_type ())
|
||||||
G_DECLARE_FINAL_TYPE (GcalManager, gcal_manager, GCAL, MANAGER, GObject)
|
G_DECLARE_FINAL_TYPE (GcalManager, gcal_manager, GCAL, MANAGER, GObject)
|
||||||
|
|
||||||
GcalManager* gcal_manager_new (GcalContext *context);
|
GcalManager* gcal_manager_new (void);
|
||||||
|
|
||||||
ESource* gcal_manager_get_source (GcalManager *self,
|
ESource* gcal_manager_get_source (GcalManager *self,
|
||||||
const gchar *uid);
|
const gchar *uid);
|
||||||
|
|||||||
Reference in New Issue
Block a user