#include <YQPkgHistoryDialog.h>
Public Member Functions | |
YQPkgHistoryItemCollector (QTreeWidget *datesTree, QTreeWidget *actionsTree) | |
bool | operator() (const zypp::HistoryLogData::Ptr &item_ptr) |
Protected Member Functions | |
void | addDatesTreeItem (const QString &actionDate) |
void | addActionsDateItem (const QString &actionDate) |
QStringList | actionColumns (const zypp::HistoryLogData::Ptr &item_ptr) |
QPixmap | actionIcon (zypp::HistoryActionID id) |
Protected Attributes | |
QTreeWidget * | _datesTree |
QTreeWidget * | _actionsTree |
QTreeWidgetItem * | _actionsDateItem |
QString | _lastDate |
Helper class to populate both tree widgets in this dialog with zypp history actions.
This is used as a functor for a zypp::parser::HistoryLogReader where it is called for each history item found while parsing the history file.
YQPkgHistoryItemCollector::YQPkgHistoryItemCollector | ( | QTreeWidget * | datesTree, |
QTreeWidget * | actionsTree ) |
Constructor. This stores the widget pointers so items can later be added to those trees when libzypp calls operator() for each history item.
|
protected |
Format columns for one action, depending on the action type.
Return an empty QStringList if this is not an action that is suitable to be shown to the user.
|
protected |
Return a suitable icon for an action.
|
protected |
Add one item in the "actions" tree for the specified date. This item will act as the parent item for all actions on that date.
|
protected |
Add one item in the "dates" tree for the specified date.
bool YQPkgHistoryItemCollector::operator() | ( | const zypp::HistoryLogData::Ptr & | item_ptr | ) |
Functor method that is called by zypp::parser::HistoryLogReader for each history item (for each action). This will add an item for the action and, if needed, a parent item for the date and an item in the dates tree.