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 04e1ada8 authored by Laurent Montel's avatar Laurent Montel 😁

Clean up code

parent ce966f4f
......@@ -73,7 +73,7 @@ find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widget
set(LIBGRAVATAR_VERSION_LIB "5.6.40")
set(MAILCOMMON_LIB_VERSION_LIB "5.6.45")
set(KDEPIM_APPS_LIB_VERSION_LIB "5.6.40")
set(MESSAGELIB_LIB_VERSION_LIB "5.6.45")
set(MESSAGELIB_LIB_VERSION_LIB "5.6.46")
set(LIBKLEO_LIB_VERSION_LIB "5.6.40")
set(PIMCOMMON_LIB_VERSION_LIB "5.6.40")
set(LIBKDEPIM_LIB_VERSION_LIB "5.6.40")
......
......@@ -1045,9 +1045,6 @@ void KMMainWidget::createWidgets()
if (mMsgActions) {
mMsgActions->setMessageView(mMsgView);
}
connect(mMsgView->viewer(), &MessageViewer::Viewer::replaceMsgByUnencryptedVersion,
this, &KMMainWidget::slotReplaceMsgByUnencryptedVersion);
connect(mMsgView->viewer(), &MessageViewer::Viewer::displayPopupMenu, this, &KMMainWidget::slotMessagePopup);
connect(mMsgView->viewer(), &MessageViewer::Viewer::moveMessageToTrash,
this, &KMMainWidget::slotMoveMessageToTrash);
......@@ -2334,7 +2331,7 @@ void KMMainWidget::slotSaveAttachments()
void KMMainWidget::slotOnlineStatus()
{
// KMKernel will Q_EMIT a signal when we toggle the network state that is caught by
// KMKernel will emit a signal when we toggle the network state that is caught by
// KMMainWidget::slotUpdateOnlineStatus to update our GUI
if (KMailSettings::self()->networkState() == KMailSettings::EnumNetworkState::Online) {
// if online; then toggle and set it offline.
......@@ -2404,75 +2401,6 @@ void KMMainWidget::showResourceOfflinePage()
mMsgView->displayResourceOfflinePage();
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotReplaceMsgByUnencryptedVersion()
{
Akonadi::Item oldMsg = mMessagePane->currentItem();
if (oldMsg.isValid()) {
#if 0
qCDebug(KMAIL_LOG) << "Old message found";
if (oldMsg->hasUnencryptedMsg()) {
qCDebug(KMAIL_LOG) << "Extra unencrypted message found";
KMime::Message *newMsg = oldMsg->unencryptedMsg();
// adjust the message id
{
QString msgId(oldMsg->msgId());
QString prefix("DecryptedMsg.");
int oldIdx = msgId.indexOf(prefix, 0, Qt::CaseInsensitive);
if (-1 == oldIdx) {
int leftAngle = msgId.lastIndexOf('<');
msgId = msgId.insert((-1 == leftAngle) ? 0 : ++leftAngle, prefix);
} else {
// toggle between "DecryptedMsg." and "DeCryptedMsg."
// to avoid same message id
QCharRef c = msgId[ oldIdx + 2 ];
if ('C' == c) {
c = 'c';
} else {
c = 'C';
}
}
newMsg->setMsgId(msgId);
mMsgView->setIdOfLastViewedMessage(msgId);
}
// insert the unencrypted message
qCDebug(KMAIL_LOG) << "Adding unencrypted message to folder";
mFolder->addMsg(newMsg);
/* Figure out its index in the folder for selecting. This must be count()-1,
* since we append. Be safe and do find, though, just in case. */
int newMsgIdx = mFolder->find(newMsg);
Q_ASSERT(newMsgIdx != -1);
/* we need this unget, to have the message displayed correctly initially */
mFolder->unGetMsg(newMsgIdx);
int idx = mFolder->find(oldMsg);
Q_ASSERT(idx != -1);
/* only select here, so the old one is not un-Gotten before, which would
* render the pointer we hold invalid so that find would fail */
#if 0
// FIXME (Pragma)
mHeaders->setCurrentItemByIndex(newMsgIdx);
#endif
// remove the old one
if (idx != -1) {
qCDebug(KMAIL_LOG) << "Deleting encrypted message";
mFolder->take(idx);
}
qCDebug(KMAIL_LOG) << "Updating message actions";
updateMessageActions();
qCDebug(KMAIL_LOG) << "Done.";
} else {
qCDebug(KMAIL_LOG) << "NO EXTRA UNENCRYPTED MESSAGE FOUND";
}
#else
qCDebug(KMAIL_LOG) << "AKONADI PORT: Disabled code in " << Q_FUNC_INFO;
#endif
} else {
qCDebug(KMAIL_LOG) << "PANIC: NO OLD MESSAGE FOUND";
}
}
void KMMainWidget::slotFocusOnNextMessage()
{
mMessagePane->focusNextMessageItem(MessageList::Core::MessageTypeAny, true, false);
......
......@@ -247,8 +247,6 @@ public Q_SLOTS:
void slotItemsFetchedForActivation(KMCommand *command);
void slotMessageStatusChangeRequest(const Akonadi::Item &, const Akonadi::MessageStatus &, const Akonadi::MessageStatus &);
void slotReplaceMsgByUnencryptedVersion();
/**
Update message menu
*/
......
......@@ -174,10 +174,6 @@ public:
void setPrintElementBackground(bool printElementBackground);
Q_SIGNALS:
/** Emitted after parsing of a message to have it stored
in unencrypted state in it's folder. */
void replaceMsgByUnencryptedVersion();
void showStatusBarMessage(const QString &message);
public Q_SLOTS:
......
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