summaryrefslogtreecommitdiff
path: root/src/folders/FoldersPage.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-05-01 14:35:32 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-05-01 14:35:32 +0200
commite230b6f78546827521107be23797048482c8b193 (patch)
tree948c1e77382c484819ea399bba4edcdc19cc6bf0 /src/folders/FoldersPage.vala
parent211da5fc3048ca2b6ccee2166b0aaaade55cb84f (diff)
parent49120f48474fc8fdc2448c75d961bc238213cfac (diff)
Update upstream source from tag 'upstream/0.28.2'
Update to upstream version '0.28.2' with Debian dir 811236a8e9a1308bf427065dcb6270419ff4f965
Diffstat (limited to 'src/folders/FoldersPage.vala')
-rw-r--r--src/folders/FoldersPage.vala41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/folders/FoldersPage.vala b/src/folders/FoldersPage.vala
new file mode 100644
index 0000000..6145c95
--- /dev/null
+++ b/src/folders/FoldersPage.vala
@@ -0,0 +1,41 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ *
+ * This software is licensed under the GNU Lesser General Public License
+ * (version 2.1 or later). See the COPYING file in this distribution.
+ */
+
+public class Folders.Page : CollectionPage {
+ private class FolderViewManager : CollectionViewManager {
+ public File dir;
+
+ public FolderViewManager(Folders.Page owner, File dir) {
+ base (owner);
+
+ this.dir = dir;
+ }
+
+ public override bool include_in_view(DataSource source) {
+ return ((MediaSource) source).get_file().has_prefix(dir);
+ }
+ }
+
+ private FolderViewManager view_manager;
+
+ public Page(File dir) {
+ base (dir.get_path());
+
+ view_manager = new FolderViewManager(this, dir);
+
+ foreach (MediaSourceCollection sources in MediaCollectionRegistry.get_instance().get_all())
+ get_view().monitor_source_collection(sources, view_manager, null);
+ }
+
+ protected override void get_config_photos_sort(out bool sort_order, out int sort_by) {
+ Config.Facade.get_instance().get_library_photos_sort(out sort_order, out sort_by);
+ }
+
+ protected override void set_config_photos_sort(bool sort_order, int sort_by) {
+ Config.Facade.get_instance().set_library_photos_sort(sort_order, sort_by);
+ }
+}
+