|
|
Home » Developing U++ » U++ Developers corner » Things we want from Linux/FreeBSD release archives
Re: Things we want from Linux/FreeBSD release archives [message #53399 is a reply to message #53391] |
Wed, 01 April 2020 11:07 |
|
mirek
Messages: 13976 Registered: November 2005
|
Ultimate Member |
|
|
So I would like this:
static String sConfigFolder;
void SetConfigDirectory(const String& s)
{
sConfigFolder = s;
}
String ConfigFile(const char *file) {
if(sConfigFolder.GetCount())
return AppendFileName(sConfigFolder, file);
#if defined(PLATFORM_WIN32)
if(sHomecfg) {
String p = GetHomeDirFile(GetExeTitle());
ONCELOCK
RealizeDirectory(p);
return AppendFileName(p, file);
}
return GetExeDirFile(file);
#elif defined(PLATFORM_POSIX)
static String cfgdir;
ONCELOCK {
String h = GetExeFolder();
if(!sHomecfg)
while(h.GetCount() > 1 && DirectoryExists(h)) {
String pp = AppendFileName(h, ".config");
if(DirectoryExists(pp)) {
cfgdir = pp;
break;
}
h = GetFileFolder(h);
}
if(IsNull(cfgdir))
cfgdir = GetEnv("XDG_CONFIG_HOME");
if(IsNull(cfgdir) || !DirectoryExists(cfgdir))
cfgdir = GetHomeDirFile(".config");
}
String pp = AppendFileName(cfgdir, GetAppName());
RealizeDirectory(pp);
return AppendFileName(pp, file);
#else
NEVER();
return file;
#endif//PLATFORM
}
[Updated on: Wed, 01 April 2020 11:21] Report message to a moderator
|
|
|
|
|
Things we want from Linux/FreeBSD release archives
By: mirek on Tue, 31 March 2020 17:52
|
|
|
Re: Things we want from Linux/FreeBSD release archives
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Tue, 31 March 2020 23:24
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Wed, 01 April 2020 06:30
|
|
|
Re: Things we want from Linux/FreeBSD release archives
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Wed, 01 April 2020 11:07
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Wed, 01 April 2020 18:17
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Wed, 01 April 2020 18:21
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Wed, 01 April 2020 18:26
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Wed, 01 April 2020 18:34
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Wed, 01 April 2020 18:54
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Thu, 02 April 2020 19:10
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Thu, 02 April 2020 19:33
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Thu, 02 April 2020 20:45
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Fri, 03 April 2020 00:32
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Fri, 03 April 2020 01:36
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Fri, 03 April 2020 09:23
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Fri, 03 April 2020 20:57
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Sat, 04 April 2020 15:08
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Sat, 04 April 2020 15:33
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Sat, 04 April 2020 18:46
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Zbych on Sat, 04 April 2020 21:06
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Sun, 05 April 2020 00:49
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Zbych on Sun, 05 April 2020 11:12
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Sun, 05 April 2020 13:03
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Sun, 05 April 2020 13:10
|
|
|
Re: Things we want from Linux/FreeBSD release archives
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Mon, 06 April 2020 06:33
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Mon, 06 April 2020 10:12
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Mon, 06 April 2020 15:31
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Tue, 07 April 2020 05:34
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Fri, 10 April 2020 17:34
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Fri, 10 April 2020 18:02
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Fri, 10 April 2020 18:06
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Fri, 10 April 2020 18:37
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Fri, 10 April 2020 19:16
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Tue, 07 April 2020 14:36
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: Novo on Tue, 07 April 2020 15:48
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Tue, 07 April 2020 16:28
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: amrein on Sun, 05 April 2020 11:46
|
|
|
Re: Things we want from Linux/FreeBSD release archives
By: mirek on Sun, 05 April 2020 13:07
|
Goto Forum:
Current Time: Thu May 09 16:03:58 CEST 2024
Total time taken to generate the page: 0.02573 seconds
|
|
|