Disable the wxFileSystemWatcher on network shares
Fix #5740 Fix #4126 This is a stupid solution because SAMBA sends invalid events and wxWidgets decides to assert rather than ignore them. Why can't people just use Windows Server shares :(
This commit is contained in:
parent
4100650ce1
commit
f168ece461
|
@ -65,6 +65,10 @@ if( UNIX )
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if( WIN32 )
|
||||||
|
list( APPEND EXTRA_KICAD_LIBS "Shlwapi" )
|
||||||
|
endif()
|
||||||
|
|
||||||
if( APPLE )
|
if( APPLE )
|
||||||
set_target_properties( kicad PROPERTIES
|
set_target_properties( kicad PROPERTIES
|
||||||
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_BINARY_DIR}/kicad/Info.plist
|
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_BINARY_DIR}/kicad/Info.plist
|
||||||
|
@ -79,6 +83,7 @@ else()
|
||||||
gal
|
gal
|
||||||
${wxWidgets_LIBRARIES}
|
${wxWidgets_LIBRARIES}
|
||||||
${GDI_PLUS_LIBRARIES}
|
${GDI_PLUS_LIBRARIES}
|
||||||
|
${EXTRA_KICAD_LIBS}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,9 @@
|
||||||
|
|
||||||
#include "tree_project_frame.h"
|
#include "tree_project_frame.h"
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#include <shlwapi.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Note about the tree project build process:
|
/* Note about the tree project build process:
|
||||||
* Building the tree project can be *very* long if there are a lot of subdirectories
|
* Building the tree project can be *very* long if there are a lot of subdirectories
|
||||||
|
@ -1065,7 +1068,26 @@ void TREE_PROJECT_FRAME::OnFileSystemEvent( wxFileSystemWatcherEvent& event )
|
||||||
|
|
||||||
void TREE_PROJECT_FRAME::FileWatcherReset()
|
void TREE_PROJECT_FRAME::FileWatcherReset()
|
||||||
{
|
{
|
||||||
|
wxString prj_dir = wxPathOnly( m_Parent->GetProjectFileName() );
|
||||||
|
|
||||||
// Prepare file watcher:
|
// Prepare file watcher:
|
||||||
|
#ifdef _WIN32
|
||||||
|
if( PathIsNetworkPathW( prj_dir.wc_str() ) )
|
||||||
|
{
|
||||||
|
// Don't support network shares for now
|
||||||
|
// SAMBA passes bad events to Windows and wxWidgets idiotically asserts
|
||||||
|
// rather than accepting vlaid event IDs
|
||||||
|
// Windows Server shares do not have this problem
|
||||||
|
m_Parent->SetStatusText( _( "Project on network share, auto refresh not available" ), 0 );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_Parent->SetStatusText( _( "" ), 0 );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if( m_watcher )
|
if( m_watcher )
|
||||||
{
|
{
|
||||||
m_watcher->RemoveAll();
|
m_watcher->RemoveAll();
|
||||||
|
@ -1084,7 +1106,6 @@ void TREE_PROJECT_FRAME::FileWatcherReset()
|
||||||
// moreover, under wxWidgets 2.9.4, AddTree does not work properly.
|
// moreover, under wxWidgets 2.9.4, AddTree does not work properly.
|
||||||
|
|
||||||
// We can see wxString under a debugger, not a wxFileName
|
// We can see wxString under a debugger, not a wxFileName
|
||||||
wxString prj_dir = wxPathOnly( m_Parent->GetProjectFileName() );
|
|
||||||
wxFileName fn;
|
wxFileName fn;
|
||||||
fn.AssignDir( prj_dir );
|
fn.AssignDir( prj_dir );
|
||||||
fn.DontFollowLink();
|
fn.DontFollowLink();
|
||||||
|
|
Loading…
Reference in New Issue