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

« back to all changes in this revision

Viewing changes to akonadi/calendar/itiphandler_p.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg, Rohan Garg, Philip Muškovac
  • Date: 2013-11-23 17:36:44 UTC
  • mfrom: (1.1.102)
  • Revision ID: package-import@ubuntu.com-20131123173644-p5ow94192ezsny8g
Tags: 4:4.11.80-0ubuntu1
[ Rohan Garg ]
* New upstream beta release
  - Bump akonadi requirement to 1.10.45
  - Update install files
  - Update symbols

[ Philip Muškovac ]
* kdepimlibs-dev/-dbg breaks/replaces kdepim-runtime/-dbg (<< 4:4.11.80)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
                                                 , m_method( KCalCore::iTIPNoMethod )
30
30
                                                 , m_helper( new ITIPHandlerHelper() ) //TODO parent
31
31
                                                 , m_currentOperation( OperationNone )
 
32
                                                 , m_uiDelegate( 0 )
 
33
                                                 , m_showDialogsOnError( true )
32
34
                                                 , q( qq )
33
35
{
34
36
  connect( m_scheduler, SIGNAL(transactionFinished(Akonadi::Scheduler::Result,QString)),
65
67
                                             const QString &errorMessage )
66
68
{
67
69
  const bool success = result == ITIPHandlerHelper::ResultSuccess;
68
 
  emit q->iTipMessageSent( success ? ResultSuccess : ResultError,
69
 
                           success ? QString() : i18n( "Error: %1", errorMessage ) );
 
70
 
 
71
  if ( m_currentOperation == OperationProcessiTIPMessage ) {
 
72
    MailScheduler::Result result2 = success ? MailScheduler::ResultSuccess : MailScheduler::ResultGenericError;
 
73
    finishProcessiTIPMessage( result2, i18n( "Error: %1", errorMessage ) );
 
74
  } else {
 
75
    emit q->iTipMessageSent( success ? ResultSuccess : ResultError,
 
76
                             success ? QString() : i18n( "Error: %1", errorMessage ) );
 
77
  }
 
78
}
 
79
 
 
80
void ITIPHandler::Private::onCounterProposalDelegateFinished( bool success, const QString &errorMessage )
 
81
{
 
82
  Q_UNUSED(success);
 
83
  Q_UNUSED(errorMessage);
 
84
  // This will be used when we make editing counter proposals async.
70
85
}
71
86
 
72
87
void ITIPHandler::Private::onLoadFinished( bool success, const QString &errorMessage )
95
110
void ITIPHandler::Private::finishProcessiTIPMessage( Akonadi::MailScheduler::Result result,
96
111
                                                     const QString &errorMessage )
97
112
{
 
113
  // Handle when user cancels on the collection selection dialog
 
114
  if ( result == MailScheduler::ResultUserCancelled ) {
 
115
    emit q->iTipMessageProcessed( ResultCancelled, QString() );
 
116
    return;
 
117
  }
 
118
 
98
119
  const bool success = result == MailScheduler::ResultSuccess;
99
120
 
100
 
  if ( m_method != KCalCore::iTIPCounter) {
 
121
  if ( m_method == KCalCore::iTIPCounter) {
 
122
    // Here we're processing a counter-proposal that someone sent us and we're the organizer.
 
123
    // TODO: Shouldn't there be a test to see if we're the organizer?
101
124
    if ( success ) {
102
125
      // send update to all attendees
103
126
      Q_ASSERT( m_incidence );
118
141
    }
119
142
  }
120
143
 
121
 
  emit q->iTipMessageSent( success ? ResultSuccess : ResultError,
122
 
                           success ? QString() : i18n( "Error: %1", errorMessage ) );
 
144
  emit q->iTipMessageProcessed( success ? ResultSuccess : ResultError,
 
145
                                success ? QString() : i18n( "Error: %1", errorMessage ) );
123
146
}
124
147
 
125
148
void ITIPHandler::Private::finishSendiTIPMessage( Akonadi::MailScheduler::Result result,
221
244
  return true;
222
245
}
223
246
 
224
 
#include "itiphandler_p.moc"