diff --git a/PicView/App.config b/PicView/App.config
index c8d267af..5d08b348 100644
--- a/PicView/App.config
+++ b/PicView/App.config
@@ -136,6 +136,9 @@
#F2FF6CD4
+
+ False
+
diff --git a/PicView/FileHandling/FileLists.cs b/PicView/FileHandling/FileLists.cs
index 27f0a1d8..12bc890b 100644
--- a/PicView/FileHandling/FileLists.cs
+++ b/PicView/FileHandling/FileLists.cs
@@ -66,8 +66,8 @@ internal static List FileList(string path, SortFilesBy sortFilesBy)
return null;
}
- // TODO make search option a user setting
- var items = Directory.EnumerateFiles(path, "*.*", SearchOption.AllDirectories)
+ var searchOption = Properties.Settings.Default.IncludeSubDirectories;
+ var items = Directory.EnumerateFiles(path, "*.*", searchOption ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly)
.AsParallel()
.Where(file =>
diff --git a/PicView/Properties/Settings.Designer.cs b/PicView/Properties/Settings.Designer.cs
index e81e21c6..cf892cd2 100644
--- a/PicView/Properties/Settings.Designer.cs
+++ b/PicView/Properties/Settings.Designer.cs
@@ -526,5 +526,17 @@ public bool Fullscreen {
this["MagentaAlpha"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool IncludeSubDirectories {
+ get {
+ return ((bool)(this["IncludeSubDirectories"]));
+ }
+ set {
+ this["IncludeSubDirectories"] = value;
+ }
+ }
}
}
diff --git a/PicView/Properties/Settings.settings b/PicView/Properties/Settings.settings
index 5e1fed11..86fba1c9 100644
--- a/PicView/Properties/Settings.settings
+++ b/PicView/Properties/Settings.settings
@@ -128,5 +128,8 @@
#F2FF6CD4
+
+ False
+
\ No newline at end of file
diff --git a/PicView/UI/Windows/SettingsWindow.xaml b/PicView/UI/Windows/SettingsWindow.xaml
index 3ca9c535..c51d1fa7 100644
--- a/PicView/UI/Windows/SettingsWindow.xaml
+++ b/PicView/UI/Windows/SettingsWindow.xaml
@@ -217,15 +217,15 @@
VerticalAlignment="Top"
Orientation="Horizontal">
-
+