Skip to content

Commit e37e9f3

Browse files
committed
add follow symlinks option
1 parent eb1bd85 commit e37e9f3

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 0.4.0 - 2025-11-11
44

5-
* support --noempty and --cache cli option
5+
* support --noempty, --cache and --symlinks cli option
66
* added preferences screen
77

88
## 0.3.2 - 2025-11-11

lib/domain/fdupes_bloc.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,13 @@ class FdupesBloc extends Bloc<FdupesEvent, FdupesState> {
9090
}
9191
final skipEmpty = sharedPreferences.getBool('noempty') ?? false;
9292
final useCache = sharedPreferences.getBool('usecache') ?? false;
93+
final followSymlinks = sharedPreferences.getBool('followsymlinks') ?? false;
9394
final dupes = await findDupes(
9495
event.dirs,
9596
emit: emit,
9697
skipEmpty: skipEmpty,
9798
useCache: useCache,
99+
followSymlinks: followSymlinks,
98100
);
99101

100102
emit(FdupesStateResult(dirs: event.dirs, dupeGroups: dupes));
@@ -170,14 +172,16 @@ class FdupesBloc extends Bloc<FdupesEvent, FdupesState> {
170172
Future<List<List<String>>> findDupes(
171173
List<Directory> dirs, {
172174
required Emitter<FdupesState> emit,
173-
bool skipEmpty = false,
174-
bool useCache = false,
175+
required bool skipEmpty,
176+
required bool useCache,
177+
required bool followSymlinks,
175178
}) async {
176179
print("finding dupes in dirs $dirs");
177180
final args = [
178181
'-r',
179182
if (skipEmpty) '--noempty',
180183
if (useCache) '--usecache',
184+
if (followSymlinks) '--symlinks',
181185
...dirs.map((d) => d.path),
182186
];
183187
print('cmd line: $fdupesLocation $args');

lib/presentation/prefs_dialog.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ class PreferencesDialog extends StatefulWidget {
2424
class _PreferencesDialogState extends State<PreferencesDialog> {
2525
late bool skipEmpty;
2626
late bool useCache;
27+
late bool followSymlinks;
2728

2829
@override
2930
void initState() {
3031
super.initState();
3132
skipEmpty = widget.sharedPreferences.getBool('noempty') ?? false;
3233
useCache = widget.sharedPreferences.getBool('usecache') ?? false;
34+
followSymlinks = widget.sharedPreferences.getBool('followsymlinks') ?? false;
3335
}
3436

3537
@override
@@ -59,6 +61,15 @@ class _PreferencesDialogState extends State<PreferencesDialog> {
5961
widget.sharedPreferences.setBool('usecache', value);
6062
});
6163
}),
64+
SwitchListTile(
65+
title: const Text('Follow symlinks'),
66+
value: followSymlinks,
67+
onChanged: (value) {
68+
setState(() {
69+
followSymlinks = value;
70+
widget.sharedPreferences.setBool('followsymlinks', value);
71+
});
72+
}),
6273
],
6374
),
6475
);

0 commit comments

Comments
 (0)