PRBool		foundIconFlag = PR_FALSE; nsFileSpec	iconSpec; nsAutoString	temp;  nsCOMPtr<nsILocalFile> iconFile;
char		*uriC = uri.ToNewCString(); if (!uriC)	continue; char		*uriCescaped = nsEscape(uriC, url_Path); nsCRT::free(uriC); if (!uriCescaped)	continue;  searchURL += uriCescaped; nsCRT::free(uriCescaped);
InternetSearchDataSource::GetSearchEngineList(nsIFile *searchDir, PRBool checkMacFileType){        nsresult			rv = NS_OK;    if (!mInner)    {    	return(NS_RDF_NO_VALUE);    }    PRBool hasMore = PR_FALSE;    nsCOMPtr<nsISimpleEnumerator> dirIterator;    rv = searchDir->GetDirectoryEntries(getter_AddRefs(dirIterator));    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIFile> dirEntry;	while ((rv = dirIterator->HasMoreElements(&hasMore)) == NS_OK && hasMore)	{		rv = dirIterator->GetNext((nsISupports**)getter_AddRefs(dirEntry));        if (NS_FAILED(rv))          continue;        // Ignore hidden files/directories        PRBool isHidden;        rv = dirEntry->IsHidden(&isHidden);        if (NS_FAILED(rv) || isHidden)          continue;        PRBool isDirectory;        rv = dirEntry->IsDirectory(&isDirectory);        if (NS_FAILED(rv))          continue;        if (isDirectory)        {          GetSearchEngineList(dirEntry, checkMacFileType);          continue;        }            nsXPIDLCString pathBuf;        rv = dirEntry->GetPath(getter_Copies(pathBuf));        if (NS_FAILED(rv))        continue;      		nsAutoString	uri;		uri.AssignWithConversion((const char *)pathBuf);		PRInt32		len = uri.Length();		if (len < 5)		{			continue;		}#ifdef	XP_MAC		if (checkMacFileType == PR_TRUE)		{            nsCOMPtr<nsILocalFileMac> macFile(do_QueryInterface(dirEntry));            if (!macFile)                continue;            OSType type, creator;            rv = macFile->GetFileTypeAndCreator(&type, &creator);            if (NS_FAILED(rv) || type != 'issp' || creator != 'fndf')                continue;  		}#endif		// check the extension (must be ".src")		nsAutoString	extension;		if ((uri.Right(extension, 4) != 4) || (!extension.EqualsIgnoreCase(".src")))		{			continue;		}		// check for various icons		PRBool		foundIconFlag = PR_FALSE;		nsFileSpec	iconSpec;		nsAutoString	temp;				nsCOMPtr<nsILocalFile> iconFile;		uri.Left(temp, uri.Length()-4);		temp.AppendWithConversion(".gif");		const	nsFileSpec	gifIconFile(temp);		if (gifIconFile.IsFile())		{			iconSpec = gifIconFile;			foundIconFlag = PR_TRUE;		}		if (foundIconFlag == PR_FALSE)		{			uri.Left(temp, uri.Length()-4);			temp.AppendWithConversion(".jpg");			const	nsFileSpec	jpgIconFile(temp);			if (jpgIconFile.IsFile())			{				iconSpec = jpgIconFile;				foundIconFlag = PR_TRUE;			}		}		if (foundIconFlag == PR_FALSE)		{			uri.Left(temp, uri.Length()-4);			temp.AppendWithConversion(".jpeg");			const	nsFileSpec	jpegIconFile(temp);			if (jpegIconFile.IsFile())			{				iconSpec = jpegIconFile;				foundIconFlag = PR_TRUE;			}		}		if (foundIconFlag == PR_FALSE)		{			uri.Left(temp, uri.Length()-4);			temp.AppendWithConversion(".png");			const	nsFileSpec	pngIconFile(temp);			if (pngIconFile.IsFile())			{				iconSpec = pngIconFile;				foundIconFlag = PR_TRUE;			}		}				if (foundIconFlag)		{		  NS_NewLocalFile((const char *)iconSpec, PR_TRUE, getter_AddRefs(iconFile));		}		SaveEngineInfoIntoGraph(dirEntry, iconFile, nsnull, nsnull, checkMacFileType);	}		return(rv);}