* @brief Handles the OTP output by displaying it, copying it to the clipboard, * and updating the UI state. * @example * void MainWindow::passOtpHandler(const QString &p_output); * * @param const QString &p_output - The OTP code text to process; if empty, an * error message is shown instead. * @return void - This function does not return a value. */
| 498 | * @return void - This function does not return a value. |
| 499 | */ |
| 500 | void MainWindow::passOtpHandler(const QString &p_output) { |
| 501 | if (!p_output.isEmpty()) { |
| 502 | addToGridLayout(ui->gridLayout->count() + 1, tr("OTP Code"), p_output); |
| 503 | m_qtPass->copyTextToClipboard(p_output); |
| 504 | showStatusMessage(tr("OTP code copied to clipboard")); |
| 505 | } else { |
| 506 | flashText(tr("No OTP code found in this password entry"), true); |
| 507 | } |
| 508 | if (QtPassSettings::isUseAutoclearPanel()) { |
| 509 | clearPanelTimer.start(); |
| 510 | } |
| 511 | setUiElementsEnabled(true); |
| 512 | } |
| 513 | |
| 514 | /** |
| 515 | * @brief MainWindow::clearPanel hide the information from shoulder surfers |
nothing calls this directly
no test coverage detected