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

messagelist

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

#include <item_p.h>

Inheritance diagram for MessageList::Core::ItemPrivate:
Inheritance graph
[legend]

Public Member Functions

 ItemPrivate (Item *owner)
 
virtual ~ItemPrivate ()
 
void childItemDead (Item *child)
 
template<class ItemComparator , bool bAscending>
bool childItemNeedsReSorting (Item *child)
 
template<class ItemComparator , bool bAscending>
int GCC_DONT_INLINE_THIS insertChildItem (Model *model, Item *child)
 

Public Attributes

QList< Item * > * mChildItems
 
time_t mDate
 
Item::InitialExpandStatus mInitialExpandStatus: 4
 
bool mIsViewable: 1
 
qint64 mItemId
 
time_t mMaxDate
 
Item * mParent
 
QString mReceiver
 
QString mSender
 
size_t mSize
 
Akonadi::MessageStatus mStatus
 
QString mSubject
 
int mThisItemIndexGuess
 
Item::Type mType: 4
 
bool mUseReceiver: 1
 
Item *const q
 

Detailed Description

Definition at line 41 of file item_p.h.

Constructor & Destructor Documentation

MessageList::Core::ItemPrivate::ItemPrivate ( Item *  owner)
inlineexplicit

Definition at line 44 of file item_p.h.

virtual MessageList::Core::ItemPrivate::~ItemPrivate ( )
inlinevirtual

Definition at line 54 of file item_p.h.

Member Function Documentation

void ItemPrivate::childItemDead ( Item *  child)

Internal handler for managing the children list.

Definition at line 604 of file item.cpp.

template<class ItemComparator , bool bAscending>
bool MessageList::Core::ItemPrivate::childItemNeedsReSorting ( Item *  child)
inline

Checks if the specified child item is actually in the wrong position in the child list and returns true in that case.

Returns false if the item is already in the right position and no re-sorting is needed.

Definition at line 191 of file item_p.h.

template<class ItemComparator , bool bAscending>
int GCC_DONT_INLINE_THIS MessageList::Core::ItemPrivate::insertChildItem ( Model *  model,
Item *  child 
)
inline

Implements "in the middle" insertions of child items.

The template argument class must export a static inline bool firstGreaterOrEqual( Item *, Item * ) function which must return true when the first parameter item is considered to be greater or equal to the second parameter item and false otherwise.

The insertion function IS our very bottleneck on flat views (when there are items with a lot of children). This is somewhat pathological... beside the binary search based insertion sort we actually can only do "statement level" optimization. I've found no better algorithms so far. If someone has a clever idea, please write to pragma at kvirc dot net :)

GCC_DONT_INLINE_THIS is a macro defined above to attribute((noinline)) if the current compiler is gcc. Without this attribute gcc attempts to inline THIS function inside the callers. The problem is that while inlining this function it doesn't inline the INNER comparison functions (which we WANT to be inlined) because they would make the caller function too big.

This is what gcc reports with -Winline:

/home/pragma/kmail-soc/kmail/messagelistview/item.h:352: warning: inlining failed in call to 'static bool MessageList::ItemSubjectComparator::firstGreaterOrEqual(MessageList::Item*, MessageList::Item*)': –param large-function-growth limit reached while inlining the caller /home/pragma/kmail-soc/kmail/messagelistview/model.cpp:239: warning: called from here

The comparison functions then appear in the symbol table:

etherea kmail # nm /usr/kde/4.0/lib/libkmailprivate.so | grep Comparator 00000000005d2c10 W ZN5KMail15MessageList18ItemDateComparator19firstGreaterOrEqualEPNS0_4ItemES3 00000000005d2cb0 W ZN5KMail15MessageList20ItemSenderComparator19firstGreaterOrEqualEPNS0_4ItemES3 00000000005d2c50 W ZN5KMail15MessageList21ItemSubjectComparator19firstGreaterOrEqualEPNS0_4ItemES3 ...

With this attribute, instead, gcc doesn't complain at all and the inner comparisons seem to be inlined correctly (there is no sign of them in the symbol table).

Definition at line 92 of file item_p.h.

Member Data Documentation

QList< Item * >* MessageList::Core::ItemPrivate::mChildItems

List of children, may be 0.

Definition at line 238 of file item_p.h.

time_t MessageList::Core::ItemPrivate::mDate

The date of the message (or group date)

Definition at line 241 of file item_p.h.

Item::InitialExpandStatus MessageList::Core::ItemPrivate::mInitialExpandStatus

The expand status we have to honor when we attach to the viewable root.

Definition at line 250 of file item_p.h.

bool MessageList::Core::ItemPrivate::mIsViewable

Is this item attacched to the viewable root ?

Definition at line 251 of file item_p.h.

qint64 MessageList::Core::ItemPrivate::mItemId

The Akonadi item id.

Definition at line 248 of file item_p.h.

time_t MessageList::Core::ItemPrivate::mMaxDate

The maximum date in the subtree.

Definition at line 240 of file item_p.h.

Item* MessageList::Core::ItemPrivate::mParent

The parent view item.

Definition at line 239 of file item_p.h.

QString MessageList::Core::ItemPrivate::mReceiver

The receiver of the message (or group receiver)

Definition at line 244 of file item_p.h.

QString MessageList::Core::ItemPrivate::mSender

The sender of the message (or group sender)

Definition at line 243 of file item_p.h.

size_t MessageList::Core::ItemPrivate::mSize

The size of the message in bytes.

Definition at line 242 of file item_p.h.

Akonadi::MessageStatus MessageList::Core::ItemPrivate::mStatus

The status of the message (may be extended to groups in the future)

Definition at line 247 of file item_p.h.

QString MessageList::Core::ItemPrivate::mSubject

The subject of the message (or group subject)

Definition at line 246 of file item_p.h.

int MessageList::Core::ItemPrivate::mThisItemIndexGuess

The guess for the index in the parent's child list.

Definition at line 245 of file item_p.h.

Item::Type MessageList::Core::ItemPrivate::mType

The type of this item.

Definition at line 249 of file item_p.h.

bool MessageList::Core::ItemPrivate::mUseReceiver

senderOrReceiver() returns receiver rather than sender

Definition at line 252 of file item_p.h.

Item* const MessageList::Core::ItemPrivate::q

Definition at line 236 of file item_p.h.


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