7#include <private/qfileinfo_p.h>
10# include <sys/types.h>
12#if defined(Q_OS_VXWORKS)
13# include "qplatformdefs.h"
20#ifdef QT_BUILD_INTERNAL
24 fetchedRoot.storeRelaxed(
false);
29 return fetchedRoot.loadRelaxed();
50 , m_iconProvider(&defaultProvider)
71 m_resolveSymlinks =
enable;
75void QFileInfoGatherer::driveAdded()
80void QFileInfoGatherer::driveRemoved()
92 return m_resolveSymlinks;
100 m_iconProvider = provider;
105 return m_iconProvider;
119 if (this->files.at(loc) ==
files) {
125 this->path.push(
path);
126 this->files.push(
files);
132#if QT_CONFIG(filesystemwatcher)
135 && !
path.startsWith(
"//"_L1) ) {
156#if QT_CONFIG(filesystemwatcher)
158 return m_watcher->files();
165#if QT_CONFIG(filesystemwatcher)
167 return m_watcher->directories();
172void QFileInfoGatherer::createWatcher()
174#if QT_CONFIG(filesystemwatcher)
178# if defined(Q_OS_WIN)
179 const QVariant listener = m_watcher->property(
"_q_driveListener");
192#if QT_CONFIG(filesystemwatcher)
194 if (m_watcher ==
nullptr)
196 m_watcher->addPaths(
paths);
205#if QT_CONFIG(filesystemwatcher)
206 if (m_watcher && !
paths.isEmpty())
207 m_watcher->removePaths(
paths);
216#if QT_CONFIG(filesystemwatcher)
225#if QT_CONFIG(filesystemwatcher)
227 if (
v != m_watching) {
246#if QT_CONFIG(filesystemwatcher)
260#if QT_CONFIG(filesystemwatcher)
291 const QStringList thisList = std::as_const(files).front();
295 getFileInfos(thisPath, thisList);
302 info.icon = m_iconProvider->
icon(fileInfo);
303 info.displayType = m_iconProvider->
type(fileInfo);
304#if QT_CONFIG(filesystemwatcher)
324 if (resolvedInfo.
exists()) {
339 if (
path.isEmpty()) {
340#ifdef QT_BUILD_INTERNAL
341 fetchedRoot.storeRelaxed(
true);
344 if (
files.isEmpty()) {
353 for (
int i = infoList.
size() - 1;
i >= 0; --
i) {
366 bool firstTime =
true;
371 if (
files.isEmpty()) {
374 fileInfo = dirIt.nextFileInfo();
376 allFiles.append(fileInfo.
fileName());
377 fetch(fileInfo,
base, firstTime, updatedFiles,
path);
380 if (!allFiles.isEmpty())
383 QStringList::const_iterator filesIt = filesToCheck.constBegin();
384 while (!abort.
loadRelaxed() && filesIt != filesToCheck.constEnd()) {
388 fetch(fileInfo,
base, firstTime, updatedFiles,
path);
401 if ((firstTime && updatedFiles.
size() > 100) ||
base.msecsTo(current) > 1000) {
403 updatedFiles.
clear();
411#include "moc_qfileinfogatherer_p.cpp"
virtual QIcon icon(IconType) const
Returns an icon set for the given type, using the current icon theme.
virtual QString type(const QFileInfo &) const
Returns the type of the file described by info.
void storeRelaxed(T newValue) noexcept
T loadRelaxed() const noexcept
The QDirIterator class provides an iterator for directory entrylists.
static QChar separator()
Returns the native directory separator: "/" under Unix and "\\" under Windows.
static QFileInfoList drives()
Returns a list of the root directories on this system.
void start() noexcept
Starts this timer.
QAbstractFileIconProvider * iconProvider() const
QStringList watchedFiles() const
void list(const QString &directoryPath)
QFileInfoGatherer(QObject *parent=nullptr)
Creates thread.
void updates(const QString &directory, const QList< QPair< QString, QFileInfo > > &updates)
QStringList watchedDirectories() const
void setIconProvider(QAbstractFileIconProvider *provider)
void newListOfFiles(const QString &directory, const QStringList &listOfFiles) const
void unwatchPaths(const QStringList &paths)
void fetchExtendedInformation(const QString &path, const QStringList &files)
Fetch extended information for all files in path.
void setResolveSymlinks(bool enable)
void nameResolved(const QString &fileName, const QString &resolvedName) const
void directoryLoaded(const QString &path)
void updateFile(const QString &path)
Fetch extended information for all filePath.
bool resolveSymlinks() const
void watchPaths(const QStringList &paths)
QExtendedInformation getInfo(const QFileInfo &info) const
~QFileInfoGatherer()
Destroys thread.
void removePath(const QString &path)
\inmodule QtCore \reentrant
bool isSymLink() const
Returns true if this object points to a symbolic link, shortcut, or alias; otherwise returns false.
QString symLinkTarget() const
void stat()
Reads all attributes from the file system.
QString fileName() const
Returns the name of the file, excluding the path.
void setFile(const QString &file)
Sets the file that the QFileInfo provides information about to file.
QString absoluteFilePath() const
Returns an absolute path including the file name.
bool isFile() const
Returns true if this object points to a file or to a symbolic link to a file.
QString canonicalFilePath() const
Returns the canonical path including the file name, i.e.
QString filePath() const
Returns the file name, including the path (which may be absolute or relative).
bool exists() const
Returns true if the file exists; otherwise returns false.
bool isReadable() const
Returns true if the user can read the file; otherwise returns false.
void fileChanged(const QString &path, QPrivateSignal)
This signal is emitted when the file at the specified path is modified, renamed or removed from disk.
void directoryChanged(const QString &path, QPrivateSignal)
This signal is emitted when the directory at a specified path is modified (e.g., when a file is added...
qsizetype size() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void pop_front() noexcept
void append(parameter_type t)
void unlock() noexcept
Unlocks this mutex locker.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
\macro QT_RESTRICTED_CAST_FROM_ASCII
qsizetype lastIndexOf(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
void chop(qsizetype n)
Removes n characters from the end of the string.
qsizetype size() const
Returns the number of characters in this string.
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
void start(Priority=InheritPriority)
bool wait(QDeadlineTimer deadline=QDeadlineTimer(QDeadlineTimer::Forever))
bool canConvert(QMetaType targetType) const
list append(new Employee("Blackpool", "Stephen"))
Combined button and popup list for selecting options.
#define Q_BASIC_ATOMIC_INITIALIZER(a)
std::pair< T1, T2 > QPair
static QString translateDriveName(const QFileInfo &drive)
static bool contains(const QJsonArray &haystack, unsigned needle)
GLsizei const GLfloat * v
[13]
GLsizei const GLuint * paths
GLsizei const GLchar *const * path
#define Q_AUTOTEST_EXPORT
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept
QFileInfo info(fileName)
[8]
QFileInfo fi("c:/temp/foo")
[newstuff]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent