Fix for nsIFile delete conflicts with JS reserved name b=37406, r=dougt, sr=jst

Renamed all Delete methods to Remove.

--pete
This commit is contained in:
pete%alphanumerica.com 2001-07-24 18:38:25 +00:00
Родитель 850dc2325c
Коммит f65c767018
35 изменённых файлов: 69 добавлений и 69 удалений

Просмотреть файл

@ -3038,7 +3038,7 @@ nsChromeRegistry::CheckForNewChrome()
} }
} }
PR_Close(file); PR_Close(file);
// listFile->Delete(PR_FALSE); // listFile->Remove(PR_FALSE);
return rv; return rv;
} }
@ -3223,7 +3223,7 @@ NS_IMETHODIMP nsChromeRegistry::Observe(nsISupports *aSubject, const PRUnichar *
nsCOMPtr<nsIFile> userChromeDir; nsCOMPtr<nsIFile> userChromeDir;
rv = NS_GetSpecialDirectory(NS_APP_USER_CHROME_DIR, getter_AddRefs(userChromeDir)); rv = NS_GetSpecialDirectory(NS_APP_USER_CHROME_DIR, getter_AddRefs(userChromeDir));
if (NS_SUCCEEDED(rv) && userChromeDir) if (NS_SUCCEEDED(rv) && userChromeDir)
rv = userChromeDir->Delete(PR_TRUE); rv = userChromeDir->Remove(PR_TRUE);
} }
} }
else if (!nsCRT::strcmp(NS_LITERAL_STRING("profile-do-change").get(), aTopic)) { else if (!nsCRT::strcmp(NS_LITERAL_STRING("profile-do-change").get(), aTopic)) {

Просмотреть файл

@ -455,7 +455,7 @@ NS_IMETHODIMP CWebBrowserContainer::OnStateChange(nsIWebProgress* aWebProgress,
fileToUse->Equals( tempFile, &equalToTempFile ); fileToUse->Equals( tempFile, &equalToTempFile );
fileToUse->Exists(&filetoUseAlreadyExists); fileToUse->Exists(&filetoUseAlreadyExists);
if( filetoUseAlreadyExists && !equalToTempFile ) if( filetoUseAlreadyExists && !equalToTempFile )
fileToUse->Delete(PR_FALSE); fileToUse->Remove(PR_FALSE);
// extract the new leaf name from the file location // extract the new leaf name from the file location
nsXPIDLCString fileName; nsXPIDLCString fileName;

Просмотреть файл

@ -132,7 +132,7 @@ COOKIE_DeletePersistentUserData(void)
if (NS_SUCCEEDED(res)) { if (NS_SUCCEEDED(res)) {
res = cookiesFile->Append(kCookiesFileName); res = cookiesFile->Append(kCookiesFileName);
if (NS_SUCCEEDED(res)) if (NS_SUCCEEDED(res))
(void) cookiesFile->Delete(PR_FALSE); (void) cookiesFile->Remove(PR_FALSE);
} }
} }

Просмотреть файл

@ -662,7 +662,7 @@ PERMISSION_DeletePersistentUserData(void)
if (NS_SUCCEEDED(res)) { if (NS_SUCCEEDED(res)) {
res = cookiesPermFile->Append(kCookiesPermFileName); res = cookiesPermFile->Append(kCookiesPermFileName);
if (NS_SUCCEEDED(res)) if (NS_SUCCEEDED(res))
(void) cookiesPermFile->Delete(PR_FALSE); (void) cookiesPermFile->Remove(PR_FALSE);
} }
} }

Просмотреть файл

@ -1960,7 +1960,7 @@ nsMessengerMigrator::migrateAddressBookPrefEnum(const char *aPref, void *aClosur
#ifdef DEBUG_AB_MIGRATION #ifdef DEBUG_AB_MIGRATION
printf("remove the tmp file\n"); printf("remove the tmp file\n");
#endif /* DEBUG_AB_MIGRATION */ #endif /* DEBUG_AB_MIGRATION */
rv = tmpLDIFFile->Delete(PR_TRUE); rv = tmpLDIFFile->Remove(PR_TRUE);
NS_ASSERTION(NS_SUCCEEDED(rv),"failed to delete the temp ldif file"); NS_ASSERTION(NS_SUCCEEDED(rv),"failed to delete the temp ldif file");
if (NS_FAILED(rv)) return; if (NS_FAILED(rv)) return;

Просмотреть файл

@ -157,7 +157,7 @@ nsresult nsMsgCompFields::CleanUpTempFiles()
} }
// remove it if not a dir // remove it if not a dir
urlFile->Delete(PR_FALSE); urlFile->Remove(PR_FALSE);
} }
token = nsCRT::strtok(rest, ",", &rest); token = nsCRT::strtok(rest, ",", &rest);

Просмотреть файл

@ -180,7 +180,7 @@ PRBool ObtainSpoolLock(const char *spoolnameStr,
#endif #endif
// step 3: remove .mozlock file, in any case // step 3: remove .mozlock file, in any case
rv = tmplocfile->Delete(PR_FALSE /* non-recursive */); rv = tmplocfile->Remove(PR_FALSE /* non-recursive */);
#ifdef MOVEMAIL_DEBUG #ifdef MOVEMAIL_DEBUG
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
// Could not delete our .mozlock file... very unusual, but // Could not delete our .mozlock file... very unusual, but
@ -225,7 +225,7 @@ PRBool YieldSpoolLock(const char *spoolnameStr)
return PR_FALSE; return PR_FALSE;
// Delete the file // Delete the file
rv = locklocfile->Delete(PR_FALSE /* non-recursive */); rv = locklocfile->Remove(PR_FALSE /* non-recursive */);
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return PR_FALSE; return PR_FALSE;

Просмотреть файл

@ -270,7 +270,7 @@ nsJAR::Extract(const char *zipEntry, nsIFile* outFile)
PR_Close(fd); PR_Close(fd);
if (err != ZIP_OK) if (err != ZIP_OK)
outFile->Delete(PR_FALSE); outFile->Remove(PR_FALSE);
else else
{ {
#if defined(XP_UNIX) #if defined(XP_UNIX)

Просмотреть файл

@ -133,7 +133,7 @@ NS_IMETHODIMP nsPrefService::Observe(nsISupports *aSubject, const PRUnichar *aTo
if (!nsCRT::strcmp(aTopic, NS_LITERAL_STRING("profile-before-change").get())) { if (!nsCRT::strcmp(aTopic, NS_LITERAL_STRING("profile-before-change").get())) {
if (!nsCRT::strcmp(someData, NS_LITERAL_STRING("shutdown-cleanse").get())) { if (!nsCRT::strcmp(someData, NS_LITERAL_STRING("shutdown-cleanse").get())) {
if (mCurrentFile) { if (mCurrentFile) {
mCurrentFile->Delete(PR_FALSE); mCurrentFile->Remove(PR_FALSE);
NS_RELEASE(mCurrentFile); NS_RELEASE(mCurrentFile);
} }
} else { } else {

Просмотреть файл

@ -1088,7 +1088,7 @@ nsPluginStreamInfo::~nsPluginStreamInfo()
PR_FALSE, PR_FALSE,
getter_AddRefs(localFile)); getter_AddRefs(localFile));
if(NS_SUCCEEDED(res)) if(NS_SUCCEEDED(res))
localFile->Delete(PR_FALSE); localFile->Remove(PR_FALSE);
} }
if (mFilePath) if (mFilePath)
PL_strfree(mFilePath); PL_strfree(mFilePath);
@ -1455,7 +1455,7 @@ nsPluginStreamListenerPeer::~nsPluginStreamListenerPeer()
nsCOMPtr<nsILocalFile> localFile; nsCOMPtr<nsILocalFile> localFile;
nsresult res = NS_NewLocalFile(mLocalFile, PR_FALSE, getter_AddRefs(localFile)); nsresult res = NS_NewLocalFile(mLocalFile, PR_FALSE, getter_AddRefs(localFile));
if(NS_SUCCEEDED(res)) if(NS_SUCCEEDED(res))
localFile->Delete(PR_FALSE); localFile->Remove(PR_FALSE);
delete [] mLocalFile; delete [] mLocalFile;
} }
delete mDataForwardToRequest; delete mDataForwardToRequest;
@ -2806,7 +2806,7 @@ NS_IMETHODIMP nsPluginHostImpl::Destroy(void)
rv = pluginTmp->Append(kPluginTmpDirName); rv = pluginTmp->Append(kPluginTmpDirName);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
pluginTmp->Delete(PR_TRUE); pluginTmp->Remove(PR_TRUE);
return NS_OK; return NS_OK;
} }

Просмотреть файл

@ -1088,7 +1088,7 @@ nsPluginStreamInfo::~nsPluginStreamInfo()
PR_FALSE, PR_FALSE,
getter_AddRefs(localFile)); getter_AddRefs(localFile));
if(NS_SUCCEEDED(res)) if(NS_SUCCEEDED(res))
localFile->Delete(PR_FALSE); localFile->Remove(PR_FALSE);
} }
if (mFilePath) if (mFilePath)
PL_strfree(mFilePath); PL_strfree(mFilePath);
@ -1455,7 +1455,7 @@ nsPluginStreamListenerPeer::~nsPluginStreamListenerPeer()
nsCOMPtr<nsILocalFile> localFile; nsCOMPtr<nsILocalFile> localFile;
nsresult res = NS_NewLocalFile(mLocalFile, PR_FALSE, getter_AddRefs(localFile)); nsresult res = NS_NewLocalFile(mLocalFile, PR_FALSE, getter_AddRefs(localFile));
if(NS_SUCCEEDED(res)) if(NS_SUCCEEDED(res))
localFile->Delete(PR_FALSE); localFile->Remove(PR_FALSE);
delete [] mLocalFile; delete [] mLocalFile;
} }
delete mDataForwardToRequest; delete mDataForwardToRequest;
@ -2806,7 +2806,7 @@ NS_IMETHODIMP nsPluginHostImpl::Destroy(void)
rv = pluginTmp->Append(kPluginTmpDirName); rv = pluginTmp->Append(kPluginTmpDirName);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
pluginTmp->Delete(PR_TRUE); pluginTmp->Remove(PR_TRUE);
return NS_OK; return NS_OK;
} }

6
netwerk/cache/filecache/nsNetDiskCache.cpp поставляемый
Просмотреть файл

@ -170,7 +170,7 @@ nsNetDiskCache::~nsNetDiskCache()
if( trash.CompareWithConversion( filename, PR_FALSE, 5 ) == 0) if( trash.CompareWithConversion( filename, PR_FALSE, 5 ) == 0)
file->Delete( PR_TRUE ); file->Remove( PR_TRUE );
nsCRT::free(filename) ; nsCRT::free(filename) ;
} }
@ -642,12 +642,12 @@ nsNetDiskCache::RemoveAll(void)
return rv ; return rv ;
PRBool isDirectory; PRBool isDirectory;
if ( NS_SUCCEEDED(file->IsDirectory( &isDirectory )) && isDirectory ) if ( NS_SUCCEEDED(file->IsDirectory( &isDirectory )) && isDirectory )
file->Delete( PR_TRUE ); file->Remove( PR_TRUE );
} }
if ( mDBFile ) if ( mDBFile )
{ {
mDBFile->Delete(PR_FALSE) ; mDBFile->Remove(PR_FALSE) ;
if (mDBFile) if (mDBFile)
{ {
PRBool exists = PR_FALSE; PRBool exists = PR_FALSE;

8
netwerk/cache/src/nsDiskCacheDevice.cpp поставляемый
Просмотреть файл

@ -287,7 +287,7 @@ nsDiskCacheDevice::Init()
nsCOMPtr<nsIFile> cacheTrashDir; nsCOMPtr<nsIFile> cacheTrashDir;
rv = GetCacheTrashDirectory(getter_AddRefs(cacheTrashDir)); rv = GetCacheTrashDirectory(getter_AddRefs(cacheTrashDir));
if (NS_FAILED(rv)) goto error_exit; if (NS_FAILED(rv)) goto error_exit;
(void) cacheTrashDir->Delete(PR_TRUE); // ignore errors, we tried... (void) cacheTrashDir->Remove(PR_TRUE); // ignore errors, we tried...
// Try opening cache map file. // Try opening cache map file.
mCacheMap = new nsDiskCacheMap; mCacheMap = new nsDiskCacheMap;
@ -730,7 +730,7 @@ nsDiskCacheDevice::InitializeCacheDirectory()
nsresult rv; nsresult rv;
// recursively delete the disk cache directory. // recursively delete the disk cache directory.
rv = mCacheDirectory->Delete(PR_TRUE); rv = mCacheDirectory->Remove(PR_TRUE);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
// try moving it aside // try moving it aside
@ -850,7 +850,7 @@ nsDiskCacheDevice::SetCacheParentDirectory(nsILocalFile * parentDir)
rv = directory->Exists(&exists); rv = directory->Exists(&exists);
if (NS_SUCCEEDED(rv) && exists) if (NS_SUCCEEDED(rv) && exists)
(void) directory->Delete(PR_TRUE); (void) directory->Remove(PR_TRUE);
// clean up obsolete NewCache directory // clean up obsolete NewCache directory
rv = parentDir->Clone(getter_AddRefs(directory)); rv = parentDir->Clone(getter_AddRefs(directory));
@ -860,7 +860,7 @@ nsDiskCacheDevice::SetCacheParentDirectory(nsILocalFile * parentDir)
rv = directory->Exists(&exists); rv = directory->Exists(&exists);
if (NS_SUCCEEDED(rv) && exists) if (NS_SUCCEEDED(rv) && exists)
(void) directory->Delete(PR_TRUE); (void) directory->Remove(PR_TRUE);
} }

2
netwerk/cache/src/nsDiskCacheMap.cpp поставляемый
Просмотреть файл

@ -759,7 +759,7 @@ nsDiskCacheMap::DeleteStorage(nsDiskCacheRecord * record, PRBool metaData)
rv = GetFileForDiskCacheRecord(record, metaData, getter_AddRefs(file)); rv = GetFileForDiskCacheRecord(record, metaData, getter_AddRefs(file));
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
rv = file->Delete(PR_FALSE); // false == non-recursive rv = file->Remove(PR_FALSE); // false == non-recursive
} }
DecrementTotalSize(sizeK * 1024); DecrementTotalSize(sizeK * 1024);

Просмотреть файл

@ -385,7 +385,7 @@ Test(CreateFun create, PRUint32 count,
if (NS_FAILED(rv)) goto done; if (NS_FAILED(rv)) goto done;
if (exists) { if (exists) {
rv = outSpec->Delete(PR_FALSE); rv = outSpec->Remove(PR_FALSE);
if (NS_FAILED(rv)) goto done; if (NS_FAILED(rv)) goto done;
} }

Просмотреть файл

@ -1128,11 +1128,11 @@ nsPrefMigration::ProcessPrefsCallback(const char* oldProfilePathStr, const char
PRBool flagExists = PR_FALSE; PRBool flagExists = PR_FALSE;
m_prefsFile->Exists(&flagExists); //Delete the prefs.js file in the temp directory. m_prefsFile->Exists(&flagExists); //Delete the prefs.js file in the temp directory.
if (flagExists) if (flagExists)
m_prefsFile->Delete(PR_FALSE); m_prefsFile->Remove(PR_FALSE);
systemTempIFileDir->Exists(&flagExists); //Delete the unique dir in the system temp dir. systemTempIFileDir->Exists(&flagExists); //Delete the unique dir in the system temp dir.
if (flagExists) if (flagExists)
systemTempIFileDir->Delete(PR_FALSE); systemTempIFileDir->Remove(PR_FALSE);
return rv; return rv;
} }

Просмотреть файл

@ -1667,7 +1667,7 @@ NS_IMETHODIMP nsProfile::DeleteProfile(const PRUnichar* profileName, PRBool canD
if (NS_SUCCEEDED(rv)) if (NS_SUCCEEDED(rv))
dirToDelete = parentDir; dirToDelete = parentDir;
} }
rv = dirToDelete->Delete(PR_TRUE); rv = dirToDelete->Remove(PR_TRUE);
} }
} }

Просмотреть файл

@ -1358,7 +1358,7 @@ nsresult ProfileStruct::InternalizeLocation(nsIRegistry *aRegistry, nsRegistryKe
{ {
SetResolvedProfileDir(tempLocal); SetResolvedProfileDir(tempLocal);
if (leafCreated) if (leafCreated)
tempLocal->Delete(PR_FALSE); tempLocal->Remove(PR_FALSE);
} }
} }
@ -1383,7 +1383,7 @@ nsresult ProfileStruct::ExternalizeLocation(nsIRegistry *aRegistry, nsRegistryKe
rv = resolvedLocation->GetPersistentDescriptor(getter_Copies(descBuf)); rv = resolvedLocation->GetPersistentDescriptor(getter_Copies(descBuf));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
if (leafCreated) if (leafCreated)
resolvedLocation->Delete(PR_FALSE); resolvedLocation->Remove(PR_FALSE);
regData = NS_ConvertUTF8toUCS2(descBuf); regData = NS_ConvertUTF8toUCS2(descBuf);
#else #else
nsXPIDLString ucPath; nsXPIDLString ucPath;

Просмотреть файл

@ -3038,7 +3038,7 @@ nsChromeRegistry::CheckForNewChrome()
} }
} }
PR_Close(file); PR_Close(file);
// listFile->Delete(PR_FALSE); // listFile->Remove(PR_FALSE);
return rv; return rv;
} }
@ -3223,7 +3223,7 @@ NS_IMETHODIMP nsChromeRegistry::Observe(nsISupports *aSubject, const PRUnichar *
nsCOMPtr<nsIFile> userChromeDir; nsCOMPtr<nsIFile> userChromeDir;
rv = NS_GetSpecialDirectory(NS_APP_USER_CHROME_DIR, getter_AddRefs(userChromeDir)); rv = NS_GetSpecialDirectory(NS_APP_USER_CHROME_DIR, getter_AddRefs(userChromeDir));
if (NS_SUCCEEDED(rv) && userChromeDir) if (NS_SUCCEEDED(rv) && userChromeDir)
rv = userChromeDir->Delete(PR_TRUE); rv = userChromeDir->Remove(PR_TRUE);
} }
} }
else if (!nsCRT::strcmp(NS_LITERAL_STRING("profile-do-change").get(), aTopic)) { else if (!nsCRT::strcmp(NS_LITERAL_STRING("profile-do-change").get(), aTopic)) {

Просмотреть файл

@ -488,7 +488,7 @@ LocalStoreImpl::Observe(nsISupports *aSubject, const PRUnichar *aTopic, const PR
nsCOMPtr<nsIFile> aFile; nsCOMPtr<nsIFile> aFile;
rv = NS_GetSpecialDirectory(NS_APP_LOCALSTORE_50_FILE, getter_AddRefs(aFile)); rv = NS_GetSpecialDirectory(NS_APP_LOCALSTORE_50_FILE, getter_AddRefs(aFile));
if (NS_SUCCEEDED(rv)) if (NS_SUCCEEDED(rv))
rv = aFile->Delete(PR_FALSE); rv = aFile->Remove(PR_FALSE);
} }
} }
else if (!nsCRT::strcmp(aTopic, NS_LITERAL_STRING("profile-do-change").get())) { else if (!nsCRT::strcmp(aTopic, NS_LITERAL_STRING("profile-do-change").get())) {

Просмотреть файл

@ -563,7 +563,7 @@ nsresult nsExternalHelperAppService::ExpungeTemporaryFiles()
{ {
localFile = do_QueryInterface(element); localFile = do_QueryInterface(element);
if (localFile) if (localFile)
localFile->Delete(PR_FALSE); localFile->Remove(PR_FALSE);
} }
} }
@ -1107,7 +1107,7 @@ nsresult nsExternalAppHandler::MoveFile(nsIFile * aNewFileLocation)
fileToUse->Equals(mTempFile, &equalToTempFile); fileToUse->Equals(mTempFile, &equalToTempFile);
fileToUse->Exists(&filetoUseAlreadyExists); fileToUse->Exists(&filetoUseAlreadyExists);
if (filetoUseAlreadyExists && !equalToTempFile) if (filetoUseAlreadyExists && !equalToTempFile)
fileToUse->Delete(PR_FALSE); fileToUse->Remove(PR_FALSE);
// extract the new leaf name from the file location // extract the new leaf name from the file location
nsXPIDLCString fileName; nsXPIDLCString fileName;
@ -1243,7 +1243,7 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel()
// clean up after ourselves and delete the temp file... // clean up after ourselves and delete the temp file...
if (mTempFile) if (mTempFile)
{ {
mTempFile->Delete(PR_TRUE); mTempFile->Remove(PR_TRUE);
mTempFile = nsnull; mTempFile = nsnull;
} }

Просмотреть файл

@ -172,7 +172,7 @@ interface nsIFile : nsISupports
* *
* This will not resolve any symlinks. * This will not resolve any symlinks.
*/ */
void delete(in boolean recursive); void remove(in boolean recursive);
/** /**
* Attributes of nsIFile. * Attributes of nsIFile.

Просмотреть файл

@ -1504,7 +1504,7 @@ nsresult nsLocalFile::MoveCopy( nsIFile* newParentDir, const char* newName, PRBo
rv = CopyTo( newParentDir, newName ); rv = CopyTo( newParentDir, newName );
if ( NS_FAILED ( rv ) ) if ( NS_FAILED ( rv ) )
return rv; return rv;
return Delete( PR_TRUE ); return Remove( PR_TRUE );
} }
} }
return MacErrorMapper( macErr ); return MacErrorMapper( macErr );
@ -1588,7 +1588,7 @@ nsLocalFile::Load(PRLibrary * *_retval)
} }
NS_IMETHODIMP NS_IMETHODIMP
nsLocalFile::Delete(PRBool recursive) nsLocalFile::Remove(PRBool recursive)
{ {
MakeDirty(); MakeDirty();

Просмотреть файл

@ -1265,7 +1265,7 @@ nsLocalFile::Load(PRLibrary * *_retval)
} }
NS_IMETHODIMP NS_IMETHODIMP
nsLocalFile::Delete(PRBool recursive) nsLocalFile::Remove(PRBool recursive)
{ {
PRBool isDir; PRBool isDir;
@ -1296,7 +1296,7 @@ nsLocalFile::Delete(PRBool recursive)
iterator->GetNext(getter_AddRefs(item)); iterator->GetNext(getter_AddRefs(item));
file = do_QueryInterface(item); file = do_QueryInterface(item);
file->Delete(recursive); file->Remove(recursive);
iterator->HasMoreElements(&more); iterator->HasMoreElements(&more);
} }

Просмотреть файл

@ -753,7 +753,7 @@ nsLocalFile::MoveTo(nsIFile *newParent, const char *newName)
#endif #endif
rv = CopyTo(newParent, newName); rv = CopyTo(newParent, newName);
if (NS_SUCCEEDED(rv)) if (NS_SUCCEEDED(rv))
rv = Delete(PR_TRUE); rv = Remove(PR_TRUE);
} else { } else {
rv = NSRESULT_FOR_ERRNO(); rv = NSRESULT_FOR_ERRNO();
} }
@ -762,7 +762,7 @@ nsLocalFile::MoveTo(nsIFile *newParent, const char *newName)
} }
NS_IMETHODIMP NS_IMETHODIMP
nsLocalFile::Delete(PRBool recursive) nsLocalFile::Remove(PRBool recursive)
{ {
CHECK_mPath(); CHECK_mPath();
@ -795,7 +795,7 @@ nsLocalFile::Delete(PRBool recursive)
nsCOMPtr<nsIFile> file = do_QueryInterface(item, &rv); nsCOMPtr<nsIFile> file = do_QueryInterface(item, &rv);
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
if (NS_FAILED(rv = file->Delete(recursive))) if (NS_FAILED(rv = file->Remove(recursive)))
return rv; return rv;
} }
} }

Просмотреть файл

@ -1159,7 +1159,7 @@ nsLocalFile::Load(PRLibrary * *_retval)
} }
NS_IMETHODIMP NS_IMETHODIMP
nsLocalFile::Delete(PRBool recursive) nsLocalFile::Remove(PRBool recursive)
{ {
PRBool isDir; PRBool isDir;
@ -1190,7 +1190,7 @@ nsLocalFile::Delete(PRBool recursive)
iterator->GetNext(getter_AddRefs(item)); iterator->GetNext(getter_AddRefs(item));
file = do_QueryInterface(item); file = do_QueryInterface(item);
file->Delete(recursive); file->Remove(recursive);
iterator->HasMoreElements(&more); iterator->HasMoreElements(&more);
} }

Просмотреть файл

@ -186,7 +186,7 @@ out:
if(NS_FAILED(mainFile->Exists(&exists))) if(NS_FAILED(mainFile->Exists(&exists)))
return PR_FALSE; return PR_FALSE;
if(exists && NS_FAILED(mainFile->Delete(PR_FALSE))) if(exists && NS_FAILED(mainFile->Remove(PR_FALSE)))
return PR_FALSE; return PR_FALSE;
// XXX Would prefer MoveTo with a 'null' newdir, the but nsILocalFile // XXX Would prefer MoveTo with a 'null' newdir, the but nsILocalFile

Просмотреть файл

@ -301,7 +301,7 @@ DeletionTest(char* creationPath, char* appendPath, PRBool recursive)
else else
printf("no.\n"); printf("no.\n");
rv = file->Delete(recursive); rv = file->Remove(recursive);
VerifyResult(rv); VerifyResult(rv);
rv = file->Exists(&exists); rv = file->Exists(&exists);

Просмотреть файл

@ -2151,7 +2151,7 @@ nsGlobalHistory::OpenDB()
// we couldn't open the file, so it's either corrupt or doesn't exist. // we couldn't open the file, so it's either corrupt or doesn't exist.
// attempt to delete the file, but ignore the error // attempt to delete the file, but ignore the error
historyFile->Delete(PR_FALSE); historyFile->Remove(PR_FALSE);
rv = OpenNewFile(factory, filePath); rv = OpenNewFile(factory, filePath);
} }
@ -3163,7 +3163,7 @@ nsGlobalHistory::Observe(nsISupports *aSubject, const PRUnichar *aTopic,
nsCOMPtr <nsIFile> historyFile; nsCOMPtr <nsIFile> historyFile;
rv = NS_GetSpecialDirectory(NS_APP_HISTORY_50_FILE, getter_AddRefs(historyFile)); rv = NS_GetSpecialDirectory(NS_APP_HISTORY_50_FILE, getter_AddRefs(historyFile));
if (NS_SUCCEEDED(rv)) if (NS_SUCCEEDED(rv))
rv = historyFile->Delete(PR_FALSE); rv = historyFile->Remove(PR_FALSE);
} }
} }
else if (aTopicString.Equals(NS_LITERAL_STRING("profile-do-change"))) else if (aTopicString.Equals(NS_LITERAL_STRING("profile-do-change")))

Просмотреть файл

@ -2318,7 +2318,7 @@ InternetSearchDataSource::saveContents(nsIChannel* channel, nsIInternetSearchCon
// save data to file // save data to file
// Note: write out one character at a time, as we might be dealing // Note: write out one character at a time, as we might be dealing
// with binary data (such as 0x00) [especially for images] // with binary data (such as 0x00) [especially for images]
outFile->Delete(PR_FALSE); outFile->Remove(PR_FALSE);
// Make an nsFileSpec from file so we can use nsOutputFileStream // Make an nsFileSpec from file so we can use nsOutputFileStream
nsXPIDLCString pathBuf; nsXPIDLCString pathBuf;
@ -5745,7 +5745,7 @@ InternetSearchDataSource::Observe(nsISupports *aSubject, const PRUnichar *aTopic
nsCOMPtr<nsIFile> searchFile; nsCOMPtr<nsIFile> searchFile;
rv = NS_GetSpecialDirectory(NS_APP_SEARCH_50_FILE, getter_AddRefs(searchFile)); rv = NS_GetSpecialDirectory(NS_APP_SEARCH_50_FILE, getter_AddRefs(searchFile));
if (NS_SUCCEEDED(rv)) if (NS_SUCCEEDED(rv))
rv = searchFile->Delete(PR_FALSE); rv = searchFile->Remove(PR_FALSE);
} }
} }
else if (!nsCRT::strcmp(aTopic, NS_LITERAL_STRING("profile-do-change").get())) else if (!nsCRT::strcmp(aTopic, NS_LITERAL_STRING("profile-do-change").get()))

Просмотреть файл

@ -171,7 +171,7 @@ PRInt32 DeleteFileNowOrSchedule(nsIFile* filename)
PRBool flagExists; PRBool flagExists;
PRInt32 result = nsInstall::SUCCESS; PRInt32 result = nsInstall::SUCCESS;
filename->Delete(PR_FALSE); filename->Remove(PR_FALSE);
filename->Exists(&flagExists); filename->Exists(&flagExists);
if (flagExists) if (flagExists)
result = ScheduleFileForDeletion(filename); result = ScheduleFileForDeletion(filename);
@ -472,7 +472,7 @@ void DeleteScheduledFiles( HREG reg )
if (NS_SUCCEEDED(rv)) if (NS_SUCCEEDED(rv))
{ {
PRBool flagExists; PRBool flagExists;
doomedFile->Delete(PR_FALSE); doomedFile->Remove(PR_FALSE);
doomedFile->Exists(&flagExists); doomedFile->Exists(&flagExists);
if ( !flagExists ) if ( !flagExists )
{ {

Просмотреть файл

@ -237,7 +237,7 @@ void nsInstallFile::RemoveAllFolders()
mFinalFile->GetParent(nsfsFolder); mFinalFile->GetParent(nsfsFolder);
for(i = 0; i < mFolderCreateCount; i++) for(i = 0; i < mFolderCreateCount; i++)
{ {
nsfsFolder.Delete(PR_FALSE); nsfsFolder.Remove(PR_FALSE);
nsfsFolder.GetParent(nsfsParentFolder); nsfsFolder.GetParent(nsfsParentFolder);
nsfsFolder = nsfsParentFolder; nsfsFolder = nsfsParentFolder;
} }
@ -308,7 +308,7 @@ PRInt32 nsInstallFile::Complete()
void nsInstallFile::Abort() void nsInstallFile::Abort()
{ {
if (mExtractedFile != nsnull) if (mExtractedFile != nsnull)
mExtractedFile->Delete(PR_FALSE); mExtractedFile->Remove(PR_FALSE);
} }
#define RESBUFSIZE 4096 #define RESBUFSIZE 4096

Просмотреть файл

@ -588,7 +588,7 @@ PRInt32
nsInstallFileOpItem::NativeFileOpDirCreateAbort() nsInstallFileOpItem::NativeFileOpDirCreateAbort()
{ {
if(nsInstallFileOpItem::ACTION_SUCCESS == mAction) if(nsInstallFileOpItem::ACTION_SUCCESS == mAction)
mTarget->Delete(PR_FALSE); mTarget->Remove(PR_FALSE);
return nsInstall::SUCCESS; return nsInstall::SUCCESS;
} }
@ -615,7 +615,7 @@ nsInstallFileOpItem::NativeFileOpDirRemovePrepare()
PRInt32 PRInt32
nsInstallFileOpItem::NativeFileOpDirRemoveComplete() nsInstallFileOpItem::NativeFileOpDirRemoveComplete()
{ {
mTarget->Delete(mFlags); mTarget->Remove(mFlags);
return nsInstall::SUCCESS; return nsInstall::SUCCESS;
} }
@ -826,7 +826,7 @@ nsInstallFileOpItem::NativeFileOpFileCopyComplete()
mTarget->IsFile(&flagIsFile); //Target is file that is already on the system mTarget->IsFile(&flagIsFile); //Target is file that is already on the system
if (flagIsFile) if (flagIsFile)
{ {
rv = mTarget->Delete(PR_FALSE); rv = mTarget->Remove(PR_FALSE);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
rv = mTarget->GetParent(getter_AddRefs(parent)); rv = mTarget->GetParent(getter_AddRefs(parent));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
@ -844,7 +844,7 @@ nsInstallFileOpItem::NativeFileOpFileCopyComplete()
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
tempTarget->Exists(&flagExists); tempTarget->Exists(&flagExists);
if (flagExists) if (flagExists)
tempTarget->Delete(PR_FALSE); tempTarget->Remove(PR_FALSE);
rv = mSrc->CopyTo(mTarget, leafName); rv = mSrc->CopyTo(mTarget, leafName);
} }
@ -876,7 +876,7 @@ nsInstallFileOpItem::NativeFileOpFileCopyAbort()
char* leafName; char* leafName;
mSrc->GetLeafName(&leafName); mSrc->GetLeafName(&leafName);
fullTarget->Append(leafName); fullTarget->Append(leafName);
fullTarget->Delete(PR_FALSE); fullTarget->Remove(PR_FALSE);
} }
return ret; return ret;
@ -1236,7 +1236,7 @@ nsInstallFileOpItem::NativeFileOpWindowsShortcutPrepare()
if(!flagExists) if(!flagExists)
ret = nsInstall::ACCESS_DENIED; ret = nsInstall::ACCESS_DENIED;
else else
tempVar->Delete(0); tempVar->Remove(0);
} }
} }

Просмотреть файл

@ -245,7 +245,7 @@ PRInt32 nsInstallPatch::Prepare()
mPatchFile->Exists(&flagExists); mPatchFile->Exists(&flagExists);
if ( (mPatchFile != nsnull) && (flagExists) ) if ( (mPatchFile != nsnull) && (flagExists) )
{ {
mPatchFile->Delete(PR_FALSE); mPatchFile->Remove(PR_FALSE);
} }
@ -255,7 +255,7 @@ PRInt32 nsInstallPatch::Prepare()
mPatchFile->Exists(&flagExists); mPatchFile->Exists(&flagExists);
if ((mPatchedFile != nsnull) && (flagExists)) if ((mPatchedFile != nsnull) && (flagExists))
{ {
mPatchedFile->Delete(PR_FALSE); mPatchedFile->Remove(PR_FALSE);
} }
return err; return err;
} }
@ -610,7 +610,7 @@ nsInstallPatch::NativePatch(nsIFile *sourceFile, nsIFile *patchFile, nsIFile **n
outFileSpec->GetParent(getter_AddRefs(parent)); outFileSpec->GetParent(getter_AddRefs(parent));
outFileSpec->Delete(PR_FALSE); outFileSpec->Remove(PR_FALSE);
char* leaf; char* leaf;
anotherName->GetLeafName(&leaf); anotherName->GetLeafName(&leaf);
@ -660,7 +660,7 @@ cleanup:
{ {
tempSrcFile->Exists(&flagExists); tempSrcFile->Exists(&flagExists);
if (flagExists) if (flagExists)
tempSrcFile->Delete(PR_FALSE); tempSrcFile->Remove(PR_FALSE);
} }
/* lets map any GDIFF error to nice SU errors */ /* lets map any GDIFF error to nice SU errors */

Просмотреть файл

@ -543,7 +543,7 @@ void nsXPInstallManager::Shutdown()
{ {
item = NS_STATIC_CAST(nsXPITriggerItem*, mTriggers->Get(i)); item = NS_STATIC_CAST(nsXPITriggerItem*, mTriggers->Get(i));
if ( item && item->mFile && !item->IsFileURL() ) if ( item && item->mFile && !item->IsFileURL() )
item->mFile->Delete(PR_FALSE); item->mFile->Remove(PR_FALSE);
} }
} }
@ -754,7 +754,7 @@ nsXPInstallManager::OnStopRequest(nsIRequest *request, nsISupports *ctxt,
nsresult rv2 ; nsresult rv2 ;
rv2 = mItem->mFile->Exists(&flagExists); rv2 = mItem->mFile->Exists(&flagExists);
if (NS_SUCCEEDED(rv2) && flagExists) if (NS_SUCCEEDED(rv2) && flagExists)
mItem->mFile->Delete(PR_FALSE); mItem->mFile->Remove(PR_FALSE);
mItem->mFile = 0; mItem->mFile = 0;
} }