MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / addInstance

Method addInstance

launcher/ui/MainWindow.cpp:873–903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

871}
872
873void MainWindow::addInstance(const QString& url, const QMap<QString, QString>& extra_info)
874{
875 QString groupName;
876 do {
877 QObject* obj = sender();
878 if (!obj)
879 break;
880 QAction* action = qobject_cast<QAction*>(obj);
881 if (!action)
882 break;
883 auto map = action->data().toMap();
884 if (!map.contains("group"))
885 break;
886 groupName = map["group"].toString();
887 } while (0);
888
889 if (groupName.isEmpty()) {
890 groupName = APPLICATION->settings()->get("LastUsedGroupForNewInstance").toString();
891 }
892
893 NewInstanceDialog newInstDlg(groupName, url, extra_info, this);
894 if (!newInstDlg.exec())
895 return;
896
897 APPLICATION->settings()->set("LastUsedGroupForNewInstance", newInstDlg.instGroup());
898
899 InstanceTask* creationTask = newInstDlg.extractTask();
900 if (creationTask) {
901 instanceFromInstanceTask(creationTask);
902 }
903}
904
905void MainWindow::on_actionAddInstance_triggered()
906{

Callers

nothing calls this directly

Calls 10

extractTaskMethod · 0.80
dataMethod · 0.45
containsMethod · 0.45
toStringMethod · 0.45
isEmptyMethod · 0.45
getMethod · 0.45
settingsMethod · 0.45
execMethod · 0.45
setMethod · 0.45
instGroupMethod · 0.45

Tested by

no test coverage detected