Mercurial > projects > dwt-mac
comparison dwt/browser/AppFileLocProvider.d @ 154:535243e6d16a
Fixes to make dwt compile with ldc
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sat, 13 Jun 2009 00:25:05 +0200 |
parents | 5583f8eeee6c |
children |
comparison
equal
deleted
inserted
replaced
153:8433dabeb15e | 154:535243e6d16a |
---|---|
66 | 66 |
67 extern(System) | 67 extern(System) |
68 nsresult QueryInterface (nsID* riid, void** ppvObject) { | 68 nsresult QueryInterface (nsID* riid, void** ppvObject) { |
69 if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE; | 69 if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE; |
70 | 70 |
71 if (*riid == nsISupports.IID) { | 71 if (*riid == nsISupports.IID) { |
72 *ppvObject = cast(void*)cast(nsISupports)this; | 72 *ppvObject = cast(void*)cast(nsISupports)this; |
73 AddRef (); | 73 AddRef (); |
74 return XPCOM.NS_OK; | 74 return XPCOM.NS_OK; |
75 } | 75 } |
76 if (*riid == nsIDirectoryServiceProvider.IID) { | 76 if (*riid == nsIDirectoryServiceProvider.IID) { |
153 int rc = XPCOM.NS_NewLocalFile (cast(nsAString*)pathString, 1, &localFile); | 153 int rc = XPCOM.NS_NewLocalFile (cast(nsAString*)pathString, 1, &localFile); |
154 if (rc !is XPCOM.NS_ERROR_FILE_UNRECOGNIZED_PATH) { | 154 if (rc !is XPCOM.NS_ERROR_FILE_UNRECOGNIZED_PATH) { |
155 /* value appears to be a valid pathname */ | 155 /* value appears to be a valid pathname */ |
156 if (rc !is XPCOM.NS_OK) Mozilla.error (rc); | 156 if (rc !is XPCOM.NS_OK) Mozilla.error (rc); |
157 if (localFile is null) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER); | 157 if (localFile is null) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER); |
158 | 158 //rc = localFile.QueryInterface (&nsIFile.IID, cast(void**)&file); TODO |
159 rc = localFile.QueryInterface (&nsIFile.IID, cast(void**)&file); | 159 rc = localFile.QueryInterface (&NS_IFILE_IID, cast(void**)&file); |
160 if (rc !is XPCOM.NS_OK) Mozilla.error (rc); | 160 if (rc !is XPCOM.NS_OK) Mozilla.error (rc); |
161 if (file is null) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE); | 161 if (file is null) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE); |
162 localFile.Release (); | 162 localFile.Release (); |
163 | 163 |
164 files[index++] = cast(nsISupports)file; | 164 files[index++] = cast(nsISupports)file; |
239 int rc = XPCOM.NS_NewLocalFile (cast(nsAString*)pathString, 1, &localFile); | 239 int rc = XPCOM.NS_NewLocalFile (cast(nsAString*)pathString, 1, &localFile); |
240 if (rc !is XPCOM.NS_OK) Mozilla.error (rc); | 240 if (rc !is XPCOM.NS_OK) Mozilla.error (rc); |
241 if (localFile is null) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER); | 241 if (localFile is null) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER); |
242 | 242 |
243 nsIFile file; | 243 nsIFile file; |
244 | |
244 rc = localFile.QueryInterface (&nsIFile.IID, cast(void**)&file); | 245 rc = localFile.QueryInterface (&nsIFile.IID, cast(void**)&file); |
245 if (rc !is XPCOM.NS_OK) Mozilla.error (rc); | 246 if (rc !is XPCOM.NS_OK) Mozilla.error (rc); |
246 if (file is null) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE); | 247 if (file is null) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE); |
247 | 248 |
248 *_retval = file; | 249 *_retval = file; |