Browse Source

Simplify getPluginManager calls in the swing UI.

No point calling getMain().getPluginManager() when the controller
has a nice reference you can get at.

Change-Id: I0ed3433cacaa00c08833f456ad5a5f0e65e5ebb8
Reviewed-on: http://gerrit.dmdirc.com/2663
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
tags/0.8
Chris Smith 10 years ago
parent
commit
84f6e25645

+ 3
- 3
src/com/dmdirc/addons/ui_swing/components/addonbrowser/InstallWorker.java View File

@@ -67,11 +67,11 @@ public class InstallWorker extends LoggingSwingWorker<String, Void> {
67 67
                     ActionManager.installActionPack(file.getAbsolutePath());
68 68
                     break;
69 69
                 case TYPE_PLUGIN:
70
-                    final File newFile = new File(controller.getMain()
71
-                            .getPluginManager().getDirectory(),
70
+                    final File newFile = new File(
71
+                            controller.getPluginManager().getDirectory(),
72 72
                             info.getTitle() + ".jar");
73 73
                     if (file.renameTo(newFile)) {
74
-                        controller.getMain().getPluginManager().addPlugin(
74
+                        controller.getPluginManager().addPlugin(
75 75
                                 newFile.getName());
76 76
                     } else {
77 77
                         return "Unable to install addon, failed to move file: "

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/addonpanel/PluginPanel.java View File

@@ -63,7 +63,7 @@ public class PluginPanel extends AddonPanel implements ActionListener {
63 63
 
64 64
         ActionManager.getActionManager().registerListener(this,
65 65
                 CoreActionType.PLUGIN_REFRESH);
66
-        controller.getMain().getPluginManager().refreshPlugins();
66
+        controller.getPluginManager().refreshPlugins();
67 67
     }
68 68
 
69 69
     /** {@inheritDoc} */
@@ -71,7 +71,7 @@ public class PluginPanel extends AddonPanel implements ActionListener {
71 71
     protected JTable populateList(final JTable table) {
72 72
         final List<PluginInfo> list = new ArrayList<PluginInfo>();
73 73
         final List<PluginInfo> sortedList = new ArrayList<PluginInfo>();
74
-        list.addAll(controller.getMain().getPluginManager().getPluginInfos());
74
+        list.addAll(controller.getPluginManager().getPluginInfos());
75 75
         Collections.sort(list);
76 76
         for (final PluginInfo plugin : list) {
77 77
             if (plugin.getMetaData().getParents().length == 0) {

+ 1
- 2
src/com/dmdirc/addons/ui_swing/dialogs/about/LicenceLoader.java View File

@@ -81,8 +81,7 @@ public class LicenceLoader extends LoggingSwingWorker<Void, Void> {
81 81
                     + "no resource manager");
82 82
         } else {
83 83
             addCoreLicences(rm);
84
-            for (PluginInfo pi : controller.getMain().getPluginManager()
85
-                    .getPluginInfos()) {
84
+            for (PluginInfo pi : controller.getPluginManager().getPluginInfos()) {
86 85
                 addPluginLicences(pi);
87 86
             }
88 87
         }

Loading…
Cancel
Save