Commit 38bf1efb authored by Laurent Montel's avatar Laurent Montel 😁

Clean up. Port to new connect api

parent 37dbda5e
......@@ -36,16 +36,15 @@
#include <kconfig.h>
#include <kconfiggroup.h>
namespace MessageViewer
{
using namespace MessageViewer;
class AntiSpamConfigSingletonProvider
class MessageViewer::AntiSpamConfigSingletonProvider
{
public:
AntiSpamConfig instance;
};
Q_GLOBAL_STATIC(AntiSpamConfigSingletonProvider, theAntiSpamConfigSingletonProvider)
Q_GLOBAL_STATIC(MessageViewer::AntiSpamConfigSingletonProvider, theAntiSpamConfigSingletonProvider)
AntiSpamConfig *AntiSpamConfig::instance()
{
......@@ -118,4 +117,3 @@ const SpamAgents AntiSpamConfig::uniqueAgents() const
}
return agents;
}
}
/* Copyright (C) 2012-2016 Laurent Montel <montel@kde.org>
/*
* Copyright (C) 2012-2016 Laurent Montel <montel@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......
......@@ -37,10 +37,9 @@
using namespace MessageCore;
namespace MessageViewer
{
using namespace MessageViewer;
class Q_DECL_HIDDEN GrantleeHeaderFormatter::Private
class Q_DECL_HIDDEN MessageViewer::GrantleeHeaderFormatter::Private
{
public:
Private()
......@@ -277,5 +276,3 @@ QString GrantleeHeaderFormatter::format(const QString &absolutePath, const Grant
return headerTemplate->render(&context);
}
}
......@@ -36,8 +36,7 @@
//
// HeaderStrategy abstract base:
//
namespace MessageViewer
{
using namespace MessageViewer;
HeaderStrategy::HeaderStrategy()
{
......@@ -79,5 +78,3 @@ QStringList HeaderStrategy::stringList(const char *const headers[], int numHeade
}
return sl;
}
}
......@@ -36,8 +36,6 @@
#include "grantleetheme/grantleetheme.h"
using namespace MessageViewer;
// #####################
//
// HeaderStyle abstract base:
//
......
......@@ -50,10 +50,9 @@ public:
Q_SIGNALS:
void refreshMessage(const Akonadi::Item &item);
private Q_SLOTS:
private:
void slotAttachmentEditDone(MessageViewer::EditorWatcher *editorWatcher);
void slotItemModifiedResult(KJob *);
private:
void removeEditorWatcher(MessageViewer::EditorWatcher *editorWatcher, const QString &name);
QHash<EditorWatcher *, KMime::Content *> mEditorWatchers;
Akonadi::Item mMessageItem;
......
......@@ -38,9 +38,8 @@ public:
void start();
void setMessageItem(const Akonadi::Item &messageItem);
private Q_SLOTS:
void slotModifyItemDone(KJob *job);
private:
void slotModifyItemDone(KJob *job);
void resetDisplayFormat();
void modifyDisplayFormat();
Akonadi::Item mMessageItem;
......
......@@ -39,10 +39,8 @@ public:
void setDetails(const QString &details);
private Q_SLOTS:
void slotSaveAs();
private:
void slotSaveAs();
void writeConfig();
void readConfig();
KPIMTextEdit::RichTextEditorWidget *mDetails;
......
......@@ -40,17 +40,15 @@ public:
public Q_SLOTS:
void slotShowWarning();
private Q_SLOTS:
void slotShowDetails(const QString &content);
void slotAddToWhiteList();
Q_SIGNALS:
void showDetails();
void moveMessageToTrash();
void messageIsNotAScam();
void addToWhiteList();
private Q_SLOTS:
private:
void slotShowDetails(const QString &content);
void slotAddToWhiteList();
void slotDisableScamDetection();
void slotMessageIsNotAScam();
......
......@@ -39,7 +39,7 @@ Q_SIGNALS:
void urlExpanded(const QString &shortUrl, const QString &expandedUrl);
void expandUrlError(QNetworkReply::NetworkError error);
private Q_SLOTS:
private:
void slotError(QNetworkReply::NetworkError error);
void slotExpandFinished(QNetworkReply *reply);
......
......@@ -69,12 +69,10 @@ public:
Q_SIGNALS:
void editDone(MessageViewer::EditorWatcher *watcher);
private Q_SLOTS:
private:
void editorExited();
void inotifyEvent();
void checkEditDone();
private:
QUrl mUrl;
QString mMimeType;
QTimer mTimer;
......
......@@ -39,10 +39,9 @@ public:
void setRoot(KMime::Content *root);
KMime::Content::List selectedContents();
private Q_SLOTS:
void slotMimePartDestroyed();
private:
void slotMimePartDestroyed();
void saveMimePartTreeConfig();
void restoreMimePartTreeConfig();
MimeTreeModel *mMimePartModel;
......
......@@ -1722,16 +1722,16 @@ void ViewerPrivate::showContextMenu(KMime::Content *content, const QPoint &pos)
if (!isRoot) {
popup.addAction(QIcon::fromTheme(QStringLiteral("document-save-as")), i18n("Save &As..."),
this, SLOT(slotAttachmentSaveAs()));
this, &ViewerPrivate::slotAttachmentSaveAs);
if (isAttachment) {
popup.addAction(QIcon::fromTheme(QStringLiteral("document-open")), i18nc("to open", "Open"),
this, SLOT(slotAttachmentOpen()));
this, &ViewerPrivate::slotAttachmentOpen);
if (selectedContents().count() == 1) {
createOpenWithMenu(&popup, QLatin1String(content->contentType()->mimeType()), false);
} else {
popup.addAction(i18n("Open With..."), this, SLOT(slotAttachmentOpenWith()));
popup.addAction(i18n("Open With..."), this, &ViewerPrivate::slotAttachmentOpenWith);
}
popup.addAction(i18nc("to view something", "View"), this, &ViewerPrivate::slotAttachmentView);
}
......@@ -1739,25 +1739,25 @@ void ViewerPrivate::showContextMenu(KMime::Content *content, const QPoint &pos)
if (hasAttachments) {
popup.addAction(i18n("Save All Attachments..."), this,
SLOT(slotAttachmentSaveAll()));
&ViewerPrivate::slotAttachmentSaveAll);
}
// edit + delete only for attachments
if (!isRoot) {
if (isAttachment) {
popup.addAction(QIcon::fromTheme(QStringLiteral("edit-copy")), i18n("Copy"),
this, SLOT(slotAttachmentCopy()));
this, &ViewerPrivate::slotAttachmentCopy);
#if 0 //FIXME Laurent Comment for the moment it crash see Bug 287177
popup.addAction(QIcon::fromTheme("edit-delete"), i18n("Delete Attachment"),
this, SLOT(slotAttachmentDelete()));
#endif
if (MessageViewer::MessageViewerSettings::self()->allowAttachmentEditing())
popup.addAction(QIcon::fromTheme(QStringLiteral("document-properties")), i18n("Edit Attachment"),
this, SLOT(slotAttachmentEdit()));
this, &ViewerPrivate::slotAttachmentEdit);
}
if (!content->isTopLevel()) {
popup.addAction(i18n("Properties"), this, SLOT(slotAttachmentProperties()));
popup.addAction(i18n("Properties"), this, &ViewerPrivate::slotAttachmentProperties);
}
}
popup.exec(mMimePartTree->viewport()->mapToGlobal(pos));
......
......@@ -52,12 +52,10 @@ public:
// executes the modal dialog
int exec();
private Q_SLOTS:
private:
void saveClicked();
void openClicked();
void openWithClicked();
private:
QString text, dontAskName;
QDialog *dialog;
QDialogButtonBox *mButtonBox;
......
......@@ -46,13 +46,11 @@ public:
void doLoadFromGlobalSettings();
void doResetToDefaultsOther();
private Q_SLOTS:
void slotLegacyBodyInvitesToggled(bool on);
Q_SIGNALS:
void changed();
private:
void slotLegacyBodyInvitesToggled(bool on);
InvitationSettingsPrivate *const d;
};
......
......@@ -134,10 +134,10 @@ void MailSourceViewTextBrowser::contextMenuEvent(QContextMenuEvent *event)
popup->actions());
if (mTextToSpeechInterface->isReady()) {
popup->addSeparator();
popup->addAction(QIcon::fromTheme(QStringLiteral("preferences-desktop-text-to-speech")), i18n("Speak Text"), this, SLOT(slotSpeakText()));
popup->addAction(QIcon::fromTheme(QStringLiteral("preferences-desktop-text-to-speech")), i18n("Speak Text"), this, &MailSourceViewTextBrowser::slotSpeakText);
}
popup->addSeparator();
popup->addAction(KStandardAction::saveAs(this, SLOT(slotSaveAs()), this));
popup->addAction(KStandardAction::saveAs(this, &MailSourceViewTextBrowser::slotSaveAs, this));
popup->exec(event->globalPos());
delete popup;
......
......@@ -74,9 +74,8 @@ public:
void setPlainText(const QString &text);
void setFixedFont();
MessageViewer::MailSourceViewTextBrowser *textBrowser() const;
private Q_SLOTS:
void slotFind();
private:
void slotFind();
MailSourceViewTextBrowser *mTextBrowser;
FindBarSourceView *mFindBar;
KPIMTextEdit::SlideContainer *mSliderContainer;
......@@ -91,12 +90,11 @@ public:
explicit MailSourceViewTextBrowser(KPIMTextEdit::TextToSpeechInterface *textToSpeechInterface, QWidget *parent = Q_NULLPTR);
protected:
void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
private Q_SLOTS:
void slotSpeakText();
void slotSaveAs();
Q_SIGNALS:
void findText();
private:
void slotSpeakText();
void slotSaveAs();
KPIMTextEdit::TextToSpeechInterface *mTextToSpeechInterface;
};
......
......@@ -38,11 +38,10 @@ public Q_SLOTS:
void slotShowWarning();
void slotHideWarning();
private Q_SLOTS:
private:
void slotOpenAttachmentFolder();
void slotTimeOut();
void slotExplicitlyClosed();
private:
QUrl mUrl;
QTimer *mTimer;
};
......
......@@ -38,12 +38,10 @@ public:
explicit VCardViewer(QWidget *parent, const QByteArray &vCard);
~VCardViewer();
private Q_SLOTS:
private:
void slotUser1();
void slotUser2();
void slotUser3();
private:
void readConfig();
void writeConfig();
KAddressBookGrantlee::GrantleeContactViewer *mContactViewer;
......@@ -52,7 +50,6 @@ private:
int mAddresseeListIndex;
QPushButton *mUser2Button;
QPushButton *mUser3Button;
};
}
......
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