summaryrefslogtreecommitdiff
path: root/src/user_share.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2012-09-28 13:56:41 +0200
committerraveit65 <[email protected]>2012-09-28 13:56:41 +0200
commitc0ea7fefe55f518145afd68f201bb6ed07d6e866 (patch)
treefb36698c7c1aef79bcc1fd33cf56596d4cdd4dd9 /src/user_share.c
parent8326e3b51e36244b8ae04f4d8dd010b9fbf25af1 (diff)
downloadmate-user-share-c0ea7fefe55f518145afd68f201bb6ed07d6e866.tar.bz2
mate-user-share-c0ea7fefe55f518145afd68f201bb6ed07d6e866.tar.xz
fix gsettings again
remove g_object_unref add static GSettings* settings add g_signal_connect as substitution for mateconf_client_notify_add
Diffstat (limited to 'src/user_share.c')
-rw-r--r--src/user_share.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/src/user_share.c b/src/user_share.c
index 83f005c..ae7b5ff 100644
--- a/src/user_share.c
+++ b/src/user_share.c
@@ -63,7 +63,19 @@ static BluetoothClient *client = NULL;
static gboolean bluetoothd_enabled = FALSE;
#define OBEX_ENABLED (bluetoothd_enabled && has_console)
+
#define GSETTINGS_SCHEMA "org.mate.FileSharing"
+#define GSETTINGS_KEY_FILE_SHARING_ENABLED "enabled"
+#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ENABLED "bluetooth-enabled"
+#define GSETTINGS_KEY_FILE_SHARING_REQUIRE_PASSWORD "require-password"
+#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ALLOW_WRITE "bluetooth-allow-write"
+#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_REQUIRE_PAIRING "bluetooth-require-pairing"
+#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED "bluetooth-obexpush-enabled"
+#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ACCEPT_FILES "bluetooth-accept-files"
+#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY "bluetooth-notify"
+
+
+static GSettings* settings;
static void
obex_services_start (void)
@@ -477,7 +489,38 @@ main (int argc, char **argv)
if (obexpush_init () == FALSE)
return 1;
- g_object_unref (client);
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_ENABLED,
+ G_CALLBACK (file_sharing_enabled_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_REQUIRE_PASSWORD,
+ G_CALLBACK (require_password_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ENABLED,
+ G_CALLBACK (file_sharing_bluetooth_enabled_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ALLOW_WRITE,
+ G_CALLBACK (file_sharing_bluetooth_allow_write_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_REQUIRE_PAIRING,
+ G_CALLBACK (file_sharing_bluetooth_require_pairing_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED,
+ G_CALLBACK (file_sharing_bluetooth_obexpush_enabled_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ACCEPT_FILES,
+ G_CALLBACK (file_sharing_bluetooth_obexpush_accept_files_changed), NULL);
+
+ g_signal_connect (settings,
+ "changed::" GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY,
+ G_CALLBACK (file_sharing_bluetooth_obexpush_notify_changed), NULL);
+
bluez_init ();
consolekit_init ();