Avoid generating paths on windows with ".." in them
This causes wxwidgets to failover to legacy windows dialogs as windows doesn't know how to handle them being passed to dialogs.
This commit is contained in:
+14
-3
@@ -154,7 +154,7 @@ wxString PATHS::GetStockDataPath( bool aRespectRunFromBuildDir )
|
||||
fn.RemoveLastDir();
|
||||
path = fn.GetPath();
|
||||
#else
|
||||
path = Pgm().GetExecutablePath() + wxT( ".." );
|
||||
path = getWindowsKiCadRoot();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -162,7 +162,7 @@ wxString PATHS::GetStockDataPath( bool aRespectRunFromBuildDir )
|
||||
#if defined( __WXMAC__ )
|
||||
path = GetOSXKicadDataDir();
|
||||
#elif defined( __WXMSW__ )
|
||||
path = Pgm().GetExecutablePath() + wxT( "../share/kicad" );
|
||||
path = getWindowsKiCadRoot() + wxT( "share/kicad" );
|
||||
#else
|
||||
path = wxString::FromUTF8Unchecked( KICAD_DATA );
|
||||
#endif
|
||||
@@ -257,7 +257,7 @@ wxString PATHS::GetDocumentationPath()
|
||||
#if defined( __WXMAC__ )
|
||||
path = GetOSXKicadDataDir();
|
||||
#elif defined( __WXMSW__ )
|
||||
path = Pgm().GetExecutablePath() + "../share/doc/kicad";
|
||||
path = getWindowsKiCadRoot() + "share/doc/kicad";
|
||||
#else
|
||||
path = wxString::FromUTF8Unchecked( KICAD_DOCS );
|
||||
#endif
|
||||
@@ -345,3 +345,14 @@ wxString PATHS::GetOSXKicadDataDir()
|
||||
return ddir.GetPath();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __WXWINDOWS__
|
||||
wxString PATHS::getWindowsKiCadRoot()
|
||||
{
|
||||
wxFileName root(Pgm().GetExecutablePath() + "/../");
|
||||
root.MakeAbsolute();
|
||||
|
||||
return root.GetPathWithSep();
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user