~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to camel/camel-folder.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
192
192
        folder->priv = g_malloc0(sizeof(*folder->priv));
193
193
        folder->priv->frozen = 0;
194
194
        folder->priv->changed_frozen = camel_folder_change_info_new();
 
195
        folder->priv->skip_folder_lock = FALSE;
195
196
        g_static_rec_mutex_init(&folder->priv->lock);
196
197
        g_static_mutex_init(&folder->priv->change_lock);
197
198
}
222
223
        g_free(p);
223
224
}
224
225
 
 
226
/**
 
227
 * camel_folder_set_lock_async:
 
228
 * @folder: a #CamelFolder
 
229
 * @skip_folder_lock:
 
230
 *
 
231
 * FIXME Document me!
 
232
 *
 
233
 * Since: 2.30
 
234
 **/
 
235
void
 
236
camel_folder_set_lock_async (CamelFolder *folder, gboolean skip_folder_lock)
 
237
{
 
238
        folder->priv->skip_folder_lock = skip_folder_lock;
 
239
}
 
240
 
225
241
CamelType
226
242
camel_folder_get_type (void)
227
243
{
248
264
        return g_strdup ("/dev/null");
249
265
}
250
266
 
 
267
/**
 
268
 * camel_folder_get_filename:
 
269
 *
 
270
 * Since: 2.26
 
271
 **/
251
272
gchar *
252
273
camel_folder_get_filename (CamelFolder *folder, const gchar *uid, CamelException *ex)
253
274
{
267
288
camel_folder_construct (CamelFolder *folder, CamelStore *parent_store,
268
289
                        const gchar *full_name, const gchar *name)
269
290
{
270
 
        gchar *store_db_path;
271
 
        CamelService *service = (CamelService *) parent_store;
272
 
        CamelException ex;
273
 
 
274
291
        g_return_if_fail (CAMEL_IS_FOLDER (folder));
275
292
        g_return_if_fail (CAMEL_IS_STORE (parent_store));
276
293
        g_return_if_fail (folder->parent_store == NULL);
282
299
 
283
300
        folder->name = g_strdup (name);
284
301
        folder->full_name = g_strdup (full_name);
285
 
 
286
 
        store_db_path = g_build_filename (service->url->path, CAMEL_DB_FILE, NULL);
287
 
        camel_exception_init(&ex);
288
 
        if (strlen (store_db_path) < 2) {
289
 
                gchar *store_path = camel_session_get_storage_path ((CamelSession *)camel_service_get_session (service), service, &ex);
290
 
 
291
 
                g_free (store_db_path);
292
 
                store_db_path = g_build_filename (store_path, CAMEL_DB_FILE, NULL);
293
 
                g_free (store_path);
294
 
        }
295
302
}
296
303
 
297
304
static void
413
420
                                                                deleted++;
414
421
                                                        if (flags & CAMEL_MESSAGE_JUNK) {
415
422
                                                                junked++;
416
 
                                                                if (! (flags & CAMEL_MESSAGE_DELETED))
 
423
                                                                if (!(flags & CAMEL_MESSAGE_DELETED))
417
424
                                                                        junked_not_deleted++;
418
425
                                                        }
419
426
                                                        if ((flags & (CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_JUNK)) == 0)
1140
1147
 * Ensure that a message identified by UID has been synced in the folder (so
1141
1148
 * that camel_folder_get_message on it later will work in offline mode).
1142
1149
 *
1143
 
 * Returns: void.
 
1150
 * Since: 2.26
1144
1151
 **/
1145
1152
void
1146
1153
camel_folder_sync_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
1243
1250
 * which are locally cached but should never filter out a uid which is not
1244
1251
 * locally cached. Free the result by called #camel_folder_free_uids.
1245
1252
 * Frees the array of UIDs returned by #camel_folder_get_uids.
 
1253
 *
 
1254
 * Since: 2.26
1246
1255
 **/
1247
1256
GPtrArray *
1248
1257
camel_folder_get_uncached_uids (CamelFolder *folder, GPtrArray * uids, CamelException *ex)
1270
1279
 *
1271
1280
 * Note that the default compare function expects a decimal number at the beginning of a uid,
1272
1281
 * thus if provider uses different uid values, then it should subclass this function.
 
1282
 *
 
1283
 * Since: 2.28
1273
1284
 **/
1274
1285
gint
1275
1286
camel_folder_cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2)
1305
1316
 * @uids: array of uids
1306
1317
 *
1307
1318
 * Sorts the array of UIDs.
 
1319
 *
 
1320
 * Since: 2.24
1308
1321
 **/
1309
1322
void
1310
1323
camel_folder_sort_uids (CamelFolder *folder, GPtrArray *uids)
1444
1457
 * Searches the folder for count of messages matching the given search expression.
1445
1458
 *
1446
1459
 * Returns: an interger
 
1460
 *
 
1461
 * Since: 2.26
1447
1462
 **/
1448
1463
guint32
1449
1464
camel_folder_count_by_expression (CamelFolder *folder, const gchar *expression,
1818
1833
 * @folder: a #CamelFolder object
1819
1834
 *
1820
1835
 * Returns: list of known quota(s) for the folder.
 
1836
 *
 
1837
 * Since: 2.24
1821
1838
 **/
1822
1839
CamelFolderQuotaInfo *
1823
1840
camel_folder_get_quota_info (CamelFolder *folder)
1835
1852
 *
1836
1853
 * Returns: newly allocated #CamelFolderQuotaInfo structure with
1837
1854
 * initialized values based on the parameters, with next member set to NULL.
 
1855
 *
 
1856
 * Since: 2.24
1838
1857
 **/
1839
1858
CamelFolderQuotaInfo *
1840
1859
camel_folder_quota_info_new (const gchar *name, guint64 used, guint64 total)
1855
1874
 * @info: a #CamelFolderQuotaInfo object to clone.
1856
1875
 *
1857
1876
 * Makes a copy of the given info and all next-s.
 
1877
 *
 
1878
 * Since: 2.24
1858
1879
 **/
1859
1880
CamelFolderQuotaInfo *
1860
1881
camel_folder_quota_info_clone (const CamelFolderQuotaInfo *info)
1881
1902
 * @info: a #CamelFolderQuotaInfo object to free.
1882
1903
 *
1883
1904
 * Frees this and all next objects.
 
1905
 *
 
1906
 * Since: 2.24
1884
1907
 **/
1885
1908
void
1886
1909
camel_folder_quota_info_free (CamelFolderQuotaInfo *info)
1915
1938
        gint i, status = 0;
1916
1939
        CamelURL *uri;
1917
1940
        gchar *source_url;
1918
 
        CamelException ex;
 
1941
        CamelException ex = CAMEL_EXCEPTION_INITIALISER;
1919
1942
        CamelJunkPlugin *csp = ((CamelService *)m->folder->parent_store)->session->junk_plugin;
1920
1943
 
1921
1944
        if (m->junk) {
1922
1945
                camel_operation_start (NULL, _("Learning junk"));
1923
1946
 
1924
1947
                for (i = 0; i < m->junk->len; i ++) {
1925
 
                        CamelMimeMessage *msg = camel_folder_get_message(m->folder, m->junk->pdata[i], NULL);
 
1948
                        CamelMimeMessage *msg = camel_folder_get_message(m->folder, m->junk->pdata[i], &ex);
1926
1949
                        gint pc = 100 * i / m->junk->len;
1927
1950
 
 
1951
                        camel_exception_clear (&ex);
1928
1952
                        camel_operation_progress(NULL, pc);
1929
1953
 
1930
1954
                        if (msg) {
1938
1962
        if (m->notjunk) {
1939
1963
                camel_operation_start (NULL, _("Learning non-junk"));
1940
1964
                for (i = 0; i < m->notjunk->len; i ++) {
1941
 
                        CamelMimeMessage *msg = camel_folder_get_message(m->folder, m->notjunk->pdata[i], NULL);
 
1965
                        CamelMimeMessage *msg = camel_folder_get_message(m->folder, m->notjunk->pdata[i], &ex);
1942
1966
                        gint pc = 100 * i / m->notjunk->len;
1943
1967
 
 
1968
                        camel_exception_clear (&ex);
1944
1969
                        camel_operation_progress(NULL, pc);
1945
1970
 
1946
1971
                        if (msg) {
1987
2012
                        camel_folder_free_message_info(m->folder, info);
1988
2013
                }
1989
2014
 
1990
 
                camel_exception_init(&ex);
1991
2015
                camel_filter_driver_flush(m->driver, &ex);
1992
2016
                if (!camel_exception_is_set(&m->ex))
1993
2017
                        camel_exception_xfer(&m->ex, &ex);