We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aeb347b commit 1eabf5bCopy full SHA for 1eabf5b
src/io/fileview.cpp
@@ -490,7 +490,14 @@ void FileView::updateWatchedFiles() {
490
qCDebug(logFileView) << "Creating watcher for" << this << "at" << this->targetPath;
491
this->watcher = new QFileSystemWatcher(this);
492
this->watcher->addPath(this->targetPath);
493
- this->watcher->addPath(QDir(this->targetPath).dirName());
+
494
+ auto dirPath = this->targetPath;
495
+ if (!dirPath.contains("/")) dirPath = "./" % dirPath;
496
497
+ if (auto lastIndex = dirPath.lastIndexOf('/'); lastIndex != -1) {
498
+ dirPath = dirPath.sliced(0, lastIndex);
499
+ this->watcher->addPath(dirPath);
500
+ }
501
502
QObject::connect(
503
this->watcher,
0 commit comments