mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2026-04-10 06:11:54 +10:00
tooling: ensure intercepts do not overwrite symlinks to cfg files
Intercept-file writes could end up opening an existing vfs symlink back to the user's actual config instead of creating a new file in the vfs.
This commit is contained in:
parent
d612227740
commit
92b336c80c
1 changed files with 5 additions and 1 deletions
|
|
@ -177,6 +177,8 @@ void QmlToolingSupport::updateToolingFs(
|
|||
auto fileInfo = QFileInfo(path);
|
||||
if (!fileInfo.isFile()) continue;
|
||||
|
||||
if (scanner.fileIntercepts.contains(path)) continue;
|
||||
|
||||
auto spath = linkDir.filePath(name);
|
||||
auto sFileInfo = QFileInfo(spath);
|
||||
|
||||
|
|
@ -205,8 +207,10 @@ void QmlToolingSupport::updateToolingFs(
|
|||
}
|
||||
|
||||
auto spath = linkDir.filePath(name);
|
||||
QFile::remove(spath);
|
||||
|
||||
auto file = QFile(spath);
|
||||
if (!file.open(QFile::ReadWrite | QFile::Text)) {
|
||||
if (!file.open(QFile::ReadWrite | QFile::Text | QFile::NewOnly)) {
|
||||
qCCritical(logTooling) << "Failed to open injected file" << spath;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue