mirror of
https://review.haiku-os.org/haiku
synced 2025-01-31 02:35:03 +01:00
Web+: avoid empty tab title
Use file name, if no title is provided by the page Fixes #13663
This commit is contained in:
parent
acad802d56
commit
43d60df2b0
@ -1798,7 +1798,20 @@ BrowserWindow::AuthenticationChallenge(BString message, BString& inOutUser,
|
||||
void
|
||||
BrowserWindow::_UpdateTitle(const BString& title)
|
||||
{
|
||||
BString windowTitle = title;
|
||||
BString windowTitle;
|
||||
|
||||
if (title.Length() > 0)
|
||||
windowTitle = title;
|
||||
else {
|
||||
BWebView* webView = CurrentWebView();
|
||||
if (webView != NULL) {
|
||||
BString url = webView->MainFrameURL();
|
||||
int32 leafPos = url.FindLast('/');
|
||||
url.Remove(0, leafPos + 1);
|
||||
windowTitle = url;
|
||||
}
|
||||
}
|
||||
|
||||
if (windowTitle.Length() > 0)
|
||||
windowTitle << " - ";
|
||||
windowTitle << kApplicationName;
|
||||
|
Loading…
x
Reference in New Issue
Block a user