From 742bc235c0a29798db53c58a71e09bdb0a8764b1 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Tue, 4 Feb 2003 00:07:19 +0000 Subject: pull forward Jack Jia's fix for #33672, but convert it to use unlink 2003-02-03 Chris Toshok * 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. svn path=/trunk/; revision=19721 --- addressbook/gui/component/addressbook-component.c | 29 +++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'addressbook/gui/component') 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); } -- cgit