• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

messagelist

  • sources
  • kde-4.12
  • kdepim
  • messagelist
storagemodel.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2009 Kevin Ottens <ervin@kde.org>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18 
19 #include "storagemodel.h"
20 
21 #include <messagecore/utils/stringutil.h>
22 #include <messagecore/settings/globalsettings.h>
23 #include <messagecore/helpers/nodehelper.h>
24 
25 #include <akonadi/attributefactory.h>
26 #include <akonadi/collection.h>
27 #include <akonadi/collectionstatistics.h>
28 #include <akonadi/entitymimetypefiltermodel.h>
29 #include <akonadi/entitytreemodel.h>
30 #include <akonadi/item.h>
31 #include <akonadi/itemmodifyjob.h>
32 #include <akonadi/kmime/messagefolderattribute.h>
33 #include <akonadi/selectionproxymodel.h>
34 
35 #include <Nepomuk2/Resource>
36 #include <Nepomuk2/Vocabulary/NIE>
37 #include <Nepomuk2/Variant>
38 
39 #include <Nepomuk2/ResourceWatcher>
40 
41 
42 #include <KDE/KLocale>
43 #include <Soprano/Statement>
44 #include <soprano/signalcachemodel.h>
45 #include <soprano/nao.h>
46 
47 #include "core/messageitem.h"
48 #include "core/settings.h"
49 #include "messagelistutil.h"
50 
51 
52 #include <QtCore/QAbstractItemModel>
53 #include <QtCore/QAtomicInt>
54 #include <QtCore/QScopedPointer>
55 #include <QItemSelectionModel>
56 #include <QtCore/QMimeData>
57 #include <QtCore/QCryptographicHash>
58 
59 namespace MessageList
60 {
61 
62 class StorageModel::Private
63 {
64 public:
65  void onSourceDataChanged( const QModelIndex &topLeft, const QModelIndex &bottomRight );
66  void onSelectionChanged();
67  void loadSettings();
68  void statementChanged(const Nepomuk2::Resource &statement );
69 
70  StorageModel * const q;
71 
72  QAbstractItemModel *mModel;
73  QItemSelectionModel *mSelectionModel;
74 
75  Private( StorageModel *owner )
76  : q( owner ),
77  mModel(0),
78  mSelectionModel(0)
79  {}
80 };
81 
82 } // namespace MessageList
83 
84 using namespace Akonadi;
85 using namespace MessageList;
86 
87 namespace {
88 
89 KMime::Message::Ptr messageForItem( const Akonadi::Item &item )
90 {
91  if ( !item.hasPayload<KMime::Message::Ptr>() ) {
92  kWarning() << "Not a message" << item.id() << item.remoteId() << item.mimeType();
93  return KMime::Message::Ptr();
94  }
95  return item.payload<KMime::Message::Ptr>();
96 }
97 
98 }
99 
100 static QAtomicInt _k_attributeInitialized;
101 
102 StorageModel::StorageModel( QAbstractItemModel *model, QItemSelectionModel *selectionModel, QObject *parent )
103  : Core::StorageModel( parent ), d( new Private( this ) )
104 {
105  d->mSelectionModel = selectionModel;
106  if ( _k_attributeInitialized.testAndSetAcquire( 0, 1 ) ) {
107  AttributeFactory::registerAttribute<MessageFolderAttribute>();
108  }
109 
110  Akonadi::SelectionProxyModel *childrenFilter = new Akonadi::SelectionProxyModel( d->mSelectionModel, this );
111  childrenFilter->setSourceModel( model );
112  childrenFilter->setFilterBehavior( KSelectionProxyModel::ChildrenOfExactSelection );
113 
114  EntityMimeTypeFilterModel *itemFilter = new EntityMimeTypeFilterModel( this );
115  itemFilter->setSourceModel( childrenFilter );
116  itemFilter->addMimeTypeExclusionFilter( Collection::mimeType() );
117  itemFilter->addMimeTypeInclusionFilter( QLatin1String( "message/rfc822" ) );
118  itemFilter->setHeaderGroup( EntityTreeModel::ItemListHeaders );
119 
120  d->mModel = itemFilter;
121 
122  kDebug() << "Using model:" << model->metaObject()->className();
123  Nepomuk2::ResourceWatcher *watcher = new Nepomuk2::ResourceWatcher(this);
124  watcher->addProperty(Nepomuk2::Types::Property(Soprano::Vocabulary::NAO::hasTag()));
125  watcher->addProperty(Nepomuk2::Types::Property(Soprano::Vocabulary::NAO::description()));
126  connect(watcher, SIGNAL(propertyChanged(Nepomuk2::Resource,Nepomuk2::Types::Property,QVariantList,QVariantList)),
127  this, SLOT(statementChanged(Nepomuk2::Resource)));
128  connect(watcher, SIGNAL(propertyRemoved(Nepomuk2::Resource,Nepomuk2::Types::Property,QVariant)),
129  this, SLOT(statementChanged(Nepomuk2::Resource)));
130  connect(watcher, SIGNAL(propertyAdded(Nepomuk2::Resource,Nepomuk2::Types::Property,QVariant)),
131  this, SLOT(statementChanged(Nepomuk2::Resource)));
132  connect(watcher, SIGNAL(resourceCreated(Nepomuk2::Resource,QList<QUrl>)),
133  this, SLOT(statementChanged(Nepomuk2::Resource)));
134  watcher->start();
135 
136  connect( d->mModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
137  this, SLOT(onSourceDataChanged(QModelIndex,QModelIndex)) );
138 
139  connect( d->mModel, SIGNAL(layoutAboutToBeChanged()),
140  this, SIGNAL(layoutAboutToBeChanged()) );
141  connect( d->mModel, SIGNAL(layoutChanged()),
142  this, SIGNAL(layoutChanged()) );
143  connect( d->mModel, SIGNAL(modelAboutToBeReset()),
144  this, SIGNAL(modelAboutToBeReset()) );
145  connect( d->mModel, SIGNAL(modelReset()),
146  this, SIGNAL(modelReset()) );
147 
148  //Here we assume we'll always get QModelIndex() in the parameters
149  connect( d->mModel, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
150  this, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)) );
151  connect( d->mModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
152  this, SIGNAL(rowsInserted(QModelIndex,int,int)) );
153  connect( d->mModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
154  this, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)) );
155  connect( d->mModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
156  this, SIGNAL(rowsRemoved(QModelIndex,int,int)) );
157 
158  connect( d->mSelectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
159  this, SLOT(onSelectionChanged()) );
160 
161  d->loadSettings();
162  connect( Core::Settings::self(), SIGNAL(configChanged()),
163  this, SLOT(loadSettings()) );
164 }
165 
166 StorageModel::~StorageModel()
167 {
168  delete d;
169 }
170 
171 Collection::List StorageModel::displayedCollections() const
172 {
173  Collection::List collections;
174  QModelIndexList indexes = d->mSelectionModel->selectedRows();
175 
176  foreach ( const QModelIndex &index, indexes ) {
177  Collection c = index.data( EntityTreeModel::CollectionRole ).value<Collection>();
178  if ( c.isValid() ) {
179  collections << c;
180  }
181  }
182 
183  return collections;
184 }
185 
186 QString StorageModel::id() const
187 {
188  QStringList ids;
189  QModelIndexList indexes = d->mSelectionModel->selectedRows();
190 
191  foreach ( const QModelIndex &index, indexes ) {
192  Collection c = index.data( EntityTreeModel::CollectionRole ).value<Collection>();
193  if ( c.isValid() ) {
194  ids << QString::number( c.id() );
195  }
196  }
197 
198  ids.sort();
199  return ids.join(QLatin1String( ":" ));
200 }
201 
202 bool StorageModel::isOutBoundFolder( const Akonadi::Collection& c ) const
203 {
204  if ( c.hasAttribute<MessageFolderAttribute>()
205  && c.attribute<MessageFolderAttribute>()->isOutboundFolder() ) {
206  return true;
207  }
208  return false;
209 }
210 
211 bool StorageModel::containsOutboundMessages() const
212 {
213  QModelIndexList indexes = d->mSelectionModel->selectedRows();
214 
215  foreach ( const QModelIndex &index, indexes ) {
216  Collection c = index.data( EntityTreeModel::CollectionRole ).value<Collection>();
217  if ( c.isValid() ) {
218  return isOutBoundFolder( c );
219  }
220  }
221 
222  return false;
223 }
224 
225 int StorageModel::initialUnreadRowCountGuess() const
226 {
227  QModelIndexList indexes = d->mSelectionModel->selectedRows();
228 
229  int unreadCount = 0;
230 
231  foreach ( const QModelIndex &index, indexes ) {
232  Collection c = index.data( EntityTreeModel::CollectionRole ).value<Collection>();
233  if ( c.isValid() ) {
234  unreadCount+= c.statistics().unreadCount();
235  }
236  }
237 
238  return unreadCount;
239 }
240 
241 bool StorageModel::initializeMessageItem( MessageList::Core::MessageItem *mi,
242  int row, bool bUseReceiver ) const
243 {
244  const Item item = itemForRow( row );
245  const KMime::Message::Ptr mail = messageForItem( item );
246  if ( !mail ) {
247  return false;
248  }
249 
250  QString sender;
251  if ( mail->from() ) {
252  sender = mail->from()->asUnicodeString();
253  }
254  QString receiver;
255  if ( mail->to() ) {
256  receiver = mail->to()->asUnicodeString();
257  }
258 
259  // Static for speed reasons
260  static const QString noSubject = i18nc( "displayed as subject when the subject of a mail is empty", "No Subject" );
261  static const QString unknown( i18nc( "displayed when a mail has unknown sender, receiver or date", "Unknown" ) );
262 
263  if ( sender.isEmpty() ) {
264  sender = unknown;
265  }
266  if ( receiver.isEmpty() ) {
267  receiver = unknown;
268  }
269 
270  mi->initialSetup( mail->date()->dateTime().toTime_t(),
271  item.size(),
272  sender, receiver,
273  bUseReceiver );
274  mi->setItemId( item.id() );
275 
276  QString subject = mail->subject()->asUnicodeString();
277  if ( subject.isEmpty() ) {
278  subject = QLatin1Char( '(' ) + noSubject + QLatin1Char( ')' );
279  }
280 
281  mi->setSubject( subject );
282 
283  updateMessageItemData( mi, row );
284 
285  return true;
286 }
287 
288 static QByteArray md5Encode( const QByteArray &str )
289 {
290  if ( str.trimmed().isEmpty() ) return QByteArray();
291 
292  QCryptographicHash c( QCryptographicHash::Md5 );
293  c.addData( str.trimmed() );
294  return c.result();
295 }
296 
297 void StorageModel::fillMessageItemThreadingData( MessageList::Core::MessageItem *mi,
298  int row, ThreadingDataSubset subset ) const
299 {
300  const KMime::Message::Ptr mail = messageForRow( row );
301  Q_ASSERT( mail ); // We ASSUME that initializeMessageItem has been called successfully...
302 
303  switch ( subset ) {
304  case PerfectThreadingReferencesAndSubject:
305  {
306  const QString subject = mail->subject()->asUnicodeString();
307  const QString strippedSubject = MessageCore::StringUtil::stripOffPrefixes( subject );
308  mi->setStrippedSubjectMD5( md5Encode( strippedSubject.toUtf8() ) );
309  mi->setSubjectIsPrefixed( subject != strippedSubject );
310  // fall through
311  }
312  case PerfectThreadingPlusReferences:
313  if ( !mail->references()->identifiers().isEmpty() ) {
314  mi->setReferencesIdMD5( md5Encode( mail->references()->identifiers().last() ) );
315  }
316  // fall through
317  case PerfectThreadingOnly:
318  mi->setMessageIdMD5( md5Encode( mail->messageID()->identifier() ) );
319  if ( !mail->inReplyTo()->identifiers().isEmpty() ) {
320  mi->setInReplyToIdMD5( md5Encode( mail->inReplyTo()->identifiers().first() ) );
321  }
322  break;
323  default:
324  Q_ASSERT( false ); // should never happen
325  break;
326  }
327 }
328 
329 void StorageModel::updateMessageItemData( MessageList::Core::MessageItem *mi,
330  int row ) const
331 {
332  const Item item = itemForRow( row );
333 
334  Akonadi::MessageStatus stat;
335  stat.setStatusFromFlags( item.flags() );
336 
337  mi->setAkonadiItem( item );
338  mi->setStatus( stat );
339 
340 
341  if ( stat.isEncrypted() )
342  mi->setEncryptionState( Core::MessageItem::FullyEncrypted );
343  else
344  mi->setEncryptionState( Core::MessageItem::EncryptionStateUnknown );
345 
346 
347  if ( stat.isSigned() )
348  mi->setSignatureState( Core::MessageItem::FullySigned );
349  else
350  mi->setSignatureState( Core::MessageItem::SignatureStateUnknown );
351 
352  mi->invalidateTagCache();
353  mi->invalidateAnnotationCache();
354 }
355 
356 void StorageModel::setMessageItemStatus( MessageList::Core::MessageItem *mi,
357  int row, const Akonadi::MessageStatus &status )
358 {
359  Q_UNUSED( mi );
360  Item item = itemForRow( row );
361  item.setFlags( status.statusFlags() );
362  ItemModifyJob *job = new ItemModifyJob( item, this );
363  job->disableRevisionCheck();
364  job->setIgnorePayload( true );
365 }
366 
367 QVariant StorageModel::data( const QModelIndex &index, int role ) const
368 {
369  // We don't provide an implementation for data() in No-Akonadi-KMail.
370  // This is because StorageModel must be a wrapper anyway (because columns
371  // must be re-mapped and functions not available in a QAbstractItemModel
372  // are strictly needed. So when porting to Akonadi this class will
373  // either wrap or subclass the MessageModel and implement initializeMessageItem()
374  // with appropriate calls to data(). And for No-Akonadi-KMail we still have
375  // a somewhat efficient implementation.
376 
377  Q_UNUSED( index );
378  Q_UNUSED( role );
379 
380  return QVariant();
381 }
382 
383 int StorageModel::columnCount( const QModelIndex &parent ) const
384 {
385  if ( !parent.isValid() )
386  return 1;
387  return 0; // this model is flat.
388 }
389 
390 QModelIndex StorageModel::index( int row, int column, const QModelIndex &parent ) const
391 {
392  if ( !parent.isValid() )
393  return createIndex( row, column, 0 );
394 
395  return QModelIndex(); // this model is flat.
396 }
397 
398 QModelIndex StorageModel::parent( const QModelIndex &index ) const
399 {
400  Q_UNUSED( index );
401  return QModelIndex(); // this model is flat.
402 }
403 
404 int StorageModel::rowCount( const QModelIndex &parent ) const
405 {
406  if ( !parent.isValid() )
407  return d->mModel->rowCount();
408  return 0; // this model is flat.
409 }
410 
411 QMimeData* StorageModel::mimeData( const QList< MessageList::Core::MessageItem* >& items ) const
412 {
413  QMimeData *data = new QMimeData();
414  KUrl::List urls;
415  foreach ( MessageList::Core::MessageItem* mi, items ) {
416  Akonadi::Item item = itemForRow( mi->currentModelIndexRow() );
417  urls << item.url( Item::UrlWithMimeType );
418  }
419 
420  urls.populateMimeData( data );
421 
422  return data;
423 }
424 
425 
426 void StorageModel::prepareForScan()
427 {
428 
429 }
430 
431 void StorageModel::Private::statementChanged( const Nepomuk2::Resource &statement )
432 {
433  const Akonadi::Item item = Item::fromUrl( statement.property(Nepomuk2::Vocabulary::NIE::url()).toUrl() );
434  if ( !item.isValid() ) {
435  return;
436  }
437  const QModelIndexList list = mModel->match( QModelIndex(), EntityTreeModel::ItemIdRole, item.id() );
438  if ( list.isEmpty() ) {
439  return;
440  }
441  emit q->dataChanged( q->index( list.first().row(), 0 ),
442  q->index( list.first().row(), 0 ) );
443 }
444 
445 void StorageModel::Private::onSourceDataChanged( const QModelIndex &topLeft, const QModelIndex &bottomRight )
446 {
447  emit q->dataChanged( q->index( topLeft.row(), 0 ),
448  q->index( bottomRight.row(), 0 ) );
449 }
450 
451 void StorageModel::Private::onSelectionChanged()
452 {
453  emit q->headerDataChanged( Qt::Horizontal, 0, q->columnCount()-1 );
454 }
455 
456 void StorageModel::Private::loadSettings()
457 {
458  // Custom/System colors
459  Core::Settings *settings = Core::Settings::self();
460 
461  if ( MessageCore::GlobalSettings::self()->useDefaultColors() ) {
462  Core::MessageItem::setUnreadMessageColor( MessageList::Util::unreadDefaultMessageColor() );
463  Core::MessageItem::setImportantMessageColor( MessageList::Util::importantDefaultMessageColor() );
464  Core::MessageItem::setToDoMessageColor( MessageList::Util::todoDefaultMessageColor() );
465  } else {
466  Core::MessageItem::setUnreadMessageColor( settings->unreadMessageColor() );
467  Core::MessageItem::setImportantMessageColor( settings->importantMessageColor() );
468  Core::MessageItem::setToDoMessageColor( settings->todoMessageColor() );
469  }
470 
471  if ( MessageCore::GlobalSettings::self()->useDefaultFonts() ) {
472  Core::MessageItem::setGeneralFont( KGlobalSettings::generalFont() );
473  Core::MessageItem::setUnreadMessageFont( KGlobalSettings::generalFont() );
474  Core::MessageItem::setImportantMessageFont( KGlobalSettings::generalFont() );
475  Core::MessageItem::setToDoMessageFont( KGlobalSettings::generalFont() );
476  } else {
477  Core::MessageItem::setGeneralFont( settings->messageListFont() );
478  Core::MessageItem::setUnreadMessageFont( settings->unreadMessageFont() );
479  Core::MessageItem::setImportantMessageFont( settings->importantMessageFont() );
480  Core::MessageItem::setToDoMessageFont( settings->todoMessageFont() );
481  }
482 }
483 
484 Item StorageModel::itemForRow( int row ) const
485 {
486  return d->mModel->data( d->mModel->index( row, 0 ), EntityTreeModel::ItemRole ).value<Item>();
487 }
488 
489 KMime::Message::Ptr StorageModel::messageForRow( int row ) const
490 {
491  return messageForItem( itemForRow( row ) );
492 }
493 
494 void StorageModel::resetModelStorage()
495 {
496  reset();
497 }
498 
499 #include "storagemodel.moc"
MessageList::StorageModel::messageForRow
KMime::Message::Ptr messageForRow(int row) const
Definition: storagemodel.cpp:489
MessageList::Core::Settings::importantMessageFont
static QFont importantMessageFont()
Get ImportantMessageFont.
Definition: settings.cpp:311
MessageList::StorageModel::initializeMessageItem
virtual bool initializeMessageItem(MessageList::Core::MessageItem *mi, int row, bool bUseReceiver) const
This method should use the inner model implementation to fill in the base data for the specified Mess...
Definition: storagemodel.cpp:241
MessageList::StorageModel::containsOutboundMessages
virtual bool containsOutboundMessages() const
Returns true if this StorageModel (folder) contains outbound messages and false otherwise.
Definition: storagemodel.cpp:211
MessageList::Core::MessageItem::setUnreadMessageColor
static void setUnreadMessageColor(const QColor &color)
Definition: messageitem.cpp:649
MessageList::Core::MessageItem
Definition: messageitem.h:50
MessageList::Util::importantDefaultMessageColor
MESSAGELIST_EXPORT QColor importantDefaultMessageColor()
Definition: messagelistutil.cpp:114
MessageList::StorageModel::initialUnreadRowCountGuess
virtual int initialUnreadRowCountGuess() const
Returns (a guess for) the number of unread messages: must be pessimistic (i.e.
Definition: storagemodel.cpp:225
MessageList::Core::MessageItem::setImportantMessageColor
static void setImportantMessageColor(const QColor &color)
Definition: messageitem.cpp:655
MessageList::StorageModel::fillMessageItemThreadingData
virtual void fillMessageItemThreadingData(MessageList::Core::MessageItem *mi, int row, ThreadingDataSubset subset) const
This method should use the inner model implementation to fill in the specified subset of threading da...
Definition: storagemodel.cpp:297
MessageList::Core::MessageItem::setStrippedSubjectMD5
void setStrippedSubjectMD5(const QByteArray &md5)
Definition: messageitem.cpp:530
MessageList::Core::Settings::unreadMessageFont
static QFont unreadMessageFont()
Get UnreadMessageFont.
Definition: settings.cpp:294
MessageList::Core::MessageItem::setMessageIdMD5
void setMessageIdMD5(const QByteArray &md5)
Definition: messageitem.cpp:482
MessageList::Core::MessageItem::setAkonadiItem
void setAkonadiItem(const Akonadi::Item &item)
Definition: messageitem.cpp:572
MessageList::StorageModel::rowCount
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: storagemodel.cpp:404
MessageList::Core::Item::setSubject
void setSubject(const QString &subject)
Sets the subject associated to this Item.
Definition: item.cpp:477
MessageList::Core::Item::setItemId
void setItemId(qint64 id)
Definition: item.cpp:495
QObject
MessageList::Core::MessageItem::setToDoMessageFont
static void setToDoMessageFont(const QFont &font)
Definition: messageitem.cpp:685
MessageList::Core::StorageModel::ThreadingDataSubset
ThreadingDataSubset
Definition: storagemodelbase.h:95
MessageList::StorageModel::columnCount
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: storagemodel.cpp:383
MessageList::StorageModel::updateMessageItemData
virtual void updateMessageItemData(MessageList::Core::MessageItem *mi, int row) const
This method should use the inner model implementation to re-fill the date, the status, the encryption state, the signature state and eventually update the min/max dates for the specified MessageItem from the underlying storage slot at the specified row index.
Definition: storagemodel.cpp:329
md5Encode
static QByteArray md5Encode(const QByteArray &str)
Definition: storagemodel.cpp:288
MessageList::StorageModel::displayedCollections
Akonadi::Collection::List displayedCollections() const
Definition: storagemodel.cpp:171
MessageList::Core::MessageItem::setInReplyToIdMD5
void setInReplyToIdMD5(const QByteArray &md5)
Definition: messageitem.cpp:494
MessageList::Core::Settings::todoMessageColor
static QColor todoMessageColor()
Get TodoMessageColor.
Definition: settings.cpp:260
MessageList::Core::Settings
Definition: settings.h:19
messageitem.h
MessageList::Core::Settings::todoMessageFont
static QFont todoMessageFont()
Get TodoMessageFont.
Definition: settings.cpp:328
storagemodel.h
MessageList::Core::MessageItem::setEncryptionState
void setEncryptionState(EncryptionState state)
Definition: messageitem.cpp:470
MessageList::Core::Settings::self
static Settings * self()
Definition: settings.cpp:70
MessageList::Core::Settings::unreadMessageColor
static QColor unreadMessageColor()
Get UnreadMessageColor.
Definition: settings.cpp:226
MessageList::Core::MessageItem::setReferencesIdMD5
void setReferencesIdMD5(const QByteArray &md5)
Definition: messageitem.cpp:506
MessageList::StorageModel::resetModelStorage
void resetModelStorage()
Definition: storagemodel.cpp:494
MessageList::Core::ModelInvariantIndex::currentModelIndexRow
int currentModelIndexRow()
Returns the current model index row for this invariant index.
Definition: modelinvariantindex.cpp:47
MessageList::StorageModel::prepareForScan
virtual void prepareForScan()
Called by Model just before this StorageModel is attacched to it.
Definition: storagemodel.cpp:426
MessageList::Core::StorageModel::PerfectThreadingPlusReferences
messageIdMD5, inReplyToMD5, referencesIdMD5
Definition: storagemodelbase.h:98
MessageList::StorageModel::isOutBoundFolder
virtual bool isOutBoundFolder(const Akonadi::Collection &c) const
Definition: storagemodel.cpp:202
MessageList::StorageModel::parent
virtual QModelIndex parent(const QModelIndex &index) const
Definition: storagemodel.cpp:398
MessageList::Core::MessageItem::setSignatureState
void setSignatureState(SignatureState state)
Definition: messageitem.cpp:458
MessageList::Core::MessageItem::invalidateTagCache
void invalidateTagCache()
Deletes all cached tags.
Definition: messageitem.cpp:350
QAbstractItemModel
MessageList::Util::todoDefaultMessageColor
MESSAGELIST_EXPORT QColor todoDefaultMessageColor()
Definition: messagelistutil.cpp:119
_k_attributeInitialized
static QAtomicInt _k_attributeInitialized
Definition: storagemodel.cpp:100
MessageList::StorageModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: storagemodel.cpp:390
MessageList::Core::MessageItem::setSubjectIsPrefixed
void setSubjectIsPrefixed(bool subjectIsPrefixed)
Definition: messageitem.cpp:512
MessageList::Core::MessageItem::setUnreadMessageFont
static void setUnreadMessageFont(const QFont &font)
Definition: messageitem.cpp:673
MessageList::Core::MessageItem::setImportantMessageFont
static void setImportantMessageFont(const QFont &font)
Definition: messageitem.cpp:679
MessageList::Core::MessageItem::setToDoMessageColor
static void setToDoMessageColor(const QColor &color)
Definition: messageitem.cpp:661
MessageList::Util::unreadDefaultMessageColor
MESSAGELIST_EXPORT QColor unreadDefaultMessageColor()
Definition: messagelistutil.cpp:109
settings.h
messagelistutil.h
MessageList::StorageModel::data
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: storagemodel.cpp:367
MessageList::Core::MessageItem::EncryptionStateUnknown
Definition: messageitem.h:89
MessageList::StorageModel::mimeData
virtual QMimeData * mimeData(const QList< MessageList::Core::MessageItem * > &) const
The implementation-specific mime data for this list of items.
Definition: storagemodel.cpp:411
MessageList::StorageModel::setMessageItemStatus
virtual void setMessageItemStatus(MessageList::Core::MessageItem *mi, int row, const Akonadi::MessageStatus &status)
This method should use the inner model implementation to associate the new status to the specified me...
Definition: storagemodel.cpp:356
MessageList::Core::StorageModel::PerfectThreadingReferencesAndSubject
All of the above plus subject stuff.
Definition: storagemodelbase.h:99
MessageList::StorageModel
The Akonadi specific implementation of the Core::StorageModel.
Definition: storagemodel.h:48
MessageList::Core::MessageItem::SignatureStateUnknown
Definition: messageitem.h:97
MessageList::Core::MessageItem::setGeneralFont
static void setGeneralFont(const QFont &font)
Definition: messageitem.cpp:667
MessageList::Core::MessageItem::FullyEncrypted
Definition: messageitem.h:88
MessageList::Core::Settings::messageListFont
static QFont messageListFont()
Get MessageListFont.
Definition: settings.cpp:277
MessageList::StorageModel::itemForRow
Akonadi::Item itemForRow(int row) const
Definition: storagemodel.cpp:484
MessageList::Core::Item::initialSetup
void initialSetup(time_t date, size_t size, const QString &sender, const QString &receiver, bool useReceiver)
This is meant to be called right after the constructor.
Definition: item.cpp:482
MessageList::StorageModel::id
virtual QString id() const
Returns an unique id for this Storage collection.
Definition: storagemodel.cpp:186
MessageList::Core::Settings::importantMessageColor
static QColor importantMessageColor()
Get ImportantMessageColor.
Definition: settings.cpp:243
MessageList::Core::StorageModel::PerfectThreadingOnly
Only the data for messageIdMD5 and inReplyToMD5 is needed.
Definition: storagemodelbase.h:97
MessageList::Core::MessageItem::invalidateAnnotationCache
void invalidateAnnotationCache()
Same as invalidateTagCache(), only for the annotation.
Definition: messageitem.cpp:356
MessageList::StorageModel::~StorageModel
~StorageModel()
Definition: storagemodel.cpp:166
MessageList::Core::MessageItem::FullySigned
Definition: messageitem.h:96
MessageList::Core::Item::setStatus
void setStatus(const Akonadi::MessageStatus &status)
Sets the status associated to this Item.
Definition: item.cpp:407
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

messagelist

Skip menu "messagelist"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal