MCPcopy Create free account
hub / github.com/IJHack/QtPass / processErrorExit

Method processErrorExit

src/qtpass.cpp:302–328  ·  view source on GitHub ↗

* @brief Handles process error exit. * @param exitCode The exit code * @param p_error The error message */

Source from the content-addressed store, hash-verified

300 * @param p_error The error message
301 */
302void QtPass::processErrorExit(int exitCode, const QString &p_error) {
303 if (nullptr != m_mainWindow->getKeygenDialog()) {
304 m_mainWindow->cleanKeygenDialog();
305 if (exitCode != 0) {
306 m_mainWindow->showStatusMessage(tr("GPG key pair generation failed"),
307 10000);
308 }
309 }
310
311 if (!p_error.isEmpty()) {
312 QString output;
313 QString error = p_error.toHtmlEscaped();
314 if (exitCode == 0) {
315 // https://github.com/IJHack/qtpass/issues/111
316 output = "<span style=\"color: darkgray;\">" + error + "</span><br />";
317 } else {
318 output = "<span style=\"color: red;\">" + error + "</span><br />";
319 }
320
321 output.replace(Util::protocolRegex(), R"(<a href="\1">\1</a>)");
322 output.replace(QStringLiteral("\n"), "<br />");
323
324 m_mainWindow->flashText(output, false, true);
325 }
326
327 m_mainWindow->setUiElementsEnabled(true);
328}
329
330/**
331 * @brief QtPass::processFinished background process has finished

Callers

nothing calls this directly

Calls 6

getKeygenDialogMethod · 0.80
cleanKeygenDialogMethod · 0.80
showStatusMessageMethod · 0.80
replaceMethod · 0.80
flashTextMethod · 0.80
setUiElementsEnabledMethod · 0.80

Tested by

no test coverage detected