MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / loadConfigs

Method loadConfigs

MiniZincIDE/configwindow.cpp:84–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void ConfigWindow::loadConfigs(void)
85{
86 try {
87 QStringList files;
88 QStringList warnings;
89 for (auto config : configs) {
90 if (!config->paramFile.isEmpty()) {
91 files.append(config->paramFile);
92 }
93 delete config;
94 }
95 configs.clear();
96 for (auto* solver : MznDriver::get().solvers()) {
97 if (solver->hasAllRequiredFlags()) {
98 configs.append(new SolverConfiguration(*solver, true));
99 }
100 }
101 if (!files.empty()) {
102 for (auto fileName : files) {
103 configs.append(new (SolverConfiguration) (SolverConfiguration::loadJSON(fileName, warnings)));
104 }
105 }
106 populateComboBox();
107 updateGUI(true);
108 if (!warnings.empty()) {
109 QMessageBox::warning(this, "MiniZinc IDE", warnings.join("\n"), QMessageBox::Ok);
110 }
111 } catch (Exception& e) {
112 QMessageBox::warning(this, "Parameter configuration error", e.message(), QMessageBox::Ok);
113 }
114}
115
116bool ConfigWindow::addConfig(const QString &fileName)
117{

Callers 1

Calls 2

hasAllRequiredFlagsMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected