MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / validateEditPythonPath

Method validateEditPythonPath

gui/settingsdialog.cpp:218–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218void SettingsDialog::validateEditPythonPath()
219{
220 const auto pythonPath = mUI->mEditPythonPath->text();
221 if (pythonPath.isEmpty()) {
222 mUI->mEditPythonPath->setStyleSheet("");
223 mUI->mPythonPathWarning->hide();
224 return;
225 }
226
227 QFileInfo pythonPathInfo(pythonPath);
228 if (!pythonPathInfo.exists() ||
229 !pythonPathInfo.isFile() ||
230 !pythonPathInfo.isExecutable()) {
231 mUI->mEditPythonPath->setStyleSheet("QLineEdit {border: 1px solid red}");
232 mUI->mPythonPathWarning->setText(tr("The executable file \"%1\" is not available").arg(pythonPath));
233 mUI->mPythonPathWarning->show();
234 } else {
235 mUI->mEditPythonPath->setStyleSheet("");
236 mUI->mPythonPathWarning->hide();
237 }
238}
239
240void SettingsDialog::addApplication()
241{

Callers

nothing calls this directly

Calls 4

isEmptyMethod · 0.80
existsMethod · 0.45
isFileMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected