diff options
author | Jens Georg <mail@jensge.org> | 2015-07-05 20:33:57 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2015-07-05 22:31:58 +0200 |
commit | 78b32d2e512082133e4d0da5647a2eb3e9770b60 (patch) | |
tree | bf8278971b1ed0a76d7ff6092bfeb34e7e5e199f /src | |
parent | 853b43ea06b4f9dc56a272e1d60517e2a9afece8 (diff) | |
download | rygel-78b32d2e512082133e4d0da5647a2eb3e9770b60.tar.gz |
core,ui: Remove "enable-upnp" setting
Signed-off-by: Jens Georg <mail@jensge.org>
https://bugzilla.gnome.org/show_bug.cgi?id=748404
Diffstat (limited to 'src')
-rw-r--r-- | src/librygel-core/rygel-base-configuration.vala | 4 | ||||
-rw-r--r-- | src/librygel-core/rygel-configuration.vala | 3 | ||||
-rw-r--r-- | src/librygel-core/rygel-meta-config.vala | 23 | ||||
-rw-r--r-- | src/rygel/rygel-cmdline-config.vala | 11 | ||||
-rw-r--r-- | src/rygel/rygel-environment-config.vala | 5 | ||||
-rw-r--r-- | src/rygel/rygel-main.vala | 9 | ||||
-rw-r--r-- | src/rygel/rygel-user-config.vala | 9 | ||||
-rw-r--r-- | src/ui/rygel-writable-user-config.vala | 9 |
8 files changed, 2 insertions, 71 deletions
diff --git a/src/librygel-core/rygel-base-configuration.vala b/src/librygel-core/rygel-base-configuration.vala index 830783fd..1021c233 100644 --- a/src/librygel-core/rygel-base-configuration.vala +++ b/src/librygel-core/rygel-base-configuration.vala @@ -26,10 +26,6 @@ * Mainly useful to only implement a small subset of the configuration. */ public class Rygel.BaseConfiguration : Rygel.Configuration, Object { - public virtual bool get_upnp_enabled () throws GLib.Error { - throw new ConfigurationError.NO_VALUE_SET (_("Not implemented")); - } - public virtual string get_interface () throws GLib.Error { throw new ConfigurationError.NO_VALUE_SET (_("Not implemented")); } diff --git a/src/librygel-core/rygel-configuration.vala b/src/librygel-core/rygel-configuration.vala index 7f994de0..6d7646e0 100644 --- a/src/librygel-core/rygel-configuration.vala +++ b/src/librygel-core/rygel-configuration.vala @@ -31,7 +31,6 @@ public errordomain Rygel.ConfigurationError { } public enum Rygel.ConfigurationEntry { - UPNP_ENABLED, INTERFACE, PORT, TRANSCODING, @@ -73,8 +72,6 @@ public interface Rygel.Configuration : GLib.Object { */ public signal void setting_changed (string section, string key); - public abstract bool get_upnp_enabled () throws GLib.Error; - [Deprecated (since="0.19.2", replacement="get_interfaces")] public abstract string get_interface () throws GLib.Error; diff --git a/src/librygel-core/rygel-meta-config.vala b/src/librygel-core/rygel-meta-config.vala index ec447a5e..2c3641be 100644 --- a/src/librygel-core/rygel-meta-config.vala +++ b/src/librygel-core/rygel-meta-config.vala @@ -73,25 +73,6 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { } } - public bool get_upnp_enabled () throws GLib.Error { - bool val = true; - bool unavailable = true; - - foreach (var config in MetaConfig.configs) { - try { - val = config.get_upnp_enabled (); - unavailable = false; - break; - } catch (GLib.Error err) {} - } - - if (unavailable) { - throw new ConfigurationError.NO_VALUE_SET (_("No value available")); - } - - return val; - } - public string get_interface () throws GLib.Error { string val = null; bool unavailable = true; @@ -486,10 +467,6 @@ public class Rygel.MetaConfig : GLib.Object, Configuration { ConfigurationEntry entry) { try { switch (entry) { - case ConfigurationEntry.UPNP_ENABLED: - config.get_upnp_enabled (); - break; - case ConfigurationEntry.INTERFACE: config.get_interfaces (); break; diff --git a/src/rygel/rygel-cmdline-config.vala b/src/rygel/rygel-cmdline-config.vala index 92571e33..051e2608 100644 --- a/src/rygel/rygel-cmdline-config.vala +++ b/src/rygel/rygel-cmdline-config.vala @@ -40,7 +40,6 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { private static string[] ifaces; private static int port; - private static bool no_upnp; private static bool no_transcoding; private static bool disallow_upload; @@ -95,8 +94,6 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { N_ ("Set plugin titles"), "PluginName:TITLE" }, { "plugin-option", 'o', 0, OptionArg.STRING_ARRAY, ref plugin_options, N_ ("Set plugin options"), "PluginName:OPTION:VALUE1[,VALUE2,..]" }, - { "disable-upnp", 'P', 0, OptionArg.NONE, ref no_upnp, - N_ ("Disable UPnP (streaming-only)"), null }, { "config", 'c', 0, OptionArg.FILENAME, ref config_file, N_ ("Use configuration file instead of user configuration"), "FILE" }, { "shutdown", 's', 0, OptionArg.NONE, ref shutdown, @@ -159,14 +156,6 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration { } } - public bool get_upnp_enabled () throws GLib.Error { - if (!no_upnp) { - throw new ConfigurationError.NO_VALUE_SET (_("No value available")); - } else { - return false; - } - } - public string get_interface () throws GLib.Error { if (ifaces == null) { throw new ConfigurationError.NO_VALUE_SET (_("No value available")); diff --git a/src/rygel/rygel-environment-config.vala b/src/rygel/rygel-environment-config.vala index c0f02498..9932c6af 100644 --- a/src/rygel/rygel-environment-config.vala +++ b/src/rygel/rygel-environment-config.vala @@ -36,7 +36,6 @@ internal class Rygel.EnvironmentConfig : GLib.Object, Configuration { private static string ENABLED_KEY = "ENABLED"; private static string INTERFACE_ENV = RYGEL_PREFIX + "_IFACE"; private static string PORT_ENV = RYGEL_PREFIX + "_PORT"; - private static string DISABLE_UPNP_ENV = DISABLE_PREFIX + "_UPNP"; private static string TRANSCODING_ENV = DISABLE_PREFIX + "_TRANSCODING"; private static string DISALLOW_UPLOAD_ENV = DISABLE_PREFIX + "_UPLOAD"; private static string DISALLOW_DELETION_ENV = DISABLE_PREFIX + "_DELETION"; @@ -56,10 +55,6 @@ internal class Rygel.EnvironmentConfig : GLib.Object, Configuration { return config; } - public bool get_upnp_enabled () throws GLib.Error { - return !this.get_bool_variable (DISABLE_UPNP_ENV); - } - public string get_interface () throws GLib.Error { return this.get_string_variable (INTERFACE_ENV); } diff --git a/src/rygel/rygel-main.vala b/src/rygel/rygel-main.vala index 04f22c3f..3b4ef0a9 100644 --- a/src/rygel/rygel-main.vala +++ b/src/rygel/rygel-main.vala @@ -78,12 +78,6 @@ internal class Rygel.Main : Object { } private int run () { - try { - if (!this.config.get_upnp_enabled ()) { - message (_("Rygel is running in streaming-only mode.")); - } - } catch (Error error) { } - message (_("Rygel v%s starting…"), BuildConfig.PACKAGE_VERSION); this.main_loop.run (); @@ -219,8 +213,7 @@ internal class Rygel.Main : Object { try { var device = factory.create (plugin); - device.available = plugin.active && - this.config.get_upnp_enabled (); + device.available = plugin.active; // Due to pure evilness of unix sinals this might actually happen // if someone shuts down rygel while the call-back is running, diff --git a/src/rygel/rygel-user-config.vala b/src/rygel/rygel-user-config.vala index 532c19bd..089177b1 100644 --- a/src/rygel/rygel-user-config.vala +++ b/src/rygel/rygel-user-config.vala @@ -42,7 +42,6 @@ public class Rygel.UserConfig : GLib.Object, Configuration { public static const string IFACE_KEY = "interface"; public static const string PORT_KEY = "port"; public static const string ENABLED_KEY = "enabled"; - public static const string UPNP_ENABLED_KEY = "upnp-" + ENABLED_KEY; public static const string TITLE_KEY = "title"; public static const string TRANSCODING_KEY = "enable-transcoding"; public static const string ALLOW_UPLOAD_KEY = "allow-upload"; @@ -105,10 +104,6 @@ public class Rygel.UserConfig : GLib.Object, Configuration { general_config_keys.set (PORT_KEY, new ConfigPair (ConfigurationEntry.PORT, EntryType.INT)); - general_config_keys.set (UPNP_ENABLED_KEY, - new ConfigPair - (ConfigurationEntry.UPNP_ENABLED, - EntryType.BOOL)); general_config_keys.set (TRANSCODING_KEY, new ConfigPair (ConfigurationEntry.TRANSCODING, EntryType.BOOL)); @@ -149,10 +144,6 @@ public class Rygel.UserConfig : GLib.Object, Configuration { EntryType.STRING)); } - public bool get_upnp_enabled () throws GLib.Error { - return this.get_bool (GENERAL_SECTION, UPNP_ENABLED_KEY); - } - [CCode (array_length=false, array_null_terminated = true)] public string[] get_interfaces () throws GLib.Error { var interfaces = this.get_string_list (GENERAL_SECTION, diff --git a/src/ui/rygel-writable-user-config.vala b/src/ui/rygel-writable-user-config.vala index ab5b01fd..22b627b8 100644 --- a/src/ui/rygel-writable-user-config.vala +++ b/src/ui/rygel-writable-user-config.vala @@ -60,11 +60,8 @@ public class Rygel.WritableUserConfig : Rygel.UserConfig { public bool is_upnp_enabled () { try { var autostart_file = this.get_autostart_file (); - if (this.user_config.query_exists () && autostart_file.query_exists ()) { - return this.get_upnp_enabled (); - } - return false; + return autostart_file.query_exists (); } catch (Error error) { return false; } @@ -192,8 +189,6 @@ public class Rygel.WritableUserConfig : Rygel.UserConfig { try { dest.make_symbolic_link (source_path, null); } catch (IOError.EXISTS err) {} - - this.set_bool ("general", UPNP_ENABLED_KEY, true); } else { // Stop service only if already running // Then delete the symlink from user's autostart dir @@ -201,8 +196,6 @@ public class Rygel.WritableUserConfig : Rygel.UserConfig { dest.delete (null); } catch (IOError.NOT_FOUND err) {} - this.set_bool ("general", UPNP_ENABLED_KEY, false); - if (this.is_upnp_enabled ()) { // Create proxy to Rygel DBusInterface rygel_proxy = Bus.get_proxy_sync |