1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 06:37:17 +00:00

change FilesDB to singleton class

move hash calculation back in to Files class
clear cache now clears hash cache in addition to picture cache
This commit is contained in:
Dobatymo
2021-10-29 12:22:12 +08:00
parent 1ea108fc2b
commit 9753afba74
5 changed files with 149 additions and 146 deletions

View File

@@ -129,11 +129,11 @@ class DupeGuru(QObject):
self.showDirectoriesWindow,
),
(
"actionClearPictureCache",
"actionClearCache",
"Ctrl+Shift+P",
"",
tr("Clear Picture Cache"),
self.clearPictureCacheTriggered,
tr("Clear Cache"),
self.clearCacheTriggered,
),
(
"actionExcludeList",
@@ -258,6 +258,7 @@ class DupeGuru(QObject):
self.willSavePrefs.emit()
self.prefs.save()
self.model.save()
self.model.close()
# Workaround for #857, hide() or close().
if self.details_dialog is not None:
self.details_dialog.close()
@@ -288,13 +289,14 @@ class DupeGuru(QObject):
self.model.load_from(results)
self.recentResults.insertItem(results)
def clearPictureCacheTriggered(self):
title = tr("Clear Picture Cache")
msg = tr("Do you really want to remove all your cached picture analysis?")
def clearCacheTriggered(self):
title = tr("Clear Cache")
msg = tr("Do you really want to clear the cache? This will remove all cached file hashes and picture analysis.")
if self.confirm(title, msg, QMessageBox.No):
self.model.clear_picture_cache()
self.model.clear_hash_cache()
active = QApplication.activeWindow()
QMessageBox.information(active, title, tr("Picture cache cleared."))
QMessageBox.information(active, title, tr("Cache cleared."))
def ignoreListTriggered(self):
if self.use_tabs:

View File

@@ -126,7 +126,7 @@ class DirectoriesDialog(QMainWindow):
self.menuFile.addAction(self.actionLoadResults)
self.menuFile.addAction(self.menuLoadRecent.menuAction())
self.menuFile.addSeparator()
self.menuFile.addAction(self.app.actionClearPictureCache)
self.menuFile.addAction(self.app.actionClearCache)
self.menuFile.addSeparator()
self.menuFile.addAction(self.actionLoadDirectories)
self.menuFile.addAction(self.actionSaveDirectories)