Re: [Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-08 Thread Denis Krjuchkov
I've pushed implementation of standard directories API. It does not support non-POSIX getpwnam_r/getpwuid_r yet, because I don't know how to test it. Please take a look. CommandLine: refactor config search, use standard directory API Main: use standard directory API ConfigPath: use standard direc

Re: [Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-06 Thread Denis Krjuchkov
05.12.2013 23:28, Max Kellermann пишет: > On 2013/12/05 17:10, Ben Boeckel wrote: >> >> Please use $HOME then fall back to getpwnam_r(). > > Agree. $HOME is the "nearest" variable, one that can be customized > easily by users. One can not override /etc/passwd entries easily. > OK, guys. Do you

Re: [Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-05 Thread Max Kellermann
On 2013/12/05 17:10, Ben Boeckel wrote: > On Thu, Dec 05, 2013 at 19:17:56 +0600, Denis Krjuchkov wrote: > > g_get_home_dir() works differently depending on GLib version. > > Newer GLib versions check $HOME first > > and if it's empty use getpwnam_r() to obtain home directory for > > currently us

Re: [Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-05 Thread Ben Boeckel
On Thu, Dec 05, 2013 at 19:17:56 +0600, Denis Krjuchkov wrote: > g_get_home_dir() works differently depending on GLib version. > Newer GLib versions check $HOME first > and if it's empty use getpwnam_r() to obtain home directory for > currently user. > Old versions go straight into using getpwnam_

Re: [Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-05 Thread Denis Krjuchkov
Next part is reimplementing of what I call "standard directories API". g_get_system_config_dirs g_get_user_config_dir g_get_home_dir g_get_user_special_dir(G_USER_DIRECTORY_MUSIC) Windows part looks easy there are plenty of standard functions with different levels of obsolescence for that. For

Re: [Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-05 Thread Max Kellermann
On 2013/12/05 10:24, Denis Krjuchkov wrote: > Few more improvements + fix for starting with missing db file on Windows Good work, all merged. -- Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps wi

Re: [Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-05 Thread Denis Krjuchkov
Few more improvements + fix for starting with missing db file on Windows fs/FileSystem.hxx: don't define CheckAccess() with mode on Windows db/SimpleDatabasePlugin.cxx: don't use CheckAccess with mode on Windows fs/FileSystem.hxx: add CheckAccess without mode parameter fs/Traits.cxx: don't return

Re: [Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-04 Thread Denis Krjuchkov
04.12.2013 20:34, Max Kellermann пишет: > > We need to be careful when to merge code, because sometimes, there are > differences; for example, UTF-8 strings shall always use slash and > never backslash. That is not currently documented or enforced, but > may be a good idea to implement for better

Re: [Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-04 Thread Max Kellermann
On 2013/12/04 09:51, Denis Krjuchkov wrote: > I'm going to replace remaing GLib path management functions. > > However I have some thoughts at first: > > I think PathTraits type could be split into two types. > One for native paths and one for UTF-8 paths. > They could have similar symbol names

Re: [Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-04 Thread Denis Krjuchkov
I'm going to replace remaing GLib path management functions. However I have some thoughts at first: I think PathTraits type could be split into two types. One for native paths and one for UTF-8 paths. They could have similar symbol names (e.g. Build, IsAbsolute). This would allow writing more gen

Re: [Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-03 Thread Max Kellermann
On 2013/12/03 09:58, Denis Krjuchkov wrote: > I think you're right. Pushed a fix for that. Merged. -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of h

Re: [Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-03 Thread Denis Krjuchkov
03.12.2013 14:42, Max Kellermann пишет: > > Merged. > > + AllocatedPath(string &&_value):value(_value) {} > > I believe we need to add an explicit std::move() here, because the > rvalue reference gets lost, and the normal copy constructor gets > called. > I think you're right. Pushed a fix f

Re: [Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-03 Thread Max Kellermann
On 2013/12/03 09:06, Denis Krjuchkov wrote: > fs/AllocatedPath: use PathTraits::BuildFS > fs/Traits.hxx: implement BuildFS() method > fs/Traits.hxx: move definition of AllocatedPath::string to PathTraits > fs/Traits.hxx: add GetLengthFS() > fs/AllocatedPath.hxx: add FromFS(std::string) method > fs

[Musicpd-dev-team] FS improvements + refinements in PollGroupWinSelect

2013-12-03 Thread Denis Krjuchkov
fs/AllocatedPath: use PathTraits::BuildFS fs/Traits.hxx: implement BuildFS() method fs/Traits.hxx: move definition of AllocatedPath::string to PathTraits fs/Traits.hxx: add GetLengthFS() fs/AllocatedPath.hxx: add FromFS(std::string) method fs/Traits.hxx: don't use g_path_is_absolute fs/Traits.hxx: