Bug 22174; add title to SH entries for file:/ftp: directory URLs; r=radha@netscape.com

This commit is contained in:
law%netscape.com 2005-08-18 11:15:49 +00:00
parent 9a4ba5d2fa
commit f21cc4c0cb

View File

@ -22,6 +22,7 @@
// Local Includes
#include "nsSHEntry.h"
#include "nsXPIDLString.h"
//*****************************************************************************
//*** nsSHEntry: Object Management
@ -98,6 +99,15 @@ NS_IMETHODIMP nsSHEntry::GetTitle(PRUnichar** aTitle)
{
NS_ENSURE_ARG_POINTER(aTitle);
// Check for empty title...
if ( mTitle.IsEmpty() && mURI ) {
// Default title is the URL.
nsXPIDLCString spec;
if ( NS_SUCCEEDED( mURI->GetSpec( getter_Copies( spec ) ) ) ) {
mTitle.AssignWithConversion( spec );
}
}
*aTitle = mTitle.ToNewUnicode();
return NS_OK;
}