Added cleanup code for GXS services in rsinit (services now based in GXS_phase1 folder in .retroshare/ folder

disabled msg synchronisation by default through compilation #define (use GXS_ENABLE_MSG_SYNC to enable message sync)
Finally removed v2 suffix from all photo components and filenames (please edit your libretroshare.pro file accordingly)



git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5883 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2012-11-24 19:49:23 +00:00
parent da39d1de77
commit 744a78b140
20 changed files with 2202 additions and 2179 deletions

View File

@ -86,6 +86,8 @@ void RsGxsNetService::syncWithPeers()
sendItem(grp); sendItem(grp);
} }
#ifdef GXS_ENABLE_SYNC_MSGS
std::map<RsGxsGroupId, RsGxsGrpMetaData* > grpMeta; std::map<RsGxsGroupId, RsGxsGrpMetaData* > grpMeta;
mDataStore->retrieveGxsGrpMetaData(grpMeta); mDataStore->retrieveGxsGrpMetaData(grpMeta);
@ -123,6 +125,7 @@ void RsGxsNetService::syncWithPeers()
sendItem(msg); sendItem(msg);
} }
} }
#endif
} }
bool RsGxsNetService::loadList(std::list<RsItem*>& load) bool RsGxsNetService::loadList(std::list<RsItem*>& load)

View File

@ -32,8 +32,8 @@
#include "rsgxsservice.h" #include "rsgxsservice.h"
/* The Main Interface Class - for information about your Peers */ /* The Main Interface Class - for information about your Peers */
class RsPhotoV2; class RsPhoto;
extern RsPhotoV2 *rsPhotoV2; extern RsPhoto *rsPhoto;
/******************* NEW STUFF FOR NEW CACHE SYSTEM *********/ /******************* NEW STUFF FOR NEW CACHE SYSTEM *********/
@ -176,7 +176,7 @@ typedef std::map<RsGxsGroupId, std::vector<RsPhotoPhoto> > PhotoResult;
typedef std::map<RsGxsGroupId, std::vector<RsPhotoComment> > PhotoCommentResult; typedef std::map<RsGxsGroupId, std::vector<RsPhotoComment> > PhotoCommentResult;
typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsPhotoComment> > PhotoRelatedCommentResult; typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsPhotoComment> > PhotoRelatedCommentResult;
class RsPhotoV2 class RsPhoto
{ {
public: public:
@ -186,9 +186,9 @@ public:
static const uint32_t FLAG_MSG_TYPE_MASK; static const uint32_t FLAG_MSG_TYPE_MASK;
RsPhotoV2() { return; } RsPhoto() { return; }
virtual ~RsPhotoV2() { return; } virtual ~RsPhoto() { return; }
/*! /*!
* Use to enquire if groups or msgs have changed * Use to enquire if groups or msgs have changed

View File

@ -1827,7 +1827,7 @@ RsTurtle *rsTurtle = NULL ;
#include "services/p3idservice.h" #include "services/p3idservice.h"
#include "services/p3wiki.h" #include "services/p3wiki.h"
#include "services/p3posted.h" #include "services/p3posted.h"
#include "services/p3photoserviceV2.h" #include "services/p3photoservice.h"
#include "services/p3gxsforums.h" #include "services/p3gxsforums.h"
// Not too many to convert now! // Not too many to convert now!
@ -2278,9 +2278,28 @@ int RsServer::StartupRetroShare()
mPluginsManager->registerCacheServices() ; mPluginsManager->registerCacheServices() ;
#ifdef ENABLE_GXS_SERVICES #ifdef ENABLE_GXS_SERVICES
// The idea is that if priorGxsDir is non
// empty and matches an exist directory location
// the given ssl user id then this directory is cleaned
// and deleted
std::string priorGxsDir = "./" + mLinkMgr->getOwnId() + "/", currGxsDir = RsInitConfig::configDir + "/GXS_phase1";
bool cleanUpGxsDir = false;
if(!priorGxsDir.empty())
cleanUpGxsDir = RsDirUtil::checkDirectory(priorGxsDir);
std::list<std::string> filesToKeep;
bool cleanUpSuccess = RsDirUtil::cleanupDirectory(priorGxsDir, filesToKeep);
if(!cleanUpSuccess)
std::cerr << "RsInit::StartupRetroShare() Clean up of Old Gxs Dir Failed!";
else
rmdir(priorGxsDir.c_str());
RsDirUtil::checkCreateDirectory(currGxsDir);
// Testing New Cache Services. // Testing New Cache Services.
//p3WikiServiceVEG *mWikis = new p3WikiServiceVEG(RS_SERVICE_GXSV1_TYPE_WIKI); //p3WikiServiceVEG *mWikis = new p3WikiServiceVEG(RS_SERVICE_GXSV1_TYPE_WIKI);
//pqih -> addService(mWikis); //pqih -> addService(mWikis);
@ -2295,7 +2314,7 @@ int RsServer::StartupRetroShare()
// TODO: temporary to store GXS service data, remove // TODO: temporary to store GXS service data, remove
RsDirUtil::checkCreateDirectory(mLinkMgr->getOwnId()); RsDirUtil::checkCreateDirectory(currGxsDir);
RsNxsNetMgr* nxsMgr = new RsNxsNetMgrImpl(mLinkMgr); RsNxsNetMgr* nxsMgr = new RsNxsNetMgrImpl(mLinkMgr);
@ -2303,7 +2322,7 @@ int RsServer::StartupRetroShare()
p3IdService *mGxsIdService = NULL; p3IdService *mGxsIdService = NULL;
RsGeneralDataService* gxsid_ds = new RsDataService("./" + mLinkMgr->getOwnId() + "/", "gxsid_db", RsGeneralDataService* gxsid_ds = new RsDataService(currGxsDir + "/", "gxsid_db",
RS_SERVICE_GXSV1_TYPE_GXSID, NULL); RS_SERVICE_GXSV1_TYPE_GXSID, NULL);
gxsid_ds->resetDataStore(); gxsid_ds->resetDataStore();
@ -2338,27 +2357,27 @@ int RsServer::StartupRetroShare()
RsGenExchange::setAuthenPolicyFlag(flag, photoAuthenPolicy, RsGenExchange::setAuthenPolicyFlag(flag, photoAuthenPolicy,
RsGenExchange::GRP_OPTION_BITS); RsGenExchange::GRP_OPTION_BITS);
p3PhotoServiceV2 *mPhotoV2 = NULL; p3PhotoService *mPhoto = NULL;
RsGeneralDataService* photo_ds = new RsDataService("./" + mLinkMgr->getOwnId() + "/", "photoV2_db", RsGeneralDataService* photo_ds = new RsDataService(currGxsDir + "/", "photoV2_db",
RS_SERVICE_GXSV1_TYPE_PHOTO, NULL); RS_SERVICE_GXSV1_TYPE_PHOTO, NULL);
photo_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing photo_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing
// init gxs services // init gxs services
mPhotoV2 = new p3PhotoServiceV2(photo_ds, NULL, mGxsIdService, photoAuthenPolicy); mPhoto = new p3PhotoService(photo_ds, NULL, mGxsIdService, photoAuthenPolicy);
// create GXS photo service // create GXS photo service
RsGxsNetService* photo_ns = new RsGxsNetService( RsGxsNetService* photo_ns = new RsGxsNetService(
RS_SERVICE_GXSV1_TYPE_PHOTO, photo_ds, nxsMgr, mPhotoV2); RS_SERVICE_GXSV1_TYPE_PHOTO, photo_ds, nxsMgr, mPhoto);
/**** Posted GXS service ****/ /**** Posted GXS service ****/
p3Posted *mPosted = NULL; p3Posted *mPosted = NULL;
RsGeneralDataService* posted_ds = new RsDataService("./" + mLinkMgr->getOwnId()+ "/", "posted_db", RsGeneralDataService* posted_ds = new RsDataService(currGxsDir + "/", "posted_db",
RS_SERVICE_GXSV1_TYPE_POSTED); RS_SERVICE_GXSV1_TYPE_POSTED);
posted_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing posted_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing
@ -2374,7 +2393,7 @@ int RsServer::StartupRetroShare()
p3Wiki *mWiki = NULL; p3Wiki *mWiki = NULL;
RsGeneralDataService* wiki_ds = new RsDataService("./" + mLinkMgr->getOwnId()+ "/", "wiki_db", RsGeneralDataService* wiki_ds = new RsDataService(currGxsDir + "/", "wiki_db",
RS_SERVICE_GXSV1_TYPE_WIKI); RS_SERVICE_GXSV1_TYPE_WIKI);
wiki_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing wiki_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing
@ -2389,7 +2408,7 @@ int RsServer::StartupRetroShare()
p3GxsForums *mGxsForums = NULL; p3GxsForums *mGxsForums = NULL;
RsGeneralDataService* gxsforums_ds = new RsDataService("./" + mLinkMgr->getOwnId()+ "/", "gxsforums_db", RsGeneralDataService* gxsforums_ds = new RsDataService(currGxsDir + "/", "gxsforums_db",
RS_SERVICE_GXSV1_TYPE_FORUMS); RS_SERVICE_GXSV1_TYPE_FORUMS);
gxsforums_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing gxsforums_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing
@ -2411,12 +2430,12 @@ int RsServer::StartupRetroShare()
//mGxsCore->addService(mGxsIdService); //mGxsCore->addService(mGxsIdService);
#if ENABLE_OTHER_GXS_SERVICES #if ENABLE_OTHER_GXS_SERVICES
createThread(*mGxsIdService); createThread(*mGxsIdService);
createThread(*mPhotoV2); createThread(*mPhoto);
createThread(*mPosted); createThread(*mPosted);
createThread(*mWiki); createThread(*mWiki);
createThread(*mGxsForums); createThread(*mGxsForums);
// //
// mGxsCore->addService(mPhotoV2); // mGxsCore->addService(mPhoto);
// mGxsCore->addService(mPosted); // mGxsCore->addService(mPosted);
// mGxsCore->addService(mWiki); // mGxsCore->addService(mWiki);
#endif #endif
@ -2707,7 +2726,7 @@ int RsServer::StartupRetroShare()
#if ENABLE_OTHER_GXS_SERVICES #if ENABLE_OTHER_GXS_SERVICES
rsWiki = mWiki; rsWiki = mWiki;
rsPosted = mPosted; rsPosted = mPosted;
rsPhotoV2 = mPhotoV2; rsPhoto = mPhoto;
rsGxsForums = mGxsForums; rsGxsForums = mGxsForums;
#endif #endif

View File

@ -25,7 +25,7 @@
#include <iostream> #include <iostream>
#include "rsphotov2items.h" #include "rsphotoitems.h"
#include "serialiser/rstlvbase.h" #include "serialiser/rstlvbase.h"
#include "serialiser/rsbaseserial.h" #include "serialiser/rsbaseserial.h"

View File

@ -33,7 +33,7 @@
#include "serialiser/rstlvtypes.h" #include "serialiser/rstlvtypes.h"
#include "rsgxsitems.h" #include "rsgxsitems.h"
#include "retroshare/rsphotoV2.h" #include "retroshare/rsphoto.h"
const uint8_t RS_PKT_SUBTYPE_PHOTO_ITEM = 0x02; const uint8_t RS_PKT_SUBTYPE_PHOTO_ITEM = 0x02;
const uint8_t RS_PKT_SUBTYPE_PHOTO_SHOW_ITEM = 0x03; const uint8_t RS_PKT_SUBTYPE_PHOTO_SHOW_ITEM = 0x03;

View File

@ -1,13 +1,13 @@
#include "p3photoserviceV2.h" #include "p3photoservice.h"
#include "serialiser/rsphotov2items.h" #include "serialiser/rsphotoitems.h"
#include "gxs/rsgxsflags.h" #include "gxs/rsgxsflags.h"
RsPhotoV2 *rsPhotoV2 = NULL; RsPhoto *rsPhoto = NULL;
const uint32_t RsPhotoV2::FLAG_MSG_TYPE_MASK = 0x000f; const uint32_t RsPhoto::FLAG_MSG_TYPE_MASK = 0x000f;
const uint32_t RsPhotoV2::FLAG_MSG_TYPE_PHOTO_POST = 0x0001; const uint32_t RsPhoto::FLAG_MSG_TYPE_PHOTO_POST = 0x0001;
const uint32_t RsPhotoV2::FLAG_MSG_TYPE_PHOTO_COMMENT = 0x0002; const uint32_t RsPhoto::FLAG_MSG_TYPE_PHOTO_COMMENT = 0x0002;
@ -86,7 +86,7 @@ std::ostream &operator<<(std::ostream &out, const RsPhotoAlbum &album)
return out; return out;
} }
p3PhotoServiceV2::p3PhotoServiceV2(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs, p3PhotoService::p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs,
uint32_t authenPolicy) uint32_t authenPolicy)
: RsGenExchange(gds, nes, new RsGxsPhotoSerialiser(), RS_SERVICE_GXSV1_TYPE_PHOTO, gixs, authenPolicy), : RsGenExchange(gds, nes, new RsGxsPhotoSerialiser(), RS_SERVICE_GXSV1_TYPE_PHOTO, gixs, authenPolicy),
mPhotoMutex(std::string("Photo Mutex")) mPhotoMutex(std::string("Photo Mutex"))
@ -107,7 +107,7 @@ p3PhotoServiceV2::p3PhotoServiceV2(RsGeneralDataService* gds, RsNetworkExchangeS
createDummyGroup(item2); createDummyGroup(item2);
} }
bool p3PhotoServiceV2::updated() bool p3PhotoService::updated()
{ {
RsStackMutex stack(mPhotoMutex); RsStackMutex stack(mPhotoMutex);
@ -116,14 +116,14 @@ bool p3PhotoServiceV2::updated()
return changed; return changed;
} }
void p3PhotoServiceV2::service_tick() void p3PhotoService::service_tick()
{ {
} }
void p3PhotoServiceV2::groupsChanged(std::list<RsGxsGroupId>& grpIds) void p3PhotoService::groupsChanged(std::list<RsGxsGroupId>& grpIds)
{ {
RsStackMutex stack(mPhotoMutex); RsStackMutex stack(mPhotoMutex);
@ -141,7 +141,7 @@ void p3PhotoServiceV2::groupsChanged(std::list<RsGxsGroupId>& grpIds)
} }
void p3PhotoServiceV2::msgsChanged( void p3PhotoService::msgsChanged(
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >& msgs) std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >& msgs)
{ {
RsStackMutex stack(mPhotoMutex); RsStackMutex stack(mPhotoMutex);
@ -156,20 +156,20 @@ void p3PhotoServiceV2::msgsChanged(
} }
RsTokenService* p3PhotoServiceV2::getTokenService() { RsTokenService* p3PhotoService::getTokenService() {
return RsGenExchange::getTokenService(); return RsGenExchange::getTokenService();
} }
bool p3PhotoServiceV2::getGroupList(const uint32_t& token, bool p3PhotoService::getGroupList(const uint32_t& token,
std::list<RsGxsGroupId>& groupIds) std::list<RsGxsGroupId>& groupIds)
{ {
return RsGenExchange::getGroupList(token, groupIds); return RsGenExchange::getGroupList(token, groupIds);
} }
bool p3PhotoServiceV2::getMsgList(const uint32_t& token, bool p3PhotoService::getMsgList(const uint32_t& token,
GxsMsgIdResult& msgIds) GxsMsgIdResult& msgIds)
{ {
@ -177,21 +177,21 @@ bool p3PhotoServiceV2::getMsgList(const uint32_t& token,
} }
bool p3PhotoServiceV2::getGroupSummary(const uint32_t& token, bool p3PhotoService::getGroupSummary(const uint32_t& token,
std::list<RsGroupMetaData>& groupInfo) std::list<RsGroupMetaData>& groupInfo)
{ {
return RsGenExchange::getGroupMeta(token, groupInfo); return RsGenExchange::getGroupMeta(token, groupInfo);
} }
bool p3PhotoServiceV2::getMsgSummary(const uint32_t& token, bool p3PhotoService::getMsgSummary(const uint32_t& token,
MsgMetaResult& msgInfo) MsgMetaResult& msgInfo)
{ {
return RsGenExchange::getMsgMeta(token, msgInfo); return RsGenExchange::getMsgMeta(token, msgInfo);
} }
bool p3PhotoServiceV2::getAlbum(const uint32_t& token, std::vector<RsPhotoAlbum>& albums) bool p3PhotoService::getAlbum(const uint32_t& token, std::vector<RsPhotoAlbum>& albums)
{ {
std::vector<RsGxsGrpItem*> grpData; std::vector<RsGxsGrpItem*> grpData;
bool ok = RsGenExchange::getGroupData(token, grpData); bool ok = RsGenExchange::getGroupData(token, grpData);
@ -215,7 +215,7 @@ bool p3PhotoServiceV2::getAlbum(const uint32_t& token, std::vector<RsPhotoAlbum>
} }
bool p3PhotoServiceV2::getPhoto(const uint32_t& token, PhotoResult& photos) bool p3PhotoService::getPhoto(const uint32_t& token, PhotoResult& photos)
{ {
GxsMsgDataMap msgData; GxsMsgDataMap msgData;
bool ok = RsGenExchange::getMsgData(token, msgData); bool ok = RsGenExchange::getMsgData(token, msgData);
@ -252,7 +252,7 @@ bool p3PhotoServiceV2::getPhoto(const uint32_t& token, PhotoResult& photos)
return ok; return ok;
} }
bool p3PhotoServiceV2::getPhotoComment(const uint32_t &token, PhotoCommentResult &comments) bool p3PhotoService::getPhotoComment(const uint32_t &token, PhotoCommentResult &comments)
{ {
GxsMsgDataMap msgData; GxsMsgDataMap msgData;
bool ok = RsGenExchange::getMsgData(token, msgData); bool ok = RsGenExchange::getMsgData(token, msgData);
@ -295,14 +295,14 @@ RsPhotoComment& RsPhotoComment::operator=(const RsGxsPhotoCommentItem& comment)
return *this; return *this;
} }
bool p3PhotoServiceV2::getPhotoRelatedComment(const uint32_t &token, PhotoRelatedCommentResult &comments) bool p3PhotoService::getPhotoRelatedComment(const uint32_t &token, PhotoRelatedCommentResult &comments)
{ {
return RsGenExchange::getMsgRelatedDataT<RsGxsPhotoCommentItem, RsPhotoComment>(token, comments); return RsGenExchange::getMsgRelatedDataT<RsGxsPhotoCommentItem, RsPhotoComment>(token, comments);
} }
bool p3PhotoServiceV2::submitAlbumDetails(uint32_t& token, RsPhotoAlbum& album) bool p3PhotoService::submitAlbumDetails(uint32_t& token, RsPhotoAlbum& album)
{ {
RsGxsPhotoAlbumItem* albumItem = new RsGxsPhotoAlbumItem(); RsGxsPhotoAlbumItem* albumItem = new RsGxsPhotoAlbumItem();
albumItem->album = album; albumItem->album = album;
@ -313,7 +313,7 @@ bool p3PhotoServiceV2::submitAlbumDetails(uint32_t& token, RsPhotoAlbum& album)
void p3PhotoServiceV2::notifyChanges(std::vector<RsGxsNotify*>& changes) void p3PhotoService::notifyChanges(std::vector<RsGxsNotify*>& changes)
{ {
RsStackMutex stack(mPhotoMutex); RsStackMutex stack(mPhotoMutex);
@ -340,7 +340,7 @@ void p3PhotoServiceV2::notifyChanges(std::vector<RsGxsNotify*>& changes)
} }
} }
bool p3PhotoServiceV2::submitPhoto(uint32_t& token, RsPhotoPhoto& photo) bool p3PhotoService::submitPhoto(uint32_t& token, RsPhotoPhoto& photo)
{ {
RsGxsPhotoPhotoItem* photoItem = new RsGxsPhotoPhotoItem(); RsGxsPhotoPhotoItem* photoItem = new RsGxsPhotoPhotoItem();
photoItem->photo = photo; photoItem->photo = photo;
@ -351,7 +351,7 @@ bool p3PhotoServiceV2::submitPhoto(uint32_t& token, RsPhotoPhoto& photo)
return true; return true;
} }
bool p3PhotoServiceV2::submitComment(uint32_t &token, RsPhotoComment &comment) bool p3PhotoService::submitComment(uint32_t &token, RsPhotoComment &comment)
{ {
RsGxsPhotoCommentItem* commentItem = new RsGxsPhotoCommentItem(); RsGxsPhotoCommentItem* commentItem = new RsGxsPhotoCommentItem();
commentItem->comment = comment; commentItem->comment = comment;
@ -362,20 +362,20 @@ bool p3PhotoServiceV2::submitComment(uint32_t &token, RsPhotoComment &comment)
return true; return true;
} }
bool p3PhotoServiceV2::acknowledgeMsg(const uint32_t& token, bool p3PhotoService::acknowledgeMsg(const uint32_t& token,
std::pair<RsGxsGroupId, RsGxsMessageId>& msgId) std::pair<RsGxsGroupId, RsGxsMessageId>& msgId)
{ {
return RsGenExchange::acknowledgeTokenMsg(token, msgId); return RsGenExchange::acknowledgeTokenMsg(token, msgId);
} }
bool p3PhotoServiceV2::acknowledgeGrp(const uint32_t& token, bool p3PhotoService::acknowledgeGrp(const uint32_t& token,
RsGxsGroupId& grpId) RsGxsGroupId& grpId)
{ {
return RsGenExchange::acknowledgeTokenGrp(token, grpId); return RsGenExchange::acknowledgeTokenGrp(token, grpId);
} }
bool p3PhotoServiceV2::subscribeToAlbum(uint32_t &token, const RsGxsGroupId &grpId, bool subscribe) bool p3PhotoService::subscribeToAlbum(uint32_t &token, const RsGxsGroupId &grpId, bool subscribe)
{ {
if(subscribe) if(subscribe)
RsGenExchange::setGroupSubscribeFlags(token, grpId, GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED, GXS_SERV::GROUP_SUBSCRIBE_MASK); RsGenExchange::setGroupSubscribeFlags(token, grpId, GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED, GXS_SERV::GROUP_SUBSCRIBE_MASK);

View File

@ -27,13 +27,13 @@
*/ */
#include "gxs/rsgenexchange.h" #include "gxs/rsgenexchange.h"
#include "retroshare/rsphotoV2.h" #include "retroshare/rsphoto.h"
class p3PhotoServiceV2 : public RsPhotoV2, public RsGenExchange class p3PhotoService : public RsPhoto, public RsGenExchange
{ {
public: public:
p3PhotoServiceV2(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs, p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs,
uint32_t authenPolicy); uint32_t authenPolicy);
public: public:

View File

@ -6,7 +6,7 @@
#include "util/misc.h" #include "util/misc.h"
#include "gxs/rsgxsflags.h" #include "gxs/rsgxsflags.h"
AlbumCreateDialog::AlbumCreateDialog(TokenQueue *photoQueue, RsPhotoV2 *rs_photo, QWidget *parent): AlbumCreateDialog::AlbumCreateDialog(TokenQueue *photoQueue, RsPhoto *rs_photo, QWidget *parent):
QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint), QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint),
ui(new Ui::AlbumCreateDialog), mPhotoQueue(photoQueue), mRsPhoto(rs_photo), mPhotoSelected(NULL) ui(new Ui::AlbumCreateDialog), mPhotoQueue(photoQueue), mRsPhoto(rs_photo), mPhotoSelected(NULL)
{ {

View File

@ -3,7 +3,8 @@
#include <QDialog> #include <QDialog>
#include "util/TokenQueue.h" #include "util/TokenQueue.h"
#include "retroshare/rsphotoV2.h" #include "retroshare/rsphoto.h"
#include "retroshare/rsphoto.h"
#include "PhotoShareItemHolder.h" #include "PhotoShareItemHolder.h"
#include "PhotoItem.h" #include "PhotoItem.h"
#include "PhotoDrop.h" #include "PhotoDrop.h"
@ -18,7 +19,7 @@ class AlbumCreateDialog : public QDialog, public PhotoShareItemHolder
Q_OBJECT Q_OBJECT
public: public:
explicit AlbumCreateDialog(TokenQueue* photoQueue, RsPhotoV2* rs_photo, QWidget *parent = 0); explicit AlbumCreateDialog(TokenQueue* photoQueue, RsPhoto* rs_photo, QWidget *parent = 0);
~AlbumCreateDialog(); ~AlbumCreateDialog();
void notifySelection(PhotoShareItem* selection); void notifySelection(PhotoShareItem* selection);
@ -39,7 +40,7 @@ private:
Ui::AlbumCreateDialog *ui; Ui::AlbumCreateDialog *ui;
TokenQueue* mPhotoQueue; TokenQueue* mPhotoQueue;
RsPhotoV2* mRsPhoto; RsPhoto* mRsPhoto;
QPixmap mThumbNail; QPixmap mThumbNail;
PhotoDrop* mPhotoDrop; PhotoDrop* mPhotoDrop;
PhotoItem* mPhotoSelected; PhotoItem* mPhotoSelected;

View File

@ -4,7 +4,7 @@
#include "ui_AlbumDialog.h" #include "ui_AlbumDialog.h"
#include "gxs/rsgxsflags.h" #include "gxs/rsgxsflags.h"
AlbumDialog::AlbumDialog(const RsPhotoAlbum& album, TokenQueue* photoQueue, RsPhotoV2* rs_Photo, QWidget *parent) : AlbumDialog::AlbumDialog(const RsPhotoAlbum& album, TokenQueue* photoQueue, RsPhoto* rs_Photo, QWidget *parent) :
QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint), QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint),
ui(new Ui::AlbumDialog), mRsPhoto(rs_Photo), mPhotoQueue(photoQueue), mAlbum(album), mPhotoSelected(NULL) ui(new Ui::AlbumDialog), mRsPhoto(rs_Photo), mPhotoQueue(photoQueue), mAlbum(album), mPhotoSelected(NULL)
{ {

View File

@ -2,7 +2,7 @@
#define ALBUMDIALOG_H #define ALBUMDIALOG_H
#include <QDialog> #include <QDialog>
#include "retroshare/rsphotoV2.h" #include "retroshare/rsphoto.h"
#include "util/TokenQueue.h" #include "util/TokenQueue.h"
#include "PhotoShareItemHolder.h" #include "PhotoShareItemHolder.h"
#include "PhotoItem.h" #include "PhotoItem.h"
@ -17,7 +17,7 @@ class AlbumDialog : public QDialog, public PhotoShareItemHolder
Q_OBJECT Q_OBJECT
public: public:
explicit AlbumDialog(const RsPhotoAlbum& album, TokenQueue* photoQueue, RsPhotoV2* rs_Photo, QWidget *parent = 0); explicit AlbumDialog(const RsPhotoAlbum& album, TokenQueue* photoQueue, RsPhoto* rs_Photo, QWidget *parent = 0);
~AlbumDialog(); ~AlbumDialog();
void notifySelection(PhotoShareItem* selection); void notifySelection(PhotoShareItem* selection);
@ -33,7 +33,7 @@ private slots:
void editPhoto(); void editPhoto();
private: private:
Ui::AlbumDialog *ui; Ui::AlbumDialog *ui;
RsPhotoV2* mRsPhoto; RsPhoto* mRsPhoto;
TokenQueue* mPhotoQueue; TokenQueue* mPhotoQueue;
RsPhotoAlbum mAlbum; RsPhotoAlbum mAlbum;
PhotoDrop* mPhotoDrop; PhotoDrop* mPhotoDrop;

View File

@ -3,7 +3,7 @@
#include <QWidget> #include <QWidget>
#include "string.h" #include "string.h"
#include "retroshare/rsphotoV2.h" #include "retroshare/rsphoto.h"
#include "PhotoShareItemHolder.h" #include "PhotoShareItemHolder.h"
namespace Ui { namespace Ui {

View File

@ -2,7 +2,7 @@
#define PHOTOCOMMENTITEM_H #define PHOTOCOMMENTITEM_H
#include <QWidget> #include <QWidget>
#include "retroshare/rsphotoV2.h" #include "retroshare/rsphoto.h"
namespace Ui { namespace Ui {
class PhotoCommentItem; class PhotoCommentItem;

View File

@ -5,7 +5,7 @@
#include "retroshare/rsidentity.h" #include "retroshare/rsidentity.h"
#include "AddCommentDialog.h" #include "AddCommentDialog.h"
PhotoDialog::PhotoDialog(RsPhotoV2 *rs_photo, const RsPhotoPhoto &photo, QWidget *parent) : PhotoDialog::PhotoDialog(RsPhoto *rs_photo, const RsPhotoPhoto &photo, QWidget *parent) :
QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint), QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint),
ui(new Ui::PhotoDialog), mRsPhoto(rs_photo), mPhotoQueue(new TokenQueue(mRsPhoto->getTokenService(), this)), ui(new Ui::PhotoDialog), mRsPhoto(rs_photo), mPhotoQueue(new TokenQueue(mRsPhoto->getTokenService(), this)),
mPhotoDetails(photo) mPhotoDetails(photo)
@ -84,8 +84,8 @@ void PhotoDialog::resetComments()
void PhotoDialog::requestComments() void PhotoDialog::requestComments()
{ {
RsTokReqOptions opts; RsTokReqOptions opts;
opts.mMsgFlagMask = RsPhotoV2::FLAG_MSG_TYPE_MASK; opts.mMsgFlagMask = RsPhoto::FLAG_MSG_TYPE_MASK;
opts.mMsgFlagFilter = RsPhotoV2::FLAG_MSG_TYPE_PHOTO_COMMENT; opts.mMsgFlagFilter = RsPhoto::FLAG_MSG_TYPE_PHOTO_COMMENT;
opts.mReqType = GXS_REQUEST_TYPE_MSG_IDS; opts.mReqType = GXS_REQUEST_TYPE_MSG_IDS;
opts.mReqType = GXS_REQUEST_TYPE_MSG_RELATED_DATA; opts.mReqType = GXS_REQUEST_TYPE_MSG_RELATED_DATA;

View File

@ -3,7 +3,7 @@
#include <QDialog> #include <QDialog>
#include <QSet> #include <QSet>
#include "retroshare/rsphotoV2.h" #include "retroshare/rsphoto.h"
#include "util/TokenQueue.h" #include "util/TokenQueue.h"
#include "PhotoCommentItem.h" #include "PhotoCommentItem.h"
@ -16,7 +16,7 @@ class PhotoDialog : public QDialog, public TokenResponse
Q_OBJECT Q_OBJECT
public: public:
explicit PhotoDialog(RsPhotoV2* rs_photo, const RsPhotoPhoto& photo, QWidget *parent = 0); explicit PhotoDialog(RsPhoto* rs_photo, const RsPhotoPhoto& photo, QWidget *parent = 0);
~PhotoDialog(); ~PhotoDialog();
private slots: private slots:
@ -53,7 +53,7 @@ private:
private: private:
Ui::PhotoDialog *ui; Ui::PhotoDialog *ui;
RsPhotoV2* mRsPhoto; RsPhoto* mRsPhoto;
TokenQueue* mPhotoQueue; TokenQueue* mPhotoQueue;
RsPhotoPhoto mPhotoDetails; RsPhotoPhoto mPhotoDetails;
QSet<PhotoCommentItem*> mComments; QSet<PhotoCommentItem*> mComments;

View File

@ -4,7 +4,7 @@
#include <QWidget> #include <QWidget>
#include <QLabel> #include <QLabel>
#include "PhotoShareItemHolder.h" #include "PhotoShareItemHolder.h"
#include "retroshare/rsphotoV2.h" #include "retroshare/rsphoto.h"
namespace Ui { namespace Ui {
class PhotoItem; class PhotoItem;

View File

@ -26,7 +26,7 @@
#include "ui_PhotoShare.h" #include "ui_PhotoShare.h"
#include <retroshare/rspeers.h> #include <retroshare/rspeers.h>
#include <retroshare/rsphotoV2.h> #include <retroshare/rsphoto.h>
#include <gxs/rsgxsflags.h> #include <gxs/rsgxsflags.h>
#include <iostream> #include <iostream>
@ -93,7 +93,7 @@ PhotoShare::PhotoShare(QWidget *parent)
timer->start(1000); timer->start(1000);
/* setup TokenQueue */ /* setup TokenQueue */
mPhotoQueue = new TokenQueue(rsPhotoV2->getTokenService(), this); mPhotoQueue = new TokenQueue(rsPhoto->getTokenService(), this);
requestAlbumData(); requestAlbumData();
} }
@ -165,14 +165,14 @@ void PhotoShare::notifySelection(PhotoShareItem *selection)
void PhotoShare::checkUpdate() void PhotoShare::checkUpdate()
{ {
/* update */ /* update */
if (!rsPhotoV2) if (!rsPhoto)
return; return;
if (rsPhotoV2->updated()) if (rsPhoto->updated())
{ {
//insertAlbums(); //insertAlbums();
std::list<std::string> grpIds; std::list<std::string> grpIds;
rsPhotoV2->groupsChanged(grpIds); rsPhoto->groupsChanged(grpIds);
if(!grpIds.empty()) if(!grpIds.empty())
{ {
RsTokReqOptions opts; RsTokReqOptions opts;
@ -182,7 +182,7 @@ void PhotoShare::checkUpdate()
} }
GxsMsgIdResult res; GxsMsgIdResult res;
rsPhotoV2->msgsChanged(res); rsPhoto->msgsChanged(res);
if(!res.empty()) if(!res.empty())
requestPhotoList(res); requestPhotoList(res);
} }
@ -214,14 +214,14 @@ void PhotoShare::OpenSlideShow()
void PhotoShare::createAlbum() void PhotoShare::createAlbum()
{ {
AlbumCreateDialog albumCreate(mPhotoQueue, rsPhotoV2, this); AlbumCreateDialog albumCreate(mPhotoQueue, rsPhoto, this);
albumCreate.exec(); albumCreate.exec();
} }
void PhotoShare::OpenAlbumDialog() void PhotoShare::OpenAlbumDialog()
{ {
if (mAlbumSelected) { if (mAlbumSelected) {
AlbumDialog dlg(mAlbumSelected->getAlbum(), mPhotoQueue, rsPhotoV2); AlbumDialog dlg(mAlbumSelected->getAlbum(), mPhotoQueue, rsPhoto);
dlg.exec(); dlg.exec();
} }
} }
@ -229,7 +229,7 @@ void PhotoShare::OpenAlbumDialog()
void PhotoShare::OpenPhotoDialog() void PhotoShare::OpenPhotoDialog()
{ {
if (mPhotoSelected) { if (mPhotoSelected) {
PhotoDialog *dlg = new PhotoDialog(rsPhotoV2, mPhotoSelected->getPhotoDetails()); PhotoDialog *dlg = new PhotoDialog(rsPhoto, mPhotoSelected->getPhotoDetails());
dlg->show(); dlg->show();
} }
} }
@ -418,12 +418,12 @@ void PhotoShare::subscribeToAlbum()
uint32_t token; uint32_t token;
if(IS_ALBUM_SUBSCRIBED(mAlbumSelected->getAlbum().mMeta.mSubscribeFlags)) if(IS_ALBUM_SUBSCRIBED(mAlbumSelected->getAlbum().mMeta.mSubscribeFlags))
rsPhotoV2->subscribeToAlbum(token, id, false); rsPhoto->subscribeToAlbum(token, id, false);
else if(IS_ALBUM_ADMIN(mAlbumSelected->getAlbum().mMeta.mSubscribeFlags)) else if(IS_ALBUM_ADMIN(mAlbumSelected->getAlbum().mMeta.mSubscribeFlags))
return; return;
else if(IS_ALBUM_N_SUBSCR_OR_ADMIN( else if(IS_ALBUM_N_SUBSCR_OR_ADMIN(
mAlbumSelected->getAlbum().mMeta.mSubscribeFlags)) mAlbumSelected->getAlbum().mMeta.mSubscribeFlags))
rsPhotoV2->subscribeToAlbum(token, id, true); rsPhoto->subscribeToAlbum(token, id, true);
else else
return; return;
@ -473,7 +473,7 @@ void PhotoShare::loadAlbumList(const uint32_t &token)
std::cerr << std::endl; std::cerr << std::endl;
std::list<std::string> albumIds; std::list<std::string> albumIds;
rsPhotoV2->getGroupList(token, albumIds); rsPhoto->getGroupList(token, albumIds);
requestAlbumData(albumIds); requestAlbumData(albumIds);
@ -507,7 +507,7 @@ bool PhotoShare::loadAlbumData(const uint32_t &token)
std::cerr << std::endl; std::cerr << std::endl;
std::vector<RsPhotoAlbum> albums; std::vector<RsPhotoAlbum> albums;
rsPhotoV2->getAlbum(token, albums); rsPhoto->getAlbum(token, albums);
std::vector<RsPhotoAlbum>::iterator vit = albums.begin(); std::vector<RsPhotoAlbum>::iterator vit = albums.begin();
@ -541,7 +541,7 @@ void PhotoShare::requestPhotoList(const std::string &albumId)
void PhotoShare::acknowledgeGroup(const uint32_t &token) void PhotoShare::acknowledgeGroup(const uint32_t &token)
{ {
RsGxsGroupId grpId; RsGxsGroupId grpId;
rsPhotoV2->acknowledgeGrp(token, grpId); rsPhoto->acknowledgeGrp(token, grpId);
if(!grpId.empty()) if(!grpId.empty())
{ {
@ -558,7 +558,7 @@ void PhotoShare::acknowledgeGroup(const uint32_t &token)
void PhotoShare::acknowledgeMessage(const uint32_t &token) void PhotoShare::acknowledgeMessage(const uint32_t &token)
{ {
std::pair<RsGxsGroupId, RsGxsMessageId> p; std::pair<RsGxsGroupId, RsGxsMessageId> p;
rsPhotoV2->acknowledgeMsg(token, p); rsPhoto->acknowledgeMsg(token, p);
// just acknowledge don't load it // just acknowledge don't load it
// loading is only instigated by clicking an album (i.e. requesting photo data) // loading is only instigated by clicking an album (i.e. requesting photo data)
@ -584,7 +584,7 @@ void PhotoShare::loadPhotoList(const uint32_t &token)
GxsMsgIdResult res; GxsMsgIdResult res;
rsPhotoV2->getMsgList(token, res); rsPhoto->getMsgList(token, res);
requestPhotoData(res); requestPhotoData(res);
} }
@ -614,7 +614,7 @@ void PhotoShare::loadPhotoData(const uint32_t &token)
clearPhotos(); clearPhotos();
PhotoResult res; PhotoResult res;
rsPhotoV2->getPhoto(token, res); rsPhoto->getPhoto(token, res);
PhotoResult::iterator mit = res.begin(); PhotoResult::iterator mit = res.begin();

View File

@ -5,7 +5,7 @@
#include <map> #include <map>
#include "ui_PhotoShare.h" #include "ui_PhotoShare.h"
#include "retroshare/rsphotoV2.h" #include "retroshare/rsphoto.h"
#include "retroshare-gui/mainpage.h" #include "retroshare-gui/mainpage.h"
#include "AlbumCreateDialog.h" #include "AlbumCreateDialog.h"

View File

@ -39,7 +39,7 @@ PhotoSlideShow::PhotoSlideShow(const RsPhotoAlbum& album, QWidget *parent)
connect(ui.pushButton_Close, SIGNAL( clicked( void ) ), this, SLOT( closeShow( void ) ) ); connect(ui.pushButton_Close, SIGNAL( clicked( void ) ), this, SLOT( closeShow( void ) ) );
connect(ui.fullscreenButton, SIGNAL(clicked()),this, SLOT(setFullScreen())); connect(ui.fullscreenButton, SIGNAL(clicked()),this, SLOT(setFullScreen()));
mPhotoQueue = new TokenQueue(rsPhotoV2->getTokenService(), this); mPhotoQueue = new TokenQueue(rsPhoto->getTokenService(), this);
mRunning = true; mRunning = true;
mShotActive = true; mShotActive = true;
@ -236,7 +236,7 @@ bool PhotoSlideShow::loadPhotoData(const uint32_t &token)
std::cerr << std::endl; std::cerr << std::endl;
PhotoResult res; PhotoResult res;
rsPhotoV2->getPhoto(token, res); rsPhoto->getPhoto(token, res);
PhotoResult::iterator mit = res.begin(); PhotoResult::iterator mit = res.begin();

View File

@ -26,7 +26,7 @@
#include "ui_PhotoSlideShow.h" #include "ui_PhotoSlideShow.h"
#include <retroshare/rsphotoV2.h> #include <retroshare/rsphoto.h>
#include "util/TokenQueue.h" #include "util/TokenQueue.h"
#include "AlbumItem.h" #include "AlbumItem.h"