mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 14:21:57 +00:00
[client] config: load config file based on new lgConfigDir()
This commit is contained in:
parent
3369536cb8
commit
6109067275
2 changed files with 4 additions and 8 deletions
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "common/option.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/paths.h"
|
||||
#include "common/stringutils.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
@ -497,14 +498,7 @@ bool config_load(int argc, char * argv[])
|
|||
|
||||
// load config from XDG_CONFIG_HOME
|
||||
char * xdgFile;
|
||||
char * dir;
|
||||
|
||||
if ((dir = getenv("XDG_CONFIG_HOME")) != NULL)
|
||||
alloc_sprintf(&xdgFile, "%s/looking-glass/client.ini", dir);
|
||||
else if ((dir = getenv("HOME")) != NULL)
|
||||
alloc_sprintf(&xdgFile, "%s/.config/looking-glass/client.ini", dir);
|
||||
else
|
||||
alloc_sprintf(&xdgFile, "%s/.config/looking-glass/client.ini", pw->pw_dir);
|
||||
alloc_sprintf(&xdgFile, "%s/client.ini", lgConfigDir());
|
||||
|
||||
if (xdgFile && stat(xdgFile, &st) >= 0 && S_ISREG(st.st_mode))
|
||||
{
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include "common/ivshmem.h"
|
||||
#include "common/time.h"
|
||||
#include "common/version.h"
|
||||
#include "common/paths.h"
|
||||
|
||||
#include "core.h"
|
||||
#include "app.h"
|
||||
|
@ -1235,6 +1236,7 @@ int main(int argc, char * argv[])
|
|||
if (!installCrashHandler("/proc/self/exe"))
|
||||
DEBUG_WARN("Failed to install the crash handler");
|
||||
|
||||
lgPathsInit("looking-glass");
|
||||
config_init();
|
||||
ivshmemOptionsInit();
|
||||
egl_dynProcsInit();
|
||||
|
|
Loading…
Reference in a new issue