diff --git a/src/main/java/com/rarchives/ripme/ripper/AbstractRipper.java b/src/main/java/com/rarchives/ripme/ripper/AbstractRipper.java index 8a72482a..4bf1a7e0 100644 --- a/src/main/java/com/rarchives/ripme/ripper/AbstractRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/AbstractRipper.java @@ -28,7 +28,7 @@ public abstract class AbstractRipper implements RipperInterface, Runnable { protected static final Logger logger = Logger.getLogger(AbstractRipper.class); - private final String URLHistoryFile = Utils.getConfigDir() + File.separator + "url_history.txt"; + private final String URLHistoryFile = Utils.getURLHistoryFile(); public static final String USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:36.0) Gecko/20100101 Firefox/36.0"; diff --git a/src/main/java/com/rarchives/ripme/ui/MainWindow.java b/src/main/java/com/rarchives/ripme/ui/MainWindow.java index 984e750d..38c73889 100644 --- a/src/main/java/com/rarchives/ripme/ui/MainWindow.java +++ b/src/main/java/com/rarchives/ripme/ui/MainWindow.java @@ -665,6 +665,7 @@ public final class MainWindow implements Runnable, RipStatusHandler { saveHistory(); }); historyButtonClear.addActionListener(event -> { + Utils.clearURLHistory(); HISTORY.clear(); try { historyTableModel.fireTableDataChanged(); diff --git a/src/main/java/com/rarchives/ripme/utils/Utils.java b/src/main/java/com/rarchives/ripme/utils/Utils.java index 28be6639..7a34e6e3 100644 --- a/src/main/java/com/rarchives/ripme/utils/Utils.java +++ b/src/main/java/com/rarchives/ripme/utils/Utils.java @@ -20,7 +20,6 @@ import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; import javax.sound.sampled.Line; import javax.sound.sampled.LineEvent; -import javax.sound.sampled.LineListener; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.PropertiesConfiguration; @@ -176,6 +175,16 @@ public class Utils { return "."; } } + // Delete the url history file + public static void clearURLHistory() { + File file = new File(getURLHistoryFile()); + file.delete(); + } + + // Return the path of the url history file + public static String getURLHistoryFile() { + return getConfigDir() + File.separator + "url_history.txt"; + } private static String getConfigFilePath() { return getConfigDir() + File.separator + configFile;