[baobab/import-export: 6/7] Add timestamp of last completed scan
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab/import-export: 6/7] Add timestamp of last completed scan
- Date: Sun, 9 Sep 2012 13:02:53 +0000 (UTC)
commit b7de97f785f612acd9a3c654dcf19ce19847854f
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 b2736da..0f0cc86 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]