libyui-qt-pkg
Loading...
Searching...
No Matches
YQPkgHistoryItemCollector Class Reference

#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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ YQPkgHistoryItemCollector()

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.

Member Function Documentation

◆ actionColumns()

QStringList YQPkgHistoryItemCollector::actionColumns ( const zypp::HistoryLogData::Ptr & item_ptr)
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.

◆ actionIcon()

QPixmap YQPkgHistoryItemCollector::actionIcon ( zypp::HistoryActionID id)
protected

Return a suitable icon for an action.

◆ addActionsDateItem()

void YQPkgHistoryItemCollector::addActionsDateItem ( const QString & actionDate)
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.

◆ addDatesTreeItem()

void YQPkgHistoryItemCollector::addDatesTreeItem ( const QString & actionDate)
protected

Add one item in the "dates" tree for the specified date.

◆ operator()()

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.


The documentation for this class was generated from the following files: