var info = f.query_info ("standard::*", 0);
var ct = info.get_content_type();
this.content_type = ct;
- var cts = ct.split("/");
- this.language = "plain-text";
-
- if (ct.length > 1 && cts.length > 1) {
-
- this.language = cts[1];
-
- this.language = (new Regex("^x-")).replace( this.language, this.language.length, 0, "");
- print("got language %s\n", this.language);
-
- }
+
+ this.language = "";
// fixme...
public override void loadItems() throws GLib.Error // : function(cb, sync) == original was async.
{
- GLib.FileUtils.get_contents(this.path, out this.contents);
-
+ GLib.FileUtils.get_contents(this.path, out this.contents);
+ this.loaded = true;
}
}
public override void save() {
- this.writeFile(this.path, this.contents);
+ if (!this.loaded) {
+ print("Ignoring Save - as file was never loaded?\n");
+ return;
+ }
+ try {
+ this.writeFile(this.path, this.contents);
+ } catch (GLib.Error e) {
+ // error ???
+ }
}
// ignore these calls.