mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-21 23:09:40 +00:00
Fix viewer file paths on windows (bug #8892)
Some applications do not accept forward slashes, so call external viewers and editors with backward slashes which is the usual convention under windows.
This commit is contained in:
parent
5ea48e077b
commit
a180414975
@ -705,8 +705,10 @@ bool Formats::view(Buffer const & buffer, FileName const & filename,
|
||||
if (!contains(command, token_from_format))
|
||||
command += ' ' + token_from_format;
|
||||
|
||||
command = subst(command, token_from_format, quoteName(onlyFileName(filename.toFilesystemEncoding())));
|
||||
command = subst(command, token_path_format, quoteName(onlyPath(filename.toFilesystemEncoding())));
|
||||
command = subst(command, token_from_format,
|
||||
quoteName(onlyFileName(filename.toFilesystemEncoding()), quote_shell_filename));
|
||||
command = subst(command, token_path_format,
|
||||
quoteName(onlyPath(filename.toFilesystemEncoding()), quote_shell_filename));
|
||||
command = subst(command, token_socket_format, quoteName(theServerSocket().address()));
|
||||
LYXERR(Debug::FILES, "Executing command: " << command);
|
||||
// FIXME UNICODE utf8 can be wrong for files
|
||||
@ -773,8 +775,10 @@ bool Formats::edit(Buffer const & buffer, FileName const & filename,
|
||||
if (!contains(command, token_from_format))
|
||||
command += ' ' + token_from_format;
|
||||
|
||||
command = subst(command, token_from_format, quoteName(filename.toFilesystemEncoding()));
|
||||
command = subst(command, token_path_format, quoteName(onlyPath(filename.toFilesystemEncoding())));
|
||||
command = subst(command, token_from_format,
|
||||
quoteName(filename.toFilesystemEncoding(), quote_shell_filename));
|
||||
command = subst(command, token_path_format,
|
||||
quoteName(onlyPath(filename.toFilesystemEncoding()), quote_shell_filename));
|
||||
command = subst(command, token_socket_format, quoteName(theServerSocket().address()));
|
||||
LYXERR(Debug::FILES, "Executing command: " << command);
|
||||
// FIXME UNICODE utf8 can be wrong for files
|
||||
|
@ -236,6 +236,8 @@ string const quoteName(string const & name, quote_style style)
|
||||
// simple parser in Systemcall.cpp do the substitution.
|
||||
return '"' + subst(name, "\"", "\\\"") + '"';
|
||||
#endif
|
||||
case quote_shell_filename:
|
||||
return quoteName(os::external_path(name), quote_shell);
|
||||
case quote_python:
|
||||
return "\"" + subst(subst(name, "\\", "\\\\"), "\"", "\\\"")
|
||||
+ "\"";
|
||||
|
@ -120,6 +120,9 @@ enum quote_style {
|
||||
/** Quote for the (OS dependant) shell. This is needed for command
|
||||
line arguments of subprocesses. */
|
||||
quote_shell,
|
||||
/** Quote a file name for the (OS dependant) shell. This is needed
|
||||
for file names as command line arguments of subprocesses. */
|
||||
quote_shell_filename,
|
||||
/** Quote for python. Use this if you want to store a filename in a
|
||||
python script. Example: \code
|
||||
os << "infile = " << quoteName(filename) << '\\n';
|
||||
|
Loading…
x
Reference in New Issue
Block a user