3a7f81c013
- Package the docs licensing file - Patch for EDS API changes (Migrate from CamelException to GError) - Backport a memory leak fix
293 lines
8.9 KiB
Diff
293 lines
8.9 KiB
Diff
--- src/plugins/evolution/tracker-evolution-plugin.c 2010-07-02 03:49:03.000000000 -0400
|
|
+++ src/plugins/evolution/tracker-evolution-plugin.c.new 2010-07-16 12:44:44.335347946 -0400
|
|
@@ -39,27 +39,7 @@
|
|
|
|
#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 +283,8 @@
|
|
static void
|
|
folder_registry_free (FolderRegistry *registry)
|
|
{
|
|
- camel_object_remove_event (registry->folder, registry->hook_info->hook_id);
|
|
- camel_object_unref (registry->folder);
|
|
+ g_signal_handler_disconnect (registry->folder, registry->hook_info->hook_id);
|
|
+ g_object_unref (registry->folder);
|
|
g_free (registry->hook_info->account_uri);
|
|
g_slice_free (OnSummaryChangedInfo, registry->hook_info);
|
|
g_slice_free (FolderRegistry, registry);
|
|
@@ -321,7 +301,7 @@
|
|
registry->hook_info->account_uri = g_strdup (account_uri);
|
|
registry->hook_info->self = self; /* weak */
|
|
registry->hook_info->hook_id = 0;
|
|
- camel_object_ref (folder);
|
|
+ g_object_ref (folder);
|
|
registry->folder = folder;
|
|
|
|
return registry;
|
|
@@ -1267,7 +1247,7 @@
|
|
EAccount *account = (EAccount *) e_iterator_get (it);
|
|
CamelProvider *provider;
|
|
CamelStore *store;
|
|
- CamelException ex;
|
|
+ GError *error = NULL;
|
|
char *uri;
|
|
CamelDB *cdb_r;
|
|
sqlite3_stmt *stmt = NULL;
|
|
@@ -1275,13 +1255,11 @@
|
|
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);
|
|
+ g_error_free (error);
|
|
continue;
|
|
}
|
|
|
|
@@ -1289,8 +1267,8 @@
|
|
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, &error))) {
|
|
+ g_error_free (error);
|
|
continue;
|
|
}
|
|
|
|
@@ -1345,8 +1323,8 @@
|
|
goto not_ready;
|
|
}
|
|
|
|
- hook_id = camel_object_hook_event (folder, "folder_changed",
|
|
- CAMEL_CALLBACK (on_folder_summary_changed),
|
|
+ hook_id = g_signal_connect (folder, "folder_changed",
|
|
+ G_CALLBACK (on_folder_summary_changed),
|
|
registry->hook_info);
|
|
registry->hook_info->hook_id = hook_id;
|
|
|
|
@@ -1524,7 +1502,7 @@
|
|
/* Ownership was transfered to us in try_again */
|
|
free_introduction_info (winfo->intro_info);
|
|
camel_db_close (winfo->cdb_r);
|
|
- camel_object_unref (winfo->store);
|
|
+ g_object_unref (winfo->store);
|
|
camel_folder_info_free (winfo->iter);
|
|
g_free (winfo);
|
|
}
|
|
@@ -1579,7 +1557,7 @@
|
|
|
|
/* Ownership of these is transfered in try_again */
|
|
|
|
- camel_object_ref (store);
|
|
+ g_object_ref (store);
|
|
info->store = store;
|
|
/* This apparently creates a thread */
|
|
info->cdb_r = camel_db_clone (store->cdb_r, NULL);
|
|
@@ -1622,24 +1600,23 @@
|
|
{
|
|
CamelProvider *provider;
|
|
CamelStore *store;
|
|
- CamelException ex;
|
|
+ GError *error = NULL;
|
|
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, &error))) {
|
|
+ g_error_free (error);
|
|
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, &error))) {
|
|
+ g_error_free (error);
|
|
return;
|
|
}
|
|
|
|
@@ -1660,7 +1637,7 @@
|
|
|
|
mail_get_folderinfo (store, NULL, on_got_folderinfo_introduce, intro_info);
|
|
|
|
- camel_object_unref (store);
|
|
+ g_object_unref (store);
|
|
|
|
}
|
|
|
|
@@ -1821,7 +1798,7 @@
|
|
|
|
static void
|
|
on_folder_renamed (CamelStore *store,
|
|
- CamelRenameInfo *info,
|
|
+ CamelFolderInfo *info,
|
|
StoreRegistry *registry)
|
|
{
|
|
unregister_account (registry->self, registry->account);
|
|
@@ -1839,7 +1816,7 @@
|
|
registry->store = co;
|
|
registry->account = account; /* weak */
|
|
registry->self = self; /* weak */
|
|
- camel_object_ref (co);
|
|
+ g_object_ref (co);
|
|
|
|
return registry;
|
|
}
|
|
@@ -1847,8 +1824,8 @@
|
|
static void
|
|
store_registry_free (StoreRegistry *registry)
|
|
{
|
|
- camel_object_remove_event (registry->store, registry->hook_id);
|
|
- camel_object_unref (registry->store);
|
|
+ g_signal_handler_disconnect (registry->store, registry->hook_id);
|
|
+ g_object_unref (registry->store);
|
|
g_slice_free (StoreRegistry, registry);
|
|
}
|
|
|
|
@@ -1876,8 +1853,8 @@
|
|
|
|
/* Hook up catching folder changes in the store */
|
|
registry = store_registry_new (store, account, self);
|
|
- hook_id = camel_object_hook_event (store, "folder_created",
|
|
- CAMEL_CALLBACK (on_folder_created),
|
|
+ hook_id = g_signal_connect (store, "folder_created",
|
|
+ G_CALLBACK (on_folder_created),
|
|
registry);
|
|
registry->hook_id = hook_id;
|
|
g_hash_table_replace (priv->registered_stores,
|
|
@@ -1885,8 +1862,8 @@
|
|
registry);
|
|
|
|
registry = store_registry_new (store, account, self);
|
|
- hook_id = camel_object_hook_event (store, "folder_renamed",
|
|
- CAMEL_CALLBACK (on_folder_renamed),
|
|
+ hook_id = g_signal_connect (store, "folder_renamed",
|
|
+ G_CALLBACK (on_folder_renamed),
|
|
registry);
|
|
registry->hook_id = hook_id;
|
|
g_hash_table_replace (priv->registered_stores,
|
|
@@ -1894,8 +1871,8 @@
|
|
registry);
|
|
|
|
registry = store_registry_new (store, account, self);
|
|
- hook_id = camel_object_hook_event (store, "folder_deleted",
|
|
- CAMEL_CALLBACK (on_folder_deleted),
|
|
+ hook_id = g_signal_connect (store, "folder_deleted",
|
|
+ G_CALLBACK (on_folder_deleted),
|
|
registry);
|
|
registry->hook_id = hook_id;
|
|
g_hash_table_replace (priv->registered_stores,
|
|
@@ -1921,24 +1898,23 @@
|
|
{
|
|
CamelProvider *provider;
|
|
CamelStore *store;
|
|
- CamelException ex;
|
|
+ GError *error = NULL;
|
|
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, &error))) {
|
|
+ g_error_free (error);
|
|
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, &error))) {
|
|
+ g_error_free (error);
|
|
return;
|
|
}
|
|
|
|
@@ -1953,7 +1929,7 @@
|
|
/* Get the account's folder-info and register it asynchronously */
|
|
mail_get_folderinfo (store, NULL, on_got_folderinfo_register, reg_info);
|
|
|
|
- camel_object_unref (store);
|
|
+ g_object_unref (store);
|
|
}
|
|
|
|
static gboolean
|
|
@@ -1992,22 +1968,21 @@
|
|
{
|
|
CamelProvider *provider;
|
|
CamelStore *store;
|
|
- CamelException ex;
|
|
+ GError *error = NULL;
|
|
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, &error))) {
|
|
+ g_error_free (error);
|
|
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, &error))) {
|
|
+ g_error_free (error);
|
|
return;
|
|
}
|
|
|
|
@@ -2020,7 +1995,7 @@
|
|
/* Get the account's folder-info and unregister asynchronously */
|
|
mail_get_folderinfo (store, NULL, on_got_folderinfo_unregister, reg_info);
|
|
|
|
- camel_object_unref (store);
|
|
+ g_object_unref (store);
|
|
}
|
|
|
|
static void
|