mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 22174; add title to SH entries for file:/ftp: directory URLs; r=radha@netscape.com
This commit is contained in:
parent
9a4ba5d2fa
commit
f21cc4c0cb
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user