aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas
diff options
context:
space:
mode:
authorChris Toshok <toshok@src.gnome.org>2000-03-29 08:47:30 +0800
committerChris Toshok <toshok@src.gnome.org>2000-03-29 08:47:30 +0800
commitb88b59741fd9d2bc4097b803db4447e15d004d79 (patch)
tree45da75a284430bd2b8d48f53829a072950a09abd /addressbook/backend/pas
parentbce1144ad7cd318cb193eb39aecc42cf8a87358e (diff)
downloadgsoc2013-evolution-b88b59741fd9d2bc4097b803db4447e15d004d79.tar
gsoc2013-evolution-b88b59741fd9d2bc4097b803db4447e15d004d79.tar.gz
gsoc2013-evolution-b88b59741fd9d2bc4097b803db4447e15d004d79.tar.bz2
gsoc2013-evolution-b88b59741fd9d2bc4097b803db4447e15d004d79.tar.lz
gsoc2013-evolution-b88b59741fd9d2bc4097b803db4447e15d004d79.tar.xz
gsoc2013-evolution-b88b59741fd9d2bc4097b803db4447e15d004d79.tar.zst
gsoc2013-evolution-b88b59741fd9d2bc4097b803db4447e15d004d79.zip
create id's for entries using the following format: ("pas-id-%08lX%08X",
* addressbook/backend/pas/pas-backend-file.c (pas_backend_file_create_unique_id): create id's for entries using the following format: ("pas-id-%08lX%08X", time(NULL), c++). svn path=/trunk/; revision=2235
Diffstat (limited to 'addressbook/backend/pas')
-rw-r--r--addressbook/backend/pas/pas-backend-file.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index 94c87f655b..e117fe8b05 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -9,6 +9,7 @@
#include "config.h"
#include <gtk/gtksignal.h>
#include <fcntl.h>
+#include <time.h>
#ifdef HAVE_DB_185_H
#include <db_185.h>
#else
@@ -92,7 +93,11 @@ string_to_dbt(const char *str, DBT *dbt)
static char *
pas_backend_file_create_unique_id (char *vcard)
{
- return g_strdup ("foo"); /* XXX create unique id here */
+ /* use a 32 counter and the 32 bit timestamp to make an id.
+ it's doubtful 2^32 id's will be created in a second, so we
+ should be okay. */
+ static guint c = 0;
+ return g_strdup_printf ("pas-id-%08lX%08X", time(NULL), c++);
}
static void