7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 08:31:48 +00:00

Silence errors from file watchers when adding files

The file watcher can throw errors on Linux that are very cryptic and
actually not very useful to users, so let's hide them since there isn't
really any problem that comes from this.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15717
This commit is contained in:
Ian McInerney 2025-01-29 19:34:00 +00:00
parent 799ea8317d
commit 4cf8274b2b
3 changed files with 17 additions and 5 deletions

View File

@ -705,7 +705,11 @@ void SCH_BASE_FRAME::setSymWatcher( const LIB_ID* aID )
fn.AssignDir( m_watcherFileName.GetPath() );
fn.DontFollowLink();
m_watcher->Add( fn );
{
// Silence OS errors that come from the watcher
wxLogNull silence;
m_watcher->Add( fn );
}
}

View File

@ -1498,9 +1498,13 @@ void PROJECT_TREE_PANE::FileWatcherReset()
if( wxFileName::IsDirReadable( path ) ) // linux whines about watching protected dir
{
fn.AssignDir( path );
m_watcher->Add( fn );
total_watch_count++;
{
// Silence OS errors that come from the watcher
wxLogNull silence;
fn.AssignDir( path );
m_watcher->Add( fn );
total_watch_count++;
}
// if kid is a subdir, push in list to explore it later
if( itemData->IsPopulated() && m_TreeProject->GetChildrenCount( kid ) )

View File

@ -1172,7 +1172,11 @@ void PCB_BASE_FRAME::setFPWatcher( FOOTPRINT* aFootprint )
wxLogTrace( "KICAD_LIB_WATCH", "Add watch: %s", fn.GetPath() );
m_watcher->Add( fn );
{
// Silence OS errors that come from the watcher
wxLogNull silence;
m_watcher->Add( fn );
}
}