Pārlūkot izejas kodu

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 gadus atpakaļ
vecāks
revīzija
589293d2c0
1 mainītis faili ar 9 papildinājumiem un 0 dzēšanām
  1. 9
    0
      src/com/dmdirc/Main.java

+ 9
- 0
src/com/dmdirc/Main.java Parādīt failu

496
                         resourceName.length()));
496
                         resourceName.length()));
497
 
497
 
498
                 if (!newFile.isDirectory()) {
498
                 if (!newFile.isDirectory()) {
499
+                    final PluginManager pm = PluginManager.getPluginManager();
500
+
499
                     ResourceManager.getResourceManager().
501
                     ResourceManager.getResourceManager().
500
                             resourceToFile(resource.getValue(), newFile);
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
             } catch (IOException ex) {
511
             } catch (IOException ex) {
503
                 Logger.userError(ErrorLevel.LOW, "Failed to extract plugins", ex);
512
                 Logger.userError(ErrorLevel.LOW, "Failed to extract plugins", ex);

Notiek ielāde…
Atcelt
Saglabāt