digiKam
Digikam::DTrashItemModel Class Reference
+ Inheritance diagram for Digikam::DTrashItemModel:

Public Types

enum  DTrashColumn { DTrashThumb = 0 , DTrashRelPath , DTrashTimeStamp , DTrashNumCol }
 

Public Slots

void append (const DTrashItemInfo &itemInfo)
 appends item to model data and informs the view More...
 
void refreshLayout ()
 refreshes the view layout More...
 
void refreshThumbnails (const LoadingDescription &desc, const QPixmap &pix)
 refreshes the thumbnails More...
 
void removeItems (const QModelIndexList &indexes)
 removes list of items for given indexes from model data and informs the view More...
 

Signals

void dataChange ()
 

Public Member Functions

DTrashItemInfoList allItems ()
 returns a list of all items in model More...
 
void changeThumbSize (int size)
 Changes the thumbnail size. More...
 
void clearCurrentData ()
 Clears all data from model and informs the view. More...
 
int columnCount (const QModelIndex &) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
 DTrashItemModel (QObject *const parent=nullptr)
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
QModelIndex indexForItem (const DTrashItemInfo &itemInfo) const
 returns the index for the DTrashItemInfo in model More...
 
bool isEmpty ()
 
DTrashItemInfo itemForIndex (const QModelIndex &index)
 returns DTrashItemInfo for specific index in model More...
 
DTrashItemInfoList itemsForIndexes (const QList< QModelIndex > &indexes)
 returns DTrashItemInfoList for given indexes in model More...
 
void loadItemsForCollection (const QString &colPath)
 Runs a thread to list all items from a collection trash. More...
 
bool pixmapForItem (const QString &path, QPixmap &pix) const
 loads a thumbnail for item in trash for showing More...
 
int rowCount (const QModelIndex &) const override
 QAbstractItemModel interface. More...
 
void sort (int column, Qt::SortOrder order=Qt::AscendingOrder) override
 
 ~DTrashItemModel () override
 

Member Enumeration Documentation

◆ DTrashColumn

Enumerator
DTrashThumb 
DTrashRelPath 
DTrashTimeStamp 
DTrashNumCol 

Constructor & Destructor Documentation

◆ DTrashItemModel()

Digikam::DTrashItemModel::DTrashItemModel ( QObject *const  parent = nullptr)
explicit

References refreshThumbnails().

◆ ~DTrashItemModel()

Digikam::DTrashItemModel::~DTrashItemModel ( )
override

Member Function Documentation

◆ allItems()

DTrashItemInfoList Digikam::DTrashItemModel::allItems ( )

returns a list of all items in model

◆ append

void Digikam::DTrashItemModel::append ( const DTrashItemInfo itemInfo)
slot

appends item to model data and informs the view

Parameters
itemInfoitem to append

◆ changeThumbSize()

void Digikam::DTrashItemModel::changeThumbSize ( int  size)

Changes the thumbnail size.

Parameters
sizesize to change to

◆ clearCurrentData()

void Digikam::DTrashItemModel::clearCurrentData ( )

Clears all data from model and informs the view.

◆ columnCount()

int Digikam::DTrashItemModel::columnCount ( const QModelIndex &  ) const
override

References DTrashNumCol.

◆ data()

◆ dataChange

void Digikam::DTrashItemModel::dataChange ( )
signal

◆ headerData()

QVariant Digikam::DTrashItemModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
override

◆ indexForItem()

QModelIndex Digikam::DTrashItemModel::indexForItem ( const DTrashItemInfo itemInfo) const

returns the index for the DTrashItemInfo in model

◆ isEmpty()

bool Digikam::DTrashItemModel::isEmpty ( )
Returns
true if there is no data in the model

◆ itemForIndex()

DTrashItemInfo Digikam::DTrashItemModel::itemForIndex ( const QModelIndex &  index)

returns DTrashItemInfo for specific index in model

◆ itemsForIndexes()

DTrashItemInfoList Digikam::DTrashItemModel::itemsForIndexes ( const QList< QModelIndex > &  indexes)

returns DTrashItemInfoList for given indexes in model

◆ loadItemsForCollection()

void Digikam::DTrashItemModel::loadItemsForCollection ( const QString &  colPath)

Runs a thread to list all items from a collection trash.

Parameters
colPathpath to collection to load items for

Referenced by Digikam::ItemIconView::slotAlbumSelected().

◆ pixmapForItem()

bool Digikam::DTrashItemModel::pixmapForItem ( const QString &  path,
QPixmap &  pix 
) const

loads a thumbnail for item in trash for showing

Parameters
pathpath of image in trash
pixPixmap to fill
Returns
true if there is an available thumbnail

Referenced by data().

◆ refreshLayout

void Digikam::DTrashItemModel::refreshLayout ( )
slot

refreshes the view layout

◆ refreshThumbnails

void Digikam::DTrashItemModel::refreshThumbnails ( const LoadingDescription desc,
const QPixmap &  pix 
)
slot

refreshes the thumbnails

Parameters
descloading description from thumbnail load thread
pixpixmap from thumbnail load thread

References Digikam::LoadingDescription::filePath.

Referenced by DTrashItemModel().

◆ removeItems

void Digikam::DTrashItemModel::removeItems ( const QModelIndexList &  indexes)
slot

removes list of items for given indexes from model data and informs the view

Parameters
indexesindexes to remove

References Digikam::DTrashItemInfo::collectionPath, and Digikam::DTrashItemInfo::trashPath.

◆ rowCount()

int Digikam::DTrashItemModel::rowCount ( const QModelIndex &  ) const
override

QAbstractItemModel interface.

◆ sort()

void Digikam::DTrashItemModel::sort ( int  column,
Qt::SortOrder  order = Qt::AscendingOrder 
)
override

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