diff dwtx/jface/resource/FileImageDescriptor.d @ 40:da5ad8eedf5d

debug prints, dwt.dwthelper restructure, ...
author Frank Benoit <benoit@tionex.de>
date Thu, 10 Apr 2008 08:59:39 +0200
parents c884a1ab6db3
children ea8ff534f622
line wrap: on
line diff
--- a/dwtx/jface/resource/FileImageDescriptor.d	Tue Apr 08 22:05:42 2008 +0200
+++ b/dwtx/jface/resource/FileImageDescriptor.d	Thu Apr 10 08:59:39 2008 +0200
@@ -30,6 +30,8 @@
 import dwt.dwthelper.BufferedInputStream;
 import dwt.dwthelper.ByteArrayInputStream;
 
+import tango.util.log.Trace;
+
 /**
  * An image descriptor that loads its image information
  * from a file.
@@ -45,7 +47,7 @@
     /**
      * The name of the file.
      */
-//     private String name;
+    private String name;
     private void[] importdata;
 
     /**
@@ -62,10 +64,10 @@
      *   <code>null</code>
      * @param filename the name of the file
      */
-    this(void[] importdata/+ClassInfo clazz, String filename+/) {
+    this(ImportData importdata) {
 //         this.location = clazz;
-//         this.name = filename;
-        this.importdata = importdata;
+        this.name = importdata.name;
+        this.importdata = importdata.data;
     }
 
     /* (non-Javadoc)
@@ -99,7 +101,8 @@
             try {
                 result = new ImageData(in_);
             } catch (DWTException e) {
-                if (e.code !is DWT.ERROR_INVALID_IMAGE) {
+                if (e.code !is DWT.ERROR_INVALID_IMAGE /+&& e.code !is DWT.ERROR_UNSUPPORTED_FORMAT+/) {
+                    Trace.formatln( "FileImageDescriptor getImageData DWTException for name={}", name );
                     throw e;
                 // fall through otherwise
                 }
@@ -121,6 +124,7 @@
         InputStream is_ = null;
 
 //         if (location !is null) {
+// Trace.formatln( "FileImageDescriptor getStream importdata.length={} name={}",importdata.length, name );
             is_ = new ByteArrayInputStream(cast(byte[]) importdata);
 //             is_ = ClassInfoGetResourceAsStream( location, name);