~ubuntu-branches/ubuntu/trusty/kdepimlibs/trusty

« back to all changes in this revision

Viewing changes to akonadi/monitor_p.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell, Howard Chan, Jonathan Riddell
  • Date: 2013-08-13 23:49:48 UTC
  • mfrom: (1.1.99)
  • Revision ID: package-import@ubuntu.com-20130813234948-y37ze0f94nwr9o2n
Tags: 4:4.11.0-0ubuntu1~ubuntu13.10~ppa1
[ Howard Chan ]
* New upstream release

[ Jonathan Riddell ]
* New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
    || ( op == NotificationMessageV2::Remove && q_ptr->receivers( SIGNAL(itemRemoved(Akonadi::Item)) ) == 0
119
119
                                             && q_ptr->receivers( SIGNAL(itemsRemoved(Akonadi::Item::List)) ) == 0 )
120
120
    || ( op == NotificationMessageV2::Modify && q_ptr->receivers( SIGNAL(itemChanged(Akonadi::Item,QSet<QByteArray>)) ) == 0 )
121
 
    || ( op == NotificationMessageV2::ModifyFlags && q_ptr->receivers( SIGNAL(itemsFlagsChanged(Akonadi::Item::List,QSet<QByteArray>,QSet<QByteArray>)) ) == 0 )
 
121
    || ( op == NotificationMessageV2::ModifyFlags &&
 
122
         ( q_ptr->receivers( SIGNAL(itemsFlagsChanged(Akonadi::Item::List,QSet<QByteArray>,QSet<QByteArray>)) ) == 0
122
123
        // Newly delivered ModifyFlags notifications will be converted to
123
124
        // itemChanged(item, "FLAGS") for legacy clients.
124
 
    || ( op == NotificationMessageV2::ModifyFlags && ( !allowModifyFlagsConversion || q_ptr->receivers( SIGNAL(itemChanged(Akonadi::Item,QSet<QByteArray>)) ) == 0 ) )
 
125
          && ( !allowModifyFlagsConversion || q_ptr->receivers( SIGNAL(itemChanged(Akonadi::Item,QSet<QByteArray>)) ) == 0 )
 
126
          )
 
127
       )
125
128
    || ( op == NotificationMessageV2::Move && q_ptr->receivers( SIGNAL(itemMoved(Akonadi::Item,Akonadi::Collection,Akonadi::Collection)) ) == 0
126
129
                                           && q_ptr->receivers( SIGNAL(itemsMoved(Akonadi::Item::List,Akonadi::Collection,Akonadi::Collection)) ) == 0 )
127
130
    || ( op == NotificationMessageV2::Link && q_ptr->receivers( SIGNAL(itemLinked(Akonadi::Item,Akonadi::Collection)) ) == 0
547
550
        const int appended = translateAndCompress( pendingNotifications, msg );
548
551
        if ( appended > 0 ) {
549
552
          appendedMessages += appended;
550
 
          // translateAndCompress can remove an existing "modify" when msg is a "delete". We need to detect that, for ChangeRecorder.
551
 
          if ( pendingNotifications.count() != oldSize + 1 )
552
 
            ++erasedMessages;
553
 
        } else
 
553
        } else {
554
554
          ++modifiedMessages;
 
555
        }
 
556
        // translateAndCompress can remove an existing "modify" when msg is a "delete".
 
557
        // Or it can merge two ModifyFlags and return false.
 
558
        // We need to detect such removals, for ChangeRecorder.
 
559
        if ( pendingNotifications.count() != oldSize + appended ) {
 
560
          ++erasedMessages; // this count isn't exact, but it doesn't matter
 
561
        }
555
562
      } else if ( needsSplit ) {
556
563
        // If it's not queued at least make sure we fetch all the items from split
557
564
        // notifications in one go.
572
579
  }
573
580
 
574
581
  // tell ChangeRecorder (even if 0 appended, the compression could have made changes to existing messages)
575
 
  if ( appendedMessages > 0 || modifiedMessages > 0 ) {
 
582
  if ( appendedMessages > 0 || modifiedMessages > 0 || erasedMessages > 0 ) {
576
583
    if ( erasedMessages > 0 )
577
584
      notificationsErased();
578
585
    else