[gxml] Fixed TwDocument(). No create more tmp files, just on save_to()
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Fixed TwDocument(). No create more tmp files, just on save_to()
- Date: Fri, 8 May 2015 23:46:11 +0000 (UTC)
commit 558e98a1adc60e418e52d17054dbe316ea489c90
Author: Daniel Espinosa <esodan gmail com>
Date: Fri May 8 18:31:35 2015 -0500
Fixed TwDocument(). No create more tmp files, just on save_to()
gxml/TwDocument.vala | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/gxml/TwDocument.vala b/gxml/TwDocument.vala
index d17325b..3f114fc 100644
--- a/gxml/TwDocument.vala
+++ b/gxml/TwDocument.vala
@@ -24,16 +24,8 @@ using Xml;
public class GXml.TwDocument : GXml.TwNode, GXml.Document
{
- protected FileIOStream _doc_iostream;
GXml.Element _root = null;
- public TwDocument ()
- {
- try {
- file = GLib.File.new_tmp (null, out _doc_iostream);
- } catch (GLib.Error e) {
- GLib.warning ("Couldn't create temporaly file for TwDocument:"+e.message);
- }
- }
+ public TwDocument () {}
public TwDocument.for_path (string file)
{
var f = File.new_for_path (file);
@@ -87,8 +79,8 @@ public class GXml.TwDocument : GXml.TwNode, GXml.Document
}
public bool save (GLib.Cancellable? cancellable = null)
throws GLib.Error
- requires (file != null)
{
+ if (file == null) return false;
return save_to (file, cancellable);
}
public bool save_to (GLib.File f, GLib.Cancellable? cancellable = null)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]