Sfoglia il codice sorgente

Fix issues with extracting plugins

Tell the plugin system that a plugin has been updated when we
extract it from within the jar. This forces it to get a new
resource manager, prevenint it from using the stale one.

Fixes CLIENT-184

Change-Id: I93bd2f705baf1ccd34b2ba3a6db107b694690ea4
Reviewed-on: http://gerrit.dmdirc.com/1809
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.6.5rc1
Chris Smith 13 anni fa
parent
commit
589293d2c0
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9
    0
      src/com/dmdirc/Main.java

+ 9
- 0
src/com/dmdirc/Main.java Vedi File

@@ -496,8 +496,17 @@ public final class Main {
496 496
                         resourceName.length()));
497 497
 
498 498
                 if (!newFile.isDirectory()) {
499
+                    final PluginManager pm = PluginManager.getPluginManager();
500
+
499 501
                     ResourceManager.getResourceManager().
500 502
                             resourceToFile(resource.getValue(), newFile);
503
+
504
+                    final PluginInfo plugin = pm.getPluginInfo(newFile
505
+                            .getAbsolutePath().substring(pm.getDirectory().length()));
506
+
507
+                    if (plugin != null) {
508
+                        plugin.pluginUpdated();
509
+                    }
501 510
                 }
502 511
             } catch (IOException ex) {
503 512
                 Logger.userError(ErrorLevel.LOW, "Failed to extract plugins", ex);

Loading…
Annulla
Salva