summaryrefslogtreecommitdiff
path: root/src/pies/save.vala
diff options
context:
space:
mode:
authorAlessandro Ghedini <al3xbio@gmail.com>2012-03-05 12:19:59 +0100
committerAlessandro Ghedini <al3xbio@gmail.com>2012-03-05 12:19:59 +0100
commit98f3ef2689de06e8ab8b46a91acfa7dd2056a3a6 (patch)
treeb98e438ac1082925e12af6dfec6d9ebeb4e3035e /src/pies/save.vala
parenta824c3e5bdab686901b02667609282e7d596a6af (diff)
Imported Upstream version 0.5.1
Diffstat (limited to 'src/pies/save.vala')
-rw-r--r--src/pies/save.vala15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pies/save.vala b/src/pies/save.vala
index c940e5a..aadc7c8 100644
--- a/src/pies/save.vala
+++ b/src/pies/save.vala
@@ -30,6 +30,11 @@ namespace Pies {
/////////////////////////////////////////////////////////////////////
public void save() {
+ message("Saving Pies to \"" + Paths.pie_config + "\".");
+
+ // log pie statistics
+ string pie_line = "PIES";
+
// initializes the XML-Writer
var writer = new Xml.TextWriter.filename(Paths.pie_config);
writer.set_indent(true);
@@ -42,6 +47,8 @@ namespace Pies {
// if it's no dynamically created Pie
if (pie.id.length == 3) {
+ int slice_count = 0;
+
// write all attributes of the Pie
writer.start_element("pie");
writer.write_attribute("name", pie.name);
@@ -63,18 +70,26 @@ namespace Pies {
writer.write_attribute("command", action.real_command);
writer.write_attribute("quickAction", action.is_quickaction ? "true" : "false");
writer.end_element();
+
+ ++ slice_count;
}
} else {
writer.start_element("group");
writer.write_attribute("type", GroupRegistry.descriptions[group.get_type().name()].id);
writer.end_element();
+
+ slice_count += group.actions.size;
}
}
writer.end_element();
+
+ pie_line += " " + pie.id + "(%d)".printf(slice_count);
}
}
writer.end_element();
writer.end_document();
+
+ Logger.stats(pie_line);
}
}