diff --git a/editor/kmcomposewin.cpp b/editor/kmcomposewin.cpp index 56e943734..aa24de4f4 100644 --- a/editor/kmcomposewin.cpp +++ b/editor/kmcomposewin.cpp @@ -1955,13 +1955,14 @@ void KMComposeWin::slotSendSuccessful(const QString &messageId) void KMComposeWin::addFollowupReminder(const QString &messageId) { - if (mFollowUpDate.isValid()) { + const QDate date = mComposerBase->followUpDate(); + if (date.isValid()) { FollowupReminderCreateJob *job = new FollowupReminderCreateJob; job->setSubject(subject()); job->setMessageId(messageId); job->setTo(replyTo()); - job->setFollowUpReminderDate(mFollowUpDate); - job->setCollectionToDo(mFollowUpCollection); + job->setFollowUpReminderDate(date); + job->setCollectionToDo(mComposerBase->followUpCollection()); job->start(); } } @@ -1985,25 +1986,6 @@ void KMComposeWin::addAttach(KMime::Content *msgPart) setModified(true); } -QString KMComposeWin::prettyMimeType(const QString &type) -{ - const QString t = type.toLower(); - QMimeDatabase db; - const QMimeType st = db.mimeTypeForName(t); - - if (st.isValid()) { - qCWarning(KMAIL_LOG) << "unknown mimetype" << t; - return t; - } - - const QString pretty = !st.isDefault() ? st.comment() : t; - if (pretty.isEmpty()) { - return type; - } else { - return pretty; - } -} - void KMComposeWin::setAutoCharset() { mCodecAction->setCurrentItem(0); @@ -3413,15 +3395,14 @@ void KMComposeWin::slotFollowUpMail(bool toggled) if (toggled) { QPointer dlg = new FollowUpReminderSelectDateDialog(this); if (dlg->exec()) { - mFollowUpDate = dlg->selectedDate(); - mFollowUpCollection = dlg->collection(); + mComposerBase->setFollowUpDate(dlg->selectedDate()); + mComposerBase->setFollowUpCollection(dlg->collection()); } else { mFollowUpToggleAction->setChecked(false); } delete dlg; } else { - mFollowUpDate = QDate(); - mFollowUpCollection = Akonadi::Collection(); + mComposerBase->clearFollowUp(); } } diff --git a/editor/kmcomposewin.h b/editor/kmcomposewin.h index 757595ffc..e28b7e685 100644 --- a/editor/kmcomposewin.h +++ b/editor/kmcomposewin.h @@ -277,13 +277,6 @@ private: */ bool inlineSigningEncryptionSelected(); - /** - * Tries to find the given mimetype @p type in the KDE Mimetype registry. - * If found, returns its localized description, otherwise the @p type - * in lowercase. - */ - static QString prettyMimeType(const QString &type); - public Q_SLOTS: // kmkernel, callback void slotSendNow() Q_DECL_OVERRIDE; /** @@ -680,8 +673,6 @@ private: QString mdbusObjectPath; static int s_composerNumber; - QDate mFollowUpDate; - Akonadi::Collection mFollowUpCollection; MessageComposer::ComposerViewBase *mComposerBase; diff --git a/followupreminder/followupremindercreatejob.cpp b/followupreminder/followupremindercreatejob.cpp index ef03b9749..af87baacb 100644 --- a/followupreminder/followupremindercreatejob.cpp +++ b/followupreminder/followupremindercreatejob.cpp @@ -22,6 +22,8 @@ #include #include +//KF5 move to messagecomposer + FollowupReminderCreateJob::FollowupReminderCreateJob(QObject *parent) : KJob(parent), mInfo(new FollowUpReminder::FollowUpReminderInfo)