зеркало из https://github.com/mozilla/gecko-dev.git
r=pedemont, sr=blizzard (platform specific) OS/2 only - handle cases where we are asked for icons for extensions (.zip, etc.)
This commit is contained in:
Родитель
809145775f
Коммит
3ad659d9c9
|
@ -456,7 +456,21 @@ nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, PRBool nonBloc
|
|||
// (1) get an hIcon for the file
|
||||
PSZ pszFileName = (PSZ)filePath.get();
|
||||
HPOINTER hIcon = WinLoadFileIcon(pszFileName, FALSE);
|
||||
if (hIcon == NULL)
|
||||
if (hIcon == NULLHANDLE) && (pszFileName[0] == '.')) {
|
||||
/* Just trying to get an icon for an extension */
|
||||
/* Create a temporary file to try to get an icon */
|
||||
char* tmpdir = getenv("TMP");
|
||||
if (tmpdir) {
|
||||
char tmpfile[CCHMAXPATH];
|
||||
strcpy(tmpfile, tmpdir);
|
||||
strcat(tmpfile, pszFileName);
|
||||
FILE* fp = fopen(tmpfile, "wb+");
|
||||
fclose(fp);
|
||||
hIcon = WinLoadFileIcon(tmpfile, FALSE);
|
||||
remove(tmpfile);
|
||||
}
|
||||
}
|
||||
if (hIcon == NULLHANDLE)
|
||||
return NS_ERROR_FAILURE;
|
||||
// we got a handle to an icon. Now we want to get a bitmap for the icon using GetIconInfo....
|
||||
POINTERINFO IconInfo;
|
||||
|
|
Загрузка…
Ссылка в новой задаче