Messagelib
item.cpp
150 if (siblingAbove && siblingAbove != this && siblingAbove != d_ptr->mParent && siblingAbove->childItemCount() > 0) {
319 return Manager::instance()->dateFormatter()->dateString(QDateTime::fromSecsSinceEpoch(maxDate()));
388 // qDebug("BEGIN INSERT ROWS FOR PARENT %x: from %d to %d, (will) have %d children",this,0,tmp->count()-1,tmp->count());
551void MessageList::Core::Item::initialSetup(time_t date, size_t size, const QString &sender, const QString &receiver, bool useReceiver)
581void 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
QString formatByteSize(double size, int precision=1, KFormat::BinaryUnitDialect dialect=KFormat::DefaultBinaryDialect, KFormat::BinarySizeUnits units=KFormat::DefaultBinaryUnits) const
A structure used with MessageList::Item::childItemStats().
Definition item.h:173
A single item of the MessageList tree managed by MessageList::Model.
Definition item.h:36
Item * topmostNonRoot()
Returns the topmost parent item that is not a Root item (that is, is a Message or GroupHeader).
Definition item.cpp:224
bool recomputeMaxDate()
Recompute the maximum date from the current children list.
Definition item.cpp:323
const QString & senderOrReceiver() const
Returns the sender or the receiver, depending on the underlying StorageModel settings.
Definition item.cpp:516
const QString & receiver() const
Returns the receiver associated to this item.
Definition item.cpp:501
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:63
QString formattedMaxDate() const
A string with a text rappresentation of maxDate() obtained via Manager.
Definition item.cpp:314
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
InitialExpandStatus
Specifies the initial expand status for the item that should be applied when it's attached to the vie...
Definition item.h:55
void setSize(size_t size)
Sets the size of this item (size of the Message, mainly)
Definition item.cpp:461
void rawAppendChildItem(Item *child)
Appends a child item without inserting it via the model.
Definition item.cpp:589
QString statusDescription() const
Returns a string describing the status e.g: "Read, Forwarded, Important".
Definition item.cpp:247
int appendChildItem(Model *model, Item *child)
Appends an Item to this item's child list.
Definition item.cpp:597
bool useReceiver() const
Returns whether sender or receiver is supposed to be displayed.
Definition item.cpp:526
const Akonadi::MessageStatus & status() const
Returns the status associated to this Item.
Definition item.cpp:446
void setReceiver(const QString &receiver)
Sets the sender associated to this item.
Definition item.cpp:506
InitialExpandStatus initialExpandStatus() const
The initial expand status we have to honor when attaching to the viewable root.
Definition item.cpp:347
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 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 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
Item * itemAboveChild(Item *child)
Returns the item that is visually above the specified child if this item.
Definition item.cpp:128
Item * itemAbove()
Returns the item that is visually above this item in the tree.
Definition item.cpp:143
void killAllChildItems()
Kills all the child items without emitting any signal, recursively.
Definition item.cpp:422
time_t maxDate() const
Returns the maximum date in the subtree originating from this item.
Definition item.cpp:476
void setMaxDate(time_t date)
Sets the maximum date in the subtree originating from this item.
Definition item.cpp:481
void childItemStats(ChildItemStats &stats) const
Gathers statistics about child items.
Definition item.cpp:43
void setStatus(Akonadi::MessageStatus status)
Sets the status associated to this Item.
Definition item.cpp:451
Item * itemBelowChild(Item *child)
Returns the item that is visually below the specified child if this item.
Definition item.cpp:82
void takeChildItem(Model *model, Item *child)
Removes a child from this item's child list without deleting it.
Definition item.cpp:637
void setSender(const QString &sender)
Sets the sender associated to this item.
Definition item.cpp:491
void setIndexGuess(int index)
Sets the cached guess for the index of this item in the parent's child list.
Definition item.cpp:219
void setSubject(const QString &subject)
Sets the subject associated to this Item.
Definition item.cpp:536
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
Item * deepestItem()
Returns the deepest item in the subtree originating at this item.
Definition item.cpp:117
void setFolder(const QString &folder)
Sets the folder associated to this Item.
Definition item.cpp:546
void setInitialExpandStatus(InitialExpandStatus initialExpandStatus)
Set the initial expand status we have to honor when attaching to the viewable root.
Definition item.cpp:352
bool hasChildren() const
Convenience function that returns true if this item has children.
Definition item.cpp:162
@ InvisibleRoot
This item is just Item and it's the only InvisibleRoot per Model.
Definition item.h:47
Item * itemBelow()
Returns the item that is visually below this item in the tree.
Definition item.cpp:102
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:167
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
This class manages the huge tree of displayable objects: GroupHeaderItems and MessageItems.
Definition model.h:54
Q_SCRIPTABLE CaptureState status()
QString i18nc(const char *context, const char *text, const TYPE &arg...)
The implementation independent part of the MessageList library.
Definition aggregation.h:22
void beginInsertRows(const QModelIndex &parent, int first, int last)
void beginRemoveRows(const QModelIndex &parent, int first, int last)
void endInsertRows()
void endRemoveRows()
char * data()
QDateTime fromSecsSinceEpoch(qint64 secs)
qsizetype count() const const
QString arg(Args &&... args) const const
bool isEmpty() const const
QByteArray toUtf8() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.