summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-13 04:56:41 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-13 04:56:55 (GMT)
commitc1af9bb147d56009ad36f1c56a1b6873d69c5e79 (patch)
treef53eb23137d87e8b378baebf4f1c5cac3620f6f2
parent277cbdcbfbce200957c107a96bc6f6627bdafe3e (diff)
Remove not necessary old scripts
-rw-r--r--messageviewer/src/viewer/viewer_p.cpp1
-rw-r--r--messageviewer/src/viewer/webengine/autotests/mailwebenginescripttest.cpp32
-rw-r--r--messageviewer/src/viewer/webengine/autotests/mailwebenginescripttest.h2
-rw-r--r--messageviewer/src/viewer/webengine/mailwebenginescript.cpp32
-rw-r--r--messageviewer/src/viewer/webengine/mailwebenginescript.h2
-rw-r--r--messageviewer/src/viewer/webengine/mailwebengineview.cpp12
-rw-r--r--messageviewer/src/viewer/webengine/mailwebengineview.h2
7 files changed, 0 insertions, 83 deletions
diff --git a/messageviewer/src/viewer/viewer_p.cpp b/messageviewer/src/viewer/viewer_p.cpp
index 35817d4..9aab3a1 100644
--- a/messageviewer/src/viewer/viewer_p.cpp
+++ b/messageviewer/src/viewer/viewer_p.cpp
@@ -2376,7 +2376,6 @@ void ViewerPrivate::executeCustomScriptsAfterLoading()
mViewer->injectAttachments(bind(&ViewerPrivate::attachmentInjectionHtml, this));
toggleFullAddressList();
- mViewer->executeCustomRenderingScripts();
mViewer->scrollToRelativePosition(mViewer->relativePosition());
mViewer->clearRelativePosition();
}
diff --git a/messageviewer/src/viewer/webengine/autotests/mailwebenginescripttest.cpp b/messageviewer/src/viewer/webengine/autotests/mailwebenginescripttest.cpp
index 0a65cb0..769bf30 100644
--- a/messageviewer/src/viewer/webengine/autotests/mailwebenginescripttest.cpp
+++ b/messageviewer/src/viewer/webengine/autotests/mailwebenginescripttest.cpp
@@ -45,36 +45,4 @@ void MailWebEngineScriptTest::shouldReplaceInnerHtml()
QCOMPARE(MessageViewer::MailWebEngineScript::replaceInnerHtml(QStringLiteral("GG"), QStringLiteral("<a>hello word</a>")), result);
}
-void MailWebEngineScriptTest::shouldManageShowHideAttachments()
-{
- const QString result = QString::fromLatin1("qt.jQuery('#kmailshowattachment').click(function(){"
- "qt.jQuery('#kmailshowattachment').hide();"
- "qt.jQuery(\"#kmailhideattachment\").show();"
- "qt.jQuery(\"#attachmentid\").hide()}"
- ");"
- "qt.jQuery('#kmailhideattachment').click(function(){"
- "qt.jQuery(\"#kmailhideattachment\").hide();"
- "qt.jQuery(\"#kmailshowattachment\").show();"
- "qt.jQuery(\"#attachmentid\").show()}"
- ");");
- QCOMPARE(MessageViewer::MailWebEngineScript::manageShowHideAttachments(), result);
-}
-
-void MailWebEngineScriptTest::shouldManageExpandAddresses()
-{
- const QString result = QString::fromLatin1("qt.jQuery('#kmail%1show').click(function(){"
- "qt.jQuery('#kmail%1show').hide();"
- "qt.jQuery(\"#kmail%1hide\").show();"
- "qt.jQuery(\"#dotsFull%1AddressList\").hide();"
- "qt.jQuery(\"#hiddenFull%1AddressList\").show();}"
- ");"
- "qt.jQuery('#kmail%1hide').click(function(){"
- "qt.jQuery(\"#kmail%1hide\").hide();"
- "qt.jQuery(\"#kmail%1show\").show();"
- "qt.jQuery(\"#dotsFull%1AddressList\").show();"
- "qt.jQuery(\"#hiddenFull%1AddressList\").hide();}"
- ");").arg(QStringLiteral("FOO"));
- QCOMPARE(MessageViewer::MailWebEngineScript::manageExpandAddresses(QStringLiteral("FOO")), result);
-}
-
QTEST_MAIN(MailWebEngineScriptTest)
diff --git a/messageviewer/src/viewer/webengine/autotests/mailwebenginescripttest.h b/messageviewer/src/viewer/webengine/autotests/mailwebenginescripttest.h
index 68be240..8d2de35 100644
--- a/messageviewer/src/viewer/webengine/autotests/mailwebenginescripttest.h
+++ b/messageviewer/src/viewer/webengine/autotests/mailwebenginescripttest.h
@@ -31,8 +31,6 @@ public:
private Q_SLOTS:
void shouldInjectAttachment();
void shouldReplaceInnerHtml();
- void shouldManageShowHideAttachments();
- void shouldManageExpandAddresses();
};
#endif // MAILWEBENGINESCRIPTTEST_H
diff --git a/messageviewer/src/viewer/webengine/mailwebenginescript.cpp b/messageviewer/src/viewer/webengine/mailwebenginescript.cpp
index 86ecd4e..be85e5b 100644
--- a/messageviewer/src/viewer/webengine/mailwebenginescript.cpp
+++ b/messageviewer/src/viewer/webengine/mailwebenginescript.cpp
@@ -22,23 +22,6 @@
#include <QDebug>
using namespace MessageViewer;
-QString MailWebEngineScript::manageExpandAddresses(const QString &field)
-{
- const QString source = QString::fromLatin1("qt.jQuery('#kmail%1show').click(function(){"
- "qt.jQuery('#kmail%1show').hide();"
- "qt.jQuery(\"#kmail%1hide\").show();"
- "qt.jQuery(\"#dotsFull%1AddressList\").hide();"
- "qt.jQuery(\"#hiddenFull%1AddressList\").show();}"
- ");"
- "qt.jQuery('#kmail%1hide').click(function(){"
- "qt.jQuery(\"#kmail%1hide\").hide();"
- "qt.jQuery(\"#kmail%1show\").show();"
- "qt.jQuery(\"#dotsFull%1AddressList\").show();"
- "qt.jQuery(\"#hiddenFull%1AddressList\").hide();}"
- ");").arg(field);
- return source;
-}
-
QString MailWebEngineScript::createShowHideAddressScript(const QString &field, bool hide)
{
QString source;
@@ -81,21 +64,6 @@ QString MailWebEngineScript::manageShowHideAttachments(bool hide)
return source;
}
-QString MailWebEngineScript::manageShowHideAttachments()
-{
- const QString source = QString::fromLatin1("qt.jQuery('#kmailshowattachment').click(function(){"
- "qt.jQuery('#kmailshowattachment').hide();"
- "qt.jQuery(\"#kmailhideattachment\").show();"
- "qt.jQuery(\"#attachmentid\").hide()}"
- ");"
- "qt.jQuery('#kmailhideattachment').click(function(){"
- "qt.jQuery(\"#kmailhideattachment\").hide();"
- "qt.jQuery(\"#kmailshowattachment\").show();"
- "qt.jQuery(\"#attachmentid\").show()}"
- ");");
- return source;
-}
-
QString MailWebEngineScript::injectAttachments(const QString &delayedHtml, const QString &elementStr)
{
const QString source = QString::fromLatin1("qt.jQuery('#%1').append('%2')").arg(elementStr).arg(delayedHtml);
diff --git a/messageviewer/src/viewer/webengine/mailwebenginescript.h b/messageviewer/src/viewer/webengine/mailwebenginescript.h
index c966b89..c2d6cb1 100644
--- a/messageviewer/src/viewer/webengine/mailwebenginescript.h
+++ b/messageviewer/src/viewer/webengine/mailwebenginescript.h
@@ -29,9 +29,7 @@ namespace MailWebEngineScript
{
MESSAGEVIEWER_EXPORT QString injectAttachments(const QString &delayedHtml, const QString &element);
MESSAGEVIEWER_EXPORT QString replaceInnerHtml(const QString &field, const QString &html);
-MESSAGEVIEWER_EXPORT QString manageShowHideAttachments();
MESSAGEVIEWER_EXPORT QString manageShowHideAttachments(bool hide);
-MESSAGEVIEWER_EXPORT QString manageExpandAddresses(const QString &field);
MESSAGEVIEWER_EXPORT QString manageShowHideToAddress(bool hide);
MESSAGEVIEWER_EXPORT QString manageShowHideCcAddress(bool hide);
MESSAGEVIEWER_EXPORT QString createShowHideAddressScript(const QString &field, bool hide);
diff --git a/messageviewer/src/viewer/webengine/mailwebengineview.cpp b/messageviewer/src/viewer/webengine/mailwebengineview.cpp
index d2040c5..77b3715 100644
--- a/messageviewer/src/viewer/webengine/mailwebengineview.cpp
+++ b/messageviewer/src/viewer/webengine/mailwebengineview.cpp
@@ -120,10 +120,6 @@ void MailWebEngineView::runJavaScriptInWordId(const QString &script)
void MailWebEngineView::initializeScripts()
{
initializeJQueryScript();
- const QString scripts = MessageViewer::MailWebEngineScript::manageShowHideAttachments() +
- MessageViewer::MailWebEngineScript::manageExpandAddresses(QStringLiteral("To")) +
- MessageViewer::MailWebEngineScript::manageExpandAddresses(QStringLiteral("Cc"));
- addScript(scripts, QStringLiteral("emailmanagement"), QWebEngineScript::DocumentReady);
}
void MailWebEngineView::contextMenuEvent(QContextMenuEvent *e)
@@ -333,14 +329,6 @@ void MailWebEngineView::executeHideShowAttachmentsScripts(bool hide)
runJavaScriptInWordId(source);
}
-void MailWebEngineView::executeCustomRenderingScripts()
-{
- const QString scripts = MessageViewer::MailWebEngineScript::manageShowHideAttachments() +
- MessageViewer::MailWebEngineScript::manageExpandAddresses(QStringLiteral("To")) +
- MessageViewer::MailWebEngineScript::manageExpandAddresses(QStringLiteral("Cc"));
- runJavaScriptInWordId(scripts);
-}
-
void MailWebEngineView::injectAttachments(const boost::function<QString()> &delayedHtml)
{
const QString html = delayedHtml();
diff --git a/messageviewer/src/viewer/webengine/mailwebengineview.h b/messageviewer/src/viewer/webengine/mailwebengineview.h
index de260d2..790f707 100644
--- a/messageviewer/src/viewer/webengine/mailwebengineview.h
+++ b/messageviewer/src/viewer/webengine/mailwebengineview.h
@@ -66,8 +66,6 @@ public:
QList<QAction *> interceptorUrlActions(const WebEngineViewer::WebHitTestResult &result) const;
void toggleFullAddressList(const QString &field, const boost::function<QString()> &delayedHtml);
- void executeCustomRenderingScripts();
-
void setPrintElementBackground(bool printElementBackground);
void executeHideShowAttachmentsScripts(bool hide);