quickshell/src/core/scan.hpp
outfoxxed 0519acf1d6
core: support root: and root:/ paths for the config root
This works everywhere urls are accepted and rewrites them from the
config root as a qsintercept url.
2024-05-29 15:07:10 -07:00

26 lines
538 B
C++

#pragma once
#include <qcontainerfwd.h>
#include <qdir.h>
#include <qhash.h>
#include <qloggingcategory.h>
#include <qvector.h>
Q_DECLARE_LOGGING_CATEGORY(logQmlScanner);
// expects canonical paths
class QmlScanner {
public:
QmlScanner(const QDir& rootPath): rootPath(rootPath) {}
void scanDir(const QString& path);
// returns if the file has a singleton
bool scanQmlFile(const QString& path);
QVector<QString> scannedDirs;
QVector<QString> scannedFiles;
QHash<QString, QString> qmldirIntercepts;
private:
QDir rootPath;
};