lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Using picker controls for paths


From: Greg Chicares
Subject: Re: [lmi] Using picker controls for paths
Date: Thu, 9 Jun 2016 12:47:57 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0

On 2016-06-07 22:18, Greg Chicares wrote:
> On 2016-06-07 20:35, Vadim Zeitlin wrote:
>> On Tue, 7 Jun 2016 20:18:13 +0000 Greg Chicares <address@hidden> wrote:
[...]
>> GC> Curiously, if I exit and reload lmi, I see only forward slashes in
>> GC> both GUI fields, though the xml file contains backslashes.
>> 
>>  This is a side effect of using fs::system_complete() in
>> configurable_settings ctor. FWIW I wouldn't be surprised if newer version
>> of Boost.Filesystem didn't behave in this way, it looks wrong to me to
>> change the path separators, especially for an already absolute path.
> 
> Agreed.

Wait--I agreed too quickly. I think instead that it's a side effect of
using string(), because the boost-1.33.1 documentation says:

|   path my_path( "foo/bar/data.txt" );
| On Windows, the output would be:
|   string------------------: foo/bar/data.txt
|   native_directory_string-: foo\bar\data.txt
|   native_file_string------: foo\bar\data.txt

The difference between complete() and system_complete() has to do with
multiple filesystem roots, not path separators.

And this seems to offer a way to achieve the behavior I personally
prefer: always use forward slashes everywhere. All I have to do is call
system_complete() and string() in these functions:
  Transfer(transfer_direction td, std::string& data, wxDirPickerCtrl& control)
  Transfer(transfer_direction td, std::string& data, wxFilePickerCtrl& control)
This must be done carefully, but I think I know how to make it work.

Have you already started working on an alternative that would use
forward slashes in the xml, and backward in the GUI? If you have, then
I wouldn't mind seeing your implementation. But if you haven't, then
please wait to see what I can come up with.




reply via email to

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