core: reference configs by absolute instead of canonical paths

This commit is contained in:
outfoxxed 2025-10-18 14:09:03 -07:00
parent 00858812f2
commit 3e2ce40b18
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
4 changed files with 18 additions and 9 deletions

View file

@ -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
- Added support for creating wayland idle inhibitors.

View file

@ -163,7 +163,7 @@ bool QmlScanner::scanQmlFile(const QString& path, bool& singleton, bool& interna
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
this->scanDir(currentdir.path());
@ -179,9 +179,9 @@ bool QmlScanner::scanQmlFile(const QString& path, bool& singleton, bool& interna
}
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;
continue;
}

View file

@ -16,9 +16,7 @@ public:
QmlScanner() = default;
QmlScanner(const QDir& rootPath): rootPath(rootPath) {}
// path must be canonical
void scanDir(const QString& path);
void scanQmlRoot(const QString& path);
QVector<QString> scannedDirs;

View file

@ -110,7 +110,7 @@ int locateConfigFile(CommandState& cmd, QString& path) {
}
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;
}
}
@ -140,8 +140,7 @@ int locateConfigFile(CommandState& cmd, QString& path) {
return -1;
}
path = QFileInfo(path).canonicalFilePath();
return 0;
goto rpath;
}
}
@ -154,7 +153,8 @@ int locateConfigFile(CommandState& cmd, QString& path) {
return -1;
}
path = QFileInfo(path).canonicalFilePath();
rpath:
path = QFileInfo(path).absoluteFilePath();
return 0;
}