Skip to content
/ Pe Public
forked from HaikuArchives/Pe

Commit

Permalink
Fix showing Help doc
Browse files Browse the repository at this point in the history
The existing code fails to show the docs, if the browser is already
running for some reason. It's also unnecessarily complicated. Just
having be_roster launch the preferred app for text/html with the
URL in the message is simpler.
If the browser is already running, it pops to the front when loading
the doc anyway.
  • Loading branch information
Humdinger committed May 13, 2023
1 parent 2f4db2f commit 5169b05
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions Sources/PApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1034,19 +1034,7 @@ void PApp::DisplayInBrowser(const entry_ref& doc)
url += path.Path();

msg.AddString("url", url.c_str());

char sig[B_MIME_TYPE_LENGTH];
BMimeType("text/html").GetPreferredApp(sig);
team_id team = be_roster->TeamFor(sig);

if (team > 0)
{
BMessenger msr(sig, team);
msg.AddSpecifier("Window", (int32)0);
msr.SendMessage(&msg, (BHandler*)NULL, 1000);
be_roster->ActivateApp(team);
}
else if (be_roster->Launch(sig, &msg))
if (be_roster->Launch("text/html", &msg) == B_LAUNCH_FAILED)
THROW(("Could not launch browser"));
}
catch (HErr& e)
Expand Down

0 comments on commit 5169b05

Please sign in to comment.