[gnome-user-share] webdav: Fix launching the webdav server
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-user-share] webdav: Fix launching the webdav server
- Date: Wed, 25 Jun 2014 09:46:35 +0000 (UTC)
commit 8f86bf5482d476b76524f480075eac8f8c61a4e5
Author: Bastien Nocera <hadess hadess net>
Date: Wed Jun 25 11:45:03 2014 +0200
webdav: Fix launching the webdav server
It was relying on the non-existent "enabled" setting.
src/user_share-private.h | 1 -
src/user_share-webdav.c | 49 +++------------------------------------------
2 files changed, 4 insertions(+), 46 deletions(-)
---
diff --git a/src/user_share-private.h b/src/user_share-private.h
index f57bc1e..3734722 100644
--- a/src/user_share-private.h
+++ b/src/user_share-private.h
@@ -27,7 +27,6 @@
#define GNOME_USER_SHARE_SCHEMAS "org.gnome.desktop.file-sharing"
-#define FILE_SHARING_ENABLED "enabled"
#define FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED "bluetooth-obexpush-enabled"
#define FILE_SHARING_REQUIRE_PASSWORD "require-password"
diff --git a/src/user_share-webdav.c b/src/user_share-webdav.c
index e2e7c24..334a583 100644
--- a/src/user_share-webdav.c
+++ b/src/user_share-webdav.c
@@ -49,10 +49,6 @@
#define GNOME_SESSION_DBUS_OBJECT "/org/gnome/SessionManager"
#define GNOME_SESSION_DBUS_INTERFACE "org.gnome.SessionManager"
-static GSettings *settings = NULL;
-
-static guint disabled_timeout_tag = 0;
-
static void
migrate_old_configuration (void)
{
@@ -76,47 +72,12 @@ require_password_changed (void)
}
}
-/* File sharing was disabled for some time, exit now */
-/* If we re-enable it in the ui, this will be restarted anyway */
-static gboolean
-disabled_timeout_callback (void)
-{
- http_down ();
- return FALSE;
-}
-
-static void
-file_sharing_enabled_changed (void)
-{
- gboolean enabled;
-
- if (disabled_timeout_tag != 0) {
- g_source_remove (disabled_timeout_tag);
- disabled_timeout_tag = 0;
- }
-
- enabled = g_settings_get_boolean (settings,
- FILE_SHARING_ENABLED);
- if (enabled) {
- if (http_get_pid () == 0) {
- http_up ();
- }
- } else {
- http_down ();
- disabled_timeout_tag = g_timeout_add_seconds (3,
- (GSourceFunc) disabled_timeout_callback,
- NULL);
- }
-}
-
static void
setttings_changed (GSettings *settings,
gchar *path,
gpointer data)
{
- if (g_strcmp0 (FILE_SHARING_ENABLED, path) == 0)
- file_sharing_enabled_changed ();
- else if (g_strcmp0 (FILE_SHARING_REQUIRE_PASSWORD, path) == 0)
+ if (g_strcmp0 (FILE_SHARING_REQUIRE_PASSWORD, path) == 0)
require_password_changed ();
}
@@ -141,6 +102,7 @@ main (int argc, char **argv)
G_GNUC_UNUSED int x_fd;
Window selection_owner;
Atom xatom;
+ GSettings *settings;
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -185,9 +147,6 @@ main (int argc, char **argv)
migrate_old_configuration ();
- settings = g_settings_new (GNOME_USER_SHARE_SCHEMAS);
- if (g_settings_get_boolean (settings, FILE_SHARING_ENABLED) == FALSE)
- return 1;
x_fd = ConnectionNumber (xdisplay);
XSetIOErrorHandler (x_io_error_handler);
@@ -195,10 +154,11 @@ main (int argc, char **argv)
if (http_init () == FALSE)
return 1;
+ settings = g_settings_new (GNOME_USER_SHARE_SCHEMAS);
g_signal_connect (settings, "changed", G_CALLBACK(setttings_changed), NULL);
/* Initial setting */
- file_sharing_enabled_changed ();
+ http_up ();
gtk_main ();
@@ -207,4 +167,3 @@ main (int argc, char **argv)
return 0;
}
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]