зеркало из https://github.com/mozilla/pjs.git
Bug 22174; add title to SH entries for file:/ftp: directory URLs; r=radha@netscape.com
This commit is contained in:
Родитель
05d1775b1e
Коммит
f39aadf915
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче