[geary/mjog/port-to-libhandy-1: 91/95] Components.PreferencesWindow: Remove unused code




commit d274b6e7e982f78b7f8afa795095348a928deccd
Author: Michael Gratton <mike vee net>
Date:   Tue Aug 18 21:32:07 2020 +1000

    Components.PreferencesWindow: Remove unused code

 .../components/components-preferences-window.vala  | 47 ----------------------
 1 file changed, 47 deletions(-)
---
diff --git a/src/client/components/components-preferences-window.vala 
b/src/client/components/components-preferences-window.vala
index 2fcb8ca9c..7c97e781d 100644
--- a/src/client/components/components-preferences-window.vala
+++ b/src/client/components/components-preferences-window.vala
@@ -255,53 +255,6 @@ public class Components.PreferencesWindow : Hdy.PreferencesWindow {
         add(page);
     }
 
-    private Hdy.ActionRow new_plugin_row(Peas.PluginInfo plugin) {
-        var @switch = new Gtk.Switch();
-        @switch.active = plugin.is_loaded();
-        @switch.notify["active"].connect_after(
-            () => enable_plugin(plugin, switch)
-        );
-        @switch.valign = CENTER;
-
-        var row = new Hdy.ActionRow();
-        row.title = plugin.get_name();
-        row.subtitle = plugin.get_description();
-        row.activatable_widget = @switch;
-        row.add(@switch);
-
-        return row;
-    }
-
-    private void enable_plugin(Peas.PluginInfo plugin, Gtk.Switch @switch) {
-        if (@switch.active && !plugin.is_loaded()) {
-            bool loaded = false;
-            try {
-                loaded = this.plugins.load_optional(plugin);
-            } catch (GLib.Error err) {
-                warning(
-                    "Plugin %s not able to be loaded: %s",
-                    plugin.get_name(), err.message
-                );
-            }
-            if (!loaded) {
-                @switch.active = false;
-            }
-        } else if (!@switch.active && plugin.is_loaded()) {
-            bool unloaded = false;
-            try {
-                unloaded = this.plugins.unload_optional(plugin);
-            } catch (GLib.Error err) {
-                warning(
-                    "Plugin %s not able to be loaded: %s",
-                    plugin.get_name(), err.message
-                );
-            }
-            if (!unloaded) {
-                @switch.active = true;
-            }
-        }
-    }
-
     private void on_close() {
         close();
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]