aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ChangeLog6
-rw-r--r--addressbook/backend/pas/pas-backend-file.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c1c14ab950..a3e9df9dd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-03-28 Chris Toshok <toshok@laptoph.xtoph.org>
+
+ * 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++).
+
2000-03-27 Miguel de Icaza <miguel@gnu.org>
* widgets/shortcut-bar/e-icon-bar.c (flatten_alpha): New function,
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