[baobab] Move the fs usage timeout back to LocationList
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab] Move the fs usage timeout back to LocationList
- Date: Sun, 31 May 2020 08:06:59 +0000 (UTC)
commit 089e5582357a89830b03a90d8b18f2739d115847
Author: Stefano Facchini <stefano facchini gmail com>
Date: Sat May 30 19:13:30 2020 +0200
Move the fs usage timeout back to LocationList
src/baobab-location-list.vala | 12 ++++++++++++
src/baobab-location.vala | 18 ++----------------
2 files changed, 14 insertions(+), 16 deletions(-)
---
diff --git a/src/baobab-location-list.vala b/src/baobab-location-list.vala
index 0bcd54c..5ea7957 100644
--- a/src/baobab-location-list.vala
+++ b/src/baobab-location-list.vala
@@ -124,6 +124,18 @@ namespace Baobab {
remote_list_box.row_activated.connect (row_activated);
populate ();
+
+ queue_query_fs_usage ();
+ Timeout.add_seconds(2, (() => {
+ queue_query_fs_usage ();
+ return Source.CONTINUE;
+ }));
+ }
+
+ void queue_query_fs_usage () {
+ foreach (var location in locations) {
+ location.queue_query_fs_usage ();
+ }
}
bool already_present (File file) {
diff --git a/src/baobab-location.vala b/src/baobab-location.vala
index e1a7b83..909a8c9 100644
--- a/src/baobab-location.vala
+++ b/src/baobab-location.vala
@@ -76,8 +76,6 @@ namespace Baobab {
make_this_home_location ();
- start_fs_usage_timeout ();
-
scanner = new Scanner (file, ScanFlags.EXCLUDE_MOUNTS);
}
@@ -113,8 +111,6 @@ namespace Baobab {
icon = new ThemedIcon.with_default_fallbacks ("drive-harddisk-system");
is_main_volume = true;
- start_fs_usage_timeout ();
-
scanner = new Scanner (file, ScanFlags.EXCLUDE_MOUNTS);
}
@@ -163,27 +159,17 @@ namespace Baobab {
make_this_home_location ();
}
- start_fs_usage_timeout ();
-
scanner = new Scanner (file, ScanFlags.EXCLUDE_MOUNTS);
}
- void start_fs_usage_timeout () {
- queue_query_fs_usage ();
- Timeout.add_seconds(2, (() => {
- queue_query_fs_usage ();
- return Source.CONTINUE;
- }));
- }
-
- void queue_query_fs_usage () {
+ public void queue_query_fs_usage () {
if (querying_fs || file == null) {
return;
}
querying_fs = true;
- file.query_filesystem_info_async (FS_ATTRIBUTES, Priority.DEFAULT, null, (obj, res) => {
+ file.query_filesystem_info_async.begin (FS_ATTRIBUTES, Priority.DEFAULT, null, (obj, res) => {
querying_fs = false;
size = null;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]