From 50722c37782edd9af39c66a03af835cae2db1945 Mon Sep 17 00:00:00 2001 From: "law%netscape.com" Date: Mon, 21 Aug 2000 11:02:39 +0000 Subject: [PATCH] Bug 22174; add title to SH entries for file:/ftp: directory URLs; r=radha@netscape.com --- xpfe/components/shistory/src/nsSHEntry.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xpfe/components/shistory/src/nsSHEntry.cpp b/xpfe/components/shistory/src/nsSHEntry.cpp index 4d24b331f7f..6d7e5b30398 100644 --- a/xpfe/components/shistory/src/nsSHEntry.cpp +++ b/xpfe/components/shistory/src/nsSHEntry.cpp @@ -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; }