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

Method passOtpHandler

src/mainwindow.cpp:500–512  ·  view source on GitHub ↗

* @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. */

Source from the content-addressed store, hash-verified

498 * @return void - This function does not return a value.
499 */
500void 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

Callers

nothing calls this directly

Calls 1

copyTextToClipboardMethod · 0.80

Tested by

no test coverage detected