Qt 4.8
|
#include <qfilesystemmodel_p.h>
Classes | |
struct | Fetching |
class | QFileSystemNode |
Public Functions | |
void | _q_directoryChanged (const QString &directory, const QStringList &list) |
Performed quick listing and see if any files have been added or removed, then fetch more information on visible files. More... | |
void | _q_fileSystemChanged (const QString &path, const QList< QPair< QString, QFileInfo > > &) |
The thread has received new information about files, update and emit dataChanged if it has actually changed. More... | |
void | _q_performDelayedSort () |
void | _q_resolvedName (const QString &fileName, const QString &resolvedName) |
QFileSystemNode * | addNode (QFileSystemNode *parentNode, const QString &fileName, const QFileInfo &info) |
void | addVisibleFiles (QFileSystemNode *parentNode, const QStringList &newFiles) |
void | delayedSort () |
QString | displayName (const QModelIndex &index) const |
QString | filePath (const QModelIndex &index) const |
bool | filtersAcceptsNode (const QFileSystemNode *node) const |
QIcon | icon (const QModelIndex &index) const |
QModelIndex | index (const QString &path) |
QModelIndex | index (const QFileSystemNode *node) const |
void | init () |
bool | isHiddenByFilter (QFileSystemNode *indexNode, const QModelIndex &index) const |
QString | name (const QModelIndex &index) const |
QFileSystemNode * | node (const QModelIndex &index) const |
Return the QFileSystemNode that goes to index. More... | |
QFileSystemNode * | node (const QString &path, bool fetch=true) const |
bool | passNameFilters (const QFileSystemNode *node) const |
QFileSystemModelPrivate () | |
void | removeNode (QFileSystemNode *parentNode, const QString &name) |
void | removeVisibleFile (QFileSystemNode *parentNode, int visibleLocation) |
QString | size (const QModelIndex &index) const |
void | sortChildren (int column, const QModelIndex &parent) |
QString | time (const QModelIndex &index) const |
int | translateVisibleLocation (QFileSystemNode *parent, int row) const |
QString | type (const QModelIndex &index) const |
Public Functions inherited from QAbstractItemModelPrivate | |
bool | allowMove (const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation) |
Returns whether a move operation is valid. More... | |
void | columnsAboutToBeInserted (const QModelIndex &parent, int first, int last) |
void | columnsAboutToBeRemoved (const QModelIndex &parent, int first, int last) |
void | columnsInserted (const QModelIndex &parent, int first, int last) |
void | columnsRemoved (const QModelIndex &parent, int first, int last) |
QModelIndex | createIndex (int row, int column, void *data=0) const |
QModelIndex | createIndex (int row, int column, int id) const |
bool | indexValid (const QModelIndex &index) const |
void | invalidatePersistentIndex (const QModelIndex &index) |
void | invalidatePersistentIndexes () |
void | itemsAboutToBeMoved (const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation) |
void | itemsMoved (const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation) |
void | movePersistentIndexes (QVector< QPersistentModelIndexData *> indexes, int change, const QModelIndex &parent, Qt::Orientation orientation) |
Moves persistent indexes indexes by amount change. More... | |
QAbstractItemModelPrivate () | |
void | removePersistentIndexData (QPersistentModelIndexData *data) |
void | rowsAboutToBeInserted (const QModelIndex &parent, int first, int last) |
void | rowsAboutToBeRemoved (const QModelIndex &parent, int first, int last) |
void | rowsInserted (const QModelIndex &parent, int first, int last) |
void | rowsRemoved (const QModelIndex &parent, int first, int last) |
Public Functions inherited from QObjectPrivate | |
void | _q_reregisterTimers (void *pointer) |
void | addConnection (int signal, Connection *c) |
void | cleanConnectionLists () |
void | connectNotify (const char *signal) |
void | deleteChildren () |
void | disconnectNotify (const char *signal) |
bool | isSender (const QObject *receiver, const char *signal) const |
bool | isSignalConnected (uint signalIdx) const |
Returns true if the signal with index signal_index from object sender is connected. More... | |
void | moveToThread_helper () |
QObjectPrivate (int version=QObjectPrivateVersion) | |
QObjectList | receiverList (const char *signal) const |
QObjectList | senderList () const |
void | setParent_helper (QObject *) |
void | setThreadData_helper (QThreadData *currentData, QThreadData *targetData) |
int | signalIndex (const char *signalName) const |
Returns the signal index used in the internal connectionLists vector. More... | |
virtual | ~QObjectPrivate () |
Public Functions inherited from QObjectData | |
virtual | ~QObjectData ()=0 |
Static Public Functions | |
static bool | caseInsensitiveLessThan (const QString &s1, const QString &s2) |
static QString | myComputer () |
static int | naturalCompare (const QString &s1, const QString &s2, Qt::CaseSensitivity cs) |
Natural number sort, skips spaces. More... | |
static bool | nodeCaseInsensitiveLessThan (const QFileSystemModelPrivate::QFileSystemNode &s1, const QFileSystemModelPrivate::QFileSystemNode &s2) |
static QString | size (qint64 bytes) |
Static Public Functions inherited from QAbstractItemModelPrivate | |
static const QHash< int, QByteArray > & | defaultRoleNames () |
static QAbstractItemModel * | staticEmptyModel () |
static bool | variantLessThan (const QVariant &v1, const QVariant &v2) |
This function is used by our Q{Tree,Widget,Table}WidgetModel classes to sort. More... | |
Static Public Functions inherited from QObjectPrivate | |
static void | clearGuards (QObject *) |
static QObjectPrivate * | get (QObject *o) |
static void | resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender) |
static Sender * | setCurrentSender (QObject *receiver, Sender *sender) |
static void | signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result) |
Additional Inherited Members | |
Public Types inherited from QObjectPrivate | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
Definition at line 78 of file qfilesystemmodel_p.h.
|
inline |
Definition at line 208 of file qfilesystemmodel_p.h.
void QFileSystemModelPrivate::_q_directoryChanged | ( | const QString & | directory, |
const QStringList & | files | ||
) |
Performed quick listing and see if any files have been added or removed, then fetch more information on visible files.
Definition at line 1697 of file qfilesystemmodel.cpp.
void QFileSystemModelPrivate::_q_fileSystemChanged | ( | const QString & | path, |
const QList< QPair< QString, QFileInfo > > & | updates | ||
) |
The thread has received new information about files, update and emit dataChanged if it has actually changed.
Definition at line 1868 of file qfilesystemmodel.cpp.
void QFileSystemModelPrivate::_q_performDelayedSort | ( | ) |
Definition at line 1011 of file qfilesystemmodel.cpp.
void QFileSystemModelPrivate::_q_resolvedName | ( | const QString & | fileName, |
const QString & | resolvedName | ||
) |
Definition at line 1971 of file qfilesystemmodel.cpp.
QFileSystemModelPrivate::QFileSystemNode * QFileSystemModelPrivate::addNode | ( | QFileSystemNode * | parentNode, |
const QString & | fileName, | ||
const QFileInfo & | info | ||
) |
Adds a new file to the children of parentNode
WARNING* this will change the count of children
Definition at line 1738 of file qfilesystemmodel.cpp.
Referenced by node().
void QFileSystemModelPrivate::addVisibleFiles | ( | QFileSystemNode * | parentNode, |
const QStringList & | newFiles | ||
) |
File at parentNode->children(itemLocation) was not visible before, but now should be and emit signals if necessary.
WARNING* this will change the visible count
Definition at line 1816 of file qfilesystemmodel.cpp.
Referenced by node().
|
inlinestatic |
Definition at line 272 of file qfilesystemmodel_p.h.
|
inline |
Definition at line 267 of file qfilesystemmodel_p.h.
QString QFileSystemModelPrivate::displayName | ( | const QModelIndex & | index | ) | const |
Definition at line 851 of file qfilesystemmodel.cpp.
QString QFileSystemModelPrivate::filePath | ( | const QModelIndex & | index | ) | const |
Definition at line 1329 of file qfilesystemmodel.cpp.
bool QFileSystemModelPrivate::filtersAcceptsNode | ( | const QFileSystemNode * | node | ) | const |
Returns false if node doesn't pass the filters otherwise true
QDir::Modified is not supported QDir::Drives is not supported
Definition at line 2009 of file qfilesystemmodel.cpp.
QIcon QFileSystemModelPrivate::icon | ( | const QModelIndex & | index | ) | const |
Definition at line 864 of file qfilesystemmodel.cpp.
|
inline |
Definition at line 233 of file qfilesystemmodel_p.h.
Referenced by index().
QModelIndex QFileSystemModelPrivate::index | ( | const QFileSystemNode * | node | ) | const |
Definition at line 616 of file qfilesystemmodel.cpp.
void QFileSystemModelPrivate::init | ( | ) |
Definition at line 1979 of file qfilesystemmodel.cpp.
|
inline |
Definition at line 227 of file qfilesystemmodel_p.h.
|
inlinestatic |
Definition at line 255 of file qfilesystemmodel_p.h.
QString QFileSystemModelPrivate::name | ( | const QModelIndex & | index | ) | const |
Definition at line 834 of file qfilesystemmodel.cpp.
|
static |
Natural number sort, skips spaces.
Examples: 1, 2, 10, 55, 100 01.jpg, 2.jpg, 10.jpg
Note on the algorithm: Only as many characters as necessary are looked at and at most they all are looked at once.
Slower then QString::compare() (of course)
Definition at line 1035 of file qfilesystemmodel.cpp.
Referenced by QFileSystemModelSorter::compareNodes().
QFileSystemModelPrivate::QFileSystemNode * QFileSystemModelPrivate::node | ( | const QModelIndex & | index | ) | const |
Return the QFileSystemNode that goes to index.
Definition at line 331 of file qfilesystemmodel.cpp.
QFileSystemModelPrivate::QFileSystemNode * QFileSystemModelPrivate::node | ( | const QString & | path, |
bool | fetch = true |
||
) | const |
Given a path return the matching QFileSystemNode or &root if invalid
Definition at line 380 of file qfilesystemmodel.cpp.
|
inlinestatic |
Definition at line 277 of file qfilesystemmodel_p.h.
bool QFileSystemModelPrivate::passNameFilters | ( | const QFileSystemNode * | node | ) | const |
Definition at line 2056 of file qfilesystemmodel.cpp.
void QFileSystemModelPrivate::removeNode | ( | QFileSystemModelPrivate::QFileSystemNode * | parentNode, |
const QString & | name | ||
) |
File at parentNode->children(itemLocation) has been removed, remove from the lists and emit signals if necessary
WARNING* this will change the count of children and could change visibleChildren
Definition at line 1769 of file qfilesystemmodel.cpp.
void QFileSystemModelPrivate::removeVisibleFile | ( | QFileSystemNode * | parentNode, |
int | vLocation | ||
) |
File was visible before, but now should NOT be
WARNING* this will change the visible count
Definition at line 1843 of file qfilesystemmodel.cpp.
QString QFileSystemModelPrivate::size | ( | const QModelIndex & | index | ) | const |
Definition at line 768 of file qfilesystemmodel.cpp.
Definition at line 787 of file qfilesystemmodel.cpp.
void QFileSystemModelPrivate::sortChildren | ( | int | column, |
const QModelIndex & | parent | ||
) |
Definition at line 1150 of file qfilesystemmodel.cpp.
QString QFileSystemModelPrivate::time | ( | const QModelIndex & | index | ) | const |
Definition at line 809 of file qfilesystemmodel.cpp.
|
inline |
Definition at line 243 of file qfilesystemmodel_p.h.
QString QFileSystemModelPrivate::type | ( | const QModelIndex & | index | ) | const |
Definition at line 824 of file qfilesystemmodel.cpp.
QHash<const QFileSystemNode*, bool> QFileSystemModelPrivate::bypassFilters |
Definition at line 309 of file qfilesystemmodel_p.h.
Referenced by node().
QTimer QFileSystemModelPrivate::delayedSortTimer |
Definition at line 302 of file qfilesystemmodel_p.h.
bool QFileSystemModelPrivate::disableRecursiveSort |
Definition at line 314 of file qfilesystemmodel_p.h.
QBasicTimer QFileSystemModelPrivate::fetchingTimer |
Definition at line 323 of file qfilesystemmodel_p.h.
Referenced by node().
QFileInfoGatherer QFileSystemModelPrivate::fileInfoGatherer |
Definition at line 300 of file qfilesystemmodel_p.h.
Referenced by QFileSystemModel::remove(), and QFileSystemModel::rmdir().
QDir::Filters QFileSystemModelPrivate::filters |
Definition at line 308 of file qfilesystemmodel_p.h.
bool QFileSystemModelPrivate::forceSort |
Definition at line 303 of file qfilesystemmodel_p.h.
bool QFileSystemModelPrivate::nameFilterDisables |
Definition at line 310 of file qfilesystemmodel_p.h.
Definition at line 316 of file qfilesystemmodel_p.h.
bool QFileSystemModelPrivate::readOnly |
Definition at line 306 of file qfilesystemmodel_p.h.
Definition at line 319 of file qfilesystemmodel_p.h.
QFileSystemNode QFileSystemModelPrivate::root |
Definition at line 321 of file qfilesystemmodel_p.h.
QDir QFileSystemModelPrivate::rootDir |
Definition at line 298 of file qfilesystemmodel_p.h.
bool QFileSystemModelPrivate::setRootPath |
Definition at line 307 of file qfilesystemmodel_p.h.
int QFileSystemModelPrivate::sortColumn |
Definition at line 304 of file qfilesystemmodel_p.h.
Qt::SortOrder QFileSystemModelPrivate::sortOrder |
Definition at line 305 of file qfilesystemmodel_p.h.
Definition at line 329 of file qfilesystemmodel_p.h.
Referenced by node().