NS_RELEASE(pulseLiteral); return rv;
return(rv);
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;	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_ConvertASCIItoUCS2("12").GetUnicode(), &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 == 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);			nsIRDFLiteral	*literal;			gRDFService->GetLiteral(url.GetUnicode(), &literal);			rv = literal->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target);			NS_RELEASE(literal);			return rv;		}		else if (property == kNC_pulse)		{			nsIRDFLiteral	*pulseLiteral;			gRDFService->GetLiteral(NS_ConvertASCIItoUCS2("12").GetUnicode(), &pulseLiteral);			rv = pulseLiteral->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target);			NS_RELEASE(pulseLiteral);			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);			}		}	}	*target = nsnull;	return NS_RDF_NO_VALUE;}