mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 06:37:17 +00:00
[#92 state:fixed] Added an option to ignore duplicates hardlinking to the same file.
This commit is contained in:
@@ -106,6 +106,7 @@ class DupeGuru(DupeGuruBase, QObject):
|
||||
self.scanner.mix_file_kind = self.prefs.mix_file_kind
|
||||
self.options['escape_filter_regexp'] = self.prefs.use_regexp
|
||||
self.options['clean_empty_dirs'] = self.prefs.remove_empty_folders
|
||||
self.options['ignore_hardlink_matches'] = self.prefs.ignore_hardlink_matches
|
||||
|
||||
#--- Virtual
|
||||
def _create_details_dialog(self, parent):
|
||||
|
||||
@@ -24,6 +24,7 @@ class Preferences(PreferencesBase):
|
||||
get = self.get_value
|
||||
self.filter_hardness = get('FilterHardness', self.filter_hardness)
|
||||
self.mix_file_kind = get('MixFileKind', self.mix_file_kind)
|
||||
self.ignore_hardlink_matches = get('IgnoreHardlinkMatches', self.ignore_hardlink_matches)
|
||||
self.use_regexp = get('UseRegexp', self.use_regexp)
|
||||
self.remove_empty_folders = get('RemoveEmptyFolders', self.remove_empty_folders)
|
||||
self.destination_type = get('DestinationType', self.destination_type)
|
||||
@@ -52,6 +53,7 @@ class Preferences(PreferencesBase):
|
||||
self.filter_hardness = 95
|
||||
self.mix_file_kind = True
|
||||
self.use_regexp = False
|
||||
self.ignore_hardlink_matches = False
|
||||
self.remove_empty_folders = False
|
||||
self.destination_type = 1
|
||||
self.custom_command = ''
|
||||
@@ -77,6 +79,7 @@ class Preferences(PreferencesBase):
|
||||
set_ = self.set_value
|
||||
set_('FilterHardness', self.filter_hardness)
|
||||
set_('MixFileKind', self.mix_file_kind)
|
||||
set_('IgnoreHardlinkMatches', self.ignore_hardlink_matches)
|
||||
set_('UseRegexp', self.use_regexp)
|
||||
set_('RemoveEmptyFolders', self.remove_empty_folders)
|
||||
set_('DestinationType', self.destination_type)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import sys
|
||||
from PyQt4.QtCore import SIGNAL, Qt
|
||||
from PyQt4.QtGui import QDialog, QDialogButtonBox
|
||||
|
||||
@@ -35,6 +36,9 @@ class PreferencesDialog(QDialog, Ui_PreferencesDialog):
|
||||
|
||||
def _setupUi(self):
|
||||
self.setupUi(self)
|
||||
if sys.platform not in {'darwin', 'linux2'}:
|
||||
self.verticalLayout.removeWidget(self.ignoreHardlinkMatches)
|
||||
self.ignoreHardlinkMatches.setHidden(True)
|
||||
|
||||
def load(self, prefs=None):
|
||||
if prefs is None:
|
||||
@@ -53,6 +57,7 @@ class PreferencesDialog(QDialog, Ui_PreferencesDialog):
|
||||
setchecked(self.matchSimilarBox, prefs.match_similar)
|
||||
setchecked(self.wordWeightingBox, prefs.word_weighting)
|
||||
setchecked(self.mixFileKindBox, prefs.mix_file_kind)
|
||||
setchecked(self.ignoreHardlinkMatches, prefs.ignore_hardlink_matches)
|
||||
setchecked(self.useRegexpBox, prefs.use_regexp)
|
||||
setchecked(self.removeEmptyFoldersBox, prefs.remove_empty_folders)
|
||||
self.copyMoveDestinationComboBox.setCurrentIndex(prefs.destination_type)
|
||||
@@ -72,6 +77,7 @@ class PreferencesDialog(QDialog, Ui_PreferencesDialog):
|
||||
prefs.match_similar = ischecked(self.matchSimilarBox)
|
||||
prefs.word_weighting = ischecked(self.wordWeightingBox)
|
||||
prefs.mix_file_kind = ischecked(self.mixFileKindBox)
|
||||
prefs.ignore_hardlink_matches = ischecked(self.ignoreHardlinkMatches)
|
||||
prefs.use_regexp = ischecked(self.useRegexpBox)
|
||||
prefs.remove_empty_folders = ischecked(self.removeEmptyFoldersBox)
|
||||
prefs.destination_type = self.copyMoveDestinationComboBox.currentIndex()
|
||||
|
||||
@@ -310,6 +310,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ignoreHardlinkMatches">
|
||||
<property name="text">
|
||||
<string>Ignore duplicates hardlinking to the same file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import sys
|
||||
from PyQt4.QtCore import SIGNAL, Qt
|
||||
from PyQt4.QtGui import QDialog, QDialogButtonBox
|
||||
|
||||
@@ -23,6 +24,9 @@ class PreferencesDialog(QDialog, Ui_PreferencesDialog):
|
||||
|
||||
def _setupUi(self):
|
||||
self.setupUi(self)
|
||||
if sys.platform not in {'darwin', 'linux2'}:
|
||||
self.verticalLayout.removeWidget(self.ignoreHardlinkMatches)
|
||||
self.ignoreHardlinkMatches.setHidden(True)
|
||||
|
||||
def load(self, prefs=None):
|
||||
if prefs is None:
|
||||
|
||||
@@ -150,6 +150,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ignoreHardlinkMatches">
|
||||
<property name="text">
|
||||
<string>Ignore duplicates hardlinking to the same file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
import sys
|
||||
from PyQt4.QtCore import SIGNAL, Qt
|
||||
from PyQt4.QtGui import QDialog, QDialogButtonBox
|
||||
|
||||
@@ -33,6 +34,9 @@ class PreferencesDialog(QDialog, Ui_PreferencesDialog):
|
||||
|
||||
def _setupUi(self):
|
||||
self.setupUi(self)
|
||||
if sys.platform not in {'darwin', 'linux2'}:
|
||||
self.verticalLayout_4.removeWidget(self.ignoreHardlinkMatches)
|
||||
self.ignoreHardlinkMatches.setHidden(True)
|
||||
|
||||
def load(self, prefs=None):
|
||||
if prefs is None:
|
||||
@@ -45,6 +49,7 @@ class PreferencesDialog(QDialog, Ui_PreferencesDialog):
|
||||
setchecked(self.matchSimilarBox, prefs.match_similar)
|
||||
setchecked(self.wordWeightingBox, prefs.word_weighting)
|
||||
setchecked(self.mixFileKindBox, prefs.mix_file_kind)
|
||||
setchecked(self.ignoreHardlinkMatches, prefs.ignore_hardlink_matches)
|
||||
setchecked(self.useRegexpBox, prefs.use_regexp)
|
||||
setchecked(self.removeEmptyFoldersBox, prefs.remove_empty_folders)
|
||||
setchecked(self.ignoreSmallFilesBox, prefs.ignore_small_files)
|
||||
@@ -60,6 +65,7 @@ class PreferencesDialog(QDialog, Ui_PreferencesDialog):
|
||||
prefs.match_similar = ischecked(self.matchSimilarBox)
|
||||
prefs.word_weighting = ischecked(self.wordWeightingBox)
|
||||
prefs.mix_file_kind = ischecked(self.mixFileKindBox)
|
||||
prefs.ignore_hardlink_matches = ischecked(self.ignoreHardlinkMatches)
|
||||
prefs.use_regexp = ischecked(self.useRegexpBox)
|
||||
prefs.remove_empty_folders = ischecked(self.removeEmptyFoldersBox)
|
||||
prefs.ignore_small_files = ischecked(self.ignoreSmallFilesBox)
|
||||
|
||||
@@ -253,9 +253,16 @@
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ignoreHardlinkMatches">
|
||||
<property name="text">
|
||||
<string>Ignore duplicates hardlinking to the same file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user