aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2001-01-26 03:05:22 +0800
committerChris Lahey <clahey@src.gnome.org>2001-01-26 03:05:22 +0800
commitbf762467c8703006c96d4698b558a7af6d14262b (patch)
tree05372cbceb4d68f2d77922b5d5609f092ae34d2b /addressbook/backend/pas
parent191c0c006ac3885234033e2ddaf14c6a3679ef9e (diff)
downloadgsoc2013-evolution-bf762467c8703006c96d4698b558a7af6d14262b.tar
gsoc2013-evolution-bf762467c8703006c96d4698b558a7af6d14262b.tar.gz
gsoc2013-evolution-bf762467c8703006c96d4698b558a7af6d14262b.tar.bz2
gsoc2013-evolution-bf762467c8703006c96d4698b558a7af6d14262b.tar.lz
gsoc2013-evolution-bf762467c8703006c96d4698b558a7af6d14262b.tar.xz
gsoc2013-evolution-bf762467c8703006c96d4698b558a7af6d14262b.tar.zst
gsoc2013-evolution-bf762467c8703006c96d4698b558a7af6d14262b.zip
Made this only add the initial VCard if it finds a file "create-initial"
2001-01-25 Christopher James Lahey <clahey@helixcode.com> * backend/pas/pas-backend-file.c (pas_backend_file_load_uri): Made this only add the initial VCard if it finds a file "create-initial" in the directory it's creating the database in. * gui/component/addressbook-component.c (factory_fn): Added a create_folder function. * gui/search/e-addressbook-search-dialog.c (e_addressbook_search_dialog_init): Fixed an unused variable warning. svn path=/trunk/; revision=7816
Diffstat (limited to 'addressbook/backend/pas')
-rw-r--r--addressbook/backend/pas/pas-backend-file.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index b4a0555e76..f9e2c53a2d 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -8,6 +8,7 @@
#include "config.h"
#include <gtk/gtksignal.h>
+#include <gnome.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
@@ -1291,9 +1292,20 @@ pas_backend_file_load_uri (PASBackend *backend,
bf->priv->file_db = dbopen (filename, O_RDWR | O_CREAT, 0666, DB_HASH, NULL);
if (bf->priv->file_db) {
- char *id;
- id = do_create(backend, INITIAL_VCARD, NULL);
- g_free (id);
+ char *create_initial_file;
+ char *dir;
+
+ dir = g_dirname(filename);
+ create_initial_file = g_concat_dir_and_file(dir, "create-initial");
+
+ if (g_file_exists(create_initial_file)) {
+ char *id;
+ id = do_create(backend, INITIAL_VCARD, NULL);
+ g_free (id);
+ }
+
+ g_free(create_initial_file);
+ g_free(dir);
}
}