aboutsummaryrefslogtreecommitdiff
path: root/src/settings-helper.c
blob: 0ab188adcc1c418a1b1acf34ec8ec9efb6d28764 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
A small wrapper utility for connecting to GSettings.

Copyright 2009 Canonical Ltd.

Authors:
    Christoph Korn <c_korn@gmx.de>

This program is free software: you can redistribute it and/or modify it 
under the terms of the GNU General Public License version 3, as published 
by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but 
WITHOUT ANY WARRANTY; without even the implied warranties of 
MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along 
with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <gio/gio.h>

#include "dbus-shared-names.h"
#include "settings-helper.h"

static GSettings* settings = NULL;

static gboolean
build_settings (void)
{
  if (G_UNLIKELY(settings == NULL))
    {
      settings = g_settings_new (SESSION_SCHEMA);
    }

  return settings != NULL;
}

gboolean
supress_confirmations (void)
{
  g_return_val_if_fail (build_settings(), FALSE);

  return g_settings_get_boolean (settings, SUPPRESS_KEY) ;
}