Workaround wxWidgets inability to find the default PDF viewer.
Fixes: lp:1843061
* https://bugs.launchpad.net/kicad/+bug/1843061
(cherry picked from commit d55f4d05b4
)
This commit is contained in:
parent
d5275b16aa
commit
75bb864237
|
@ -347,27 +347,27 @@ bool OpenPDF( const wxString& file )
|
|||
wxString command;
|
||||
wxString filename = file;
|
||||
|
||||
// Quote in case there are spaces in the file name.
|
||||
AddDelimiterString( filename );
|
||||
|
||||
Pgm().ReadPdfBrowserInfos();
|
||||
|
||||
if( !Pgm().UseSystemPdfBrowser() ) // Run the preferred PDF Browser
|
||||
{
|
||||
command = Pgm().GetPdfBrowserName() + wxT( " " ) + filename;
|
||||
command = Pgm().GetPdfBrowserName() + wxT( " '" ) + filename + wxT( "'" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( wxLaunchDefaultApplication( filename ) )
|
||||
return true;
|
||||
|
||||
#ifdef __WXMAC__
|
||||
command = wxT( "/usr/bin/open -a '" ) + filename + wxT( "'" );
|
||||
#endif
|
||||
// If launching the system default PDF viewer fails, fall through with empty command
|
||||
// string so the error message is displayed.
|
||||
}
|
||||
|
||||
if( !command.IsEmpty() )
|
||||
{
|
||||
if( ProcessExecute( command ) )
|
||||
if( ProcessExecute( command ) != -1 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue