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

messagelist

  • MessageList
  • Core
  • ModelPrivate
Public Types | Public Member Functions | Public Attributes | List of all members
MessageList::Core::ModelPrivate Class Reference

#include <model_p.h>

Public Types

enum  PropertyChanges {
  DateChanged = 1, MaxDateChanged = (1 << 1), ActionItemStatusChanged = (1 << 2), UnreadStatusChanged = (1 << 3),
  ImportantStatusChanged = (1 << 4)
}
 
enum  ViewItemJobResult { ViewItemJobCompleted, ViewItemJobInterrupted }
 

Public Member Functions

 ModelPrivate (Model *owner)
 
void addMessageToSubjectBasedThreadingCache (MessageItem *mi)
 
bool applyFilterToSubtree (Item *item, const QModelIndex &parentIndex)
 
void attachGroup (GroupHeaderItem *ghi)
 
void attachMessageToGroupHeader (MessageItem *mi)
 
void attachMessageToParent (Item *pParent, MessageItem *mi)
 
void checkIfDateChanged ()
 
void clear ()
 
void clearJobList ()
 
void clearOrphanChildrenHash ()
 
void clearThreadingCacheMessageSubjectMD5ToMessageItem ()
 
void clearUnassignedMessageLists ()
 
void fillView ()
 
MessageItem * findMessageParent (MessageItem *mi)
 
MessageItem * guessMessageParent (MessageItem *mi)
 
bool handleItemPropertyChanges (int propertyChangeMask, Item *parent, Item *item)
 
void messageDetachedUpdateParentProperties (Item *oldParent, MessageItem *mi)
 
void propagateItemPropertiesToParent (Item *item)
 
void removeMessageFromSubjectBasedThreadingCache (MessageItem *mi)
 
void saveExpandedStateOfSubtree (Item *root)
 
void slotApplyFilter ()
 
void slotStorageModelDataChanged (const QModelIndex &fromIndex, const QModelIndex &toIndex)
 
void slotStorageModelHeaderDataChanged (Qt::Orientation orientation, int first, int last)
 
void slotStorageModelLayoutChanged ()
 
void slotStorageModelRowsInserted (const QModelIndex &parent, int from, int to)
 
void slotStorageModelRowsRemoved (const QModelIndex &parent, int from, int to)
 
void syncExpandedStateOfSubtree (Item *root)
 
void viewItemJobStep ()
 
ViewItemJobResult viewItemJobStepInternal ()
 
ViewItemJobResult viewItemJobStepInternalForJob (ViewItemJob *job, const QTime &tStart)
 
ViewItemJobResult viewItemJobStepInternalForJobPass1Cleanup (ViewItemJob *job, const QTime &tStart)
 
ViewItemJobResult viewItemJobStepInternalForJobPass1Fill (ViewItemJob *job, const QTime &tStart)
 
ViewItemJobResult viewItemJobStepInternalForJobPass1Update (ViewItemJob *job, const QTime &tStart)
 
ViewItemJobResult viewItemJobStepInternalForJobPass2 (ViewItemJob *job, const QTime &tStart)
 
ViewItemJobResult viewItemJobStepInternalForJobPass3 (ViewItemJob *job, const QTime &tStart)
 
ViewItemJobResult viewItemJobStepInternalForJobPass4 (ViewItemJob *job, const QTime &tStart)
 
ViewItemJobResult viewItemJobStepInternalForJobPass5 (ViewItemJob *job, const QTime &tStart)
 

Public Attributes

const Aggregation * mAggregation
 
QString mCachedFiveWeeksAgoLabel
 
QString mCachedFourWeeksAgoLabel
 
QString mCachedLastWeekLabel
 
QString mCachedThreeWeeksAgoLabel
 
QString mCachedTodayLabel
 
QString mCachedTwoWeeksAgoLabel
 
QString mCachedUnknownLabel
 
qint32 mCachedWatchedOrIgnoredStatusBits
 
QString mCachedYesterdayLabel
 
Item * mCurrentItemToRestoreAfterViewItemJobStep
 
QTimer mFillStepTimer
 
const Filter * mFilter
 
QHash< QString, GroupHeaderItem * > mGroupHeaderItemHash
 
QHash< GroupHeaderItem
*, GroupHeaderItem * > 
mGroupHeadersThatNeedUpdate
 
bool mInLengthyJobBatch
 
ModelInvariantRowMapper * mInvariantRowMapper
 
MessageItem * mLastSelectedMessageInFolder
 
bool mLoading
 
Model * mModelForItemFunctions
 
MessageItem * mNewestItem
 
MessageItem * mOldestItem
 
QHash< MessageItem
*, MessageItem * > 
mOrphanChildrenHash
 
MessageItemSetManager * mPersistentSetManager
 
PreSelectionMode mPreSelectionMode
 
int mRecursionCounterForReset
 
Item * mRootItem
 
const SortOrder * mSortOrder
 
StorageModel * mStorageModel
 
bool mStorageModelContainsOutboundMessages
 
const Theme * mTheme
 
QHash< QByteArray, MessageItem * > mThreadingCacheMessageIdMD5ToMessageItem
 
QMultiHash< QByteArray,
MessageItem * > 
mThreadingCacheMessageInReplyToIdMD5ToMessageItem
 
QHash< QByteArray, QList
< MessageItem * > * > 
mThreadingCacheMessageSubjectMD5ToMessageItem
 
QDate mTodayDate
 
QList< MessageItem * > mUnassignedMessageListForPass2
 
QList< MessageItem * > mUnassignedMessageListForPass3
 
QList< MessageItem * > mUnassignedMessageListForPass4
 
View * mView
 
QList< ViewItemJob * > mViewItemJobs
 
int mViewItemJobStepChunkTimeout
 
int mViewItemJobStepIdleInterval
 
int mViewItemJobStepMessageCheckCount
 
time_t mViewItemJobStepStartTime
 
Model *const q
 

Detailed Description

Definition at line 33 of file model_p.h.

Member Enumeration Documentation

enum MessageList::Core::ModelPrivate::PropertyChanges
Enumerator
DateChanged 
MaxDateChanged 
ActionItemStatusChanged 
UnreadStatusChanged 
ImportantStatusChanged 

Definition at line 113 of file model_p.h.

enum MessageList::Core::ModelPrivate::ViewItemJobResult
Enumerator
ViewItemJobCompleted 
ViewItemJobInterrupted 

Definition at line 69 of file model_p.h.

Constructor & Destructor Documentation

MessageList::Core::ModelPrivate::ModelPrivate ( Model *  owner)
inline

Definition at line 36 of file model_p.h.

Member Function Documentation

void ModelPrivate::addMessageToSubjectBasedThreadingCache ( MessageItem *  mi)

Definition at line 1540 of file model.cpp.

bool ModelPrivate::applyFilterToSubtree ( Item *  item,
const QModelIndex &  parentIndex 
)

Recursively applies the current filter to the tree originating at the specified item.

The item is hidden if the filter doesn't match (the item or any children of it) and this function returns false. If the filter matches somewhere in the subtree then the item isn't hidden and this function returns true.

Assumes that the specified item is viewable.

Definition at line 377 of file model.cpp.

void ModelPrivate::attachGroup ( GroupHeaderItem *  ghi)

Definition at line 1087 of file model.cpp.

void ModelPrivate::attachMessageToGroupHeader ( MessageItem *  mi)

Definition at line 1214 of file model.cpp.

void ModelPrivate::attachMessageToParent ( Item *  pParent,
MessageItem *  mi 
)

Definition at line 1987 of file model.cpp.

void ModelPrivate::checkIfDateChanged ( )

This is called by MessageList::Manager once in a while.

It is a good place to check if the date has changed and trigger a view reload.

Definition at line 871 of file model.cpp.

void ModelPrivate::clear ( )

Definition at line 628 of file model.cpp.

void ModelPrivate::clearJobList ( )

Definition at line 1066 of file model.cpp.

void ModelPrivate::clearOrphanChildrenHash ( )

Definition at line 1054 of file model.cpp.

void ModelPrivate::clearThreadingCacheMessageSubjectMD5ToMessageItem ( )

Definition at line 1048 of file model.cpp.

void ModelPrivate::clearUnassignedMessageLists ( )

Definition at line 919 of file model.cpp.

void MessageList::Core::ModelPrivate::fillView ( )
MessageItem * ModelPrivate::findMessageParent ( MessageItem *  mi)

Attempt to find the threading parent for the specified message item.

Sets the message threading status to the appropriate value.

This function performs In-Reply-To and References threading.

Definition at line 1376 of file model.cpp.

MessageItem * ModelPrivate::guessMessageParent ( MessageItem *  mi)

Attempt to find the threading parent for the specified message item.

Sets the message threading status to the appropriate value.

This function performs Subject based threading.

Definition at line 1603 of file model.cpp.

bool ModelPrivate::handleItemPropertyChanges ( int  propertyChangeMask,
Item *  parent,
Item *  item 
)

Handle the specified property changes in item.

Depending on the item position inside the parent and the types of item and parent the item might need re-grouping or re-sorting. This function takes care of that. It is meant to be called from somewhere inside viewItemJobStepInternal() as it postpones group updates to Pass5.

parent and item must not be null. propertyChangeMask should not be zero.

Return true if parent might be affected by the item property changes and false otherwise.

Definition at line 1715 of file model.cpp.

void ModelPrivate::messageDetachedUpdateParentProperties ( Item *  oldParent,
MessageItem *  mi 
)

Definition at line 1892 of file model.cpp.

void ModelPrivate::propagateItemPropertiesToParent ( Item *  item)

This one checks if the parent of item requires an update due to the properties of item (that might have been changed or the item might have been simply added to the parent).

The properties are propagated up to the root item. As optimization we ASSUME that the item->parent() exists (is non 0) and is NOT the root item. Be sure to check it before calling this function (it will assert in debug mode anyway). ... ah... and don't be afraid: this is NOT (directly) recursive :)

Definition at line 1942 of file model.cpp.

void ModelPrivate::removeMessageFromSubjectBasedThreadingCache ( MessageItem *  mi)

Definition at line 1570 of file model.cpp.

void ModelPrivate::saveExpandedStateOfSubtree ( Item *  root)

Save the expanded state of the subtree with the specified root.

The state will be saved in the initialExpandStatus() variable. For optimization purposes the specified root is assumed to be expanded and viewable.

Definition at line 1162 of file model.cpp.

void ModelPrivate::slotApplyFilter ( )

Definition at line 361 of file model.cpp.

void ModelPrivate::slotStorageModelDataChanged ( const QModelIndex &  fromIndex,
const QModelIndex &  toIndex 
)

Definition at line 4420 of file model.cpp.

void ModelPrivate::slotStorageModelHeaderDataChanged ( Qt::Orientation  orientation,
int  first,
int  last 
)

Definition at line 4474 of file model.cpp.

void ModelPrivate::slotStorageModelLayoutChanged ( )

Definition at line 4412 of file model.cpp.

void ModelPrivate::slotStorageModelRowsInserted ( const QModelIndex &  parent,
int  from,
int  to 
)

Definition at line 4105 of file model.cpp.

void ModelPrivate::slotStorageModelRowsRemoved ( const QModelIndex &  parent,
int  from,
int  to 
)

Definition at line 4237 of file model.cpp.

void ModelPrivate::syncExpandedStateOfSubtree ( Item *  root)

Sync the expanded state of the subtree with the specified root.

This will cause the items that are marked with Item::ExpandNeeded to be expanded also in the view. For optimization purposes the specified root is assumed to be marked as Item::ExpandNeeded so be sure to check it before calling this function.

Definition at line 1184 of file model.cpp.

void ModelPrivate::viewItemJobStep ( )

Definition at line 3874 of file model.cpp.

ModelPrivate::ViewItemJobResult ModelPrivate::viewItemJobStepInternal ( )

Definition at line 3666 of file model.cpp.

ModelPrivate::ViewItemJobResult ModelPrivate::viewItemJobStepInternalForJob ( ViewItemJob *  job,
const QTime &  tStart 
)

Definition at line 3333 of file model.cpp.

ModelPrivate::ViewItemJobResult ModelPrivate::viewItemJobStepInternalForJobPass1Cleanup ( ViewItemJob *  job,
const QTime &  tStart 
)

Definition at line 2934 of file model.cpp.

ModelPrivate::ViewItemJobResult ModelPrivate::viewItemJobStepInternalForJobPass1Fill ( ViewItemJob *  job,
const QTime &  tStart 
)

Definition at line 2654 of file model.cpp.

ModelPrivate::ViewItemJobResult ModelPrivate::viewItemJobStepInternalForJobPass1Update ( ViewItemJob *  job,
const QTime &  tStart 
)

Definition at line 3185 of file model.cpp.

ModelPrivate::ViewItemJobResult ModelPrivate::viewItemJobStepInternalForJobPass2 ( ViewItemJob *  job,
const QTime &  tStart 
)

Definition at line 2544 of file model.cpp.

ModelPrivate::ViewItemJobResult ModelPrivate::viewItemJobStepInternalForJobPass3 ( ViewItemJob *  job,
const QTime &  tStart 
)

Definition at line 2451 of file model.cpp.

ModelPrivate::ViewItemJobResult ModelPrivate::viewItemJobStepInternalForJobPass4 ( ViewItemJob *  job,
const QTime &  tStart 
)

Definition at line 2402 of file model.cpp.

ModelPrivate::ViewItemJobResult ModelPrivate::viewItemJobStepInternalForJobPass5 ( ViewItemJob *  job,
const QTime &  tStart 
)

Definition at line 2294 of file model.cpp.

Member Data Documentation

const Aggregation* MessageList::Core::ModelPrivate::mAggregation

The currently set aggregation mode: shallow pointer set by Widget.

Definition at line 182 of file model_p.h.

QString MessageList::Core::ModelPrivate::mCachedFiveWeeksAgoLabel

The label for the "Five Weeks Ago" group item, cached, so we don't translate it multiple times.

Definition at line 342 of file model_p.h.

QString MessageList::Core::ModelPrivate::mCachedFourWeeksAgoLabel

The label for the "Four Weeks Ago" group item, cached, so we don't translate it multiple times.

Definition at line 337 of file model_p.h.

QString MessageList::Core::ModelPrivate::mCachedLastWeekLabel

The label for the "Last Week" group item, cached, so we don't translate it multiple times.

Definition at line 322 of file model_p.h.

QString MessageList::Core::ModelPrivate::mCachedThreeWeeksAgoLabel

The label for the "Three Weeks Ago" group item, cached, so we don't translate it multiple times.

Definition at line 332 of file model_p.h.

QString MessageList::Core::ModelPrivate::mCachedTodayLabel

The label for the "Today" group item, cached, so we don't translate it multiple times.

Definition at line 307 of file model_p.h.

QString MessageList::Core::ModelPrivate::mCachedTwoWeeksAgoLabel

The label for the "Two Weeks Ago" group item, cached, so we don't translate it multiple times.

Definition at line 327 of file model_p.h.

QString MessageList::Core::ModelPrivate::mCachedUnknownLabel

The label for the "Unknown" group item, cached, so we don't translate it multiple times.

Definition at line 317 of file model_p.h.

qint32 MessageList::Core::ModelPrivate::mCachedWatchedOrIgnoredStatusBits

Cached bits that we use for fast status checks.

Definition at line 347 of file model_p.h.

QString MessageList::Core::ModelPrivate::mCachedYesterdayLabel

The label for the "Yesterday" group item, cached, so we don't translate it multiple times.

Definition at line 312 of file model_p.h.

Item* MessageList::Core::ModelPrivate::mCurrentItemToRestoreAfterViewItemJobStep

We need to save the current item before each job step.

This is because our job may cause items to be reparented (thus removed and readded with the current Qt API) and QTreeView will loose the current setting. We also use this to force the current to a specific item after a cleanup job.

Definition at line 361 of file model_p.h.

QTimer MessageList::Core::ModelPrivate::mFillStepTimer

The timer involved in breaking the "fill" operation in steps.

Definition at line 202 of file model_p.h.

const Filter* MessageList::Core::ModelPrivate::mFilter

The filter to apply on messages.

Shallow. Never 0.

Definition at line 197 of file model_p.h.

QHash< QString, GroupHeaderItem * > MessageList::Core::ModelPrivate::mGroupHeaderItemHash

Group Key (usually the label) -> GroupHeaderItem, used to quickly find groups, pointers are shallow copies.

Definition at line 207 of file model_p.h.

QHash< GroupHeaderItem *, GroupHeaderItem * > MessageList::Core::ModelPrivate::mGroupHeadersThatNeedUpdate

List of group headers that either need to be re-sorted or must be removed because empty.

Definition at line 230 of file model_p.h.

bool MessageList::Core::ModelPrivate::mInLengthyJobBatch

Flag signaling a possibly long job batch.

This is checked by other classes and used to display some kind of "please wait" feedback to the user.

Definition at line 353 of file model_p.h.

ModelInvariantRowMapper* MessageList::Core::ModelPrivate::mInvariantRowMapper

Our mighty ModelInvariantRowMapper: used to workaround an issue related to the Model/View architecture.

See also
ModelInvariantRowMapper

Definition at line 302 of file model_p.h.

MessageItem* MessageList::Core::ModelPrivate::mLastSelectedMessageInFolder

The id of the preselected ;essage is "translated" to a message pointer when it's fetched from the storage.

This message is then selected when it becomes viewable (so at the end of the job). 0 if we have no message to select.

See also setStorageModel() and abortMessagePreSelection()

Definition at line 395 of file model_p.h.

bool MessageList::Core::ModelPrivate::mLoading

Set to true in the first large loading job.

Reset to false when the job finishes.

Please note that this is NOT set for later jobs: only for the first (possibly huge) one.

Definition at line 369 of file model_p.h.

Model* MessageList::Core::ModelPrivate::mModelForItemFunctions

This pointer is passed to the Item functions that insert children.

When we work with disconnected UI this pointer becomes 0.

Definition at line 415 of file model_p.h.

MessageItem* MessageList::Core::ModelPrivate::mNewestItem

Definition at line 386 of file model_p.h.

MessageItem* MessageList::Core::ModelPrivate::mOldestItem

Definition at line 385 of file model_p.h.

QHash< MessageItem *, MessageItem * > MessageList::Core::ModelPrivate::mOrphanChildrenHash

Hash of orphan children used in Pass1Cleanup.

Definition at line 250 of file model_p.h.

MessageItemSetManager* MessageList::Core::ModelPrivate::mPersistentSetManager

The "persistent message item sets" are (guess what?) sets of messages that can be referenced globally via a persistent id.

The MessageItemSetManager and this class keep the persistent sets coherent: messages that are deleted are automatically removed from all the sets.

Users of this class typically create persistent sets when they start an asynchronous job and they query them back on the way or when the job is terminated.

So mPersistentSetManager is in fact the manager for the outstanding "user" jobs. 0 if no jobs are pending (so there are no persistent sets at the moment).

Definition at line 409 of file model_p.h.

PreSelectionMode MessageList::Core::ModelPrivate::mPreSelectionMode

Pre-selection is the action of automatically selecting a message just after the folder has finished loading.

We may want to select the message that was selected the last time this folder has been open, or we may want to select the first unread message. We also may want to do no pre-selection at all (for example, when the user starts navigating the view before the pre-selection could actually be made and pre-selecting would confuse him). This member holds the option.

See also setStorageModel() and abortMessagePreSelection()

Definition at line 381 of file model_p.h.

int MessageList::Core::ModelPrivate::mRecursionCounterForReset

counter to avoid infinite recursions in the setStorageModel() function

Definition at line 172 of file model_p.h.

Item* MessageList::Core::ModelPrivate::mRootItem

Owned invisible root item, useful to implement algorithms that not need to handle the special case of parentless items.

This is never 0.

Definition at line 267 of file model_p.h.

const SortOrder* MessageList::Core::ModelPrivate::mSortOrder

The currently used sort order.

Pointer not owned by us, but by the Widget.

Definition at line 192 of file model_p.h.

StorageModel* MessageList::Core::ModelPrivate::mStorageModel

The currently set storage model: shallow pointer.

Definition at line 177 of file model_p.h.

bool MessageList::Core::ModelPrivate::mStorageModelContainsOutboundMessages

The cached result of StorageModel::containsOutboundMessages().

We access this property at each incoming message and StorageModel::containsOutboundMessages() is virtual (so it's always an indirect function call). Caching makes sense.

Definition at line 422 of file model_p.h.

const Theme* MessageList::Core::ModelPrivate::mTheme

The currently used theme: shallow pointer.

Definition at line 187 of file model_p.h.

QHash< QByteArray, MessageItem * > MessageList::Core::ModelPrivate::mThreadingCacheMessageIdMD5ToMessageItem

Threading cache.

MessageIdMD5 -> MessageItem, pointers are shallow copies

Definition at line 213 of file model_p.h.

QMultiHash< QByteArray, MessageItem * > MessageList::Core::ModelPrivate::mThreadingCacheMessageInReplyToIdMD5ToMessageItem

Threading cache.

MessageInReplyToIdMD5 -> MessageItem, pointers are shallow copies

Definition at line 219 of file model_p.h.

QHash< QByteArray, QList< MessageItem * > * > MessageList::Core::ModelPrivate::mThreadingCacheMessageSubjectMD5ToMessageItem

Threading cache.

SubjectMD5 -> MessageItem, pointers are shallow copies

Definition at line 225 of file model_p.h.

QDate MessageList::Core::ModelPrivate::mTodayDate

The today's date.

Set when the StorageModel is set and thus grouping is performed. This is used to put the today's messages in the "Today" group, for instance.

Definition at line 261 of file model_p.h.

QList< MessageItem * > MessageList::Core::ModelPrivate::mUnassignedMessageListForPass2

List of unassigned messages, used to handle threading in two passes, pointers are owned!

Definition at line 235 of file model_p.h.

QList< MessageItem * > MessageList::Core::ModelPrivate::mUnassignedMessageListForPass3

List of unassigned messages, used to handle threading in two passes, pointers are owned!

Definition at line 240 of file model_p.h.

QList< MessageItem * > MessageList::Core::ModelPrivate::mUnassignedMessageListForPass4

List of unassigned messages, used to handle threading in two passes, pointers are owned!

Definition at line 245 of file model_p.h.

View* MessageList::Core::ModelPrivate::mView

The view we're attacched to.

Shallow pointer (the View owns us).

Definition at line 272 of file model_p.h.

QList< ViewItemJob * > MessageList::Core::ModelPrivate::mViewItemJobs

Pending fill view jobs, pointers are owned.

Definition at line 255 of file model_p.h.

int MessageList::Core::ModelPrivate::mViewItemJobStepChunkTimeout

The timeout for a single ViewItemJob step.

Definition at line 283 of file model_p.h.

int MessageList::Core::ModelPrivate::mViewItemJobStepIdleInterval

The idle time between two ViewItemJob steps.

Definition at line 288 of file model_p.h.

int MessageList::Core::ModelPrivate::mViewItemJobStepMessageCheckCount

The number of messages we process at once in a ViewItemJob step without checking the timeouts above.

Definition at line 294 of file model_p.h.

time_t MessageList::Core::ModelPrivate::mViewItemJobStepStartTime

The time at the current ViewItemJob step started.

Used to compute the time we spent inside this step and eventually jump out on timeout.

Definition at line 278 of file model_p.h.

Model* const MessageList::Core::ModelPrivate::q

Definition at line 169 of file model_p.h.


The documentation for this class was generated from the following files:
  • model_p.h
  • model.cpp
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