From 402459960e49927432f8f7f9e6081b1f8d155d14 Mon Sep 17 00:00:00 2001 From: stippi Date: Wed, 19 May 2010 20:07:20 +0000 Subject: [PATCH] Fix empty URL input bar when switching to a tab after it loaded in the background. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@503 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/BrowserWindow.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index 3ff7e2d9f3..9888677abf 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -188,9 +188,9 @@ public: fURLInputContents = text; } - const char* URLInputContents() const + const BString& URLInputContents() const { - return fURLInputContents.String(); + return fURLInputContents; } void SetURLInputSelection(int32 selectionStart, int32 selectionEnd) @@ -946,7 +946,10 @@ BrowserWindow::SetCurrentWebView(BWebView* webView) if (userData != NULL) { fURLInputGroup->SetPageIcon(userData->PageIcon()); - fURLInputGroup->SetText(userData->URLInputContents()); + if (userData->URLInputContents().Length()) + fURLInputGroup->SetText(userData->URLInputContents()); + else + fURLInputGroup->SetText(webView->MainFrameURL()); if (userData->URLInputSelectionStart() >= 0) { fURLInputGroup->TextView()->Select( userData->URLInputSelectionStart(),