/***************************************************************************
- * Copyright (C) 2005-2016 by the Quassel Project *
+ * Copyright (C) 2005-2018 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#pragma once
+#include "common-export.h"
+
#include <QEvent>
#include <QSet>
class Peer;
class SyncableObject;
-class SignalProxy : public QObject
+class COMMON_EXPORT SignalProxy : public QObject
{
Q_OBJECT
SignalProxy(QObject *parent);
SignalProxy(ProxyMode mode, QObject *parent);
- virtual ~SignalProxy();
+ ~SignalProxy() override;
void setProxyMode(ProxyMode mode);
inline ProxyMode proxyMode() const { return _proxyMode; }
void dumpProxyStats();
void dumpSyncMap(SyncableObject *object);
- static SignalProxy *current() {
- return _current;
- }
+ static SignalProxy *current();
/**@{*/
/**
}
//A better version, but only implemented on Qt5 if Initializer Lists exist
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#ifdef Q_COMPILER_INITIALIZER_LISTS
void restrictTargetPeers(std::initializer_list<Peer*> peers, std::function<void()> closure) {
restrictTargetPeers(QSet<Peer*>(peers), std::move(closure));
}
-#endif
#endif
/**}@*/
void detachSlots(QObject *receiver);
protected:
- void customEvent(QEvent *event);
+ void customEvent(QEvent *event) override;
void sync_call__(const SyncableObject *obj, ProxyMode modeType, const char *funcname, va_list ap);
void renameObject(const SyncableObject *obj, const QString &newname, const QString &oldname);
template<class T>
void handle(Peer *, T) { Q_ASSERT(0); }
- bool invokeSlot(QObject *receiver, int methodId, const QVariantList ¶ms, QVariant &returnValue, Peer *peer = 0);
- bool invokeSlot(QObject *receiver, int methodId, const QVariantList ¶ms = QVariantList(), Peer *peer = 0);
+ bool invokeSlot(QObject *receiver, int methodId, const QVariantList ¶ms, QVariant &returnValue, Peer *peer = nullptr);
+ bool invokeSlot(QObject *receiver, int methodId, const QVariantList ¶ms = QVariantList(), Peer *peer = nullptr);
void requestInit(SyncableObject *obj);
QVariantMap initData(SyncableObject *obj) const;
Peer *_sourcePeer = nullptr;
Peer *_targetPeer = nullptr;
- thread_local static SignalProxy *_current;
-
friend class SignalRelay;
friend class SyncableObject;
friend class Peer;