IJHack / QtPass

Compare 0789259 ... +13 ... d483e98

Showing 25 of 55 files from the diff.

@@ -8,8 +8,8 @@
Loading
8 8
#include "filecontent.h"
9 9
#include "keygendialog.h"
10 10
#include "passworddialog.h"
11 -
#include "qpushbuttonwithclipboard.h"
12 11
#include "qpushbuttonasqrcode.h"
12 +
#include "qpushbuttonwithclipboard.h"
13 13
#include "qtpass.h"
14 14
#include "qtpasssettings.h"
15 15
#include "settingsconstants.h"
@@ -836,7 +836,7 @@
Loading
836 836
 */
837 837
bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
838 838
  if (obj == ui->lineEdit && event->type() == QEvent::KeyPress) {
839 -
    QKeyEvent *key = static_cast<QKeyEvent *>(event);
839 +
    auto *key = dynamic_cast<QKeyEvent *>(event);
840 840
    if (key->key() == Qt::Key_Down) {
841 841
      ui->treeView->setFocus();
842 842
    }
@@ -1022,8 +1022,7 @@
Loading
1022 1022
  ly->setContentsMargins(5, 2, 2, 2);
1023 1023
  frame->setLayout(ly);
1024 1024
  if (QtPassSettings::getClipBoardType() != Enums::CLIPBOARD_NEVER) {
1025 -
    QPushButtonWithClipboard *fieldLabel =
1026 -
        new QPushButtonWithClipboard(trimmedValue, this);
1025 +
    auto *fieldLabel = new QPushButtonWithClipboard(trimmedValue, this);
1027 1026
    connect(fieldLabel, &QPushButtonWithClipboard::clicked, m_qtPass,
1028 1027
            &QtPass::copyTextToClipboard);
1029 1028
@@ -1033,8 +1032,7 @@
Loading
1033 1032
  }
1034 1033
1035 1034
  if (QtPassSettings::isUseQrencode()) {
1036 -
    QPushButtonAsQRCode *qrbutton =
1037 -
        new QPushButtonAsQRCode(trimmedValue, this);
1035 +
    QPushButtonAsQRCode *qrbutton = new QPushButtonAsQRCode(trimmedValue, this);
1038 1036
    connect(qrbutton, &QPushButtonAsQRCode::clicked, m_qtPass,
1039 1037
            &QtPass::showTextAsQRCode);
1040 1038
    qrbutton->setStyleSheet("border-style: none ; background: transparent;");
@@ -1044,7 +1042,7 @@
Loading
1044 1042
1045 1043
  // set the echo mode to password, if the field is "password"
1046 1044
  if (QtPassSettings::isHidePassword() && trimmedField == tr("Password")) {
1047 -
    QLineEdit *line = new QLineEdit();
1045 +
    auto *line = new QLineEdit();
1048 1046
    line->setObjectName(trimmedField);
1049 1047
    line->setText(trimmedValue);
1050 1048
    line->setReadOnly(true);
@@ -1053,7 +1051,7 @@
Loading
1053 1051
    line->setEchoMode(QLineEdit::Password);
1054 1052
    frame->layout()->addWidget(line);
1055 1053
  } else {
1056 -
    QTextBrowser *line = new QTextBrowser();
1054 +
    auto *line = new QTextBrowser();
1057 1055
    line->setOpenExternalLinks(true);
1058 1056
    line->setOpenLinks(true);
1059 1057
    line->setMaximumHeight(26);
@@ -1063,7 +1061,7 @@
Loading
1063 1061
    line->setObjectName(trimmedField);
1064 1062
    trimmedValue.replace(
1065 1063
        QRegExp("((?:https?|ftp|ssh|sftp|ftps|webdav|webdavs)://\\S+)"),
1066 -
        "<a href=\"\\1\">\\1</a>");
1064 +
        R"(<a href="\1">\1</a>)");
1067 1065
    line->setText(trimmedValue);
1068 1066
    line->setReadOnly(true);
1069 1067
    line->setStyleSheet("border-style: none ; background: transparent;");

@@ -187,7 +187,7 @@
Loading
187 187
 */
188 188
void Pass::finished(int id, int exitCode, const QString &out,
189 189
                    const QString &err) {
190 -
  PROCESS pid = static_cast<PROCESS>(id);
190 +
  auto pid = static_cast<PROCESS>(id);
191 191
  if (exitCode != 0) {
192 192
    emit processErrorExit(exitCode, err);
193 193
    return;

@@ -7,7 +7,7 @@
Loading
7 7
  QString password = lines.takeFirst();
8 8
  QStringList remainingData;
9 9
  NamedValues namedValues;
10 -
  for (QString line : lines) {
10 +
  for (const QString &line : lines) {
11 11
    if (line.contains(":")) {
12 12
      int colon = line.indexOf(':');
13 13
      QString name = line.left(colon);

@@ -1,6 +1,6 @@
Loading
1 1
#include "singleapplication.h"
2 2
#include <QLocalSocket>
3 -
3 +
#include <utility>
4 4
#ifdef QT_DEBUG
5 5
#include "debughelper.h"
6 6
#endif
@@ -12,9 +12,8 @@
Loading
12 12
 * @param argv
13 13
 * @param uniqueKey
14 14
 */
15 -
SingleApplication::SingleApplication(int &argc, char *argv[],
16 -
                                     const QString uniqueKey)
17 -
    : QApplication(argc, argv), _uniqueKey(uniqueKey) {
15 +
SingleApplication::SingleApplication(int &argc, char *argv[], QString uniqueKey)
16 +
    : QApplication(argc, argv), _uniqueKey(std::move(uniqueKey)) {
18 17
  sharedMemory.setKey(_uniqueKey);
19 18
  if (sharedMemory.attach()) {
20 19
    _isRunning = true;

@@ -39,7 +39,7 @@
Loading
39 39
  ui->checkBoxHideContent->setChecked(QtPassSettings::isHideContent());
40 40
  ui->checkBoxAddGPGId->setChecked(QtPassSettings::isAddGPGId(true));
41 41
42 -
  if (QSystemTrayIcon::isSystemTrayAvailable() == true) {
42 +
  if (QSystemTrayIcon::isSystemTrayAvailable()) {
43 43
    ui->checkBoxHideOnClose->setChecked(QtPassSettings::isHideOnClose());
44 44
    ui->checkBoxStartMinimized->setChecked(QtPassSettings::isStartMinimized());
45 45
  } else {
@@ -74,8 +74,7 @@
Loading
74 74
75 75
  if (!isQrencodeAvailable()) {
76 76
    ui->checkBoxUseQrencode->setEnabled(false);
77 -
    ui->checkBoxUseQrencode->setToolTip(
78 -
        tr("qrencode needs to be installed"));
77 +
    ui->checkBoxUseQrencode->setToolTip(tr("qrencode needs to be installed"));
79 78
  }
80 79
81 80
  setProfiles(QtPassSettings::getProfiles(), QtPassSettings::getProfile());
@@ -271,7 +270,7 @@
Loading
271 270
  QList<UserInfo> keys = QtPassSettings::getPass()->listKeys("", true);
272 271
  QStringList names;
273 272
274 -
  if (keys.size() == 0)
273 +
  if (keys.empty())
275 274
    return names;
276 275
277 276
  foreach (const UserInfo &sec, keys)
@@ -299,8 +298,8 @@
Loading
299 298
  dialog.setOption(QFileDialog::ReadOnly);
300 299
  if (dialog.exec())
301 300
    return dialog.selectedFiles().first();
302 -
  else
303 -
    return QString();
301 +
302 +
  return QString();
304 303
}
305 304
306 305
/**
@@ -314,8 +313,8 @@
Loading
314 313
  dialog.setOption(QFileDialog::ShowDirsOnly);
315 314
  if (dialog.exec())
316 315
    return dialog.selectedFiles().first();
317 -
  else
318 -
    return QString();
316 +
317 +
  return QString();
319 318
}
320 319
321 320
/**
@@ -606,7 +605,7 @@
Loading
606 605
           "href=\"https://www.gnupg.org/download/#sec-1-2\">download</a> it "
607 606
           "from GnuPG.org")
608 607
#endif
609 -
	);
608 +
    );
610 609
    clean = true;
611 610
  }
612 611
@@ -676,7 +675,7 @@
Loading
676 675
 * @param useSystray
677 676
 */
678 677
void ConfigDialog::useTrayIcon(bool useSystray) {
679 -
  if (QSystemTrayIcon::isSystemTrayAvailable() == true) {
678 +
  if (QSystemTrayIcon::isSystemTrayAvailable()) {
680 679
    ui->checkBoxUseTrayIcon->setChecked(useSystray);
681 680
    ui->checkBoxHideOnClose->setEnabled(useSystray);
682 681
    ui->checkBoxStartMinimized->setEnabled(useSystray);

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Learn more Showing 3 files with coverage changes found.

Changes in src/realpass.h
+1
Loading file...
New file src/settingsconstants.h
New
Loading file...
Changes in src/imitatepass.h
+1
Loading file...
Files Coverage
src -<.01% 7.21%
main/main.cpp 0.00%
Project Totals (44 files) 7.13%
Loading