From e142da742ce7f1bd4dc41ac7065e6be2aeafaa9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Fri, 8 Nov 2024 08:12:46 +0100 Subject: [PATCH] Cookie watcher does not depend on config. --- src/com/jpexs/decompiler/flash/gui/Main.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index 17701bcad..2db21613e 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -1986,7 +1986,7 @@ public class Main { getMainFrame().getPanel().refreshTree(); } }); - if (watcher != null) { + if (watcher != null && Configuration.checkForModifications.get()) { try { File dir = new File(fileName).getParentFile(); if (dir == null) { @@ -2491,13 +2491,12 @@ public class Main { offerAssociation(); loadingDialog = new LoadingDialog(getDefaultDialogsOwner()); - if (Configuration.checkForModifications.get()) { - try { - watcher = FileSystems.getDefault().newWatchService(); - } catch (IOException ex) { - //ignore - } + try { + watcher = FileSystems.getDefault().newWatchService(); + } catch (IOException ex) { + //ignore } + if (watcher != null) { watcherWorker = new SwingWorker() { @@ -2536,7 +2535,7 @@ public class Main { }); } - if (watchedDirectories.containsKey(key)) { + if (Configuration.checkForModifications.get() && watchedDirectories.containsKey(key)) { File dir = watchedDirectories.get(key); java.nio.file.Path child = dir.toPath().resolve(filename); File fullPath = child.toFile();