kopia lustrzana https://github.com/Hamlib/Hamlib
Make HAMLIB_SETTINGS_FILE global
rodzic
8e9dea8ca9
commit
b7cbd39d1d
|
@ -3261,6 +3261,8 @@ rigerror2 HAMLIB_PARAMS((int errnum));
|
||||||
extern HAMLIB_EXPORT(int)
|
extern HAMLIB_EXPORT(int)
|
||||||
rig_setting2idx HAMLIB_PARAMS((setting_t s));
|
rig_setting2idx HAMLIB_PARAMS((setting_t s));
|
||||||
|
|
||||||
|
#define HAMLIB_SETTINGS_FILE "hamlib_settings"
|
||||||
|
|
||||||
extern HAMLIB_EXPORT(setting_t)
|
extern HAMLIB_EXPORT(setting_t)
|
||||||
rig_idx2setting(int i);
|
rig_idx2setting(int i);
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1004,20 +1004,20 @@ HAMLIB_EXPORT(int) rig_settings_get_path(char *path, int pathlen)
|
||||||
snprintf(path, pathlen, "%s/.config", home);
|
snprintf(path, pathlen, "%s/.config", home);
|
||||||
if (xdgpath)
|
if (xdgpath)
|
||||||
{
|
{
|
||||||
snprintf(path, pathlen-1, "%s/%s/%s", xdgpath, cwd, SETTINGS_FILE);
|
snprintf(path, pathlen-1, "%s/%s/%s", xdgpath, cwd, HAMLIB_SETTINGS_FILE);
|
||||||
}
|
}
|
||||||
else if (home && access(path, F_OK) != -1)
|
else if (home && access(path, F_OK) != -1)
|
||||||
{
|
{
|
||||||
snprintf(path, pathlen-1, "%s/.config/%s", home, SETTINGS_FILE);
|
snprintf(path, pathlen-1, "%s/.config/%s", home, HAMLIB_SETTINGS_FILE);
|
||||||
}
|
}
|
||||||
else if (home)
|
else if (home)
|
||||||
{
|
{
|
||||||
// we add a leading period to hide the file
|
// we add a leading period to hide the file
|
||||||
snprintf(path, pathlen-1, "%s/.%s", home, SETTINGS_FILE);
|
snprintf(path, pathlen-1, "%s/.%s", home, HAMLIB_SETTINGS_FILE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf(path, pathlen-1, ".%s", SETTINGS_FILE);
|
snprintf(path, pathlen-1, ".%s", HAMLIB_SETTINGS_FILE);
|
||||||
}
|
}
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: path=%s\n", __func__, path);
|
rig_debug(RIG_DEBUG_TRACE, "%s: path=%s\n", __func__, path);
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
|
|
Ładowanie…
Reference in New Issue