diff options
-rw-r--r-- | addressbook/ChangeLog | 6 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-component.c | 29 |
2 files changed, 22 insertions, 13 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 051295480b..05385eea62 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,9 @@ +2003-02-03 Chris Toshok <toshok@ximian.com> + + * gui/component/addressbook-component.c (remove_folder): pull + forward Jack Jia's fix for #33672, but convert it to use unlink + instead of the gnome-vfs stuff. + 2003-01-27 Chris Toshok <toshok@ximian.com> * gui/contact-editor/contact-editor.glade: add a scrolled window diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c index 1d9371fdc8..244afb0cc6 100644 --- a/addressbook/gui/component/addressbook-component.c +++ b/addressbook/gui/component/addressbook-component.c @@ -135,7 +135,7 @@ remove_folder (EvolutionShellComponent *shell_component, void *closure) { CORBA_Environment ev; - char *addressbook_db_path, *subdir_path; + char *db_path, *summary_path, *subdir_path; struct stat sb; int rv; @@ -175,24 +175,27 @@ remove_folder (EvolutionShellComponent *shell_component, return; } - addressbook_db_path = g_build_filename (physical_uri + 7, "addressbook.db", NULL); - rv = unlink (addressbook_db_path); - g_free (addressbook_db_path); - if (rv == 0) { + db_path = g_build_filename (physical_uri + 7, "addressbook.db", NULL); + summary_path = g_build_filename (physical_uri + 7, "addressbook.db.summary", NULL); + rv = unlink (db_path); + + if (rv == 0 || (rv == -1 && errno == ENOENT)) + rv = unlink (summary_path); + + if (rv == 0 || (rv == -1 && errno == ENOENT)) { GNOME_Evolution_ShellComponentListener_notifyResult (listener, GNOME_Evolution_ShellComponentListener_OK, &ev); } else { - if (errno == EACCES || errno == EPERM) - GNOME_Evolution_ShellComponentListener_notifyResult (listener, - GNOME_Evolution_ShellComponentListener_PERMISSION_DENIED, - &ev); - else - GNOME_Evolution_ShellComponentListener_notifyResult (listener, - GNOME_Evolution_ShellComponentListener_INVALID_URI, /*XXX*/ - &ev); + GNOME_Evolution_ShellComponentListener_notifyResult (listener, + GNOME_Evolution_ShellComponentListener_PERMISSION_DENIED, + &ev); } + + g_free (db_path); + g_free (summary_path); + CORBA_exception_free(&ev); } |