r37442 - in /desktop/experimental/gnome-user-share/debian: changelog patches/02_bluetooth_optional.patch
pochu at users.alioth.debian.org
pochu at users.alioth.debian.org
Sun Mar 31 16:25:48 UTC 2013
Author: pochu
Date: Sun Mar 31 16:25:48 2013
New Revision: 37442
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=37442
Log:
+ debian/patches/02_bluetooth_optional.patch:
- Updated.
Modified:
desktop/experimental/gnome-user-share/debian/changelog
desktop/experimental/gnome-user-share/debian/patches/02_bluetooth_optional.patch
Modified: desktop/experimental/gnome-user-share/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-user-share/debian/changelog?rev=37442&op=diff
==============================================================================
--- desktop/experimental/gnome-user-share/debian/changelog [utf-8] (original)
+++ desktop/experimental/gnome-user-share/debian/changelog [utf-8] Sun Mar 31 16:25:48 2013
@@ -3,6 +3,8 @@
* New upstream release.
+ debian/control.in:
- Update build dependencies.
+ + debian/patches/02_bluetooth_optional.patch:
+ - Updated.
-- Emilio Pozuelo Monfort <pochu at debian.org> Fri, 29 Mar 2013 15:20:11 +0100
Modified: desktop/experimental/gnome-user-share/debian/patches/02_bluetooth_optional.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-user-share/debian/patches/02_bluetooth_optional.patch?rev=37442&op=diff
==============================================================================
--- desktop/experimental/gnome-user-share/debian/patches/02_bluetooth_optional.patch [utf-8] (original)
+++ desktop/experimental/gnome-user-share/debian/patches/02_bluetooth_optional.patch [utf-8] Sun Mar 31 16:25:48 2013
@@ -1,6 +1,6 @@
-From 393871d5d3a4817f88385d1a17888f53fad35190 Mon Sep 17 00:00:00 2001
-From: Josselin Mouette <joss at malsain.org>
-Date: Sun, 29 Apr 2012 11:16:04 +0200
+From cc71d396069c036643eec8038377d233e2f8f303 Mon Sep 17 00:00:00 2001
+From: Emilio Pozuelo Monfort <pochu27 at gmail.com>
+Date: Sun, 31 Mar 2013 17:56:49 +0200
Subject: [PATCH] Make bluetooth support optional
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@@ -9,91 +9,64 @@
As gnome-bluetooth doesn’t build on non-Linux architectures, bluetooth
support in gnome-user-share needs to be optional to allow it to build on
non-linux.
+
+Based on a patch by Josselin Mouette.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=601890
---
- configure.in | 15 +++++++++++++-
- data/file-share-properties.ui | 10 +++++-----
- src/Makefile.am | 14 +++++++++----
- src/file-share-properties.c | 44 ++++++++++++++++++++++++++++++++++++-----
- src/user_share.c | 34 +++++++++++++++++++++++++++++--
- 5 files changed, 100 insertions(+), 17 deletions(-)
-
-diff --git a/configure.in b/configure.in
-index 17f7f11..c7e9621 100644
---- a/configure.in
-+++ b/configure.in
-@@ -59,10 +59,23 @@ if $have_dbus_1_1 ; then
- AC_DEFINE(HAVE_DBUS_1_1, 1, [Set to true if we have D-BUS 1.1])
- fi
-
--PKG_CHECK_MODULES(USER_SHARE, glib-2.0 >= 2.28 gio-2.0 gtk+-3.0 gconf-2.0 dbus-glib-1 libnotify libcanberra-gtk3 $DBUS_MODULES gnome-bluetooth-1.0 >= 2.91.5)
-+PKG_CHECK_MODULES(USER_SHARE, glib-2.0 >= 2.28 gio-2.0 gtk+-3.0 gconf-2.0 dbus-glib-1 libnotify libcanberra-gtk3 $DBUS_MODULES)
+ configure.ac | 13 +++++++++++--
+ src/Makefile.am | 18 ++++++++++++++----
+ src/share-extension.c | 15 ++++++++++++++-
+ src/user_share.c | 31 ++++++++++++++++++++++++++++++-
+ 4 files changed, 69 insertions(+), 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4208716..6d3a4e7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -54,10 +54,19 @@ fi
+
+ AC_SUBST(HTTPD)
+
+-PKG_CHECK_MODULES(USER_SHARE, glib-2.0 >= 2.28 gio-2.0 >= 2.26 gtk+-3.0 dbus-1 >= 1.1.1 dbus-glib-1 libnotify libcanberra-gtk3 gnome-bluetooth-1.0 >= 2.91.5)
++PKG_CHECK_MODULES(USER_SHARE, glib-2.0 >= 2.28 gio-2.0 >= 2.26 gtk+-3.0 dbus-1 >= 1.1.1 dbus-glib-1 libnotify libcanberra-gtk3)
AC_SUBST(USER_SHARE_CFLAGS)
AC_SUBST(USER_SHARE_LIBS)
-+PKG_CHECK_MODULES(BLUETOOTH, gnome-bluetooth-1.0 >= 2.91.5,
-+ have_bluetooth=true, have_bluetooth=false)
-+AC_SUBST(BLUETOOTH_CFLAGS)
-+AC_SUBST(BLUETOOTH_LIBS)
-+if $have_bluetooth; then
-+ AC_DEFINE(HAVE_BLUETOOTH, 1, [Set to true if gnome-bluetooth support is available])
++AC_ARG_ENABLE(bluetooth, AS_HELP_STRING([--disable-bluetooth],[compile without bluetooth support]),,enable_bluetooth=yes)
++if test "x$enable_bluetooth" = "xyes"; then
++ PKG_CHECK_MODULES(BLUETOOTH, gnome-bluetooth-1.0 >= 2.91.5)
++ AC_DEFINE(HAVE_BLUETOOTH, 1, [Set to true if gnome-bluetooth support is available])
+else
-+ AC_MSG_WARN([Bluetooth support is disabled.])
++ AC_MSG_WARN([Bluetooth support is disabled.])
+fi
-+AM_CONDITIONAL(USE_BLUETOOTH, [test "$have_bluetooth" = "true"])
-+
-+
-+
- PKG_CHECK_MODULES(USER_SHARE_CONFIG, glib-2.0 >= 2.28 gtk+-3.0 >= 2.12.0 gconf-2.0)
- AC_SUBST(USER_SHARE_CONFIG_CFLAGS)
- AC_SUBST(USER_SHARE_CONFIG_LIBS)
-diff --git a/data/file-share-properties.ui b/data/file-share-properties.ui
-index 6c4f053..088e2ed 100644
---- a/data/file-share-properties.ui
-+++ b/data/file-share-properties.ui
-@@ -18,7 +18,7 @@
- <property name="border_width">5</property>
- <property name="spacing">18</property>
- <child>
-- <object class="GtkVBox" id="vbox3">
-+ <object class="GtkVBox" id="vbox_share_http">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
-@@ -129,8 +129,8 @@
- </packing>
- </child>
- <child>
-- <object class="GtkVBox" id="vbox4">
-- <property name="visible">True</property>
-+ <object class="GtkVBox" id="vbox_share_bluetooth">
-+ <property name="visible">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label7">
-@@ -212,8 +212,8 @@
- </packing>
- </child>
- <child>
-- <object class="GtkVBox" id="vbox5">
-- <property name="visible">True</property>
-+ <object class="GtkVBox" id="vbox_receive_bluetooth">
-+ <property name="visible">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label8">
++AM_CONDITIONAL(USE_BLUETOOTH, [test "$enable_bluetooth" = "yes"])
++
+ AC_CHECK_LIB(socket, socket)
+
+ have_socket=no
+@@ -124,7 +133,7 @@ AC_ARG_WITH(nautilusdir,
+ [ac_with_nautilusdir=""])
+
+ PKG_CHECK_MODULES(EXTENSION,
+- libnautilus-extension >= 2.91.7 gnome-bluetooth-1.0)
++ libnautilus-extension >= 2.91.7)
+ if test "${ac_with_nautilusdir}" = ""; then
+ ac_with_nautilusdir=`pkg-config --variable=extensiondir libnautilus-extension`
+ fi
diff --git a/src/Makefile.am b/src/Makefile.am
-index 09e82e3..fb28157 100644
+index d49a70c..9787073 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
-@@ -31,6 +31,7 @@ INCLUDES= \
+@@ -27,6 +27,7 @@ INCLUDES= \
-I$(top_builddir) \
$(EXTENSION_CFLAGS) \
$(USER_SHARE_CFLAGS) \
+ $(BLUETOOTH_CFLAGS) \
- $(USER_SHARE_CONFIG_CFLAGS) \
$(X_CFLAGS)
-@@ -41,10 +42,6 @@ gnome_user_share_SOURCES = \
+ gnome_user_share_SOURCES = \
+@@ -36,10 +37,6 @@ gnome_user_share_SOURCES = \
user_share-private.c \
http.c \
http.h \
@@ -104,7 +77,7 @@
$(MARSHALFILES)
gnome_user_share_LDADD = \
-@@ -53,6 +50,15 @@ gnome_user_share_LDADD = \
+@@ -48,6 +45,15 @@ gnome_user_share_LDADD = \
$(SELINUX_LIBS) \
$(X_LIBS) $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS)
@@ -117,247 +90,92 @@
+gnome_user_share_LDADD += $(BLUETOOTH_LIBS)
+endif
+
- gnome_file_share_properties_SOURCES = \
- file-share-properties.c \
- user_share-private.h \
-diff --git a/src/file-share-properties.c b/src/file-share-properties.c
-index 4d8473d..52108f8 100644
---- a/src/file-share-properties.c
-+++ b/src/file-share-properties.c
-@@ -85,26 +85,39 @@ static void
- update_ui (void)
- {
- GConfClient *client;
-- gboolean enabled, bluetooth_enabled, bluetooth_write_enabled, require_pairing_enabled;
-+ gboolean enabled;
-+#ifdef HAVE_BLUETOOTH
-+ gboolean bluetooth_enabled, bluetooth_write_enabled, require_pairing_enabled;
- gboolean bluetooth_obexpush_enabled, bluetooth_obexpush_notify;
-+#endif /* HAVE_BLUETOOTH */
- char *str;
- PasswordSetting password_setting;
- AcceptSetting accept_setting;
- GtkWidget *check;
- GtkWidget *password_combo;
- GtkWidget *password_entry;
-+#ifdef HAVE_BLUETOOTH
-+ GtkWidget *vbox_share_bluetooth;
-+ GtkWidget *vbox_receive_bluetooth;
- GtkWidget *bluetooth_check;
- GtkWidget *allow_write_bluetooth_check;
- GtkWidget *require_pairing_check;
- GtkWidget *enable_obexpush_check;
- GtkWidget *accept_obexpush_combo;
- GtkWidget *notify_received_obexpush_check;
-+#endif /* HAVE_BLUETOOTH */
-
- client = gconf_client_get_default ();
-
- enabled = gconf_client_get_bool (client,
- FILE_SHARING_ENABLED,
- NULL);
-+
-+ str = gconf_client_get_string (client, FILE_SHARING_REQUIRE_PASSWORD, NULL);
-+ password_setting = password_setting_from_string (str);
-+ g_free (str);
-+
-+#ifdef HAVE_BLUETOOTH
- bluetooth_enabled = gconf_client_get_bool (client,
- FILE_SHARING_BLUETOOTH_ENABLED,
- NULL);
-@@ -121,23 +134,24 @@ update_ui (void)
- FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY,
- NULL);
-
-- str = gconf_client_get_string (client, FILE_SHARING_REQUIRE_PASSWORD, NULL);
-- password_setting = password_setting_from_string (str);
-- g_free (str);
--
- str = gconf_client_get_string (client, FILE_SHARING_BLUETOOTH_OBEXPUSH_ACCEPT_FILES, NULL);
- accept_setting = accept_setting_from_string (str);
- g_free (str);
-+#endif /* HAVE_BLUETOOTH */
-
- check = GTK_WIDGET (gtk_builder_get_object (builder, "enable_check"));
- password_combo = GTK_WIDGET (gtk_builder_get_object (builder, "password_combo"));
- password_entry = GTK_WIDGET (gtk_builder_get_object (builder, "password_entry"));
-+#ifdef HAVE_BLUETOOTH
-+ vbox_share_bluetooth = GTK_WIDGET (gtk_builder_get_object (builder, "vbox_share_bluetooth"));
-+ vbox_receive_bluetooth = GTK_WIDGET (gtk_builder_get_object (builder, "vbox_receive_bluetooth"));
- bluetooth_check = GTK_WIDGET (gtk_builder_get_object (builder, "enable_bluetooth_check"));
- allow_write_bluetooth_check = GTK_WIDGET (gtk_builder_get_object (builder, "allow_write_bluetooth_check"));
- require_pairing_check = GTK_WIDGET (gtk_builder_get_object (builder, "require_pairing_check"));
- enable_obexpush_check = GTK_WIDGET (gtk_builder_get_object (builder, "enable_obexpush_check"));
- accept_obexpush_combo = GTK_WIDGET (gtk_builder_get_object (builder, "accept_obexpush_combo"));
- notify_received_obexpush_check = GTK_WIDGET (gtk_builder_get_object (builder, "notify_received_obexpush_check"));
-+#endif /* HAVE_BLUETOOTH */
-
- /* Network */
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), enabled);
-@@ -147,7 +161,9 @@ update_ui (void)
- gtk_combo_box_set_active (GTK_COMBO_BOX (password_combo),
- password_setting);
-
-+#ifdef HAVE_BLUETOOTH
- /* Bluetooth ObexFTP */
-+ gtk_widget_set_visible (vbox_share_bluetooth, TRUE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (bluetooth_check), bluetooth_enabled);
- gtk_widget_set_sensitive (allow_write_bluetooth_check, bluetooth_enabled);
- gtk_widget_set_sensitive (require_pairing_check, bluetooth_enabled);
-@@ -158,6 +174,7 @@ update_ui (void)
- require_pairing_enabled);
-
- /* Bluetooth ObexPush */
-+ gtk_widget_set_visible (vbox_receive_bluetooth, TRUE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enable_obexpush_check), bluetooth_obexpush_enabled);
- gtk_widget_set_sensitive (accept_obexpush_combo, bluetooth_obexpush_enabled);
- gtk_widget_set_sensitive (notify_received_obexpush_check, bluetooth_obexpush_enabled);
-@@ -167,6 +184,7 @@ update_ui (void)
-
- gtk_combo_box_set_active (GTK_COMBO_BOX (accept_obexpush_combo),
- accept_setting);
-+#endif /* HAVE_BLUETOOTH */
-
- g_object_unref (client);
- }
-@@ -189,6 +207,7 @@ password_required_changed (GConfClient* client,
- update_ui ();
- }
-
-+#ifdef HAVE_BLUETOOTH
- static void
- file_sharing_bluetooth_enabled_changed (GConfClient* client,
- guint cnxn_id,
-@@ -242,6 +261,7 @@ file_sharing_bluetooth_obexpush_notify_changed (GConfClient* client,
- {
- update_ui ();
- }
-+#endif /* HAVE_BLUETOOTH */
-
- static void
- password_combo_changed (GtkComboBox *combo_box)
-@@ -282,6 +302,7 @@ launch_share (void)
+ nautilus_extensiondir = $(NAUTILUSDIR)
+ nautilus_extension_LTLIBRARIES = libnautilus-share-extension.la
+
+@@ -60,6 +66,10 @@ libnautilus_share_extension_la_SOURCES = \
+ libnautilus_share_extension_la_LIBADD = libuser-share-common.la $(EXTENSION_LIBS)
+ libnautilus_share_extension_la_LDFLAGS = -avoid-version -module -no-undefined
+
++if USE_BLUETOOTH
++libnautilus_share_extension_la_LIBADD += $(BLUETOOTH_LIBS)
++endif
++
+ EXTRA_DIST = marshal.list
+
+ CLEANFILES = $(BUILT_SOURCES)
+diff --git a/src/share-extension.c b/src/share-extension.c
+index 7e81b5a..b9e0df4 100644
+--- a/src/share-extension.c
++++ b/src/share-extension.c
+@@ -28,10 +28,13 @@
+ #include <glib/gi18n-lib.h>
+ #include <gio/gdesktopappinfo.h>
+ #include <gtk/gtk.h>
+-#include <bluetooth-client.h>
+ #include <libnautilus-extension/nautilus-menu-provider.h>
+ #include <libnautilus-extension/nautilus-location-widget-provider.h>
+
++#ifdef HAVE_BLUETOOTH
++#include <bluetooth-client.h>
++#endif /* HAVE_BLUETOOTH */
++
+ #include "nautilus-share-bar.h"
+ #include "user_share-common.h"
+
+@@ -89,6 +92,7 @@ bar_response_cb (NautilusShareBar *bar,
+ launch_prefs_on_window ();
+ }
+
++#ifdef HAVE_BLUETOOTH
+ static void
+ downloads_bar_set_from_bluetooth_status (GtkWidget *bar)
+ {
+@@ -109,6 +113,7 @@ default_adapter_powered_cb (GObject *gobject,
+ {
+ downloads_bar_set_from_bluetooth_status (bar);
+ }
++#endif /* HAVE_BLUETOOTH */
+
+ static GtkWidget *
+ nautilus_user_share_get_location_widget (NautilusLocationWidgetProvider *iface,
+@@ -151,8 +156,13 @@ nautilus_user_share_get_location_widget (NautilusLocationWidgetProvider *iface,
+ if (is_dir[0] != FALSE && is_dir[1] != FALSE) {
+ bar = nautilus_share_bar_new (_("May be used to share or receive files"));
+ } else if (is_dir[0] != FALSE) {
++#ifdef HAVE_BLUETOOTH
+ bar = nautilus_share_bar_new (_("May be shared over the network or Bluetooth"));
++#else
++ bar = nautilus_share_bar_new (_("May be shared over the network"));
++#endif /* HAVE_BLUETOOTH */
+ } else {
++#ifdef HAVE_BLUETOOTH
+ BluetoothClient *client;
+
+ bar = nautilus_share_bar_new (_("May be used to receive files over Bluetooth"));
+@@ -162,6 +172,9 @@ nautilus_user_share_get_location_widget (NautilusLocationWidgetProvider *iface,
+ g_signal_connect (G_OBJECT (client), "notify::default-adapter-powered",
+ G_CALLBACK (default_adapter_powered_cb), bar);
+ downloads_bar_set_from_bluetooth_status (bar);
++#else
++ return NULL;
++#endif /* HAVE_BLUETOOTH */
}
- }
-
-+#ifdef HAVE_BLUETOOTH
- static void
- enable_bluetooth_check_toggled (GtkWidget *check)
- {
-@@ -302,6 +323,7 @@ enable_bluetooth_check_toggled (GtkWidget *check)
- if (enabled != FALSE)
- launch_share ();
- }
-+#endif /* HAVE_BLUETOOTH */
-
- static void
- enable_check_toggled (GtkWidget *check)
-@@ -332,6 +354,7 @@ password_entry_changed (GtkEditable *editable)
- flush_password ();
- }
-
-+#ifdef HAVE_BLUETOOTH
- static void
- bluetooth_allow_write_check_toggled (GtkWidget *check)
- {
-@@ -423,6 +446,7 @@ notify_received_obexpush_check_toggled (GtkWidget *check)
-
- g_object_unref (client);
- }
-+#endif /* HAVE_BLUETOOTH */
-
- static GtkWidget *
- error_dialog (const char *title,
-@@ -477,12 +501,14 @@ create_window (void)
- GtkWidget *check;
- GtkWidget *password_combo;
- GtkWidget *password_entry;
-+#ifdef HAVE_BLUETOOTH
- GtkWidget *bluetooth_check;
- GtkWidget *bluetooth_allow_write_check;
- GtkWidget *require_pairing_check;
- GtkWidget *enable_obexpush_check;
- GtkWidget *accept_obexpush_combo;
- GtkWidget *notify_received_obexpush_check;
-+#endif /* HAVE_BLUETOOTH */
- GtkWidget *window;
- GtkListStore *store;
- GtkCellRenderer *cell;
-@@ -513,12 +539,14 @@ create_window (void)
- check = GTK_WIDGET (gtk_builder_get_object (builder, "enable_check"));
- password_combo = GTK_WIDGET (gtk_builder_get_object (builder, "password_combo"));
- password_entry = GTK_WIDGET (gtk_builder_get_object (builder, "password_entry"));
-+#ifdef HAVE_BLUETOOTH
- bluetooth_check = GTK_WIDGET (gtk_builder_get_object (builder, "enable_bluetooth_check"));
- bluetooth_allow_write_check = GTK_WIDGET (gtk_builder_get_object (builder, "allow_write_bluetooth_check"));
- require_pairing_check = GTK_WIDGET (gtk_builder_get_object (builder, "require_pairing_check"));
- enable_obexpush_check = GTK_WIDGET (gtk_builder_get_object (builder, "enable_obexpush_check"));
- accept_obexpush_combo = GTK_WIDGET (gtk_builder_get_object (builder, "accept_obexpush_combo"));
- notify_received_obexpush_check = GTK_WIDGET (gtk_builder_get_object (builder, "notify_received_obexpush_check"));
-+#endif /* HAVE_BLUETOOTH */
-
- store = gtk_list_store_new (1, G_TYPE_STRING);
- gtk_combo_box_set_model (GTK_COMBO_BOX (password_combo),
-@@ -548,6 +576,7 @@ create_window (void)
- g_signal_connect (password_entry,
- "changed", G_CALLBACK (password_entry_changed), NULL);
-
-+#ifdef HAVE_BLUETOOTH
- /* Accept files combo */
- store = gtk_list_store_new (1, G_TYPE_STRING);
- gtk_combo_box_set_model (GTK_COMBO_BOX (accept_obexpush_combo),
-@@ -572,6 +601,7 @@ create_window (void)
- _("Ask"), -1);
- #endif
- g_object_unref (store);
-+#endif /* HAVE_BLUETOOTH */
-
- update_ui ();
-
-@@ -579,6 +609,7 @@ create_window (void)
- "toggled", G_CALLBACK (enable_check_toggled), NULL);
- g_signal_connect (password_combo,
- "changed", G_CALLBACK (password_combo_changed), NULL);
-+#ifdef HAVE_BLUETOOTH
- g_signal_connect (bluetooth_check,
- "toggled", G_CALLBACK (enable_bluetooth_check_toggled), NULL);
- g_signal_connect (bluetooth_allow_write_check,
-@@ -591,6 +622,7 @@ create_window (void)
- "changed", G_CALLBACK (accept_obexpush_combo_changed), NULL);
- g_signal_connect (notify_received_obexpush_check,
- "toggled", G_CALLBACK (notify_received_obexpush_check_toggled), NULL);
-+#endif /* HAVE_BLUETOOTH */
-
- g_signal_connect_swapped (GTK_WIDGET (gtk_builder_get_object (builder, "close_button")),
- "clicked", G_CALLBACK (gtk_widget_destroy), window);
-@@ -610,6 +642,7 @@ create_window (void)
- NULL,
- NULL,
- NULL);
-+#ifdef HAVE_BLUETOOTH
- gconf_client_notify_add (client,
- FILE_SHARING_BLUETOOTH_ENABLED,
- file_sharing_bluetooth_enabled_changed,
-@@ -646,6 +679,7 @@ create_window (void)
- NULL,
- NULL,
- NULL);
-+#endif /* HAVE_BLUETOOTH */
-
- g_object_unref (client);
-
+
+ g_signal_connect (bar, "response",
diff --git a/src/user_share.c b/src/user_share.c
-index e54c5ed..ed87ca1 100644
+index 3bcec7f..139bacd 100644
--- a/src/user_share.c
+++ b/src/user_share.c
-@@ -26,18 +26,22 @@
- #include <gdk/gdkx.h>
+@@ -27,7 +27,6 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
+ #include <glib/gstdio.h>
-#include <bluetooth-client.h>
+ #include <gio/gio.h>
#include <X11/Xlib.h>
- #include "user_share.h"
+@@ -35,11 +34,16 @@
#include "user_share-private.h"
#include "user_share-common.h"
#include "http.h"
@@ -372,27 +190,18 @@
#include <dbus/dbus-glib.h>
+#endif /* HAVE_BLUETOOTH */
- #include <gconf/gconf-client.h>
-
-@@ -48,6 +52,9 @@
- #include <signal.h>
- #include <unistd.h>
-
-+static guint disabled_timeout_tag = 0;
-+
-+#ifdef HAVE_BLUETOOTH
- /* ConsoleKit */
- #define CK_NAME "org.freedesktop.ConsoleKit"
- #define CK_INTERFACE "org.freedesktop.ConsoleKit"
-@@ -56,7 +63,6 @@
- #define CK_SEAT_INTERFACE "org.freedesktop.ConsoleKit.Seat"
- #define CK_SESSION_INTERFACE "org.freedesktop.ConsoleKit.Session"
-
--static guint disabled_timeout_tag = 0;
+ #include <stdarg.h>
+ #include <string.h>
+@@ -56,6 +60,8 @@
+ static GSettings *settings = NULL;
+
+ static guint disabled_timeout_tag = 0;
++
++#ifdef HAVE_BLUETOOTH
+ static GDBusProxy *session_proxy = NULL;
static gboolean has_console = TRUE;
- static BluetoothClient *client = NULL;
-@@ -262,6 +268,7 @@ bluez_init (void)
+@@ -185,6 +191,7 @@ bluez_init (void)
g_signal_connect (G_OBJECT (client), "notify::default-adapter-powered",
G_CALLBACK (default_adapter_changed), NULL);
}
@@ -400,33 +209,50 @@
static void
migrate_old_configuration (void)
-@@ -297,9 +304,13 @@ disabled_timeout_callback (gpointer user_data)
- GConfClient* client = (GConfClient *) user_data;
+@@ -216,9 +223,13 @@ disabled_timeout_callback (void)
+ {
http_down ();
+#ifdef HAVE_BLUETOOTH
- if (gconf_client_get_bool (client, FILE_SHARING_BLUETOOTH_ENABLED, NULL) == FALSE &&
- gconf_client_get_bool (client, FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED, NULL) == FALSE)
+ if (g_settings_get_boolean (settings, FILE_SHARING_BLUETOOTH_ENABLED) == FALSE &&
+ g_settings_get_boolean (settings, FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED) == FALSE)
_exit (0);
-+#else /* HAVE_BLUETOOTH */
++#else
+ _exit (0);
+#endif /* HAVE_BLUETOOTH */
return FALSE;
}
-@@ -330,6 +341,7 @@ file_sharing_enabled_changed (GConfClient* client,
+@@ -246,6 +257,7 @@ file_sharing_enabled_changed (void)
}
}
+#ifdef HAVE_BLUETOOTH
static void
- file_sharing_bluetooth_allow_write_changed (GConfClient* client,
- guint cnxn_id,
-@@ -414,13 +426,16 @@ file_sharing_bluetooth_obexpush_notify_changed (GConfClient* client,
- {
- obexpush_set_notify (gconf_client_get_bool (client, FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY, NULL));
- }
-+#endif /* HAVE_BLUETOOTH */
+ file_sharing_bluetooth_allow_write_changed (void)
+ {
+@@ -312,6 +324,7 @@ file_sharing_bluetooth_obexpush_notify_changed (void)
+ {
+ obexpush_set_notify (g_settings_get_boolean (settings, FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY));
+ }
++#endif /* HAVE_BLUETOOTH */
+
+ static void
+ setttings_changed (GSettings *settings,
+@@ -324,6 +337,7 @@ setttings_changed (GSettings *settings,
+ else if (g_strcmp0 (FILE_SHARING_REQUIRE_PASSWORD, path) == 0)
+ require_password_changed ();
+
++#ifdef HAVE_BLUETOOTH
+ else if (g_strcmp0 (FILE_SHARING_BLUETOOTH_ENABLED, path) == 0)
+ file_sharing_bluetooth_enabled_changed ();
+
+@@ -341,14 +355,17 @@ setttings_changed (GSettings *settings,
+
+ else if (g_strcmp0 (FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY, path) == 0)
+ file_sharing_bluetooth_obexpush_notify_changed ();
++#endif /* HAVE_BLUETOOTH */
+ }
static void
cleanup_handler (int sig)
@@ -439,7 +265,7 @@
_exit (2);
}
-@@ -428,7 +443,9 @@ static int
+@@ -356,7 +373,9 @@ static int
x_io_error_handler (Display *xdisplay)
{
http_down ();
@@ -449,22 +275,22 @@
_exit (2);
}
-@@ -485,20 +502,27 @@ main (int argc, char **argv)
+@@ -411,10 +430,14 @@ main (int argc, char **argv)
+
migrate_old_configuration ();
- client = gconf_client_get_default ();
-+#ifdef HAVE_BLUETOOTH
- if (gconf_client_get_bool (client, FILE_SHARING_ENABLED, NULL) == FALSE &&
- gconf_client_get_bool (client, FILE_SHARING_BLUETOOTH_ENABLED, NULL) == FALSE &&
- gconf_client_get_bool (client, FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED, NULL) == FALSE)
++#ifdef HAVE_BLUETOOTH
+ settings = g_settings_new (GNOME_USER_SHARE_SCHEMAS);
+ if (g_settings_get_boolean (settings, FILE_SHARING_ENABLED) == FALSE &&
+ g_settings_get_boolean (settings, FILE_SHARING_BLUETOOTH_ENABLED) == FALSE &&
+ g_settings_get_boolean (settings, FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED) == FALSE)
++#else
++ if (g_settings_get_boolean (settings, FILE_SHARING_ENABLED) == FALSE)
++#endif /* HAVE_BLUETOOTH */
return 1;
-+#else /* HAVE_BLUETOOTH */
-+ if (gconf_client_get_bool (client, FILE_SHARING_ENABLED, NULL) == FALSE)
-+ return 1;
-+#endif /* HAVE_BLUETOOTH */
x_fd = ConnectionNumber (xdisplay);
- XSetIOErrorHandler (x_io_error_handler);
+@@ -422,22 +445,28 @@ main (int argc, char **argv)
if (http_init () == FALSE)
return 1;
@@ -475,40 +301,24 @@
return 1;
+#endif /* HAVE_BLUETOOTH */
- gconf_client_add_dir (client,
- FILE_SHARING_DIR,
-@@ -517,6 +541,7 @@ main (int argc, char **argv)
- NULL,
- NULL,
- NULL);
-+#ifdef HAVE_BLUETOOTH
- gconf_client_notify_add (client,
- FILE_SHARING_BLUETOOTH_ENABLED,
- file_sharing_bluetooth_enabled_changed,
-@@ -553,18 +578,23 @@ main (int argc, char **argv)
- NULL,
- NULL,
- NULL);
-+#endif /* HAVE_BLUETOOTH */
-
- g_object_unref (client);
+ g_signal_connect (settings, "changed", G_CALLBACK(setttings_changed), NULL);
+#ifdef HAVE_BLUETOOTH
bluez_init ();
- consolekit_init ();
+ session_init ();
+#endif /* HAVE_BLUETOOTH */
/* Initial setting */
- file_sharing_enabled_changed (client, 0, NULL, NULL);
-+#ifdef HAVE_BLUETOOTH
- file_sharing_bluetooth_enabled_changed (client, 0, NULL, NULL);
- file_sharing_bluetooth_obexpush_accept_files_changed (client, 0, NULL, NULL);
- file_sharing_bluetooth_obexpush_notify_changed (client, 0, NULL, NULL);
- file_sharing_bluetooth_obexpush_enabled_changed (client, 0, NULL, NULL);
+ file_sharing_enabled_changed ();
++#ifdef HAVE_BLUETOOTH
+ file_sharing_bluetooth_enabled_changed ();
+ file_sharing_bluetooth_obexpush_accept_files_changed ();
+ file_sharing_bluetooth_obexpush_notify_changed ();
+ file_sharing_bluetooth_obexpush_enabled_changed ();
+#endif /* HAVE_BLUETOOTH */
gtk_main ();
-
+ g_object_unref (settings);
--
-1.7.10
-
+1.7.10.4
+
More information about the pkg-gnome-commits
mailing list