diff options
author | JP Rosevear <jpr@helixcode.com> | 2000-09-10 14:52:09 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2000-09-10 14:52:09 +0800 |
commit | 900a7ac710e0ce88bb3c8fa00673fe405a8ba668 (patch) | |
tree | 91c9d8f5f17674291993aecc076cdfb20d6896ae /calendar/conduits/todo/todo-conduit-config.h | |
parent | d6080b277df35517afcc21b5b963e3e86389d66b (diff) | |
download | gsoc2013-evolution-900a7ac710e0ce88bb3c8fa00673fe405a8ba668.tar gsoc2013-evolution-900a7ac710e0ce88bb3c8fa00673fe405a8ba668.tar.gz gsoc2013-evolution-900a7ac710e0ce88bb3c8fa00673fe405a8ba668.tar.bz2 gsoc2013-evolution-900a7ac710e0ce88bb3c8fa00673fe405a8ba668.tar.lz gsoc2013-evolution-900a7ac710e0ce88bb3c8fa00673fe405a8ba668.tar.xz gsoc2013-evolution-900a7ac710e0ce88bb3c8fa00673fe405a8ba668.tar.zst gsoc2013-evolution-900a7ac710e0ce88bb3c8fa00673fe405a8ba668.zip |
Use cal component pilot stuff properly (find_record_in_repository): Remove
2000-09-10 JP Rosevear <jpr@helixcode.com>
* conduits/todo/todo-conduit.c (local_record_from_icalobject): Use
cal component pilot stuff properly
(find_record_in_repository): Remove cruft
(ical_from_remote_record): Remove cruft
(update_record): Set the vtype immediately after creation. Remove
cruft
* conduits/todo/todo-conduit.h: Remove iCalObject stuff
* conduits/todo/todo-conduit-config.h: Move all the config stuff
here, I need to kill the warnings at some point
* conduits/todo/todo-conduit-control-applet.c (doRevertSettings):
Set all the state variables correctly on a revert
(doSaveSettings): Update original state
(doHelp): Rename from about_cb
(main): Destroy configurations when done
* conduits/todo/Makefile.am: Tidy
* pcs/cal-backend-file.c (cbf_pilot_hash): Function for hashing
pilot ids
(cbf_pilot_equal): For hash table of pilot ids
(cal_backend_file_destroy): Destroy pilot id hash
(add_component): Insert the uid into the pilot hash
(remove_component): Remove the uid from the pilot hash
(cal_backend_file_load): Create the pilot hash
(cal_backend_file_create): ditto
(cal_backend_file_get_uid_by_pilot_id): Implement using the pilot
hash
(cal_backend_file_update_pilot_id): ditto
* cal-util/cal-component.h: Update prototypes
* cal-util/cal-component.c (cal_component_get_pilot_id): Implement
using ical X properties
(cal_component_set_pilot_id): ditto
(cal_component_get_pilot_status): ditto
(cal_component_set_pilot_status): ditto
(cal_component_free_pilot_id): Free a pilot id
(cal_component_free_pilot_status): Free a pilot status
svn path=/trunk/; revision=5298
Diffstat (limited to 'calendar/conduits/todo/todo-conduit-config.h')
-rw-r--r-- | calendar/conduits/todo/todo-conduit-config.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/calendar/conduits/todo/todo-conduit-config.h b/calendar/conduits/todo/todo-conduit-config.h new file mode 100644 index 0000000000..fb4d35c7e8 --- /dev/null +++ b/calendar/conduits/todo/todo-conduit-config.h @@ -0,0 +1,79 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +#ifndef __TODO_CONDUIT_CONFIG_H__ +#define __TODO_CONDUIT_CONFIG_H__ + +#include <gnome.h> +#include <libgpilotdCM/gnome-pilot-conduit-management.h> +#include <libgpilotdCM/gnome-pilot-conduit-config.h> + +/* This is the configuration of the GnomeCal conduit. */ +typedef struct _ToDoConduitCfg ToDoConduitCfg; +struct _ToDoConduitCfg { + gboolean open_secret; + guint32 pilotId; + GnomePilotConduitSyncType sync_type; /* only used by capplet */ +}; + +static void +todoconduit_load_configuration (ToDoConduitCfg **c, guint32 pilotId) +{ + gchar prefix[256]; + g_snprintf (prefix,255,"/gnome-pilot.d/todo-conduit/Pilot_%u/",pilotId); + + *c = g_new0 (ToDoConduitCfg,1); + g_assert (*c != NULL); + gnome_config_push_prefix (prefix); + (*c)->open_secret = gnome_config_get_bool ("open_secret=FALSE"); + (*c)->sync_type = GnomePilotConduitSyncTypeCustom; /* set in capplets main */ + gnome_config_pop_prefix (); + + (*c)->pilotId = pilotId; +} + +/* Saves the configuration data. */ +static void +todoconduit_save_configuration (ToDoConduitCfg *c) +{ + gchar prefix[256]; + + g_snprintf(prefix,255,"/gnome-pilot.d/todo-conduit/Pilot_%u/",c->pilotId); + + gnome_config_push_prefix(prefix); + gnome_config_set_bool ("open_secret", c->open_secret); + gnome_config_pop_prefix(); + + gnome_config_sync(); + gnome_config_drop_all(); +} + +/* Creates a duplicate of the configuration data */ +static ToDoConduitCfg* +todoconduit_dupe_configuration (ToDoConduitCfg *c) +{ + ToDoConduitCfg *retval; + g_return_val_if_fail (c!=NULL,NULL); + retval = g_new0 (ToDoConduitCfg,1); + retval->sync_type = c->sync_type; + retval->open_secret = c->open_secret; + retval->pilotId = c->pilotId; + return retval; +} + +static void +todoconduit_destroy_configuration (ToDoConduitCfg **c) +{ + g_return_if_fail (c!=NULL); + g_return_if_fail (*c!=NULL); + g_free (*c); + *c = NULL; +} + +#endif __TODO_CONDUIT_CONFIG_H__ + + + + + + + |