~ubuntu-branches/ubuntu/natty/evolution-data-server/natty

« back to all changes in this revision

Viewing changes to camel/camel-folder-summary.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-02-07 14:11:56 UTC
  • mfrom: (1.1.84 upstream)
  • Revision ID: james.westby@ubuntu.com-20110207141156-jakojbbkzee62447
Tags: 2.32.2-0ubuntu1
* New upstream release
* debian/patches/01_various_linking_issues.patch:
* debian/patches/02_fix_sources_migration.patch:
* debian/patches/199-git-backport-2.32.1-b08a6a1_to_2d0f4a3.patch:
* debian/patches/199-git-backport-2.32.1-to-b08a6a1.patch:
* debian/patches/199-git-skip-empty-cache-files-ee21a86.patch:
  - Fixed upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
#include "camel-string-utils.h"
57
57
#include "camel-store.h"
58
58
#include "camel-vee-folder.h"
 
59
#include "camel-vtrash-folder.h"
59
60
#include "camel-mime-part-utils.h"
60
61
 
61
62
#define CAMEL_FOLDER_SUMMARY_GET_PRIVATE(obj) \
850
851
                else if ((mi->flags & CAMEL_MESSAGE_JUNK) && deleted)
851
852
                        mi->summary->junk_not_deleted_count -= deleted;
852
853
 
853
 
                if (((junk && !(mi->flags & CAMEL_MESSAGE_DELETED)))||  (deleted && !(mi->flags & CAMEL_MESSAGE_JUNK)) )
 
854
                if (((junk && !(mi->flags & CAMEL_MESSAGE_DELETED))) || (deleted && !(mi->flags & CAMEL_MESSAGE_JUNK)))
854
855
                        mi->summary->visible_count -= junk ? junk : deleted;
855
856
        }
856
857
        if (mi->uid)
2492
2493
camel_folder_summary_update_counts_by_flags (CamelFolderSummary *summary, guint32 flags, gboolean subtract)
2493
2494
{
2494
2495
        gint unread=0, deleted=0, junk=0;
 
2496
        gboolean is_junk_folder = FALSE, is_trash_folder = FALSE;
2495
2497
 
2496
2498
        g_return_if_fail (summary != NULL);
2497
2499
 
 
2500
        if (summary->folder && CAMEL_IS_VTRASH_FOLDER (summary->folder)) {
 
2501
                CamelVTrashFolder *vtrash = CAMEL_VTRASH_FOLDER (summary->folder);
 
2502
 
 
2503
                is_junk_folder = vtrash && vtrash->type == CAMEL_VTRASH_FOLDER_JUNK;
 
2504
                is_trash_folder = vtrash && vtrash->type == CAMEL_VTRASH_FOLDER_TRASH;
 
2505
        }
 
2506
 
2498
2507
        if (!(flags & CAMEL_MESSAGE_SEEN))
2499
2508
                unread = subtract ? -1 : 1;
2500
2509
 
2506
2515
 
2507
2516
        dd(printf("%p: %d %d %d | %d %d %d \n", (gpointer) summary, unread, deleted, junk, summary->unread_count, summary->visible_count, summary->saved_count));
2508
2517
 
2509
 
        if (unread)
2510
 
                summary->unread_count += unread;
2511
2518
        if (deleted)
2512
2519
                summary->deleted_count += deleted;
2513
2520
        if (junk)
2517
2524
        if (!junk && !deleted)
2518
2525
                summary->visible_count += subtract ? -1 : 1;
2519
2526
 
 
2527
        if (junk && !is_junk_folder)
 
2528
                unread = 0;
 
2529
        if (deleted && !is_trash_folder)
 
2530
                unread = 0;
 
2531
 
 
2532
        if (unread)
 
2533
                summary->unread_count += unread;
 
2534
 
2520
2535
        summary->saved_count += subtract ? -1 : 1;
2521
2536
        camel_folder_summary_touch (summary);
2522
2537