MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / checkLinkedInstances

Function checkLinkedInstances

launcher/InstanceDirUpdate.cpp:108–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108bool checkLinkedInstances(const QString& id, QWidget* parent, const QString& verb)
109{
110 auto linkedInstances = APPLICATION->instances()->getLinkedInstancesById(id);
111 if (!linkedInstances.empty()) {
112 auto response = CustomMessageBox::selectable(parent, QObject::tr("There are linked instances"),
113 QObject::tr("The following instance(s) might reference files in this instance:\n\n"
114 "%1\n\n"
115 "%2 it could break the other instance(s), \n\n"
116 "Do you wish to proceed?",
117 nullptr, linkedInstances.count())
118 .arg(linkedInstances.join("\n"))
119 .arg(verb),
120 QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
121 ->exec();
122 if (response != QMessageBox::Yes)
123 return false;
124 }
125 return true;
126}

Calls 6

selectableFunction · 0.85
instancesMethod · 0.80
emptyMethod · 0.45
execMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected