return url->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target); } else if (property == kNC_Icon) { nsCOMPtr<nsIRDFLiteral> url; PRBool isFavorite = PR_FALSE; rv = GetURL(source, &isFavorite, getter_AddRefs(url)); if (NS_FAILED(rv)) return(rv); if (isFavorite || !url)	rv = NS_RDF_NO_VALUE; if (rv == NS_RDF_NO_VALUE)	return(rv);  const PRUnichar *uni = nsnull; url->GetValueConst(&uni); if (!uni)   return(NS_RDF_NO_VALUE); nsAutoString    urlStr; urlStr.Assign(NS_LITERAL_STRING(NS_MOZICON_SCHEME).get()); urlStr.Append(uni);  rv = gRDFService->GetLiteral(urlStr.get(), getter_AddRefs(url)); if (NS_FAILED(rv) || !url)    return(NS_RDF_NO_VALUE);
FileSystemDataSource::GetTarget(nsIRDFResource *source,                                nsIRDFResource *property,                                PRBool tv,                                nsIRDFNode **target /* out */){	NS_PRECONDITION(source != nsnull, "null ptr");	if (! source)		return NS_ERROR_NULL_POINTER;	NS_PRECONDITION(property != nsnull, "null ptr");	if (! property)		return NS_ERROR_NULL_POINTER;	NS_PRECONDITION(target != nsnull, "null ptr");	if (! target)		return NS_ERROR_NULL_POINTER;	*target = nsnull;	nsresult		rv = NS_RDF_NO_VALUE;	// we only have positive assertions in the file system data source.	if (! tv)		return NS_RDF_NO_VALUE;	if (source == kNC_FileSystemRoot)	{		if (property == kNC_pulse)		{			nsIRDFLiteral	*pulseLiteral;			gRDFService->GetLiteral(NS_LITERAL_STRING("12").get(), &pulseLiteral);			*target = pulseLiteral;			return NS_OK;		}	}	else if (isFileURI(source))	{		if (property == kNC_Name)		{			nsCOMPtr<nsIRDFLiteral> name;			rv = GetName(source, getter_AddRefs(name));			if (NS_FAILED(rv)) return(rv);			if (!name)	rv = NS_RDF_NO_VALUE;			if (rv == NS_RDF_NO_VALUE)	return(rv);			return name->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target);		}		else if (property == kNC_URL)		{			nsCOMPtr<nsIRDFLiteral> url;			rv = GetURL(source, getter_AddRefs(url));			if (NS_FAILED(rv)) return(rv);			if (!url)	rv = NS_RDF_NO_VALUE;			if (rv == NS_RDF_NO_VALUE)	return(rv);			return url->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target);		}		else if (property == kNC_Length)		{		    nsCOMPtr<nsIRDFInt> fileSize;		    rv = GetFileSize(source, getter_AddRefs(fileSize));			if (NS_FAILED(rv)) return(rv);			if (!fileSize)	rv = NS_RDF_NO_VALUE;			if (rv == NS_RDF_NO_VALUE)	return(rv);			return fileSize->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target);		}		else if (property == kWEB_LastMod)		{		    nsCOMPtr<nsIRDFDate> lastMod;		    rv = GetLastMod(source, getter_AddRefs(lastMod));			if (NS_FAILED(rv)) return(rv);			if (!lastMod)	rv = NS_RDF_NO_VALUE;			if (rv == NS_RDF_NO_VALUE)	return(rv);			return lastMod->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target);		}		else if (property == kRDF_type)		{			const char	*type;			rv = kNC_FileSystemObject->GetValueConst(&type);			if (NS_FAILED(rv)) return(rv);#ifdef	XP_WIN			// under Windows, if its an IE favorite, return that type			if (ieFavoritesDir)			{				const char		*uri;				rv = source->GetValueConst(&uri);				if (NS_FAILED(rv)) return(rv);				nsAutoString		theURI;				theURI.AssignWithConversion(uri);				if (theURI.Find(ieFavoritesDir) == 0)				{					if (theURI[theURI.Length() - 1] == '/')					{						rv = kNC_IEFavoriteFolder->GetValueConst(&type);					}					else					{						rv = kNC_IEFavoriteObject->GetValueConst(&type);					}					if (NS_FAILED(rv)) return(rv);				}			}#endif			nsAutoString	url;			url.AssignWithConversion(type);			nsCOMPtr<nsIRDFLiteral> literal;			gRDFService->GetLiteral(url.get(), getter_AddRefs(literal));			rv = literal->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target);			return(rv);		}		else if (property == kNC_pulse)		{			nsCOMPtr<nsIRDFLiteral> pulseLiteral;			gRDFService->GetLiteral(NS_LITERAL_STRING("12").get(), getter_AddRefs(pulseLiteral));			rv = pulseLiteral->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target);			return(rv);		}		else if (property == kNC_Child)		{			// Oh this is evil. Somebody kill me now.			nsCOMPtr<nsISimpleEnumerator> children;			rv = GetFolderList(source, PR_FALSE, PR_TRUE, getter_AddRefs(children));			if (NS_FAILED(rv)) return(rv);			PRBool hasMore;			rv = children->HasMoreElements(&hasMore);			if (NS_FAILED(rv)) return(rv);			if (hasMore)			{				nsCOMPtr<nsISupports> isupports;				rv = children->GetNext(getter_AddRefs(isupports));				if (NS_FAILED(rv)) return(rv);				return isupports->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target);			}		}#ifdef USE_NC_EXTENSION		else if (property == kNC_extension)		{		    nsCOMPtr<nsIRDFLiteral> extension;		    rv = GetExtension(source, getter_AddRefs(extension));		    if (!extension)    rv = NS_RDF_NO_VALUE;		    if (rv == NS_RDF_NO_VALUE) return(rv);		    return extension->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target);		}#endif	}	return(NS_RDF_NO_VALUE);}