messagelist
item.cpp
Go to the documentation of this file.
88 return d_ptr->mChildItems ? ( d_ptr->mChildItems->count() > 0 ? d_ptr->mChildItems->at( 0 ) : 0 ) : 0;
319 return d_ptr->mParent ? ( d_ptr->mParent == it ? true : d_ptr->mParent->hasAncestor( it ) ) : false;
344 //qDebug("BEGIN INSERT ROWS FOR PARENT %x: from %d to %d, (will) have %d children",this,0,tmp->count()-1,tmp->count());
361 // It seems that we can avoid removing child items here since the parent has been removed: this is a hack tough
385 delete d_ptr->mChildItems->first(); // this will call childDead() which will remove the child from the list
521 // FIXME: Try to "cache item insertions" and call beginInsertRows() and endInsertRows() in a chunked fashion...
538 model->beginInsertRows( model->index( this, 0 ), idx, idx ); // THIS IS EXTREMELY UGLY, BUT IT'S THE ONLY POSSIBLE WAY WITH QT4 AT THE TIME OF WRITING
542 model->endInsertRows(); // THIS IS EXTREMELY UGLY, BUT IT'S THE ONLY POSSIBLE WAY WITH QT4 AT THE TIME OF WRITING
554 QString out = QString::fromLatin1( "%1 %x VIEWABLE:%2" ).arg(prefix).arg(d_ptr->mIsViewable ? QLatin1String( "yes" ) : QLatin1String( "no" ));
static void append_string(QString &buffer, const QString &append)
Definition: item.cpp:206
Akonadi::MessageStatus mStatus
The status of the message (may be extended to groups in the future)
Definition: item_p.h:248
const KMime::DateFormatter * dateFormatter() const
Definition: manager.h:118
void childItemStats(ChildItemStats &stats) const
Gathers statistics about child items.
Definition: item.cpp:55
void rawAppendChildItem(Item *child)
Appends a child item without inserting it via the model.
Definition: item.cpp:523
void setIndexGuess(int index)
Sets the cached guess for the index of this item in the parent's child list.
Definition: item.cpp:187
qint64 mParentCollectionId
The Akonadi ID of collection that this particular item comes from (can be virtual collection) ...
Definition: item_p.h:247
const QString & senderOrReceiver() const
Returns the sender or the receiver, depending on the underlying StorageModel settings.
Definition: item.cpp:461
void setSize(size_t size)
Sets the size of this item (size of the Message, mainly)
Definition: item.cpp:416
QString formattedSize() const
A string with a text rappresentation of size().
Definition: item.cpp:254
Definition: item_p.h:41
const QString & cachedLocalizedUnknownText() const
Definition: manager.h:183
const QString & receiver() const
Returns the receiver associated to this item.
Definition: item.cpp:451
void setViewable(Model *model, bool bViewable)
Makes this item viewable, that is, notifies its existence to any listener attacched to the "rowsInser...
Definition: item.cpp:322
void setSubject(const QString &subject)
Sets the subject associated to this Item.
Definition: item.cpp:476
const QString & subject() const
Returns the subject associated to this Item.
Definition: item.cpp:471
unsigned int mUnreadChildCount
Definition: item.h:195
size_t size() const
Returns the size of this item (size of the Message, mainly)
Definition: item.cpp:411
bool recomputeMaxDate()
Recompute the maximum date from the current children list.
Definition: item.cpp:275
unsigned int mTotalChildCount
Definition: item.h:194
void setSubjectAndStatus(const QString &subject, const Akonadi::MessageStatus &status)
This is meant to be called right after the constructor for MessageItem objects.
Definition: item.cpp:514
This class manages the huge tree of displayable objects: GroupHeaderItems and MessageItems.
Definition: model.h:77
void setInitialExpandStatus(InitialExpandStatus initialExpandStatus)
Set the initial expand status we have to honor when attacching to the viewable root.
Definition: item.cpp:307
QString formattedMaxDate() const
A string with a text rappresentation of maxDate() obtained via Manager.
Definition: item.cpp:267
int appendChildItem(Model *model, Item *child)
Appends an Item to this item's child list.
Definition: item.cpp:530
int count(const T &value) const
void endInsertRows()
bool useReceiver() const
Returns whether sender or receiver is supposed to be displayed.
Definition: item.cpp:466
Item * itemAboveChild(Item *child)
Returns the item that is visually above the specified child if this item.
Definition: item.cpp:134
bool isEmpty() const
void beginRemoveRows(const QModelIndex &parent, int first, int last)
bool hasAncestor(const Item *it) const
Return true if Item pointed by it is an ancestor of this item (that is, if it is its parent...
Definition: item.cpp:317
void killAllChildItems()
Kills all the child items without emitting any signal, recursively.
Definition: item.cpp:379
Item * childItem(int idx) const
Returns the child item at position idx or 0 if idx is out of the allowable range. ...
Definition: item.cpp:75
InitialExpandStatus initialExpandStatus() const
The initial expand status we have to honor when attacching to the viewable root.
Definition: item.cpp:302
Item::InitialExpandStatus mInitialExpandStatus
The expand status we have to honor when we attach to the viewable root.
Definition: item_p.h:251
InitialExpandStatus
Specifies the initial expand status for the item that should be applied when it's attached to the vie...
Definition: item.h:73
QString formattedDate() const
A string with a text rappresentation of date() obtained via Manager.
Definition: item.cpp:259
This item is just Item and it's the only InvisibleRoot per Model.
Definition: item.h:65
A single item of the MessageList tree managed by MessageList::Model.
Definition: item.h:52
void setParentCollectionId(qint64 id)
Definition: item.cpp:504
void beginInsertRows(const QModelIndex &parent, int first, int last)
A structure used with MessageList::Item::childItemStats().
Definition: item.h:191
Item * itemBelow()
Returns the item that is visually below this item in the tree.
Definition: item.cpp:109
time_t maxDate() const
Returns the maximum date in the subtree originating from this item.
Definition: item.cpp:431
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: model.cpp:545
void setMaxDate(time_t date)
Sets the maximum date in the subtree originating from this item.
Definition: item.cpp:436
char * data()
Item * topmostNonRoot()
Returns the topmost parent item that is not a Root item (that is, is a Message or GroupHeader)...
Definition: item.cpp:192
Item * itemAbove()
Returns the item that is visually above this item in the tree.
Definition: item.cpp:149
QString fromLatin1(const char *str, int size)
Item * deepestItem()
Returns the deepest item in the subtree originating at this item.
Definition: item.cpp:123
const Akonadi::MessageStatus & status() const
Returns the status associated to this Item.
Definition: item.cpp:401
void takeChildItem(Model *model, Item *child)
Removes a child from this item's child list without deleting it.
Definition: item.cpp:568
void endRemoveRows()
QString statusDescription() const
Returns a string describing the status e.g: "Read, Forwarded, Important".
Definition: item.cpp:213
Item * parent() const
Returns the parent Item in the tree, or 0 if this item isn't attached to the tree.
Definition: item.cpp:391
bool hasChildren() const
Convenience function that returns true if this item has children.
Definition: item.cpp:168
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
qint64 parentCollectionId() const
Definition: item.cpp:509
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:481
Item * itemBelowChild(Item *child)
Returns the item that is visually below the specified child if this item.
Definition: item.cpp:91
void setReceiver(const QString &receiver)
Sets the sender associated to this item.
Definition: item.cpp:456
int indexOfChildItem(Item *item) const
Returns the actual index of the child Item item or -1 if item is not a child of this Item...
Definition: item.cpp:173
void childItemDead(Item *child)
Internal handler for managing the children list.
Definition: item.cpp:613
void setSender(const QString &sender)
Sets the sender associated to this item.
Definition: item.cpp:446
QByteArray toUtf8() const
void setStatus(const Akonadi::MessageStatus &status)
Sets the status associated to this Item.
Definition: item.cpp:406
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.