зеркало из https://github.com/mozilla/pjs.git
Back out the code where, under Windows, try and munge imported IE Favorites names to not include a ".url". I'm going to put the code elsewhere.
This commit is contained in:
Родитель
6bb89e5a9e
Коммит
1c2b36a081
|
@ -1467,52 +1467,7 @@ nsBookmarksService::GetTarget(nsIRDFResource* aSource,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rv = mInner->GetTarget(aSource, aProperty, aTruthValue, aTarget);
|
return mInner->GetTarget(aSource, aProperty, aTruthValue, aTarget);
|
||||||
|
|
||||||
#ifdef XP_WIN
|
|
||||||
// under Windows, munge IE favorite names to strip off the ".url"
|
|
||||||
if (NS_SUCCEEDED(rv) && (aTruthValue) && (aProperty == kNC_Name))
|
|
||||||
{
|
|
||||||
// XXX should ensure that aSource's URI begins with nsSpecialSystemDirectory::Win_Favorites
|
|
||||||
|
|
||||||
nsCOMPtr<nsIRDFNode> tempNode = do_QueryInterface(*aTarget);
|
|
||||||
if (tempNode)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsIRDFLiteral> litTemp = do_QueryInterface(tempNode);
|
|
||||||
if (litTemp)
|
|
||||||
{
|
|
||||||
const PRUnichar *uniName = nsnull;
|
|
||||||
if (NS_SUCCEEDED(litTemp->GetValueConst(&uniName)) && (uniName))
|
|
||||||
{
|
|
||||||
nsAutoString name(uniName), extension;
|
|
||||||
PRInt32 len = name.Length();
|
|
||||||
if (len > 4)
|
|
||||||
{
|
|
||||||
name.Right(extension, 4);
|
|
||||||
if (extension.EqualsIgnoreCase(".url"))
|
|
||||||
{
|
|
||||||
name.Truncate(len-4);
|
|
||||||
|
|
||||||
nsIRDFLiteral *literal;
|
|
||||||
if (NS_SUCCEEDED(gRDF->GetLiteral(name.GetUnicode(),
|
|
||||||
&literal)))
|
|
||||||
{
|
|
||||||
// be sure to release the original name we got back!
|
|
||||||
NS_IF_RELEASE(*aTarget);
|
|
||||||
|
|
||||||
rv = literal->QueryInterface(nsIRDFNode::GetIID(),
|
|
||||||
(void**) aTarget);
|
|
||||||
NS_RELEASE(literal);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return(rv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче