Messagelib
storagemodel.cpp
68 qCWarning(MESSAGELIST_LOG) << "Not a message" << item.id() << item.remoteId() << item.mimeType();
77MessageList::StorageModel::StorageModel(QAbstractItemModel *model, QItemSelectionModel *selectionModel, QObject *parent)
101 connect(d->mModel, &QAbstractItemModel::dataChanged, this, [this](const QModelIndex &id1, const QModelIndex &id2) {
105 connect(d->mModel, &QAbstractItemModel::layoutAboutToBeChanged, this, &StorageModel::layoutAboutToBeChanged);
107 connect(d->mModel, &QAbstractItemModel::modelAboutToBeReset, this, &StorageModel::modelAboutToBeReset);
111 connect(d->mModel, &QAbstractItemModel::rowsAboutToBeInserted, this, &StorageModel::rowsAboutToBeInserted);
113 connect(d->mModel, &QAbstractItemModel::rowsAboutToBeRemoved, this, &StorageModel::rowsAboutToBeRemoved);
163 if (c.hasAttribute<MessageFolderAttribute>() && c.attribute<MessageFolderAttribute>()->isOutboundFolder()) {
199bool MessageList::StorageModel::initializeMessageItem(MessageList::Core::MessageItem *mi, int row, bool bUseReceiver) const
219 static const QString noSubject = i18nc("displayed as subject when the subject of a mail is empty", "No Subject");
220 static const QString unknown(i18nc("displayed when a mail has unknown sender, receiver or date", "Unknown"));
229 mi->initialSetup(mail->date()->dateTime().toSecsSinceEpoch(), item.size(), sender, receiver, bUseReceiver);
283 c.addData(QByteArrayView(reinterpret_cast<const char *>(trimmed.utf16()), sizeof(QStringView::storage_type) * trimmed.length()));
287void MessageList::StorageModel::fillMessageItemThreadingData(MessageList::Core::MessageItem *mi, int row, ThreadingDataSubset subset) const
325void MessageList::StorageModel::updateMessageItemData(MessageList::Core::MessageItem *mi, int row) const
384QModelIndex MessageList::StorageModel::index(int row, int column, const QModelIndex &parent) const
406QMimeData *MessageList::StorageModel::mimeData(const QList<MessageList::Core::MessageItem *> &items) const
421void MessageList::StorageModel::StorageModelPrivate::onSourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
450 Core::MessageItem::setImportantMessageFont(QFontDatabase::systemFont(QFontDatabase::GeneralFont));
462 return d->mModel->data(d->mModel->index(row, 0), EntityTreeModel::ItemRole).value<Akonadi::Item>();
490Akonadi::Collection MessageList::StorageModel::collectionForId(Akonadi::Collection::Id colId) const
qint64 unreadCount() const
qint64 Id
static QString mimeType()
CollectionStatistics statistics() const
bool isValid() const
QString displayName() const
const T * attribute() const
Collection & parentCollection()
bool hasAttribute() const
Id id() const
ItemListHeaders
static QModelIndex modelIndexForCollection(const QAbstractItemModel *model, const Collection &collection)
CollectionRole
qint64 size() const
QString mimeType() const
T payload() const
QUrl url(UrlType type=UrlShort) const
Flags flags() const
Id id() const
Collection::Id storageCollectionId() const
QString remoteId() const
void setFlags(const Flags &flags)
bool hasPayload() const
UrlWithMimeType
bool isOutboundFolder() const
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:551
void setStatus(Akonadi::MessageStatus status)
Sets the status associated to this Item.
Definition item.cpp:451
void setSubject(const QString &subject)
Sets the subject associated to this Item.
Definition item.cpp:536
void setFolder(const QString &folder)
Sets the folder associated to this Item.
Definition item.cpp:546
Compact storage of the result of an MD5 hash computation, for use in the threading code.
Definition md5hash.h:18
ThreadingDataSubset
Definition storagemodelbase.h:78
The Akonadi specific implementation of the Core::StorageModel.
Definition storagemodel.h:36
int initialUnreadRowCountGuess() const override
Returns (a guess for) the number of unread messages: must be pessimistic (i.e.
Definition storagemodel.cpp:183
void setMessageItemStatus(MessageList::Core::MessageItem *mi, int row, Akonadi::MessageStatus status) override
This method should use the inner model implementation to associate the new status to the specified me...
Definition storagemodel.cpp:350
void fillMessageItemThreadingData(MessageList::Core::MessageItem *mi, int row, ThreadingDataSubset subset) const override
This method should use the inner model implementation to fill in the specified subset of threading da...
Definition storagemodel.cpp:287
bool containsOutboundMessages() const override
Returns true if this StorageModel (folder) contains outbound messages and false otherwise.
Definition storagemodel.cpp:169
StorageModel(QAbstractItemModel *model, QItemSelectionModel *selectionModel, QObject *parent=nullptr)
Create a StorageModel wrapping the specified folder.
Definition storagemodel.cpp:77
void updateMessageItemData(MessageList::Core::MessageItem *mi, int row) const override
This method should use the inner model implementation to re-fill the date, the status,...
Definition storagemodel.cpp:325
QString id() const override
Returns an unique id for this Storage collection.
Definition storagemodel.cpp:144
bool initializeMessageItem(MessageList::Core::MessageItem *mi, int row, bool bUseReceiver) const override
This method should use the inner model implementation to fill in the base data for the specified Mess...
Definition storagemodel.cpp:199
QMimeData * mimeData(const QList< MessageList::Core::MessageItem * > &) const override
The implementation-specific mime data for this list of items.
Definition storagemodel.cpp:406
Q_SCRIPTABLE CaptureState status()
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString stripOffPrefixes(const QString &subject)
Removes the forward and reply marks (e.g.
Definition stringutil.cpp:785
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles)
void layoutAboutToBeChanged(const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
void layoutChanged(const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
void modelAboutToBeReset()
void modelReset()
void rowsAboutToBeInserted(const QModelIndex &parent, int start, int end)
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
void rowsInserted(const QModelIndex &parent, int first, int last)
void rowsRemoved(const QModelIndex &parent, int first, int last)
bool testAndSetAcquire(T expectedValue, T newValue)
QByteArrayView trimmed() const const
GeneralFont
QFont systemFont(SystemFont type)
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
qsizetype count() const const
void reserve(qsizetype size)
const char * className() const const
QVariant data(int role) const const
bool isValid() const const
QModelIndex parent() const const
int row() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
virtual const QMetaObject * metaObject() const const
QObject * parent() const const
virtual void setSourceModel(QAbstractItemModel *sourceModel) override
void chop(qsizetype n)
bool isEmpty() const const
QString number(double n, char format, int precision)
QString join(QChar separator) const const
void sort(Qt::CaseSensitivity cs)
storage_type
QStringView trimmed() const const
Horizontal
T value() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.