42 #ifndef QFILESYSTEMMODEL_P_H 43 #define QFILESYSTEMMODEL_P_H 58 #ifndef QT_NO_FILESYSTEMMODEL 60 #include <private/qabstractitemmodel_p.h> 74 class ExtendedInformation;
87 :
fileName(filename), populatedChildren(false), isVisible(false), dirtyChildrenIndex(-1), parent(p),
info(0) {}
90 while (i != children.constEnd()) {
100 #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) 113 return info->isDir();
114 if (children.count() > 0)
121 inline bool isSymLink(
bool ignoreNtfsSymLinks =
false)
const {
return info &&
info->isSymLink(ignoreNtfsSymLinks); }
132 return fileName >
name;
137 return fileName <
name;
145 return fileName ==
name;
162 return visibleChildren.indexOf(childName);
168 for(iterator = children.constBegin() ; iterator != children.constEnd() ; ++iterator) {
172 iterator.
value()->updateIcon(iconProvider, path + iterator.
value()->fileName);
176 iterator.
value()->updateIcon(iconProvider, iterator.
value()->fileName);
184 for(iterator = children.constBegin() ; iterator != children.constEnd() ; ++iterator) {
188 iterator.
value()->retranslateStrings(iconProvider, path + iterator.
value()->fileName);
190 iterator.
value()->retranslateStrings(iconProvider, path +
QLatin1Char(
'/') + iterator.
value()->fileName);
192 iterator.
value()->retranslateStrings(iconProvider, iterator.
value()->fileName);
215 nameFilterDisables(true),
216 disableRecursiveSort(false)
218 delayedSortTimer.setSingleShot(
true);
229 return (indexNode != &root && !index.
isValid());
240 void removeVisibleFile(
QFileSystemNode *parentNode,
int visibleLocation);
241 void sortChildren(
int column,
const QModelIndex &parent);
248 if (row < parent->dirtyChildrenIndex)
268 if (!delayedSortTimer.isActive())
269 delayedSortTimer.start(0);
292 void _q_performDelayedSort();
294 void _q_resolvedName(
const QString &fileName,
const QString &resolvedName);
299 #ifndef QT_NO_FILESYSTEMWATCHER 332 #endif // QT_NO_FILESYSTEMMODEL The QDir class provides access to directory structures and their contents.
void populate(const QExtendedInformation &fileInfo)
QHash< QString, QFileSystemNode * > children
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
The QFileSystemModel class provides a data model for the local filesystem.
QList< QRegExp > nameFilters
static bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
static mach_timebase_info_data_t info
#define QT_END_NAMESPACE
This macro expands to.
static bool nodeCaseInsensitiveLessThan(const QFileSystemModelPrivate::QFileSystemNode &s1, const QFileSystemModelPrivate::QFileSystemNode &s2)
bool operator>(const QByteArray &a1, const QByteArray &a2)
virtual QIcon icon(IconType type) const
Returns an icon set for the given type.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
bool operator!=(QBool b1, bool b2)
The QString class provides a Unicode character string.
The QHash class is a template class that provides a hash-table-based dictionary.
QDateTime lastModified() const
bool operator<(int priority, const QPair< QRunnable *, int > &p)
virtual QString type(const QFileInfo &info) const
Returns the type of the file described by info.
static QString myComputer()
#define QT_BEGIN_NAMESPACE
This macro expands to.
QList< Fetching > toFetch
QFileSystemModelPrivate()
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The QStringList class provides a list of strings.
bool hasInformation() const
const QFileSystemNode * node
const T & value() const
Returns the current item's value.
The QFileIconProvider class provides file icons for the QDirModel and the QFileSystemModel classes...
QHash< const QFileSystemNode *, bool > bypassFilters
QList< QString > visibleChildren
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
QFile::Permissions permissions() const
QBasicTimer fetchingTimer
static const char *const filters[3]
QModelIndex index(const QString &path)
#define Q_DECLARE_PUBLIC(Class)
int compare(const QString &s) const
The QDateTime class provides date and time functions.
The QModelIndex class is used to locate data in a data model.
#define Q_AUTOTEST_EXPORT
QFileSystemNode(const QString &filename=QString(), QFileSystemNode *p=0)
int visibleLocation(QString childName)
bool isSymLink(bool ignoreNtfsSymLinks=false) const
QHash< QString, QString > resolvedSymLinks
The QBasicTimer class provides timer events for objects.
int translateVisibleLocation(QFileSystemNode *parent, int row) const
bool isHiddenByFilter(QFileSystemNode *indexNode, const QModelIndex &index) const
The QTimer class provides repetitive and single-shot timers.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
The QFileInfo class provides system-independent file information.
static QString fileName(const QString &fileUrl)
bool operator==(QBool b1, bool b2)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
void retranslateStrings(QFileIconProvider *iconProvider, const QString &path)
bool disableRecursiveSort
bool caseSensitive() const
void updateIcon(QFileIconProvider *iconProvider, const QString &path)
QExtendedInformation * info
QFileInfoGatherer fileInfoGatherer
bool isExecutable() const
The QIcon class provides scalable icons in different modes and states.