Author: jsuchome
Date: Tue Feb 8 11:16:38 2011
New Revision: 63367
URL: http://svn.opensuse.org/viewcvs/yast?rev=63367&view=rev
Log:
only diff once snapshot is selected
Modified:
branches/tmp/jsuchome/snapper/src/Snapper.ycp
branches/tmp/jsuchome/snapper/src/dialogs.ycp
Modified: branches/tmp/jsuchome/snapper/src/Snapper.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/src/Snapper.ycp?rev=63367&r1=63366&r2=63367&view=diff
==============================================================================
--- branches/tmp/jsuchome/snapper/src/Snapper.ycp (original)
+++ branches/tmp/jsuchome/snapper/src/Snapper.ycp Tue Feb 8 11:16:38 2011
@@ -44,6 +44,9 @@
global map selected_snapshot = $[];
+// index to snapshots list
+global integer selected_snapshot_index = 0;
+
/**
* Return list of files modified between given snapshots
* File is a map with name (path) and some parameters
@@ -108,11 +111,6 @@
integer id = snapshot["num"]:0;
if (id == 0) return; // ignore the 'current system'
snapshot["name"] = tostring (id);
- if (snapshot["type"]:`NONE == `POST)
- {
- integer pre = snapshot["pre_num"]:0;
- snapshot["files"] = ReadModifiedFiles (pre, id);
- }
y2internal ("snapshot data: %1", snapshot);
snapshots = add (snapshots, snapshot);
});
Modified: branches/tmp/jsuchome/snapper/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/snapper/src/dialogs.ycp?rev=63367&r1=63366&r2=63367&view=diff
==============================================================================
--- branches/tmp/jsuchome/snapper/src/dialogs.ycp (original)
+++ branches/tmp/jsuchome/snapper/src/dialogs.ycp Tue Feb 8 11:16:38 2011
@@ -161,6 +161,7 @@
}
else if (ret == `show) {
Snapper::selected_snapshot = snapshots[selected]:$[];
+ Snapper::selected_snapshot_index = selected;
break;
}
else if(ret == `next) {
@@ -195,10 +196,24 @@
list<term> tree_items = [];
map open_items = $[];
- list<map> file_list = Snapper::selected_snapshot["files"]:[];
- integer snapshot_num = Snapper::selected_snapshot["num"]:0;
+ map snapshot = Snapper::selected_snapshot;
+ integer snapshot_num = snapshot["num"]:0;
+ list<map> file_list = snapshot["files"]:[];
+
+ if (!haskey (snapshot, "files"))
+ {
+ if (snapshot["type"]:`NONE == `POST)
+ {
+ integer pre = snapshot["pre_num"]:0;
+ snapshot["files"] = Snapper::ReadModifiedFiles (pre, snapshot_num);
+ file_list = snapshot["files"]:[];
+ // update the global snapshots list
+ Snapper::snapshots[Snapper::selected_snapshot_index] = snapshot;
+ }
+ }
+
// FIXME what to use for previous_num in non-post snapshots?
- integer previous_num = Snapper::selected_snapshot["pre_num"]:snapshot_num;
+ integer previous_num = snapshot["pre_num"]:snapshot_num;
string snapshot_name = tostring (snapshot_num);
map