~ubuntu-branches/ubuntu/saucy/kdepimlibs/saucy-proposed

« back to all changes in this revision

Viewing changes to akonadi/contact/contactcompletionmodel.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Jonathan Riddell, Scott Kitterman
  • Date: 2012-11-19 17:32:30 UTC
  • mfrom: (1.1.85)
  • Revision ID: package-import@ubuntu.com-20121119173230-xi32j2vpz82zlmmh
Tags: 4:4.9.80-0ubuntu1
[ Jonathan Riddell ]
* New upstream beta release
* Remove 03_hide_akonadi_progressbar.diff now upstream
* Update .symbols file

[ Scott Kitterman ]
* Add libqjson-dev to build-depends since it is required for 4.10
* Update symbols files
* Drop FindAkonadi.cmake from debian/kdepimlibs5-dev.install since it is no
  longer provided by upstream
* Add FindQtOAuth.cmake to debian/kdepimlibs5-dev.install
* Document files we don't install in debian/NOT-INSTALLED
* Add new binary, libakonadi-socialutils4
  - Add to debian/control
  - Add to kdepimlibs metapackage depends
  - Add debian/libakonadi-socialutils4.install
  - Add debian/libakonadi-socialutils4.symbols 
* Update kdepimlibs5-dev.install for new headers for 4.10
* Add googletalkprotocol.desktop to debian/libakonadi-contact4.install
* Add missing symbols files for libakonadi-notes4 and libkalarmcal2
* Add dont_break_libkabc_abi.diff to fix ABI break - patch from José Manuel
  Santamaría Lema

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
QAbstractItemModel* ContactCompletionModel::self()
36
36
{
37
 
  if ( mSelf )
 
37
  if ( mSelf ) {
38
38
    return mSelf;
 
39
  }
39
40
 
40
41
  ChangeRecorder *monitor = new ChangeRecorder;
41
42
  monitor->fetchCollection( true );
69
70
{
70
71
  if ( !item.hasPayload<KABC::Addressee>() ) {
71
72
    // Pass modeltest
72
 
    if ( role == Qt::DisplayRole )
 
73
    if ( role == Qt::DisplayRole ) {
73
74
      return item.remoteId();
 
75
    }
74
76
 
75
77
    return QVariant();
76
78
  }
80
82
 
81
83
    switch ( column ) {
82
84
      case NameColumn:
83
 
        if ( !contact.formattedName().isEmpty() )
 
85
        if ( !contact.formattedName().isEmpty() ) {
84
86
          return contact.formattedName();
85
 
        else
 
87
        } else {
86
88
          return contact.assembledName();
 
89
        }
87
90
        break;
88
91
      case NameAndEmailColumn:
89
92
        {
90
93
          QString name = QString::fromLatin1( "%1 %2" ).arg( contact.givenName() )
91
94
                                                       .arg( contact.familyName() ).simplified();
92
 
          if ( name.isEmpty() )
 
95
          if ( name.isEmpty() ) {
93
96
            name = contact.organization().simplified();
94
 
          if ( name.isEmpty() )
 
97
          }
 
98
          if ( name.isEmpty() ) {
95
99
            return QString();
 
100
          }
96
101
 
97
102
          const QString email = contact.preferredEmail().simplified();
98
 
          if ( email.isEmpty() )
 
103
          if ( email.isEmpty() ) {
99
104
            return QString();
 
105
          }
100
106
 
101
107
          return QString::fromLatin1( "%1 <%2>" ).arg( name ).arg( email );
102
108
        }
117
123
 
118
124
int ContactCompletionModel::columnCount( const QModelIndex &parent ) const
119
125
{
120
 
  if ( !parent.isValid() )
 
126
  if ( !parent.isValid() ) {
121
127
    return 3;
122
 
  else
 
128
  } else {
123
129
    return 0;
 
130
  }
124
131
}
125
132
 
126
133
int ContactCompletionModel::entityColumnCount( HeaderGroup ) const
128
135
  return 3;
129
136
}
130
137
 
131
 
#include "contactcompletionmodel_p.moc"
 
138
#include "moc_contactcompletionmodel_p.cpp"