~ubuntu-branches/ubuntu/raring/kdepimlibs/raring-proposed

« back to all changes in this revision

Viewing changes to akonadi/contact/contactgrouplineedit.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-14 14:37:07 UTC
  • mfrom: (1.1.72)
  • Revision ID: package-import@ubuntu.com-20111214143707-nvfc00wnfayzn9ig
Tags: 4:4.7.90-0ubuntu1
* New upstream beta release
* Add packages libkalarmcal2 and libakonadi-notes4

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
{
46
46
  mCompleter = new QCompleter( model, this );
47
47
  mCompleter->setCompletionColumn( Akonadi::ContactCompletionModel::NameAndEmailColumn );
48
 
  connect( mCompleter, SIGNAL( activated( const QModelIndex& ) ),
49
 
           this, SLOT( autoCompleted( const QModelIndex& ) ) );
 
48
  connect( mCompleter, SIGNAL(activated(QModelIndex)),
 
49
           this, SLOT(autoCompleted(QModelIndex)) );
50
50
 
51
51
  setCompleter( mCompleter );
52
52
}
84
84
  mContactReference = reference;
85
85
  mContainsReference = true;
86
86
 
87
 
  disconnect( this, SIGNAL( textChanged( const QString& ) ), this, SLOT( invalidateReference() ) );
 
87
  disconnect( this, SIGNAL(textChanged(QString)), this, SLOT(invalidateReference()) );
88
88
 
89
89
  updateView( reference.uid(), reference.preferredEmail() );
90
90
}
103
103
  if ( !item.isValid() )
104
104
    return;
105
105
 
106
 
  disconnect( this, SIGNAL( textChanged( const QString& ) ), this, SLOT( invalidateReference() ) );
 
106
  disconnect( this, SIGNAL(textChanged(QString)), this, SLOT(invalidateReference()) );
107
107
  mContainsReference = true;
108
108
 
109
109
  updateView( item );
110
110
 
111
 
  connect( this, SIGNAL( textChanged( const QString& ) ), SLOT( invalidateReference() ) );
 
111
  connect( this, SIGNAL(textChanged(QString)), SLOT(invalidateReference()) );
112
112
}
113
113
 
114
114
void ContactGroupLineEdit::invalidateReference()
115
115
{
116
 
  disconnect( this, SIGNAL( textChanged( const QString& ) ), this, SLOT( invalidateReference() ) );
 
116
  disconnect( this, SIGNAL(textChanged(QString)), this, SLOT(invalidateReference()) );
117
117
  mContainsReference = false;
118
118
}
119
119
 
122
122
  Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( Akonadi::Item( uid.toLongLong() ) );
123
123
  job->fetchScope().fetchFullPayload();
124
124
  job->setProperty( "preferredEmail", preferredEmail );
125
 
  connect( job, SIGNAL( result( KJob* ) ), SLOT( fetchDone( KJob* ) ) );
 
125
  connect( job, SIGNAL(result(KJob*)), SLOT(fetchDone(KJob*)) );
126
126
}
127
127
 
128
128
void ContactGroupLineEdit::fetchDone( KJob *job )
134
134
    updateView( item, fetchJob->property( "preferredEmail" ).toString() );
135
135
  }
136
136
 
137
 
  connect( this, SIGNAL( textChanged( const QString& ) ), SLOT( invalidateReference() ) );
 
137
  connect( this, SIGNAL(textChanged(QString)), SLOT(invalidateReference()) );
138
138
}
139
139
 
140
140
void ContactGroupLineEdit::updateView( const Akonadi::Item &item, const QString &preferredEmail )
179
179
 
180
180
  QMenu menu;
181
181
  menu.setTitle( i18n( "Select preferred email address" ) );
182
 
  for ( int i = 0; i < emails.count(); ++i ) {
 
182
  const int numberOfEmails( emails.count() );
 
183
  for ( int i = 0; i < numberOfEmails; ++i ) {
183
184
    action = menu.addAction( emails.at( i ) );
184
185
    action->setData( i );
185
186
  }