Skip to content

Reset folder watcher when ignore pattern changes - #1178

Merged
TheOneRing merged 2 commits into
mainfrom
work/watcher
Oct 22, 2026
Merged

TheOneRing merged 2 commits into
mainfrom
work/watcher

Conversation

@TheOneRing

Copy link
Copy Markdown
Contributor

The linux file watcher uses the ignore list to decide what folders to watch, if the lists changes we have to repopulate the watchted folders.

@TheOneRing TheOneRing linked an issue Oct 15, 2026 that may be closed by this pull request
@TheOneRing
TheOneRing force-pushed the work/watcher branch 2 times, most recently from e412f43 to 4b3daaf Compare October 21, 2026 13:45

@dragotin dragotin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brilliant!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Exclusion reload ordering, failure handling, and watcher and scheduler lifecycle issues introduce correctness and reliability regressions.

6 open issues
What changed in this PR

This PR aims to rebuild folder watches when exclusion settings change, so Linux can watch directories that were previously ignored.

Changes:

  • Adds a watcher restart API and retains the watched root path.
  • Routes hidden-file setting changes through exclusion reloading and discovery invalidation.
  • Moves exclusion reloading out of sync startup and adds abort/requeue handling for active syncs.
File Description
src/​gui/​folderwatcher.h Declares restart support and stores the root path.
src/​gui/​folderwatcher.cpp Implements watcher backend recreation.
src/​gui/​folder.h Changes reloadExcludes() to return void.
src/​gui/​folder.cpp Coordinates exclusion reloads, watcher restarts, and synchronization.

Review effort: Balanced

Comment thread src/gui/folder.cpp Resolved
Comment thread src/gui/folder.cpp Resolved
Comment thread src/gui/folder.cpp Resolved
Comment thread src/gui/folderwatcher.cpp Resolved
Comment thread src/gui/folder.cpp Resolved
Comment thread src/gui/folderwatcher.cpp Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/gui/folder.cpp Resolved
Comment thread src/gui/folder.cpp
Comment on lines +847 to +849
if (!_engine->reloadExcludes()) {
_syncResult.appendErrorString(tr("Failed to load excludes"));
setSyncState(SyncResult::SetupError);
The linux file watcher uses the ignore list to decide what folders to watch, if the lists changes we have to repopulate the watchted folders.
Comment thread src/gui/folder.cpp
doReload(wasRunning);
FolderMan::instance()->scheduler()->enqueueFolder(this);
},
static_cast<Qt::ConnectionType>(Qt::SingleShotConnection | Qt::QueuedConnection));
@TheOneRing
TheOneRing merged commit 9ed54c5 into main Oct 22, 2026
@TheOneRing
TheOneRing deleted the work/watcher branch October 22, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

enable 'sync hidden files' fails to start syncing

4 participants