Adjust all users of BUrl to new API

The old BUrl constructor with just a string is now private. The new one
has a default value for the second parameter, but C++ doesn't exclude
the private constructor from the candidate functions search. So, the
default argument for the new constructor needs to be explicitly
specified now.

Change-Id: Idb1915649ea3d2c59e344801a9d4fe201f8040e9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9236
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
PulkoMandy
2025-05-27 10:43:12 +00:00
committed by Adrien Destugues
parent 1d242620b4
commit 0ec1d4526c
20 changed files with 33 additions and 33 deletions
@@ -23,7 +23,7 @@
#define USERAGENT_FALLBACK_VERSION "0.0.0"
BUrl ServerSettings::sBaseUrl = BUrl(BASEURL_DEFAULT);
BUrl ServerSettings::sBaseUrl = BUrl(BASEURL_DEFAULT, true);
BString ServerSettings::sUserAgent = BString();
pthread_once_t ServerSettings::sUserAgentInitOnce = PTHREAD_ONCE_INIT;
bool ServerSettings::sPreferCache = false;
+1 -1
View File
@@ -277,7 +277,7 @@ App::ArgvReceived(int32 argc, char* argv[])
break;
case WEB_APP_BASE_URL_SWITCH:
if (ServerSettings::SetBaseUrl(BUrl(argv[i + 1])) != B_OK) {
if (ServerSettings::SetBaseUrl(BUrl(argv[i + 1], true)) != B_OK) {
HDERROR("malformed web app base url; %s", argv[i + 1]);
Quit();
} else {
+1 -1
View File
@@ -777,7 +777,7 @@ public:
case MSG_VISIT_PUBLISHER_WEBSITE:
{
BUrl url(fWebsiteLinkView->Text());
BUrl url(fWebsiteLinkView->Text(), true);
url.OpenWithPreferredApplication();
break;
}
+1 -1
View File
@@ -218,7 +218,7 @@ MainApp::ArgvReceived(int32 argc, char** argv)
getcwd(cwd, sizeof(cwd));
for (int i = 1; i < argc; i++) {
BUrl url(argv[i]);
BUrl url(argv[i], true);
if (url.IsValid()) {
BMessage archivedUrl;
url.Archive(&archivedUrl);
+1 -1
View File
@@ -654,7 +654,7 @@ MainWin::MessageReceived(BMessage* msg)
BString urlString;
entry_ref fileRef;
for (int32 j = 0; msg->FindString("data", j, &urlString) == B_OK; j++) {
BUrl url(urlString);
BUrl url(urlString, true);
if (url.IsValid() && url.Protocol() != "file") {
UrlPlaylistItem* item = new UrlPlaylistItem(url);
if (!fPlaylist->AddItem(item, i + j)) {
+2 -2
View File
@@ -62,7 +62,7 @@ NetworkStreamWin::MessageReceived(BMessage* message)
switch(message->what) {
case M_OPEN_URL:
{
BUrl url(fTextControl->Text());
BUrl url(fTextControl->Text(), true);
if (!url.IsValid()) {
BAlert* alert = new BAlert(B_TRANSLATE("Bad URL"),
B_TRANSLATE("Invalid URL inserted!"),
@@ -137,7 +137,7 @@ NetworkStreamWin::_LookIntoClipboardForUrl()
// Before to set the text let's see if it's really
// a valid URL.
BUrl url(text);
BUrl url(text, true);
if (url.IsValid())
fTextControl->SetText(text);
}
@@ -52,7 +52,7 @@ PlaylistFileReader::_AppendItemToPlaylist(const BString& entry, Playlist* playli
if (err == B_OK)
item = new (nothrow) FilePlaylistItem(refPath);
else {
BUrl url(entry);
BUrl url(entry, true);
if (url.IsValid())
item = new (nothrow) UrlPlaylistItem(url);
else {
@@ -30,7 +30,7 @@ UrlPlaylistItem::UrlPlaylistItem(const BMessage* archive)
{
const char* url = NULL;
if (archive->FindString("mediaplayer:url", &url) == B_OK)
fUrl = BUrl(url);
fUrl = BUrl(url, true);
}