aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-09-01 14:09:29 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-09-01 14:09:29 +0800
commit26112575da034a7a0a79ab2238a01304348eada5 (patch)
treeef90667e30709a4f74fe931be9f27b56b9baf2e2
parent7df49391da6f67a7c1abee662e0d3a2c18ea9c36 (diff)
downloadgsoc2013-evolution-26112575da034a7a0a79ab2238a01304348eada5.tar
gsoc2013-evolution-26112575da034a7a0a79ab2238a01304348eada5.tar.gz
gsoc2013-evolution-26112575da034a7a0a79ab2238a01304348eada5.tar.bz2
gsoc2013-evolution-26112575da034a7a0a79ab2238a01304348eada5.tar.lz
gsoc2013-evolution-26112575da034a7a0a79ab2238a01304348eada5.tar.xz
gsoc2013-evolution-26112575da034a7a0a79ab2238a01304348eada5.tar.zst
gsoc2013-evolution-26112575da034a7a0a79ab2238a01304348eada5.zip
Changed `Evolution::Storage' so that the displayed name for a folder
is decoupled from its path, and updated all the components accordingly. svn path=/trunk/; revision=5159
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/gui/component/e-ldap-storage.c5
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-ops.c1
-rw-r--r--mail/mail-vfolder.c8
-rw-r--r--shell/ChangeLog12
-rw-r--r--shell/Evolution-Storage.idl2
-rw-r--r--shell/e-corba-storage.c6
-rw-r--r--shell/e-local-storage.c18
-rw-r--r--shell/e-storage.c39
-rw-r--r--shell/evolution-storage.c21
-rw-r--r--shell/evolution-storage.h1
12 files changed, 84 insertions, 41 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index b99ff7e04b..51db4eef14 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,9 @@
+2000-09-01 Ettore Perazzoli <ettore@helixcode.com>
+
+ * gui/component/e-ldap-storage.c (load_ldap_data): Updated for the
+ extra arg now needed by `evolution_storage_new_folder()'.
+ (e_ldap_storage_add_server): Likewise.
+
2000-08-31 Ettore Perazzoli <ettore@helixcode.com>
* conduit/Makefile.am (INCLUDES): Add `BONOBO_GNOME_CFLAGS' and
diff --git a/addressbook/gui/component/e-ldap-storage.c b/addressbook/gui/component/e-ldap-storage.c
index aa1e153a2a..be9b085f7d 100644
--- a/addressbook/gui/component/e-ldap-storage.c
+++ b/addressbook/gui/component/e-ldap-storage.c
@@ -186,7 +186,8 @@ load_ldap_data (EvolutionStorage *storage,
server->uri = g_strdup_printf ("ldap://%s:%s/%s??%s", server->host, server->port, server->rootdn, server->scope);
path = g_strdup_printf ("/%s", server->name);
- evolution_storage_new_folder (storage, path, "contacts", server->uri, server->description);
+ evolution_storage_new_folder (storage, path, server->name,
+ "contacts", server->uri, server->description);
g_hash_table_insert (servers, server->name, server);
@@ -277,7 +278,7 @@ e_ldap_storage_add_server (ELDAPServer *server)
/* and then to the ui */
path = g_strdup_printf ("/%s", server->name);
- evolution_storage_new_folder (storage, path, "contacts", server->uri, server->description);
+ evolution_storage_new_folder (storage, path, server->name, "contacts", server->uri, server->description);
g_free (path);
diff --git a/mail/ChangeLog b/mail/ChangeLog
index cfc5a4ce0d..98f8d7eb37 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,9 @@
+2000-09-01 Ettore Perazzoli <ettore@helixcode.com>
+
+ * mail-ops.c (cleanup_scan_subfolders): Update for the extra arg
+ needed by `evolution_storage_new_folder()'.
+ * mail-vfolder.c (vfolder_refresh): Likewise.
+
2000-08-30 Ettore Perazzoli <ettore@helixcode.com>
* mail-view.c (mail_view_create): Make the HTML widget grab the
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index d7bfb9af10..79fdf12ab6 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -890,6 +890,7 @@ cleanup_scan_subfolders (gpointer in_data, gpointer op_data,
info = data->new_folders->pdata[i];
evolution_storage_new_folder (input->storage,
info->path,
+ g_basename (info->path),
"mail",
info->uri, _("(No description)"));
g_free (info->path);
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index b425fe7bec..40e3cd7f11 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -91,7 +91,9 @@ vfolder_refresh(void)
uri = g_strdup_printf("vfolder:%s", info->name);
path = g_strdup_printf("/%s", info->name);
evolution_storage_removed_folder(vfolder_storage, path);
- evolution_storage_new_folder (vfolder_storage, path,
+ evolution_storage_new_folder (vfolder_storage,
+ path,
+ g_basename (path),
"mail",
uri,
info->name);
@@ -107,7 +109,9 @@ vfolder_refresh(void)
/*uri = g_strdup_printf("vfolder:%s/vfolder/%s?%s", evolution_dir, info->name, info->query);*/
uri = g_strdup_printf("vfolder:%s", info->name);
path = g_strdup_printf("/%s", info->name);
- evolution_storage_new_folder (vfolder_storage, path,
+ evolution_storage_new_folder (vfolder_storage,
+ path,
+ g_basename (path),
"mail",
uri,
info->name);
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 022ab25cd9..503ac66817 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,15 @@
+2000-09-01 Ettore Perazzoli <ettore@helixcode.com>
+
+ * evolution-storage.c (evolution_storage_new_folder): Handle @path
+ as the full path.
+
+ * e-storage.c (e_storage_new_folder): Consider @path to be the
+ full path, not the parent path.
+ * e-local-storage.c (load_folders): Updated accordingly.
+
+ * Evolution-Storage.idl: Member `name' of `struct Folder' renamed
+ to `display_name'.
+
2000-08-31 Chris Toshok <toshok@helixcode.com>
* e-shell-view.c: add delayed_selection to _EShellViewPrivate.
diff --git a/shell/Evolution-Storage.idl b/shell/Evolution-Storage.idl
index 4e35e859bf..46c73e2654 100644
--- a/shell/Evolution-Storage.idl
+++ b/shell/Evolution-Storage.idl
@@ -14,7 +14,7 @@ module Evolution {
struct Folder {
string type;
string description;
- string name;
+ string display_name;
string physical_uri;
};
diff --git a/shell/e-corba-storage.c b/shell/e-corba-storage.c
index b4320a4c52..3e977afaf1 100644
--- a/shell/e-corba-storage.c
+++ b/shell/e-corba-storage.c
@@ -105,14 +105,14 @@ impl_StorageListener_new_folder (PortableServer_Servant servant,
storage_listener_servant = (StorageListenerServant *) servant;
storage = storage_listener_servant->storage;
- e_folder = e_folder_new (folder->name,
+ e_folder = e_folder_new (folder->display_name,
folder->type,
folder->description);
e_folder_set_physical_uri (e_folder, folder->physical_uri);
if (! e_storage_new_folder (storage, path, e_folder)) {
- g_print ("Cannot register folder -- %s %s\n", path, folder->name);
+ g_print ("Cannot register folder -- %s %s\n", path, folder->display_name);
CORBA_exception_set (ev,
CORBA_USER_EXCEPTION,
ex_Evolution_StorageListener_Exists,
@@ -120,7 +120,7 @@ impl_StorageListener_new_folder (PortableServer_Servant servant,
gtk_object_unref (GTK_OBJECT (e_folder));
}
- g_print ("Folder registered successfully -- %s %s\n", path, folder->name);
+ g_print ("Folder registered successfully -- %s %s\n", path, folder->display_name);
}
static void
diff --git a/shell/e-local-storage.c b/shell/e-local-storage.c
index 93234b4741..de8e23e704 100644
--- a/shell/e-local-storage.c
+++ b/shell/e-local-storage.c
@@ -169,7 +169,7 @@ load_folders (ELocalStorage *local_storage,
if (folder == NULL)
return FALSE;
- e_storage_new_folder (E_STORAGE (local_storage), parent_path, folder);
+ e_storage_new_folder (E_STORAGE (local_storage), path, folder);
subfolder_directory_path = g_concat_dir_and_file (physical_path, SUBFOLDER_DIR_NAME);
}
@@ -295,8 +295,8 @@ shell_component_result_to_storage_result (EvolutionShellComponentResult result)
struct _AsyncCreateFolderCallbackData {
EStorage *storage;
- char *parent_path;
- char *name;
+ char *path;
+ char *display_name;
char *type;
char *description;
char *physical_uri;
@@ -322,7 +322,7 @@ component_async_create_folder_callback (EvolutionShellComponentClient *shell_com
} else {
EFolder *folder;
- folder = e_local_folder_new (callback_data->name,
+ folder = e_local_folder_new (callback_data->display_name,
callback_data->type,
callback_data->description);
@@ -330,7 +330,7 @@ component_async_create_folder_callback (EvolutionShellComponentClient *shell_com
if (e_local_folder_save (E_LOCAL_FOLDER (folder))) {
e_storage_new_folder (callback_data->storage,
- callback_data->parent_path,
+ callback_data->path,
folder);
} else {
rmdir (callback_data->physical_path);
@@ -345,8 +345,8 @@ component_async_create_folder_callback (EvolutionShellComponentClient *shell_com
shell_component_result_to_storage_result (result),
callback_data->callback_data);
- g_free (callback_data->parent_path);
- g_free (callback_data->name);
+ g_free (callback_data->path);
+ g_free (callback_data->display_name);
g_free (callback_data->type);
g_free (callback_data->description);
g_free (callback_data->physical_uri);
@@ -465,8 +465,8 @@ impl_async_create_folder (EStorage *storage,
callback_data = g_new (AsyncCreateFolderCallbackData, 1);
callback_data->storage = storage;
- callback_data->parent_path = parent_path;
- callback_data->name = g_strdup (folder_name);
+ callback_data->path = path;
+ callback_data->display_name = g_strdup (folder_name);
callback_data->type = g_strdup (type);
callback_data->description = g_strdup (description);
callback_data->physical_uri = physical_uri;
diff --git a/shell/e-storage.c b/shell/e-storage.c
index eb03cb36a0..ae984f7a09 100644
--- a/shell/e-storage.c
+++ b/shell/e-storage.c
@@ -154,6 +154,24 @@ free_private (EStorage *storage)
}
+/* Private utility functions. */
+
+static char *
+get_parent_path (const char *path)
+{
+ const char *last_separator;
+
+ g_assert (g_path_is_absolute (path));
+
+ last_separator = strrchr (path, G_DIR_SEPARATOR);
+
+ if (last_separator == path)
+ return g_strdup (G_DIR_SEPARATOR_S);
+
+ return g_strndup (path, last_separator - path);
+}
+
+
/* GtkObject methods. */
static void
@@ -436,7 +454,7 @@ e_storage_result_to_string (EStorageResult result)
}
-/* Utility functions. */
+/* Public utility functions. */
struct _GetPathForPhysicalUriForeachData {
const char *physical_uri;
@@ -511,28 +529,30 @@ e_storage_get_path_for_physical_uri (EStorage *storage,
gboolean
e_storage_new_folder (EStorage *storage,
- const char *path,
+ const char *full_path,
EFolder *e_folder)
{
EStoragePrivate *priv;
Folder *folder;
Folder *parent_folder;
const char *name;
- char *full_path;
+ char *parent_path;
g_return_val_if_fail (storage != NULL, FALSE);
g_return_val_if_fail (E_IS_STORAGE (storage), FALSE);
- g_return_val_if_fail (path != NULL, FALSE);
- g_return_val_if_fail (g_path_is_absolute (path), FALSE);
+ g_return_val_if_fail (full_path != NULL, FALSE);
+ g_return_val_if_fail (g_path_is_absolute (full_path), FALSE);
g_return_val_if_fail (e_folder != NULL, FALSE);
g_return_val_if_fail (E_IS_FOLDER (e_folder), FALSE);
priv = storage->priv;
- parent_folder = g_hash_table_lookup (priv->path_to_folder, path);
+ parent_path = get_parent_path (full_path);
+
+ parent_folder = g_hash_table_lookup (priv->path_to_folder, parent_path);
if (parent_folder == NULL) {
g_warning ("%s: Trying to add a subfolder to a path that does not exist yet -- %s",
- __FUNCTION__, path);
+ __FUNCTION__, parent_path);
return FALSE;
}
@@ -540,13 +560,10 @@ e_storage_new_folder (EStorage *storage,
g_assert (name != NULL);
g_return_val_if_fail (*name != G_DIR_SEPARATOR, FALSE);
- full_path = g_concat_dir_and_file (path, name);
-
folder = g_hash_table_lookup (priv->path_to_folder, full_path);
if (folder != NULL) {
g_warning ("%s: Trying to add a subfolder for a path that already exists -- %s",
__FUNCTION__, full_path);
- g_free (full_path);
return FALSE;
}
@@ -557,7 +574,7 @@ e_storage_new_folder (EStorage *storage,
gtk_signal_emit (GTK_OBJECT (storage), signals[NEW_FOLDER], folder->path);
- g_free (full_path);
+ g_free (parent_path);
return TRUE;
}
diff --git a/shell/evolution-storage.c b/shell/evolution-storage.c
index 2503905b13..6b768770bd 100644
--- a/shell/evolution-storage.c
+++ b/shell/evolution-storage.c
@@ -287,6 +287,7 @@ evolution_storage_register_on_shell (EvolutionStorage *evolution_storage,
EvolutionStorageResult
evolution_storage_new_folder (EvolutionStorage *evolution_storage,
const char *path,
+ const char *display_name,
const char *type,
const char *physical_uri,
const char *description)
@@ -313,21 +314,17 @@ evolution_storage_new_folder (EvolutionStorage *evolution_storage,
path_basename = g_basename (path);
/* Yuck. */
- corba_folder.name = (CORBA_char *) path_basename;
- corba_folder.description = (CORBA_char *) description;
- corba_folder.type = (CORBA_char *) type;
+ corba_folder.display_name = (CORBA_char *) display_name;
+ corba_folder.description = (CORBA_char *) description;
+ corba_folder.type = (CORBA_char *) type;
corba_folder.physical_uri = (CORBA_char *) physical_uri;
- if (path_basename - path > 1) {
- parent_path = g_strndup (path, path_basename - path - 1);
- } else {
- parent_path = g_strdup (G_DIR_SEPARATOR_S);
- }
-
CORBA_exception_init (&ev);
- Evolution_StorageListener_new_folder (priv->corba_storage_listener, parent_path,
- &corba_folder, &ev);
+ Evolution_StorageListener_new_folder (priv->corba_storage_listener,
+ path,
+ &corba_folder,
+ &ev);
if (ev._major == CORBA_NO_EXCEPTION)
result = EVOLUTION_STORAGE_OK;
@@ -340,8 +337,6 @@ evolution_storage_new_folder (EvolutionStorage *evolution_storage,
CORBA_exception_free (&ev);
- g_free (parent_path);
-
return result;
}
diff --git a/shell/evolution-storage.h b/shell/evolution-storage.h
index 4e96e28df8..ff36bef3c0 100644
--- a/shell/evolution-storage.h
+++ b/shell/evolution-storage.h
@@ -85,6 +85,7 @@ EvolutionStorageResult evolution_storage_register_on_shell (EvolutionStorage
EvolutionStorageResult evolution_storage_new_folder (EvolutionStorage *evolution_storage,
const char *path,
+ const char *display_name,
const char *type,
const char *physical_uri,
const char *description);