nsIComponentManager API Changes (bug 98553)
a) create a new nsIComponentManager with only four functions on it: CreateInstance CreateInstanceByContractID GetClassInfo GetClassInfoByContractID. b) rename the old nsIComponentManager to nsIComponentManagerObsolete. c) fixes callers which use to access the nsIComponentManager for component registration functionality. These callers will temporary use the nsIComponentManagerObsolete interface. d) Create a new API NS_GetComponentManager() which mirrors the NS_GetServiceManager() e) Perserves the old NS_GetGlobalComponentManager(). Note the cast usage. r/sr = rpotts@netscape.com alecf@netscape.com brendan@mozilla.org git-svn-id: svn://10.0.0.236/trunk@110748 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -300,7 +300,6 @@ nsLocalFile::MakeDirty()
|
||||
// this function will walk the native path of |this| resolving any symbolic
|
||||
// links found. The new resulting path will be placed into mResolvedPath.
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
nsLocalFile::ResolvePath(const char* workingPath, PRBool resolveTerminal, char** resolvedPath)
|
||||
{
|
||||
@@ -589,13 +588,10 @@ NS_IMETHODIMP
|
||||
nsLocalFile::Clone(nsIFile **file)
|
||||
{
|
||||
nsresult rv;
|
||||
char * aFilePath;
|
||||
GetPath(&aFilePath);
|
||||
|
||||
|
||||
nsCOMPtr<nsILocalFile> localFile;
|
||||
|
||||
rv = NS_NewLocalFile(aFilePath, mFollowSymlinks, getter_AddRefs(localFile));
|
||||
nsMemory::Free(aFilePath);
|
||||
rv = NS_NewLocalFile(mWorkingPath.get(), mFollowSymlinks, getter_AddRefs(localFile));
|
||||
|
||||
if (NS_SUCCEEDED(rv) && localFile)
|
||||
{
|
||||
@@ -1862,19 +1858,19 @@ NS_IMETHODIMP nsLocalFile::GetURL(char * *aURL)
|
||||
// Escape the path with the directory mask
|
||||
rv = nsStdEscape(ePath, esc_Directory+esc_Forced, escPath);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
||||
escPath.Insert("file:///", 0);
|
||||
|
||||
PRBool dir;
|
||||
rv = IsDirectory(&dir);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Cannot tell if this is a directory");
|
||||
if (NS_SUCCEEDED(rv) && dir && escPath[escPath.Length() - 1] != '/') {
|
||||
// make sure we have a trailing slash
|
||||
escPath += "/";
|
||||
if (escPath[escPath.Length() - 1] != '/') {
|
||||
PRBool dir;
|
||||
rv = IsDirectory(&dir);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Cannot tell if this is a directory");
|
||||
if (NS_SUCCEEDED(rv) && dir) {
|
||||
// make sure we have a trailing slash
|
||||
escPath += "/";
|
||||
}
|
||||
}
|
||||
escPath.Insert("file:///", 0);
|
||||
*aURL = ToNewCString(escPath);
|
||||
rv = *aURL ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
}
|
||||
CRTFREEIF(ePath);
|
||||
return rv;
|
||||
|
||||
Reference in New Issue
Block a user