summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-08-20 13:42:27 +0200
committerMontel Laurent <[email protected]>2015-08-20 13:42:27 +0200
commit06f6479395570d4b6f8ea4177d7520dcf9435831 (patch)
tree90a28e8c465468014da166ff8d59d94f622f25eb
parentba8f46e94e126403dd3729e390e90b8b4fb7abaa (diff)
Bye bye toltec. We don't have UI for it
-rw-r--r--messageviewer/settings/messageviewer.kcfg.cmake8
-rw-r--r--messageviewer/viewer/nodehelper.cpp37
-rw-r--r--messageviewer/viewer/nodehelper.h2
-rw-r--r--messageviewer/viewer/objecttreeparser.cpp25
-rw-r--r--messageviewer/viewer/objecttreeparser.h27
-rw-r--r--messageviewer/viewer/urlhandlermanager.cpp6
-rw-r--r--messageviewer/viewer/viewer_p.cpp10
-rw-r--r--messageviewer/viewer/viewer_p.h11
8 files changed, 0 insertions, 126 deletions
diff --git a/messageviewer/settings/messageviewer.kcfg.cmake b/messageviewer/settings/messageviewer.kcfg.cmake
index 1130ffa..bd953c6 100644
--- a/messageviewer/settings/messageviewer.kcfg.cmake
+++ b/messageviewer/settings/messageviewer.kcfg.cmake
@@ -34,14 +34,6 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/sta
</group>
<group name="Reader">
- <entry name="ShowToltecReplacementText" type="Bool">
- <label>When encountering a Toltec scheduling message, display a custom replacement text for it.</label>
- <default>true</default>
- </entry>
- <entry name="ToltecReplacementText" type="String">
- <label>The text that will be displayed as a replacement when encountering Toltec scheduling messages.</label>
- <default code="true">MessageViewer::ObjectTreeParser::defaultToltecReplacementText()</default>
- </entry>
<entry name="AutoImportKeys" type="Bool">
<default>false</default>
</entry>
diff --git a/messageviewer/viewer/nodehelper.cpp b/messageviewer/viewer/nodehelper.cpp
index deb545e..338841a 100644
--- a/messageviewer/viewer/nodehelper.cpp
+++ b/messageviewer/viewer/nodehelper.cpp
@@ -327,43 +327,6 @@ void NodeHelper::addTempFile(const QString &file)
mAttachmentFilesDir->addTempFile(file);
}
-bool NodeHelper::isToltecMessage(KMime::Content *node)
-{
- if (!node->contentType(false)) {
- return false;
- }
-
- if (node->contentType()->mediaType().toLower() != "multipart" ||
- node->contentType()->subType().toLower() != "mixed") {
- return false;
- }
-
- if (node->contents().size() != 3) {
- return false;
- }
-
- const KMime::Headers::Base *libraryHeader = node->headerByType("X-Library");
- if (!libraryHeader) {
- return false;
- }
-
- if (QString::fromLatin1(libraryHeader->as7BitString(false)).toLower() !=
- QLatin1String("toltec")) {
- return false;
- }
-
- const KMime::Headers::Base *kolabTypeHeader = node->headerByType("X-Kolab-Type");
- if (!kolabTypeHeader) {
- return false;
- }
-
- if (!QString::fromLatin1(kolabTypeHeader->as7BitString(false)).toLower().startsWith(
- QLatin1String("application/x-vnd.kolab"))) {
- return false;
- }
-
- return true;
-}
bool NodeHelper::isInEncapsulatedMessage(KMime::Content *node)
{
diff --git a/messageviewer/viewer/nodehelper.h b/messageviewer/viewer/nodehelper.h
index 51fee9f..5b3e7c4 100644
--- a/messageviewer/viewer/nodehelper.h
+++ b/messageviewer/viewer/nodehelper.h
@@ -187,8 +187,6 @@ public:
// UrlHandlerManager.
QString asHREF(const KMime::Content *node, const QString &place);
- static bool isToltecMessage(KMime::Content *node);
-
/**
* @return true if this node is a child or an encapsulated message
*/
diff --git a/messageviewer/viewer/objecttreeparser.cpp b/messageviewer/viewer/objecttreeparser.cpp
index 459c5e1..943033f 100644
--- a/messageviewer/viewer/objecttreeparser.cpp
+++ b/messageviewer/viewer/objecttreeparser.cpp
@@ -161,7 +161,6 @@ ObjectTreeParser::ObjectTreeParser(const ObjectTreeParser *topLevelParser,
mIncludeSignatures(includeSignatures),
mHasPendingAsyncJobs(false),
mAllowAsync(topLevelParser->mAllowAsync),
- mShowRawToltecMail(false),
mAttachmentStrategy(strategy)
{
init();
@@ -182,7 +181,6 @@ ObjectTreeParser::ObjectTreeParser(ObjectTreeSourceIf *source,
mIncludeSignatures(includeSignatures),
mHasPendingAsyncJobs(false),
mAllowAsync(false),
- mShowRawToltecMail(false),
mAttachmentStrategy(strategy),
mPrinting(false)
{
@@ -1513,31 +1511,8 @@ void ObjectTreeParser::standardChildHandling(KMime::Content *child)
copyContentFrom(&otp);
}
-QString ObjectTreeParser::defaultToltecReplacementText()
-{
- return i18n("This message is a <i>Toltec</i> Groupware object, it can only be viewed with "
- "Microsoft Outlook in combination with the Toltec connector.");
-}
-
-bool ObjectTreeParser::processToltecMail(KMime::Content *node)
-{
- if (!node || !htmlWriter() || !GlobalSettings::self()->showToltecReplacementText() ||
- !NodeHelper::isToltecMessage(node) || mShowRawToltecMail) {
- return false;
- }
-
- htmlWriter()->queue(GlobalSettings::self()->toltecReplacementText());
- htmlWriter()->queue(QLatin1String("<br/><br/><a href=\"kmail:showRawToltecMail\">") +
- i18n("Show Raw Message") + QLatin1String("</a>"));
- return true;
-}
-
bool ObjectTreeParser::processMultiPartMixedSubtype(KMime::Content *node, ProcessResult &)
{
- if (processToltecMail(node)) {
- return true;
- }
-
KMime::Content *child = MessageCore::NodeHelper::firstChild(node);
if (!child) {
return false;
diff --git a/messageviewer/viewer/objecttreeparser.h b/messageviewer/viewer/objecttreeparser.h
index 8782a12..a1b455f 100644
--- a/messageviewer/viewer/objecttreeparser.h
+++ b/messageviewer/viewer/objecttreeparser.h
@@ -441,21 +441,6 @@ public:
mIncludeSignatures = include;
}
- // Controls whether Toltec invitations are displayed in their raw form or as a replacement text,
- // which is used in processToltecMail().
- void setShowRawToltecMail(bool showRawToltecMail)
- {
- mShowRawToltecMail = showRawToltecMail;
- }
- bool showRawToltecMail() const
- {
- return mShowRawToltecMail;
- }
-
- /// Default text for processToltecMail(), which is used in messageviewer.kcfg, therefore it
- /// needs to be static here.
- static QString defaultToltecReplacementText();
-
const AttachmentStrategy *attachmentStrategy() const
{
return mAttachmentStrategy;
@@ -544,17 +529,6 @@ private:
bool &decryptionStarted,
PartMetaData &partMetaData);
- /**
- * This is called for all multipart/mixed nodes. It checks if that belongs to a Toltec mail,
- * by checking various criteria.
- * If it is a toltec mail, a special text, instead of the confusing toltec text, will be
- * displayed.
- *
- * @return true if the mail was indeed a toltec mail, in which case the node should not be
- * processed further
- */
- bool processToltecMail(KMime::Content *node);
-
bool processMailmanMessage(KMime::Content *node);
/** Checks whether @p str contains external references. To be precise,
@@ -676,7 +650,6 @@ private:
bool mIncludeSignatures;
bool mHasPendingAsyncJobs;
bool mAllowAsync;
- bool mShowRawToltecMail;
const AttachmentStrategy *mAttachmentStrategy;
// DataUrl Icons cache
QString mCollapseIcon;
diff --git a/messageviewer/viewer/urlhandlermanager.cpp b/messageviewer/viewer/urlhandlermanager.cpp
index bc1b486..d209f36 100644
--- a/messageviewer/viewer/urlhandlermanager.cpp
+++ b/messageviewer/viewer/urlhandlermanager.cpp
@@ -555,10 +555,6 @@ bool KMailProtocolURLHandler::handleClick(const QUrl &url, ViewerPrivate *w) con
w->setShowFullCcAddressList(false);
w->update(Viewer::Force);
return true;
- } else if (urlPath == QLatin1String("showRawToltecMail")) {
- w->setShowRawToltecMail(true);
- w->update(Viewer::Force);
- return true;
}
}
return false;
@@ -594,8 +590,6 @@ QString KMailProtocolURLHandler::statusBarMessage(const QUrl &url, ViewerPrivate
return i18n("Show full \"Cc\" list");
} else if (urlPath == QLatin1String("hideFullCcAddressList")) {
return i18n("Hide full \"Cc\" list");
- } else if (urlPath == QLatin1String("showRawToltecMail")) {
- return i18n("Show Raw Message");
} else {
return QString();
}
diff --git a/messageviewer/viewer/viewer_p.cpp b/messageviewer/viewer/viewer_p.cpp
index b1169a5..ca2ce2b 100644
--- a/messageviewer/viewer/viewer_p.cpp
+++ b/messageviewer/viewer/viewer_p.cpp
@@ -206,7 +206,6 @@ ViewerPrivate::ViewerPrivate(Viewer *aParent, QWidget *mainWindow,
mDecrytMessageOverwrite(false),
mShowSignatureDetails(false),
mShowAttachmentQuicklist(true),
- mShowRawToltecMail(false),
mRecursionCountForDisplayMessage(0),
mCurrentContent(0),
mMessagePartNode(0),
@@ -976,13 +975,6 @@ void ViewerPrivate::parseContent(KMime::Content *content)
}
}
- if (!NodeHelper::isToltecMessage(content) || mShowRawToltecMail) {
- KMime::Message *message = dynamic_cast<KMime::Message *>(content);
- if (message) {
- htmlWriter()->queue(writeMsgHeader(message, hasVCard ? vCardContent : 0, true));
- }
- }
-
// Pass control to the OTP now, which does the real work
mNodeHelper->removeTempFiles();
mNodeHelper->setNodeUnprocessed(mMessage.data(), true);
@@ -990,7 +982,6 @@ void ViewerPrivate::parseContent(KMime::Content *content)
ObjectTreeParser otp(&otpSource, mNodeHelper, 0, mMessage.data() != content /* show only single node */);
otp.setAllowAsync(!mPrinting);
otp.setPrinting(mPrinting);
- otp.setShowRawToltecMail(mShowRawToltecMail);
otp.parseObjectTree(content);
// TODO: Setting the signature state to nodehelper is not enough, it should actually
@@ -1325,7 +1316,6 @@ void ViewerPrivate::resetStateForNewMessage()
#endif
mSavedRelativePosition = 0;
setShowSignatureDetails(false);
- mShowRawToltecMail = !GlobalSettings::self()->showToltecReplacementText();
mFindBar->closeBar();
mTranslatorWidget->slotCloseWidget();
mCreateTodo->slotCloseWidget();
diff --git a/messageviewer/viewer/viewer_p.h b/messageviewer/viewer/viewer_p.h
index 86defab..8c6ad85 100644
--- a/messageviewer/viewer/viewer_p.h
+++ b/messageviewer/viewer/viewer_p.h
@@ -447,16 +447,6 @@ public:
/* show or hide the list that points to the attachments */
void setShowAttachmentQuicklist(bool showAttachmentQuicklist = true);
- // This controls whether a Toltec invitation is shown in its raw form or as a replacement text.
- // This can be toggled with the "kmail:showRawToltecMail" link.
- bool showRawToltecMail() const
- {
- return mShowRawToltecMail;
- }
- void setShowRawToltecMail(bool showRawToltecMail)
- {
- mShowRawToltecMail = showRawToltecMail;
- }
void scrollToAttachment(KMime::Content *node);
void setUseFixedFont(bool useFixedFont);
@@ -744,7 +734,6 @@ public:
bool mDecrytMessageOverwrite;
bool mShowSignatureDetails;
bool mShowAttachmentQuicklist;
- bool mShowRawToltecMail;
bool mExternalWindow;
bool mZoomTextOnly;
int mRecursionCountForDisplayMessage;