summaryrefslogtreecommitdiff
path: root/common/xfconf-errors.c
blob: 106ba50f4f6db76d5dc33e22b69163ca3d987e50 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 *  xfconf
 *
 *  Copyright (c) 2007 Brian Tarricone <bjt23@cornell.edu>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License ONLY.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "xfconf/xfconf-errors.h"
#include "xfconf-alias.h"

static GQuark xfconf_error_quark = 0;

/**
 * XFCONF_ERROR:
 *
 * The #GError error domain for Xfconf.
 **/


/**
 * XfconfError:
 *
 * An enumeration listing the different kinds of errors under the
 * XFCONF_ERROR domain.
 **/

GQuark
xfconf_get_error_quark()
{
    if(!xfconf_error_quark)
        xfconf_error_quark = g_quark_from_static_string("xfconf-error-quark");
    
    return xfconf_error_quark;
}

/* unfortunately glib-mkenums can't generate types that are compatible with
 * dbus error names -- the 'nick' value is used, which can have dashes in it,
 * which dbus doesn't like. */
GType
xfconf_error_get_type()
{
    static GType type = 0;
    
    if(!type) {
        static const GEnumValue values[] = {
            { XFCONF_ERROR_UNKNOWN, "XFCONF_ERROR_UNKNOWN", "Unknown" },
            { XFCONF_ERROR_CHANNEL_NOT_FOUND, "XFCONF_ERROR_CHANNEL_NOT_FOUND", "ChannelNotFound" },
            { XFCONF_ERROR_PROPERTY_NOT_FOUND, "XFCONF_ERROR_PROPERTY_NOT_FOUND", "PropertyNotFound" },
            { XFCONF_ERROR_READ_FAILURE, "XFCONF_ERROR_READ_FAILURE", "ReadFailure" },
            { XFCONF_ERROR_WRITE_FAILURE, "XFCONF_ERROR_WRITE_FAILURE", "WriteFailure" },
            { XFCONF_ERROR_PERMISSION_DENIED, "XFCONF_ERROR_PERMISSION_DENIED", "PermissionDenied" },
            { XFCONF_ERROR_INTERNAL_ERROR, "XFCONF_ERROR_INTERNAL_ERROR", "InternalError" },
            { XFCONF_ERROR_NO_BACKEND, "XFCONF_ERROR_NO_BACKEND", "NoBackend" },
            { 0, NULL, NULL }
        };
        
        type = g_enum_register_static("XfconfError", values);
    }
    
    return type;
}



#define __XFCONF_ERRORS_C__
#include "xfconf-aliasdef.c"