Messagelib
item.cpp
80 return d_ptr->mChildItems ? (d_ptr->mChildItems->count() > 0 ? d_ptr->mChildItems->at(0) : nullptr) : nullptr;
151 if (siblingAbove && siblingAbove != this && siblingAbove != d_ptr->mParent && siblingAbove->childItemCount() > 0) {
319 return Manager::instance()->dateFormatter()->dateString(QDateTime::fromSecsSinceEpoch(maxDate()));
364 return d_ptr->mParent ? (d_ptr->mParent == it ? true : d_ptr->mParent->hasAncestor(it)) : false;
388 // qDebug("BEGIN INSERT ROWS FOR PARENT %x: from %d to %d, (will) have %d children",this,0,tmp->count()-1,tmp->count());
405 // It seems that we can avoid removing child items here since the parent has been removed: this is a hack tough
429 delete d_ptr->mChildItems->first(); // this will call childDead() which will remove the child from the list
551 void MessageList::Core::Item::initialSetup(time_t date, size_t size, const QString &sender, const QString &receiver, bool useReceiver)
581 void MessageList::Core::Item::setSubjectAndStatus(const QString &subject, Akonadi::MessageStatus status)
587 // FIXME: Try to "cache item insertions" and call beginInsertRows() and endInsertRows() in a chunked fashion...
605 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
610 model->endInsertRows(); // THIS IS EXTREMELY UGLY, BUT IT'S THE ONLY POSSIBLE WAY WITH QT4 AT THE TIME OF WRITING
const QString & receiver() const
Returns the receiver associated to this item.
Definition: item.cpp:501
QString formattedDate() const
A string with a text rappresentation of date() obtained via Manager.
Definition: item.cpp:305
size_t size() const
Returns the size of this item (size of the Message, mainly)
Definition: item.cpp:456
Item * itemBelow()
Returns the item that is visually below this item in the tree.
Definition: item.cpp:103
QString statusDescription() const
Returns a string describing the status e.g: "Read, Forwarded, Important".
Definition: item.cpp:248
void beginRemoveRows(const QModelIndex &parent, int first, int last)
void childItemStats(ChildItemStats &stats) const
Gathers statistics about child items.
Definition: item.cpp:44
A structure used with MessageList::Item::childItemStats().
Definition: item.h:184
qulonglong filesize_t
int count(const T &value) const const
void rawAppendChildItem(Item *child)
Appends a child item without inserting it via the model.
Definition: item.cpp:589
void setStatus(Akonadi::MessageStatus status)
Sets the status associated to this Item.
Definition: item.cpp:451
@ InvisibleRoot
This item is just Item and it's the only InvisibleRoot per Model.
Definition: item.h:59
Item * parent() const
Returns the parent Item in the tree, or 0 if this item isn't attached to the tree.
Definition: item.cpp:436
void setViewable(Model *model, bool bViewable)
Makes this item viewable, that is, notifies its existence to any listener attached to the "rowsInsert...
Definition: item.cpp:367
void beginInsertRows(const QModelIndex &parent, int first, int last)
time_t maxDate() const
Returns the maximum date in the subtree originating from this item.
Definition: item.cpp:476
void takeChildItem(Model *model, Item *child)
Removes a child from this item's child list without deleting it.
Definition: item.cpp:637
void killAllChildItems()
Kills all the child items without emitting any signal, recursively.
Definition: item.cpp:422
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:168
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
bool isEmpty() const const
QByteArray toUtf8() const const
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:64
Q_SCRIPTABLE CaptureState status()
Item * itemAboveChild(Item *child)
Returns the item that is visually above the specified child if this item.
Definition: item.cpp:129
bool useReceiver() const
Returns whether sender or receiver is supposed to be displayed.
Definition: item.cpp:526
void endInsertRows()
bool recomputeMaxDate()
Recompute the maximum date from the current children list.
Definition: item.cpp:323
QString formattedMaxDate() const
A string with a text rappresentation of maxDate() obtained via Manager.
Definition: item.cpp:314
InitialExpandStatus
Specifies the initial expand status for the item that should be applied when it's attached to the vie...
Definition: item.h:67
Definition: aggregation.h:21
void setSubjectAndStatus(const QString &subject, Akonadi::MessageStatus status)
This is meant to be called right after the constructor for MessageItem objects.
Definition: item.cpp:581
QString formattedSize() const
A string with a text rappresentation of size().
Definition: item.cpp:300
void endRemoveRows()
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
Item * topmostNonRoot()
Returns the topmost parent item that is not a Root item (that is, is a Message or GroupHeader).
Definition: item.cpp:225
QDateTime fromSecsSinceEpoch(qint64 secs, Qt::TimeSpec spec, int offsetSeconds)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
InitialExpandStatus initialExpandStatus() const
The initial expand status we have to honor when attaching to the viewable root.
Definition: item.cpp:347
const Akonadi::MessageStatus & status() const
Returns the status associated to this Item.
Definition: item.cpp:446
const QString & senderOrReceiver() const
Returns the sender or the receiver, depending on the underlying StorageModel settings.
Definition: item.cpp:516
void setInitialExpandStatus(InitialExpandStatus initialExpandStatus)
Set the initial expand status we have to honor when attaching to the viewable root.
Definition: item.cpp:352
void setFolder(const QString &folder)
Sets the folder associated to this Item.
Definition: item.cpp:546
This class manages the huge tree of displayable objects: GroupHeaderItems and MessageItems.
Definition: model.h:65
bool hasChildren() const
Convenience function that returns true if this item has children.
Definition: item.cpp:163
int appendChildItem(Model *model, Item *child)
Appends an Item to this item's child list.
Definition: item.cpp:597
void setSender(const QString &sender)
Sets the sender associated to this item.
Definition: item.cpp:491
A single item of the MessageList tree managed by MessageList::Model.
Definition: item.h:47
Item * itemAbove()
Returns the item that is visually above this item in the tree.
Definition: item.cpp:144
Item * itemBelowChild(Item *child)
Returns the item that is visually below the specified child if this item.
Definition: item.cpp:83
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:362
void setSize(size_t size)
Sets the size of this item (size of the Message, mainly)
Definition: item.cpp:461
void setReceiver(const QString &receiver)
Sets the sender associated to this item.
Definition: item.cpp:506
void setMaxDate(time_t date)
Sets the maximum date in the subtree originating from this item.
Definition: item.cpp:481
void setSubject(const QString &subject)
Sets the subject associated to this Item.
Definition: item.cpp:536
Item * deepestItem()
Returns the deepest item in the subtree originating at this item.
Definition: item.cpp:118
char * data()
void setIndexGuess(int index)
Sets the cached guess for the index of this item in the parent's child list.
Definition: item.cpp:220
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 9 2023 03:55:28 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 9 2023 03:55:28 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.