~ubuntu-branches/ubuntu/quantal/kdepimlibs/quantal-proposed

« back to all changes in this revision

Viewing changes to akonadi/kmime/markascommand.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-14 14:37:07 UTC
  • mto: This revision was merged to the branch mainline in revision 112.
  • Revision ID: package-import@ubuntu.com-20111214143707-m0qplh3hsd957ukv
Tags: upstream-4.7.90
ImportĀ upstreamĀ versionĀ 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 
54
54
  Akonadi::ItemFetchJob *fjob = dynamic_cast<Akonadi::ItemFetchJob*>( job );
55
55
  Q_ASSERT( fjob );
56
 
 
 
56
  mMessages.clear();
57
57
  foreach( const Akonadi::Item &item, fjob->items() ) {
58
58
    Akonadi::MessageStatus status;
59
59
    status.setStatusFromFlags( item.flags() );
68
68
      }
69
69
  }
70
70
  if ( mMessages.empty() ) {
71
 
    emitResult( OK );
72
 
    return;
 
71
    if( mFolderListJobCount == 0 ) { 
 
72
      emitResult( OK );
 
73
      return;
 
74
    }
 
75
  } else {
 
76
    markMessages();
73
77
  }
74
 
 
75
 
  markMessages();
76
 
 
77
78
  if ( mFolderListJobCount > 0 ) {
78
79
    Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( mFolders[mFolderListJobCount - 1], parent() );
79
80
    job->fetchScope().setAncestorRetrieval( Akonadi::ItemFetchScope::Parent );
80
 
    connect( job, SIGNAL( result( KJob* ) ), this, SLOT( slotFetchDone( KJob* ) ) );
 
81
    connect( job, SIGNAL(result(KJob*)), this, SLOT(slotFetchDone(KJob*)) );
81
82
  }
82
83
}
83
84
 
88
89
    //yes, we go backwards, shouldn't matter
89
90
    Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( mFolders[mFolderListJobCount - 1], parent() );
90
91
    job->fetchScope().setAncestorRetrieval( Akonadi::ItemFetchScope::Parent );
91
 
    connect( job, SIGNAL( result( KJob* ) ), this, SLOT( slotFetchDone( KJob* ) ) );
 
92
    connect( job, SIGNAL(result(KJob*)), this, SLOT(slotFetchDone(KJob*)) );
92
93
  } else if ( !mMessages.isEmpty() ) {
93
94
    mFolders << mMessages.first().parentCollection();
94
95
    markMessages();
103
104
 
104
105
  Q_ASSERT( mTargetStatus.statusFlags().size() == 1 );
105
106
  const Akonadi::Item::Flag flag = *(mTargetStatus.statusFlags().begin());
106
 
 
107
107
  Akonadi::Item::List itemsToModify;
108
108
  foreach( const Akonadi::Item &it, mMessages ) {
109
109
    Akonadi::Item item( it );
130
130
    Akonadi::ItemModifyJob *modifyJob = new Akonadi::ItemModifyJob( itemsToModify, this );
131
131
    modifyJob->setIgnorePayload( true );
132
132
    modifyJob->disableRevisionCheck();
133
 
    connect( modifyJob, SIGNAL( result( KJob* ) ), this, SLOT( slotModifyItemDone( KJob* ) ) );
 
133
    connect( modifyJob, SIGNAL(result(KJob*)), this, SLOT(slotModifyItemDone(KJob*)) );
134
134
  }
135
135
}
136
136