evolution-data-server r9777 - in trunk: addressbook addressbook/libedata-book calendar calendar/libecal
- From: msuman svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r9777 - in trunk: addressbook addressbook/libedata-book calendar calendar/libecal
- Date: Mon, 24 Nov 2008 09:52:07 +0000 (UTC)
Author: msuman
Date: Mon Nov 24 09:52:07 2008
New Revision: 9777
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9777&view=rev
Log:
Fix for bug #561466 - some changes in the core code needed for evolution-mapi, adds a few APIs.
Modified:
trunk/addressbook/ChangeLog
trunk/addressbook/libedata-book/e-book-backend-db-cache.c
trunk/addressbook/libedata-book/e-book-backend-db-cache.h
trunk/calendar/ChangeLog
trunk/calendar/libecal/e-cal-util.h
trunk/calendar/libecal/e-cal.c
Modified: trunk/addressbook/libedata-book/e-book-backend-db-cache.c
==============================================================================
--- trunk/addressbook/libedata-book/e-book-backend-db-cache.c (original)
+++ trunk/addressbook/libedata-book/e-book-backend-db-cache.c Mon Nov 24 09:52:07 2008
@@ -131,8 +131,8 @@
EContact *
e_book_backend_db_cache_get_contact (DB *db, const char *uid)
{
- DBT uid_dbt, vcard_dbt;
- int db_error;
+ DBT uid_dbt, vcard_dbt;
+ int db_error;
EContact *contact = NULL;
g_return_val_if_fail (uid != NULL, NULL);
@@ -163,19 +163,19 @@
**/
gboolean
e_book_backend_db_cache_add_contact (DB *db,
- EContact *contact)
+ EContact *contact)
{
- DBT uid_dbt, vcard_dbt;
- int db_error;
- char *vcard_str;
+ DBT uid_dbt, vcard_dbt;
+ int db_error;
+ char *vcard_str;
const char *uid;
uid = e_contact_get_const (contact, E_CONTACT_UID);
if (!uid) {
printf ("no uid\n");
printf("name:%s, email:%s\n",
- (char*)e_contact_get (contact, E_CONTACT_GIVEN_NAME),
- (char*)e_contact_get (contact, E_CONTACT_EMAIL_1));
+ (char*)e_contact_get (contact, E_CONTACT_GIVEN_NAME),
+ (char*)e_contact_get (contact, E_CONTACT_EMAIL_1));
return FALSE;
}
string_to_dbt (uid, &uid_dbt);
@@ -207,11 +207,11 @@
**/
gboolean
e_book_backend_db_cache_remove_contact (DB *db,
- const char *uid)
+ const char *uid)
{
- DBT uid_dbt;
- int db_error;
+ DBT uid_dbt;
+ int db_error;
g_return_val_if_fail (uid != NULL, FALSE);
@@ -239,8 +239,8 @@
gboolean
e_book_backend_db_cache_check_contact (DB *db, const char *uid)
{
- DBT uid_dbt, vcard_dbt;
- int db_error;
+ DBT uid_dbt, vcard_dbt;
+ int db_error;
g_return_val_if_fail (uid != NULL, FALSE);
@@ -271,11 +271,11 @@
GList *
e_book_backend_db_cache_get_contacts (DB *db, const char *query)
{
- DBC *dbc;
- DBT uid_dbt, vcard_dbt;
- int db_error;
+ DBC *dbc;
+ DBT uid_dbt, vcard_dbt;
+ int db_error;
GList *list = NULL;
- EBookBackendSExp *sexp = NULL;
+ EBookBackendSExp *sexp = NULL;
EContact *contact;
if (query) {
@@ -315,7 +315,7 @@
if (sexp)
g_object_unref (sexp);
- return g_list_reverse (list);
+ return g_list_reverse (list);
}
/**
@@ -381,8 +381,8 @@
void
e_book_backend_db_cache_set_populated (DB *db)
{
- DBT uid_dbt, vcard_dbt;
- int db_error;
+ DBT uid_dbt, vcard_dbt;
+ int db_error;
string_to_dbt ("populated", &uid_dbt);
string_to_dbt ("TRUE", &vcard_dbt);
@@ -404,8 +404,8 @@
gboolean
e_book_backend_db_cache_is_populated (DB *db)
{
- DBT uid_dbt, vcard_dbt;
- int db_error;
+ DBT uid_dbt, vcard_dbt;
+ int db_error;
string_to_dbt ("populated", &uid_dbt);
memset(&vcard_dbt, 0, sizeof(vcard_dbt));
@@ -420,3 +420,40 @@
return TRUE;
}
}
+
+void
+e_book_backend_db_cache_set_time(DB *db, const char *t)
+{
+ DBT uid_dbt, vcard_dbt;
+ int db_error;
+
+ string_to_dbt ("last_update_time", &uid_dbt);
+ string_to_dbt (t, &vcard_dbt);
+
+ db_error = db->put (db, NULL, &uid_dbt, &vcard_dbt, 0);
+ if (db_error != 0) {
+ g_warning ("db->put failed with %d", db_error);
+ }
+}
+
+char *
+e_book_backend_db_cache_get_time (DB *db)
+{
+ DBT uid_dbt, vcard_dbt;
+ int db_error;
+ char *t = NULL;
+
+ string_to_dbt ("last_update_time", &uid_dbt);
+ memset (&vcard_dbt, 0, sizeof(vcard_dbt));
+ vcard_dbt.flags = DB_DBT_MALLOC;
+
+ db_error = db->get (db, NULL, &uid_dbt, &vcard_dbt, 0);
+ if (db_error != 0) {
+ g_warning ("db->get failed with %d", db_error);
+ } else {
+ t = g_strdup (vcard_dbt.data);
+ free (vcard_dbt.data);
+ }
+
+ return t;
+}
Modified: trunk/addressbook/libedata-book/e-book-backend-db-cache.h
==============================================================================
--- trunk/addressbook/libedata-book/e-book-backend-db-cache.h (original)
+++ trunk/addressbook/libedata-book/e-book-backend-db-cache.h Mon Nov 24 09:52:07 2008
@@ -25,6 +25,8 @@
#include <libebook/e-contact.h>
#include "db.h"
+G_BEGIN_DECLS
+
EContact* e_book_backend_db_cache_get_contact (DB *db, const char *uid);
void string_to_dbt(const char *str, DBT *dbt);
char *e_book_backend_db_cache_get_filename(DB *db);
@@ -39,9 +41,8 @@
void e_book_backend_db_cache_set_populated (DB *db);
gboolean e_book_backend_db_cache_is_populated (DB *db);
GPtrArray* e_book_backend_db_cache_search (DB *db, const char *query);
-
-
-
+void e_book_backend_db_cache_set_time(DB *db, const char *t);
+char * e_book_backend_db_cache_get_time (DB *db);
G_END_DECLS
Modified: trunk/calendar/libecal/e-cal-util.h
==============================================================================
--- trunk/calendar/libecal/e-cal-util.h (original)
+++ trunk/calendar/libecal/e-cal-util.h Mon Nov 24 09:52:07 2008
@@ -115,6 +115,7 @@
#define CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ATTEND "organizer-must-attend"
#define CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS "organizer-not-email-address"
#define CAL_STATIC_CAPABILITY_REMOVE_ALARMS "remove-alarms"
+#define CAL_STATIC_CAPABILITY_CREATE_MESSAGES "create-messages"
#define CAL_STATIC_CAPABILITY_SAVE_SCHEDULES "save-schedules"
#define CAL_STATIC_CAPABILITY_NO_CONV_TO_ASSIGN_TASK "no-conv-to-assign-task"
#define CAL_STATIC_CAPABILITY_NO_CONV_TO_RECUR "no-conv-to-recur"
Modified: trunk/calendar/libecal/e-cal.c
==============================================================================
--- trunk/calendar/libecal/e-cal.c (original)
+++ trunk/calendar/libecal/e-cal.c Mon Nov 24 09:52:07 2008
@@ -1386,7 +1386,16 @@
priv->local_attachment_store =
g_filename_to_uri (filename, NULL, NULL);
g_free (filename);
+ } else if (g_str_has_prefix (priv->uri, "mapi://")) {
+ gchar *filename = g_build_filename (g_get_home_dir (),
+ ".evolution/cache/calendar",
+ mangled_uri,
+ NULL);
+ priv->local_attachment_store =
+ g_filename_to_uri (filename, NULL, NULL);
+ g_free (filename);
}
+
g_free (mangled_uri);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]