aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/addressbook.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@helixcode.com>2000-12-31 04:12:33 +0800
committerChris Toshok <toshok@src.gnome.org>2000-12-31 04:12:33 +0800
commitb941c6f04cef47d9d9038a5e8e41f60a3819ef84 (patch)
tree8d95612d96f9a1dbd3fa62c62fcb1bf9a3c21d99 /addressbook/gui/component/addressbook.c
parentc4dfc8669bf21acf8c06cc7f79d0864c8e3d4fab (diff)
downloadgsoc2013-evolution-b941c6f04cef47d9d9038a5e8e41f60a3819ef84.tar.gz
gsoc2013-evolution-b941c6f04cef47d9d9038a5e8e41f60a3819ef84.tar.zst
gsoc2013-evolution-b941c6f04cef47d9d9038a5e8e41f60a3819ef84.zip
copy the dialog's source, destroy the dialog after we're done, and make
2000-12-30 Chris Toshok <toshok@helixcode.com> * gui/component/addressbook-config.c (edit_source_clicked): copy the dialog's source, destroy the dialog after we're done, and make sure to update both columns in the clist. (add_source_clicked): copy the dialog's source, and destroy the dialog when we're done. (addressbook_source_dialog_destroy): free up all the dialog's memory. * gui/component/addressbook.c (set_prop): allow file: uri's that point to files, not just dirs that contain addressbook.db. The rule is the addressbook file has to end in .db. * gui/component/addressbook-storage.c (file_source_foreach): contactserver => contactfile. cut and paste error. (addressbook_storage_init_source_uri): use file://%s to build the uri. * gui/component/e-ldap-server-dialog.[ch]: forgot to remove these in my last commit. svn path=/trunk/; revision=7199
Diffstat (limited to 'addressbook/gui/component/addressbook.c')
-rw-r--r--addressbook/gui/component/addressbook.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 49367bd041..bdad6ae04c 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -432,9 +432,20 @@ set_prop (BonoboPropertyBag *bag,
view->uri = g_strdup(BONOBO_ARG_GET_STRING (arg));
if (!strncmp (view->uri, "file:", 5)) {
- char *file_name = g_concat_dir_and_file(view->uri + 7, "addressbook.db");
- uri_data = g_strdup_printf("file://%s", file_name);
- g_free(file_name);
+
+ if (strlen (view->uri + 7) > 3
+ && !strcmp (view->uri + strlen(view->uri) - 3, ".db")) {
+ /* it's a .db file */
+ uri_data = g_strdup (view->uri);
+ }
+ else {
+ char *file_name;
+ /* we assume it's a dir and glom addressbook.db onto the end. */
+ file_name = g_concat_dir_and_file(view->uri + 7, "addressbook.db");
+ uri_data = g_strdup_printf("file://%s", file_name);
+ g_free(file_name);
+ }
+
}
else {
uri_data = g_strdup (view->uri);