Bug 445673 - Rename mType member of class nsMIMEInfoBase to nSchemeOrType to avoid confusion [r=bzbarsky]

This commit is contained in:
Mike Hommey 2010-05-06 09:22:01 +02:00
parent a5171637c0
commit 9d74ea53a9
3 changed files with 18 additions and 18 deletions

View File

@ -62,7 +62,7 @@ NS_INTERFACE_MAP_END_THREADSAFE
// Constructors for a MIME handler.
nsMIMEInfoBase::nsMIMEInfoBase(const char *aMIMEType) :
mType(aMIMEType),
mSchemeOrType(aMIMEType),
mClass(eMIMEInfo),
mPreferredAction(nsIMIMEInfo::saveToDisk),
mAlwaysAskBeforeHandling(PR_TRUE)
@ -70,7 +70,7 @@ nsMIMEInfoBase::nsMIMEInfoBase(const char *aMIMEType) :
}
nsMIMEInfoBase::nsMIMEInfoBase(const nsACString& aMIMEType) :
mType(aMIMEType),
mSchemeOrType(aMIMEType),
mClass(eMIMEInfo),
mPreferredAction(nsIMIMEInfo::saveToDisk),
mAlwaysAskBeforeHandling(PR_TRUE)
@ -83,7 +83,7 @@ nsMIMEInfoBase::nsMIMEInfoBase(const nsACString& aMIMEType) :
// for both and distinguish between the two kinds of handlers via the aClass
// argument to this method, which can be either eMIMEInfo or eProtocolInfo.
nsMIMEInfoBase::nsMIMEInfoBase(const nsACString& aType, HandlerClass aClass) :
mType(aType),
mSchemeOrType(aType),
mClass(aClass),
mPreferredAction(nsIMIMEInfo::saveToDisk),
mAlwaysAskBeforeHandling(PR_TRUE)
@ -163,20 +163,20 @@ nsMIMEInfoBase::AppendExtension(const nsACString& aExtension)
NS_IMETHODIMP
nsMIMEInfoBase::GetType(nsACString& aType)
{
if (mType.IsEmpty())
if (mSchemeOrType.IsEmpty())
return NS_ERROR_NOT_INITIALIZED;
aType = mType;
aType = mSchemeOrType;
return NS_OK;
}
NS_IMETHODIMP
nsMIMEInfoBase::GetMIMEType(nsACString& aMIMEType)
{
if (mType.IsEmpty())
if (mSchemeOrType.IsEmpty())
return NS_ERROR_NOT_INITIALIZED;
aMIMEType = mType;
aMIMEType = mSchemeOrType;
return NS_OK;
}
@ -203,7 +203,7 @@ nsMIMEInfoBase::Equals(nsIMIMEInfo *aMIMEInfo, PRBool *_retval)
nsresult rv = aMIMEInfo->GetMIMEType(type);
if (NS_FAILED(rv)) return rv;
*_retval = mType.Equals(type);
*_retval = mSchemeOrType.Equals(type);
return NS_OK;
}
@ -367,7 +367,7 @@ nsMIMEInfoBase::LaunchWithURI(nsIURI* aURI,
void
nsMIMEInfoBase::CopyBasicDataTo(nsMIMEInfoBase* aOther)
{
aOther->mType = mType;
aOther->mSchemeOrType = mSchemeOrType;
aOther->mDefaultAppDescription = mDefaultAppDescription;
aOther->mExtensions = mExtensions;
}

View File

@ -105,7 +105,7 @@ class nsMIMEInfoBase : public nsIMIMEInfo {
nsMIMEInfoBase(const nsACString& aType, HandlerClass aClass) NS_HIDDEN;
virtual ~nsMIMEInfoBase(); // must be virtual, as the the base class's Release should call the subclass's destructor
void SetMIMEType(const nsACString & aMIMEType) { mType = aMIMEType; }
void SetMIMEType(const nsACString & aMIMEType) { mSchemeOrType = aMIMEType; }
void SetDefaultDescription(const nsString& aDesc) { mDefaultAppDescription = aDesc; }
@ -170,7 +170,7 @@ class nsMIMEInfoBase : public nsIMIMEInfo {
// member variables
nsTArray<nsCString> mExtensions; ///< array of file extensions associated w/ this MIME obj
nsString mDescription; ///< human readable description
nsCString mType;
nsCString mSchemeOrType;
HandlerClass mClass;
nsCOMPtr<nsIHandlerApp> mPreferredApplication;
nsCOMPtr<nsIMutableArray> mPossibleApplications;

View File

@ -59,7 +59,7 @@ nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI)
nsresult rv = nsGNOMERegistry::LoadURL(aURI);
#if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS)
if (NS_FAILED(rv)){
HildonURIAction *action = hildon_uri_get_default_action(mType.get(), nsnull);
HildonURIAction *action = hildon_uri_get_default_action(mSchemeOrType.get(), nsnull);
if (action) {
nsCAutoString spec;
aURI->GetAsciiSpec(spec);
@ -76,7 +76,7 @@ NS_IMETHODIMP
nsMIMEInfoUnix::GetHasDefaultHandler(PRBool *_retval)
{
*_retval = PR_FALSE;
nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mType);
nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType);
if (!mimeInfo) {
nsCAutoString ext;
nsresult rv = GetPrimaryExtension(ext);
@ -91,7 +91,7 @@ nsMIMEInfoUnix::GetHasDefaultHandler(PRBool *_retval)
return NS_OK;
#if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS)
HildonURIAction *action = hildon_uri_get_default_action(mType.get(), nsnull);
HildonURIAction *action = hildon_uri_get_default_action(mSchemeOrType.get(), nsnull);
if (action) {
*_retval = PR_TRUE;
hildon_uri_action_unref(action);
@ -118,12 +118,12 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile *aFile)
nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
if (giovfs) {
nsCOMPtr<nsIGIOMimeApp> app;
if (NS_SUCCEEDED(giovfs->GetAppForMimeType(mType, getter_AddRefs(app))) && app)
if (NS_SUCCEEDED(giovfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app)
return app->Launch(nativePath);
} else if (gnomevfs) {
/* Fallback to GnomeVFS */
nsCOMPtr<nsIGnomeVFSMimeApp> app;
if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(mType, getter_AddRefs(app))) && app)
if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app)
return app->Launch(nativePath);
}
@ -176,7 +176,7 @@ nsMIMEInfoUnix::LaunchDefaultWithDBus(const char *aFilePath)
result = hildon_mime_open_file_with_mime_type(connection,
aFilePath,
mType.get());
mSchemeOrType.get());
if (result != kHILDON_SUCCESS)
if (hildon_mime_open_file(connection, aFilePath) != kHILDON_SUCCESS)
return NS_ERROR_FAILURE;
@ -205,7 +205,7 @@ nsMIMEInfoUnix::GetPossibleApplicationHandlers(nsIMutableArray ** aPossibleAppHa
if (!mPossibleApplications)
return NS_ERROR_OUT_OF_MEMORY;
GSList *actions = hildon_uri_get_actions(mType.get(), nsnull);
GSList *actions = hildon_uri_get_actions(mSchemeOrType.get(), nsnull);
GSList *actionsPtr = actions;
while (actionsPtr) {
HildonURIAction *action = (HildonURIAction*)actionsPtr->data;