Messagelib
storagemodel.cpp
67 qCWarning(MESSAGELIST_LOG) << "Not a message" << item.id() << item.remoteId() << item.mimeType();
76MessageList::StorageModel::StorageModel(QAbstractItemModel *model, QItemSelectionModel *selectionModel, QObject *parent)
100 connect(d->mModel, &QAbstractItemModel::dataChanged, this, [this](const QModelIndex &id1, const QModelIndex &id2) {
104 connect(d->mModel, &QAbstractItemModel::layoutAboutToBeChanged, this, &StorageModel::layoutAboutToBeChanged);
106 connect(d->mModel, &QAbstractItemModel::modelAboutToBeReset, this, &StorageModel::modelAboutToBeReset);
110 connect(d->mModel, &QAbstractItemModel::rowsAboutToBeInserted, this, &StorageModel::rowsAboutToBeInserted);
112 connect(d->mModel, &QAbstractItemModel::rowsAboutToBeRemoved, this, &StorageModel::rowsAboutToBeRemoved);
162 if (c.hasAttribute<MessageFolderAttribute>() && c.attribute<MessageFolderAttribute>()->isOutboundFolder()) {
198bool MessageList::StorageModel::initializeMessageItem(MessageList::Core::MessageItem *mi, int row, bool bUseReceiver) const
218 static const QString noSubject = i18nc("displayed as subject when the subject of a mail is empty", "No Subject");
219 static const QString unknown(i18nc("displayed when a mail has unknown sender, receiver or date", "Unknown"));
228 mi->initialSetup(mail->date()->dateTime().toSecsSinceEpoch(), item.size(), sender, receiver, bUseReceiver);
280 c.addData(QByteArrayView(reinterpret_cast<const char *>(trimmed.unicode()), sizeof(QChar) * trimmed.length()));
284void MessageList::StorageModel::fillMessageItemThreadingData(MessageList::Core::MessageItem *mi, int row, ThreadingDataSubset subset) const
322void MessageList::StorageModel::updateMessageItemData(MessageList::Core::MessageItem *mi, int row) const
381QModelIndex MessageList::StorageModel::index(int row, int column, const QModelIndex &parent) const
403QMimeData *MessageList::StorageModel::mimeData(const QList<MessageList::Core::MessageItem *> &items) const
418void MessageList::StorageModel::StorageModelPrivate::onSourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
447 Core::MessageItem::setImportantMessageFont(QFontDatabase::systemFont(QFontDatabase::GeneralFont));
459 return d->mModel->data(d->mModel->index(row, 0), EntityTreeModel::ItemRole).value<Akonadi::Item>();
487Akonadi::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
QUrl url(UrlType type=UrlShort) const
Flags flags() const
bool hasPayload() const
Id id() const
T payload() const
Collection::Id storageCollectionId() const
QString remoteId() const
void setFlags(const Flags &flags)
UrlWithMimeType
bool isOutboundFolder() const
void setSourceModel(QAbstractItemModel *sourceModel) override
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
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:182
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:347
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:284
bool containsOutboundMessages() const override
Returns true if this StorageModel (folder) contains outbound messages and false otherwise.
Definition storagemodel.cpp:168
StorageModel(QAbstractItemModel *model, QItemSelectionModel *selectionModel, QObject *parent=nullptr)
Create a StorageModel wrapping the specified folder.
Definition storagemodel.cpp:76
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:322
QString id() const override
Returns an unique id for this Storage collection.
Definition storagemodel.cpp:143
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:198
QMimeData * mimeData(const QList< MessageList::Core::MessageItem * > &) const override
The implementation-specific mime data for this list of items.
Definition storagemodel.cpp:403
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)
QByteArray 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 trimmed() const const
QString join(QChar separator) const const
void sort(Qt::CaseSensitivity cs)
Horizontal
T value() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.