projects/package-update-indicator

annotate pui-settings.c @ 52:707e9e3deeac

Do not hardcode pkg-config

Using a macro allows passing a different executable in case of
cross-compilation.
author Helmut Grohne <helmut@subdivi.de>
date Sat Dec 12 01:08:21 2020 -0500 (13 months ago)
parents
children
rev   line source
guido+pui@1 1 /*
guido+pui@1 2 * Copyright (C) 2018 Guido Berhoerster <guido+pui@berhoerster.name>
guido+pui@1 3 *
guido+pui@1 4 * Permission is hereby granted, free of charge, to any person obtaining
guido+pui@1 5 * a copy of this software and associated documentation files (the
guido+pui@1 6 * "Software"), to deal in the Software without restriction, including
guido+pui@1 7 * without limitation the rights to use, copy, modify, merge, publish,
guido+pui@1 8 * distribute, sublicense, and/or sell copies of the Software, and to
guido+pui@1 9 * permit persons to whom the Software is furnished to do so, subject to
guido+pui@1 10 * the following conditions:
guido+pui@1 11 *
guido+pui@1 12 * The above copyright notice and this permission notice shall be included
guido+pui@1 13 * in all copies or substantial portions of the Software.
guido+pui@1 14 *
guido+pui@1 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
guido+pui@1 16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
guido+pui@1 17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
guido+pui@1 18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
guido+pui@1 19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
guido+pui@1 20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
guido+pui@1 21 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
guido+pui@1 22 */
guido+pui@1 23
guido+pui@1 24 #define G_SETTINGS_ENABLE_BACKEND
guido+pui@1 25 #include <gio/gsettingsbackend.h>
guido+pui@1 26
guido+pui@1 27 #include "pui-settings.h"
guido+pui@1 28
guido+pui@1 29 #define SETTINGS_ROOT_PATH \
guido+pui@1 30 "/org/guido-berhoerster/code/package-update-indicator/"
guido+pui@1 31 #define SETTINGS_ROOT_GROUP "General"
guido+pui@1 32
guido+pui@1 33 GSettings *
guido+pui@1 34 pui_settings_new(void)
guido+pui@1 35 {
guido+pui@1 36 gchar *settings_filename;
guido+pui@1 37 GSettingsBackend *settings_backend;
guido+pui@1 38
guido+pui@1 39 settings_filename = g_build_filename(g_get_user_config_dir(), PACKAGE,
guido+pui@1 40 PACKAGE ".conf", NULL);
guido+pui@1 41 settings_backend = g_keyfile_settings_backend_new(settings_filename,
guido+pui@1 42 SETTINGS_ROOT_PATH, SETTINGS_ROOT_GROUP);
guido+pui@1 43
guido+pui@1 44 return (g_settings_new_with_backend(SETTINGS_SCHEMA_ID,
guido+pui@1 45 settings_backend));
guido+pui@1 46 }