VirtualBox

Changeset 47898 in vbox


Ignore:
Timestamp:
Aug 20, 2013 11:59:55 AM (11 years ago)
Author:
vboxsync
Message:

comment typo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/io/nsDirectoryService.cpp

    r1 r47898  
    9393#define COMPONENT_REGISTRY_NAME NS_LITERAL_CSTRING("compreg.dat")
    9494#define COMPONENT_DIRECTORY     NS_LITERAL_CSTRING("components")
    95 #endif 
     95#endif
    9696
    9797#define XPTI_REGISTRY_NAME      NS_LITERAL_CSTRING("xpti.dat")
     
    112112
    113113//----------------------------------------------------------------------------------------
    114 nsresult 
     114nsresult
    115115nsDirectoryService::GetCurrentProcessDirectory(nsILocalFile** aFile)
    116116//----------------------------------------------------------------------------------------
     
    118118    NS_ENSURE_ARG_POINTER(aFile);
    119119    *aFile = nsnull;
    120    
     120
    121121   //  Set the component registry location:
    122122    if (!mService)
    123123        return NS_ERROR_FAILURE;
    124124
    125     nsresult rv; 
    126  
     125    nsresult rv;
     126
    127127    nsCOMPtr<nsIProperties> dirService;
    128     rv = nsDirectoryService::Create(nsnull, 
    129                                     NS_GET_IID(nsIProperties), 
     128    rv = nsDirectoryService::Create(nsnull,
     129                                    NS_GET_IID(nsIProperties),
    130130                                    getter_AddRefs(dirService));  // needs to be around for life of product
    131131
     
    157157        if (lastSlash)
    158158            *(lastSlash + 1) = '\0';
    159        
     159
    160160        localFile->InitWithNativePath(nsDependentCString(buf));
    161161        *aFile = localFile;
     
    183183        FSSpec appFSSpec;
    184184        ::FSMakeFSSpec(pInfo.processAppSpec->vRefNum, pInfo.processAppSpec->parID, 0, &appFSSpec);
    185        
     185
    186186        nsCOMPtr<nsILocalFileMac> localFileMac = do_QueryInterface((nsIFile*)localFile);
    187         if (localFileMac) 
     187        if (localFileMac)
    188188        {
    189189            localFileMac->InitWithFSSpec(&appFSSpec);
     
    221221        }
    222222    }
    223    
    224     NS_ASSERTION(*aFile, "nsDirectoryService - Could not determine CurrentProcessDir.\n"); 
     223
     224    NS_ASSERTION(*aFile, "nsDirectoryService - Could not determine CurrentProcessDir.\n");
    225225    if (*aFile)
    226226        return NS_OK;
     
    243243        buf2[0] = '\0';
    244244
    245         /* 
     245        /*
    246246         * Env.var. VBOX_XPCOM_HOME first.
    247247         */
     
    251251            if (strlen(psz) < MAXPATHLEN)
    252252            {
    253                 if (!realpath(psz, buf2)) 
     253                if (!realpath(psz, buf2))
    254254                    strcpy(buf2, psz);
    255255                strcat(buf2, "/x"); /* for the filename stripping */
     
    278278            char buf[MAXPATHLEN];
    279279            int cchLink = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
    280             if (cchLink > 0 || cchLink != sizeof(buf) - 1) 
     280            if (cchLink > 0 || cchLink != sizeof(buf) - 1)
    281281             {
    282282                buf[cchLink] = '\0';
     
    297297            #ifdef DEBUG
    298298                printf("debug: (1) VBOX_XPCOM_HOME=%s\n", buf2);
    299             #endif 
     299            #endif
    300300                strcpy(szPath, buf2);
    301301                fPathSet = true;
     
    313313
    314314
    315     // The MOZ_DEFAULT_VBOX_XPCOMHOME variable can be set at configure time with
     315    // The MOZ_DEFAULT_VBOX_XPCOM_HOME variable can be set at configure time with
    316316    // a --with-default-mozilla-five-home=foo autoconf flag.
    317     // 
     317    //
    318318    // The idea here is to allow for builds that have a default VBOX_XPCOM_HOME
    319319    // regardless of the environment.  This makes it easier to write apps that
    320     // embed mozilla without having to worry about setting up the environment 
     320    // embed mozilla without having to worry about setting up the environment
    321321    //
    322322    // We do this py putenv()ing the default value into the environment.  Note that
     
    399399
    400400#endif
    401    
     401
    402402    NS_RELEASE(localFile);
    403403
     
    449449nsIAtom*  nsDirectoryService::sMusicDocumentsDirectory = nsnull;
    450450nsIAtom*  nsDirectoryService::sInternetSitesDirectory = nsnull;
    451 #elif defined (XP_WIN) 
     451#elif defined (XP_WIN)
    452452nsIAtom*  nsDirectoryService::sSystemDirectory = nsnull;
    453453nsIAtom*  nsDirectoryService::sWindowsDirectory = nsnull;
     
    558558    { NS_OSX_MUSIC_DOCUMENTS_DIR,         &nsDirectoryService::sMusicDocumentsDirectory },
    559559    { NS_OSX_INTERNET_SITES_DIR,          &nsDirectoryService::sInternetSitesDirectory },
    560 #elif defined (XP_WIN) 
     560#elif defined (XP_WIN)
    561561    { NS_OS_SYSTEM_DIR,            &nsDirectoryService::sSystemDirectory },
    562562    { NS_WIN_WINDOWS_DIR,          &nsDirectoryService::sWindowsDirectory },
     
    601601    { NS_BEOS_DESKTOP_DIR,         &nsDirectoryService::sDesktopDirectory },
    602602#endif
    603 };   
     603};
    604604
    605605nsresult
     
    607607{
    608608    nsresult rv;
    609      
     609
    610610    rv = NS_NewISupportsArray(getter_AddRefs(mProviders));
    611611    if (NS_FAILED(rv)) return rv;
    612612
    613613    NS_RegisterStaticAtoms(directory_atoms, NS_ARRAY_LENGTH(directory_atoms));
    614    
     614
    615615    // Let the list hold the only reference to the provider.
    616616    nsAppFileLocationProvider *defaultProvider = new nsAppFileLocationProvider;
     
    666666    persistent(PR_TRUE),
    667667    uuid(aUUID) {}
    668    
     668
    669669  const char*   property;
    670670  nsISupports*  data;
     
    707707{
    708708    nsCStringKey key(prop);
    709    
     709
    710710    nsCOMPtr<nsISupports> value = dont_AddRef(mHashtable.Get(&key));
    711    
     711
    712712    if (value)
    713713    {
     
    768768    }
    769769
    770     return NS_ERROR_FAILURE;   
     770    return NS_ERROR_FAILURE;
    771771}
    772772
     
    777777    nsCOMPtr<nsIFile> value;
    778778    nsresult rv = Get(prop, NS_GET_IID(nsIFile), getter_AddRefs(value));
    779     if (NS_FAILED(rv)) 
     779    if (NS_FAILED(rv))
    780780        return rv;
    781    
     781
    782782    if (value)
    783783    {
    784784        *_retval = PR_TRUE;
    785785    }
    786    
     786
    787787    return rv;
    788788}
     
    823823// This is meant to be a place of xpcom or system specific file locations, not
    824824// application specific locations.  If you need the later, register a callback for
    825 // your application. 
     825// your application.
    826826
    827827NS_IMETHODIMP
     
    837837
    838838        // check to see if it is one of our defaults
    839        
    840     if (inAtom == nsDirectoryService::sCurrentProcess || 
     839
     840    if (inAtom == nsDirectoryService::sCurrentProcess ||
    841841        inAtom == nsDirectoryService::sOS_CurrentProcessDirectory )
    842842    {
     
    849849            return NS_ERROR_FAILURE;
    850850
    851         localFile->AppendNative(COMPONENT_DIRECTORY);           
    852         localFile->AppendNative(COMPONENT_REGISTRY_NAME);           
     851        localFile->AppendNative(COMPONENT_DIRECTORY);
     852        localFile->AppendNative(COMPONENT_REGISTRY_NAME);
    853853    }
    854854    else if (inAtom == nsDirectoryService::sXPTIRegistry)
     
    858858            return NS_ERROR_FAILURE;
    859859
    860         localFile->AppendNative(COMPONENT_DIRECTORY);           
    861         localFile->AppendNative(XPTI_REGISTRY_NAME);           
    862     }
    863    
     860        localFile->AppendNative(COMPONENT_DIRECTORY);
     861        localFile->AppendNative(XPTI_REGISTRY_NAME);
     862    }
     863
    864864    // Unless otherwise set, the core pieces of the GRE exist
    865865    // in the current process directory.
     
    881881        rv = GetCurrentProcessDirectory(getter_AddRefs(localFile));
    882882        if (localFile)
    883                     localFile->AppendNative(COMPONENT_DIRECTORY);           
     883                    localFile->AppendNative(COMPONENT_DIRECTORY);
    884884    }
    885885    else if (inAtom == nsDirectoryService::sOS_DriveDirectory)
     
    893893    else if (inAtom == nsDirectoryService::sOS_CurrentProcessDirectory)
    894894    {
    895         rv = GetSpecialSystemDirectory(OS_CurrentProcessDirectory, getter_AddRefs(localFile)); 
     895        rv = GetSpecialSystemDirectory(OS_CurrentProcessDirectory, getter_AddRefs(localFile));
    896896    }
    897897    else if (inAtom == nsDirectoryService::sOS_CurrentWorkingDirectory)
    898898    {
    899         rv = GetSpecialSystemDirectory(OS_CurrentWorkingDirectory, getter_AddRefs(localFile)); 
    900     }
    901        
     899        rv = GetSpecialSystemDirectory(OS_CurrentWorkingDirectory, getter_AddRefs(localFile));
     900    }
     901
    902902#if defined(XP_MACOSX)
    903903    else if (inAtom == nsDirectoryService::sDirectory)
     
    948948    {
    949949        rv = GetOSXFolderType(kClassicDomain, kInternetSearchSitesFolderType, getter_AddRefs(localFile));
    950     }   
     950    }
    951951    else if (inAtom == nsDirectoryService::sUserLibDirectory)
    952952    {
     
    980980                ::ICStop(icInstance);
    981981            }
    982            
     982
    983983            if NS_FAILED(rv)
    984             { 
     984            {
    985985                // We got an error getting the DL folder from IC so try finding the user's Desktop folder
    986986                rv = GetOSXFolderType(kUserDomain, kDesktopFolderType, getter_AddRefs(localFile));
    987987            }
    988988        }
    989        
     989
    990990        // Don't cache the DL directory as the user may change it while we're running.
    991991        // Negligible perf hit as this directory is only requested for downloads
     
    10591059    else if (inAtom == nsDirectoryService::sSystemDirectory)
    10601060    {
    1061         rv = GetSpecialSystemDirectory(Win_SystemDirectory, getter_AddRefs(localFile)); 
     1061        rv = GetSpecialSystemDirectory(Win_SystemDirectory, getter_AddRefs(localFile));
    10621062    }
    10631063    else if (inAtom == nsDirectoryService::sWindowsDirectory)
    10641064    {
    1065         rv = GetSpecialSystemDirectory(Win_WindowsDirectory, getter_AddRefs(localFile)); 
     1065        rv = GetSpecialSystemDirectory(Win_WindowsDirectory, getter_AddRefs(localFile));
    10661066    }
    10671067    else if (inAtom == nsDirectoryService::sHomeDirectory)
    10681068    {
    1069         rv = GetSpecialSystemDirectory(Win_HomeDirectory, getter_AddRefs(localFile)); 
     1069        rv = GetSpecialSystemDirectory(Win_HomeDirectory, getter_AddRefs(localFile));
    10701070    }
    10711071    else if (inAtom == nsDirectoryService::sDesktop)
    10721072    {
    1073         rv = GetSpecialSystemDirectory(Win_Desktop, getter_AddRefs(localFile)); 
     1073        rv = GetSpecialSystemDirectory(Win_Desktop, getter_AddRefs(localFile));
    10741074    }
    10751075    else if (inAtom == nsDirectoryService::sPrograms)
    10761076    {
    1077         rv = GetSpecialSystemDirectory(Win_Programs, getter_AddRefs(localFile)); 
     1077        rv = GetSpecialSystemDirectory(Win_Programs, getter_AddRefs(localFile));
    10781078    }
    10791079    else if (inAtom == nsDirectoryService::sControls)
    10801080    {
    1081         rv = GetSpecialSystemDirectory(Win_Controls, getter_AddRefs(localFile)); 
     1081        rv = GetSpecialSystemDirectory(Win_Controls, getter_AddRefs(localFile));
    10821082    }
    10831083    else if (inAtom == nsDirectoryService::sPrinters)
    10841084    {
    1085         rv = GetSpecialSystemDirectory(Win_Printers, getter_AddRefs(localFile)); 
     1085        rv = GetSpecialSystemDirectory(Win_Printers, getter_AddRefs(localFile));
    10861086    }
    10871087    else if (inAtom == nsDirectoryService::sPersonal)
    10881088    {
    1089         rv = GetSpecialSystemDirectory(Win_Personal, getter_AddRefs(localFile)); 
     1089        rv = GetSpecialSystemDirectory(Win_Personal, getter_AddRefs(localFile));
    10901090    }
    10911091    else if (inAtom == nsDirectoryService::sFavorites)
    10921092    {
    1093         rv = GetSpecialSystemDirectory(Win_Favorites, getter_AddRefs(localFile)); 
     1093        rv = GetSpecialSystemDirectory(Win_Favorites, getter_AddRefs(localFile));
    10941094    }
    10951095    else if (inAtom == nsDirectoryService::sStartup)
     
    10991099    else if (inAtom == nsDirectoryService::sRecent)
    11001100    {
    1101         rv = GetSpecialSystemDirectory(Win_Recent, getter_AddRefs(localFile)); 
     1101        rv = GetSpecialSystemDirectory(Win_Recent, getter_AddRefs(localFile));
    11021102    }
    11031103    else if (inAtom == nsDirectoryService::sSendto)
    11041104    {
    1105         rv = GetSpecialSystemDirectory(Win_Sendto, getter_AddRefs(localFile)); 
     1105        rv = GetSpecialSystemDirectory(Win_Sendto, getter_AddRefs(localFile));
    11061106    }
    11071107    else if (inAtom == nsDirectoryService::sBitbucket)
    11081108    {
    1109         rv = GetSpecialSystemDirectory(Win_Bitbucket, getter_AddRefs(localFile)); 
     1109        rv = GetSpecialSystemDirectory(Win_Bitbucket, getter_AddRefs(localFile));
    11101110    }
    11111111    else if (inAtom == nsDirectoryService::sStartmenu)
    11121112    {
    1113         rv = GetSpecialSystemDirectory(Win_Startmenu, getter_AddRefs(localFile)); 
     1113        rv = GetSpecialSystemDirectory(Win_Startmenu, getter_AddRefs(localFile));
    11141114    }
    11151115    else if (inAtom == nsDirectoryService::sDesktopdirectory)
    11161116    {
    1117         rv = GetSpecialSystemDirectory(Win_Desktopdirectory, getter_AddRefs(localFile)); 
     1117        rv = GetSpecialSystemDirectory(Win_Desktopdirectory, getter_AddRefs(localFile));
    11181118    }
    11191119    else if (inAtom == nsDirectoryService::sDrives)
     
    11231123    else if (inAtom == nsDirectoryService::sNetwork)
    11241124    {
    1125         rv = GetSpecialSystemDirectory(Win_Network, getter_AddRefs(localFile)); 
     1125        rv = GetSpecialSystemDirectory(Win_Network, getter_AddRefs(localFile));
    11261126    }
    11271127    else if (inAtom == nsDirectoryService::sNethood)
    11281128    {
    1129         rv = GetSpecialSystemDirectory(Win_Nethood, getter_AddRefs(localFile)); 
     1129        rv = GetSpecialSystemDirectory(Win_Nethood, getter_AddRefs(localFile));
    11301130    }
    11311131    else if (inAtom == nsDirectoryService::sFonts)
     
    11351135    else if (inAtom == nsDirectoryService::sTemplates)
    11361136    {
    1137         rv = GetSpecialSystemDirectory(Win_Templates, getter_AddRefs(localFile)); 
     1137        rv = GetSpecialSystemDirectory(Win_Templates, getter_AddRefs(localFile));
    11381138    }
    11391139    else if (inAtom == nsDirectoryService::sCommon_Startmenu)
    11401140    {
    1141         rv = GetSpecialSystemDirectory(Win_Common_Startmenu, getter_AddRefs(localFile)); 
     1141        rv = GetSpecialSystemDirectory(Win_Common_Startmenu, getter_AddRefs(localFile));
    11421142    }
    11431143    else if (inAtom == nsDirectoryService::sCommon_Programs)
    11441144    {
    1145         rv = GetSpecialSystemDirectory(Win_Common_Programs, getter_AddRefs(localFile)); 
     1145        rv = GetSpecialSystemDirectory(Win_Common_Programs, getter_AddRefs(localFile));
    11461146    }
    11471147    else if (inAtom == nsDirectoryService::sCommon_Startup)
    11481148    {
    1149         rv = GetSpecialSystemDirectory(Win_Common_Startup, getter_AddRefs(localFile)); 
     1149        rv = GetSpecialSystemDirectory(Win_Common_Startup, getter_AddRefs(localFile));
    11501150    }
    11511151    else if (inAtom == nsDirectoryService::sCommon_Desktopdirectory)
    11521152    {
    1153         rv = GetSpecialSystemDirectory(Win_Common_Desktopdirectory, getter_AddRefs(localFile)); 
     1153        rv = GetSpecialSystemDirectory(Win_Common_Desktopdirectory, getter_AddRefs(localFile));
    11541154    }
    11551155    else if (inAtom == nsDirectoryService::sAppdata)
    11561156    {
    1157         rv = GetSpecialSystemDirectory(Win_Appdata, getter_AddRefs(localFile)); 
     1157        rv = GetSpecialSystemDirectory(Win_Appdata, getter_AddRefs(localFile));
    11581158    }
    11591159    else if (inAtom == nsDirectoryService::sPrinthood)
    11601160    {
    1161         rv = GetSpecialSystemDirectory(Win_Printhood, getter_AddRefs(localFile)); 
     1161        rv = GetSpecialSystemDirectory(Win_Printhood, getter_AddRefs(localFile));
    11621162    }
    11631163    else if (inAtom == nsDirectoryService::sWinCookiesDirectory)
    11641164    {
    1165         rv = GetSpecialSystemDirectory(Win_Cookies, getter_AddRefs(localFile)); 
     1165        rv = GetSpecialSystemDirectory(Win_Cookies, getter_AddRefs(localFile));
    11661166    }
    11671167#elif defined (XP_UNIX)
     
    11691169    else if (inAtom == nsDirectoryService::sLocalDirectory)
    11701170    {
    1171         rv = GetSpecialSystemDirectory(Unix_LocalDirectory, getter_AddRefs(localFile)); 
     1171        rv = GetSpecialSystemDirectory(Unix_LocalDirectory, getter_AddRefs(localFile));
    11721172    }
    11731173    else if (inAtom == nsDirectoryService::sLibDirectory)
     
    11771177    else if (inAtom == nsDirectoryService::sHomeDirectory)
    11781178    {
    1179         rv = GetSpecialSystemDirectory(Unix_HomeDirectory, getter_AddRefs(localFile)); 
     1179        rv = GetSpecialSystemDirectory(Unix_HomeDirectory, getter_AddRefs(localFile));
    11801180    }
    11811181#elif defined (XP_OS2)
    11821182    else if (inAtom == nsDirectoryService::sSystemDirectory)
    11831183    {
    1184         rv = GetSpecialSystemDirectory(OS2_SystemDirectory, getter_AddRefs(localFile)); 
     1184        rv = GetSpecialSystemDirectory(OS2_SystemDirectory, getter_AddRefs(localFile));
    11851185    }
    11861186    else if (inAtom == nsDirectoryService::sOS2Directory)
    11871187    {
    1188         rv = GetSpecialSystemDirectory(OS2_OS2Directory, getter_AddRefs(localFile)); 
     1188        rv = GetSpecialSystemDirectory(OS2_OS2Directory, getter_AddRefs(localFile));
    11891189    }
    11901190    else if (inAtom == nsDirectoryService::sHomeDirectory)
    11911191    {
    1192         rv = GetSpecialSystemDirectory(OS2_HomeDirectory, getter_AddRefs(localFile)); 
     1192        rv = GetSpecialSystemDirectory(OS2_HomeDirectory, getter_AddRefs(localFile));
    11931193    }
    11941194    else if (inAtom == nsDirectoryService::sDesktopDirectory)
    11951195    {
    1196         rv = GetSpecialSystemDirectory(OS2_DesktopDirectory, getter_AddRefs(localFile)); 
     1196        rv = GetSpecialSystemDirectory(OS2_DesktopDirectory, getter_AddRefs(localFile));
    11971197    }
    11981198#elif defined (XP_BEOS)
    11991199    else if (inAtom == nsDirectoryService::sSettingsDirectory)
    12001200    {
    1201         rv = GetSpecialSystemDirectory(BeOS_SettingsDirectory, getter_AddRefs(localFile)); 
     1201        rv = GetSpecialSystemDirectory(BeOS_SettingsDirectory, getter_AddRefs(localFile));
    12021202    }
    12031203    else if (inAtom == nsDirectoryService::sHomeDirectory)
     
    12071207    else if (inAtom == nsDirectoryService::sDesktopDirectory)
    12081208    {
    1209         rv = GetSpecialSystemDirectory(BeOS_DesktopDirectory, getter_AddRefs(localFile)); 
     1209        rv = GetSpecialSystemDirectory(BeOS_DesktopDirectory, getter_AddRefs(localFile));
    12101210    }
    12111211    else if (inAtom == nsDirectoryService::sSystemDirectory)
    12121212    {
    1213         rv = GetSpecialSystemDirectory(BeOS_SystemDirectory, getter_AddRefs(localFile)); 
     1213        rv = GetSpecialSystemDirectory(BeOS_SystemDirectory, getter_AddRefs(localFile));
    12141214    }
    12151215#endif
     
    12311231    NS_ENSURE_ARG_POINTER(_retval);
    12321232    *_retval = nsnull;
    1233        
     1233
    12341234    return NS_ERROR_FAILURE;
    12351235}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette