[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #41367] append folder separator in second outp

From: Rik
Subject: [Octave-bug-tracker] [bug #41367] append folder separator in second output of uigetfile
Date: Tue, 28 Jan 2014 17:26:50 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0

Update of bug #41367 (project octave):

                  Status:                    None => Patch Submitted        


Follow-up Comment #8:

This is a minor compatibility issue.  I would place it on the gui-release
branch rather than the stable branch.

>From uigetfile.m I see

  if (__octave_link_enabled__ ())
    [retfile, retpath, retindex] = __octave_link_file_dialog__ (outargs{:});
    [retfile, retpath, retindex] = feval (funcname, outargs{:});

In the CLI version, uigetfile eventually calls out to __fltk_uigetfile__.cc
which is in libinterp/dldfcn.

In the C++ code for __fltk_uigetfile__ I see this:

//fltk uses forward slash even for windows
std::string sep = "/";
retval(1) = std::string (fc.directory ()) + sep;

So that would explain things for the CLI interface.

It seems like it would be simple enough to add either a regexprep call after
the feval in the m-file (regexprep (retpath, '/', filesep), or to add the
search and replace code in C++ to __fltk_uigetfile__ using
file_ops::dir_sep_char (), string.find, and string.replace calls.

This seems like a useful enough function that the best option would be to add
the equivalent of QDir::toNativeSeparators function to Octave's own liboctave
library.  The class to change is file_ops which lives in
liboctave/system/file_ops.[h|cc].  The function would probably need to go
through the path character by character so that it would not replace instances
of dir_sep_char that had been escaped.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]