Commit 62c3442a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix test

parent 0d55bbd0
......@@ -45,6 +45,6 @@ if (KDEPIM_RUN_AKONADI_TEST)
add_akonadi_isolated_test_advanced( tagselectdialogtest.cpp "" "kmailprivate;KF5::MailCommon;KF5::Libkdepim;KF5::ItemViews;KF5::TemplateParser;KF5::XmlGui;KF5::Completion;KF5::I18n")
add_akonadi_isolated_test_advanced(kmcommandstest.cpp "../kmcommands.cpp;../util.cpp;../secondarywindow.cpp;../undostack.cpp;../kmail_debug.cpp;../job/handleclickedurljob.cpp;"
add_akonadi_isolated_test_advanced(kmcommandstest.cpp ""
"Qt5::Test;Qt5::Widgets;KF5::AkonadiCore;KF5::Bookmarks;KF5::ConfigWidgets;KF5::Contacts;KF5::I18n;KF5::IdentityManagement;KF5::KIOCore;KF5::KIOFileWidgets;KF5::MessageCore;KF5::MessageComposer;KF5::MessageList;KF5::MessageViewer;KF5::MailCommon;KF5::MailTransportAkonadi;KF5::Libkdepim;KF5::TemplateParser;kmailprivate")
endif()
......@@ -23,8 +23,9 @@
#include <QObject>
#include <QSharedPointer>
#include <MailCommon/FolderSettings>
#include "kmail_private_export.h"
class HandleClickedUrlJob : public QObject
class KMAILTESTS_TESTS_EXPORT HandleClickedUrlJob : public QObject
{
Q_OBJECT
public:
......
......@@ -2,6 +2,9 @@
#ifndef KMCommands_h
#define KMCommands_h
#include "kmail_private_export.h"
#include <MessageComposer/MessageFactoryNG>
#include <MessageList/View>
#include <MailCommon/SearchPattern>
......@@ -47,7 +50,7 @@ class Composer;
typedef QMap<KMime::Content *, Akonadi::Item> PartNodeMessageMap;
/// Small helper structure which encapsulates the KMMessage created when creating a reply, and
class KMCommand : public QObject
class KMAILTESTS_TESTS_EXPORT KMCommand : public QObject
{
Q_OBJECT
......@@ -155,7 +158,7 @@ private:
Akonadi::ItemFetchScope mFetchScope;
};
class KMMailtoComposeCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMMailtoComposeCommand : public KMCommand
{
Q_OBJECT
......@@ -169,7 +172,7 @@ private:
Akonadi::Item mMessage;
};
class KMMailtoReplyCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMMailtoReplyCommand : public KMCommand
{
Q_OBJECT
......@@ -183,7 +186,7 @@ private:
QString mSelection;
};
class KMMailtoForwardCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMMailtoForwardCommand : public KMCommand
{
Q_OBJECT
......@@ -195,7 +198,7 @@ private:
QUrl mUrl;
};
class KMAddBookmarksCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMAddBookmarksCommand : public KMCommand
{
Q_OBJECT
......@@ -208,7 +211,7 @@ private:
QUrl mUrl;
};
class KMUrlSaveCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMUrlSaveCommand : public KMCommand
{
Q_OBJECT
......@@ -224,7 +227,7 @@ private:
QUrl mUrl;
};
class KMEditItemCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMEditItemCommand : public KMCommand
{
Q_OBJECT
......@@ -238,7 +241,7 @@ private:
bool mDeleteFromSource = false;
};
class KMEditMessageCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMEditMessageCommand : public KMCommand
{
Q_OBJECT
......@@ -249,7 +252,7 @@ private:
KMime::Message::Ptr mMessage;
};
class KMUseTemplateCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMUseTemplateCommand : public KMCommand
{
Q_OBJECT
......@@ -260,7 +263,7 @@ private:
Result execute() override;
};
class KMSaveMsgCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMSaveMsgCommand : public KMCommand
{
Q_OBJECT
......@@ -271,7 +274,7 @@ private:
Result execute() override;
};
class KMOpenMsgCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMOpenMsgCommand : public KMCommand
{
Q_OBJECT
......@@ -295,7 +298,7 @@ private:
KMMainWidget *mMainWidget = nullptr;
};
class KMSaveAttachmentsCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMSaveAttachmentsCommand : public KMCommand
{
Q_OBJECT
public:
......@@ -316,7 +319,7 @@ private:
MessageViewer::Viewer *mViewer = nullptr;
};
class KMReplyCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMReplyCommand : public KMCommand
{
Q_OBJECT
public:
......@@ -331,7 +334,7 @@ private:
bool mNoQuote = false;
};
class KMForwardCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMForwardCommand : public KMCommand
{
Q_OBJECT
......@@ -349,7 +352,7 @@ private:
QString mSelection;
};
class KMForwardAttachedCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMForwardAttachedCommand : public KMCommand
{
Q_OBJECT
......@@ -364,7 +367,7 @@ private:
QPointer<KMail::Composer> mWin;
};
class KMRedirectCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMRedirectCommand : public KMCommand
{
Q_OBJECT
......@@ -376,7 +379,7 @@ private:
Result execute() override;
};
struct KMPrintCommandInfo
struct KMAILTESTS_TESTS_EXPORT KMPrintCommandInfo
{
Akonadi::Item mMsg;
QFont mOverrideFont;
......@@ -391,7 +394,7 @@ struct KMPrintCommandInfo
bool mShowEncryptionDetails = false;
};
class KMPrintCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMPrintCommand : public KMCommand
{
Q_OBJECT
......@@ -403,7 +406,7 @@ private:
KMPrintCommandInfo mPrintCommandInfo;
};
class KMSetStatusCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMSetStatusCommand : public KMCommand
{
Q_OBJECT
......@@ -423,7 +426,7 @@ private:
/** This command is used to set or toggle a tag for a list of messages. If toggle is
true then the tag is deleted if it is already applied.
*/
class KMSetTagCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMSetTagCommand : public KMCommand
{
Q_OBJECT
......@@ -449,7 +452,7 @@ private:
/* This command is used to apply a single filter (AKA ad-hoc filter)
to a set of messages */
class KMFilterActionCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMFilterActionCommand : public KMCommand
{
Q_OBJECT
......@@ -462,7 +465,7 @@ private:
QString mFilterId;
};
class KMMetaFilterActionCommand : public QObject
class KMAILTESTS_TESTS_EXPORT KMMetaFilterActionCommand : public QObject
{
Q_OBJECT
......@@ -477,7 +480,7 @@ private:
KMMainWidget *mMainWidget = nullptr;
};
class KMMailingListFilterCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMMailingListFilterCommand : public KMCommand
{
Q_OBJECT
......@@ -488,7 +491,7 @@ private:
Result execute() override;
};
class KMCopyCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMCopyCommand : public KMCommand
{
Q_OBJECT
......@@ -504,7 +507,7 @@ private:
Akonadi::Collection mDestFolder;
};
class KMCopyDecryptedCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMCopyDecryptedCommand : public KMCommand
{
Q_OBJECT
public:
......@@ -521,7 +524,7 @@ private:
QList<KJob *> mPendingJobs;
};
class KMMoveCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMMoveCommand : public KMCommand
{
Q_OBJECT
......@@ -559,7 +562,7 @@ private:
MessageList::Core::MessageItemSetReference mRef;
};
class KMTrashMsgCommand final : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMTrashMsgCommand final : public KMCommand
{
Q_OBJECT
......@@ -603,7 +606,7 @@ private:
QList<KJob *> mPendingDeletes;
};
class KMResendMessageCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMResendMessageCommand : public KMCommand
{
Q_OBJECT
......@@ -614,7 +617,7 @@ private:
Result execute() override;
};
class KMShareImageCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMShareImageCommand : public KMCommand
{
Q_OBJECT
......@@ -626,7 +629,7 @@ private:
QUrl mUrl;
};
class KMFetchMessageCommand : public KMCommand
class KMAILTESTS_TESTS_EXPORT KMFetchMessageCommand : public KMCommand
{
Q_OBJECT
public:
......
......@@ -32,7 +32,7 @@
#define KMAIL_SECONDARYWINDOW_H
#include <kxmlguiwindow.h>
#include "kmail_private_export.h"
class QCloseEvent;
namespace KMail {
......@@ -40,7 +40,7 @@ namespace KMail {
* Window class for secondary KMail window like the composer window and
* the separate message window.
*/
class SecondaryWindow : public KXmlGuiWindow
class KMAILTESTS_TESTS_EXPORT SecondaryWindow : public KXmlGuiWindow
{
Q_OBJECT
......
......@@ -22,10 +22,12 @@
#ifndef UNDOSTACK_H
#define UNDOSTACK_H
#include "kmail_private_export.h"
#include <QList>
#include <QObject>
#include <AkonadiCore/collection.h>
#include <AkonadiCore/item.h>
class KJob;
namespace KMail {
......@@ -44,7 +46,7 @@ public:
bool moveToTrash = false;
};
class UndoStack : public QObject
class KMAILTESTS_TESTS_EXPORT UndoStack : public QObject
{
Q_OBJECT
......
......@@ -41,6 +41,7 @@
#include <AkonadiCore/item.h>
#include <AkonadiCore/Collection>
#include <MailCommon/FolderSettings>
#include "kmail_private_export.h"
namespace KMail {
/**
......@@ -52,37 +53,37 @@ namespace Util {
* Returns any mailing list post addresses set on the
* parent collection (the mail folder) of the item.
*/
KMime::Types::Mailbox::List mailingListsFromMessage(const Akonadi::Item &item);
KMAILTESTS_TESTS_EXPORT KMime::Types::Mailbox::List mailingListsFromMessage(const Akonadi::Item &item);
/**
* Whether or not the mail item has the keep-reply-in-folder
* attribute set.
*/
Akonadi::Item::Id putRepliesInSameFolder(const Akonadi::Item &item);
KMAILTESTS_TESTS_EXPORT Akonadi::Item::Id putRepliesInSameFolder(const Akonadi::Item &item);
/**
* Handles a clicked URL, but only in case the viewer didn't handle it.
* Currently only support mailto.
*/
Q_REQUIRED_RESULT bool handleClickedURL(const QUrl &url, const QSharedPointer<MailCommon::FolderSettings> &folder = QSharedPointer<MailCommon::FolderSettings>(), const Akonadi::Collection &collection = Akonadi::Collection());
KMAILTESTS_TESTS_EXPORT Q_REQUIRED_RESULT bool handleClickedURL(const QUrl &url, const QSharedPointer<MailCommon::FolderSettings> &folder = QSharedPointer<MailCommon::FolderSettings>(), const Akonadi::Collection &collection = Akonadi::Collection());
Q_REQUIRED_RESULT bool mailingListsHandleURL(const QList<QUrl> &lst, const QSharedPointer<MailCommon::FolderSettings> &folder, const Akonadi::Collection &collection);
KMAILTESTS_TESTS_EXPORT Q_REQUIRED_RESULT bool mailingListsHandleURL(const QList<QUrl> &lst, const QSharedPointer<MailCommon::FolderSettings> &folder, const Akonadi::Collection &collection);
Q_REQUIRED_RESULT bool mailingListPost(const QSharedPointer<MailCommon::FolderSettings> &fd, const Akonadi::Collection &col);
Q_REQUIRED_RESULT bool mailingListSubscribe(const QSharedPointer<MailCommon::FolderSettings> &fd, const Akonadi::Collection &col);
Q_REQUIRED_RESULT bool mailingListUnsubscribe(const QSharedPointer<MailCommon::FolderSettings> &fd, const Akonadi::Collection &col);
Q_REQUIRED_RESULT bool mailingListArchives(const QSharedPointer<MailCommon::FolderSettings> &fd, const Akonadi::Collection &col);
Q_REQUIRED_RESULT bool mailingListHelp(const QSharedPointer<MailCommon::FolderSettings> &fd, const Akonadi::Collection &col);
KMAILTESTS_TESTS_EXPORT Q_REQUIRED_RESULT bool mailingListPost(const QSharedPointer<MailCommon::FolderSettings> &fd, const Akonadi::Collection &col);
KMAILTESTS_TESTS_EXPORT Q_REQUIRED_RESULT bool mailingListSubscribe(const QSharedPointer<MailCommon::FolderSettings> &fd, const Akonadi::Collection &col);
KMAILTESTS_TESTS_EXPORT Q_REQUIRED_RESULT bool mailingListUnsubscribe(const QSharedPointer<MailCommon::FolderSettings> &fd, const Akonadi::Collection &col);
KMAILTESTS_TESTS_EXPORT Q_REQUIRED_RESULT bool mailingListArchives(const QSharedPointer<MailCommon::FolderSettings> &fd, const Akonadi::Collection &col);
KMAILTESTS_TESTS_EXPORT Q_REQUIRED_RESULT bool mailingListHelp(const QSharedPointer<MailCommon::FolderSettings> &fd, const Akonadi::Collection &col);
void lastEncryptAndSignState(bool &lastEncrypt, bool &lastSign, const KMime::Message::Ptr &msg);
KMAILTESTS_TESTS_EXPORT void lastEncryptAndSignState(bool &lastEncrypt, bool &lastSign, const KMime::Message::Ptr &msg);
void addQActionHelpText(QAction *action, const QString &text);
KMAILTESTS_TESTS_EXPORT void addQActionHelpText(QAction *action, const QString &text);
/**
* Set an action's text, icon etc. as appropriate for whether a message is
* in the trash folder (delete permanently) or any other (move to trash).
*/
void setActionTrashOrDelete(QAction *action, bool isInTrashFolder);
KMAILTESTS_TESTS_EXPORT void setActionTrashOrDelete(QAction *action, bool isInTrashFolder);
}
}
......
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