[baobab/import-export: 5/9] Add timestamp of last completed scan
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab/import-export: 5/9] Add timestamp of last completed scan
- Date: Tue, 11 Sep 2012 16:57:04 +0000 (UTC)
commit 17dfdb9a69e5eabe7d4e4b503e4f39d94830fad3
Author: Stefano Facchini <stefano facchini gmail com>
Date: Sun Sep 9 14:50:45 2012 +0200
Add timestamp of last completed scan
Show in the toolbar the timestamp of last completed scan.
The format of the time indication is currently quite pedantic
and could be improved.
src/baobab-scanner.vala | 3 +++
src/baobab-window.vala | 4 +++-
2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/baobab-scanner.vala b/src/baobab-scanner.vala
index c4359a1..4c082f0 100644
--- a/src/baobab-scanner.vala
+++ b/src/baobab-scanner.vala
@@ -55,6 +55,8 @@ namespace Baobab {
public int max_depth { get; protected set; }
+ public int64? last_scan_timestamp { get; protected set; }
+
public signal void completed();
static const string ATTRIBUTES =
@@ -310,6 +312,7 @@ namespace Baobab {
if (results.parent == null) {
successful = true;
+ last_scan_timestamp = get_real_time () / 1000000;
completed ();
return false;
}
diff --git a/src/baobab-window.vala b/src/baobab-window.vala
index 0f25601..c00e9c5 100644
--- a/src/baobab-window.vala
+++ b/src/baobab-window.vala
@@ -561,7 +561,9 @@ namespace Baobab {
var action = lookup_action ("reload") as SimpleAction;
action.set_enabled (false);
} else {
- result_toolbar.set_labels (active_location.name, null);
+ var unixtime = active_location.scanner.last_scan_timestamp;
+ var timestamp_label = (unixtime != null) ? (new DateTime.from_unix_local (unixtime)).format ("%c") : null;
+ result_toolbar.set_labels (active_location.name, timestamp_label);
}
main_notebook.page = page;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]