[evolution-kolab] calendar: cleanup (removed commented old code)
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab] calendar: cleanup (removed commented old code)
- Date: Mon, 6 Aug 2012 16:36:36 +0000 (UTC)
commit 25fd88d55d020c8fb5474d4a6bf385c11aff6704
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Mon Aug 6 17:58:59 2012 +0200
calendar: cleanup (removed commented old code)
src/calendar/e-cal-backend-kolab-factory.c | 214 -------------------
src/calendar/e-cal-backend-kolab.c | 304 ----------------------------
src/calendar/kolab-util-calendar.c | 32 ---
src/calendar/kolab-util-calendar.h | 4 -
4 files changed, 0 insertions(+), 554 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-kolab-factory.c b/src/calendar/e-cal-backend-kolab-factory.c
index d86500d..08ff549 100644
--- a/src/calendar/e-cal-backend-kolab-factory.c
+++ b/src/calendar/e-cal-backend-kolab-factory.c
@@ -149,217 +149,3 @@ e_module_unload (GTypeModule *type_module)
}
/*----------------------------------------------------------------------------*/
-
-#if 0 /* FIXME old */
-
-static void
-e_cal_backend_kolab_factory_instance_init (ECalBackendKolabFactory *factory)
-{
- (void) factory;
-}
-
-static const gchar *
-_get_protocol (ECalBackendFactory *factory)
-{
- (void) factory;
- return KOLAB_CAMEL_PROVIDER_PROTOCOL;
-}
-
-static icalcomponent_kind
-_events_get_kind (ECalBackendFactory *factory)
-{
- (void) factory;
- return ICAL_VEVENT_COMPONENT;
-}
-
-static icalcomponent_kind
-_todos_get_kind (ECalBackendFactory *factory)
-{
- (void) factory;
- return ICAL_VTODO_COMPONENT;
-}
-
-static icalcomponent_kind
-_journal_get_kind (ECalBackendFactory *factory)
-{
- (void) factory;
- return ICAL_VJOURNAL_COMPONENT;
-}
-
-static ECalBackend *
-_events_new_backend (ECalBackendFactory *factory, ESource *source)
-{
- ECalBackend *new_backend = NULL;
- (void) factory;
-
- new_backend = g_object_new (e_cal_backend_kolab_get_type (),
- "source", source,
- "kind", ICAL_VEVENT_COMPONENT,
- NULL);
- if (koma_objects == NULL)
- koma_objects = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
- e_cal_backend_kolab_set_koma_table (E_CAL_BACKEND_KOLAB (new_backend), koma_objects);
- return new_backend;
-}
-
-static ECalBackend *
-_todos_new_backend (ECalBackendFactory *factory, ESource *source)
-{
- ECalBackend *new_backend = NULL;
- (void) factory;
-
- new_backend = g_object_new (e_cal_backend_kolab_get_type (),
- "source", source,
- "kind", ICAL_VTODO_COMPONENT,
- NULL);
- if (koma_objects == NULL)
- koma_objects = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
- e_cal_backend_kolab_set_koma_table (E_CAL_BACKEND_KOLAB (new_backend), koma_objects);
- return new_backend;
-}
-
-static ECalBackend *
-_journal_new_backend (ECalBackendFactory *factory, ESource *source)
-{
- ECalBackend *new_backend = NULL;
- (void) factory;
-
- new_backend = g_object_new (e_cal_backend_kolab_get_type (),
- "source", source,
- "kind", ICAL_VJOURNAL_COMPONENT,
- NULL);
- if (koma_objects == NULL)
- koma_objects = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
- e_cal_backend_kolab_set_koma_table (E_CAL_BACKEND_KOLAB (new_backend), koma_objects);
- return new_backend;
-}
-
-static void
-events_backend_factory_class_init (ECalBackendKolabFactoryClass *klass)
-{
- E_CAL_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
- E_CAL_BACKEND_FACTORY_CLASS (klass)->get_kind = _events_get_kind;
- E_CAL_BACKEND_FACTORY_CLASS (klass)->new_backend = _events_new_backend;
-}
-
-static void
-todos_backend_factory_class_init (ECalBackendKolabFactoryClass *klass)
-{
- E_CAL_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
- E_CAL_BACKEND_FACTORY_CLASS (klass)->get_kind = _todos_get_kind;
- E_CAL_BACKEND_FACTORY_CLASS (klass)->new_backend = _todos_new_backend;
-}
-
-static void
-journal_backend_factory_class_init (ECalBackendKolabFactoryClass *klass)
-{
- E_CAL_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
- E_CAL_BACKEND_FACTORY_CLASS (klass)->get_kind = _journal_get_kind;
- E_CAL_BACKEND_FACTORY_CLASS (klass)->new_backend = _journal_new_backend;
-}
-
-static GType
-events_backend_factory_get_type (GTypeModule *module)
-{
- GType type;
-
- GTypeInfo info = {
- sizeof (ECalBackendKolabFactoryClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) events_backend_factory_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ECalBackend),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_cal_backend_kolab_factory_instance_init,
- NULL /* GTypeValueTable */
- };
-
- type = g_type_module_register_type (module,
- E_TYPE_CAL_BACKEND_FACTORY,
- "ECalBackendKolabEventsFactory",
- &info, 0);
-
- return type;
-}
-
-static GType
-todos_backend_factory_get_type (GTypeModule *module)
-{
- GType type;
-
- GTypeInfo info = {
- sizeof (ECalBackendKolabFactoryClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) todos_backend_factory_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ECalBackend),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_cal_backend_kolab_factory_instance_init,
- NULL /* GTypeValueTable */
- };
-
- type = g_type_module_register_type (module,
- E_TYPE_CAL_BACKEND_FACTORY,
- "ECalBackendKolabTodosFactory",
- &info, 0);
-
- return type;
-}
-
-static GType
-journal_backend_factory_get_type (GTypeModule *module)
-{
- GType type;
-
- GTypeInfo info = {
- sizeof (ECalBackendKolabFactoryClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) journal_backend_factory_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ECalBackend),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_cal_backend_kolab_factory_instance_init,
- NULL /* GTypeValueTable */
- };
-
- type = g_type_module_register_type (module,
- E_TYPE_CAL_BACKEND_FACTORY,
- "ECalBackendKolabJournalFactory",
- &info, 0);
-
- return type;
-}
-
-static GType kolab_cal_types[1];
-
-void
-eds_module_initialize (GTypeModule *module)
-{
- kolab_cal_types[0] = events_backend_factory_get_type (module);
- kolab_cal_types[1] = todos_backend_factory_get_type (module);
- kolab_cal_types[2] = journal_backend_factory_get_type (module);
-}
-
-
-void
-eds_module_shutdown (void)
-{
- /* TODO: implement me */
-}
-
-
-void
-eds_module_list_types (const GType **types, gint *num_types)
-{
- *types = kolab_cal_types;
- *num_types = 3;
-}
-#endif
-
-/*----------------------------------------------------------------------------*/
diff --git a/src/calendar/e-cal-backend-kolab.c b/src/calendar/e-cal-backend-kolab.c
index 1214f4c..57874a6 100644
--- a/src/calendar/e-cal-backend-kolab.c
+++ b/src/calendar/e-cal-backend-kolab.c
@@ -636,34 +636,6 @@ cal_backend_kolab_get_backend_property (ECalBackendSync *backend,
return processed;
}
-#if 0 /* probably not needed */
-static gboolean
-cal_backend_kolab_set_backend_property (ECalBackendSync *backend,
- EDataCal *cal,
- GCancellable *cancellable,
- const gchar *prop_name,
- const gchar *prop_value,
- GError **error)
-{
- ECalBackendKolab *self = NULL;
- ECalBackendKolabPrivate *priv = NULL;
-
- g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- e_return_data_cal_error_val_if_fail (E_IS_CAL_BACKEND_KOLAB (backend), InvalidArg);
- e_return_data_cal_error_val_if_fail (E_IS_DATA_CAL (cal), InvalidArg);
- /* cancellable may be NULL */
- e_return_data_cal_error_val_if_fail (prop_name != NULL, InvalidArg);
- e_return_data_cal_error_val_if_fail (prop_value != NULL, InvalidArg);
-
- self = E_CAL_BACKEND_KOLAB (backend);
- priv = E_CAL_BACKEND_KOLAB_PRIVATE (self);
-
- g_error ("%s: FIXME implement me", __func__);
-
- return FALSE;
-}
-#endif
-
/**
* cal_backend_kolab_get_object:
* @backend: An ECalBackendSync object.
@@ -2023,9 +1995,6 @@ e_cal_backend_kolab_class_init (ECalBackendKolabClass *klass)
sync_class->remove_sync = cal_backend_kolab_remove;
sync_class->refresh_sync = cal_backend_kolab_refresh;
sync_class->get_backend_property_sync = cal_backend_kolab_get_backend_property;
-#if 0 /* probably not needed */
- sync_class->set_backend_property_sync = cal_backend_kolab_set_backend_property;
-#endif
sync_class->get_object_sync = cal_backend_kolab_get_object;
sync_class->get_object_list_sync = cal_backend_kolab_get_object_list;
sync_class->get_free_busy_sync = cal_backend_kolab_get_free_busy;
@@ -2043,276 +2012,3 @@ e_cal_backend_kolab_class_init (ECalBackendKolabClass *klass)
/*----------------------------------------------------------------------------*/
-
-#if 0 /* FIXME old */
-
-/**
- * e_cal_backend_kolab_get_default_object:
- * @backend: An ECalBackendSync object.
- * @cal: An EDataCal object.
- * @object: Placeholder for returned object.
- *
- * Returns the default object via object placeholder.
- *
- * Returns: Status code.
- */
-static ECalBackendSyncStatus
-e_cal_backend_kolab_get_default_object (ECalBackendSync *backend,
- EDataCal *cal,
- gchar **object)
-{
- /* FIXME: Remove experimental code related to summary*/
- ECalComponent *comp;
- ECalComponentText *summary = NULL;
- ECalComponentText *desc = NULL;
- GSList *desclist = NULL;
- gchar *tmpsum = g_strdup ("");
- gchar *tmploc = g_strdup ("");
- gchar *tmpdesc1 = g_strdup ("");
- (void) cal;
-
- summary = g_new0 (ECalComponentText, 1);
- summary->value=tmpsum;
- desc = g_new0 (ECalComponentText, 1);
- desc->value=tmpdesc1;
- desclist = g_slist_append(desclist, desc);
-
- comp = e_cal_component_new ();
-
- switch (e_cal_backend_get_kind (E_CAL_BACKEND (backend))) {
- case ICAL_VEVENT_COMPONENT:
- e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
- e_cal_component_set_summary (comp, summary);
- e_cal_component_set_description_list (comp, desclist);
- e_cal_component_set_location (comp, tmploc);
- break;
- default:
- g_object_unref (comp);
- return GNOME_Evolution_Calendar_ObjectNotFound;
- }
-
- *object = e_cal_component_get_as_string (comp);
-
- if (comp)
- g_object_unref (comp);
-
- g_free (summary);
- g_free (tmploc);
- g_free (tmpdesc1);
- g_slist_foreach (desclist, (GFunc) g_free, NULL);
- g_slist_free (desclist);
-
- return GNOME_Evolution_Calendar_Success;
-} /* e_cal_backend_kolab_get_default_object () */
-
-/**
- * e_cal_backend_kolab_set_default_zone:
- * @backend: An ECalBackendSync object.
- * @cal: An EDataCal object.
- * @tz: Timezone object as string.
- *
- * Sets the default timezone for the calendar, which is used to resolve DATE and
- * floating DATE-TIME values.
- *
- * Returns: Status code.
- */
-static ECalBackendSyncStatus
-e_cal_backend_kolab_set_default_zone (ECalBackendSync *backend,
- EDataCal *cal,
- const gchar *tzobj)
-{
- ECalBackendKolab *kolab = E_CAL_BACKEND_KOLAB (backend);
- ECalBackendKolabPrivate *priv = E_CAL_BACKEND_KOLAB_PRIVATE (kolab);
- ECalComponent *ecaltz = NULL;
- (void) cal;
-
- ecaltz = e_cal_component_new_from_string (tzobj);
- if (ecaltz == NULL)
- return GNOME_Evolution_Calendar_InvalidObject;
-
- if (priv->default_zone != NULL)
- g_object_unref (priv->default_zone);
- priv->default_zone = ecaltz;
- return GNOME_Evolution_Calendar_Success;
-} /* e_cal_backend_kolab_set_default_zone () */
-
-/**
- * e_cal_backend_internal_get_default_timezone:
- * @backend: A calendar backend.
- *
- * Requests the default timezone from the backend.
- *
- * Returns: The icaltimezone representation of the default timezone.
- */
-static icaltimezone*
-e_cal_backend_kolab_internal_get_default_timezone (ECalBackend *backend)
-{
- ECalBackendKolab *kolab = E_CAL_BACKEND_KOLAB (backend);
- ECalBackendKolabPrivate *priv = E_CAL_BACKEND_KOLAB_PRIVATE (kolab);
- icaltimezone *icaltz = NULL;
- icalcomponent *icalcomp = NULL;
-
- icaltz = icaltimezone_new ();
- icalcomp = e_cal_component_get_icalcomponent (priv->default_zone);
- if (icalcomp == NULL)
- return NULL;
- icaltimezone_set_component (icaltz, icalcomp);
-
- return icaltz;
-} /* e_cal_backend_kolab_internal_get_default_timezone () */
-
-/**
- * e_cal_backend_kolab_get_mode:
- * @backend: A Kolab calendar backend.
- *
- * Queries the current calendar backend mode (local/remote).
- *
- * Returns: The current mode, the calendar is in.
- */
-static CalMode
-e_cal_backend_kolab_get_mode (ECalBackend *backend)
-{
- ECalBackendKolab *kolab = E_CAL_BACKEND_KOLAB (backend);
- ECalBackendKolabPrivate *priv = E_CAL_BACKEND_KOLAB_PRIVATE (kolab);
- KolabMailAccessOpmodeID koma_mode = KOLAB_MAIL_ACCESS_OPMODE_INVAL;
- GError *error = NULL;
-
- if (priv->cal_koma == NULL) {
- g_warning ("%s()[%u]: KolabMailAccess object not existent.",
- __func__, __LINE__);
- return CAL_MODE_INVALID;
- }
- koma_mode = kolab_mail_access_get_opmode (priv->cal_koma, &error);
- if (error != NULL) {
- g_warning ("%s()[%u]: %s",
- __func__, __LINE__, error->message);
- g_error_free (error);
- return CAL_MODE_INVALID;
- }
-
- switch (koma_mode) {
- case KOLAB_MAIL_ACCESS_OPMODE_OFFLINE:
- return CAL_MODE_LOCAL;
- break;
- case KOLAB_MAIL_ACCESS_OPMODE_ONLINE:
- return CAL_MODE_REMOTE;
- break;
- case KOLAB_MAIL_ACCESS_OPMODE_SHUTDOWN:
- case KOLAB_MAIL_ACCESS_OPMODE_NEW:
- case KOLAB_MAIL_ACCESS_OPMODE_INVAL:
- case KOLAB_MAIL_ACCESS_OPMODE_CONFIGURED:
- default:
- g_warning ("%s()[%u]: KolabMailAccess object's state unknown: %u.",
- __func__, __LINE__, koma_mode);
- return CAL_MODE_INVALID;
- }
-} /* e_cal_backend_kolab_get_mode () */
-
-/**
- * e_cal_backend_kolab_set_mode:
- * @backend: A Kolab calendar backend.
- * @mode: Mode to change to.
- *
- * Sets the mode of the calendar backend to the given mode.
- */
-static void
-e_cal_backend_kolab_set_mode (ECalBackend *backend,
- CalMode mode)
-{
- ECalBackendKolab *kolab = E_CAL_BACKEND_KOLAB (backend);
- ECalBackendKolabPrivate *priv = E_CAL_BACKEND_KOLAB_PRIVATE (kolab);
- GError *error = NULL;
- KolabMailAccessOpmodeID koma_mode = KOLAB_MAIL_ACCESS_OPMODE_INVAL;
- KolabMailAccessOpmodeID tmp_mode = KOLAB_MAIL_ACCESS_OPMODE_INVAL;
- const gchar *foldername;
- KolabSettingsHandler *ksettings = NULL;
- gboolean ok;
-
- switch (mode) {
- case CAL_MODE_LOCAL:
- priv->cal_mode = CAL_MODE_LOCAL;
- koma_mode = KOLAB_MAIL_ACCESS_OPMODE_OFFLINE;
- break;
- case CAL_MODE_REMOTE:
- priv->cal_mode = CAL_MODE_REMOTE;
- koma_mode = KOLAB_MAIL_ACCESS_OPMODE_ONLINE;
- break;
- case CAL_MODE_ANY:
- case CAL_MODE_INVALID:
- default:
- g_assert_not_reached();
- }
- if (priv->cal_koma == NULL) {
- g_warning ("%s()[%u]: KolabMailAccess object not existent.",
- __func__, __LINE__);
- return;
- }
- tmp_mode = kolab_mail_access_get_opmode (priv->cal_koma,
- &error);
- if (error != NULL)
- {
- g_warning ("%s()[%u]: error getting mode: %s",
- __func__, __LINE__, error->message);
- g_error_free (error);
- return;
- }
-
- if (tmp_mode < KOLAB_MAIL_ACCESS_OPMODE_OFFLINE) {
- return;
- }
- ok = kolab_mail_access_set_opmode (priv->cal_koma,
- koma_mode,
- &error);
- if (error != NULL)
- {
- g_warning ("%s()[%u]: error setting mode: %s",
- __func__, __LINE__, error->message);
- g_error_free (error);
- error = NULL;
- return;
- }
-
- if (ok && (koma_mode < KOLAB_MAIL_ACCESS_OPMODE_ONLINE))
- return;
-
- foldername = kolab_util_backend_get_foldername (E_BACKEND (backend));
- ok = kolab_mail_access_source_fbtrigger_needed (priv->cal_koma,
- foldername,
- &error);
- if (error != NULL)
- {
- g_warning ("%s()[%u]: %s",
- __func__, __LINE__, error->message);
- g_error_free (error);
- error = NULL;
- return;
- }
- if (ok) {
- ksettings = kolab_mail_access_get_settings_handler (priv->cal_koma);
- kolab_util_calendar_toggle_pfb_trigger (ksettings,
- foldername);
- g_object_unref (ksettings);
- }
-} /* e_cal_backend_kolab_set_mode () */
-
-/**
- * e_cal_backend_kolab_set_koma_table:
- * @kolab: An ECalBackendKolab object.
- * @koma_objects: A GHashTable to contain the required KoMA instances.
- *
- * This method has to be called before any other method which accesses
- * Kolab infrastructure. In this case it should be called from
- * e-cal-backend-kolab-factory during creation of a new ECalBackendKolab
- * instance.
- */
-void
-e_cal_backend_kolab_set_koma_table (ECalBackendKolab *kolab,
- GHashTable *koma_objects)
-{
- ECalBackendKolabPrivate *priv = E_CAL_BACKEND_KOLAB_PRIVATE (kolab);
-
- g_hash_table_ref (koma_objects);
- priv->koma_table = koma_objects;
-}
-
-#endif
diff --git a/src/calendar/kolab-util-calendar.c b/src/calendar/kolab-util-calendar.c
index 281be23..7d9afec 100644
--- a/src/calendar/kolab-util-calendar.c
+++ b/src/calendar/kolab-util-calendar.c
@@ -344,38 +344,6 @@ kolab_util_calendar_store (ECalComponent *ecalcomp,
/*----------------------------------------------------------------------------*/
-#if 0 /* FIXME old */
-ECalBackendSyncStatus
-kolab_util_calendar_map_error (GError *error)
-{
- ECalBackendSyncStatus status = GNOME_Evolution_Calendar_Success;
-
- if (error == NULL)
- return GNOME_Evolution_Calendar_Success;
-
- switch (error->code) {
- case KOLAB_BACKEND_ERROR_SYNC_NOTSTORED:
- status = GNOME_Evolution_Calendar_Success;
- break;
- case KOLAB_BACKEND_ERROR_NOTFOUND:
- status = GNOME_Evolution_Calendar_ObjectNotFound;
- break;
- case KOLAB_BACKEND_ERROR_CONTEXT_MISUSE:
- case KOLAB_BACKEND_ERROR_INFODB_NOFOLDER:
- status = GNOME_Evolution_Calendar_NoSuchCal;
- break;
- case KOLAB_BACKEND_ERROR_DATATYPE_EVOLUTION:
- case KOLAB_BACKEND_ERROR_DATATYPE_KOLAB:
- status = GNOME_Evolution_Calendar_InvalidObject;
- default:
- status = GNOME_Evolution_Calendar_OtherError;
- }
-
- g_debug ("%s()[%u] ECalBackendSyncStatus: %i", __func__, __LINE__, status);
- return status;
-}
-#endif
-
/**
* kolab_util_calendar_extract:
* @icalcomp: An icalcomponent.
diff --git a/src/calendar/kolab-util-calendar.h b/src/calendar/kolab-util-calendar.h
index 6d4ab00..d682540 100644
--- a/src/calendar/kolab-util-calendar.h
+++ b/src/calendar/kolab-util-calendar.h
@@ -82,10 +82,6 @@ kolab_util_calendar_extract (icalcomponent *icalcomp,
ECalComponent **tzcomp,
GError **error);
-#if 0
-ECalBackendSyncStatus kolab_util_calendar_map_error (GError *error);
-#endif
-
void
kolab_util_calendar_err_to_edb_err (GError **e_err,
const GError *k_err,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]