Commit 74cc5a75 authored by Dick Hollenbeck's avatar Dick Hollenbeck

fix Bug #578532, document and embellish QuoteFullPath()

parent d9c42e27
...@@ -685,5 +685,5 @@ void OpenFile( const wxString& file ) ...@@ -685,5 +685,5 @@ void OpenFile( const wxString& file )
wxString QuoteFullPath( wxFileName& fn, wxPathFormat format ) wxString QuoteFullPath( wxFileName& fn, wxPathFormat format )
{ {
return wxT( "\"" ) + fn.GetFullPath() + wxT( "\"" ); return wxT( "\"" ) + fn.GetFullPath( format ) + wxT( "\"" );
} }
...@@ -458,7 +458,7 @@ wxString WinEDA_SchematicFrame::GetUniqueFilenameForCurrentSheet() ...@@ -458,7 +458,7 @@ wxString WinEDA_SchematicFrame::GetUniqueFilenameForCurrentSheet()
#else #else
fn.ClearExt(); fn.ClearExt();
wxString filename = fn.GetFullPath(); wxString filename = fn.GetFullPath();
if( ( filename.Len() + m_CurrentSheet->PathHumanReadable().Len() ) < 80 ) if( ( filename.Len() + m_CurrentSheet->PathHumanReadable().Len() ) < 80 )
#endif #endif
{ {
...@@ -702,8 +702,11 @@ void WinEDA_SchematicFrame::OnOpenPcbnew( wxCommandEvent& event ) ...@@ -702,8 +702,11 @@ void WinEDA_SchematicFrame::OnOpenPcbnew( wxCommandEvent& event )
if( fn.IsOk() ) if( fn.IsOk() )
{ {
fn.ClearExt(); fn.SetExt( BoardFileExtension );
ExecuteFile( this, PCBNEW_EXE, QuoteFullPath( fn ) );
wxString filename = QuoteFullPath( fn );
ExecuteFile( this, PCBNEW_EXE, filename );
} }
else else
ExecuteFile( this, PCBNEW_EXE ); ExecuteFile( this, PCBNEW_EXE );
......
...@@ -77,8 +77,10 @@ wxString FindKicadFile( const wxString& shortname ); ...@@ -77,8 +77,10 @@ wxString FindKicadFile( const wxString& shortname );
* Quote return value of wxFileName::GetFullPath(). * Quote return value of wxFileName::GetFullPath().
* *
* This allows file name paths with spaces to be used as parameters to * This allows file name paths with spaces to be used as parameters to
* ProcessExecute function calls. This is a cheap and dirty hack and * ProcessExecute function calls.
* should probably should be done in a class derived from wxFileName. * @param fn is the filename to wrap
* @param format if provided, can be used to transform the nature of the
* wrapped filename to another platform.
*/ */
extern wxString QuoteFullPath( wxFileName& fn, extern wxString QuoteFullPath( wxFileName& fn,
wxPathFormat format = wxPATH_NATIVE ); wxPathFormat format = wxPATH_NATIVE );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment