- Timestamp:
- Jan 29, 2009 11:07:40 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/xpcom/io/nsAppFileLocationProvider.cpp
r1 r16394 49 49 #include "nsCRT.h" 50 50 51 #if defined(XP_MAC) || defined(XP_MACOSX)51 #if (defined(XP_MAC) || defined(XP_MACOSX)) && (!defined(VBOX) || !defined(RT_ARCH_AMD64)) 52 52 #include <Folders.h> 53 53 #include <Script.h> … … 148 148 *persistant = PR_TRUE; 149 149 150 #if defined (XP_MAC) || defined(XP_MACOSX)150 #if (defined (XP_MAC) || defined(XP_MACOSX)) && (!defined(VBOX) || !defined(RT_ARCH_AMD64)) 151 151 short foundVRefNum; 152 152 long foundDirID; … … 154 154 nsCOMPtr<nsILocalFileMac> macFile; 155 155 #endif 156 156 157 157 if (nsCRT::strcmp(prop, NS_APP_APPLICATION_REGISTRY_DIR) == 0) 158 158 { … … 212 212 rv = localFile->AppendRelativeNativePath(PLUGINS_DIR_NAME); 213 213 } 214 #if defined(XP_MAC) || defined(XP_MACOSX)214 #if (defined(XP_MAC) || defined(XP_MACOSX)) && (!defined(VBOX) || !defined(RT_ARCH_AMD64)) 215 215 else if (nsCRT::strcmp(prop, NS_MACOSX_USER_PLUGIN_DIR) == 0) 216 216 { … … 269 269 } 270 270 else if (nsCRT::strcmp(prop, NS_APP_INSTALL_CLEANUP_DIR) == 0) 271 { 271 { 272 272 // This is cloned so that embeddors will have a hook to override 273 // with their own cleanup dir. See bugzilla bug #105087 273 // with their own cleanup dir. See bugzilla bug #105087 274 274 rv = CloneMozBinDirectory(getter_AddRefs(localFile)); 275 275 #ifdef XP_MAC … … 278 278 #endif 279 279 280 } 280 } 281 281 282 282 if (localFile && NS_SUCCEEDED(rv)) 283 283 return localFile->QueryInterface(NS_GET_IID(nsIFile), (void**)_retval); 284 284 285 285 return rv; 286 286 } … … 341 341 342 342 #if defined(XP_MAC) 343 nsCOMPtr<nsIProperties> directoryService = 343 nsCOMPtr<nsIProperties> directoryService = 344 344 do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv); 345 345 if (NS_FAILED(rv)) return rv; … … 350 350 rv = directoryService->Get(prop, NS_GET_IID(nsILocalFile), getter_AddRefs(localDir)); 351 351 if (NS_FAILED(rv)) return rv; 352 #elif defined(XP_MACOSX) 352 #elif defined(XP_MACOSX) && (!defined(VBOX) || !defined(RT_ARCH_AMD64)) 353 353 FSRef fsRef; 354 354 OSErr err = ::FSFindFolder(kUserDomain, kDomainLibraryFolderType, kCreateFolder, &fsRef); … … 360 360 if (NS_FAILED(rv)) return rv; 361 361 #elif defined(XP_OS2) 362 nsCOMPtr<nsIProperties> directoryService = 362 nsCOMPtr<nsIProperties> directoryService = 363 363 do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv); 364 364 if (NS_FAILED(rv)) return rv; … … 366 366 if (NS_FAILED(rv)) return rv; 367 367 #elif defined(XP_WIN) 368 nsCOMPtr<nsIProperties> directoryService = 368 nsCOMPtr<nsIProperties> directoryService = 369 369 do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv); 370 370 if (NS_FAILED(rv)) return rv; … … 470 470 } 471 471 472 NS_IMETHOD HasMoreElements(PRBool *result) 472 NS_IMETHOD HasMoreElements(PRBool *result) 473 473 { 474 474 while (!mNext && *mCurrentKey) … … 486 486 } 487 487 488 NS_IMETHOD GetNext(nsISupports **result) 488 NS_IMETHOD GetNext(nsISupports **result) 489 489 { 490 490 NS_ENSURE_ARG_POINTER(result); … … 495 495 if (!hasMore) 496 496 return NS_ERROR_FAILURE; 497 497 498 498 *result = mNext; 499 499 NS_IF_ADDREF(*result); 500 500 mNext = nsnull; 501 501 502 502 return *result ? NS_OK : NS_ERROR_FAILURE; 503 503 } … … 543 543 } 544 544 545 NS_IMETHOD HasMoreElements(PRBool *result) 545 NS_IMETHOD HasMoreElements(PRBool *result) 546 546 { 547 547 if (mEndPath) … … 582 582 *_retval = nsnull; 583 583 nsresult rv = NS_ERROR_FAILURE; 584 584 585 585 if (!nsCRT::strcmp(prop, NS_APP_PLUGINS_DIR_LIST)) 586 586 { 587 #if defined(XP_MAC) || defined(XP_MACOSX)587 #if (defined(XP_MAC) || defined(XP_MACOSX)) && (!defined(VBOX) || !defined(RT_ARCH_AMD64)) 588 588 static const char* osXKeys[] = { NS_APP_PLUGINS_DIR, NS_MACOSX_USER_PLUGIN_DIR, NS_MACOSX_LOCAL_PLUGIN_DIR, nsnull }; 589 589 static const char* os9Keys[] = { NS_APP_PLUGINS_DIR, NS_MAC_CLASSIC_PLUGIN_DIR, nsnull }; 590 590 static const char** keys; 591 591 592 592 if (!keys) { 593 593 OSErr err; 594 594 long response; 595 err = ::Gestalt(gestaltSystemVersion, &response); 595 err = ::Gestalt(gestaltSystemVersion, &response); 596 596 keys = (!err && response >= 0x00001000) ? osXKeys : os9Keys; 597 597 } … … 607 607 #endif 608 608 NS_IF_ADDREF(*_retval); 609 rv = *_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; 609 rv = *_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY; 610 610 } 611 611 return rv;
Note:
See TracChangeset
for help on using the changeset viewer.