Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 4076781e authored by Laurent Montel's avatar Laurent Montel 😁

Add messagebox when we have an error

parent a8cfc851
......@@ -24,9 +24,11 @@
#include <Akonadi/KMime/RemoveDuplicatesJob>
#include "libkdepim/progressmanager.h"
#include <KLocalizedString>
#include <KMessageBox>
RemoveDuplicateMessageInFolderAndSubFolderJob::RemoveDuplicateMessageInFolderAndSubFolderJob(QObject *parent)
RemoveDuplicateMessageInFolderAndSubFolderJob::RemoveDuplicateMessageInFolderAndSubFolderJob(QObject *parent, QWidget *parentWidget)
: QObject(parent)
, mParentWidget(parentWidget)
{
}
......@@ -95,7 +97,7 @@ void RemoveDuplicateMessageInFolderAndSubFolderJob::slotFinished(KJob *job)
}
if (job->error()) {
qCDebug(KMAIL_LOG()) << " Error during remove duplicates " << job->errorString();
//KMessageBox::error(mParent, i18n("Error occurred during removing duplicate emails: \'%1\'", job->errorText()), i18n("Error while removing duplicates"));
KMessageBox::error(mParentWidget, i18n("Error occurred during removing duplicate emails: \'%1\'", job->errorText()), i18n("Error while removing duplicates"));
}
deleteLater();
......
......@@ -32,7 +32,7 @@ class RemoveDuplicateMessageInFolderAndSubFolderJob : public QObject
{
Q_OBJECT
public:
explicit RemoveDuplicateMessageInFolderAndSubFolderJob(QObject *parent = nullptr);
explicit RemoveDuplicateMessageInFolderAndSubFolderJob(QObject *parent = nullptr, QWidget *parentWidget = nullptr);
~RemoveDuplicateMessageInFolderAndSubFolderJob();
void start();
......@@ -46,6 +46,7 @@ private:
void slotRemoveDuplicatesUpdate(KJob *job, const QString &description);
void slotRemoveDuplicatesCanceled(KPIM::ProgressItem *item);
Akonadi::Collection mTopLevelCollection;
QWidget *mParentWidget = nullptr;
};
#endif // REMOVEDUPLICATEMESSAGEINFOLDERANDSUBFOLDERJOB_H
......@@ -4638,7 +4638,7 @@ void KMMainWidget::slotMarkAllMessageAsReadInCurrentFolderAndSubfolder()
void KMMainWidget::slotRemoveDuplicateRecursive()
{
if (mCurrentCollection.isValid()) {
RemoveDuplicateMessageInFolderAndSubFolderJob *job = new RemoveDuplicateMessageInFolderAndSubFolderJob(this);
RemoveDuplicateMessageInFolderAndSubFolderJob *job = new RemoveDuplicateMessageInFolderAndSubFolderJob(this, this);
job->setTopLevelCollection(mCurrentCollection);
job->start();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment