Hydra 0.20
|
#include <FileList.h>
Public Member Functions | |
FileList (FileEntryCache *_cache) | |
constructor | |
virtual | ~FileList () |
destructor | |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const |
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
virtual QVariant | data (const QModelIndex &index, int role) const |
virtual void | sort (int column, Qt::SortOrder order=Qt::AscendingOrder) |
FileList * | peer (void) const |
void | setPeer (FileList *peer) |
const QString & | baseDir (void) const |
bool | isBaseRecurse (void) const |
bool | isBaseShuffle (void) const |
bool | hasBaseQuery (void) const |
const QString & | baseQueryString (void) const |
std::shared_ptr< hydra::Token > | baseQueryToken (void) const |
bool | isValid (int index) const |
bool | isValid (void) const |
const FileEntry & | fileAt (int index) const |
FileEntry & | fileAt (int index) |
const FileEntry & | fileAt (const QModelIndex &index) const |
FileEntry & | fileAt (const QModelIndex &index) |
int | numFiles (void) const |
int | selectedFileIndex (void) const |
FileEntry & | selectedFile (void) |
int | findFileIndexByName (const QString &fullfilename) const |
void | setSelectedFile (int index) |
void | addListener (FileListListener *v) |
void | removeListener (FileListListener *v) |
void | emitBaseChange (FileListListener *source=0) |
void | emitImageChange (int fileIndex, FileListListener *source=0) |
QItemSelectionModel * | selectionModel (void) |
void | emitChangedTagsAll (void) |
void | emitChangedTagsOne (int idx) |
void | flushJobs (void) |
signals all the jobs to die quickly | |
void | enqueueLoad (const QString &fullfilename, int idx) |
Friends | |
class | desktop::FileListLoader |
class | desktop::FileListReloader |
Holds a file (image) list. Not all the images may be loaded. Can be backed by a FileMonitor.
void desktop::FileList::emitBaseChange | ( | FileListListener * | source = 0 | ) |
Calls onBaseChange on all the Views that are listenting to the FileList.
This works through thr FileListListener system.
void desktop::FileList::emitChangedTagsAll | ( | void | ) |
Smits a signal for the data model that all the tags changed. This translates into a QAbstractListModel::dataChanged() call.
This works through the QAbstractListModel system.
void desktop::FileList::emitChangedTagsOne | ( | int | idx | ) |
Smits a signal for the data model that all the tags changed for this particular index. This translates into a QAbstractListModel::dataChanged() call.
This works through the QAbstractListModel system.
void desktop::FileList::emitImageChange | ( | int | fileIndex, |
FileListListener * | source = 0 |
||
) |
Calls onImageChange on all the Views that are listenting to the FileList.
This is usually called when the image is changed, usually because its rotation has been changed.
This works through thr FileListListener system.
void desktop::FileList::enqueueLoad | ( | const QString & | fullfilename, |
int | idx | ||
) |
Using the worker/background thread pool system, enqueue a file info load for the given file.
Upon completion, a tag emit event will be sent.
const FileEntry& desktop::FileList::fileAt | ( | int | index | ) | const [inline] |
Return the FileEntry at the given index
const FileEntry& desktop::FileList::fileAt | ( | const QModelIndex & | index | ) | const [inline] |
Return the FileEntry at the given QModelIndex
FileEntry& desktop::FileList::fileAt | ( | const QModelIndex & | index | ) | [inline] |
Return the FileEntry at the given QModelIndex
int desktop::FileList::findFileIndexByName | ( | const QString & | fullfilename | ) | const |
Finds the file index that has the given fullfilename. Returns -1 on failure.
bool desktop::FileList::isValid | ( | void | ) | const [inline] |
Is there a currently selected file?
bool desktop::FileList::isValid | ( | int | index | ) | const [inline] |
Does the given index refer to a valid file entry?
int desktop::FileList::numFiles | ( | void | ) | const [inline] |
Returns the number of files in the list (basically a size() function)
FileEntry& desktop::FileList::selectedFile | ( | void | ) | [inline] |
Returns the currently selected file index, which must be valid.
Also a helper for selectionModel()
int desktop::FileList::selectedFileIndex | ( | void | ) | const |
Returns the currently selected file's index. Returns -1 if nothing is currently selected
helper for selectionModel.
QItemSelectionModel* desktop::FileList::selectionModel | ( | void | ) | [inline] |
Returns the internal selection model. This keeps tracks of which files are selected (often more than one.) Use isSelected(fileList()->index(x,0)) to test.
void desktop::FileList::setSelectedFile | ( | int | index | ) |
Sets the currently selected file. Will do nothing if the index is out of range, or is already the current file. This will fire an event if the current file is changed.
Helper for selectionModel()