MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / openLink

Method openLink

source/frontend/StarModsMenu.cpp:100–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100void ModsMenu::openLink() {
101 size_t selectedItem = m_modList->selectedItem();
102 if (selectedItem == NPos)
103 return;
104
105 String assetsSource = m_assetsSources.at(selectedItem);
106 JsonObject assetsSourceMetadata = Root::singleton().assets()->assetSourceMetadata(assetsSource);
107 String link = assetsSourceMetadata.value("link", "").toString();
108
109 if (link.empty())
110 return;
111
112 auto& guiContext = GuiContext::singleton();
113 if (auto desktopService = guiContext.applicationController()->desktopService())
114 desktopService->openUrl(link);
115 else
116 guiContext.setClipboard(link);
117}
118
119void ModsMenu::openWorkshop() {
120 auto assets = Root::singleton().assets();

Callers

nothing calls this directly

Calls 11

singletonClass · 0.85
assetSourceMetadataMethod · 0.80
assetsMethod · 0.80
openUrlMethod · 0.80
selectedItemMethod · 0.45
atMethod · 0.45
toStringMethod · 0.45
valueMethod · 0.45
emptyMethod · 0.45
desktopServiceMethod · 0.45
setClipboardMethod · 0.45

Tested by

no test coverage detected