forked from quickshell/quickshell
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.
This commit is contained in:
parent
33fac67798
commit
0519acf1d6
7 changed files with 48 additions and 8 deletions
|
@ -103,7 +103,15 @@ bool QmlScanner::scanQmlFile(const QString& path) {
|
|||
this->scanDir(currentdir.path());
|
||||
|
||||
for (auto& import: imports) {
|
||||
auto ipath = currentdir.filePath(import);
|
||||
QString ipath;
|
||||
if (import.startsWith("root:")) {
|
||||
auto path = import.sliced(5);
|
||||
if (path.startsWith('/')) path = path.sliced(1);
|
||||
ipath = this->rootPath.filePath(path);
|
||||
} else {
|
||||
ipath = currentdir.filePath(import);
|
||||
}
|
||||
|
||||
auto cpath = QFileInfo(ipath).canonicalFilePath();
|
||||
|
||||
if (cpath.isEmpty()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue