зеркало из https://github.com/mozilla/pjs.git
Fix bugs 113745, 113742 and 114811: all regarding "moz-icon:". Fix up XP_MAC code to use Mac OS's Icon Services, and expose platform icons in file:/// display and search panel (and search preferences panel). Mixture of r/srs: sdagley, ben, and smfr
This commit is contained in:
Родитель
dc478c6203
Коммит
6219c60c09
|
@ -3771,14 +3771,24 @@ InternetSearchDataSource::SaveEngineInfoIntoGraph(nsIFile *file, nsIFile *icon,
|
||||||
if (!searchRes) return(NS_ERROR_UNEXPECTED);
|
if (!searchRes) return(NS_ERROR_UNEXPECTED);
|
||||||
if (!categoryRes) return(NS_ERROR_UNEXPECTED);
|
if (!categoryRes) return(NS_ERROR_UNEXPECTED);
|
||||||
|
|
||||||
|
nsAutoString iconURL;
|
||||||
if (icon)
|
if (icon)
|
||||||
{
|
{
|
||||||
nsXPIDLCString iconPath;
|
nsXPIDLCString iconFileURL;
|
||||||
icon->GetPath(getter_Copies(iconPath));
|
if (NS_FAILED(rv = icon->GetURL(getter_Copies(iconFileURL))))
|
||||||
nsFileSpec iconSpec((const char *)iconPath);
|
return(rv);
|
||||||
nsFileURL iconFileURL(iconSpec);
|
iconURL.AssignWithConversion(iconFileURL);
|
||||||
nsAutoString iconURL;
|
}
|
||||||
iconURL.AssignWithConversion(iconFileURL.GetURLString());
|
#ifdef XP_MAC
|
||||||
|
else if (file)
|
||||||
|
{
|
||||||
|
nsXPIDLCString fileURL;
|
||||||
|
if (NS_FAILED(rv = file->GetURL(getter_Copies(fileURL))))
|
||||||
|
return(rv);
|
||||||
|
iconURL.Assign(NS_LITERAL_STRING("moz-icon:"));
|
||||||
|
iconURL.AppendWithConversion(fileURL);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// save icon url (if we have one)
|
// save icon url (if we have one)
|
||||||
if (iconURL.Length() > 0)
|
if (iconURL.Length() > 0)
|
||||||
|
@ -3790,7 +3800,6 @@ InternetSearchDataSource::SaveEngineInfoIntoGraph(nsIFile *file, nsIFile *icon,
|
||||||
updateAtom(mInner, searchRes, kNC_Icon, iconLiteral, nsnull);
|
updateAtom(mInner, searchRes, kNC_Icon, iconLiteral, nsnull);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (checkMacFileType == PR_FALSE)
|
if (checkMacFileType == PR_FALSE)
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче