Copy from GNOME:Apps/tracker based on submit request 46409 from user dimstar OBS-URL: https://build.opensuse.org/request/show/46409 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/tracker?expand=0&rev=6
356 lines
11 KiB
Diff
356 lines
11 KiB
Diff
Index: tracker-0.9.14/configure.ac
|
|
===================================================================
|
|
--- tracker-0.9.14.orig/configure.ac
|
|
+++ tracker-0.9.14/configure.ac
|
|
@@ -911,6 +911,8 @@ if test "x$enable_miner_evolution" != "x
|
|
|
|
PKG_CHECK_EXISTS([evolution-data-server-1.2 >= 2.29.1],
|
|
[AC_DEFINE(HAVE_EDS_2_29_1, 1, [Define if we have eds 2.29.1 or newer])])
|
|
+ PKG_CHECK_EXISTS([evolution-data-server-1.2 >= 2.31.2],
|
|
+ [AC_DEFINE(HAVE_EDS_2_31_2, 1, [Define if we have eds 2.31.2 or newer])])
|
|
|
|
AC_SUBST(EVOLUTION_PLUGIN_CFLAGS)
|
|
AC_SUBST(EVOLUTION_PLUGIN_LIBS)
|
|
Index: tracker-0.9.14/src/plugins/evolution/tracker-evolution-plugin.c
|
|
===================================================================
|
|
--- tracker-0.9.14.orig/src/plugins/evolution/tracker-evolution-plugin.c
|
|
+++ tracker-0.9.14/src/plugins/evolution/tracker-evolution-plugin.c
|
|
@@ -34,32 +34,13 @@
|
|
#include <time.h>
|
|
#include <inttypes.h>
|
|
|
|
+#include <glib/gi18n-lib.h>
|
|
#include <glib-object.h>
|
|
#include <gio/gio.h>
|
|
|
|
#include <sqlite3.h>
|
|
|
|
-#include <camel/camel-mime-message.h>
|
|
-#include <camel/camel-i18n.h>
|
|
-#include <camel/camel-store.h>
|
|
-#include <camel/camel-folder.h>
|
|
-#include <camel/camel-db.h>
|
|
-#include <camel/camel-offline-store.h>
|
|
-#include <camel/camel-session.h>
|
|
-#include <camel/camel-url.h>
|
|
-#include <camel/camel-stream.h>
|
|
-#include <camel/camel-stream-mem.h>
|
|
-#include <camel/camel-multipart.h>
|
|
-#include <camel/camel-multipart-encrypted.h>
|
|
-#include <camel/camel-multipart-signed.h>
|
|
-#include <camel/camel-medium.h>
|
|
-#include <camel/camel-gpg-context.h>
|
|
-#include <camel/camel-smime-context.h>
|
|
-#include <camel/camel-string-utils.h>
|
|
-#include <camel/camel-stream-filter.h>
|
|
-#include <camel/camel-stream-null.h>
|
|
-#include <camel/camel-mime-filter-charset.h>
|
|
-#include <camel/camel-mime-filter-windows.h>
|
|
+#include <camel/camel.h>
|
|
|
|
#include <mail/mail-config.h>
|
|
#include <mail/mail-session.h>
|
|
@@ -303,8 +284,16 @@ get_email_and_fullname (const gchar *lin
|
|
static void
|
|
folder_registry_free (FolderRegistry *registry)
|
|
{
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ g_signal_handler_disconnect (registry->folder, registry->hook_info->hook_id);
|
|
+#else
|
|
camel_object_remove_event (registry->folder, registry->hook_info->hook_id);
|
|
+#endif
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ g_object_unref (registry->folder);
|
|
+#else
|
|
camel_object_unref (registry->folder);
|
|
+#endif
|
|
g_free (registry->hook_info->account_uri);
|
|
g_slice_free (OnSummaryChangedInfo, registry->hook_info);
|
|
g_slice_free (FolderRegistry, registry);
|
|
@@ -321,7 +310,11 @@ folder_registry_new (const gchar *accoun
|
|
registry->hook_info->account_uri = g_strdup (account_uri);
|
|
registry->hook_info->self = self; /* weak */
|
|
registry->hook_info->hook_id = 0;
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ g_object_ref (folder);
|
|
+#else
|
|
camel_object_ref (folder);
|
|
+#endif
|
|
registry->folder = folder;
|
|
|
|
return registry;
|
|
@@ -1267,7 +1260,6 @@ get_last_deleted_time (TrackerEvolutionP
|
|
EAccount *account = (EAccount *) e_iterator_get (it);
|
|
CamelProvider *provider;
|
|
CamelStore *store;
|
|
- CamelException ex;
|
|
char *uri;
|
|
CamelDB *cdb_r;
|
|
sqlite3_stmt *stmt = NULL;
|
|
@@ -1275,13 +1267,10 @@ get_last_deleted_time (TrackerEvolutionP
|
|
guint ret = SQLITE_OK;
|
|
guint64 latest = smallest;
|
|
|
|
- camel_exception_init (&ex);
|
|
-
|
|
if (!account->enabled || !(uri = account->source->url))
|
|
continue;
|
|
|
|
if (!(provider = camel_provider_get(uri, NULL))) {
|
|
- camel_exception_clear (&ex);
|
|
continue;
|
|
}
|
|
|
|
@@ -1289,8 +1278,7 @@ get_last_deleted_time (TrackerEvolutionP
|
|
continue;
|
|
}
|
|
|
|
- if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) {
|
|
- camel_exception_clear (&ex);
|
|
+ if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, NULL))) {
|
|
continue;
|
|
}
|
|
|
|
@@ -1345,9 +1333,15 @@ register_on_get_folder (gchar *uri, Came
|
|
goto not_ready;
|
|
}
|
|
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ hook_id = g_signal_connect (folder, "changed",
|
|
+ G_CALLBACK (on_folder_summary_changed),
|
|
+ registry->hook_info);
|
|
+#else
|
|
hook_id = camel_object_hook_event (folder, "folder_changed",
|
|
CAMEL_CALLBACK (on_folder_summary_changed),
|
|
registry->hook_info);
|
|
+#endif
|
|
registry->hook_info->hook_id = hook_id;
|
|
|
|
g_hash_table_replace (priv->registered_folders,
|
|
@@ -1524,7 +1518,11 @@ free_worker_thread_info (gpointer data,
|
|
/* Ownership was transfered to us in try_again */
|
|
free_introduction_info (winfo->intro_info);
|
|
camel_db_close (winfo->cdb_r);
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ g_object_unref (winfo->store);
|
|
+#else
|
|
camel_object_unref (winfo->store);
|
|
+#endif
|
|
camel_folder_info_free (winfo->iter);
|
|
g_free (winfo);
|
|
}
|
|
@@ -1579,7 +1577,11 @@ on_got_folderinfo_introduce (CamelStore
|
|
|
|
/* Ownership of these is transfered in try_again */
|
|
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ g_object_ref (store);
|
|
+#else
|
|
camel_object_ref (store);
|
|
+#endif
|
|
info->store = store;
|
|
/* This apparently creates a thread */
|
|
info->cdb_r = camel_db_clone (store->cdb_r, NULL);
|
|
@@ -1622,24 +1624,20 @@ introduce_account_to (TrackerEvolutionPl
|
|
{
|
|
CamelProvider *provider;
|
|
CamelStore *store;
|
|
- CamelException ex;
|
|
char *uri, *account_uri, *ptr;
|
|
IntroductionInfo *intro_info;
|
|
|
|
if (!account->enabled || !(uri = account->source->url))
|
|
return;
|
|
|
|
- camel_exception_init (&ex);
|
|
- if (!(provider = camel_provider_get(uri, &ex))) {
|
|
- camel_exception_clear (&ex);
|
|
+ if (!(provider = camel_provider_get(uri, NULL))) {
|
|
return;
|
|
}
|
|
|
|
if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE))
|
|
return;
|
|
|
|
- if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) {
|
|
- camel_exception_clear (&ex);
|
|
+ if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, NULL))) {
|
|
return;
|
|
}
|
|
|
|
@@ -1660,7 +1658,11 @@ introduce_account_to (TrackerEvolutionPl
|
|
|
|
mail_get_folderinfo (store, NULL, on_got_folderinfo_introduce, intro_info);
|
|
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ g_object_unref (store);
|
|
+#else
|
|
camel_object_unref (store);
|
|
+#endif
|
|
|
|
}
|
|
|
|
@@ -1821,7 +1823,11 @@ on_folder_deleted (CamelStore *store,
|
|
|
|
static void
|
|
on_folder_renamed (CamelStore *store,
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ gchar *old_name,
|
|
+#else
|
|
CamelRenameInfo *info,
|
|
+#endif
|
|
StoreRegistry *registry)
|
|
{
|
|
unregister_account (registry->self, registry->account);
|
|
@@ -1839,7 +1845,11 @@ store_registry_new (gpointer co,
|
|
registry->store = co;
|
|
registry->account = account; /* weak */
|
|
registry->self = self; /* weak */
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ g_object_ref (co);
|
|
+#else
|
|
camel_object_ref (co);
|
|
+#endif
|
|
|
|
return registry;
|
|
}
|
|
@@ -1847,8 +1857,16 @@ store_registry_new (gpointer co,
|
|
static void
|
|
store_registry_free (StoreRegistry *registry)
|
|
{
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ g_signal_handler_disconnect (registry->store, registry->hook_id);
|
|
+#else
|
|
camel_object_remove_event (registry->store, registry->hook_id);
|
|
+#endif
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ g_object_unref (registry->store);
|
|
+#else
|
|
camel_object_unref (registry->store);
|
|
+#endif
|
|
g_slice_free (StoreRegistry, registry);
|
|
}
|
|
|
|
@@ -1876,27 +1894,45 @@ on_got_folderinfo_register (CamelStore *
|
|
|
|
/* Hook up catching folder changes in the store */
|
|
registry = store_registry_new (store, account, self);
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ hook_id = g_signal_connect (store, "folder-created",
|
|
+ G_CALLBACK (on_folder_created),
|
|
+ registry);
|
|
+#else
|
|
hook_id = camel_object_hook_event (store, "folder_created",
|
|
CAMEL_CALLBACK (on_folder_created),
|
|
registry);
|
|
+#endif
|
|
registry->hook_id = hook_id;
|
|
g_hash_table_replace (priv->registered_stores,
|
|
GINT_TO_POINTER (hook_id),
|
|
registry);
|
|
|
|
registry = store_registry_new (store, account, self);
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ hook_id = g_signal_connect (store, "folder-renamed",
|
|
+ G_CALLBACK (on_folder_renamed),
|
|
+ registry);
|
|
+#else
|
|
hook_id = camel_object_hook_event (store, "folder_renamed",
|
|
CAMEL_CALLBACK (on_folder_renamed),
|
|
registry);
|
|
+#endif
|
|
registry->hook_id = hook_id;
|
|
g_hash_table_replace (priv->registered_stores,
|
|
GINT_TO_POINTER (hook_id),
|
|
registry);
|
|
|
|
registry = store_registry_new (store, account, self);
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ hook_id = g_signal_connect (store, "folder-deleted",
|
|
+ G_CALLBACK (on_folder_deleted),
|
|
+ registry);
|
|
+#else
|
|
hook_id = camel_object_hook_event (store, "folder_deleted",
|
|
CAMEL_CALLBACK (on_folder_deleted),
|
|
registry);
|
|
+#endif
|
|
registry->hook_id = hook_id;
|
|
g_hash_table_replace (priv->registered_stores,
|
|
GINT_TO_POINTER (hook_id),
|
|
@@ -1921,24 +1957,20 @@ register_account (TrackerEvolutionPlugin
|
|
{
|
|
CamelProvider *provider;
|
|
CamelStore *store;
|
|
- CamelException ex;
|
|
char *uri;
|
|
RegisterInfo *reg_info;
|
|
|
|
if (!account->enabled || !(uri = account->source->url))
|
|
return;
|
|
|
|
- camel_exception_init (&ex);
|
|
- if (!(provider = camel_provider_get(uri, &ex))) {
|
|
- camel_exception_clear (&ex);
|
|
+ if (!(provider = camel_provider_get(uri, NULL))) {
|
|
return;
|
|
}
|
|
|
|
if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE))
|
|
return;
|
|
|
|
- if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) {
|
|
- camel_exception_clear (&ex);
|
|
+ if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, NULL))) {
|
|
return;
|
|
}
|
|
|
|
@@ -1953,7 +1985,11 @@ register_account (TrackerEvolutionPlugin
|
|
/* Get the account's folder-info and register it asynchronously */
|
|
mail_get_folderinfo (store, NULL, on_got_folderinfo_register, reg_info);
|
|
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ g_object_unref (store);
|
|
+#else
|
|
camel_object_unref (store);
|
|
+#endif
|
|
}
|
|
|
|
static gboolean
|
|
@@ -1992,22 +2028,18 @@ unregister_account (TrackerEvolutionPlug
|
|
{
|
|
CamelProvider *provider;
|
|
CamelStore *store;
|
|
- CamelException ex;
|
|
char *uri = account->source->url;
|
|
RegisterInfo *reg_info;
|
|
|
|
|
|
- camel_exception_init (&ex);
|
|
- if (!(provider = camel_provider_get(uri, &ex))) {
|
|
- camel_exception_clear (&ex);
|
|
+ if (!(provider = camel_provider_get(uri, NULL))) {
|
|
return;
|
|
}
|
|
|
|
if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE))
|
|
return;
|
|
|
|
- if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) {
|
|
- camel_exception_clear (&ex);
|
|
+ if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, NULL))) {
|
|
return;
|
|
}
|
|
|
|
@@ -2020,7 +2052,11 @@ unregister_account (TrackerEvolutionPlug
|
|
/* Get the account's folder-info and unregister asynchronously */
|
|
mail_get_folderinfo (store, NULL, on_got_folderinfo_unregister, reg_info);
|
|
|
|
+#ifdef HAVE_EDS_2_31_2
|
|
+ g_object_unref (store);
|
|
+#else
|
|
camel_object_unref (store);
|
|
+#endif
|
|
}
|
|
|
|
static void
|