Mercurial > projects > dwt-addons
diff dwtx/jface/dialogs/DialogSettings.d @ 197:0ea0c9f9008f
Remove tango deprecation warnings.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 18 Feb 2009 19:35:22 +0100 |
parents | 1470d66733fa |
children |
line wrap: on
line diff
--- a/dwtx/jface/dialogs/DialogSettings.d Tue Feb 10 17:12:01 2009 +0100 +++ b/dwtx/jface/dialogs/DialogSettings.d Wed Feb 18 19:35:22 2009 +0100 @@ -25,10 +25,9 @@ static import tango.text.convert.Integer; static import tango.text.convert.Float; static import tango.text.Text; -static import tango.io.File; -static import tango.io.Print; +static import tango.io.stream.Format; static import tango.io.model.IConduit; -static import tango.io.stream.FileStream; +import tango.io.device.File; static import tango.text.convert.Format; import tango.core.Exception; alias tango.text.Text.Text!(char) StringBuffer; @@ -242,7 +241,7 @@ //TODO: remove() was added after tango 0.99.5 //n.remove(); } - load(document, document.root.firstChild ); + load(document, document.tree.child ); } catch (IOException e) { // ignore } catch (TextException e) { @@ -255,9 +254,9 @@ */ //TODO: solve overload load(char[]) public void load(String fileName) { - auto f = new tango.io.stream.FileStream.FileInput( fileName ); - load( f.input ); - f.close; + scope file = new File( fileName ); + load( file.input ); + file.close; } /* (non-Javadoc) @@ -265,23 +264,23 @@ */ private void load(Document document, Element root) { - name = root.getAttribute(TAG_NAME).value(); + name = root.attributes.name(null,TAG_NAME).value(); foreach( n; root.query[TAG_ITEM] ){ if( root is n.parent() ){ - String key = n.getAttribute(TAG_KEY).value().dup; - String value = n.getAttribute(TAG_VALUE).value().dup; + String key = n.attributes.name(null,TAG_KEY).value().dup; + String value = n.attributes.name(null,TAG_VALUE).value().dup; items.put(stringcast(key), stringcast(value)); } } foreach( n; root.query[TAG_LIST].dup ){ if( root is n.parent() ){ auto child = n; - String key = child.getAttribute(TAG_KEY).value().dup; + String key = child.attributes.name(null,TAG_KEY).value().dup; char[][] valueList; foreach( node; root.query[TAG_ITEM].dup ){ if (child is node.parent()) { - valueList ~= node.getAttribute(TAG_VALUE).value().dup; + valueList ~= node.attributes.name(null,TAG_VALUE).value().dup; } } arrayItems.put(stringcast(key), new ArrayWrapperString2(valueList) ); @@ -357,7 +356,9 @@ * Method declared on IDialogSettings. */ public void save(String fileName) { - auto stream = new tango.io.stream.FileStream.FileOutput(fileName); + auto stream = new tango.io.device.File.File( + fileName, + tango.io.device.File.File.WriteCreate); XMLWriter writer = new XMLWriter(stream.output); save(writer); writer.close(); @@ -407,7 +408,7 @@ * A simple XML writer. Using this instead of the javax.xml.transform classes allows * compilation against JCL Foundation (bug 80059). */ - private static class XMLWriter : tango.io.Print.Print!(char) { + private static class XMLWriter : tango.io.stream.Format.FormatOutput!(char) { /** current number of tabs to use for ident */ protected int tab;