summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-07-07 07:01:53 +0200
committerMontel Laurent <[email protected]>2017-07-07 07:01:53 +0200
commit5cafbed10f7c0a159e0a853824c3c9badbde45e5 (patch)
tree33b8abef6a9c1bc79f4b2638487b71a678b3bda6
parent76c96e7d5a6f0da30b7a1e6cc2931646c7908c84 (diff)
not necessary to create private class here as it's on plugin
-rw-r--r--src/kmailtransport/plugins/smtp/smtpconfigdialog.cpp57
-rw-r--r--src/kmailtransport/plugins/smtp/smtpconfigdialog.h11
2 files changed, 24 insertions, 44 deletions
diff --git a/src/kmailtransport/plugins/smtp/smtpconfigdialog.cpp b/src/kmailtransport/plugins/smtp/smtpconfigdialog.cpp
index 8005398..6ce5bf4 100644
--- a/src/kmailtransport/plugins/smtp/smtpconfigdialog.cpp
+++ b/src/kmailtransport/plugins/smtp/smtpconfigdialog.cpp
@@ -31,61 +31,40 @@
using namespace MailTransport;
-class MailTransport::SmtpConfigDialog::Private
-{
-public:
- Private(SmtpConfigDialog *qq)
- : transport(nullptr)
- , configWidget(nullptr)
- , q(qq)
- , okButton(nullptr)
- {
- }
-
- Transport *transport;
- SMTPConfigWidget *configWidget;
- SmtpConfigDialog *q;
- QPushButton *okButton;
-
- void okClicked();
- void slotTextChanged(const QString &text);
-};
-
-void SmtpConfigDialog::Private::okClicked()
-{
- configWidget->apply();
- transport->save();
-}
-
-void SmtpConfigDialog::Private::slotTextChanged(const QString &text)
-{
- okButton->setEnabled(!text.isEmpty());
-}
SmtpConfigDialog::SmtpConfigDialog(Transport *transport, QWidget *parent)
: QDialog(parent)
- , d(new Private(this))
{
Q_ASSERT(transport);
- d->transport = transport;
+ mTransport = transport;
QVBoxLayout *mainLayout = new QVBoxLayout(this);
- d->configWidget = new SMTPConfigWidget(transport, this);
- d->configWidget->setObjectName(QStringLiteral("smtpconfigwidget"));
- mainLayout->addWidget(d->configWidget);
+ mConfigWidget = new SMTPConfigWidget(transport, this);
+ mConfigWidget->setObjectName(QStringLiteral("smtpconfigwidget"));
+ mainLayout->addWidget(mConfigWidget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttons"));
- d->okButton = buttonBox->button(QDialogButtonBox::Ok);
- d->okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ mOkButton = buttonBox->button(QDialogButtonBox::Ok);
+ mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
mainLayout->addWidget(buttonBox);
- connect(d->okButton, SIGNAL(clicked()), this, SLOT(okClicked()));
+ connect(mOkButton, &QAbstractButton::clicked, this, &SmtpConfigDialog::okClicked);
connect(buttonBox, &QDialogButtonBox::accepted, this, &SmtpConfigDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &SmtpConfigDialog::reject);
}
SmtpConfigDialog::~SmtpConfigDialog()
{
- delete d;
+}
+
+void SmtpConfigDialog::okClicked()
+{
+ mConfigWidget->apply();
+ mTransport->save();
+}
+
+void SmtpConfigDialog::slotTextChanged(const QString &text)
+{
+ mOkButton->setEnabled(!text.isEmpty());
}
#include "moc_smtpconfigdialog.cpp"
diff --git a/src/kmailtransport/plugins/smtp/smtpconfigdialog.h b/src/kmailtransport/plugins/smtp/smtpconfigdialog.h
index b63def8..d6e0b17 100644
--- a/src/kmailtransport/plugins/smtp/smtpconfigdialog.h
+++ b/src/kmailtransport/plugins/smtp/smtpconfigdialog.h
@@ -24,7 +24,7 @@
namespace MailTransport {
class Transport;
-
+class SMTPConfigWidget;
class SmtpConfigDialog : public QDialog
{
Q_OBJECT
@@ -33,11 +33,12 @@ public:
virtual ~SmtpConfigDialog();
private:
- class Private;
- Private *const d;
+ void okClicked();
+ void slotTextChanged(const QString &text);
- Q_PRIVATE_SLOT(d, void okClicked())
- Q_PRIVATE_SLOT(d, void slotTextChanged(const QString &))
+ Transport *mTransport;
+ SMTPConfigWidget *mConfigWidget;
+ QPushButton *mOkButton;
};
} // namespace MailTransport