mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2025-11-04 19:04:56 +11:00
core: reference configs by absolute instead of canonical paths
This commit is contained in:
parent
00858812f2
commit
3e2ce40b18
4 changed files with 18 additions and 9 deletions
|
|
@ -1,3 +1,14 @@
|
||||||
|
## Breaking Changes
|
||||||
|
|
||||||
|
### Config paths are no longer canonicalized
|
||||||
|
|
||||||
|
This fixes nix configs changing shell-ids on rebuild as the shell id is now derived from
|
||||||
|
the symlink path. Configs with a symlink in their path will have a different shell id.
|
||||||
|
|
||||||
|
Shell ids are used to derive the default config / state / cache folders, so those files
|
||||||
|
will need to be manually moved if using a config behind a symlinked path without an explicitly
|
||||||
|
set shell id.
|
||||||
|
|
||||||
## New Features
|
## New Features
|
||||||
|
|
||||||
- Added support for creating wayland idle inhibitors.
|
- Added support for creating wayland idle inhibitors.
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ bool QmlScanner::scanQmlFile(const QString& path, bool& singleton, bool& interna
|
||||||
qCDebug(logQmlScanner) << "Found imports" << imports;
|
qCDebug(logQmlScanner) << "Found imports" << imports;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto currentdir = QDir(QFileInfo(path).canonicalPath());
|
auto currentdir = QDir(QFileInfo(path).absolutePath());
|
||||||
|
|
||||||
// the root can never be a singleton so it dosent matter if we skip it
|
// the root can never be a singleton so it dosent matter if we skip it
|
||||||
this->scanDir(currentdir.path());
|
this->scanDir(currentdir.path());
|
||||||
|
|
@ -179,9 +179,9 @@ bool QmlScanner::scanQmlFile(const QString& path, bool& singleton, bool& interna
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pathInfo = QFileInfo(ipath);
|
auto pathInfo = QFileInfo(ipath);
|
||||||
auto cpath = pathInfo.canonicalFilePath();
|
auto cpath = pathInfo.absoluteFilePath();
|
||||||
|
|
||||||
if (cpath.isEmpty()) {
|
if (!pathInfo.exists()) {
|
||||||
qCWarning(logQmlScanner) << "Ignoring unresolvable import" << ipath << "from" << path;
|
qCWarning(logQmlScanner) << "Ignoring unresolvable import" << ipath << "from" << path;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,7 @@ public:
|
||||||
QmlScanner() = default;
|
QmlScanner() = default;
|
||||||
QmlScanner(const QDir& rootPath): rootPath(rootPath) {}
|
QmlScanner(const QDir& rootPath): rootPath(rootPath) {}
|
||||||
|
|
||||||
// path must be canonical
|
|
||||||
void scanDir(const QString& path);
|
void scanDir(const QString& path);
|
||||||
|
|
||||||
void scanQmlRoot(const QString& path);
|
void scanQmlRoot(const QString& path);
|
||||||
|
|
||||||
QVector<QString> scannedDirs;
|
QVector<QString> scannedDirs;
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ int locateConfigFile(CommandState& cmd, QString& path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (split[0].trimmed() == *cmd.config.name) {
|
if (split[0].trimmed() == *cmd.config.name) {
|
||||||
path = QDir(QFileInfo(file).canonicalPath()).filePath(split[1].trimmed());
|
path = QDir(QFileInfo(file).absolutePath()).filePath(split[1].trimmed());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -140,8 +140,7 @@ int locateConfigFile(CommandState& cmd, QString& path) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
path = QFileInfo(path).canonicalFilePath();
|
goto rpath;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -154,7 +153,8 @@ int locateConfigFile(CommandState& cmd, QString& path) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
path = QFileInfo(path).canonicalFilePath();
|
rpath:
|
||||||
|
path = QFileInfo(path).absoluteFilePath();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue