~ubuntu-branches/ubuntu/lucid/kdepim-runtime/lucid-updates

« back to all changes in this revision

Viewing changes to agents/maildispatcher/sendjob.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2010-01-06 18:57:08 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20100106185708-njxieh19nqhom3nd
Tags: 4:4.3.90-0ubuntu1
* New upstream beta release:
  - Bump build-depend versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
#include <akonadi/agentinstance.h>
47
47
#include <akonadi/agentmanager.h>
 
48
#include <Akonadi/TransportResourceBase>
48
49
#include <akonadi/kmime/addressattribute.h>
49
50
#include <akonadi/kmime/messageparts.h>
50
51
#include <akonadi/kmime/specialmailcollections.h>
82
83
    void transportPercent( KJob *job, unsigned long percent ); // slot
83
84
    void transportResult( KJob *job ); // slot
84
85
    void resourceProgress( const AgentInstance &instance ); // slot
85
 
    void resourceResult( qlonglong itemId, bool success, const QString &message ); // slot
 
86
    void resourceResult( qlonglong itemId, int result, const QString &message ); // slot
86
87
    void doPostJob( bool transportSuccess, const QString &transportMessage ); // result of transport
87
88
    void postJobResult( KJob *job ); // slot
88
89
    void storeResult( bool success, const QString &message = QString() );
141
142
  // Signals.
142
143
  QObject::connect( AgentManager::self(), SIGNAL(instanceProgressChanged(Akonadi::AgentInstance)),
143
144
      q, SLOT(resourceProgress(Akonadi::AgentInstance)) );
144
 
  QObject::connect( iface, SIGNAL(transportResult(qlonglong,bool,QString)),
145
 
      q, SLOT(resourceResult(qlonglong,bool,QString)) );
 
145
  QObject::connect( iface, SIGNAL(transportResult(qlonglong,int,QString)),
 
146
      q, SLOT(resourceResult(qlonglong,int,QString)) );
146
147
 
147
148
  // Start sending.
148
149
  QDBusReply<void> reply = iface->call( QLatin1String( "send" ), item.id() );
215
216
  }
216
217
}
217
218
 
218
 
void SendJob::Private::resourceResult( qlonglong itemId, bool success, const QString &message )
 
219
void SendJob::Private::resourceResult( qlonglong itemId, int result,
 
220
                                       const QString &message )
219
221
{
220
222
  Q_ASSERT( iface );
221
223
  delete iface; // So that abort() knows the transport job is over.
222
224
  iface = 0;
 
225
  const TransportResourceBase::TransportResult transportResult =
 
226
      static_cast<TransportResourceBase::TransportResult>( result );
 
227
  const bool success = ( transportResult == TransportResourceBase::TransportSucceeded );
223
228
  Q_ASSERT( itemId == item.id() );
224
229
  doPostJob( success, message );
225
230
}