anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / test / make-hardcode-gsettings-patch / fixtures / example-project / main.c
blobafcb3686ec840d650f155ac62adbad97dd9135ba
1 #include <gio/gio.h>
2 #include <glib-object.h>
4 void schema_id_literal() {
5 GSettings *settings;
6 settings = g_settings_new("org.gnome.evolution-data-server.addressbook");
7 g_object_unref(settings);
10 #define SELF_UID_PATH_ID "org.gnome.evolution-data-server.addressbook"
11 int schema_id_from_constant() {
12 GSettings *settings;
13 settings = g_settings_new(SELF_UID_PATH_ID);
14 g_object_unref(settings);
17 void schema_id_autoptr() {
18 g_autoptr(GSettings) settings = NULL;
19 settings = g_settings_new("org.gnome.evolution.calendar");
22 void schema_id_with_backend() {
23 GSettings *settings;
24 settings = g_settings_new_with_backend("org.gnome.evolution-data-server.addressbook", g_settings_backend_get_default());
25 g_object_unref(settings);
28 void schema_id_with_backend_and_path() {
29 GSettings *settings;
30 settings = g_settings_new_with_backend_and_path("org.gnome.seahorse.nautilus.window", g_settings_backend_get_default(), "/org/gnome/seahorse/nautilus/windows/123/");
31 g_object_unref(settings);
34 void schema_id_with_path() {
35 GSettings *settings;
36 settings = g_settings_new_with_path("org.gnome.seahorse.nautilus.window", "/org/gnome/seahorse/nautilus/windows/123/");
37 g_object_unref(settings);
40 int main() {
41 schema_id_literal();
42 schema_id_from_constant();
43 schema_id_autoptr();
44 schema_id_with_backend();
45 schema_id_with_backend_and_path();
46 schema_id_with_path();
48 return 0;