diff options
author | hjk <[email protected]> | 2023-01-23 09:51:21 +0100 |
---|---|---|
committer | hjk <[email protected]> | 2023-01-23 13:46:42 +0000 |
commit | 156ef28d9013d17bec0ddd166eaa1119f8831ef4 (patch) | |
tree | 0c84d3823044a24305c82260b0f8b551b63e5203 /src/libs/utils/filesystemwatcher.cpp | |
parent | 5bbc7ea0f5d4d2ba9873c9521748501bd5871e6f (diff) |
Utils: Start migration of FileSystemWatcher to FilePath
This duplication of the interface is a first step, the
QString based part will be gone in the end.
Change-Id: I5e6378a92f96324188b917599b50def536f57bbe
Reviewed-by: Marcus Tillmanns <[email protected]>
Diffstat (limited to 'src/libs/utils/filesystemwatcher.cpp')
-rw-r--r-- | src/libs/utils/filesystemwatcher.cpp | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/src/libs/utils/filesystemwatcher.cpp b/src/libs/utils/filesystemwatcher.cpp index 89ca3dc2cee..3991c127e07 100644 --- a/src/libs/utils/filesystemwatcher.cpp +++ b/src/libs/utils/filesystemwatcher.cpp @@ -2,6 +2,8 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "filesystemwatcher.h" + +#include "algorithm.h" #include "globalfilechangeblocker.h" #include <QDebug> @@ -454,4 +456,64 @@ void FileSystemWatcher::slotDirectoryChanged(const QString &path) } } -} // namespace Utils +void FileSystemWatcher::addFile(const FilePath &file, WatchMode wm) +{ + addFile(file.toFSPathString(), wm); +} + +void FileSystemWatcher::addFiles(const FilePaths &files, WatchMode wm) +{ + addFiles(transform(files, &FilePath::toFSPathString), wm); +} + +void FileSystemWatcher::removeFile(const FilePath &file) +{ + removeFile(file.toFSPathString()); +} + +void FileSystemWatcher::removeFiles(const FilePaths &files) +{ + removeFiles(transform(files, &FilePath::toFSPathString)); +} + +bool FileSystemWatcher::watchesFile(const FilePath &file) const +{ + return watchesFile(file.toFSPathString()); +} + +FilePaths FileSystemWatcher::filePaths() const +{ + return transform(files(), &FilePath::fromString); +} + +void FileSystemWatcher::addDirectory(const FilePath &file, WatchMode wm) +{ + addDirectory(file.toFSPathString(), wm); +} + +void FileSystemWatcher::addDirectories(const FilePaths &files, WatchMode wm) +{ + addDirectories(transform(files, &FilePath::toFSPathString), wm); +} + +void FileSystemWatcher::removeDirectory(const FilePath &file) +{ + removeDirectory(file.toFSPathString()); +} + +void FileSystemWatcher::removeDirectories(const FilePaths &files) +{ + removeDirectories(transform(files, &FilePath::toFSPathString)); +} + +bool FileSystemWatcher::watchesDirectory(const FilePath &file) const +{ + return watchesDirectory(file.toFSPathString()); +} + +FilePaths FileSystemWatcher::directoryPaths() const +{ + return transform(directories(), &FilePath::fromString); +} + +} //Utils |