continue;
uri.Left(temp, uri.Length()-4); temp.AppendWithConversion(".jpeg"); const	nsFileSpec	jpegIconFile(temp); if (jpegIconFile.IsFile()) { iconSpec = jpegIconFile; foundIconFlag = PR_TRUE; }
InternetSearchDataSource::GetSearchEngineList(nsFileSpec nativeDir, PRBool checkMacFileType){        nsresult			rv = NS_OK;	if (!mInner)	{		return(NS_RDF_NO_VALUE);	}	for (nsDirectoryIterator i(nativeDir, PR_TRUE); i.Exists(); i++)	{		const nsFileSpec	fileSpec = (const nsFileSpec &)i;		if (fileSpec.IsHidden())		{			// Ignore hidden files/directories			continue;		}		if (fileSpec.IsDirectory())		{			GetSearchEngineList(fileSpec, checkMacFileType);			continue;		}		const char	*childURL = fileSpec;		if (childURL == nsnull)		{			continue;		}		nsAutoString	uri; uri.AssignWithConversion(childURL);		PRInt32		len = uri.Length();		if (len < 5)		{			continue;		}		// check for various icons		nsAutoString	iconURL;		PRInt32		extensionOffset;		extensionOffset = uri.RFind(".src", PR_TRUE);		if ((extensionOffset >= 0) && (extensionOffset == len-4))		{			nsAutoString	temp;			uri.Left(temp, uri.Length()-4);			temp.AppendWithConversion(".gif");			const	nsFileSpec	gifIconFile(temp);			if (gifIconFile.IsFile())			{				nsFileURL	gifIconFileURL(gifIconFile);				iconURL.AssignWithConversion(gifIconFileURL.GetURLString());			}			uri.Left(temp, uri.Length()-4);			temp.AppendWithConversion(".jpg");			const	nsFileSpec	jpgIconFile(temp);			if (jpgIconFile.IsFile())			{				nsFileURL	jpgIconFileURL(jpgIconFile);				iconURL.AssignWithConversion(jpgIconFileURL.GetURLString());			}			uri.Left(temp, uri.Length()-4);			temp.AppendWithConversion(".jpeg");			const	nsFileSpec	jpegIconFile(temp);			if (jpegIconFile.IsFile())			{				nsFileURL	jpegIconFileURL(jpegIconFile);				iconURL.AssignWithConversion(jpegIconFileURL.GetURLString());			}			uri.Left(temp, uri.Length()-4);			temp.AppendWithConversion(".png");			const	nsFileSpec	pngIconFile(temp);			if (pngIconFile.IsFile())			{				nsFileURL	pngIconFileURL(pngIconFile);				iconURL.AssignWithConversion(pngIconFileURL.GetURLString());			}		}#ifdef	XP_MAC		if (checkMacFileType == PR_TRUE)		{			CInfoPBRec	cInfo;			OSErr		err;			err = fileSpec.GetCatInfo(cInfo);			if ((err) || (cInfo.hFileInfo.ioFlFndrInfo.fdType != 'issp') ||				(cInfo.hFileInfo.ioFlFndrInfo.fdCreator != 'fndf'))			{				continue;			}		}#endif		// check the extension (must be ".src")		nsAutoString	extension;		if ((uri.Right(extension, 4) != 4) || (!extension.EqualsIgnoreCase(".src")))		{			continue;		}		nsAutoString	searchURL; searchURL.AssignWithConversion(kEngineProtocol);		char		*uriC = uri.ToNewCString();		if (!uriC)		{			continue;		}		char		*uriCescaped = nsEscape(uriC, url_Path);		nsCRT::free(uriC);		if (!uriCescaped)		{			continue;		}		searchURL.AppendWithConversion(uriCescaped);		nsCRT::free(uriCescaped);		nsCOMPtr<nsIRDFResource>	searchRes;		if (NS_FAILED(rv = gRDFService->GetUnicodeResource(searchURL.GetUnicode(),			getter_AddRefs(searchRes))))		{			continue;		}		// save icon url (if we have one)		if (iconURL.Length() > 0)		{			nsCOMPtr<nsIRDFLiteral>	iconLiteral;			if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(iconURL.GetUnicode(),					getter_AddRefs(iconLiteral))))			{				mInner->Assert(searchRes, kNC_Icon, iconLiteral, PR_TRUE);			}		}		// save the file basename		nsNativeFileSpec	native(fileSpec);		nsAutoString		basename;		native.GetLeafName(basename);		basename.InsertWithConversion(kURINC_SearchCategoryEngineBasenamePrefix, 0);		nsCOMPtr<nsIRDFLiteral>	basenameLiteral;		if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(basename.GetUnicode(),				getter_AddRefs(basenameLiteral))))		{			mInner->Assert(searchRes, kNC_URL, basenameLiteral, PR_TRUE);		}		// Note: add the child relationship last		mInner->Assert(kNC_SearchEngineRoot, kNC_Child, searchRes, PR_TRUE);	}	return(rv);}