aboutsummaryrefslogtreecommitdiffstats
path: root/shell/evolution-storage.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-11-02 08:11:53 +0800
committerDan Winship <danw@src.gnome.org>2000-11-02 08:11:53 +0800
commit0fa29927fc5a0913388dc8fbc4a9b816c0a11119 (patch)
treef03f91bc99dfb77e3601f5c3506dde1eb025b059 /shell/evolution-storage.c
parentf62d997329216c7e47bb8e78724edec4dd7e72ef (diff)
downloadgsoc2013-evolution-0fa29927fc5a0913388dc8fbc4a9b816c0a11119.tar.gz
gsoc2013-evolution-0fa29927fc5a0913388dc8fbc4a9b816c0a11119.tar.zst
gsoc2013-evolution-0fa29927fc5a0913388dc8fbc4a9b816c0a11119.zip
Add "highligted" field to Folder. Add update_folder method to
* Evolution-Storage.idl: Add "highligted" field to Folder. Add update_folder method to StorageListener to change display_name and highlight status. * e-folder.c: Add "highlighted" to EFolder to match the Evolution::Folder type. (e_folder_get_highlighted, e_folder_set_highlighted): Added * evolution-storage-listener.c (impl_Evolution_StorageListener_update_folder, etc): * e-storage.c (e_storage_updated_folder, etc): * e-corba-storage.c (impl_StorageListener_update_folder, etc): Implement update_folder. * e-storage-set.c (storage_updated_folder_cb, etc): Re-emit updated_folder signals received from EStorage. * e-storage-set-view.c (various): Add another model column to the ETable and set it up as a bold_column based on e_folder_get_highligted. (updated_folder_cb, etc): Listen to EStorageSet update_folder signal and emit ETree node_changed signals. * evolution-storage.c (evolution_storage_update_folder): Client function to update a folder's display_name and highlighted status. * Evolution-LocalStorage.idl: * evolution-local-storage.c: * e-local-storage.c: Change set_display_name to update_folder to match Evolution::StorageListener svn path=/trunk/; revision=6328
Diffstat (limited to 'shell/evolution-storage.c')
-rw-r--r--shell/evolution-storage.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/shell/evolution-storage.c b/shell/evolution-storage.c
index 4d271cefa8..d1a1285297 100644
--- a/shell/evolution-storage.c
+++ b/shell/evolution-storage.c
@@ -545,6 +545,67 @@ evolution_storage_new_folder (EvolutionStorage *evolution_storage,
}
EvolutionStorageResult
+evolution_storage_update_folder (EvolutionStorage *evolution_storage,
+ const char *path, const char *display_name,
+ gboolean highlighted)
+{
+ EvolutionStorageResult result;
+ EvolutionStoragePrivate *priv;
+ CORBA_Environment ev;
+ GList *p;
+ Evolution_Folder *corba_folder;
+
+ g_return_val_if_fail (evolution_storage != NULL,
+ EVOLUTION_STORAGE_ERROR_INVALIDPARAMETER);
+ g_return_val_if_fail (EVOLUTION_IS_STORAGE (evolution_storage),
+ EVOLUTION_STORAGE_ERROR_INVALIDPARAMETER);
+ g_return_val_if_fail (path != NULL, EVOLUTION_STORAGE_ERROR_INVALIDPARAMETER);
+ g_return_val_if_fail (g_path_is_absolute (path), EVOLUTION_STORAGE_ERROR_INVALIDPARAMETER);
+
+ priv = evolution_storage->priv;
+
+ if (priv->corba_storage_listeners == NULL)
+ return EVOLUTION_STORAGE_ERROR_NOTREGISTERED;
+
+ CORBA_exception_init (&ev);
+
+ result = EVOLUTION_STORAGE_OK;
+
+ for (p = priv->corba_storage_listeners; p != NULL; p = p->next) {
+ Evolution_StorageListener listener;
+
+ listener = p->data;
+ Evolution_StorageListener_update_folder (listener, path, display_name, highlighted, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION)
+ continue;
+
+ if (ev._major != CORBA_USER_EXCEPTION)
+ result = EVOLUTION_STORAGE_ERROR_CORBA;
+ else if (strcmp (CORBA_exception_id (&ev), ex_Evolution_StorageListener_NotFound) == 0)
+ result = EVOLUTION_STORAGE_ERROR_NOTFOUND;
+ else
+ result = EVOLUTION_STORAGE_ERROR_GENERIC;
+
+ break;
+ }
+
+ CORBA_exception_free (&ev);
+
+ if (result == EVOLUTION_STORAGE_OK) {
+ corba_folder = e_folder_tree_get_folder (priv->folder_tree, path);
+ if (corba_folder != NULL) {
+ CORBA_free (corba_folder->display_name);
+ corba_folder->display_name = CORBA_string_dup (display_name);
+ corba_folder->highlighted = highlighted;
+ } else
+ result = EVOLUTION_STORAGE_ERROR_NOTFOUND;
+ }
+
+ return result;
+}
+
+EvolutionStorageResult
evolution_storage_removed_folder (EvolutionStorage *evolution_storage,
const char *path)
{