Przeglądaj źródła

Fix weird plugin path construction.

We have a path, it doesn't really make sense to take the filename,
then take the directory, then create a new path using those...
pull/605/head
Chris Smith 8 lat temu
rodzic
commit
e54b0331f1

+ 1
- 3
src/com/dmdirc/plugins/PluginInfo.java Wyświetl plik

@@ -39,7 +39,6 @@ import java.nio.file.FileSystems;
39 39
 import java.nio.file.FileVisitResult;
40 40
 import java.nio.file.Files;
41 41
 import java.nio.file.Path;
42
-import java.nio.file.Paths;
43 42
 import java.nio.file.SimpleFileVisitor;
44 43
 import java.nio.file.attribute.BasicFileAttributes;
45 44
 import java.util.ArrayList;
@@ -111,7 +110,6 @@ public class PluginInfo implements ServiceProvider {
111 110
     public PluginInfo(
112 111
             final PluginManager pluginManager,
113 112
             final ServiceManager serviceManager,
114
-            final String pluginDirectory,
115 113
             final PluginMetaData metadata,
116 114
             final DMDircMBassador eventBus,
117 115
             final IdentityController identityController,
@@ -125,7 +123,7 @@ public class PluginInfo implements ServiceProvider {
125 123
         this.metaData = metadata;
126 124
 
127 125
         try {
128
-            pluginFilesystem = FileSystems.newFileSystem(Paths.get(pluginDirectory, filename), null);
126
+            pluginFilesystem = FileSystems.newFileSystem(metadata.getPluginPath(), null);
129 127
         } catch (IOException ex) {
130 128
             lastError = "Error loading filesystem: " + ex.getMessage();
131 129
             throw new PluginException("Plugin " + filename + " failed to load. " + lastError, ex);

+ 1
- 1
src/com/dmdirc/plugins/PluginManager.java Wyświetl plik

@@ -149,7 +149,7 @@ public class PluginManager {
149 149
             final PluginMetaData metadata = new PluginMetaData(this,
150 150
                     Paths.get(directory, filename));
151 151
             metadata.load();
152
-            final PluginInfo pluginInfo = new PluginInfo(this, serviceManager, directory, metadata,
152
+            final PluginInfo pluginInfo = new PluginInfo(this, serviceManager, metadata,
153 153
                     eventBus, identityController, objectGraph);
154 154
             final PluginInfo existing = getPluginInfoByName(metadata.getName());
155 155
             if (existing != null) {

Ładowanie…
Anuluj
Zapisz