guido+pui@1: /* guido+pui@1: * Copyright (C) 2018 Guido Berhoerster guido+pui@1: * guido+pui@1: * Permission is hereby granted, free of charge, to any person obtaining guido+pui@1: * a copy of this software and associated documentation files (the guido+pui@1: * "Software"), to deal in the Software without restriction, including guido+pui@1: * without limitation the rights to use, copy, modify, merge, publish, guido+pui@1: * distribute, sublicense, and/or sell copies of the Software, and to guido+pui@1: * permit persons to whom the Software is furnished to do so, subject to guido+pui@1: * the following conditions: guido+pui@1: * guido+pui@1: * The above copyright notice and this permission notice shall be included guido+pui@1: * in all copies or substantial portions of the Software. guido+pui@1: * guido+pui@1: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, guido+pui@1: * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF guido+pui@1: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. guido+pui@1: * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY guido+pui@1: * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, guido+pui@1: * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE guido+pui@1: * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. guido+pui@1: */ guido+pui@1: guido+pui@1: #define G_SETTINGS_ENABLE_BACKEND guido+pui@1: #include guido+pui@1: guido+pui@1: #include "pui-settings.h" guido+pui@1: guido+pui@1: #define SETTINGS_ROOT_PATH \ guido+pui@1: "/org/guido-berhoerster/code/package-update-indicator/" guido+pui@1: #define SETTINGS_ROOT_GROUP "General" guido+pui@1: guido+pui@1: GSettings * guido+pui@1: pui_settings_new(void) guido+pui@1: { guido+pui@1: gchar *settings_filename; guido+pui@1: GSettingsBackend *settings_backend; guido+pui@1: guido+pui@1: settings_filename = g_build_filename(g_get_user_config_dir(), PACKAGE, guido+pui@1: PACKAGE ".conf", NULL); guido+pui@1: settings_backend = g_keyfile_settings_backend_new(settings_filename, guido+pui@1: SETTINGS_ROOT_PATH, SETTINGS_ROOT_GROUP); guido+pui@1: guido+pui@1: return (g_settings_new_with_backend(SETTINGS_SCHEMA_ID, guido+pui@1: settings_backend)); guido+pui@1: }