src: Mark symbols to be exported where needed
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 2 Sep 2018 21:34:36 +0000 (23:34 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
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.

105 files changed:
src/client/CMakeLists.txt
src/client/abstractmessageprocessor.h
src/client/abstractui.h
src/client/buffermodel.h
src/client/buffersettings.h
src/client/bufferviewoverlay.h
src/client/client.h
src/client/clientaliasmanager.h
src/client/clientbacklogmanager.h
src/client/clientbufferviewconfig.h
src/client/clientbufferviewmanager.h
src/client/clientidentity.h
src/client/clientignorelistmanager.h
src/client/clientsettings.h
src/client/coreaccount.h
src/client/coreaccountmodel.h
src/client/coreconnection.h
src/client/irclistmodel.h
src/client/messagefilter.h
src/client/messagemodel.h
src/client/networkmodel.h
src/client/selectionmodelsynchronizer.h
src/client/treemodel.h
src/common/CMakeLists.txt
src/common/aliasmanager.h
src/common/authhandler.h
src/common/backlogmanager.h
src/common/basichandler.h
src/common/bufferinfo.h
src/common/buffersyncer.h
src/common/bufferviewconfig.h
src/common/bufferviewmanager.h
src/common/coreinfo.h
src/common/ctcpevent.h
src/common/dccconfig.h
src/common/deferredptr.h
src/common/event.h
src/common/eventmanager.h
src/common/expressionmatch.h
src/common/highlightrulemanager.h
src/common/identity.h
src/common/ignorelistmanager.h
src/common/internalpeer.h
src/common/ircchannel.h
src/common/ircevent.h
src/common/irclisthelper.h
src/common/ircuser.h
src/common/logger.h
src/common/logmessage.h
src/common/message.h
src/common/messageevent.h
src/common/network.h
src/common/networkconfig.h
src/common/networkevent.h
src/common/nickhighlightmatcher.h
src/common/peer.h
src/common/peerfactory.h
src/common/presetnetworks.h
src/common/quassel.h
src/common/remotepeer.h
src/common/settings.h
src/common/signalproxy.h
src/common/singleton.h
src/common/syncableobject.h
src/common/transfer.h
src/common/transfermanager.h
src/common/util.h
src/core/CMakeLists.txt
src/core/core.h
src/core/coreapplication.h
src/qtui/CMakeLists.txt
src/qtui/bufferwidget.h
src/qtui/qtuiapplication.h
src/uisupport/CMakeLists.txt
src/uisupport/aboutdata.h
src/uisupport/abstractbuffercontainer.h
src/uisupport/abstractitemview.h
src/uisupport/abstractnotificationbackend.h
src/uisupport/action.h
src/uisupport/actioncollection.h
src/uisupport/bufferhotlistfilter.h
src/uisupport/bufferview.h
src/uisupport/bufferviewfilter.h
src/uisupport/bufferviewoverlayfilter.h
src/uisupport/clearablelineedit.h
src/uisupport/clickable.h
src/uisupport/clickablelabel.h
src/uisupport/colorbutton.h
src/uisupport/contextmenuactionprovider.h
src/uisupport/flatproxymodel.h
src/uisupport/fontselector.h
src/uisupport/graphicalui.h
src/uisupport/icon.h
src/uisupport/multilineedit.h
src/uisupport/networkmodelcontroller.h
src/uisupport/nickview.h
src/uisupport/nickviewfilter.h
src/uisupport/resizingstackedwidget.h
src/uisupport/settingspage.h
src/uisupport/styledlabel.h
src/uisupport/tabcompleter.h
src/uisupport/toolbaractionprovider.h
src/uisupport/treeviewtouch.h
src/uisupport/uisettings.h
src/uisupport/uistyle.h

index 1645538..7546443 100644 (file)
@@ -1,4 +1,4 @@
-quassel_add_module(Client)
+quassel_add_module(Client EXPORT)
 
 target_sources(${TARGET} PRIVATE
     abstractmessageprocessor.cpp
index 4ed31f4..1ac52fb 100644 (file)
  *   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
index a2657fe..44467fc 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef ABSTRACTUI_H
-#define ABSTRACTUI_H
+#pragma once
+
+#include "client-export.h"
 
 #include <QObject>
 #include <QVariantMap>
-//#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
index b4ec9ba..a8fada2 100644 (file)
@@ -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 <QSortFilterProxyModel>
 #include <QItemSelectionModel>
@@ -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<NetworkId, QString> _bufferToSwitchTo;
 };
-
-
-#endif // BUFFERMODEL_H
index 7dd3a2d..1d0e372 100644 (file)
  *   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
index 38dad73..24e1101 100644 (file)
@@ -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 <QObject>
 
@@ -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
index ef37ad5..7642c3e 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "client-export.h"
+
 #include <memory>
 
 #include <QList>
@@ -66,7 +68,7 @@ class TransferModel;
 
 struct NetworkInfo;
 
-class Client : public QObject, public Singleton<Client>
+class CLIENT_EXPORT Client : public QObject, public Singleton<Client>
 {
     Q_OBJECT
 
index 9fcb768..2f0eda4 100644 (file)
 
 #pragma once
 
+#include "client-export.h"
+
 #include "aliasmanager.h"
 
-class ClientAliasManager : public AliasManager
+class CLIENT_EXPORT ClientAliasManager : public AliasManager
 {
     Q_OBJECT
 
index cce66f0..77ae36f 100644 (file)
 
 #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
 
index 44ee211..5c7d8b7 100644 (file)
 
 #pragma once
 
+#include "client-export.h"
+
 #include "bufferviewconfig.h"
 
-class ClientBufferViewConfig : public BufferViewConfig
+class CLIENT_EXPORT ClientBufferViewConfig : public BufferViewConfig
 {
     Q_OBJECT
 
index 6f26710..c44b720 100644 (file)
 
 #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
 
index 9f6fdc0..2ff4cb8 100644 (file)
 
 #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
index 29cd51f..36c1b47 100644 (file)
 
 #pragma once
 
+#include "client-export.h"
+
 #include "ignorelistmanager.h"
 #include <QMap>
 
-class ClientIgnoreListManager : public IgnoreListManager
+class CLIENT_EXPORT ClientIgnoreListManager : public IgnoreListManager
 {
     Q_OBJECT
 
index 16a4681..54df34b 100644 (file)
@@ -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
index d8acb42..d4aed0f 100644 (file)
@@ -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 <QCoreApplication>
 #include <QDebug>
@@ -28,7 +29,8 @@
 #include <QVariantMap>
 
 #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
index 9814d08..5b224b4 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef COREACCOUNTMODEL_H_
-#define COREACCOUNTMODEL_H_
+#pragma once
+
+#include "client-export.h"
 
 #include <QAbstractListModel>
 #include <QUuid>
 
 #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
index 69b4c9e..7951a49 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "client-export.h"
+
 #include <QNetworkConfigurationManager>
 #include <QPointer>
 #include <QTimer>
@@ -41,7 +43,7 @@ class Network;
 class Peer;
 class SignalProxy;
 
-class CoreConnection : public QObject
+class CLIENT_EXPORT CoreConnection : public QObject
 {
     Q_OBJECT
 
index 939789e..8c52231 100644 (file)
  *   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 <QAbstractItemModel>
 
-class IrcListModel : public QAbstractItemModel
+class CLIENT_EXPORT IrcListModel : public QAbstractItemModel
 {
     Q_OBJECT
 
@@ -50,6 +51,3 @@ public slots:
 private:
     QList<IrcListHelper::ChannelDescription> _channelList;
 };
-
-
-#endif //IRCLISTMODEL_H
index 61091f1..c7bd3d1 100644 (file)
@@ -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 <QSortFilterProxyModel>
 #include <set>
@@ -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
index e26455d..9fd7ea6 100644 (file)
@@ -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 <QAbstractItemModel>
 #include <QDateTime>
@@ -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
index a97372e..7f73b76 100644 (file)
@@ -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
index 17bca3a..b3d1214 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef _SELECTIONMODELSYNCHRONIZER_H_
-#define _SELECTIONMODELSYNCHRONIZER_H_
+#pragma once
+
+#include "client-export.h"
 
 #include <QObject>
 #include <QItemSelectionModel>
 
 class QAbstractItemModel;
 
-class SelectionModelSynchronizer : public QObject
+class CLIENT_EXPORT SelectionModelSynchronizer : public QObject
 {
     Q_OBJECT
 
@@ -67,6 +68,3 @@ private:
 
     QSet<QItemSelectionModel *> _selectionModels;
 };
-
-
-#endif
index 92bf767..716e07c 100644 (file)
@@ -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 <QList>
 #include <QStringList>
@@ -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
index 2069a35..1683d26 100644 (file)
@@ -1,4 +1,4 @@
-quassel_add_module(Common)
+quassel_add_module(Common EXPORT)
 
 target_sources(${TARGET} PRIVATE
     abstractsignalwatcher.h
index 0a93789..aaac54d 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QVariantMap>
 
 #include "bufferinfo.h"
@@ -27,7 +29,7 @@
 
 class Network;
 
-class AliasManager : public SyncableObject
+class COMMON_EXPORT AliasManager : public SyncableObject
 {
     Q_OBJECT
     SYNCABLE_OBJECT
index 0f3c788..7fb9127 100644 (file)
@@ -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 <QTcpSocket>
 
@@ -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
index ecee40d..e64f45a 100644 (file)
 
 #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
index 4a168f6..e48d605 100644 (file)
@@ -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 <QObject>
 #include <QString>
@@ -27,7 +28,7 @@
 #include <QHash>
 #include <QGenericArgument>
 
-class BasicHandler : public QObject
+class COMMON_EXPORT BasicHandler : public QObject
 {
     Q_OBJECT
 
@@ -51,6 +52,3 @@ private:
     bool _initDone;
     QString _methodPrefix;
 };
-
-
-#endif
index 3631d96..6e77e63 100644 (file)
  *   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
index 5d4f383..6db6f9c 100644 (file)
 
 #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
index d2542e7..03debf8 100644 (file)
 
 #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
index 4e41e98..0a4f280 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include "syncableobject.h"
 
 #include <QList>
@@ -28,7 +30,7 @@
 class BufferViewConfig;
 class SignalProxy;
 
-class BufferViewManager : public SyncableObject
+class COMMON_EXPORT BufferViewManager : public SyncableObject
 {
     Q_OBJECT
     SYNCABLE_OBJECT
index 284336c..17db3cb 100644 (file)
 
 #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
index 73bcc4b..1f0635b 100644 (file)
  *   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 <QUuid>
 
-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
index c82830a..f919dcc 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QHostAddress>
 
 #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
index e04fb97..8e02db8 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <memory>
 #include <type_traits>
 
index 7ad2ad4..10bfdab 100644 (file)
@@ -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 <QDateTime>
 #include <QDebug>
@@ -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);
index d74e236..246c58a 100644 (file)
@@ -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 <QMetaEnum>
 
@@ -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
index 2712778..a22b34b 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QRegularExpression>
 #include <QString>
 #include <QStringList>
@@ -27,7 +29,7 @@
 /**
  * Expression matcher with multiple modes of operation and automatic caching for performance
  */
-class ExpressionMatch
+class COMMON_EXPORT ExpressionMatch
 {
 
 public:
index d8d8859..addbbf6 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <utility>
 
 #include <QString>
@@ -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:
         /**
index 4c5de2c..7cbd193 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QByteArray>
 #include <QDataStream>
 #include <QMetaType>
@@ -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 <QSslKey>
 #include <QSslCertificate>
 
-class CertManager : public SyncableObject
+class COMMON_EXPORT CertManager : public SyncableObject
 {
     Q_OBJECT
     SYNCABLE_OBJECT
index 3a3844f..3f73eb6 100644 (file)
@@ -20,7 +20,8 @@
 
 #pragma once
 
-#include <QDebug>
+#include "common-export.h"
+
 #include <QString>
 #include <QStringList>
 #include <QRegExp>
@@ -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
index a94802d..62e070d 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QPointer>
 #include <QString>
 
@@ -27,7 +29,7 @@
 #include "protocol.h"
 #include "signalproxy.h"
 
-class InternalPeer : public Peer
+class COMMON_EXPORT InternalPeer : public Peer
 {
     Q_OBJECT
 
index 68c3683..7275cd6 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QHash>
 #include <QSet>
 #include <QString>
@@ -31,7 +33,7 @@
 class IrcUser;
 class Network;
 
-class IrcChannel : public SyncableObject
+class COMMON_EXPORT IrcChannel : public SyncableObject
 {
     Q_OBJECT
     SYNCABLE_OBJECT
index 1747ac6..e5a2313 100644 (file)
  *   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 &params = 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 &params = 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
index 037daf7..00128a3 100644 (file)
@@ -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
index 4162a85..0b230eb 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QSet>
 #include <QString>
 #include <QStringList>
@@ -33,7 +35,7 @@ class SignalProxy;
 class Network;
 class IrcChannel;
 
-class IrcUser : public SyncableObject
+class COMMON_EXPORT IrcUser : public SyncableObject
 {
     Q_OBJECT
     SYNCABLE_OBJECT
index e6701fe..9d80305 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <vector>
 
 #include <QDateTime>
@@ -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
 
index e1e908f..bd9acc6 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QStringList>
 #include <QTextStream>
 
@@ -31,7 +33,7 @@
  *
  * Very similar in concept to qDebug() and friends.
  */
-class LogMessage
+class COMMON_EXPORT LogMessage
 {
 public:
     LogMessage(Logger::LogLevel level);
index 45a8286..1088b09 100644 (file)
@@ -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 <QCoreApplication>
 #include <QDateTime>
@@ -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
index 8c1e396..dfe81d0 100644 (file)
@@ -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
index 80e4686..410931f 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QString>
 #include <QStringList>
 #include <QList>
@@ -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)
index 5f234f5..85d1f56 100644 (file)
 
 #pragma once
 
+#include "common-export.h"
+
 #include "syncableobject.h"
 
-class NetworkConfig : public SyncableObject
+class COMMON_EXPORT NetworkConfig : public SyncableObject
 {
     Q_OBJECT
     SYNCABLE_OBJECT
index 961aa6b..fcae0b4 100644 (file)
@@ -18,8 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef NETWORKEVENT_H
-#define NETWORKEVENT_H
+#pragma once
 
 #include <QStringList>
 #include <QVariantList>
@@ -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
index e6757b7..78a8e8f 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QHash>
 #include <QString>
 #include <QStringList>
@@ -30,7 +32,7 @@
 /**
  * Nickname matcher with automatic caching for performance
  */
-class NickHighlightMatcher
+class COMMON_EXPORT NickHighlightMatcher
 {
 public:
     /// Nickname highlighting mode
index c77c6bf..345889a 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QAbstractSocket>
 #include <QDataStream>
 #include <QPointer>
@@ -29,7 +31,7 @@
 #include "quassel.h"
 #include "signalproxy.h"
 
-class Peer : public QObject
+class COMMON_EXPORT Peer : public QObject
 {
     Q_OBJECT
 
index da93667..f78cf0c 100644 (file)
@@ -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 <QPair>
 
@@ -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
index 57187dc..253e56e 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef PRESETNETWORKS_H
-#define PRESETNETWORKS_H
+#pragma once
+
+#include "common-export.h"
 
 #include <QString>
 #include <QStringList>
 
 #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
index 2b57a31..fd1dfd7 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <functional>
 #include <vector>
 
@@ -38,7 +40,7 @@ class QFile;
 
 class Logger;
 
-class Quassel : public QObject, public Singleton<Quassel>
+class COMMON_EXPORT Quassel : public QObject, public Singleton<Quassel>
 {
     // TODO Qt5: Use Q_GADGET
     Q_OBJECT
@@ -263,7 +265,7 @@ private:
  *
  * @sa Quassel::Feature
  */
-class Quassel::Features
+class COMMON_EXPORT Quassel::Features
 {
 public:
     /**
index 7bf7944..d29236c 100644 (file)
@@ -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 <QDateTime>
 
@@ -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
index 681e5b2..a575172 100644 (file)
@@ -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 <QCoreApplication>
 #include <QHash>
@@ -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
index a3d7703..d4e920e 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QEvent>
 #include <QSet>
 
@@ -34,7 +36,7 @@ class QIODevice;
 class Peer;
 class SyncableObject;
 
-class SignalProxy : public QObject
+class COMMON_EXPORT SignalProxy : public QObject
 {
     Q_OBJECT
 
index b3e4dfd..a3c9652 100644 (file)
 
 #pragma once
 
-#include <QtGlobal>
+#include <iostream>
+
+// 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<typename T>
+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<T>(instance);
     }
 
     // Satisfy Rule of Five
@@ -73,8 +111,7 @@ public:
      */
     ~Singleton()
     {
-        _instance = nullptr;
-        _destroyed = true;
+        detail::getOrSetInstance<T>(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<T>();
     }
-
-private:
-    static T *_instance;
-    static bool _destroyed;
-
 };
-
-template<typename T>
-T *Singleton<T>::_instance{nullptr};
-
-template<typename T>
-bool Singleton<T>::_destroyed{false};
index af52974..91e1e70 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QDataStream>
 #include <QMetaType>
 #include <QObject>
@@ -50,7 +52,7 @@
 #define ARG(x) const_cast<void *>(reinterpret_cast<const void *>(&x))
 #define NO_ARG 0
 
-class SyncableObject : public QObject
+class COMMON_EXPORT SyncableObject : public QObject
 {
     Q_OBJECT
 
index a77676d..aa9da69 100644 (file)
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QHostAddress>
 #include <QUuid>
 
 #include "peer.h"
 #include "syncableobject.h"
 
-class Transfer : public SyncableObject
+class COMMON_EXPORT Transfer : public SyncableObject
 {
     Q_OBJECT
     SYNCABLE_OBJECT
index 94dbbfb..49f04c6 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QHash>
 #include <QList>
 #include <QUuid>
@@ -28,7 +30,7 @@
 
 class Transfer;
 
-class TransferManager : public SyncableObject
+class COMMON_EXPORT TransferManager : public SyncableObject
 {
     Q_OBJECT
     SYNCABLE_OBJECT
index 0db903e..ba73f4d 100644 (file)
 
 #pragma once
 
+#include "common-export.h"
+
 #include <QList>
 #include <QString>
 #include <QVariant>
 
-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<typename T>
 QVariantList toVariantList(const QList<T> &list)
@@ -70,7 +72,7 @@ QList<T> fromVariantList(const QVariantList &variants)
 }
 
 
-QByteArray prettyDigest(const QByteArray &digest);
+COMMON_EXPORT QByteArray prettyDigest(const QByteArray &digest);
 
 /**
  * Format a string with %%<text>%% 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);
index 57e5437..a4cc809 100644 (file)
@@ -1,4 +1,4 @@
-quassel_add_module(Core)
+quassel_add_module(Core EXPORT)
 
 target_sources(${TARGET} PRIVATE
     abstractsqlstorage.cpp
index 021d9c9..45d0607 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "core-export.h"
+
 #include <memory>
 #include <vector>
 
@@ -59,7 +61,7 @@ struct NetworkInfo;
 class AbstractSqlMigrationReader;
 class AbstractSqlMigrationWriter;
 
-class Core : public QObject, public Singleton<Core>
+class CORE_EXPORT Core : public QObject, public Singleton<Core>
 {
     Q_OBJECT
 
index 216eda0..6f9e9ba 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "core-export.h"
+
 #include <memory>
 
 #include <QCoreApplication>
@@ -29,7 +31,7 @@
 
 class Core;
 
-class CoreApplication : public QCoreApplication
+class CORE_EXPORT CoreApplication : public QCoreApplication
 {
     Q_OBJECT
 
index 10100d8..eee27cb 100644 (file)
@@ -1,4 +1,4 @@
-quassel_add_module(QtUi)
+quassel_add_module(QtUi EXPORT)
 
 target_sources(${TARGET} PRIVATE
     aboutdlg.cpp
index 3d81612..f5f5c3f 100644 (file)
@@ -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
index 8d8608e..39eea07 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "qtui-export.h"
+
 #include <memory>
 
 #include <QApplication>
@@ -32,7 +34,7 @@
 
 class QtUi;
 
-class QtUiApplication : public QApplication
+class QTUI_EXPORT QtUiApplication : public QApplication
 {
     Q_OBJECT
 
index 5d0982c..839ecc8 100644 (file)
@@ -1,4 +1,4 @@
-quassel_add_module(UiSupport)
+quassel_add_module(UiSupport EXPORT)
 
 target_sources(${TARGET} PRIVATE
     aboutdata.cpp
index bfbe39c..de27cbb 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "uisupport-export.h"
+
 #include <QList>
 #include <QLocale>
 #include <QString>
@@ -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:
index 9af43ca..5b6bb7b 100644 (file)
@@ -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
index d244899..a981667 100644 (file)
@@ -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 <QWidget>
 #include <QAbstractItemModel>
@@ -29,7 +30,7 @@
 #include <QAbstractItemDelegate>
 #include <QPointer>
 
-class AbstractItemView : public QWidget
+class UISUPPORT_EXPORT AbstractItemView : public QWidget
 {
     Q_OBJECT
 
@@ -58,6 +59,3 @@ protected:
     QPointer<QAbstractItemModel> _model;
     QPointer<QItemSelectionModel> _selectionModel;
 };
-
-
-#endif // ABSTRACTITEMVIEW_H
index 2fe30c3..7d6b1d9 100644 (file)
@@ -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 <QObject>
 #include <QString>
@@ -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
index 62bc8a3..ba03a24 100644 (file)
@@ -22,6 +22,8 @@
 
 #pragma once
 
+#include "uisupport-export.h"
+
 #include <QShortcut>
 #include <QWidgetAction>
 
@@ -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
 
index 5de038f..a675fdd 100644 (file)
@@ -22,6 +22,8 @@
 
 #pragma once
 
+#include "uisupport-export.h"
+
 #ifndef HAVE_KDE
 
 #include <QDebug>
@@ -35,7 +37,7 @@ class QWidget;
 class Action;
 class QAction;
 
-class ActionCollection : public QObject
+class UISUPPORT_EXPORT ActionCollection : public QObject
 {
     Q_OBJECT
 
index abfc26d..60c8039 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef BUFFERHOTLISTFILTER_H
-#define BUFFERHOTLISTFILTER_H
+#pragma once
+
+#include "uisupport-export.h"
 
 #include <QSortFilterProxyModel>
 #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
index 47a519f..52210ca 100644 (file)
@@ -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 <QAction>
 #include <QMenu>
@@ -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
index 1f53083..f53662a 100644 (file)
@@ -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 <QAction>
 #include <QDropEvent>
@@ -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_
index f12f9c3..2b43bf9 100644 (file)
@@ -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 <QSortFilterProxyModel>
 
@@ -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_
index 0abd72f..5369222 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef CLEARABLELINEEDIT_H
-#define CLEARABLELINEEDIT_H
+#pragma once
+
+#include "uisupport-export.h"
 
 #include <QLineEdit>
 
 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
index 8d1c2f7..a57513f 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "uisupport-export.h"
+
 #include <vector>
 
 #include <QStackedWidget>
@@ -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<Clickable>
+class UISUPPORT_EXPORT ClickableList : public std::vector<Clickable>
 {
 public:
     static ClickableList fromString(const QString &);
index 1f7247d..0bd2032 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef CLICKABLELABEL_H
-#define CLICKABLELABEL_H
+#pragma once
+
+#include "uisupport-export.h"
 
 #include <QLabel>
 
-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
index 43abf02..48811f6 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef COLORBUTTON_H_
-#define COLORBUTTON_H_
+#pragma once
+
+#include "uisupport-export.h"
 
 #include <QToolButton>
 
-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
index 2835eaf..a9c76bf 100644 (file)
  *   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<QAction *> _ignoreDescriptions;
 };
-
-
-#endif
index db37d04..ca362b9 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef FLATPROXYMODEL_H
-#define FLATPROXYMODEL_H
+#pragma once
+
+#include "uisupport-export.h"
 
 #include <QAbstractProxyModel>
 
-class FlatProxyModel : public QAbstractProxyModel
+class UISUPPORT_EXPORT FlatProxyModel : public QAbstractProxyModel
 {
     Q_OBJECT
 
@@ -121,6 +122,3 @@ private:
 
     friend class FlatProxyModel;
 };
-
-
-#endif //FLATPROXYMODEL_H
index 7f9a745..1359f7d 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef FONTSELECTOR_H_
-#define FONTSELECTOR_H_
+#pragma once
+
+#include "uisupport-export.h"
 
 #include <QLabel>
 #include <QWidget>
 
-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_
index 3b94544..ebf9871 100644 (file)
@@ -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 <Carbon/Carbon.h>
 #endif
 
-class GraphicalUi : public AbstractUi, protected Singleton<GraphicalUi>
+class UISUPPORT_EXPORT GraphicalUi : public AbstractUi, protected Singleton<GraphicalUi>
 {
     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
index 18ec665..17ed902 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "uisupport-export.h"
+
 #include <vector>
 
 #include <QIcon>
@@ -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<QString> &iconNames, const QString &fallbackPath = {});
+UISUPPORT_EXPORT QIcon get(const std::vector<QString> &iconNames, const QString &fallbackPath = {});
 
 }
index b4badfb..63b67eb 100644 (file)
@@ -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 <QKeyEvent>
 #include <QHash>
@@ -38,7 +39,7 @@
 #  include <Sonnet/SpellCheckDecorator>
 #endif
 
-class MultiLineEdit : public MultiLineEditParent
+class UISUPPORT_EXPORT MultiLineEdit : public MultiLineEditParent
 {
     Q_OBJECT
 
@@ -153,6 +154,3 @@ private:
     Sonnet::SpellCheckDecorator *_spellCheckDecorator{nullptr};
 #endif
 };
-
-
-#endif
index 4b85957..ea7ab65 100644 (file)
@@ -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 <QDialog>
 
@@ -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
index f7a56c8..4bdc7d0 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef NICKVIEW_H_
-#define NICKVIEW_H_
+#pragma once
+
+#include "uisupport-export.h"
 
 #include <QTreeView>
 
 #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
index ce029cc..b8c0551 100644 (file)
@@ -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 <QSortFilterProxyModel>
 
@@ -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
index dfd9814..08baf2c 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef RESIZINGSTACKEDWIDGET_H_
-#define RESIZINGSTACKEDWIDGET_H_
+#pragma once
+
+#include "uisupport-export.h"
 
 #include <QStackedWidget>
 
-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_
index 667c908..c6c28cd 100644 (file)
@@ -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 <QWidget>
 
@@ -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
index 668ebd7..6bcdb93 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef STYLEDLABEL_H
-#define STYLEDLABEL_H
+#pragma once
+
+#include "uisupport-export.h"
 
 #include <QFrame>
 
 #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
index b10fe7c..9d58d44 100644 (file)
@@ -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 <QPointer>
 #include <QString>
@@ -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
index 8ca5dae..a341be9 100644 (file)
  *   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
index c9c0c5a..7b94039 100644 (file)
 
 #pragma once
 
+#include "uisupport-export.h"
+
 #include <QTreeView>
 
 /**
 * This class handles Touch Events for TreeViews
 */
-class TreeViewTouch : public QTreeView
+class UISUPPORT_EXPORT TreeViewTouch : public QTreeView
 {
     Q_OBJECT
 
index fa18ebe..3fc627e 100644 (file)
  *   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
index 661e025..6febcd5 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "uisupport-export.h"
+
 #include <utility>
 #include <vector>
 
@@ -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 ----------------------------------------------------------