digiKam
Loading...
Searching...
No Matches
Digikam::DTrashItemModel Class Reference

#include <dtrashitemmodel.h>

+ 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
 
void refreshLayout ()
 refreshes the view layout
 
void refreshThumbnails (const LoadingDescription &desc, const QPixmap &pix)
 refreshes the thumbnails
 
void removeItems (const QModelIndexList &indexes)
 removes list of items for given indexes from model data and informs the view
 

Signals

void dataChange ()
 
void signalLoadingFinished ()
 
void signalLoadingStarted ()
 

Public Member Functions

DTrashItemInfoList allItems ()
 returns a list of all items in model
 
void changeThumbSize (int size)
 Changes the thumbnail size.
 
void clearCurrentData ()
 Clears all data from model and informs the view.
 
int columnCount (const QModelIndex &) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
 DTrashItemModel (QObject *const parent, QWidget *const widget)
 
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
 
bool isEmpty ()
 
DTrashItemInfo itemForIndex (const QModelIndex &index)
 returns DTrashItemInfo for specific index in model
 
DTrashItemInfoList itemsForIndexes (const QList< QModelIndex > &indexes)
 returns DTrashItemInfoList for given indexes in model
 
void loadItemsForCollection (const QString &colPath)
 Runs a thread to list all items from a collection trash.
 
bool pixmapForItem (const QString &path, QPixmap &pix) const
 loads a thumbnail for item in trash for showing
 
int rowCount (const QModelIndex &) const override
 QAbstractItemModel interface.
 
void sort (int column, Qt::SortOrder order=Qt::AscendingOrder) override
 
void stopLoadingTrash ()
 Stop loading of trash.
 
QString trashAlbumPath () const
 
 ~DTrashItemModel () override
 

Member Enumeration Documentation

◆ DTrashColumn

Enumerator
DTrashThumb 
DTrashRelPath 
DTrashTimeStamp 
DTrashNumCol 

Constructor & Destructor Documentation

◆ DTrashItemModel()

Digikam::DTrashItemModel::DTrashItemModel ( QObject *const  parent,
QWidget *const  widget 
)
explicit

References refreshThumbnails().

◆ ~DTrashItemModel()

Digikam::DTrashItemModel::~DTrashItemModel ( )
override

References stopLoadingTrash().

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.

◆ signalLoadingFinished

void Digikam::DTrashItemModel::signalLoadingFinished ( )
signal

◆ signalLoadingStarted

void Digikam::DTrashItemModel::signalLoadingStarted ( )
signal

◆ sort()

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

◆ stopLoadingTrash()

void Digikam::DTrashItemModel::stopLoadingTrash ( )

Stop loading of trash.

Referenced by ~DTrashItemModel().

◆ trashAlbumPath()

QString Digikam::DTrashItemModel::trashAlbumPath ( ) const

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