Skip to content

Commit

Permalink
Remove unused legacy settings
Browse files Browse the repository at this point in the history
  • Loading branch information
dar5hak committed Aug 28, 2021
1 parent b74a27e commit 44cdc4c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 55 deletions.
34 changes: 0 additions & 34 deletions data/gschema.xml
Original file line number Diff line number Diff line change
@@ -1,35 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<!-- Obsolete. Replaced with the timers schema. Will be removed at some point. -->
<schema
path="/com/github/elfenware/badger/reminders/"
id="com.github.elfenware.badger.reminders"
gettext-domain="com.github.elfenware.badger">
<key name="all" type="b">
<default>true</default>
<summary>Global switch to control all reminders</summary>
</key>
<key name="eyes" type="b">
<default>true</default>
<summary>Remind the user to blink their eyes</summary>
</key>
<key name="fingers" type="b">
<default>true</default>
<summary>Remind the user to stretch their fingers</summary>
</key>
<key name="legs" type="b">
<default>true</default>
<summary>Remind the user to stretch their legs</summary>
</key>
<key name="arms" type="b">
<default>true</default>
<summary>Remind the user to stretch their arms</summary>
</key>
<key name="neck" type="b">
<default>true</default>
<summary>Remind the user to stretch their neck</summary>
</key>
</schema>
<schema
path="/com/github/elfenware/badger/timers/"
id="com.github.elfenware.badger.timers"
Expand Down Expand Up @@ -86,10 +56,6 @@
<default>false</default>
<summary>Whether to show the posture reminders</summary>
</key>
<key name="old-settings-replaced" type="b">
<default>false</default>
<summary>Whether the installation has switched to the newer custom timers instead of booleans</summary>
</key>
</schema>
<schema
path="/com/github/elfenware/badger/state/"
Expand Down
21 changes: 0 additions & 21 deletions src/MainGrid.vala
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,6 @@ public class Badger.MainGrid : Gtk.Grid {
public MainGrid (Reminder[] reminders) {
var settings = new GLib.Settings ("com.github.elfenware.badger.timers");

/* GSettings migration code. Will be removed at some point. */
if (!settings.get_boolean ("old-settings-replaced")) {
var old_settings = new GLib.Settings ("com.github.elfenware.badger.reminders");
var key_names = new string[5];
key_names[0] = "eyes";
key_names[1] = "fingers";
key_names[2] = "legs";
key_names[3] = "arms";
key_names[4] = "neck";

foreach (string key in key_names) {
bool old_value = old_settings.get_boolean (key);
if (!old_value) {
settings.set_uint (key, 0);
}
}

settings.set_boolean ("old-settings-replaced", true);
}
/* GSettings migration code ends. */

row_spacing = 4;
column_spacing = 12;
margin_bottom = 12;
Expand Down

0 comments on commit 44cdc4c

Please sign in to comment.