From d53993c2a0a9e3ade37a331519260692b3879bda Mon Sep 17 00:00:00 2001 From: Konrad Date: Sat, 6 Jan 2018 18:39:47 +0100 Subject: [PATCH] Changed in Libresapi: Pointer to RsNotify object into reference --- libresapi/src/api/ApiServer.cpp | 4 ++-- libresapi/src/api/FileSharingHandler.cpp | 6 +++--- libresapi/src/api/FileSharingHandler.h | 4 ++-- libresapi/src/api/TransfersHandler.cpp | 6 +++--- libresapi/src/api/TransfersHandler.h | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libresapi/src/api/ApiServer.cpp b/libresapi/src/api/ApiServer.cpp index d2f672e40..db8b75d16 100644 --- a/libresapi/src/api/ApiServer.cpp +++ b/libresapi/src/api/ApiServer.cpp @@ -236,8 +236,8 @@ public: mForumHandler(ifaces.mGxsForums), mServiceControlHandler(ifaces.mServiceControl), mFileSearchHandler(sts, ifaces.mNotify, ifaces.mTurtle, ifaces.mFiles), - mFileSharingHandler(sts, ifaces.mFiles, ifaces.mNotify), - mTransfersHandler(sts, ifaces.mFiles, ifaces.mPeers, ifaces.mNotify), + mFileSharingHandler(sts, ifaces.mFiles, *ifaces.mNotify), + mTransfersHandler(sts, ifaces.mFiles, ifaces.mPeers, *ifaces.mNotify), mChatHandler(sts, ifaces.mNotify, ifaces.mMsgs, ifaces.mPeers, ifaces.mIdentity, &mPeersHandler), mApiPluginHandler(sts, ifaces), mChannelsHandler(ifaces.mGxsChannels), diff --git a/libresapi/src/api/FileSharingHandler.cpp b/libresapi/src/api/FileSharingHandler.cpp index b1faf338a..b8645ec2a 100644 --- a/libresapi/src/api/FileSharingHandler.cpp +++ b/libresapi/src/api/FileSharingHandler.cpp @@ -22,7 +22,7 @@ namespace resource_api { FileSharingHandler::FileSharingHandler(StateTokenServer *sts, RsFiles *files, - RsNotify* notify): + RsNotify& notify): mStateTokenServer(sts), mRsFiles(files), mNotify(notify), mMtx("FileSharingHandler Mtx") { @@ -44,12 +44,12 @@ FileSharingHandler::FileSharingHandler(StateTokenServer *sts, RsFiles *files, mLocalDirStateToken = mStateTokenServer->getNewToken(); mRemoteDirStateToken = mStateTokenServer->getNewToken(); - mNotify->registerNotifyClient(this); + mNotify.registerNotifyClient(this); } FileSharingHandler::~FileSharingHandler() { - mNotify->unregisterNotifyClient(this); + mNotify.unregisterNotifyClient(this); } void FileSharingHandler::notifyListChange(int list, int /* type */) diff --git a/libresapi/src/api/FileSharingHandler.h b/libresapi/src/api/FileSharingHandler.h index 1205cf5cd..d2dad346f 100644 --- a/libresapi/src/api/FileSharingHandler.h +++ b/libresapi/src/api/FileSharingHandler.h @@ -31,7 +31,7 @@ namespace resource_api class FileSharingHandler: public ResourceRouter, NotifyClient { public: - FileSharingHandler(StateTokenServer* sts, RsFiles* files, RsNotify* notify); + FileSharingHandler(StateTokenServer* sts, RsFiles* files, RsNotify& notify); ~FileSharingHandler(); // from NotifyClient @@ -61,7 +61,7 @@ private: RsMutex mMtx; // Inherited virtual functions of NotifyClient may be called from foreing thread RsFiles* mRsFiles; - RsNotify* mNotify; + RsNotify& mNotify; }; } // namespace resource_api diff --git a/libresapi/src/api/TransfersHandler.cpp b/libresapi/src/api/TransfersHandler.cpp index 83b0039b7..39e9c5875 100644 --- a/libresapi/src/api/TransfersHandler.cpp +++ b/libresapi/src/api/TransfersHandler.cpp @@ -7,7 +7,7 @@ namespace resource_api { TransfersHandler::TransfersHandler(StateTokenServer *sts, RsFiles *files, RsPeers *peers, - RsNotify* notify): + RsNotify& notify): mStateTokenServer(sts), mFiles(files), mRsPeers(peers), mLastUpdateTS(0), mNotify(notify), mMtx("TransfersHandler") { @@ -17,13 +17,13 @@ TransfersHandler::TransfersHandler(StateTokenServer *sts, RsFiles *files, RsPeer addResourceHandler("control_download", this, &TransfersHandler::handleControlDownload); mStateToken = mStateTokenServer->getNewToken(); mStateTokenServer->registerTickClient(this); - mNotify->registerNotifyClient(this); + mNotify.registerNotifyClient(this); } TransfersHandler::~TransfersHandler() { mStateTokenServer->unregisterTickClient(this); - mNotify->unregisterNotifyClient(this); + mNotify.unregisterNotifyClient(this); } void TransfersHandler::notifyListChange(int list, int /* type */) diff --git a/libresapi/src/api/TransfersHandler.h b/libresapi/src/api/TransfersHandler.h index 0db387073..39659d97a 100644 --- a/libresapi/src/api/TransfersHandler.h +++ b/libresapi/src/api/TransfersHandler.h @@ -13,7 +13,7 @@ namespace resource_api class TransfersHandler: public ResourceRouter, Tickable, NotifyClient { public: - TransfersHandler(StateTokenServer* sts, RsFiles* files, RsPeers *peers, RsNotify* notify); + TransfersHandler(StateTokenServer* sts, RsFiles* files, RsPeers *peers, RsNotify& notify); virtual ~TransfersHandler(); // from NotifyClient @@ -30,7 +30,7 @@ private: StateTokenServer* mStateTokenServer; RsFiles* mFiles; RsPeers* mRsPeers; - RsNotify* mNotify; + RsNotify& mNotify; RsMutex mMtx; StateToken mStateToken;