diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-07-23 10:04:14 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-07-23 10:04:14 +0800 |
commit | 97cc1d57adcdefb5b63a704f42f692e3cffb4014 (patch) | |
tree | 8cf6ca737156fa7ae603a5b479813f6a6c5830d5 /addressbook | |
parent | 13c7f54818b9b6a25a47289768d17e5a885cec7a (diff) | |
download | gsoc2013-evolution-97cc1d57adcdefb5b63a704f42f692e3cffb4014.tar.gz gsoc2013-evolution-97cc1d57adcdefb5b63a704f42f692e3cffb4014.tar.zst gsoc2013-evolution-97cc1d57adcdefb5b63a704f42f692e3cffb4014.zip |
Add an extra @type arg to the xferFolder and removeFolder methods in
the ShellComponent interface. Updated the EvolutionShellComponent
GTK+ wrapper and all the component accordingly. Get the calendar to
use this so it can delete both tasks and calendar folders.
svn path=/trunk/; revision=11300
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 8 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-component.c | 30 |
2 files changed, 26 insertions, 12 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 359745c7de..e2c01bfafa 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,11 @@ +2001-07-22 Ettore Perazzoli <ettore@ximian.com> + + * gui/component/addressbook-component.c (remove_folder): Add a + @type arg. If the type is not "contacts", report an + `UNSUPPORTED_TYPE' error through the listener. Also, remove + `g_print()' debugging messages. + (xfer_folder): Likewise. + 2001-07-21 Ettore Perazzoli <ettore@ximian.com> * gui/component/addressbook-component.c: Make the "contacts" diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c index 02e3fb85f9..1dca130042 100644 --- a/addressbook/gui/component/addressbook-component.c +++ b/addressbook/gui/component/addressbook-component.c @@ -64,7 +64,7 @@ static char *accepted_dnd_types[] = { static const EvolutionShellComponentFolderType folder_types[] = { { "contacts", "evolution-contacts.png", TRUE, accepted_dnd_types, NULL }, - { NULL, NULL, NULL, NULL } + { NULL, NULL, FALSE, NULL, NULL } }; @@ -113,6 +113,7 @@ create_folder (EvolutionShellComponent *shell_component, static void remove_folder (EvolutionShellComponent *shell_component, const char *physical_uri, + const char *type, const GNOME_Evolution_ShellComponentListener listener, void *closure) { @@ -121,10 +122,16 @@ remove_folder (EvolutionShellComponent *shell_component, struct stat sb; int rv; - g_print ("should remove %s\n", physical_uri); - CORBA_exception_init(&ev); + if (strcmp (type, "contacts") != 0) { + GNOME_Evolution_ShellComponentListener_notifyResult (listener, + GNOME_Evolution_ShellComponentListener_UNSUPPORTED_TYPE, + &ev); + CORBA_exception_free(&ev); + return; + } + if (!strncmp (physical_uri, "ldap://", 7)) { GNOME_Evolution_ShellComponentListener_notifyResult (listener, GNOME_Evolution_ShellComponentListener_UNSUPPORTED_OPERATION, @@ -176,6 +183,7 @@ static void xfer_folder (EvolutionShellComponent *shell_component, const char *source_physical_uri, const char *destination_physical_uri, + const char *type, gboolean remove_source, const GNOME_Evolution_ShellComponentListener listener, void *closure) @@ -184,8 +192,13 @@ xfer_folder (EvolutionShellComponent *shell_component, char *source_path; char *destination_path; - g_print ("should transfer %s to %s, %s source\n", source_physical_uri, - destination_physical_uri, remove_source ? "removing" : "not removing"); + if (strcmp (type, "contacts") != 0) { + GNOME_Evolution_ShellComponentListener_notifyResult (listener, + GNOME_Evolution_ShellComponentListener_UNSUPPORTED_TYPE, + &ev); + CORBA_exception_free(&ev); + return; + } if (!strncmp (source_physical_uri, "ldap://", 7) || !strncmp (destination_physical_uri, "ldap://", 7)) { @@ -208,13 +221,6 @@ xfer_folder (EvolutionShellComponent *shell_component, source_path = g_concat_dir_and_file (source_physical_uri + 7, "addressbook.db"); destination_path = g_concat_dir_and_file (destination_physical_uri + 7, "addressbook.db"); - if (remove_source) { - g_print ("rename %s %s\n", source_path, destination_path); - } - else { - g_print ("copy %s %s\n", source_path, destination_path); - } - CORBA_exception_init (&ev); /* XXX always fail for now, until the above stuff is written */ |