From 04c9332a99cfe3f02b6b08d3ec043f7a7a765507 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Mon, 13 Jan 2014 21:40:23 +0100 Subject: [PATCH] Drop superfluous PasswordGeneratorWidget::togglePassword slot. --- src/gui/PasswordComboBox.h | 4 +++- src/gui/PasswordGeneratorWidget.cpp | 7 +------ src/gui/PasswordGeneratorWidget.h | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/gui/PasswordComboBox.h b/src/gui/PasswordComboBox.h index 3784a6531..69ce1523f 100644 --- a/src/gui/PasswordComboBox.h +++ b/src/gui/PasswordComboBox.h @@ -33,11 +33,13 @@ public: explicit PasswordComboBox(QWidget* parent = Q_NULLPTR); ~PasswordComboBox(); - void setEcho(bool echo); void setGenerator(PasswordGenerator* generator); void setNumberAlternatives(int alternatives); void showPopup(); +public Q_SLOTS: + void setEcho(bool echo); + private: PasswordGenerator* m_generator; int m_alternatives; diff --git a/src/gui/PasswordGeneratorWidget.cpp b/src/gui/PasswordGeneratorWidget.cpp index 044484d25..d6fb12bea 100644 --- a/src/gui/PasswordGeneratorWidget.cpp +++ b/src/gui/PasswordGeneratorWidget.cpp @@ -35,7 +35,7 @@ PasswordGeneratorWidget::PasswordGeneratorWidget(QWidget* parent) m_ui->togglePasswordButton->setIcon(filePath()->onOffIcon("actions", "password-show")); connect(m_ui->editNewPassword->lineEdit(), SIGNAL(textChanged(QString)), SLOT(updateApplyEnabled(QString))); - connect(m_ui->togglePasswordButton, SIGNAL(toggled(bool)), SLOT(togglePassword(bool))); + connect(m_ui->togglePasswordButton, SIGNAL(toggled(bool)), m_ui->editNewPassword, SLOT(setEcho(bool))); connect(m_ui->buttonApply, SIGNAL(clicked()), SLOT(emitNewPassword())); connect(m_ui->buttonApply, SIGNAL(clicked()), SLOT(saveSettings())); @@ -93,11 +93,6 @@ void PasswordGeneratorWidget::updateApplyEnabled(const QString& password) m_ui->buttonApply->setEnabled(!password.isEmpty()); } -void PasswordGeneratorWidget::togglePassword(bool checked) -{ - m_ui->editNewPassword->setEcho(checked); -} - void PasswordGeneratorWidget::emitNewPassword() { Q_EMIT newPassword(m_ui->editNewPassword->lineEdit()->text()); diff --git a/src/gui/PasswordGeneratorWidget.h b/src/gui/PasswordGeneratorWidget.h index 465f03d78..96f3f6023 100644 --- a/src/gui/PasswordGeneratorWidget.h +++ b/src/gui/PasswordGeneratorWidget.h @@ -45,7 +45,6 @@ Q_SIGNALS: private Q_SLOTS: void updateApplyEnabled(const QString& password); - void togglePassword(bool checked); void emitNewPassword(); void saveSettings();