aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-11-26 03:34:07 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-11-26 03:34:07 +0800
commit5b52c5ac764f007457fc12f3abcb644011c76b43 (patch)
tree22140a646fb596a7c7419dfba3483863f58e05f6
parent98a522b22e81746773fe26ef831b0a76743cc1bb (diff)
downloadgsoc2013-evolution-5b52c5ac764f007457fc12f3abcb644011c76b43.tar.gz
gsoc2013-evolution-5b52c5ac764f007457fc12f3abcb644011c76b43.tar.zst
gsoc2013-evolution-5b52c5ac764f007457fc12f3abcb644011c76b43.zip
Updated to pass a GSList to e_storage_set_view_set_checkboxes_list()
* evolution-storage-set-view.c (impl_StorageSetView__set_checkedFolders): Updated to pass a GSList to e_storage_set_view_set_checkboxes_list() [instead of a GList]. (impl_StorageSetView__get_checkedFolders): Likewise with the return value from e_storage_set_view_get_checkboxes_list(). * e-shell-config-offline.c (config_control_apply_callback): Filled in, using GConf. (init_storage_set_view_status_from_config): Likewise. * e-storage-set-view.c (e_storage_set_view_get_checkboxes_list): Return a GSList instead of a GList. (essv_add_to_list): Update for the GSList. (e_storage_set_view_set_checkboxes_list): Get a GSList instead of a GList. * apps_evolution_shell.schemas: Added /schemas/apps/evolution/shell/offline/folder_paths. svn path=/trunk/; revision=18912
-rw-r--r--shell/ChangeLog22
-rw-r--r--shell/apps_evolution_shell.schemas12
-rw-r--r--shell/e-shell-config-offline.c83
-rw-r--r--shell/e-storage-set-view.c15
-rw-r--r--shell/e-storage-set-view.h4
-rw-r--r--shell/evolution-storage-set-view.c16
6 files changed, 72 insertions, 80 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 7fd4c8f38f..ee6e38cc50 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,25 @@
+2002-11-25 Ettore Perazzoli <ettore@ximian.com>
+
+ * evolution-storage-set-view.c
+ (impl_StorageSetView__set_checkedFolders): Updated to pass a
+ GSList to e_storage_set_view_set_checkboxes_list() [instead of a
+ GList].
+ (impl_StorageSetView__get_checkedFolders): Likewise with the
+ return value from e_storage_set_view_get_checkboxes_list().
+
+ * e-shell-config-offline.c (config_control_apply_callback): Filled
+ in, using GConf.
+ (init_storage_set_view_status_from_config): Likewise.
+
+ * e-storage-set-view.c (e_storage_set_view_get_checkboxes_list):
+ Return a GSList instead of a GList.
+ (essv_add_to_list): Update for the GSList.
+ (e_storage_set_view_set_checkboxes_list): Get a GSList instead of
+ a GList.
+
+ * apps_evolution_shell.schemas: Added
+ /schemas/apps/evolution/shell/offline/folder_paths.
+
2002-11-20 Ettore Perazzoli <ettore@ximian.com>
* main.c (idle_cb): Set displayed_any in the case when we are
diff --git a/shell/apps_evolution_shell.schemas b/shell/apps_evolution_shell.schemas
index 62adc3dab2..5aa3fcf32e 100644
--- a/shell/apps_evolution_shell.schemas
+++ b/shell/apps_evolution_shell.schemas
@@ -131,6 +131,18 @@
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/evolution/shell/offline/folder_paths</key>
+ <applyto>/apps/evolution/shell/offline/folder_paths</applyto>
+ <owner>evolution</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <default>[]</default>
+ <locale name="C">
+ <short>List of paths for the folders to be synchronized to disk for offline usage</short>
+ </locale>
+ </schema>
+
<!-- View defaults -->
<schema>
diff --git a/shell/e-shell-config-offline.c b/shell/e-shell-config-offline.c
index fa8b804691..ab97b5204a 100644
--- a/shell/e-shell-config-offline.c
+++ b/shell/e-shell-config-offline.c
@@ -32,7 +32,7 @@
#include "Evolution.h"
-#include <bonobo/bonobo-exception.h>
+#include <gconf/gconf-client.h>
#include <gal/widgets/e-scroll-frame.h>
@@ -65,42 +65,23 @@ static void
config_control_apply_callback (EvolutionConfigControl *config_control,
void *data)
{
-#if 0
- CORBA_Environment ev;
- CORBA_sequence_CORBA_string *paths;
- CORBA_any any;
+ GConfClient *gconf_client;
PageData *page_data;
- GList *checked_paths;
- GList *p;
- int i;
+ GSList *checked_paths;
page_data = (PageData *) data;
checked_paths = e_storage_set_view_get_checkboxes_list (E_STORAGE_SET_VIEW (page_data->storage_set_view));
- paths = CORBA_sequence_CORBA_string__alloc ();
- paths->_maximum = paths->_length = g_list_length (checked_paths);
- paths->_buffer = CORBA_sequence_CORBA_string_allocbuf (paths->_maximum);
+ gconf_client = gconf_client_get_default ();
- CORBA_sequence_set_release (paths, TRUE);
+ gconf_client_set_list (gconf_client, "/apps/evolution/shell/offline/folder_paths",
+ GCONF_VALUE_STRING, checked_paths, NULL);
- for (p = checked_paths, i = 0; p != NULL; p = p->next, i ++)
- paths->_buffer[i] = CORBA_string_dup ((const char *) p->data);
+ g_slist_foreach (checked_paths, (GFunc) g_free, NULL);
+ g_slist_free (checked_paths);
- any._type = TC_CORBA_sequence_CORBA_string;
- any._value = paths;
-
- CORBA_exception_init (&ev);
-
- Bonobo_ConfigDatabase_setValue (e_shell_get_config_db (page_data->shell),
- "/OfflineFolders/paths", &any, &ev);
- if (BONOBO_EX (&ev))
- g_warning ("Cannot set /OfflineFolders/paths from ConfigDatabase -- %s", BONOBO_EX_ID (&ev));
-
- CORBA_exception_free (&ev);
-
- g_list_free (checked_paths);
-#endif
+ g_object_unref (gconf_client);
}
static void
@@ -120,46 +101,20 @@ static void
init_storage_set_view_status_from_config (EStorageSetView *storage_set_view,
EShell *shell)
{
-#if 0
- Bonobo_ConfigDatabase config_db;
- CORBA_Environment ev;
- CORBA_any *any;
- CORBA_sequence_CORBA_string *sequence;
- GList *list;
- int i;
-
- config_db = e_shell_get_config_db (shell);
- g_assert (config_db != CORBA_OBJECT_NIL);
-
- CORBA_exception_init (&ev);
-
- any = Bonobo_ConfigDatabase_getValue (config_db, "/OfflineFolders/paths", "", &ev);
- if (BONOBO_EX (&ev)) {
- g_warning ("Cannot get /OfflineFolders/paths from ConfigDatabase -- %s", BONOBO_EX_ID (&ev));
- CORBA_exception_free (&ev);
- return;
- }
-
- if (! CORBA_TypeCode_equal (any->_type, TC_CORBA_sequence_CORBA_string, &ev) || BONOBO_EX (&ev)) {
- g_warning ("/OfflineFolders/Paths in ConfigDatabase is not the expected type");
- CORBA_free (any);
- CORBA_exception_free (&ev);
- return;
- }
-
- sequence = (CORBA_sequence_CORBA_string *) any->_value;
-
- list = NULL;
- for (i = 0; i < sequence->_length; i ++)
- list = g_list_prepend (list, sequence->_buffer[i]);
+ GConfClient *gconf_client;
+ GSList *list;
+
+ gconf_client = gconf_client_get_default ();
+
+ list = gconf_client_get_list (gconf_client, "/apps/evolution/shell/offline/folder_paths",
+ GCONF_VALUE_STRING, NULL);
e_storage_set_view_set_checkboxes_list (storage_set_view, list);
- g_list_free (list);
- CORBA_free (any);
+ g_slist_foreach (list, (GFunc) g_free, NULL);
+ g_slist_free (list);
- CORBA_exception_free (&ev);
-#endif
+ g_object_unref (gconf_client);
}
static gboolean
diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c
index cfa97d9583..a18d23a34d 100644
--- a/shell/e-storage-set-view.c
+++ b/shell/e-storage-set-view.c
@@ -2350,7 +2350,7 @@ e_storage_set_view_enable_search (EStorageSetView *storage_set_view,
void
e_storage_set_view_set_checkboxes_list (EStorageSetView *storage_set_view,
- GList *checkboxes)
+ GSList *checkboxes)
{
gboolean changed = FALSE;
EStorageSetViewPrivate *priv = storage_set_view->priv;
@@ -2364,7 +2364,7 @@ e_storage_set_view_set_checkboxes_list (EStorageSetView *storage_set_view,
if (checkboxes) {
priv->checkboxes = g_hash_table_new (g_str_hash, g_str_equal);
- for (; checkboxes; checkboxes = g_list_next (checkboxes)) {
+ for (; checkboxes; checkboxes = g_slist_next (checkboxes)) {
char *path = checkboxes->data;
if (g_hash_table_lookup (priv->checkboxes, path))
@@ -2387,21 +2387,22 @@ essv_add_to_list (gpointer key,
gpointer value,
gpointer user_data)
{
- GList **list = user_data;
+ GSList **list = user_data;
- *list = g_list_prepend (*list, g_strdup (key));
+ *list = g_slist_prepend (*list, g_strdup (key));
}
-GList *
+GSList *
e_storage_set_view_get_checkboxes_list (EStorageSetView *storage_set_view)
{
- GList *list = NULL;
+ GSList *list = NULL;
if (storage_set_view->priv->checkboxes) {
g_hash_table_foreach (storage_set_view->priv->checkboxes, essv_add_to_list, &list);
- list = g_list_reverse (list);
+ list = g_slist_reverse (list);
}
+
return list;
}
diff --git a/shell/e-storage-set-view.h b/shell/e-storage-set-view.h
index db5fccd975..65a2e7ae14 100644
--- a/shell/e-storage-set-view.h
+++ b/shell/e-storage-set-view.h
@@ -105,8 +105,8 @@ void e_storage_set_view_enable_search (EStorageSetView *storage_set_view,
gboolean enable);
void e_storage_set_view_set_checkboxes_list (EStorageSetView *storage_set_view,
- GList *checkboxes);
-GList *e_storage_set_view_get_checkboxes_list (EStorageSetView *storage_set_view);
+ GSList *checkboxes);
+GSList *e_storage_set_view_get_checkboxes_list (EStorageSetView *storage_set_view);
void e_storage_set_view_set_allow_dnd (EStorageSetView *storage_set_view,
gboolean allow_dnd);
diff --git a/shell/evolution-storage-set-view.c b/shell/evolution-storage-set-view.c
index 0674356162..c4eadc7ec7 100644
--- a/shell/evolution-storage-set-view.c
+++ b/shell/evolution-storage-set-view.c
@@ -285,7 +285,7 @@ impl_StorageSetView__set_checkedFolders (PortableServer_Servant servant,
BonoboObject *bonobo_object;
EvolutionStorageSetView *storage_set_view;
EvolutionStorageSetViewPrivate *priv;
- GList *path_list = NULL;
+ GSList *path_list = NULL;
int i;
bonobo_object = bonobo_object_from_servant (servant);
@@ -296,13 +296,14 @@ impl_StorageSetView__set_checkedFolders (PortableServer_Servant servant,
if (strncmp (list->_buffer[i].evolutionUri, "evolution:", 10) != 0)
continue;
- path_list = g_list_append (path_list, g_strdup (list->_buffer[i].evolutionUri + 10));
+ path_list = g_slist_append (path_list, g_strdup (list->_buffer[i].evolutionUri + 10));
}
e_storage_set_view_set_checkboxes_list (E_STORAGE_SET_VIEW (priv->storage_set_view_widget),
path_list);
- e_free_string_list (path_list);
+ g_slist_foreach (path_list, (GFunc) g_free, NULL);
+ g_slist_free (path_list);
}
static GNOME_Evolution_FolderList *
@@ -314,8 +315,8 @@ impl_StorageSetView__get_checkedFolders (PortableServer_Servant servant,
EvolutionStorageSetViewPrivate *priv;
EStorageSet *storage_set;
GNOME_Evolution_FolderList *return_list;
- GList *path_list;
- GList *p;
+ GSList *path_list;
+ GSList *p;
int num_folders;
int i;
@@ -324,7 +325,7 @@ impl_StorageSetView__get_checkedFolders (PortableServer_Servant servant,
priv = storage_set_view->priv;
path_list = e_storage_set_view_get_checkboxes_list (E_STORAGE_SET_VIEW (priv->storage_set_view_widget));
- num_folders = g_list_length (path_list);
+ num_folders = g_slist_length (path_list);
return_list = GNOME_Evolution_FolderList__alloc ();
return_list->_maximum = num_folders;
@@ -356,7 +357,8 @@ impl_StorageSetView__get_checkedFolders (PortableServer_Servant servant,
g_free (evolution_uri);
}
- e_free_string_list (path_list);
+ g_slist_foreach (path_list, (GFunc) g_free, NULL);
+ g_slist_free (path_list);
CORBA_sequence_set_release (return_list, TRUE);
return return_list;