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

Remove broken code

parent f5771e56
cmake_minimum_required(VERSION 3.0)
set(PIM_VERSION "5.6.44")
set(PIM_VERSION "5.6.45")
if (POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
......
......@@ -356,8 +356,6 @@ QString GrantleeHeaderFormatter::format(const QString &absolutePath,
headerObject.insert(QStringLiteral("attachmentIcon"), html);
}
//Action
d->headerStyleUtil.addMailAction(headerObject);
QVariantHash mapping;
mapping.insert(QStringLiteral("header"), headerObject);
Grantlee::Context context(mapping);
......
......@@ -415,104 +415,3 @@ HeaderStyleUtil::xfaceSettings HeaderStyleUtil::xface(const MessageViewer::Heade
return settings;
}
void HeaderStyleUtil::addMailAction(QVariantHash &headerObject)
{
headerObject.insert(QStringLiteral("trashaction"), mailAction(Viewer::Trash));
headerObject.insert(QStringLiteral("replyaction"), mailAction(Viewer::Reply));
headerObject.insert(QStringLiteral("replyallaction"), mailAction(Viewer::ReplyToAll));
headerObject.insert(QStringLiteral("forwardaction"), mailAction(Viewer::Forward));
headerObject.insert(QStringLiteral("newmessageaction"), mailAction(Viewer::NewMessage));
headerObject.insert(QStringLiteral("printmessageaction"), mailAction(Viewer::Print));
headerObject.insert(QStringLiteral("printpreviewmessageaction"), mailAction(
Viewer::PrintPreview));
}
QString HeaderStyleUtil::mailAction(Viewer::MailAction action) const
{
QString html;
switch (action) {
case Viewer::Trash:
{
const QString iconPath
= MessageViewer::IconNameCache::instance()->iconPath(QStringLiteral(
"user-trash"),
KIconLoader::Toolbar);
html = QStringLiteral(
"<a href=\"kmailaction:trash\"><img title=\"%2\" height=\"%3\" width=\"%3\" src=\"%1\"></a>")
.arg(QUrl::fromLocalFile(iconPath).url(), i18n("Move to Trash"),
QString::number(mIconSize));
break;
}
case Viewer::Reply:
{
const QString iconPath
= MessageViewer::IconNameCache::instance()->iconPath(QStringLiteral(
"mail-reply-sender"),
KIconLoader::Toolbar);
html = QStringLiteral(
"<a href=\"kmailaction:reply\"><img title=\"%2\" height=\"%3\" width=\"%3\" src=\"%1\"></a>")
.arg(QUrl::fromLocalFile(iconPath).url(), i18n("Reply"), QString::number(mIconSize));
break;
}
case Viewer::ReplyToAll:
{
const QString iconPath
= MessageViewer::IconNameCache::instance()->iconPath(QStringLiteral(
"mail-reply-all"),
KIconLoader::Toolbar);
html = QStringLiteral(
"<a href=\"kmailaction:replyToAll\"><img title=\"%2\" height=\"%3\" width=\"%3\" src=\"%1\"></a>")
.arg(QUrl::fromLocalFile(iconPath).url(), i18n("Reply to All"),
QString::number(mIconSize));
break;
}
case Viewer::Forward:
{
const QString iconPath
= MessageViewer::IconNameCache::instance()->iconPath(QStringLiteral(
"mail-forward"),
KIconLoader::Toolbar);
html = QStringLiteral(
"<a href=\"kmailaction:forward\"><img title=\"%2\" height=\"%3\" width=\"%3\" src=\"%1\"></a>")
.arg(QUrl::fromLocalFile(iconPath).url(), i18n("Forward"),
QString::number(mIconSize));
break;
}
case Viewer::NewMessage:
{
const QString iconPath
= MessageViewer::IconNameCache::instance()->iconPath(QStringLiteral(
"mail-message-new"),
KIconLoader::Toolbar);
html = QStringLiteral(
"<a href=\"kmailaction:newMessage\"><img title=\"%2\" height=\"%3\" width=\"%3\" src=\"%1\"></a>")
.arg(QUrl::fromLocalFile(iconPath).url(), i18n("New Message"), QString::number(
mIconSize));
break;
}
case Viewer::Print:
{
const QString iconPath
= MessageViewer::IconNameCache::instance()->iconPath(QStringLiteral(
"document-print"),
KIconLoader::Toolbar);
html = QStringLiteral(
"<a href=\"kmailaction:print\"><img title=\"%2\" height=\"%3\" width=\"%3\" src=\"%1\"></a>")
.arg(QUrl::fromLocalFile(iconPath).url(), i18n("Print"), QString::number(mIconSize));
break;
}
case Viewer::PrintPreview:
{
const QString iconPath
= MessageViewer::IconNameCache::instance()->iconPath(QStringLiteral(
"document-print-preview"),
KIconLoader::Toolbar);
html = QStringLiteral(
"<a href=\"kmailaction:printpreview\"><img title=\"%2\" height=\"%3\" width=\"%3\" src=\"%1\"></a>")
.arg(QUrl::fromLocalFile(iconPath).url(), i18n("Print Preview"),
QString::number(mIconSize));
break;
}
}
return html;
}
......@@ -72,7 +72,6 @@ public:
QString subjectDirectionString(KMime::Message *message) const;
QString mailAction(MessageViewer::Viewer::MailAction action) const;
QString spamStatus(KMime::Message *message) const;
......@@ -84,7 +83,6 @@ public:
QVector<KMime::Types::Mailbox> resentToList(KMime::Message *message) const;
xfaceSettings xface(const HeaderStyle *style, KMime::Message *message) const;
void addMailAction(QVariantHash &headerObject);
private:
void updateXFaceSettings(QImage photo, xfaceSettings &settings) const;
QString drawSpamMeter(SpamError spamError, double percent, double confidence,
......
......@@ -83,80 +83,6 @@ using namespace MessageCore;
URLHandlerManager *URLHandlerManager::self = nullptr;
namespace {
class KMailActionURLHandler : public MimeTreeParser::URLHandler
{
public:
KMailActionURLHandler() : MimeTreeParser::URLHandler()
{
}
~KMailActionURLHandler()
{
}
bool handleClick(const QUrl &url, ViewerPrivate *viewer) const override
{
if (url.scheme() == QLatin1String("kmailaction")) {
const QString urlPath(url.path());
if (urlPath == QStringLiteral("trash")) {
viewer->setMailAction(MessageViewer::Viewer::Trash);
return true;
} else if (urlPath == QStringLiteral("reply")) {
viewer->setMailAction(MessageViewer::Viewer::Reply);
return true;
} else if (urlPath == QStringLiteral("replyToAll")) {
viewer->setMailAction(MessageViewer::Viewer::ReplyToAll);
return true;
} else if (urlPath == QStringLiteral("forward")) {
viewer->setMailAction(MessageViewer::Viewer::Forward);
return true;
} else if (urlPath == QStringLiteral("newMessage")) {
viewer->setMailAction(MessageViewer::Viewer::NewMessage);
return true;
} else if (urlPath == QStringLiteral("print")) {
viewer->setMailAction(MessageViewer::Viewer::Print);
return true;
} else if (urlPath == QStringLiteral("printpreview")) {
viewer->setMailAction(MessageViewer::Viewer::PrintPreview);
return true;
} else {
qCDebug(MESSAGEVIEWER_LOG) << "Unknown urlPath " << urlPath;
}
}
return false;
}
bool handleContextMenuRequest(const QUrl &url, const QPoint &, ViewerPrivate *) const override
{
return url.scheme() == QLatin1String("kmailaction");
}
QString statusBarMessage(const QUrl &url, ViewerPrivate *) const override
{
if (url.scheme() == QLatin1String("kmailaction")) {
const QString urlPath(url.path());
if (urlPath == QStringLiteral("trash")) {
return i18n("Move To Trash");
} else if (urlPath == QStringLiteral("reply")) {
return i18n("Reply");
} else if (urlPath == QStringLiteral("replyToAll")) {
return i18n("Reply To All");
} else if (urlPath == QStringLiteral("forward")) {
return i18n("Forward");
} else if (urlPath == QStringLiteral("newMessage")) {
return i18n("New Message");
} else if (urlPath == QStringLiteral("print")) {
return i18n("Print Message");
} else if (urlPath == QStringLiteral("printpreview")) {
return i18n("Print Preview Message");
} else {
qCDebug(MESSAGEVIEWER_LOG) << "Unknown urlPath " << urlPath;
}
}
return QString();
}
};
class KMailProtocolURLHandler : public MimeTreeParser::URLHandler
{
public:
......@@ -563,7 +489,6 @@ URLHandlerManager::URLHandlerManager()
registerHandler(new ShowAuditLogURLHandler());
registerHandler(new InternalImageURLHandler);
registerHandler(new KRunURLHandler());
registerHandler(new KMailActionURLHandler());
//registerHandler(new EmbeddedImageURLHandler());
}
......
......@@ -111,7 +111,6 @@ void Viewer::initialize()
this, &Viewer::itemRemoved);
connect(d_ptr, &ViewerPrivate::changeDisplayMail, this, &Viewer::slotChangeDisplayMail);
connect(d_ptr, &ViewerPrivate::moveMessageToTrash, this, &Viewer::moveMessageToTrash);
connect(d_ptr, &ViewerPrivate::executeMailAction, this, &Viewer::executeMailAction);
connect(d_ptr, &ViewerPrivate::pageIsScrolledToBottom, this, &Viewer::pageIsScrolledToBottom);
connect(d_ptr, &ViewerPrivate::printingFinished, this, &Viewer::printingFinished);
......
......@@ -148,16 +148,6 @@ public:
ReplyMessageToAll = 11
};
enum MailAction {
Trash = 0,
Reply,
ReplyToAll,
Forward,
NewMessage,
Print,
PrintPreview
};
enum ResourceOnlineMode {
AllResources = 0,
SelectedResource = 1
......@@ -344,7 +334,6 @@ public:
Q_SIGNALS:
void moveMessageToTrash();
void pageIsScrolledToBottom(bool);
void executeMailAction(MessageViewer::Viewer::MailAction type);
/**
* Emitted when a status bar message is shown. Note that the status bar message is also set to
......
......@@ -3270,11 +3270,6 @@ void ViewerPrivate::saveMainFrameScreenshotInFile(const QString &filename)
mViewer->saveMainFrameScreenshotInFile(filename);
}
void ViewerPrivate::setMailAction(MessageViewer::Viewer::MailAction type)
{
Q_EMIT executeMailAction(type);
}
void ViewerPrivate::slotAddToWhiteList()
{
if (mMessageItem.isValid()) {
......
......@@ -282,8 +282,6 @@ public:
void saveMainFrameScreenshotInFile(const QString &filename);
void setMailAction(MessageViewer::Viewer::MailAction type);
private:
/** HTML initialization. */
void initHtmlWidget();
......@@ -586,7 +584,6 @@ Q_SIGNALS:
void changeDisplayMail(Viewer::DisplayFormatMessage, bool);
void moveMessageToTrash();
void executeMailAction(MessageViewer::Viewer::MailAction type);
void pageIsScrolledToBottom(bool);
void printingFinished();
private:
......
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