summaryrefslogtreecommitdiffstats
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 79844bd5..1a7f91cb 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -8,8 +8,8 @@
#include "filecontent.h"
#include "keygendialog.h"
#include "passworddialog.h"
-#include "qpushbuttonwithclipboard.h"
#include "qpushbuttonasqrcode.h"
+#include "qpushbuttonwithclipboard.h"
#include "qtpass.h"
#include "qtpasssettings.h"
#include "settingsconstants.h"
@@ -836,7 +836,7 @@ void MainWindow::closeEvent(QCloseEvent *event) {
*/
bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
if (obj == ui->lineEdit && event->type() == QEvent::KeyPress) {
- QKeyEvent *key = static_cast<QKeyEvent *>(event);
+ auto *key = dynamic_cast<QKeyEvent *>(event);
if (key->key() == Qt::Key_Down) {
ui->treeView->setFocus();
}
@@ -1022,8 +1022,7 @@ void MainWindow::addToGridLayout(int position, const QString &field,
ly->setContentsMargins(5, 2, 2, 2);
frame->setLayout(ly);
if (QtPassSettings::getClipBoardType() != Enums::CLIPBOARD_NEVER) {
- QPushButtonWithClipboard *fieldLabel =
- new QPushButtonWithClipboard(trimmedValue, this);
+ auto *fieldLabel = new QPushButtonWithClipboard(trimmedValue, this);
connect(fieldLabel, &QPushButtonWithClipboard::clicked, m_qtPass,
&QtPass::copyTextToClipboard);
@@ -1033,8 +1032,7 @@ void MainWindow::addToGridLayout(int position, const QString &field,
}
if (QtPassSettings::isUseQrencode()) {
- QPushButtonAsQRCode *qrbutton =
- new QPushButtonAsQRCode(trimmedValue, this);
+ QPushButtonAsQRCode *qrbutton = new QPushButtonAsQRCode(trimmedValue, this);
connect(qrbutton, &QPushButtonAsQRCode::clicked, m_qtPass,
&QtPass::showTextAsQRCode);
qrbutton->setStyleSheet("border-style: none ; background: transparent;");
@@ -1044,7 +1042,7 @@ void MainWindow::addToGridLayout(int position, const QString &field,
// set the echo mode to password, if the field is "password"
if (QtPassSettings::isHidePassword() && trimmedField == tr("Password")) {
- QLineEdit *line = new QLineEdit();
+ auto *line = new QLineEdit();
line->setObjectName(trimmedField);
line->setText(trimmedValue);
line->setReadOnly(true);
@@ -1053,7 +1051,7 @@ void MainWindow::addToGridLayout(int position, const QString &field,
line->setEchoMode(QLineEdit::Password);
frame->layout()->addWidget(line);
} else {
- QTextBrowser *line = new QTextBrowser();
+ auto *line = new QTextBrowser();
line->setOpenExternalLinks(true);
line->setOpenLinks(true);
line->setMaximumHeight(26);
@@ -1063,7 +1061,7 @@ void MainWindow::addToGridLayout(int position, const QString &field,
line->setObjectName(trimmedField);
trimmedValue.replace(
QRegExp("((?:https?|ftp|ssh|sftp|ftps|webdav|webdavs)://\\S+)"),
- "<a href=\"\\1\">\\1</a>");
+ R"(<a href="\1">\1</a>)");
line->setText(trimmedValue);
line->setReadOnly(true);
line->setStyleSheet("border-style: none ; background: transparent;");