Added integer settings for plugins

This commit is contained in:
James Booth
2016-03-26 02:19:30 +00:00
parent e2b02733df
commit ce9b0836a0
8 changed files with 90 additions and 0 deletions

View File

@@ -111,6 +111,23 @@ plugin_settings_set_string(const char *const group, const char *const key, const
_save_settings();
}
int
plugin_settings_get_int(const char *const group, const char *const key, int def)
{
if (group && key && g_key_file_has_key(settings, group, key, NULL)) {
return g_key_file_get_integer(settings, group, key, NULL);
} else {
return def;
}
}
void
plugin_settings_set_int(const char *const group, const char *const key, int value)
{
g_key_file_set_integer(settings, group, key, value);
_save_settings();
}
static void
_save_settings(void)
{