summaryrefslogtreecommitdiff
path: root/src/library/OfflineBranch.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-04-03 13:14:53 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-04-03 13:14:53 +0200
commitc43dfb815a4951b8248f4f0e98babe4f80204f03 (patch)
tree82745ed2353757c41ea1865bad9ac7a1b0a8a366 /src/library/OfflineBranch.vala
parent2785a691b958a79a1dd606c445188c71c3f58b3c (diff)
Imported Upstream version 0.22.0upstream/0.22.0
Diffstat (limited to 'src/library/OfflineBranch.vala')
-rw-r--r--src/library/OfflineBranch.vala51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/library/OfflineBranch.vala b/src/library/OfflineBranch.vala
deleted file mode 100644
index 4ed2e49..0000000
--- a/src/library/OfflineBranch.vala
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright 2011-2014 Yorba Foundation
- *
- * 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 Library.OfflineBranch : Sidebar.RootOnlyBranch {
- public OfflineBranch() {
- base (new Library.OfflineSidebarEntry());
-
- foreach (MediaSourceCollection media_sources in MediaCollectionRegistry.get_instance().get_all())
- media_sources.offline_contents_altered.connect(on_offline_contents_altered);
-
- set_show_branch(get_total_offline() != 0);
- }
-
- ~OfflineBranch() {
- foreach (MediaSourceCollection media_sources in MediaCollectionRegistry.get_instance().get_all())
- media_sources.trashcan_contents_altered.disconnect(on_offline_contents_altered);
- }
-
- private void on_offline_contents_altered() {
- set_show_branch(get_total_offline() != 0);
- }
-
- private int get_total_offline() {
- int total = 0;
- foreach (MediaSourceCollection media_sources in MediaCollectionRegistry.get_instance().get_all())
- total += media_sources.get_offline_bin_contents().size;
-
- return total;
- }
-}
-
-public class Library.OfflineSidebarEntry : Sidebar.SimplePageEntry {
- public OfflineSidebarEntry() {
- }
-
- public override string get_sidebar_name() {
- return OfflinePage.NAME;
- }
-
- public override Icon? get_sidebar_icon() {
- return new ThemedIcon(Resources.ICON_MISSING_FILES);
- }
-
- protected override Page create_page() {
- return new OfflinePage();
- }
-}
-