From kde-commits Thu Jun 30 20:54:47 2016 From: Montel Laurent Date: Thu, 30 Jun 2016 20:54:47 +0000 To: kde-commits Subject: [kdepim-addons] kmail/editorsendcheckplugins/checkbeforesend: Add new check Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=146732009709649 Git commit 25b4c921255f782141b2073ffe1cebc1d541635e by Montel Laurent. Committed on 30/06/2016 at 20:54. Pushed by mlaurent into branch 'master'. Add new check M +3 -2 kmail/editorsendcheckplugins/checkbeforesend/CMakeLists.txt M +5 -3 kmail/editorsendcheckplugins/checkbeforesend/autotests/CMake= Lists.txt A +53 -0 kmail/editorsendcheckplugins/checkbeforesend/autotests/check= attachmentdialogtest.cpp [License: GPL (v2+)] C +6 -6 kmail/editorsendcheckplugins/checkbeforesend/autotests/check= attachmentdialogtest.h [from: kmail/editorsendcheckplugins/checkbeforesend/= autotests/checkbeforesendconfigurewidgettest.h - 074% similarity] M +48 -0 kmail/editorsendcheckplugins/checkbeforesend/autotests/check= beforesendconfigurewidgettest.cpp M +1 -0 kmail/editorsendcheckplugins/checkbeforesend/autotests/check= beforesendconfigurewidgettest.h M +1 -1 kmail/editorsendcheckplugins/checkbeforesend/autotests/check= duplicateemailsdialogtest.cpp M +1 -1 kmail/editorsendcheckplugins/checkbeforesend/autotests/check= duplicateemailsjobtest.cpp M +9 -0 kmail/editorsendcheckplugins/checkbeforesend/checkbeforesend= configurewidget.cpp M +1 -0 kmail/editorsendcheckplugins/checkbeforesend/checkbeforesend= configurewidget.h M +9 -3 kmail/editorsendcheckplugins/checkbeforesend/checkbeforesend= interface.cpp M +1 -0 kmail/editorsendcheckplugins/checkbeforesend/checkbeforesend= interface.h C +0 -0 kmail/editorsendcheckplugins/checkbeforesend/duplicateemails= /checkduplicateemailsdialog.cpp [from: kmail/editorsendcheckplugins/checkbe= foresend/checkduplicateemailsdialog.cpp - 100% similarity] C +0 -0 kmail/editorsendcheckplugins/checkbeforesend/duplicateemails= /checkduplicateemailsdialog.h [from: kmail/editorsendcheckplugins/checkbefo= resend/checkduplicateemailsdialog.h - 100% similarity] R +0 -0 kmail/editorsendcheckplugins/checkbeforesend/duplicateemails= /checkduplicateemailsjob.cpp [from: kmail/editorsendcheckplugins/checkbefor= esend/checkduplicateemailsjob.cpp - 100% similarity] R +0 -0 kmail/editorsendcheckplugins/checkbeforesend/duplicateemails= /checkduplicateemailsjob.h [from: kmail/editorsendcheckplugins/checkbefores= end/checkduplicateemailsjob.h - 100% similarity] R +12 -24 kmail/editorsendcheckplugins/checkbeforesend/sendattachments= /checkattachmentdialog.cpp [from: kmail/editorsendcheckplugins/checkbefores= end/checkduplicateemailsdialog.cpp - 056% similarity] R +7 -10 kmail/editorsendcheckplugins/checkbeforesend/sendattachments= /checkattachmentdialog.h [from: kmail/editorsendcheckplugins/checkbeforesen= d/checkduplicateemailsdialog.h - 074% similarity] http://commits.kde.org/kdepim-addons/25b4c921255f782141b2073ffe1cebc1d54163= 5e diff --git a/kmail/editorsendcheckplugins/checkbeforesend/CMakeLists.txt b/= kmail/editorsendcheckplugins/checkbeforesend/CMakeLists.txt index a037bb3..2880ecf 100644 --- a/kmail/editorsendcheckplugins/checkbeforesend/CMakeLists.txt +++ b/kmail/editorsendcheckplugins/checkbeforesend/CMakeLists.txt @@ -2,8 +2,9 @@ set(kmail_checkbeforesendeditorplugin_SRCS checkbeforesendplugin.cpp checkbeforesendinterface.cpp checkbeforesendconfigurewidget.cpp - checkduplicateemailsdialog.cpp - checkduplicateemailsjob.cpp + duplicateemails/checkduplicateemailsdialog.cpp + duplicateemails/checkduplicateemailsjob.cpp + sendattachments/checkattachmentdialog.cpp ) = ecm_qt_declare_logging_category(kmail_checkbeforesendeditorplugin_SRCS HEA= DER checkbeforesendplugin_debug.h IDENTIFIER KMAIL_EDITOR_checkbeforesend_P= LUGIN_LOG CATEGORY_NAME log_kmail_checkbeforesendplugin) diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLi= sts.txt b/kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists= .txt index ceb7136..4125b3c 100644 --- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists.txt +++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists.txt @@ -12,7 +12,9 @@ macro(add_kmail_checkbeforesend_unittest _source _additio= nal) endmacro () = = -add_kmail_checkbeforesend_unittest(checkbeforesendplugintest.cpp "../check= duplicateemailsjob.cpp;../checkduplicateemailsdialog.cpp;../checkbeforesend= plugin.cpp;../checkbeforesendinterface.cpp;../checkbeforesendconfigurewidge= t.cpp") +add_kmail_checkbeforesend_unittest(checkbeforesendplugintest.cpp "../senda= ttachments/checkattachmentdialog.cpp;../duplicateemails/checkduplicateemail= sjob.cpp;../duplicateemails/checkduplicateemailsdialog.cpp;../checkbeforese= ndplugin.cpp;../checkbeforesendinterface.cpp;../checkbeforesendconfigurewid= get.cpp") add_kmail_checkbeforesend_unittest(checkbeforesendconfigurewidgettest.cpp = "../checkbeforesendconfigurewidget.cpp") -add_kmail_checkbeforesend_unittest(checkduplicateemailsdialogtest.cpp "../= checkduplicateemailsdialog.cpp") -add_kmail_checkbeforesend_unittest(checkduplicateemailsjobtest.cpp "../che= ckduplicateemailsjob.cpp") +add_kmail_checkbeforesend_unittest(checkduplicateemailsdialogtest.cpp "../= duplicateemails/checkduplicateemailsdialog.cpp") +add_kmail_checkbeforesend_unittest(checkduplicateemailsjobtest.cpp "../dup= licateemails/checkduplicateemailsjob.cpp") + +add_kmail_checkbeforesend_unittest(checkattachmentdialogtest.cpp "../senda= ttachments/checkattachmentdialog.cpp") diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkat= tachmentdialogtest.cpp b/kmail/editorsendcheckplugins/checkbeforesend/autot= ests/checkattachmentdialogtest.cpp new file mode 100644 index 0000000..23815c2 --- /dev/null +++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmen= tdialogtest.cpp @@ -0,0 +1,53 @@ +/* + Copyright (C) 2016 Montel Laurent + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "checkattachmentdialogtest.h" +#include "../sendattachments/checkattachmentdialog.h" +#include +#include +#include +#include + +CheckAttachmentDialogTest::CheckAttachmentDialogTest(QObject *parent) + : QObject(parent) +{ + +} + +CheckAttachmentDialogTest::~CheckAttachmentDialogTest() +{ + +} + +void CheckAttachmentDialogTest::shouldHaveDefaultValue() +{ + CheckAttachmentDialog w; + QDialogButtonBox *buttonBox =3D w.findChild(QStrin= gLiteral("buttonbox")); + QVERIFY(buttonBox); + + QLabel *lab =3D w.findChild(QStringLiteral("lab")); + QVERIFY(lab); + QVERIFY(!lab->text().isEmpty()); + + QListWidget *mListWidget =3D w.findChild(QStringLiteral= ("listwidget")); + QVERIFY(mListWidget); + QCOMPARE(mListWidget->count(), 0); +} + +QTEST_MAIN(CheckAttachmentDialogTest) diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbe= foresendconfigurewidgettest.h b/kmail/editorsendcheckplugins/checkbeforesen= d/autotests/checkattachmentdialogtest.h similarity index 74% copy from kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbefor= esendconfigurewidgettest.h copy to kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachm= entdialogtest.h index 91ad518..779d22f 100644 --- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesen= dconfigurewidgettest.h +++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmen= tdialogtest.h @@ -17,20 +17,20 @@ Boston, MA 02110-1301, USA. */ = -#ifndef CHECKBEFORESENDCONFIGUREWIDGETTEST_H -#define CHECKBEFORESENDCONFIGUREWIDGETTEST_H +#ifndef CHECKATTACHMENTDIALOGTEST_H +#define CHECKATTACHMENTDIALOGTEST_H = #include = -class CheckBeforeSendConfigureWidgetTest : public QObject +class CheckAttachmentDialogTest : public QObject { Q_OBJECT public: - explicit CheckBeforeSendConfigureWidgetTest(QObject *parent =3D Q_NULL= PTR); - ~CheckBeforeSendConfigureWidgetTest(); + explicit CheckAttachmentDialogTest(QObject *parent =3D Q_NULLPTR); + ~CheckAttachmentDialogTest(); = private Q_SLOTS: void shouldHaveDefaultValue(); }; = -#endif // CHECKBEFORESENDCONFIGUREWIDGETTEST_H +#endif // CHECKATTACHMENTDIALOGTEST_H diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbe= foresendconfigurewidgettest.cpp b/kmail/editorsendcheckplugins/checkbefores= end/autotests/checkbeforesendconfigurewidgettest.cpp index 9dedce3..4726d5e 100644 --- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesen= dconfigurewidgettest.cpp +++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesen= dconfigurewidgettest.cpp @@ -54,6 +54,54 @@ void CheckBeforeSendConfigureWidgetTest::shouldHaveDefau= ltValue() QVERIFY(mCheckDuplicateEmails); QVERIFY(!mCheckDuplicateEmails->text().isEmpty()); QVERIFY(!mCheckDuplicateEmails->isChecked()); + + QCheckBox *mCheckSendAttachments =3D w.findChild(QStringL= iteral("checksendattachment")); + QVERIFY(mCheckSendAttachments); + QVERIFY(!mCheckSendAttachments->text().isEmpty()); + QVERIFY(!mCheckSendAttachments->isChecked()); +} + +void CheckBeforeSendConfigureWidgetTest::shouldResetValue() +{ + CheckBeforeSendConfigureWidget w; + + QCheckBox *mCheckPlainTextMail =3D w.findChild(QStringLit= eral("checkplaintext")); + QCheckBox *mCheckMailTransport =3D w.findChild(QStringLit= eral("smtpdefinedinidentity")); + QCheckBox *mCheckDuplicateEmails =3D w.findChild(QStringL= iteral("checkduplicatedemails")); + QCheckBox *mCheckSendAttachments =3D w.findChild(QStringL= iteral("checksendattachment")); + + + mCheckMailTransport->setChecked(true); + mCheckDuplicateEmails->setChecked(true); + mCheckSendAttachments->setChecked(true); + mCheckPlainTextMail->setChecked(true); + + QVERIFY(mCheckPlainTextMail->isChecked()); + QVERIFY(mCheckMailTransport->isChecked()); + QVERIFY(mCheckDuplicateEmails->isChecked()); + QVERIFY(mCheckSendAttachments->isChecked()); + + mCheckMailTransport->setChecked(false); + mCheckDuplicateEmails->setChecked(false); + mCheckSendAttachments->setChecked(false); + mCheckPlainTextMail->setChecked(false); + + QVERIFY(!mCheckPlainTextMail->isChecked()); + QVERIFY(!mCheckMailTransport->isChecked()); + QVERIFY(!mCheckDuplicateEmails->isChecked()); + QVERIFY(!mCheckSendAttachments->isChecked()); + + + mCheckMailTransport->setChecked(true); + mCheckDuplicateEmails->setChecked(true); + mCheckSendAttachments->setChecked(true); + mCheckPlainTextMail->setChecked(true); + + w.resetSettings(); + QVERIFY(!mCheckPlainTextMail->isChecked()); + QVERIFY(!mCheckMailTransport->isChecked()); + QVERIFY(!mCheckDuplicateEmails->isChecked()); + QVERIFY(!mCheckSendAttachments->isChecked()); } = QTEST_MAIN(CheckBeforeSendConfigureWidgetTest) diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbe= foresendconfigurewidgettest.h b/kmail/editorsendcheckplugins/checkbeforesen= d/autotests/checkbeforesendconfigurewidgettest.h index 91ad518..3811b1b 100644 --- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesen= dconfigurewidgettest.h +++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesen= dconfigurewidgettest.h @@ -31,6 +31,7 @@ public: = private Q_SLOTS: void shouldHaveDefaultValue(); + void shouldResetValue(); }; = #endif // CHECKBEFORESENDCONFIGUREWIDGETTEST_H diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkdu= plicateemailsdialogtest.cpp b/kmail/editorsendcheckplugins/checkbeforesend/= autotests/checkduplicateemailsdialogtest.cpp index 8a563a3..09208ad 100644 --- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicate= emailsdialogtest.cpp +++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicate= emailsdialogtest.cpp @@ -18,7 +18,7 @@ */ = #include "checkduplicateemailsdialogtest.h" -#include "../checkduplicateemailsdialog.h" +#include "../duplicateemails/checkduplicateemailsdialog.h" #include #include #include diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkdu= plicateemailsjobtest.cpp b/kmail/editorsendcheckplugins/checkbeforesend/aut= otests/checkduplicateemailsjobtest.cpp index 2a4ee6f..a75f8b6 100644 --- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicate= emailsjobtest.cpp +++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicate= emailsjobtest.cpp @@ -18,7 +18,7 @@ */ = #include "checkduplicateemailsjobtest.h" -#include "../checkduplicateemailsjob.h" +#include "../duplicateemails/checkduplicateemailsjob.h" #include #include = diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendco= nfigurewidget.cpp b/kmail/editorsendcheckplugins/checkbeforesend/checkbefor= esendconfigurewidget.cpp index 2a7571c..760905c 100644 --- a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigure= widget.cpp +++ b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigure= widget.cpp @@ -45,6 +45,11 @@ CheckBeforeSendConfigureWidget::CheckBeforeSendConfigure= Widget(QWidget *parent) connect(mCheckDuplicateEmails, &QCheckBox::clicked, this, &CheckBefore= SendConfigureWidget::configureChanged); mainLayout->addWidget(mCheckDuplicateEmails); = + mCheckSendAttachments =3D new QCheckBox(i18n("Check send attachment"),= this); + mCheckSendAttachments->setObjectName(QStringLiteral("checksendattachme= nt")); + connect(mCheckSendAttachments, &QCheckBox::clicked, this, &CheckBefore= SendConfigureWidget::configureChanged); + mainLayout->addWidget(mCheckSendAttachments); + mainLayout->addStretch(1); } = @@ -59,6 +64,7 @@ void CheckBeforeSendConfigureWidget::loadSettings() mCheckPlainTextMail->setChecked(grp.readEntry("SendPlainText", false)); mCheckMailTransport->setChecked(grp.readEntry("SmtpDefinedInIdentity",= false)); mCheckDuplicateEmails->setChecked(grp.readEntry("CheckDuplicatedEmails= ", false)); + mCheckSendAttachments->setChecked(grp.readEntry("CheckSendAttachment",= false)); } = void CheckBeforeSendConfigureWidget::saveSettings() @@ -67,10 +73,13 @@ void CheckBeforeSendConfigureWidget::saveSettings() grp.writeEntry("SendPlainText", mCheckPlainTextMail->isChecked()); grp.writeEntry("SmtpDefinedInIdentity", mCheckMailTransport->isChecked= ()); grp.writeEntry("CheckDuplicatedEmails", mCheckDuplicateEmails->isCheck= ed()); + grp.writeEntry("CheckSendAttachment", mCheckSendAttachments->isChecked= ()); } = void CheckBeforeSendConfigureWidget::resetSettings() { mCheckPlainTextMail->setChecked(false); mCheckMailTransport->setChecked(false); + mCheckSendAttachments->setChecked(false); + mCheckDuplicateEmails->setChecked(false); } diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendco= nfigurewidget.h b/kmail/editorsendcheckplugins/checkbeforesend/checkbefores= endconfigurewidget.h index 5a50308..596162c 100644 --- a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigure= widget.h +++ b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigure= widget.h @@ -39,6 +39,7 @@ private: QCheckBox *mCheckPlainTextMail; QCheckBox *mCheckMailTransport; QCheckBox *mCheckDuplicateEmails; + QCheckBox *mCheckSendAttachments; }; = #endif // CHECKBEFORESENDCONFIGUREWIDGET_H diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendin= terface.cpp b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendi= nterface.cpp index cbb9f02..6a849e2 100644 --- a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface= .cpp +++ b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface= .cpp @@ -18,8 +18,9 @@ */ = #include "checkbeforesendinterface.h" -#include "checkduplicateemailsjob.h" -#include "checkduplicateemailsdialog.h" +#include "duplicateemails/checkduplicateemailsjob.h" +#include "duplicateemails/checkduplicateemailsdialog.h" +#include "sendattachments/checkattachmentdialog.h" = #include #include @@ -35,7 +36,8 @@ CheckBeforeSendInterface::CheckBeforeSendInterface(QObjec= t *parent) mIdentityManager(Q_NULLPTR), mSendPlainText(false), mCheckMailTransport(false), - mCheckDuplicateEmails(false) + mCheckDuplicateEmails(false), + mCheckSendAttachments(false) { reloadConfig(); } @@ -90,6 +92,9 @@ bool CheckBeforeSendInterface::exec(const MessageComposer= ::PluginEditorCheckBefo } } } + if (mCheckSendAttachments) { + //TODO + } return true; } = @@ -99,4 +104,5 @@ void CheckBeforeSendInterface::reloadConfig() mSendPlainText =3D grp.readEntry("SendPlainText", false); mCheckMailTransport =3D grp.readEntry("SmtpDefinedInIdentity", false); mCheckDuplicateEmails =3D grp.readEntry("CheckDuplicatedEmails", false= ); + mCheckSendAttachments =3D grp.readEntry("CheckSendAttachment", false); } diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendin= terface.h b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendint= erface.h index 1c0229a..73742ee 100644 --- a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface= .h +++ b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface= .h @@ -41,6 +41,7 @@ private: bool mSendPlainText; bool mCheckMailTransport; bool mCheckDuplicateEmails; + bool mCheckSendAttachments; }; = #endif // CHECKBEFORESENDINTERFACE_H diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateema= ilsdialog.cpp b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemail= s/checkduplicateemailsdialog.cpp similarity index 100% copy from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemails= dialog.cpp copy to kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkd= uplicateemailsdialog.cpp diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateema= ilsdialog.h b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/= checkduplicateemailsdialog.h similarity index 100% copy from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemails= dialog.h copy to kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkd= uplicateemailsdialog.h diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateema= ilsjob.cpp b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/c= heckduplicateemailsjob.cpp similarity index 100% rename from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemai= lsjob.cpp rename to kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/chec= kduplicateemailsjob.cpp diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateema= ilsjob.h b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/che= ckduplicateemailsjob.h similarity index 100% rename from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemai= lsjob.h rename to kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/chec= kduplicateemailsjob.h diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateema= ilsdialog.cpp b/kmail/editorsendcheckplugins/checkbeforesend/sendattachment= s/checkattachmentdialog.cpp similarity index 56% rename from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemai= lsdialog.cpp rename to kmail/editorsendcheckplugins/checkbeforesend/sendattachments/chec= kattachmentdialog.cpp index 0a8b09e..a0223f9 100644 --- a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdial= og.cpp +++ b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkatt= achmentdialog.cpp @@ -16,61 +16,49 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#include "checkduplicateemailsdialog.h" - +#include "checkattachmentdialog.h" #include #include #include -#include #include #include #include +#include = -CheckDuplicateEmailsDialog::CheckDuplicateEmailsDialog(QWidget *parent) +CheckAttachmentDialog::CheckAttachmentDialog(QWidget *parent) : QDialog(parent) { - setWindowTitle(i18n("Duplicated emails")); QVBoxLayout *mainLayout =3D new QVBoxLayout(this); - QLabel *lab =3D new QLabel(i18n("These emails are duplicated. Do you w= ant to send email?"), this); - lab->setObjectName(QStringLiteral("label")); + + QLabel *lab =3D new QLabel(i18n("Do you want to send some attachment?"= ), this); + lab->setObjectName(QStringLiteral("lab")); mainLayout->addWidget(lab); = mListWidget =3D new QListWidget(this); mListWidget->setObjectName(QStringLiteral("listwidget")); mainLayout->addWidget(mListWidget); = - QDialogButtonBox *buttonBox =3D new QDialogButtonBox(QDialogButtonBox:= :Ok | QDialogButtonBox::Cancel, this); + QDialogButtonBox * buttonBox =3D new QDialogButtonBox(QDialogButtonBox= ::Ok|QDialogButtonBox::Cancel, this); buttonBox->setObjectName(QStringLiteral("buttonbox")); - connect(buttonBox, &QDialogButtonBox::accepted, this, &CheckDuplicateE= mailsDialog::accept); - connect(buttonBox, &QDialogButtonBox::rejected, this, &CheckDuplicateE= mailsDialog::reject); mainLayout->addWidget(buttonBox); readConfig(); } = -CheckDuplicateEmailsDialog::~CheckDuplicateEmailsDialog() +CheckAttachmentDialog::~CheckAttachmentDialog() { writeConfig(); } = -void CheckDuplicateEmailsDialog::setDuplicatedEmails(const QMap &emails) -{ - QMapIterator i(emails); - while (i.hasNext()) { - i.next(); - mListWidget->addItem(i18nc("emails (number of emails)", "%1 (%2)",= i.key(), i.value())); - } -} = -void CheckDuplicateEmailsDialog::writeConfig() +void CheckAttachmentDialog::writeConfig() { - KConfigGroup group(KSharedConfig::openConfig(), "CheckDuplicateEmailsD= ialog"); + KConfigGroup group(KSharedConfig::openConfig(), "CheckAttachmentDialog= "); group.writeEntry("Size", size()); } = -void CheckDuplicateEmailsDialog::readConfig() +void CheckAttachmentDialog::readConfig() { - KConfigGroup group(KSharedConfig::openConfig(), "CheckDuplicateEmailsD= ialog"); + KConfigGroup group(KSharedConfig::openConfig(), "CheckAttachmentDialog= "); const QSize sizeDialog =3D group.readEntry("Size", QSize(500, 300)); if (sizeDialog.isValid()) { resize(sizeDialog); diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateema= ilsdialog.h b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/= checkattachmentdialog.h similarity index 74% rename from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemai= lsdialog.h rename to kmail/editorsendcheckplugins/checkbeforesend/sendattachments/chec= kattachmentdialog.h index e2f5172..9a9a42b 100644 --- a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdial= og.h +++ b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkatt= achmentdialog.h @@ -17,24 +17,21 @@ Boston, MA 02110-1301, USA. */ = -#ifndef CHECKDUPLICATEEMAILSDIALOG_H -#define CHECKDUPLICATEEMAILSDIALOG_H +#ifndef CHECKATTACHMENTDIALOG_H +#define CHECKATTACHMENTDIALOG_H = #include - class QListWidget; -class CheckDuplicateEmailsDialog : public QDialog +class CheckAttachmentDialog : public QDialog { Q_OBJECT public: - explicit CheckDuplicateEmailsDialog(QWidget *parent =3D Q_NULLPTR); - ~CheckDuplicateEmailsDialog(); - - void setDuplicatedEmails(const QMap &emails); + explicit CheckAttachmentDialog(QWidget *parent =3D Q_NULLPTR); + ~CheckAttachmentDialog(); private: - void readConfig(); void writeConfig(); + void readConfig(); QListWidget *mListWidget; }; = -#endif // CHECKDUPLICATEEMAILSDIALOG_H +#endif // CHECKATTACHMENTDIALOG_H