Changed in Libresapi: Pointer to RsNotify object into reference

This commit is contained in:
Konrad 2018-01-06 18:39:47 +01:00
parent 4026040b49
commit d53993c2a0
5 changed files with 12 additions and 12 deletions

View File

@ -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),

View File

@ -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 */)

View File

@ -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

View File

@ -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 */)

View File

@ -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;