From 92fc8c5b119111a35ab8423c3cbde5b2a022badf Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Sun, 2 Sep 2018 23:34:36 +0200 Subject: [PATCH] src: Mark symbols to be exported where needed Generate export headers for the Quassel modules, and mark all relevant classes and function to be exported so that shared libraries can be linked against without globally exporting all symbols. This is a hard requirement for Windows DLLs, and more efficient on other platforms, too. For now, this was done incrementally until everything linked properly. In the future, we may consider explicitly defining the public interfaces for each module, and trying to minimize the linker interface e.g. by PIMPLing. --- src/client/CMakeLists.txt | 2 +- src/client/abstractmessageprocessor.h | 10 ++- src/client/abstractui.h | 11 ++- src/client/buffermodel.h | 10 ++- src/client/buffersettings.h | 8 +-- src/client/bufferviewoverlay.h | 10 ++- src/client/client.h | 4 +- src/client/clientaliasmanager.h | 4 +- src/client/clientbacklogmanager.h | 4 +- src/client/clientbufferviewconfig.h | 4 +- src/client/clientbufferviewmanager.h | 4 +- src/client/clientidentity.h | 5 +- src/client/clientignorelistmanager.h | 4 +- src/client/clientsettings.h | 20 +++--- src/client/coreaccount.h | 10 +-- src/client/coreaccountmodel.h | 10 ++- src/client/coreconnection.h | 4 +- src/client/irclistmodel.h | 10 ++- src/client/messagefilter.h | 10 ++- src/client/messagemodel.h | 11 ++- src/client/networkmodel.h | 12 ++-- src/client/selectionmodelsynchronizer.h | 10 ++- src/client/treemodel.h | 16 ++--- src/common/CMakeLists.txt | 2 +- src/common/aliasmanager.h | 4 +- src/common/authhandler.h | 9 ++- src/common/backlogmanager.h | 4 +- src/common/basichandler.h | 10 ++- src/common/bufferinfo.h | 9 ++- src/common/buffersyncer.h | 4 +- src/common/bufferviewconfig.h | 4 +- src/common/bufferviewmanager.h | 4 +- src/common/coreinfo.h | 4 +- src/common/ctcpevent.h | 10 ++- src/common/dccconfig.h | 4 +- src/common/deferredptr.h | 2 + src/common/event.h | 17 ++--- src/common/eventmanager.h | 9 ++- src/common/expressionmatch.h | 4 +- src/common/highlightrulemanager.h | 6 +- src/common/identity.h | 6 +- src/common/ignorelistmanager.h | 7 +- src/common/internalpeer.h | 4 +- src/common/ircchannel.h | 4 +- src/common/ircevent.h | 14 ++-- src/common/irclisthelper.h | 4 +- src/common/ircuser.h | 4 +- src/common/logger.h | 4 +- src/common/logmessage.h | 4 +- src/common/message.h | 9 ++- src/common/messageevent.h | 10 ++- src/common/network.h | 18 ++--- src/common/networkconfig.h | 4 +- src/common/networkevent.h | 14 ++-- src/common/nickhighlightmatcher.h | 4 +- src/common/peer.h | 4 +- src/common/peerfactory.h | 9 ++- src/common/presetnetworks.h | 9 ++- src/common/quassel.h | 6 +- src/common/remotepeer.h | 9 ++- src/common/settings.h | 12 ++-- src/common/signalproxy.h | 4 +- src/common/singleton.h | 78 +++++++++++++-------- src/common/syncableobject.h | 4 +- src/common/transfer.h | 4 +- src/common/transfermanager.h | 4 +- src/common/util.h | 32 +++++---- src/core/CMakeLists.txt | 2 +- src/core/core.h | 4 +- src/core/coreapplication.h | 4 +- src/qtui/CMakeLists.txt | 2 +- src/qtui/bufferwidget.h | 6 +- src/qtui/qtuiapplication.h | 4 +- src/uisupport/CMakeLists.txt | 2 +- src/uisupport/aboutdata.h | 6 +- src/uisupport/abstractbuffercontainer.h | 10 ++- src/uisupport/abstractitemview.h | 10 ++- src/uisupport/abstractnotificationbackend.h | 10 ++- src/uisupport/action.h | 4 +- src/uisupport/actioncollection.h | 4 +- src/uisupport/bufferhotlistfilter.h | 10 ++- src/uisupport/bufferview.h | 12 ++-- src/uisupport/bufferviewfilter.h | 9 ++- src/uisupport/bufferviewoverlayfilter.h | 10 ++- src/uisupport/clearablelineedit.h | 10 ++- src/uisupport/clickable.h | 6 +- src/uisupport/clickablelabel.h | 10 ++- src/uisupport/colorbutton.h | 15 ++-- src/uisupport/contextmenuactionprovider.h | 10 ++- src/uisupport/flatproxymodel.h | 10 ++- src/uisupport/fontselector.h | 10 ++- src/uisupport/graphicalui.h | 9 ++- src/uisupport/icon.h | 6 +- src/uisupport/multilineedit.h | 10 ++- src/uisupport/networkmodelcontroller.h | 9 ++- src/uisupport/nickview.h | 10 ++- src/uisupport/nickviewfilter.h | 10 ++- src/uisupport/resizingstackedwidget.h | 10 ++- src/uisupport/settingspage.h | 10 ++- src/uisupport/styledlabel.h | 10 ++- src/uisupport/tabcompleter.h | 10 ++- src/uisupport/toolbaractionprovider.h | 10 ++- src/uisupport/treeviewtouch.h | 4 +- src/uisupport/uisettings.h | 16 ++--- src/uisupport/uistyle.h | 40 ++++++----- 105 files changed, 469 insertions(+), 459 deletions(-) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 16455385..75464431 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -1,4 +1,4 @@ -quassel_add_module(Client) +quassel_add_module(Client EXPORT) target_sources(${TARGET} PRIVATE abstractmessageprocessor.cpp diff --git a/src/client/abstractmessageprocessor.h b/src/client/abstractmessageprocessor.h index 4ed31f40..1ac52fb0 100644 --- a/src/client/abstractmessageprocessor.h +++ b/src/client/abstractmessageprocessor.h @@ -18,14 +18,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef ABSTRACTMESSAGEPROCESSOR_H_ -#define ABSTRACTMESSAGEPROCESSOR_H_ +#pragma once + +#include "client-export.h" #include "client.h" #include "message.h" #include "networkmodel.h" -class AbstractMessageProcessor : public QObject +class CLIENT_EXPORT AbstractMessageProcessor : public QObject { Q_OBJECT @@ -43,6 +44,3 @@ protected: // is called before inserting the message into the model inline void preProcess(Message &msg) { Client::networkModel()->updateBufferActivity(msg); } }; - - -#endif diff --git a/src/client/abstractui.h b/src/client/abstractui.h index a2657feb..44467fc5 100644 --- a/src/client/abstractui.h +++ b/src/client/abstractui.h @@ -18,12 +18,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef ABSTRACTUI_H -#define ABSTRACTUI_H +#pragma once + +#include "client-export.h" #include #include -//#include "message.h" class MessageFilter; class MessageModel; @@ -33,7 +33,7 @@ class AbstractActionProvider; class QAction; class QMenu; -class AbstractUi : public QObject +class CLIENT_EXPORT AbstractUi : public QObject { Q_OBJECT @@ -52,6 +52,3 @@ signals: void connectToCore(const QVariantMap &connInfo); void disconnectFromCore(); }; - - -#endif diff --git a/src/client/buffermodel.h b/src/client/buffermodel.h index b4ec9ba2..a8fada2f 100644 --- a/src/client/buffermodel.h +++ b/src/client/buffermodel.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef BUFFERMODEL_H -#define BUFFERMODEL_H +#pragma once + +#include "client-export.h" #include #include @@ -32,7 +33,7 @@ class QAbstractItemView; -class BufferModel : public QSortFilterProxyModel +class CLIENT_EXPORT BufferModel : public QSortFilterProxyModel { Q_OBJECT @@ -75,6 +76,3 @@ private: SelectionModelSynchronizer _selectionModelSynchronizer; QPair _bufferToSwitchTo; }; - - -#endif // BUFFERMODEL_H diff --git a/src/client/buffersettings.h b/src/client/buffersettings.h index 7dd3a2d1..1d0e3726 100644 --- a/src/client/buffersettings.h +++ b/src/client/buffersettings.h @@ -18,14 +18,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef BUFFERSETTINGS_H -#define BUFFERSETTINGS_H +#include "client-export.h" #include "clientsettings.h" #include "message.h" #include "types.h" -class BufferSettings : public ClientSettings +class CLIENT_EXPORT BufferSettings : public ClientSettings { public: enum RedirectTarget { @@ -59,6 +58,3 @@ public: inline int errorMsgsTarget() { return localValue("ErrorMsgsTarget", DefaultBuffer).toInt(); } inline void setErrorMsgsTarget(int target) { setLocalValue("ErrorMsgsTarget", target); } }; - - -#endif diff --git a/src/client/bufferviewoverlay.h b/src/client/bufferviewoverlay.h index 38dad733..24e1101b 100644 --- a/src/client/bufferviewoverlay.h +++ b/src/client/bufferviewoverlay.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef BUFFERVIEWOVERLAY_H -#define BUFFERVIEWOVERLAY_H +#pragma once + +#include "client-export.h" #include @@ -28,7 +29,7 @@ class BufferViewConfig; class ClientBufferViewConfig; -class BufferViewOverlay : public QObject +class CLIENT_EXPORT BufferViewOverlay : public QObject { Q_OBJECT @@ -89,6 +90,3 @@ private: static const int _updateEventId; }; - - -#endif //BUFFERVIEWOVERLAY_H diff --git a/src/client/client.h b/src/client/client.h index ef37ad53..7642c3e6 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -20,6 +20,8 @@ #pragma once +#include "client-export.h" + #include #include @@ -66,7 +68,7 @@ class TransferModel; struct NetworkInfo; -class Client : public QObject, public Singleton +class CLIENT_EXPORT Client : public QObject, public Singleton { Q_OBJECT diff --git a/src/client/clientaliasmanager.h b/src/client/clientaliasmanager.h index 9fcb7681..2f0eda43 100644 --- a/src/client/clientaliasmanager.h +++ b/src/client/clientaliasmanager.h @@ -20,9 +20,11 @@ #pragma once +#include "client-export.h" + #include "aliasmanager.h" -class ClientAliasManager : public AliasManager +class CLIENT_EXPORT ClientAliasManager : public AliasManager { Q_OBJECT diff --git a/src/client/clientbacklogmanager.h b/src/client/clientbacklogmanager.h index cce66f01..77ae36f1 100644 --- a/src/client/clientbacklogmanager.h +++ b/src/client/clientbacklogmanager.h @@ -20,12 +20,14 @@ #pragma once +#include "client-export.h" + #include "backlogmanager.h" #include "message.h" class BacklogRequester; -class ClientBacklogManager : public BacklogManager +class CLIENT_EXPORT ClientBacklogManager : public BacklogManager { Q_OBJECT diff --git a/src/client/clientbufferviewconfig.h b/src/client/clientbufferviewconfig.h index 44ee2114..5c7d8b7f 100644 --- a/src/client/clientbufferviewconfig.h +++ b/src/client/clientbufferviewconfig.h @@ -20,9 +20,11 @@ #pragma once +#include "client-export.h" + #include "bufferviewconfig.h" -class ClientBufferViewConfig : public BufferViewConfig +class CLIENT_EXPORT ClientBufferViewConfig : public BufferViewConfig { Q_OBJECT diff --git a/src/client/clientbufferviewmanager.h b/src/client/clientbufferviewmanager.h index 6f26710d..c44b7201 100644 --- a/src/client/clientbufferviewmanager.h +++ b/src/client/clientbufferviewmanager.h @@ -20,12 +20,14 @@ #pragma once +#include "client-export.h" + #include "bufferviewmanager.h" class ClientBufferViewConfig; class BufferViewOverlay; -class ClientBufferViewManager : public BufferViewManager +class CLIENT_EXPORT ClientBufferViewManager : public BufferViewManager { Q_OBJECT diff --git a/src/client/clientidentity.h b/src/client/clientidentity.h index 9f6fdc07..2ff4cb83 100644 --- a/src/client/clientidentity.h +++ b/src/client/clientidentity.h @@ -20,11 +20,13 @@ #pragma once +#include "client-export.h" + #include "identity.h" class ClientCertManager; -class CertIdentity : public Identity +class CLIENT_EXPORT CertIdentity : public Identity { Q_OBJECT @@ -69,6 +71,7 @@ private: // ClientCertManager // ======================================== #ifdef HAVE_SSL + class ClientCertManager : public CertManager { Q_OBJECT diff --git a/src/client/clientignorelistmanager.h b/src/client/clientignorelistmanager.h index 29cd51f3..36c1b47f 100644 --- a/src/client/clientignorelistmanager.h +++ b/src/client/clientignorelistmanager.h @@ -20,10 +20,12 @@ #pragma once +#include "client-export.h" + #include "ignorelistmanager.h" #include -class ClientIgnoreListManager : public IgnoreListManager +class CLIENT_EXPORT ClientIgnoreListManager : public IgnoreListManager { Q_OBJECT diff --git a/src/client/clientsettings.h b/src/client/clientsettings.h index 16a4681c..54df34b0 100644 --- a/src/client/clientsettings.h +++ b/src/client/clientsettings.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef CLIENTSETTINGS_H -#define CLIENTSETTINGS_H +#pragma once + +#include "client-export.h" #include "settings.h" @@ -28,7 +29,7 @@ class QHostAddress; class QSslSocket; -class ClientSettings : public Settings +class CLIENT_EXPORT ClientSettings : public Settings { public: virtual ~ClientSettings(); @@ -49,7 +50,7 @@ protected: // // Note that you'll get invalid data (and setting is ignored) if you are not connected to a core! -class CoreAccountSettings : public ClientSettings +class CLIENT_EXPORT CoreAccountSettings : public ClientSettings { public: // stores account-specific data in CoreAccounts/$ACCID/$SUBGROUP/$KEY) @@ -90,7 +91,7 @@ private: // ======================================== // NotificationSettings // ======================================== -class NotificationSettings : public ClientSettings +class CLIENT_EXPORT NotificationSettings : public ClientSettings { public: enum HighlightNickType { @@ -120,7 +121,7 @@ public: // CoreConnectionSettings // ======================================== -class CoreConnectionSettings : public ClientSettings +class CLIENT_EXPORT CoreConnectionSettings : public ClientSettings { public: enum NetworkDetectionMode { @@ -149,7 +150,7 @@ public: // TabCompletionSettings // ======================================== -class TabCompletionSettings : public ClientSettings +class CLIENT_EXPORT TabCompletionSettings : public ClientSettings { public: enum SortMode { @@ -179,7 +180,7 @@ public: // ======================================== // ItemViewSettings // ======================================== -class ItemViewSettings : public ClientSettings +class CLIENT_EXPORT ItemViewSettings : public ClientSettings { public: ItemViewSettings(const QString &group = "ItemViews"); @@ -187,6 +188,3 @@ public: bool displayTopicInTooltip(); bool mouseWheelChangesBuffer(); }; - - -#endif diff --git a/src/client/coreaccount.h b/src/client/coreaccount.h index d8acb428..d4aed0f3 100644 --- a/src/client/coreaccount.h +++ b/src/client/coreaccount.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef COREACCOUNT_H_ -#define COREACCOUNT_H_ +#pragma once + +#include "client-export.h" #include #include @@ -28,7 +29,8 @@ #include #include "types.h" -class CoreAccount + +class CLIENT_EXPORT CoreAccount { Q_DECLARE_TR_FUNCTIONS(CoreAccount) @@ -95,5 +97,3 @@ private: }; QDebug operator<<(QDebug dbg, const CoreAccount &msg); - -#endif diff --git a/src/client/coreaccountmodel.h b/src/client/coreaccountmodel.h index 9814d08b..5b224b45 100644 --- a/src/client/coreaccountmodel.h +++ b/src/client/coreaccountmodel.h @@ -18,15 +18,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef COREACCOUNTMODEL_H_ -#define COREACCOUNTMODEL_H_ +#pragma once + +#include "client-export.h" #include #include #include "coreaccount.h" -class CoreAccountModel : public QAbstractListModel +class CLIENT_EXPORT CoreAccountModel : public QAbstractListModel { Q_OBJECT @@ -88,6 +89,3 @@ AccountId CoreAccountModel::internalAccount() const { return _internalAccount; } - - -#endif diff --git a/src/client/coreconnection.h b/src/client/coreconnection.h index 69b4c9e5..7951a499 100644 --- a/src/client/coreconnection.h +++ b/src/client/coreconnection.h @@ -20,6 +20,8 @@ #pragma once +#include "client-export.h" + #include #include #include @@ -41,7 +43,7 @@ class Network; class Peer; class SignalProxy; -class CoreConnection : public QObject +class CLIENT_EXPORT CoreConnection : public QObject { Q_OBJECT diff --git a/src/client/irclistmodel.h b/src/client/irclistmodel.h index 939789e2..8c522314 100644 --- a/src/client/irclistmodel.h +++ b/src/client/irclistmodel.h @@ -18,14 +18,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef IRCLISTMODEL_H -#define IRCLISTMODEL_H +#pragma once + +#include "client-export.h" #include "irclisthelper.h" #include -class IrcListModel : public QAbstractItemModel +class CLIENT_EXPORT IrcListModel : public QAbstractItemModel { Q_OBJECT @@ -50,6 +51,3 @@ public slots: private: QList _channelList; }; - - -#endif //IRCLISTMODEL_H diff --git a/src/client/messagefilter.h b/src/client/messagefilter.h index 61091f14..c7bd3d1d 100644 --- a/src/client/messagefilter.h +++ b/src/client/messagefilter.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef MESSAGEFILTER_H_ -#define MESSAGEFILTER_H_ +#pragma once + +#include "client-export.h" #include #include @@ -30,7 +31,7 @@ #include "networkmodel.h" #include "types.h" -class MessageFilter : public QSortFilterProxyModel +class CLIENT_EXPORT MessageFilter : public QSortFilterProxyModel { Q_OBJECT @@ -72,6 +73,3 @@ private: int _serverNoticesTarget; int _errorMsgsTarget; }; - - -#endif diff --git a/src/client/messagemodel.h b/src/client/messagemodel.h index e26455d5..9fd7ea65 100644 --- a/src/client/messagemodel.h +++ b/src/client/messagemodel.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef MESSAGEMODEL_H_ -#define MESSAGEMODEL_H_ +#pragma once + +#include "client-export.h" #include #include @@ -31,7 +32,7 @@ class MessageModelItem; struct MsgId; -class MessageModel : public QAbstractItemModel +class CLIENT_EXPORT MessageModel : public QAbstractItemModel { Q_OBJECT @@ -134,7 +135,7 @@ QModelIndex MessageModel::index(int row, int column, const QModelIndex &parent) // ************************************************** // MessageModelItem // ************************************************** -class MessageModelItem +class CLIENT_EXPORT MessageModelItem { public: //! Creates a MessageModelItem from a Message object. @@ -168,5 +169,3 @@ private: QDebug operator<<(QDebug dbg, const MessageModelItem &msgItem); - -#endif diff --git a/src/client/networkmodel.h b/src/client/networkmodel.h index a97372e8..7f73b76a 100644 --- a/src/client/networkmodel.h +++ b/src/client/networkmodel.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef NETWORKMODEL_H -#define NETWORKMODEL_H +#pragma once + +#include "client-export.h" #include "bufferinfo.h" #include "clientsettings.h" @@ -250,7 +251,8 @@ private: * User Category Items (like @vh etc.) *****************************************/ class IrcUserItem; -class UserCategoryItem : public PropertyMapItem + +class CLIENT_EXPORT UserCategoryItem : public PropertyMapItem { Q_OBJECT Q_PROPERTY(QString categoryName READ categoryName) @@ -315,7 +317,7 @@ private: /***************************************** * NetworkModel *****************************************/ -class NetworkModel : public TreeModel +class CLIENT_EXPORT NetworkModel : public TreeModel { Q_OBJECT @@ -427,5 +429,3 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(NetworkModel::ItemTypes) - -#endif // NETWORKMODEL_H diff --git a/src/client/selectionmodelsynchronizer.h b/src/client/selectionmodelsynchronizer.h index 17bca3a5..b3d1214d 100644 --- a/src/client/selectionmodelsynchronizer.h +++ b/src/client/selectionmodelsynchronizer.h @@ -18,15 +18,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef _SELECTIONMODELSYNCHRONIZER_H_ -#define _SELECTIONMODELSYNCHRONIZER_H_ +#pragma once + +#include "client-export.h" #include #include class QAbstractItemModel; -class SelectionModelSynchronizer : public QObject +class CLIENT_EXPORT SelectionModelSynchronizer : public QObject { Q_OBJECT @@ -67,6 +68,3 @@ private: QSet _selectionModels; }; - - -#endif diff --git a/src/client/treemodel.h b/src/client/treemodel.h index 92bf7676..716e07c9 100644 --- a/src/client/treemodel.h +++ b/src/client/treemodel.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef TREEMODEL_H -#define TREEMODEL_H +#pragma once + +#include "client-export.h" #include #include @@ -31,7 +32,7 @@ /***************************************** * general item used in the Tree Model *****************************************/ -class AbstractTreeItem : public QObject +class CLIENT_EXPORT AbstractTreeItem : public QObject { Q_OBJECT @@ -100,7 +101,7 @@ private: /***************************************** * SimpleTreeItem *****************************************/ -class SimpleTreeItem : public AbstractTreeItem +class CLIENT_EXPORT SimpleTreeItem : public AbstractTreeItem { Q_OBJECT @@ -121,7 +122,7 @@ private: /***************************************** * PropertyMapItem *****************************************/ -class PropertyMapItem : public AbstractTreeItem +class CLIENT_EXPORT PropertyMapItem : public AbstractTreeItem { Q_OBJECT @@ -141,7 +142,7 @@ public: /***************************************** * TreeModel *****************************************/ -class TreeModel : public QAbstractItemModel +class CLIENT_EXPORT TreeModel : public QAbstractItemModel { Q_OBJECT @@ -204,6 +205,3 @@ private slots: void debug_rowsRemoved(const QModelIndex &parent, int start, int end); void debug_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); }; - - -#endif diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 2069a35b..1683d266 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -1,4 +1,4 @@ -quassel_add_module(Common) +quassel_add_module(Common EXPORT) target_sources(${TARGET} PRIVATE abstractsignalwatcher.h diff --git a/src/common/aliasmanager.h b/src/common/aliasmanager.h index 0a937895..aaac54d3 100644 --- a/src/common/aliasmanager.h +++ b/src/common/aliasmanager.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include "bufferinfo.h" @@ -27,7 +29,7 @@ class Network; -class AliasManager : public SyncableObject +class COMMON_EXPORT AliasManager : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/authhandler.h b/src/common/authhandler.h index 0f3c7881..7fb91277 100644 --- a/src/common/authhandler.h +++ b/src/common/authhandler.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef AUTHHANDLER_H -#define AUTHHANDLER_H +#pragma once + +#include "common-export.h" #include @@ -27,7 +28,7 @@ class Peer; -class AuthHandler : public QObject +class COMMON_EXPORT AuthHandler : public QObject { Q_OBJECT @@ -73,5 +74,3 @@ private: QTcpSocket *_socket; // FIXME: should be a QSharedPointer? -> premature disconnect before the peer has taken over bool _disconnectedSent; }; - -#endif diff --git a/src/common/backlogmanager.h b/src/common/backlogmanager.h index ecee40d0..e64f45a7 100644 --- a/src/common/backlogmanager.h +++ b/src/common/backlogmanager.h @@ -20,10 +20,12 @@ #pragma once +#include "common-export.h" + #include "syncableobject.h" #include "types.h" -class BacklogManager : public SyncableObject +class COMMON_EXPORT BacklogManager : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/basichandler.h b/src/common/basichandler.h index 4a168f63..e48d6058 100644 --- a/src/common/basichandler.h +++ b/src/common/basichandler.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef BASICHANDLER_H -#define BASICHANDLER_H +#pragma once + +#include "common-export.h" #include #include @@ -27,7 +28,7 @@ #include #include -class BasicHandler : public QObject +class COMMON_EXPORT BasicHandler : public QObject { Q_OBJECT @@ -51,6 +52,3 @@ private: bool _initDone; QString _methodPrefix; }; - - -#endif diff --git a/src/common/bufferinfo.h b/src/common/bufferinfo.h index 3631d961..6e77e636 100644 --- a/src/common/bufferinfo.h +++ b/src/common/bufferinfo.h @@ -18,15 +18,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef BUFFERINFO_H -#define BUFFERINFO_H +#pragma once + +#include "common-export.h" #include "types.h" class QString; class QDataStream; -class BufferInfo +class COMMON_EXPORT BufferInfo { public: enum Type { @@ -84,5 +85,3 @@ Q_DECLARE_METATYPE(BufferInfo) Q_DECLARE_OPERATORS_FOR_FLAGS(BufferInfo::ActivityLevel) uint qHash(const BufferInfo &); - -#endif diff --git a/src/common/buffersyncer.h b/src/common/buffersyncer.h index 5d4f3837..6db6f9c8 100644 --- a/src/common/buffersyncer.h +++ b/src/common/buffersyncer.h @@ -20,11 +20,13 @@ #pragma once +#include "common-export.h" + #include "syncableobject.h" #include "types.h" #include "message.h" -class BufferSyncer : public SyncableObject +class COMMON_EXPORT BufferSyncer : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/bufferviewconfig.h b/src/common/bufferviewconfig.h index d2542e73..03debf80 100644 --- a/src/common/bufferviewconfig.h +++ b/src/common/bufferviewconfig.h @@ -20,12 +20,14 @@ #pragma once +#include "common-export.h" + #include "syncableobject.h" #include "bufferinfo.h" #include "types.h" -class BufferViewConfig : public SyncableObject +class COMMON_EXPORT BufferViewConfig : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/bufferviewmanager.h b/src/common/bufferviewmanager.h index 4e41e98d..0a4f280b 100644 --- a/src/common/bufferviewmanager.h +++ b/src/common/bufferviewmanager.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include "syncableobject.h" #include @@ -28,7 +30,7 @@ class BufferViewConfig; class SignalProxy; -class BufferViewManager : public SyncableObject +class COMMON_EXPORT BufferViewManager : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/coreinfo.h b/src/common/coreinfo.h index 284336cb..17db3cb1 100644 --- a/src/common/coreinfo.h +++ b/src/common/coreinfo.h @@ -20,13 +20,15 @@ #pragma once +#include "common-export.h" + #include "syncableobject.h" /* * gather various information about the core. */ -class CoreInfo : public SyncableObject +class COMMON_EXPORT CoreInfo : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/ctcpevent.h b/src/common/ctcpevent.h index 73bcc4b5..1f0635ba 100644 --- a/src/common/ctcpevent.h +++ b/src/common/ctcpevent.h @@ -18,14 +18,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef CTCPEVENT_H -#define CTCPEVENT_H +#pragma once + +#include "common-export.h" #include "ircevent.h" #include -class CtcpEvent : public IrcEvent +class COMMON_EXPORT CtcpEvent : public IrcEvent { public: enum CtcpType { @@ -90,6 +91,3 @@ private: QString _target, _param, _reply; QUuid _uuid; }; - - -#endif diff --git a/src/common/dccconfig.h b/src/common/dccconfig.h index c82830ac..f919dcc9 100644 --- a/src/common/dccconfig.h +++ b/src/common/dccconfig.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include "syncableobject.h" @@ -30,7 +32,7 @@ * @warning Equality and assignment operators are optimized for use in a settings page * and do not cover all attributes! */ -class DccConfig : public SyncableObject +class COMMON_EXPORT DccConfig : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/deferredptr.h b/src/common/deferredptr.h index e04fb976..8e02db88 100644 --- a/src/common/deferredptr.h +++ b/src/common/deferredptr.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include diff --git a/src/common/event.h b/src/common/event.h index 7ad2ad40..10bfdab2 100644 --- a/src/common/event.h +++ b/src/common/event.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef EVENT_H -#define EVENT_H +#pragma once + +#include "common-export.h" #include #include @@ -28,7 +29,7 @@ class Network; -class Event +class COMMON_EXPORT Event { public: explicit Event(EventManager::EventType type = EventManager::Invalid); @@ -71,15 +72,9 @@ private: EventManager::EventType _type; EventManager::EventFlags _flags; QDateTime _timestamp; - //QVariant _data; bool _valid; - friend QDebug operator<<(QDebug dbg, Event *e); + friend COMMON_EXPORT QDebug operator<<(QDebug dbg, Event *e); }; - -QDebug operator<<(QDebug dbg, Event *e); - -/*******/ - -#endif +COMMON_EXPORT QDebug operator<<(QDebug dbg, Event *e); diff --git a/src/common/eventmanager.h b/src/common/eventmanager.h index d74e2362..246c58a7 100644 --- a/src/common/eventmanager.h +++ b/src/common/eventmanager.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef EVENTMANAGER_H -#define EVENTMANAGER_H +#pragma once + +#include "common-export.h" #include @@ -28,7 +29,7 @@ class Event; class Network; -class EventManager : public QObject +class COMMON_EXPORT EventManager : public QObject { Q_OBJECT Q_FLAGS(EventFlag EventFlags) @@ -196,5 +197,3 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(EventManager::EventFlags) - -#endif diff --git a/src/common/expressionmatch.h b/src/common/expressionmatch.h index 27127786..a22b34bf 100644 --- a/src/common/expressionmatch.h +++ b/src/common/expressionmatch.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include #include @@ -27,7 +29,7 @@ /** * Expression matcher with multiple modes of operation and automatic caching for performance */ -class ExpressionMatch +class COMMON_EXPORT ExpressionMatch { public: diff --git a/src/common/highlightrulemanager.h b/src/common/highlightrulemanager.h index d8d8859a..addbbf66 100644 --- a/src/common/highlightrulemanager.h +++ b/src/common/highlightrulemanager.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include @@ -32,7 +34,7 @@ #include "nickhighlightmatcher.h" #include "syncableobject.h" -class HighlightRuleManager : public SyncableObject +class COMMON_EXPORT HighlightRuleManager : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT @@ -53,7 +55,7 @@ public: /** * Individual highlight rule */ - class HighlightRule + class COMMON_EXPORT HighlightRule { public: /** diff --git a/src/common/identity.h b/src/common/identity.h index 4c5de2c2..7cbd193a 100644 --- a/src/common/identity.h +++ b/src/common/identity.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include #include @@ -29,7 +31,7 @@ #include "types.h" #include "syncableobject.h" -class Identity : public SyncableObject +class COMMON_EXPORT Identity : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT @@ -163,7 +165,7 @@ Q_DECLARE_METATYPE(Identity) #include #include -class CertManager : public SyncableObject +class COMMON_EXPORT CertManager : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/ignorelistmanager.h b/src/common/ignorelistmanager.h index 3a3844fc..3f73eb6f 100644 --- a/src/common/ignorelistmanager.h +++ b/src/common/ignorelistmanager.h @@ -20,7 +20,8 @@ #pragma once -#include +#include "common-export.h" + #include #include #include @@ -29,7 +30,7 @@ #include "message.h" #include "syncableobject.h" -class IgnoreListManager : public SyncableObject +class COMMON_EXPORT IgnoreListManager : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT @@ -59,7 +60,7 @@ public: /** * Individual ignore list rule */ - class IgnoreListItem { + class COMMON_EXPORT IgnoreListItem { public: /** * Construct an empty ignore rule diff --git a/src/common/internalpeer.h b/src/common/internalpeer.h index a94802d2..62e070d9 100644 --- a/src/common/internalpeer.h +++ b/src/common/internalpeer.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include @@ -27,7 +29,7 @@ #include "protocol.h" #include "signalproxy.h" -class InternalPeer : public Peer +class COMMON_EXPORT InternalPeer : public Peer { Q_OBJECT diff --git a/src/common/ircchannel.h b/src/common/ircchannel.h index 68c36836..7275cd67 100644 --- a/src/common/ircchannel.h +++ b/src/common/ircchannel.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include #include @@ -31,7 +33,7 @@ class IrcUser; class Network; -class IrcChannel : public SyncableObject +class COMMON_EXPORT IrcChannel : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/ircevent.h b/src/common/ircevent.h index 1747ac61..e5a2313d 100644 --- a/src/common/ircevent.h +++ b/src/common/ircevent.h @@ -18,13 +18,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef IRCEVENT_H -#define IRCEVENT_H +#pragma once + +#include "common-export.h" #include "networkevent.h" #include "util.h" -class IrcEvent : public NetworkEvent +class COMMON_EXPORT IrcEvent : public NetworkEvent { public: explicit IrcEvent(EventManager::EventType type, Network *network, const QString &prefix, const QStringList ¶ms = QStringList()) @@ -62,7 +63,7 @@ private: }; -class IrcEventNumeric : public IrcEvent +class COMMON_EXPORT IrcEventNumeric : public IrcEvent { public: explicit IrcEventNumeric(uint number, Network *network, const QString &prefix, const QString &target, const QStringList ¶ms = QStringList()) @@ -99,7 +100,7 @@ private: }; -class IrcEventRawMessage : public IrcEvent +class COMMON_EXPORT IrcEventRawMessage : public IrcEvent { public: explicit inline IrcEventRawMessage(EventManager::EventType type, Network *network, @@ -137,6 +138,3 @@ private: friend class IrcEvent; }; - - -#endif diff --git a/src/common/irclisthelper.h b/src/common/irclisthelper.h index 037daf75..00128a31 100644 --- a/src/common/irclisthelper.h +++ b/src/common/irclisthelper.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include "syncableobject.h" #include "types.h" @@ -31,7 +33,7 @@ * when RPL_LISTEND is received the clients will be informed, that they can pull the data * 3.) client pulls the data by calling requestChannelList again. receiving the data in receiveChannelList */ -class IrcListHelper : public SyncableObject +class COMMON_EXPORT IrcListHelper : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/ircuser.h b/src/common/ircuser.h index 4162a855..0b230eba 100644 --- a/src/common/ircuser.h +++ b/src/common/ircuser.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include #include @@ -33,7 +35,7 @@ class SignalProxy; class Network; class IrcChannel; -class IrcUser : public SyncableObject +class COMMON_EXPORT IrcUser : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/logger.h b/src/common/logger.h index e6701fe0..9d80305b 100644 --- a/src/common/logger.h +++ b/src/common/logger.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include @@ -31,7 +33,7 @@ /** * The Logger class encapsulates the various configured logging backends. */ -class Logger : public QObject +class COMMON_EXPORT Logger : public QObject { Q_OBJECT diff --git a/src/common/logmessage.h b/src/common/logmessage.h index e1e908f5..bd9acc6d 100644 --- a/src/common/logmessage.h +++ b/src/common/logmessage.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include @@ -31,7 +33,7 @@ * * Very similar in concept to qDebug() and friends. */ -class LogMessage +class COMMON_EXPORT LogMessage { public: LogMessage(Logger::LogLevel level); diff --git a/src/common/message.h b/src/common/message.h index 45a8286f..1088b09d 100644 --- a/src/common/message.h +++ b/src/common/message.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef MESSAGE_H_ -#define MESSAGE_H_ +#pragma once + +#include "common-export.h" #include #include @@ -27,7 +28,7 @@ #include "bufferinfo.h" #include "types.h" -class Message +class COMMON_EXPORT Message { Q_DECLARE_TR_FUNCTIONS(Message) @@ -120,5 +121,3 @@ QDebug operator<<(QDebug dbg, const Message &msg); Q_DECLARE_METATYPE(Message) Q_DECLARE_OPERATORS_FOR_FLAGS(Message::Types) Q_DECLARE_OPERATORS_FOR_FLAGS(Message::Flags) - -#endif diff --git a/src/common/messageevent.h b/src/common/messageevent.h index 8c1e396f..dfe81d0d 100644 --- a/src/common/messageevent.h +++ b/src/common/messageevent.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef MESSAGEEVENT_H -#define MESSAGEEVENT_H +#pragma once + +#include "common-export.h" #include "message.h" #include "networkevent.h" @@ -27,7 +28,7 @@ // this corresponds to CoreSession::RawMessage for now and should contain the information we need to convert events // into messages for the legacy code to work with -class MessageEvent : public NetworkEvent +class COMMON_EXPORT MessageEvent : public NetworkEvent { public: explicit MessageEvent(Message::Type msgType, @@ -80,6 +81,3 @@ private: QString _text, _sender, _target; Message::Flags _msgFlags; }; - - -#endif diff --git a/src/common/network.h b/src/common/network.h index 80e46863..410931fd 100644 --- a/src/common/network.h +++ b/src/common/network.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include #include @@ -46,7 +48,7 @@ struct NetworkInfo; // TODO: ConnectionInfo to propagate and sync the current state of NetworkConnection, encodings etcpp -class Network : public SyncableObject +class COMMON_EXPORT Network : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT @@ -758,7 +760,7 @@ private: //! Stores all editable information about a network (as opposed to runtime state). -struct NetworkInfo +struct COMMON_EXPORT NetworkInfo { QString networkName; @@ -798,12 +800,12 @@ public: bool operator!=(const NetworkInfo &other) const; }; -QDataStream &operator<<(QDataStream &out, const NetworkInfo &info); -QDataStream &operator>>(QDataStream &in, NetworkInfo &info); -QDebug operator<<(QDebug dbg, const NetworkInfo &i); +COMMON_EXPORT QDataStream &operator<<(QDataStream &out, const NetworkInfo &info); +COMMON_EXPORT QDataStream &operator>>(QDataStream &in, NetworkInfo &info); +COMMON_EXPORT QDebug operator<<(QDebug dbg, const NetworkInfo &i); Q_DECLARE_METATYPE(NetworkInfo) -QDataStream &operator<<(QDataStream &out, const Network::Server &server); -QDataStream &operator>>(QDataStream &in, Network::Server &server); -QDebug operator<<(QDebug dbg, const Network::Server &server); +COMMON_EXPORT QDataStream &operator<<(QDataStream &out, const Network::Server &server); +COMMON_EXPORT QDataStream &operator>>(QDataStream &in, Network::Server &server); +COMMON_EXPORT QDebug operator<<(QDebug dbg, const Network::Server &server); Q_DECLARE_METATYPE(Network::Server) diff --git a/src/common/networkconfig.h b/src/common/networkconfig.h index 5f234f55..85d1f561 100644 --- a/src/common/networkconfig.h +++ b/src/common/networkconfig.h @@ -20,9 +20,11 @@ #pragma once +#include "common-export.h" + #include "syncableobject.h" -class NetworkConfig : public SyncableObject +class COMMON_EXPORT NetworkConfig : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/networkevent.h b/src/common/networkevent.h index 961aa6b6..fcae0b45 100644 --- a/src/common/networkevent.h +++ b/src/common/networkevent.h @@ -18,8 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef NETWORKEVENT_H -#define NETWORKEVENT_H +#pragma once #include #include @@ -27,7 +26,7 @@ #include "event.h" #include "network.h" -class NetworkEvent : public Event +class COMMON_EXPORT NetworkEvent : public Event { public: explicit NetworkEvent(EventManager::EventType type, Network *network) @@ -54,7 +53,7 @@ private: /*****************************************************************************/ -class NetworkConnectionEvent : public NetworkEvent +class COMMON_EXPORT NetworkConnectionEvent : public NetworkEvent { public: explicit NetworkConnectionEvent(EventManager::EventType type, Network *network, Network::ConnectionState state) @@ -84,7 +83,7 @@ private: }; -class NetworkDataEvent : public NetworkEvent +class COMMON_EXPORT NetworkDataEvent : public NetworkEvent { public: explicit NetworkDataEvent(EventManager::EventType type, Network *network, const QByteArray &data) @@ -114,7 +113,7 @@ private: }; -class NetworkSplitEvent : public NetworkEvent +class COMMON_EXPORT NetworkSplitEvent : public NetworkEvent { public: explicit NetworkSplitEvent(EventManager::EventType type, @@ -153,6 +152,3 @@ private: friend class NetworkEvent; }; - - -#endif diff --git a/src/common/nickhighlightmatcher.h b/src/common/nickhighlightmatcher.h index e6757b7d..78a8e8fa 100644 --- a/src/common/nickhighlightmatcher.h +++ b/src/common/nickhighlightmatcher.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include #include @@ -30,7 +32,7 @@ /** * Nickname matcher with automatic caching for performance */ -class NickHighlightMatcher +class COMMON_EXPORT NickHighlightMatcher { public: /// Nickname highlighting mode diff --git a/src/common/peer.h b/src/common/peer.h index c77c6bfa..345889a3 100644 --- a/src/common/peer.h +++ b/src/common/peer.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include #include @@ -29,7 +31,7 @@ #include "quassel.h" #include "signalproxy.h" -class Peer : public QObject +class COMMON_EXPORT Peer : public QObject { Q_OBJECT diff --git a/src/common/peerfactory.h b/src/common/peerfactory.h index da93667e..f78cf0c4 100644 --- a/src/common/peerfactory.h +++ b/src/common/peerfactory.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef PEERFACTORY_H -#define PEERFACTORY_H +#pragma once + +#include "common-export.h" #include @@ -32,7 +33,7 @@ class QTcpSocket; class AuthHandler; class RemotePeer; -class PeerFactory +class COMMON_EXPORT PeerFactory { public: @@ -46,5 +47,3 @@ public: static RemotePeer *createPeer(const ProtoList &protocols, AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = 0); }; - -#endif diff --git a/src/common/presetnetworks.h b/src/common/presetnetworks.h index 57187dc9..253e56eb 100644 --- a/src/common/presetnetworks.h +++ b/src/common/presetnetworks.h @@ -18,15 +18,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef PRESETNETWORKS_H -#define PRESETNETWORKS_H +#pragma once + +#include "common-export.h" #include #include #include "network.h" -class PresetNetworks +class COMMON_EXPORT PresetNetworks { public: static QStringList names(bool onlyDefault = false); @@ -36,5 +37,3 @@ public: private: static QString _networksIniPath; }; - -#endif diff --git a/src/common/quassel.h b/src/common/quassel.h index 2b57a31e..fd1dfd79 100644 --- a/src/common/quassel.h +++ b/src/common/quassel.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include @@ -38,7 +40,7 @@ class QFile; class Logger; -class Quassel : public QObject, public Singleton +class COMMON_EXPORT Quassel : public QObject, public Singleton { // TODO Qt5: Use Q_GADGET Q_OBJECT @@ -263,7 +265,7 @@ private: * * @sa Quassel::Feature */ -class Quassel::Features +class COMMON_EXPORT Quassel::Features { public: /** diff --git a/src/common/remotepeer.h b/src/common/remotepeer.h index 7bf7944f..d29236cb 100644 --- a/src/common/remotepeer.h +++ b/src/common/remotepeer.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef REMOTEPEER_H -#define REMOTEPEER_H +#pragma once + +#include "common-export.h" #include @@ -32,7 +33,7 @@ class QTimer; class AuthHandler; -class RemotePeer : public Peer +class COMMON_EXPORT RemotePeer : public Peer { Q_OBJECT @@ -106,5 +107,3 @@ private: int _lag; quint32 _msgSize; }; - -#endif diff --git a/src/common/settings.h b/src/common/settings.h index 681e5b27..a575172c 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef SETTINGS_H -#define SETTINGS_H +#pragma once + +#include "common-export.h" #include #include @@ -29,7 +30,7 @@ #include "quassel.h" -class SettingsChangeNotifier : public QObject +class COMMON_EXPORT SettingsChangeNotifier : public QObject { Q_OBJECT @@ -41,7 +42,7 @@ private: }; -class Settings +class COMMON_EXPORT Settings { public: enum Mode { Default, Custom }; @@ -222,6 +223,3 @@ private: return settingsChangeNotifier.contains(normKey); } }; - - -#endif diff --git a/src/common/signalproxy.h b/src/common/signalproxy.h index a3d7703e..d4e920ef 100644 --- a/src/common/signalproxy.h +++ b/src/common/signalproxy.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include @@ -34,7 +36,7 @@ class QIODevice; class Peer; class SyncableObject; -class SignalProxy : public QObject +class COMMON_EXPORT SignalProxy : public QObject { Q_OBJECT diff --git a/src/common/singleton.h b/src/common/singleton.h index b3e4dfd3..a3c96524 100644 --- a/src/common/singleton.h +++ b/src/common/singleton.h @@ -20,7 +20,53 @@ #pragma once -#include +#include + +// For Windows DLLs, we must not export the template function. +// For other systems, we must, otherwise the local static variables won't work across library boundaries... +#ifndef Q_OS_WIN +# include "common-export.h" +# define QUASSEL_SINGLETON_EXPORT COMMON_EXPORT +#else +# define QUASSEL_SINGLETON_EXPORT +#endif + +namespace detail { + +// This needs to be a free function instead of a member function of Singleton, because +// - MSVC can't deal with static attributes in an exported template class +// - Clang produces weird and unreliable results for local static variables in static member functions +// +// We need to export the function on anything not using Windows DLLs, otherwise local static members don't +// work across library boundaries. +template +QUASSEL_SINGLETON_EXPORT T *getOrSetInstance(T *instance = nullptr, bool destroyed = false) +{ + static T *_instance = instance; + static bool _destroyed = destroyed; + + if (destroyed) { + _destroyed = true; + return _instance = nullptr; + } + if (instance) { + if (_destroyed) { + std::cerr << "Trying to reinstantiate a destroyed singleton, this must not happen!\n"; + abort(); // This produces a backtrace, which is highly useful for finding the culprit + } + if (_instance != instance) { + std::cerr << "Trying to reinstantiate a singleton that is already instantiated, this must not happen!\n"; + abort(); + } + } + if (!_instance) { + std::cerr << "Trying to access a singleton that has not been instantiated yet!\n"; + abort(); + } + return _instance; +} + +} // detail /** * Mixin class for "pseudo" singletons. @@ -49,15 +95,7 @@ public: */ Singleton(T *instance) { - if (_destroyed) { - qFatal("Trying to reinstantiate a destroyed singleton, this must not happen!"); - abort(); // This produces a backtrace, which is highly useful for finding the culprit - } - if (_instance) { - qFatal("Trying to reinstantiate a singleton that is already instantiated, this must not happen!"); - abort(); - } - _instance = instance; + detail::getOrSetInstance(instance); } // Satisfy Rule of Five @@ -73,8 +111,7 @@ public: */ ~Singleton() { - _instance = nullptr; - _destroyed = true; + detail::getOrSetInstance(nullptr, true); } /** @@ -87,21 +124,6 @@ public: */ static T *instance() { - if (_instance) { - return _instance; - } - qFatal("Trying to access a singleton that has not been instantiated yet"); - abort(); + return detail::getOrSetInstance(); } - -private: - static T *_instance; - static bool _destroyed; - }; - -template -T *Singleton::_instance{nullptr}; - -template -bool Singleton::_destroyed{false}; diff --git a/src/common/syncableobject.h b/src/common/syncableobject.h index af529748..91e1e70e 100644 --- a/src/common/syncableobject.h +++ b/src/common/syncableobject.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include #include @@ -50,7 +52,7 @@ #define ARG(x) const_cast(reinterpret_cast(&x)) #define NO_ARG 0 -class SyncableObject : public QObject +class COMMON_EXPORT SyncableObject : public QObject { Q_OBJECT diff --git a/src/common/transfer.h b/src/common/transfer.h index a77676d9..aa9da69b 100644 --- a/src/common/transfer.h +++ b/src/common/transfer.h @@ -20,13 +20,15 @@ #pragma once +#include "common-export.h" + #include #include #include "peer.h" #include "syncableobject.h" -class Transfer : public SyncableObject +class COMMON_EXPORT Transfer : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/transfermanager.h b/src/common/transfermanager.h index 94dbbfb8..49f04c68 100644 --- a/src/common/transfermanager.h +++ b/src/common/transfermanager.h @@ -20,6 +20,8 @@ #pragma once +#include "common-export.h" + #include #include #include @@ -28,7 +30,7 @@ class Transfer; -class TransferManager : public SyncableObject +class COMMON_EXPORT TransferManager : public SyncableObject { Q_OBJECT SYNCABLE_OBJECT diff --git a/src/common/util.h b/src/common/util.h index 0db903e4..ba73f4dc 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -20,22 +20,24 @@ #pragma once +#include "common-export.h" + #include #include #include -QString nickFromMask(const QString &mask); -QString userFromMask(const QString &mask); -QString hostFromMask(const QString &mask); -bool isChannelName(const QString &str); +COMMON_EXPORT QString nickFromMask(const QString &mask); +COMMON_EXPORT QString userFromMask(const QString &mask); +COMMON_EXPORT QString hostFromMask(const QString &mask); +COMMON_EXPORT bool isChannelName(const QString &str); //! Strip mIRC format codes -QString stripFormatCodes(QString); +COMMON_EXPORT QString stripFormatCodes(QString); //! Remove accelerator markers (&) from the string -QString stripAcceleratorMarkers(const QString &); +COMMON_EXPORT QString stripAcceleratorMarkers(const QString &); -QString secondsToString(int timeInSeconds); +COMMON_EXPORT QString secondsToString(int timeInSeconds); //! Take a string and decode it using the specified text codec, recognizing utf8. /** This function takes a string and first checks if it is encoded in utf8, in which case it is @@ -44,9 +46,9 @@ QString secondsToString(int timeInSeconds); * \param codec The text codec we use if the input is not utf8 * \return The decoded string. */ -QString decodeString(const QByteArray &input, QTextCodec *codec = 0); +COMMON_EXPORT QString decodeString(const QByteArray &input, QTextCodec *codec = 0); -uint editingDistance(const QString &s1, const QString &s2); +COMMON_EXPORT uint editingDistance(const QString &s1, const QString &s2); template QVariantList toVariantList(const QList &list) @@ -70,7 +72,7 @@ QList fromVariantList(const QVariantList &variants) } -QByteArray prettyDigest(const QByteArray &digest); +COMMON_EXPORT QByteArray prettyDigest(const QByteArray &digest); /** * Format a string with %%%% to current date/timestamp via QDateTime. @@ -78,7 +80,7 @@ QByteArray prettyDigest(const QByteArray &digest); * @param[in] formatStr String with format codes * @return String with current date/time substituted in via formatting codes */ -QString formatCurrentDateTimeInString(const QString &formatStr); +COMMON_EXPORT QString formatCurrentDateTimeInString(const QString &formatStr); /** * Try to localize a given date/time in seconds from Unix epoch, pass through string if invalid @@ -91,9 +93,9 @@ QString formatCurrentDateTimeInString(const QString &formatStr); * @param useUTC If true, use UTC timezone, otherwise use local time * @return Localized date/time if parse succeeded, otherwise the source string */ -QString tryFormatUnixEpoch(const QString &possibleEpochDate, - Qt::DateFormat dateFormat = Qt::DateFormat::TextDate, - bool useUTC = false); +COMMON_EXPORT QString tryFormatUnixEpoch(const QString &possibleEpochDate, + Qt::DateFormat dateFormat = Qt::DateFormat::TextDate, + bool useUTC = false); /** @@ -102,4 +104,4 @@ QString tryFormatUnixEpoch(const QString &possibleEpochDate, * @param dateTime Date/time of interest * @return Date/time in ISO 8601 format with timezone offset */ -QString formatDateTimeToOffsetISO(const QDateTime &dateTime); +COMMON_EXPORT QString formatDateTimeToOffsetISO(const QDateTime &dateTime); diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 57e54374..a4cc8099 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,4 +1,4 @@ -quassel_add_module(Core) +quassel_add_module(Core EXPORT) target_sources(${TARGET} PRIVATE abstractsqlstorage.cpp diff --git a/src/core/core.h b/src/core/core.h index 021d9c94..45d06072 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -20,6 +20,8 @@ #pragma once +#include "core-export.h" + #include #include @@ -59,7 +61,7 @@ struct NetworkInfo; class AbstractSqlMigrationReader; class AbstractSqlMigrationWriter; -class Core : public QObject, public Singleton +class CORE_EXPORT Core : public QObject, public Singleton { Q_OBJECT diff --git a/src/core/coreapplication.h b/src/core/coreapplication.h index 216eda0f..6f9e9baa 100644 --- a/src/core/coreapplication.h +++ b/src/core/coreapplication.h @@ -20,6 +20,8 @@ #pragma once +#include "core-export.h" + #include #include @@ -29,7 +31,7 @@ class Core; -class CoreApplication : public QCoreApplication +class CORE_EXPORT CoreApplication : public QCoreApplication { Q_OBJECT diff --git a/src/qtui/CMakeLists.txt b/src/qtui/CMakeLists.txt index 10100d89..eee27cb3 100644 --- a/src/qtui/CMakeLists.txt +++ b/src/qtui/CMakeLists.txt @@ -1,4 +1,4 @@ -quassel_add_module(QtUi) +quassel_add_module(QtUi EXPORT) target_sources(${TARGET} PRIVATE aboutdlg.cpp diff --git a/src/qtui/bufferwidget.h b/src/qtui/bufferwidget.h index 3d81612d..f5f5c3fe 100644 --- a/src/qtui/bufferwidget.h +++ b/src/qtui/bufferwidget.h @@ -18,8 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef BUFFERWIDGET_H_ -#define BUFFERWIDGET_H_ +#pragma once #include "ui_bufferwidget.h" @@ -75,6 +74,3 @@ private: bool _autoMarkerLine; bool _autoMarkerLineOnLostFocus; }; - - -#endif diff --git a/src/qtui/qtuiapplication.h b/src/qtui/qtuiapplication.h index 8d8608e7..39eea07c 100644 --- a/src/qtui/qtuiapplication.h +++ b/src/qtui/qtuiapplication.h @@ -20,6 +20,8 @@ #pragma once +#include "qtui-export.h" + #include #include @@ -32,7 +34,7 @@ class QtUi; -class QtUiApplication : public QApplication +class QTUI_EXPORT QtUiApplication : public QApplication { Q_OBJECT diff --git a/src/uisupport/CMakeLists.txt b/src/uisupport/CMakeLists.txt index 5d0982c0..839ecc8c 100644 --- a/src/uisupport/CMakeLists.txt +++ b/src/uisupport/CMakeLists.txt @@ -1,4 +1,4 @@ -quassel_add_module(UiSupport) +quassel_add_module(UiSupport EXPORT) target_sources(${TARGET} PRIVATE aboutdata.cpp diff --git a/src/uisupport/aboutdata.h b/src/uisupport/aboutdata.h index bfbe39c3..de27cbb4 100644 --- a/src/uisupport/aboutdata.h +++ b/src/uisupport/aboutdata.h @@ -20,6 +20,8 @@ #pragma once +#include "uisupport-export.h" + #include #include #include @@ -34,7 +36,7 @@ * * This is used to show a list of contributors in the About Quassel dialog. */ -class AboutPerson +class UISUPPORT_EXPORT AboutPerson { public: /** @@ -106,7 +108,7 @@ private: * the About Quassel dialog. Additionally, this class can provide a KAboutData object to be shown * if KDE integration is enabled. */ -class AboutData : public QObject +class UISUPPORT_EXPORT AboutData : public QObject { Q_OBJECT public: diff --git a/src/uisupport/abstractbuffercontainer.h b/src/uisupport/abstractbuffercontainer.h index 9af43ca0..5b6bb7b7 100644 --- a/src/uisupport/abstractbuffercontainer.h +++ b/src/uisupport/abstractbuffercontainer.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef ABSTRACTBUFFERCONTAINER_H_ -#define ABSTRACTBUFFERCONTAINER_H_ +#pragma once + +#include "uisupport-export.h" #include "abstractitemview.h" #include "buffermodel.h" @@ -28,7 +29,7 @@ class AbstractChatView; class AbstractUiMsg; class Buffer; -class AbstractBufferContainer : public AbstractItemView +class UISUPPORT_EXPORT AbstractBufferContainer : public AbstractItemView { Q_OBJECT @@ -85,6 +86,3 @@ public: virtual ~AbstractChatView() {}; virtual MsgId lastMsgId() const = 0; }; - - -#endif diff --git a/src/uisupport/abstractitemview.h b/src/uisupport/abstractitemview.h index d244899e..a981667c 100644 --- a/src/uisupport/abstractitemview.h +++ b/src/uisupport/abstractitemview.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef ABSTRACTITEMVIEW_H -#define ABSTRACTITEMVIEW_H +#pragma once + +#include "uisupport-export.h" #include #include @@ -29,7 +30,7 @@ #include #include -class AbstractItemView : public QWidget +class UISUPPORT_EXPORT AbstractItemView : public QWidget { Q_OBJECT @@ -58,6 +59,3 @@ protected: QPointer _model; QPointer _selectionModel; }; - - -#endif // ABSTRACTITEMVIEW_H diff --git a/src/uisupport/abstractnotificationbackend.h b/src/uisupport/abstractnotificationbackend.h index 2fe30c34..7d6b1d9d 100644 --- a/src/uisupport/abstractnotificationbackend.h +++ b/src/uisupport/abstractnotificationbackend.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef ABSTRACTNOTIFICATIONBACKEND_H_ -#define ABSTRACTNOTIFICATIONBACKEND_H_ +#pragma once + +#include "uisupport-export.h" #include #include @@ -28,7 +29,7 @@ class SettingsPage; -class AbstractNotificationBackend : public QObject +class UISUPPORT_EXPORT AbstractNotificationBackend : public QObject { Q_OBJECT @@ -68,6 +69,3 @@ signals: //! May be emitted by the notification to tell the MainWin to raise itself void activated(uint notificationId = 0); }; - - -#endif diff --git a/src/uisupport/action.h b/src/uisupport/action.h index 62bc8a37..ba03a245 100644 --- a/src/uisupport/action.h +++ b/src/uisupport/action.h @@ -22,6 +22,8 @@ #pragma once +#include "uisupport-export.h" + #include #include @@ -29,7 +31,7 @@ /** This declares/implements a subset of KAction's API (notably we've left out global shortcuts * for now), which should make it easy to plug in KDE support later on. */ -class Action : public QWidgetAction +class UISUPPORT_EXPORT Action : public QWidgetAction { Q_OBJECT diff --git a/src/uisupport/actioncollection.h b/src/uisupport/actioncollection.h index 5de038ff..a675fddd 100644 --- a/src/uisupport/actioncollection.h +++ b/src/uisupport/actioncollection.h @@ -22,6 +22,8 @@ #pragma once +#include "uisupport-export.h" + #ifndef HAVE_KDE #include @@ -35,7 +37,7 @@ class QWidget; class Action; class QAction; -class ActionCollection : public QObject +class UISUPPORT_EXPORT ActionCollection : public QObject { Q_OBJECT diff --git a/src/uisupport/bufferhotlistfilter.h b/src/uisupport/bufferhotlistfilter.h index abfc26dc..60c80393 100644 --- a/src/uisupport/bufferhotlistfilter.h +++ b/src/uisupport/bufferhotlistfilter.h @@ -18,13 +18,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef BUFFERHOTLISTFILTER_H -#define BUFFERHOTLISTFILTER_H +#pragma once + +#include "uisupport-export.h" #include #include "types.h" -class BufferHotListFilter : public QSortFilterProxyModel +class UISUPPORT_EXPORT BufferHotListFilter : public QSortFilterProxyModel { Q_OBJECT @@ -39,6 +40,3 @@ protected: virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; virtual bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; }; - - -#endif //BUFFERHOTLISTFILTER_H diff --git a/src/uisupport/bufferview.h b/src/uisupport/bufferview.h index 47a519f5..52210cad 100644 --- a/src/uisupport/bufferview.h +++ b/src/uisupport/bufferview.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef BUFFERVIEW_H_ -#define BUFFERVIEW_H_ +#pragma once + +#include "uisupport-export.h" #include #include @@ -37,7 +38,7 @@ /***************************************** * The TreeView showing the Buffers *****************************************/ -class BufferView : public TreeViewTouch +class UISUPPORT_EXPORT BufferView : public TreeViewTouch { Q_OBJECT @@ -160,7 +161,7 @@ protected: // ============================== // BufferView Dock // ============================== -class BufferViewDock : public QDockWidget +class UISUPPORT_EXPORT BufferViewDock : public QDockWidget { Q_OBJECT Q_PROPERTY(bool active READ isActive WRITE setActive STORED true) @@ -199,6 +200,3 @@ private: bool _active; QString _title; }; - - -#endif diff --git a/src/uisupport/bufferviewfilter.h b/src/uisupport/bufferviewfilter.h index 1f530830..f53662a1 100644 --- a/src/uisupport/bufferviewfilter.h +++ b/src/uisupport/bufferviewfilter.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef BUFFERVIEWFILTER_H_ -#define BUFFERVIEWFILTER_H_ +#pragma once + +#include "uisupport-export.h" #include #include @@ -34,7 +35,7 @@ /***************************************** * Buffer View Filter *****************************************/ -class BufferViewFilter : public QSortFilterProxyModel +class UISUPPORT_EXPORT BufferViewFilter : public QSortFilterProxyModel { Q_OBJECT @@ -106,5 +107,3 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(BufferViewFilter::Modes) - -#endif // BUFFERVIEWFILTER_H_ diff --git a/src/uisupport/bufferviewoverlayfilter.h b/src/uisupport/bufferviewoverlayfilter.h index f12f9c3e..2b43bf9b 100644 --- a/src/uisupport/bufferviewoverlayfilter.h +++ b/src/uisupport/bufferviewoverlayfilter.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef BUFFERVIEWOVERLAYFILTER_H_ -#define BUFFERVIEWOVERLAYFILTER_H_ +#pragma once + +#include "uisupport-export.h" #include @@ -27,7 +28,7 @@ class BufferViewOverlay; -class BufferViewOverlayFilter : public QSortFilterProxyModel +class UISUPPORT_EXPORT BufferViewOverlayFilter : public QSortFilterProxyModel { Q_OBJECT @@ -45,6 +46,3 @@ private slots: private: BufferViewOverlay *_overlay; }; - - -#endif // BUFFERVIEWOVERLAYFILTER_H_ diff --git a/src/uisupport/clearablelineedit.h b/src/uisupport/clearablelineedit.h index 0abd72fd..53692223 100644 --- a/src/uisupport/clearablelineedit.h +++ b/src/uisupport/clearablelineedit.h @@ -18,14 +18,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef CLEARABLELINEEDIT_H -#define CLEARABLELINEEDIT_H +#pragma once + +#include "uisupport-export.h" #include class QToolButton; -class ClearableLineEdit : public QLineEdit +class UISUPPORT_EXPORT ClearableLineEdit : public QLineEdit { Q_OBJECT @@ -41,6 +42,3 @@ private slots: private: QToolButton *clearButton; }; - - -#endif // CLEARABLELINEEDIT_H diff --git a/src/uisupport/clickable.h b/src/uisupport/clickable.h index 8d1c2f75..a57513fa 100644 --- a/src/uisupport/clickable.h +++ b/src/uisupport/clickable.h @@ -20,6 +20,8 @@ #pragma once +#include "uisupport-export.h" + #include #include @@ -28,7 +30,7 @@ class QModelIndex; -class Clickable +class UISUPPORT_EXPORT Clickable { public: // Don't change these enums without also changing dependent methods! @@ -58,7 +60,7 @@ private: }; -class ClickableList : public std::vector +class UISUPPORT_EXPORT ClickableList : public std::vector { public: static ClickableList fromString(const QString &); diff --git a/src/uisupport/clickablelabel.h b/src/uisupport/clickablelabel.h index 1f7247db..0bd20326 100644 --- a/src/uisupport/clickablelabel.h +++ b/src/uisupport/clickablelabel.h @@ -18,12 +18,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef CLICKABLELABEL_H -#define CLICKABLELABEL_H +#pragma once + +#include "uisupport-export.h" #include -class ClickableLabel : public QLabel +class UISUPPORT_EXPORT ClickableLabel : public QLabel { Q_OBJECT @@ -36,6 +37,3 @@ signals: protected: void mouseReleaseEvent(QMouseEvent *event); }; - - -#endif //CLICKABLELABEL_H diff --git a/src/uisupport/colorbutton.h b/src/uisupport/colorbutton.h index 43abf02b..48811f6e 100644 --- a/src/uisupport/colorbutton.h +++ b/src/uisupport/colorbutton.h @@ -18,18 +18,19 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef COLORBUTTON_H_ -#define COLORBUTTON_H_ +#pragma once + +#include "uisupport-export.h" #include -class ColorButton : public QToolButton +class UISUPPORT_EXPORT ColorButton : public QToolButton { Q_OBJECT Q_PROPERTY(QColor color READ color WRITE setColor USER true) public : - explicit ColorButton(QWidget *parent = 0); + explicit ColorButton(QWidget *parent = 0); explicit ColorButton(const QColor &c, QWidget *parent = 0); void setColor(const QColor &color); @@ -38,15 +39,9 @@ public : signals: void colorChanged(const QColor &); -protected: - //void paintEvent(QPaintEvent *event); - private slots: void chooseColor(); private: QColor _color; }; - - -#endif diff --git a/src/uisupport/contextmenuactionprovider.h b/src/uisupport/contextmenuactionprovider.h index 2835eaf4..a9c76bf0 100644 --- a/src/uisupport/contextmenuactionprovider.h +++ b/src/uisupport/contextmenuactionprovider.h @@ -18,12 +18,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef CONTEXTMENUACTIONPROVIDER_H -#define CONTEXTMENUACTIONPROVIDER_H +#pragma once + +#include "uisupport-export.h" #include "networkmodelcontroller.h" -class ContextMenuActionProvider : public NetworkModelController +class UISUPPORT_EXPORT ContextMenuActionProvider : public NetworkModelController { Q_OBJECT @@ -74,6 +75,3 @@ private: Action *_nickIgnoreMenuAction; QList _ignoreDescriptions; }; - - -#endif diff --git a/src/uisupport/flatproxymodel.h b/src/uisupport/flatproxymodel.h index db37d047..ca362b99 100644 --- a/src/uisupport/flatproxymodel.h +++ b/src/uisupport/flatproxymodel.h @@ -18,12 +18,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef FLATPROXYMODEL_H -#define FLATPROXYMODEL_H +#pragma once + +#include "uisupport-export.h" #include -class FlatProxyModel : public QAbstractProxyModel +class UISUPPORT_EXPORT FlatProxyModel : public QAbstractProxyModel { Q_OBJECT @@ -121,6 +122,3 @@ private: friend class FlatProxyModel; }; - - -#endif //FLATPROXYMODEL_H diff --git a/src/uisupport/fontselector.h b/src/uisupport/fontselector.h index 7f9a745d..1359f7d0 100644 --- a/src/uisupport/fontselector.h +++ b/src/uisupport/fontselector.h @@ -18,13 +18,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef FONTSELECTOR_H_ -#define FONTSELECTOR_H_ +#pragma once + +#include "uisupport-export.h" #include #include -class FontSelector : public QWidget +class UISUPPORT_EXPORT FontSelector : public QWidget { Q_OBJECT Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont) @@ -50,6 +51,3 @@ private: QFont _font; QLabel *_demo; }; - - -#endif // FONTSELECTOR_H_ diff --git a/src/uisupport/graphicalui.h b/src/uisupport/graphicalui.h index 3b945440..ebf98715 100644 --- a/src/uisupport/graphicalui.h +++ b/src/uisupport/graphicalui.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef GRAPHICALUI_H_ -#define GRAPHICALUI_H_ +#pragma once + +#include "uisupport-export.h" #include "abstractui.h" #include "singleton.h" @@ -36,7 +37,7 @@ class UiStyle; #include #endif -class GraphicalUi : public AbstractUi, protected Singleton +class UISUPPORT_EXPORT GraphicalUi : public AbstractUi, protected Singleton { Q_OBJECT @@ -132,5 +133,3 @@ ToolBarActionProvider *GraphicalUi::toolBarActionProvider() { return _toolBarAct UiStyle *GraphicalUi::uiStyle() { return _uiStyle; } QWidget *GraphicalUi::mainWidget() { return _mainWidget; } bool GraphicalUi::isHidingMainWidgetAllowed() const { return false; } - -#endif diff --git a/src/uisupport/icon.h b/src/uisupport/icon.h index 18ec665c..17ed902e 100644 --- a/src/uisupport/icon.h +++ b/src/uisupport/icon.h @@ -20,6 +20,8 @@ #pragma once +#include "uisupport-export.h" + #include #include @@ -39,7 +41,7 @@ namespace icon { * @param fallbackPath Full path to a fallback icon * @returns The requested icon, if available */ -QIcon get(const QString &iconName, const QString &fallbackPath = {}); +UISUPPORT_EXPORT QIcon get(const QString &iconName, const QString &fallbackPath = {}); /** * Gets an icon from the current icon theme. @@ -53,6 +55,6 @@ QIcon get(const QString &iconName, const QString &fallbackPath = {}); * @param fallbackPath Full path to a fallback icon * @returns The requested icon, if available */ -QIcon get(const std::vector &iconNames, const QString &fallbackPath = {}); +UISUPPORT_EXPORT QIcon get(const std::vector &iconNames, const QString &fallbackPath = {}); } diff --git a/src/uisupport/multilineedit.h b/src/uisupport/multilineedit.h index b4badfb4..63b67eb5 100644 --- a/src/uisupport/multilineedit.h +++ b/src/uisupport/multilineedit.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef MULTILINEEDIT_H_ -#define MULTILINEEDIT_H_ +#pragma once + +#include "uisupport-export.h" #include #include @@ -38,7 +39,7 @@ # include #endif -class MultiLineEdit : public MultiLineEditParent +class UISUPPORT_EXPORT MultiLineEdit : public MultiLineEditParent { Q_OBJECT @@ -153,6 +154,3 @@ private: Sonnet::SpellCheckDecorator *_spellCheckDecorator{nullptr}; #endif }; - - -#endif diff --git a/src/uisupport/networkmodelcontroller.h b/src/uisupport/networkmodelcontroller.h index 4b859574..ea7ab659 100644 --- a/src/uisupport/networkmodelcontroller.h +++ b/src/uisupport/networkmodelcontroller.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef NETWORKMODELCONTROLLER_H_ -#define NETWORKMODELCONTROLLER_H_ +#pragma once + +#include "uisupport-export.h" #include @@ -31,7 +32,7 @@ class QComboBox; class QDialogButtonBox; class QLineEdit; -class NetworkModelController : public QObject +class UISUPPORT_EXPORT NetworkModelController : public QObject { Q_OBJECT @@ -222,5 +223,3 @@ MessageFilter *NetworkModelController::messageFilter() const { return _messageFi QString NetworkModelController::contextItem() const { return _contextItem; } QObject *NetworkModelController::receiver() const { return _receiver; } const char *NetworkModelController::method() const { return _method; } - -#endif diff --git a/src/uisupport/nickview.h b/src/uisupport/nickview.h index f7a56c87..4bdc7d02 100644 --- a/src/uisupport/nickview.h +++ b/src/uisupport/nickview.h @@ -18,15 +18,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef NICKVIEW_H_ -#define NICKVIEW_H_ +#pragma once + +#include "uisupport-export.h" #include #include "bufferinfo.h" #include "treeviewtouch.h" -class NickView : public TreeViewTouch +class UISUPPORT_EXPORT NickView : public TreeViewTouch { Q_OBJECT @@ -54,6 +55,3 @@ signals: private: friend class NickListWidget; // needs selectedIndexes() }; - - -#endif diff --git a/src/uisupport/nickviewfilter.h b/src/uisupport/nickviewfilter.h index ce029ccc..b8c05513 100644 --- a/src/uisupport/nickviewfilter.h +++ b/src/uisupport/nickviewfilter.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef NICKVIEWFILTER_H -#define NICKVIEWFILTER_H +#pragma once + +#include "uisupport-export.h" #include @@ -28,7 +29,7 @@ class NetworkModel; // This is proxymodel is purely for the sorting right now -class NickViewFilter : public QSortFilterProxyModel +class UISUPPORT_EXPORT NickViewFilter : public QSortFilterProxyModel { Q_OBJECT @@ -45,6 +46,3 @@ protected: private: BufferId _bufferId; }; - - -#endif diff --git a/src/uisupport/resizingstackedwidget.h b/src/uisupport/resizingstackedwidget.h index dfd9814e..08baf2c1 100644 --- a/src/uisupport/resizingstackedwidget.h +++ b/src/uisupport/resizingstackedwidget.h @@ -18,12 +18,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef RESIZINGSTACKEDWIDGET_H_ -#define RESIZINGSTACKEDWIDGET_H_ +#pragma once + +#include "uisupport-export.h" #include -class ResizingStackedWidget : public QStackedWidget +class UISUPPORT_EXPORT ResizingStackedWidget : public QStackedWidget { Q_OBJECT @@ -35,6 +36,3 @@ public: private slots: void indexChanged(int index); }; - - -#endif // RESIZINGSTACKEDWIDGET_H_ diff --git a/src/uisupport/settingspage.h b/src/uisupport/settingspage.h index 667c9087..c6c28cd0 100644 --- a/src/uisupport/settingspage.h +++ b/src/uisupport/settingspage.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef _SETTINGSPAGE_H_ -#define _SETTINGSPAGE_H_ +#pragma once + +#include "uisupport-export.h" #include @@ -55,7 +56,7 @@ class FontSelector; * - QComboBox (currentIndex()) * - QSpinBox (value()) */ -class SettingsPage : public QWidget +class UISUPPORT_EXPORT SettingsPage : public QWidget { Q_OBJECT @@ -167,6 +168,3 @@ private: bool _changed, _autoWidgetsChanged; QObjectList _autoWidgets; }; - - -#endif diff --git a/src/uisupport/styledlabel.h b/src/uisupport/styledlabel.h index 668ebd76..6bcdb93c 100644 --- a/src/uisupport/styledlabel.h +++ b/src/uisupport/styledlabel.h @@ -18,15 +18,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef STYLEDLABEL_H -#define STYLEDLABEL_H +#pragma once + +#include "uisupport-export.h" #include #include "clickable.h" #include "uistyle.h" -class StyledLabel : public QFrame +class UISUPPORT_EXPORT StyledLabel : public QFrame { Q_OBJECT @@ -89,6 +90,3 @@ private: void setHoverMode(int start, int length); void endHoverMode(); }; - - -#endif diff --git a/src/uisupport/tabcompleter.h b/src/uisupport/tabcompleter.h index b10fe7c6..9d58d442 100644 --- a/src/uisupport/tabcompleter.h +++ b/src/uisupport/tabcompleter.h @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef TABCOMPLETER_H_ -#define TABCOMPLETER_H_ +#pragma once + +#include "uisupport-export.h" #include #include @@ -31,7 +32,7 @@ class MultiLineEdit; class IrcUser; class Network; -class TabCompleter : public QObject +class UISUPPORT_EXPORT TabCompleter : public QObject { Q_OBJECT @@ -76,6 +77,3 @@ private: void buildCompletionList(); }; - - -#endif diff --git a/src/uisupport/toolbaractionprovider.h b/src/uisupport/toolbaractionprovider.h index 8ca5dae3..a341be9b 100644 --- a/src/uisupport/toolbaractionprovider.h +++ b/src/uisupport/toolbaractionprovider.h @@ -18,14 +18,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef TOOLBARACTIONPROVIDER_H_ -#define TOOLBARACTIONPROVIDER_H_ +#pragma once + +#include "uisupport-export.h" #include "networkmodelcontroller.h" class QToolBar; -class ToolBarActionProvider : public NetworkModelController +class UISUPPORT_EXPORT ToolBarActionProvider : public NetworkModelController { Q_OBJECT @@ -67,6 +68,3 @@ private: QModelIndex _currentBuffer; QModelIndexList _selectedNicks; }; - - -#endif diff --git a/src/uisupport/treeviewtouch.h b/src/uisupport/treeviewtouch.h index c9c0c5af..7b94039c 100644 --- a/src/uisupport/treeviewtouch.h +++ b/src/uisupport/treeviewtouch.h @@ -20,12 +20,14 @@ #pragma once +#include "uisupport-export.h" + #include /** * This class handles Touch Events for TreeViews */ -class TreeViewTouch : public QTreeView +class UISUPPORT_EXPORT TreeViewTouch : public QTreeView { Q_OBJECT diff --git a/src/uisupport/uisettings.h b/src/uisupport/uisettings.h index fa18ebe2..3fc627eb 100644 --- a/src/uisupport/uisettings.h +++ b/src/uisupport/uisettings.h @@ -18,13 +18,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef UISETTINGS_H -#define UISETTINGS_H +#pragma once + +#include "uisupport-export.h" #include "clientsettings.h" #include "uistyle.h" -class UiSettings : public ClientSettings +class UISUPPORT_EXPORT UiSettings : public ClientSettings { public: UiSettings(const QString &group = "Ui"); @@ -44,7 +45,7 @@ public: }; -class UiStyleSettings : public UiSettings +class UISUPPORT_EXPORT UiStyleSettings : public UiSettings { public: UiStyleSettings(); @@ -58,7 +59,7 @@ public: }; -class SessionSettings : public UiSettings +class UISUPPORT_EXPORT SessionSettings : public UiSettings { public: SessionSettings(const QString &sessionId, const QString &group = "Session"); @@ -82,7 +83,7 @@ private: }; -class ShortcutSettings : public UiSettings +class UISUPPORT_EXPORT ShortcutSettings : public UiSettings { public: ShortcutSettings(); @@ -95,6 +96,3 @@ public: void saveShortcut(const QString &name, const QKeySequence &shortcut); QKeySequence loadShortcut(const QString &name); }; - - -#endif diff --git a/src/uisupport/uistyle.h b/src/uisupport/uistyle.h index 661e0257..6febcd5b 100644 --- a/src/uisupport/uistyle.h +++ b/src/uisupport/uistyle.h @@ -20,6 +20,8 @@ #pragma once +#include "uisupport-export.h" + #include #include @@ -38,7 +40,7 @@ #include "networkmodel.h" #include "settings.h" -class UiStyle : public QObject +class UISUPPORT_EXPORT UiStyle : public QObject { Q_OBJECT Q_ENUMS(SenderPrefixModes) @@ -365,7 +367,7 @@ private: }; -class UiStyle::StyledMessage : public Message +class UISUPPORT_EXPORT UiStyle::StyledMessage : public Message { Q_DECLARE_TR_FUNCTIONS(UiStyle::StyledMessage) @@ -393,26 +395,26 @@ uint qHash(UiStyle::ItemFormatType key, uint seed); // ---- Operators for dealing with enums ---------------------------------------------------------- -UiStyle::FormatType operator|(UiStyle::FormatType lhs, UiStyle::FormatType rhs); -UiStyle::FormatType& operator|=(UiStyle::FormatType &lhs, UiStyle::FormatType rhs); -UiStyle::FormatType operator|(UiStyle::FormatType lhs, quint32 rhs); -UiStyle::FormatType& operator|=(UiStyle::FormatType &lhs, quint32 rhs); -UiStyle::FormatType operator&(UiStyle::FormatType lhs, UiStyle::FormatType rhs); -UiStyle::FormatType& operator&=(UiStyle::FormatType &lhs, UiStyle::FormatType rhs); -UiStyle::FormatType operator&(UiStyle::FormatType lhs, quint32 rhs); -UiStyle::FormatType& operator&=(UiStyle::FormatType &lhs, quint32 rhs); -UiStyle::FormatType& operator^=(UiStyle::FormatType &lhs, UiStyle::FormatType rhs); - -UiStyle::MessageLabel operator|(UiStyle::MessageLabel lhs, UiStyle::MessageLabel rhs); -UiStyle::MessageLabel& operator|=(UiStyle::MessageLabel &lhs, UiStyle::MessageLabel rhs); -UiStyle::MessageLabel operator&(UiStyle::MessageLabel lhs, quint32 rhs); -UiStyle::MessageLabel& operator&=(UiStyle::MessageLabel &lhs, UiStyle::MessageLabel rhs); +UISUPPORT_EXPORT UiStyle::FormatType operator|(UiStyle::FormatType lhs, UiStyle::FormatType rhs); +UISUPPORT_EXPORT UiStyle::FormatType& operator|=(UiStyle::FormatType &lhs, UiStyle::FormatType rhs); +UISUPPORT_EXPORT UiStyle::FormatType operator|(UiStyle::FormatType lhs, quint32 rhs); +UISUPPORT_EXPORT UiStyle::FormatType& operator|=(UiStyle::FormatType &lhs, quint32 rhs); +UISUPPORT_EXPORT UiStyle::FormatType operator&(UiStyle::FormatType lhs, UiStyle::FormatType rhs); +UISUPPORT_EXPORT UiStyle::FormatType& operator&=(UiStyle::FormatType &lhs, UiStyle::FormatType rhs); +UISUPPORT_EXPORT UiStyle::FormatType operator&(UiStyle::FormatType lhs, quint32 rhs); +UISUPPORT_EXPORT UiStyle::FormatType& operator&=(UiStyle::FormatType &lhs, quint32 rhs); +UISUPPORT_EXPORT UiStyle::FormatType& operator^=(UiStyle::FormatType &lhs, UiStyle::FormatType rhs); + +UISUPPORT_EXPORT UiStyle::MessageLabel operator|(UiStyle::MessageLabel lhs, UiStyle::MessageLabel rhs); +UISUPPORT_EXPORT UiStyle::MessageLabel& operator|=(UiStyle::MessageLabel &lhs, UiStyle::MessageLabel rhs); +UISUPPORT_EXPORT UiStyle::MessageLabel operator&(UiStyle::MessageLabel lhs, quint32 rhs); +UISUPPORT_EXPORT UiStyle::MessageLabel& operator&=(UiStyle::MessageLabel &lhs, UiStyle::MessageLabel rhs); // Shifts the label into the upper half of the return value -quint64 operator|(UiStyle::FormatType lhs, UiStyle::MessageLabel rhs); +UISUPPORT_EXPORT quint64 operator|(UiStyle::FormatType lhs, UiStyle::MessageLabel rhs); -UiStyle::ItemFormatType operator|(UiStyle::ItemFormatType lhs, UiStyle::ItemFormatType rhs); -UiStyle::ItemFormatType& operator|=(UiStyle::ItemFormatType &lhs, UiStyle::ItemFormatType rhs); +UISUPPORT_EXPORT UiStyle::ItemFormatType operator|(UiStyle::ItemFormatType lhs, UiStyle::ItemFormatType rhs); +UISUPPORT_EXPORT UiStyle::ItemFormatType& operator|=(UiStyle::ItemFormatType &lhs, UiStyle::ItemFormatType rhs); // ---- Allow for FormatList in QVariant ---------------------------------------------------------- -- 2.20.1