summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2014-01-22 12:14:36 +0000
committerChristophe Fergeau <cfergeau@redhat.com>2014-01-23 16:15:39 +0100
commit08e2d48644cd0a3e01cb603b1b5458b148193864 (patch)
tree6b563d95574a2cc44649afd963af7187171ed011
parentb75e39d2921b793d78f3dcfabb2dcbe7dc0070d3 (diff)
Paranoia values should be flags not enumgsettings
https://bugzilla.gnome.org/show_bug.cgi?id=625897
-rw-r--r--data/org.gnome.sound-juicer.gschema.xml11
-rw-r--r--src/sj-main.c12
2 files changed, 13 insertions, 10 deletions
diff --git a/data/org.gnome.sound-juicer.gschema.xml b/data/org.gnome.sound-juicer.gschema.xml
index 83d0e0f..9a75d14 100644
--- a/data/org.gnome.sound-juicer.gschema.xml
+++ b/data/org.gnome.sound-juicer.gschema.xml
@@ -1,14 +1,13 @@
<?xml version="1.0"?>
<schemalist>
- <enum id="org.gnome.sound-juicer.paranoia">
+ <flags id="org.gnome.sound-juicer.paranoia">
<value nick="disable" value="0"/>
<value nick="fragment" value="2"/>
<value nick="overlap" value="4"/>
<value nick="scratch" value="8"/>
<value nick="repair" value="16"/>
- <value nick="full" value="255"/>
- </enum>
+ </flags>
<schema gettext-domain="sound-juicer" id="org.gnome.sound-juicer" path="/org/gnome/sound-juicer/">
@@ -48,10 +47,10 @@
<description>Do not specify an extension. Format specifiers: %at - album title; %aT - album title (lowercase); %aa - album artist; %aA - album artist (lowercase); %as - album artist (sortable); %aS - album artist (sortable lowercase); %ac - album composer; %aC - album composer (lowercase); %ap - album composer (sortable); %aP - album composer (sortable lowercase); %tn - track number (i.e 8); %tN - track number, zero padded (i.e 08); %tt - track title; %tT - track title (lowercase); %ta - track artist; %tA - track artist (lowercase); %ts - track artist (sortable); %tS - track artist (sortable lowercase); %tc - track composer; %tC - track composer (lowercase); %tp - track composer (sortable); %tP - track composer (sortable lowercase); %dn - disc and track number (i.e Disk 2 - 6, or 6); %dN - disc number, zero padded (i.e d02t06, or 06)</description>
</key>
- <key name="paranoia" enum="org.gnome.sound-juicer.paranoia">
- <default>'scratch'</default>
+ <key name="paranoia" flags="org.gnome.sound-juicer.paranoia">
+ <default>["fragment","overlap","scratch"]</default>
<summary>The paranoia mode to use</summary>
- <description>Paranoia mode: 0) disable; 2) fragment; 4) overlap; 8) scratch; 16) repair; 255) full</description>
+ <description>Paranoia flags: disable; fragment; overlap; scratch; repair</description>
</key>
<key name="strip-special" type="b">
diff --git a/src/sj-main.c b/src/sj-main.c
index 293db11..7a8287f 100644
--- a/src/sj-main.c
+++ b/src/sj-main.c
@@ -103,7 +103,7 @@ static char *device = NULL, **uris = NULL;
static guint debug_flags = 0;
-#define DEFAULT_PARANOIA 4
+#define DEFAULT_PARANOIA 15
#define RAISE_WINDOW "raise-window"
#define SOURCE_BUILDER "../data/sound-juicer.ui"
#define INSTALLED_BUILDER DATADIR"/sound-juicer/sound-juicer.ui"
@@ -1130,9 +1130,13 @@ static void paranoia_changed_cb (GSettings *settings, gchar *key, gpointer user_
{
int value;
g_assert (strcmp (key, SJ_SETTINGS_PARANOIA) == 0);
- value = g_settings_get_enum (settings, key);
- if (value == 0 || value == 2 || value == 4 || value == 8 || value == 16 || value == 255) {
- sj_extractor_set_paranoia (extractor, value);
+ value = g_settings_get_flags (settings, key);
+ if (value >= 0) {
+ if (value < 32) {
+ sj_extractor_set_paranoia (extractor, value);
+ } else {
+ sj_extractor_set_paranoia (extractor, DEFAULT_PARANOIA);
+ }
}
}