MCPcopy Create free account
hub / github.com/VCVRack/Rack / openBrowser

Function openBrowser

src/system.cpp:868–889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

866
867
868void openBrowser(const std::string& url) {
869 if (url.empty())
870 return;
871
872 INFO("Opening browser URL %s", url.c_str());
873
874 std::string urlL = url;
875 std::thread t([=] {
876#if defined ARCH_LIN
877 std::string command = "xdg-open \"" + urlL + "\"";
878 (void) std::system(command.c_str());
879#endif
880#if defined ARCH_MAC
881 std::string command = "open \"" + urlL + "\"";
882 std::system(command.c_str());
883#endif
884#if defined ARCH_WIN
885 ShellExecuteW(NULL, L"open", string::UTF8toUTF16(urlL).c_str(), NULL, NULL, SW_SHOWDEFAULT);
886#endif
887 });
888 t.detach();
889}
890
891
892void openDirectory(const std::string& path) {

Callers 10

appendContextMenuMethod · 0.85
onHoverKeyMethod · 0.85
onActionMethod · 0.85
onHoverKeyMethod · 0.85
onActionMethod · 0.85
onHoverKeyMethod · 0.85
createChildMenuMethod · 0.85
refreshMethod · 0.85
onActionMethod · 0.85

Calls 3

systemFunction · 0.85
UTF8toUTF16Function · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected