added missing services in RsPluginInterface class

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6946 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-12-15 19:35:14 +00:00
parent d26d6fa355
commit d839301b7c
2 changed files with 32 additions and 14 deletions

View File

@ -26,6 +26,7 @@
#pragma once
#include <time.h>
#include <string.h>
#include <stdint.h>
#include <string>
#include <vector>
@ -37,6 +38,10 @@ class RsPluginHandler ;
extern RsPluginHandler *rsPlugins ;
class p3Service ;
class RsTurtle ;
class RsDht ;
class RsDisc ;
class RsMsgs ;
class p3LinkMgr ;
class MainPage ;
class QIcon ;
@ -82,10 +87,16 @@ class RsPlugInInterfaces {
public:
RsPlugInInterfaces() { mPeers = NULL; mFiles = NULL; }
RsPeers* mPeers;
RsFiles* mFiles;
RsPlugInInterfaces()
{
memset(this,0,sizeof(RsPlugInInterfaces)) ; // zero all pointers.
}
RsPeers *mPeers;
RsFiles *mFiles;
RsMsgs *mMsgs;
RsTurtle *mTurtle;
RsDisc *mDisc;
RsDht *mDht;
};
class RsPlugin

View File

@ -2194,12 +2194,6 @@ int RsServer::StartupRetroShare()
//
mPluginsManager->loadPlugins(programatically_inserted_plugins) ;
// set interfaces for plugins
RsPlugInInterfaces interfaces;
interfaces.mFiles = rsFiles;
interfaces.mPeers = rsPeers;
mPluginsManager->setInterfaces(interfaces);
/* create Services */
ad = new p3disc(mPeerMgr, mLinkMgr, mNetMgr, pqih);
msgSrv = new p3MsgService(mLinkMgr);
@ -2222,6 +2216,23 @@ int RsServer::StartupRetroShare()
rsTurtle = tr ;
pqih -> addService(tr);
rsDisc = new p3Discovery(ad);
rsMsgs = new p3Msgs(msgSrv, chatSrv);
// set interfaces for plugins
//
RsPlugInInterfaces interfaces;
interfaces.mFiles = rsFiles;
interfaces.mPeers = rsPeers;
interfaces.mMsgs = rsMsgs;
interfaces.mTurtle = rsTurtle;
interfaces.mDisc = rsDisc;
interfaces.mDht = rsDht;
mPluginsManager->setInterfaces(interfaces);
// connect components to turtle router.
ftserver->connectToTurtleRouter(tr) ;
chatSrv->connectToTurtleRouter(tr) ;
msgSrv->connectToTurtleRouter(tr) ;
@ -2724,16 +2735,12 @@ int RsServer::StartupRetroShare()
/* Setup GUI Interfaces. */
rsDisc = new p3Discovery(ad);
rsBandwidthControl = mBwCtrl;
rsConfig = serverConfig;
rsMsgs = new p3Msgs(msgSrv, chatSrv);
rsForums = mForums;
rsChannels = mChannels;
#ifdef RS_USE_BLOGS
rsBlogs = mBlogs;
#endif