[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdepim-addons] kmail/editorsendcheckplugins/checkbeforesend: Add new check
From: Montel Laurent <montel () kde ! org>
Date: 2016-06-30 20:54:47
Message-ID: E1bIiz1-0000XY-3O () code ! kde ! org
[Download RAW message or body]
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/CMakeLists.txt
A +53 -0 kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.cpp \
[License: GPL (v2+)] C +6 -6 \
kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.h \
[from: kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.h \
- 074% similarity] M +48 -0 \
kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.cpp
M +1 -0 kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.h
M +1 -1 kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsdialogtest.cpp
M +1 -1 kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsjobtest.cpp
M +9 -0 kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.cpp
M +1 -0 kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.h
M +9 -3 kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.cpp
M +1 -0 kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.h
C +0 -0 kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsdialog.cpp \
[from: kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.cpp - \
100% similarity] C +0 -0 \
kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsdialog.h \
[from: kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.h - \
100% similarity] R +0 -0 \
kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsjob.cpp \
[from: kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsjob.cpp - \
100% similarity] R +0 -0 \
kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsjob.h \
[from: kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsjob.h - 100% \
similarity] R +12 -24 \
kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.cpp \
[from: kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.cpp - \
056% similarity] R +7 -10 \
kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.h \
[from: kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.h - \
074% similarity]
http://commits.kde.org/kdepim-addons/25b4c921255f782141b2073ffe1cebc1d541635e
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 HEADER \
checkbeforesendplugin_debug.h IDENTIFIER KMAIL_EDITOR_checkbeforesend_PLUGIN_LOG \
CATEGORY_NAME log_kmail_checkbeforesendplugin)
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/CMakeLists.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 _additional)
endmacro ()
-add_kmail_checkbeforesend_unittest(checkbeforesendplugintest.cpp \
"../checkduplicateemailsjob.cpp;../checkduplicateemailsdialog.cpp;../checkbeforesendplugin.cpp;../checkbeforesendinterface.cpp;../checkbeforesendconfigurewidget.cpp")
+add_kmail_checkbeforesend_unittest(checkbeforesendplugintest.cpp \
"../sendattachments/checkattachmentdialog.cpp;../duplicateemails/checkduplicateemailsj \
ob.cpp;../duplicateemails/checkduplicateemailsdialog.cpp;../checkbeforesendplugin.cpp;../checkbeforesendinterface.cpp;../checkbeforesendconfigurewidget.cpp")
add_kmail_checkbeforesend_unittest(checkbeforesendconfigurewidgettest.cpp \
"../checkbeforesendconfigurewidget.cpp")
-add_kmail_checkbeforesend_unittest(checkduplicateemailsdialogtest.cpp \
"../checkduplicateemailsdialog.cpp")
-add_kmail_checkbeforesend_unittest(checkduplicateemailsjobtest.cpp \
"../checkduplicateemailsjob.cpp") \
+add_kmail_checkbeforesend_unittest(checkduplicateemailsdialogtest.cpp \
"../duplicateemails/checkduplicateemailsdialog.cpp") \
+add_kmail_checkbeforesend_unittest(checkduplicateemailsjobtest.cpp \
"../duplicateemails/checkduplicateemailsjob.cpp") +
+add_kmail_checkbeforesend_unittest(checkattachmentdialogtest.cpp \
"../sendattachments/checkattachmentdialog.cpp")
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.cpp \
b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.cpp
new file mode 100644
index 0000000..23815c2
--- /dev/null
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.cpp
@@ -0,0 +1,53 @@
+/*
+ Copyright (C) 2016 Montel Laurent <montel@kde.org>
+
+ 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 <QDialogButtonBox>
+#include <QLabel>
+#include <QListWidget>
+#include <QTest>
+
+CheckAttachmentDialogTest::CheckAttachmentDialogTest(QObject *parent)
+ : QObject(parent)
+{
+
+}
+
+CheckAttachmentDialogTest::~CheckAttachmentDialogTest()
+{
+
+}
+
+void CheckAttachmentDialogTest::shouldHaveDefaultValue()
+{
+ CheckAttachmentDialog w;
+ QDialogButtonBox *buttonBox = w.findChild<QDialogButtonBox \
*>(QStringLiteral("buttonbox")); + QVERIFY(buttonBox);
+
+ QLabel *lab = w.findChild<QLabel *>(QStringLiteral("lab"));
+ QVERIFY(lab);
+ QVERIFY(!lab->text().isEmpty());
+
+ QListWidget *mListWidget = w.findChild<QListWidget \
*>(QStringLiteral("listwidget")); + QVERIFY(mListWidget);
+ QCOMPARE(mListWidget->count(), 0);
+}
+
+QTEST_MAIN(CheckAttachmentDialogTest)
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.h \
b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.h \
similarity index 74% copy from \
kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.h
copy to kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.h
index 91ad518..779d22f 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.h
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentdialogtest.h
@@ -17,20 +17,20 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef CHECKBEFORESENDCONFIGUREWIDGETTEST_H
-#define CHECKBEFORESENDCONFIGUREWIDGETTEST_H
+#ifndef CHECKATTACHMENTDIALOGTEST_H
+#define CHECKATTACHMENTDIALOGTEST_H
#include <QObject>
-class CheckBeforeSendConfigureWidgetTest : public QObject
+class CheckAttachmentDialogTest : public QObject
{
Q_OBJECT
public:
- explicit CheckBeforeSendConfigureWidgetTest(QObject *parent = Q_NULLPTR);
- ~CheckBeforeSendConfigureWidgetTest();
+ explicit CheckAttachmentDialogTest(QObject *parent = Q_NULLPTR);
+ ~CheckAttachmentDialogTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
-#endif // CHECKBEFORESENDCONFIGUREWIDGETTEST_H
+#endif // CHECKATTACHMENTDIALOGTEST_H
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.cpp \
b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.cpp
index 9dedce3..4726d5e 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.cpp
@@ -54,6 +54,54 @@ void CheckBeforeSendConfigureWidgetTest::shouldHaveDefaultValue()
QVERIFY(mCheckDuplicateEmails);
QVERIFY(!mCheckDuplicateEmails->text().isEmpty());
QVERIFY(!mCheckDuplicateEmails->isChecked());
+
+ QCheckBox *mCheckSendAttachments = w.findChild<QCheckBox \
*>(QStringLiteral("checksendattachment")); + QVERIFY(mCheckSendAttachments);
+ QVERIFY(!mCheckSendAttachments->text().isEmpty());
+ QVERIFY(!mCheckSendAttachments->isChecked());
+}
+
+void CheckBeforeSendConfigureWidgetTest::shouldResetValue()
+{
+ CheckBeforeSendConfigureWidget w;
+
+ QCheckBox *mCheckPlainTextMail = w.findChild<QCheckBox \
*>(QStringLiteral("checkplaintext")); + QCheckBox *mCheckMailTransport = \
w.findChild<QCheckBox *>(QStringLiteral("smtpdefinedinidentity")); + QCheckBox \
*mCheckDuplicateEmails = w.findChild<QCheckBox \
*>(QStringLiteral("checkduplicatedemails")); + QCheckBox *mCheckSendAttachments = \
w.findChild<QCheckBox *>(QStringLiteral("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/checkbeforesendconfigurewidgettest.h \
b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.h
index 91ad518..3811b1b 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.h
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendconfigurewidgettest.h
@@ -31,6 +31,7 @@ public:
private Q_SLOTS:
void shouldHaveDefaultValue();
+ void shouldResetValue();
};
#endif // CHECKBEFORESENDCONFIGUREWIDGETTEST_H
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsdialogtest.cpp \
b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsdialogtest.cpp
index 8a563a3..09208ad 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsdialogtest.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsdialogtest.cpp
@@ -18,7 +18,7 @@
*/
#include "checkduplicateemailsdialogtest.h"
-#include "../checkduplicateemailsdialog.h"
+#include "../duplicateemails/checkduplicateemailsdialog.h"
#include <QDialogButtonBox>
#include <QLabel>
#include <QListWidget>
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsjobtest.cpp \
b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsjobtest.cpp
index 2a4ee6f..a75f8b6 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsjobtest.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkduplicateemailsjobtest.cpp
@@ -18,7 +18,7 @@
*/
#include "checkduplicateemailsjobtest.h"
-#include "../checkduplicateemailsjob.h"
+#include "../duplicateemails/checkduplicateemailsjob.h"
#include <QTest>
#include <QStringList>
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.cpp \
b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.cpp \
index 2a7571c..760905c 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.cpp
@@ -45,6 +45,11 @@ CheckBeforeSendConfigureWidget::CheckBeforeSendConfigureWidget(QWidget \
*parent)
connect(mCheckDuplicateEmails, &QCheckBox::clicked, this, \
&CheckBeforeSendConfigureWidget::configureChanged); \
mainLayout->addWidget(mCheckDuplicateEmails);
+ mCheckSendAttachments = new QCheckBox(i18n("Check send attachment"), this);
+ mCheckSendAttachments->setObjectName(QStringLiteral("checksendattachment"));
+ connect(mCheckSendAttachments, &QCheckBox::clicked, this, \
&CheckBeforeSendConfigureWidget::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->isChecked());
+ 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/checkbeforesendconfigurewidget.h \
b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.h index \
5a50308..596162c 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.h
+++ b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendconfigurewidget.h
@@ -39,6 +39,7 @@ private:
QCheckBox *mCheckPlainTextMail;
QCheckBox *mCheckMailTransport;
QCheckBox *mCheckDuplicateEmails;
+ QCheckBox *mCheckSendAttachments;
};
#endif // CHECKBEFORESENDCONFIGUREWIDGET_H
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.cpp \
b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.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 <KMessageBox>
#include <KConfigGroup>
@@ -35,7 +36,8 @@ CheckBeforeSendInterface::CheckBeforeSendInterface(QObject *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 = grp.readEntry("SendPlainText", false);
mCheckMailTransport = grp.readEntry("SmtpDefinedInIdentity", false);
mCheckDuplicateEmails = grp.readEntry("CheckDuplicatedEmails", false);
+ mCheckSendAttachments = grp.readEntry("CheckSendAttachment", false);
}
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.h \
b/kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendinterface.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/checkduplicateemailsdialog.cpp \
b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsdialog.cpp
similarity index 100%
copy from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.cpp
copy to kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsdialog.cpp
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.h \
b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsdialog.h
similarity index 100%
copy from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.h
copy to kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsdialog.h
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsjob.cpp \
b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsjob.cpp
similarity index 100%
rename from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsjob.cpp
rename to kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsjob.cpp
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsjob.h \
b/kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsjob.h
similarity index 100%
rename from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsjob.h
rename to kmail/editorsendcheckplugins/checkbeforesend/duplicateemails/checkduplicateemailsjob.h
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.cpp \
b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.cpp
similarity index 56%
rename from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.cpp
rename to kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.cpp
index 0a8b09e..a0223f9 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.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 <KLocalizedString>
#include <QVBoxLayout>
#include <QDialogButtonBox>
-#include <QListWidget>
#include <QLabel>
#include <KConfigGroup>
#include <KSharedConfig>
+#include <QListWidget>
-CheckDuplicateEmailsDialog::CheckDuplicateEmailsDialog(QWidget *parent)
+CheckAttachmentDialog::CheckAttachmentDialog(QWidget *parent)
: QDialog(parent)
{
- setWindowTitle(i18n("Duplicated emails"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
- QLabel *lab = new QLabel(i18n("These emails are duplicated. Do you want to send \
email?"), this);
- lab->setObjectName(QStringLiteral("label"));
+
+ QLabel *lab = new QLabel(i18n("Do you want to send some attachment?"), this);
+ lab->setObjectName(QStringLiteral("lab"));
mainLayout->addWidget(lab);
mListWidget = new QListWidget(this);
mListWidget->setObjectName(QStringLiteral("listwidget"));
mainLayout->addWidget(mListWidget);
- QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | \
QDialogButtonBox::Cancel, this); + QDialogButtonBox * buttonBox = new \
QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this); \
buttonBox->setObjectName(QStringLiteral("buttonbox"));
- connect(buttonBox, &QDialogButtonBox::accepted, this, \
&CheckDuplicateEmailsDialog::accept);
- connect(buttonBox, &QDialogButtonBox::rejected, this, \
&CheckDuplicateEmailsDialog::reject); mainLayout->addWidget(buttonBox);
readConfig();
}
-CheckDuplicateEmailsDialog::~CheckDuplicateEmailsDialog()
+CheckAttachmentDialog::~CheckAttachmentDialog()
{
writeConfig();
}
-void CheckDuplicateEmailsDialog::setDuplicatedEmails(const QMap<QString, int> \
&emails)
-{
- QMapIterator<QString, int> 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(), "CheckDuplicateEmailsDialog");
+ KConfigGroup group(KSharedConfig::openConfig(), "CheckAttachmentDialog");
group.writeEntry("Size", size());
}
-void CheckDuplicateEmailsDialog::readConfig()
+void CheckAttachmentDialog::readConfig()
{
- KConfigGroup group(KSharedConfig::openConfig(), "CheckDuplicateEmailsDialog");
+ KConfigGroup group(KSharedConfig::openConfig(), "CheckAttachmentDialog");
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.h \
b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.h
similarity index 74%
rename from kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.h
rename to kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.h
index e2f5172..9a9a42b 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/checkduplicateemailsdialog.h
+++ b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentdialog.h
@@ -17,24 +17,21 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef CHECKDUPLICATEEMAILSDIALOG_H
-#define CHECKDUPLICATEEMAILSDIALOG_H
+#ifndef CHECKATTACHMENTDIALOG_H
+#define CHECKATTACHMENTDIALOG_H
#include <QDialog>
-
class QListWidget;
-class CheckDuplicateEmailsDialog : public QDialog
+class CheckAttachmentDialog : public QDialog
{
Q_OBJECT
public:
- explicit CheckDuplicateEmailsDialog(QWidget *parent = Q_NULLPTR);
- ~CheckDuplicateEmailsDialog();
-
- void setDuplicatedEmails(const QMap<QString, int> &emails);
+ explicit CheckAttachmentDialog(QWidget *parent = Q_NULLPTR);
+ ~CheckAttachmentDialog();
private:
- void readConfig();
void writeConfig();
+ void readConfig();
QListWidget *mListWidget;
};
-#endif // CHECKDUPLICATEEMAILSDIALOG_H
+#endif // CHECKATTACHMENTDIALOG_H
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic