mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-24 00:40:11 -05:00
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:
parent
da39d1de77
commit
744a78b140
@ -86,6 +86,8 @@ void RsGxsNetService::syncWithPeers()
|
||||
sendItem(grp);
|
||||
}
|
||||
|
||||
|
||||
#ifdef GXS_ENABLE_SYNC_MSGS
|
||||
std::map<RsGxsGroupId, RsGxsGrpMetaData* > grpMeta;
|
||||
mDataStore->retrieveGxsGrpMetaData(grpMeta);
|
||||
|
||||
@ -123,6 +125,7 @@ void RsGxsNetService::syncWithPeers()
|
||||
sendItem(msg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool RsGxsNetService::loadList(std::list<RsItem*>& load)
|
||||
|
@ -32,8 +32,8 @@
|
||||
#include "rsgxsservice.h"
|
||||
|
||||
/* The Main Interface Class - for information about your Peers */
|
||||
class RsPhotoV2;
|
||||
extern RsPhotoV2 *rsPhotoV2;
|
||||
class RsPhoto;
|
||||
extern RsPhoto *rsPhoto;
|
||||
|
||||
/******************* 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<RsGxsGrpMsgIdPair, std::vector<RsPhotoComment> > PhotoRelatedCommentResult;
|
||||
|
||||
class RsPhotoV2
|
||||
class RsPhoto
|
||||
{
|
||||
|
||||
public:
|
||||
@ -186,9 +186,9 @@ public:
|
||||
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
|
@ -1827,7 +1827,7 @@ RsTurtle *rsTurtle = NULL ;
|
||||
#include "services/p3idservice.h"
|
||||
#include "services/p3wiki.h"
|
||||
#include "services/p3posted.h"
|
||||
#include "services/p3photoserviceV2.h"
|
||||
#include "services/p3photoservice.h"
|
||||
#include "services/p3gxsforums.h"
|
||||
|
||||
// Not too many to convert now!
|
||||
@ -2278,9 +2278,28 @@ int RsServer::StartupRetroShare()
|
||||
mPluginsManager->registerCacheServices() ;
|
||||
|
||||
|
||||
|
||||
#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.
|
||||
//p3WikiServiceVEG *mWikis = new p3WikiServiceVEG(RS_SERVICE_GXSV1_TYPE_WIKI);
|
||||
//pqih -> addService(mWikis);
|
||||
@ -2295,7 +2314,7 @@ int RsServer::StartupRetroShare()
|
||||
|
||||
|
||||
// TODO: temporary to store GXS service data, remove
|
||||
RsDirUtil::checkCreateDirectory(mLinkMgr->getOwnId());
|
||||
RsDirUtil::checkCreateDirectory(currGxsDir);
|
||||
|
||||
RsNxsNetMgr* nxsMgr = new RsNxsNetMgrImpl(mLinkMgr);
|
||||
|
||||
@ -2303,7 +2322,7 @@ int RsServer::StartupRetroShare()
|
||||
|
||||
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);
|
||||
|
||||
gxsid_ds->resetDataStore();
|
||||
@ -2338,27 +2357,27 @@ int RsServer::StartupRetroShare()
|
||||
RsGenExchange::setAuthenPolicyFlag(flag, photoAuthenPolicy,
|
||||
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);
|
||||
|
||||
photo_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing
|
||||
|
||||
|
||||
// init gxs services
|
||||
mPhotoV2 = new p3PhotoServiceV2(photo_ds, NULL, mGxsIdService, photoAuthenPolicy);
|
||||
mPhoto = new p3PhotoService(photo_ds, NULL, mGxsIdService, photoAuthenPolicy);
|
||||
|
||||
// create GXS photo service
|
||||
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 ****/
|
||||
|
||||
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);
|
||||
|
||||
posted_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing
|
||||
@ -2374,7 +2393,7 @@ int RsServer::StartupRetroShare()
|
||||
|
||||
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);
|
||||
|
||||
wiki_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing
|
||||
@ -2389,7 +2408,7 @@ int RsServer::StartupRetroShare()
|
||||
|
||||
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);
|
||||
|
||||
gxsforums_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing
|
||||
@ -2411,12 +2430,12 @@ int RsServer::StartupRetroShare()
|
||||
//mGxsCore->addService(mGxsIdService);
|
||||
#if ENABLE_OTHER_GXS_SERVICES
|
||||
createThread(*mGxsIdService);
|
||||
createThread(*mPhotoV2);
|
||||
createThread(*mPhoto);
|
||||
createThread(*mPosted);
|
||||
createThread(*mWiki);
|
||||
createThread(*mGxsForums);
|
||||
//
|
||||
// mGxsCore->addService(mPhotoV2);
|
||||
// mGxsCore->addService(mPhoto);
|
||||
// mGxsCore->addService(mPosted);
|
||||
// mGxsCore->addService(mWiki);
|
||||
#endif
|
||||
@ -2707,7 +2726,7 @@ int RsServer::StartupRetroShare()
|
||||
#if ENABLE_OTHER_GXS_SERVICES
|
||||
rsWiki = mWiki;
|
||||
rsPosted = mPosted;
|
||||
rsPhotoV2 = mPhotoV2;
|
||||
rsPhoto = mPhoto;
|
||||
rsGxsForums = mGxsForums;
|
||||
#endif
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "rsphotov2items.h"
|
||||
#include "rsphotoitems.h"
|
||||
#include "serialiser/rstlvbase.h"
|
||||
#include "serialiser/rsbaseserial.h"
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "serialiser/rstlvtypes.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_SHOW_ITEM = 0x03;
|
@ -1,13 +1,13 @@
|
||||
#include "p3photoserviceV2.h"
|
||||
#include "serialiser/rsphotov2items.h"
|
||||
#include "p3photoservice.h"
|
||||
#include "serialiser/rsphotoitems.h"
|
||||
#include "gxs/rsgxsflags.h"
|
||||
|
||||
RsPhotoV2 *rsPhotoV2 = NULL;
|
||||
RsPhoto *rsPhoto = NULL;
|
||||
|
||||
|
||||
const uint32_t RsPhotoV2::FLAG_MSG_TYPE_MASK = 0x000f;
|
||||
const uint32_t RsPhotoV2::FLAG_MSG_TYPE_PHOTO_POST = 0x0001;
|
||||
const uint32_t RsPhotoV2::FLAG_MSG_TYPE_PHOTO_COMMENT = 0x0002;
|
||||
const uint32_t RsPhoto::FLAG_MSG_TYPE_MASK = 0x000f;
|
||||
const uint32_t RsPhoto::FLAG_MSG_TYPE_PHOTO_POST = 0x0001;
|
||||
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;
|
||||
}
|
||||
|
||||
p3PhotoServiceV2::p3PhotoServiceV2(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs,
|
||||
p3PhotoService::p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs,
|
||||
uint32_t authenPolicy)
|
||||
: RsGenExchange(gds, nes, new RsGxsPhotoSerialiser(), RS_SERVICE_GXSV1_TYPE_PHOTO, gixs, authenPolicy),
|
||||
mPhotoMutex(std::string("Photo Mutex"))
|
||||
@ -107,7 +107,7 @@ p3PhotoServiceV2::p3PhotoServiceV2(RsGeneralDataService* gds, RsNetworkExchangeS
|
||||
createDummyGroup(item2);
|
||||
}
|
||||
|
||||
bool p3PhotoServiceV2::updated()
|
||||
bool p3PhotoService::updated()
|
||||
{
|
||||
RsStackMutex stack(mPhotoMutex);
|
||||
|
||||
@ -116,14 +116,14 @@ bool p3PhotoServiceV2::updated()
|
||||
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);
|
||||
|
||||
@ -141,7 +141,7 @@ void p3PhotoServiceV2::groupsChanged(std::list<RsGxsGroupId>& grpIds)
|
||||
}
|
||||
|
||||
|
||||
void p3PhotoServiceV2::msgsChanged(
|
||||
void p3PhotoService::msgsChanged(
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >& msgs)
|
||||
{
|
||||
RsStackMutex stack(mPhotoMutex);
|
||||
@ -156,20 +156,20 @@ void p3PhotoServiceV2::msgsChanged(
|
||||
}
|
||||
|
||||
|
||||
RsTokenService* p3PhotoServiceV2::getTokenService() {
|
||||
RsTokenService* p3PhotoService::getTokenService() {
|
||||
|
||||
return RsGenExchange::getTokenService();
|
||||
}
|
||||
|
||||
|
||||
bool p3PhotoServiceV2::getGroupList(const uint32_t& token,
|
||||
bool p3PhotoService::getGroupList(const uint32_t& token,
|
||||
std::list<RsGxsGroupId>& groupIds)
|
||||
{
|
||||
return RsGenExchange::getGroupList(token, groupIds);
|
||||
}
|
||||
|
||||
|
||||
bool p3PhotoServiceV2::getMsgList(const uint32_t& token,
|
||||
bool p3PhotoService::getMsgList(const uint32_t& token,
|
||||
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)
|
||||
{
|
||||
return RsGenExchange::getGroupMeta(token, groupInfo);
|
||||
}
|
||||
|
||||
|
||||
bool p3PhotoServiceV2::getMsgSummary(const uint32_t& token,
|
||||
bool p3PhotoService::getMsgSummary(const uint32_t& token,
|
||||
MsgMetaResult& 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;
|
||||
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;
|
||||
bool ok = RsGenExchange::getMsgData(token, msgData);
|
||||
@ -252,7 +252,7 @@ bool p3PhotoServiceV2::getPhoto(const uint32_t& token, PhotoResult& photos)
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool p3PhotoServiceV2::getPhotoComment(const uint32_t &token, PhotoCommentResult &comments)
|
||||
bool p3PhotoService::getPhotoComment(const uint32_t &token, PhotoCommentResult &comments)
|
||||
{
|
||||
GxsMsgDataMap msgData;
|
||||
bool ok = RsGenExchange::getMsgData(token, msgData);
|
||||
@ -295,14 +295,14 @@ RsPhotoComment& RsPhotoComment::operator=(const RsGxsPhotoCommentItem& comment)
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
bool p3PhotoServiceV2::submitAlbumDetails(uint32_t& token, RsPhotoAlbum& album)
|
||||
bool p3PhotoService::submitAlbumDetails(uint32_t& token, RsPhotoAlbum& album)
|
||||
{
|
||||
RsGxsPhotoAlbumItem* albumItem = new RsGxsPhotoAlbumItem();
|
||||
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);
|
||||
@ -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();
|
||||
photoItem->photo = photo;
|
||||
@ -351,7 +351,7 @@ bool p3PhotoServiceV2::submitPhoto(uint32_t& token, RsPhotoPhoto& photo)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool p3PhotoServiceV2::submitComment(uint32_t &token, RsPhotoComment &comment)
|
||||
bool p3PhotoService::submitComment(uint32_t &token, RsPhotoComment &comment)
|
||||
{
|
||||
RsGxsPhotoCommentItem* commentItem = new RsGxsPhotoCommentItem();
|
||||
commentItem->comment = comment;
|
||||
@ -362,20 +362,20 @@ bool p3PhotoServiceV2::submitComment(uint32_t &token, RsPhotoComment &comment)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool p3PhotoServiceV2::acknowledgeMsg(const uint32_t& token,
|
||||
bool p3PhotoService::acknowledgeMsg(const uint32_t& token,
|
||||
std::pair<RsGxsGroupId, RsGxsMessageId>& msgId)
|
||||
{
|
||||
return RsGenExchange::acknowledgeTokenMsg(token, msgId);
|
||||
}
|
||||
|
||||
|
||||
bool p3PhotoServiceV2::acknowledgeGrp(const uint32_t& token,
|
||||
bool p3PhotoService::acknowledgeGrp(const uint32_t& token,
|
||||
RsGxsGroupId& 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)
|
||||
RsGenExchange::setGroupSubscribeFlags(token, grpId, GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED, GXS_SERV::GROUP_SUBSCRIBE_MASK);
|
@ -27,13 +27,13 @@
|
||||
*/
|
||||
|
||||
#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:
|
||||
|
||||
p3PhotoServiceV2(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs,
|
||||
p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs,
|
||||
uint32_t authenPolicy);
|
||||
|
||||
public:
|
@ -6,7 +6,7 @@
|
||||
#include "util/misc.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),
|
||||
ui(new Ui::AlbumCreateDialog), mPhotoQueue(photoQueue), mRsPhoto(rs_photo), mPhotoSelected(NULL)
|
||||
{
|
||||
|
@ -3,7 +3,8 @@
|
||||
|
||||
#include <QDialog>
|
||||
#include "util/TokenQueue.h"
|
||||
#include "retroshare/rsphotoV2.h"
|
||||
#include "retroshare/rsphoto.h"
|
||||
#include "retroshare/rsphoto.h"
|
||||
#include "PhotoShareItemHolder.h"
|
||||
#include "PhotoItem.h"
|
||||
#include "PhotoDrop.h"
|
||||
@ -18,7 +19,7 @@ class AlbumCreateDialog : public QDialog, public PhotoShareItemHolder
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AlbumCreateDialog(TokenQueue* photoQueue, RsPhotoV2* rs_photo, QWidget *parent = 0);
|
||||
explicit AlbumCreateDialog(TokenQueue* photoQueue, RsPhoto* rs_photo, QWidget *parent = 0);
|
||||
~AlbumCreateDialog();
|
||||
|
||||
void notifySelection(PhotoShareItem* selection);
|
||||
@ -39,7 +40,7 @@ private:
|
||||
Ui::AlbumCreateDialog *ui;
|
||||
|
||||
TokenQueue* mPhotoQueue;
|
||||
RsPhotoV2* mRsPhoto;
|
||||
RsPhoto* mRsPhoto;
|
||||
QPixmap mThumbNail;
|
||||
PhotoDrop* mPhotoDrop;
|
||||
PhotoItem* mPhotoSelected;
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "ui_AlbumDialog.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),
|
||||
ui(new Ui::AlbumDialog), mRsPhoto(rs_Photo), mPhotoQueue(photoQueue), mAlbum(album), mPhotoSelected(NULL)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define ALBUMDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "retroshare/rsphotoV2.h"
|
||||
#include "retroshare/rsphoto.h"
|
||||
#include "util/TokenQueue.h"
|
||||
#include "PhotoShareItemHolder.h"
|
||||
#include "PhotoItem.h"
|
||||
@ -17,7 +17,7 @@ class AlbumDialog : public QDialog, public PhotoShareItemHolder
|
||||
Q_OBJECT
|
||||
|
||||
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();
|
||||
|
||||
void notifySelection(PhotoShareItem* selection);
|
||||
@ -33,7 +33,7 @@ private slots:
|
||||
void editPhoto();
|
||||
private:
|
||||
Ui::AlbumDialog *ui;
|
||||
RsPhotoV2* mRsPhoto;
|
||||
RsPhoto* mRsPhoto;
|
||||
TokenQueue* mPhotoQueue;
|
||||
RsPhotoAlbum mAlbum;
|
||||
PhotoDrop* mPhotoDrop;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <QWidget>
|
||||
#include "string.h"
|
||||
#include "retroshare/rsphotoV2.h"
|
||||
#include "retroshare/rsphoto.h"
|
||||
#include "PhotoShareItemHolder.h"
|
||||
|
||||
namespace Ui {
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define PHOTOCOMMENTITEM_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "retroshare/rsphotoV2.h"
|
||||
#include "retroshare/rsphoto.h"
|
||||
|
||||
namespace Ui {
|
||||
class PhotoCommentItem;
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "retroshare/rsidentity.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),
|
||||
ui(new Ui::PhotoDialog), mRsPhoto(rs_photo), mPhotoQueue(new TokenQueue(mRsPhoto->getTokenService(), this)),
|
||||
mPhotoDetails(photo)
|
||||
@ -84,8 +84,8 @@ void PhotoDialog::resetComments()
|
||||
void PhotoDialog::requestComments()
|
||||
{
|
||||
RsTokReqOptions opts;
|
||||
opts.mMsgFlagMask = RsPhotoV2::FLAG_MSG_TYPE_MASK;
|
||||
opts.mMsgFlagFilter = RsPhotoV2::FLAG_MSG_TYPE_PHOTO_COMMENT;
|
||||
opts.mMsgFlagMask = RsPhoto::FLAG_MSG_TYPE_MASK;
|
||||
opts.mMsgFlagFilter = RsPhoto::FLAG_MSG_TYPE_PHOTO_COMMENT;
|
||||
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_IDS;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_RELATED_DATA;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <QDialog>
|
||||
#include <QSet>
|
||||
#include "retroshare/rsphotoV2.h"
|
||||
#include "retroshare/rsphoto.h"
|
||||
#include "util/TokenQueue.h"
|
||||
#include "PhotoCommentItem.h"
|
||||
|
||||
@ -16,7 +16,7 @@ class PhotoDialog : public QDialog, public TokenResponse
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PhotoDialog(RsPhotoV2* rs_photo, const RsPhotoPhoto& photo, QWidget *parent = 0);
|
||||
explicit PhotoDialog(RsPhoto* rs_photo, const RsPhotoPhoto& photo, QWidget *parent = 0);
|
||||
~PhotoDialog();
|
||||
|
||||
private slots:
|
||||
@ -53,7 +53,7 @@ private:
|
||||
private:
|
||||
Ui::PhotoDialog *ui;
|
||||
|
||||
RsPhotoV2* mRsPhoto;
|
||||
RsPhoto* mRsPhoto;
|
||||
TokenQueue* mPhotoQueue;
|
||||
RsPhotoPhoto mPhotoDetails;
|
||||
QSet<PhotoCommentItem*> mComments;
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include "PhotoShareItemHolder.h"
|
||||
#include "retroshare/rsphotoV2.h"
|
||||
#include "retroshare/rsphoto.h"
|
||||
|
||||
namespace Ui {
|
||||
class PhotoItem;
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "ui_PhotoShare.h"
|
||||
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rsphotoV2.h>
|
||||
#include <retroshare/rsphoto.h>
|
||||
#include <gxs/rsgxsflags.h>
|
||||
|
||||
#include <iostream>
|
||||
@ -93,7 +93,7 @@ PhotoShare::PhotoShare(QWidget *parent)
|
||||
timer->start(1000);
|
||||
|
||||
/* setup TokenQueue */
|
||||
mPhotoQueue = new TokenQueue(rsPhotoV2->getTokenService(), this);
|
||||
mPhotoQueue = new TokenQueue(rsPhoto->getTokenService(), this);
|
||||
requestAlbumData();
|
||||
}
|
||||
|
||||
@ -165,14 +165,14 @@ void PhotoShare::notifySelection(PhotoShareItem *selection)
|
||||
void PhotoShare::checkUpdate()
|
||||
{
|
||||
/* update */
|
||||
if (!rsPhotoV2)
|
||||
if (!rsPhoto)
|
||||
return;
|
||||
|
||||
if (rsPhotoV2->updated())
|
||||
if (rsPhoto->updated())
|
||||
{
|
||||
//insertAlbums();
|
||||
std::list<std::string> grpIds;
|
||||
rsPhotoV2->groupsChanged(grpIds);
|
||||
rsPhoto->groupsChanged(grpIds);
|
||||
if(!grpIds.empty())
|
||||
{
|
||||
RsTokReqOptions opts;
|
||||
@ -182,7 +182,7 @@ void PhotoShare::checkUpdate()
|
||||
}
|
||||
|
||||
GxsMsgIdResult res;
|
||||
rsPhotoV2->msgsChanged(res);
|
||||
rsPhoto->msgsChanged(res);
|
||||
if(!res.empty())
|
||||
requestPhotoList(res);
|
||||
}
|
||||
@ -214,14 +214,14 @@ void PhotoShare::OpenSlideShow()
|
||||
|
||||
void PhotoShare::createAlbum()
|
||||
{
|
||||
AlbumCreateDialog albumCreate(mPhotoQueue, rsPhotoV2, this);
|
||||
AlbumCreateDialog albumCreate(mPhotoQueue, rsPhoto, this);
|
||||
albumCreate.exec();
|
||||
}
|
||||
|
||||
void PhotoShare::OpenAlbumDialog()
|
||||
{
|
||||
if (mAlbumSelected) {
|
||||
AlbumDialog dlg(mAlbumSelected->getAlbum(), mPhotoQueue, rsPhotoV2);
|
||||
AlbumDialog dlg(mAlbumSelected->getAlbum(), mPhotoQueue, rsPhoto);
|
||||
dlg.exec();
|
||||
}
|
||||
}
|
||||
@ -229,7 +229,7 @@ void PhotoShare::OpenAlbumDialog()
|
||||
void PhotoShare::OpenPhotoDialog()
|
||||
{
|
||||
if (mPhotoSelected) {
|
||||
PhotoDialog *dlg = new PhotoDialog(rsPhotoV2, mPhotoSelected->getPhotoDetails());
|
||||
PhotoDialog *dlg = new PhotoDialog(rsPhoto, mPhotoSelected->getPhotoDetails());
|
||||
dlg->show();
|
||||
}
|
||||
}
|
||||
@ -418,12 +418,12 @@ void PhotoShare::subscribeToAlbum()
|
||||
uint32_t token;
|
||||
|
||||
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))
|
||||
return;
|
||||
else if(IS_ALBUM_N_SUBSCR_OR_ADMIN(
|
||||
mAlbumSelected->getAlbum().mMeta.mSubscribeFlags))
|
||||
rsPhotoV2->subscribeToAlbum(token, id, true);
|
||||
rsPhoto->subscribeToAlbum(token, id, true);
|
||||
else
|
||||
return;
|
||||
|
||||
@ -473,7 +473,7 @@ void PhotoShare::loadAlbumList(const uint32_t &token)
|
||||
std::cerr << std::endl;
|
||||
|
||||
std::list<std::string> albumIds;
|
||||
rsPhotoV2->getGroupList(token, albumIds);
|
||||
rsPhoto->getGroupList(token, albumIds);
|
||||
|
||||
requestAlbumData(albumIds);
|
||||
|
||||
@ -507,7 +507,7 @@ bool PhotoShare::loadAlbumData(const uint32_t &token)
|
||||
std::cerr << std::endl;
|
||||
|
||||
std::vector<RsPhotoAlbum> albums;
|
||||
rsPhotoV2->getAlbum(token, albums);
|
||||
rsPhoto->getAlbum(token, albums);
|
||||
|
||||
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)
|
||||
{
|
||||
RsGxsGroupId grpId;
|
||||
rsPhotoV2->acknowledgeGrp(token, grpId);
|
||||
rsPhoto->acknowledgeGrp(token, grpId);
|
||||
|
||||
if(!grpId.empty())
|
||||
{
|
||||
@ -558,7 +558,7 @@ void PhotoShare::acknowledgeGroup(const uint32_t &token)
|
||||
void PhotoShare::acknowledgeMessage(const uint32_t &token)
|
||||
{
|
||||
std::pair<RsGxsGroupId, RsGxsMessageId> p;
|
||||
rsPhotoV2->acknowledgeMsg(token, p);
|
||||
rsPhoto->acknowledgeMsg(token, p);
|
||||
|
||||
// just acknowledge don't load it
|
||||
// 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;
|
||||
|
||||
rsPhotoV2->getMsgList(token, res);
|
||||
rsPhoto->getMsgList(token, res);
|
||||
requestPhotoData(res);
|
||||
}
|
||||
|
||||
@ -614,7 +614,7 @@ void PhotoShare::loadPhotoData(const uint32_t &token)
|
||||
clearPhotos();
|
||||
|
||||
PhotoResult res;
|
||||
rsPhotoV2->getPhoto(token, res);
|
||||
rsPhoto->getPhoto(token, res);
|
||||
PhotoResult::iterator mit = res.begin();
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <map>
|
||||
#include "ui_PhotoShare.h"
|
||||
|
||||
#include "retroshare/rsphotoV2.h"
|
||||
#include "retroshare/rsphoto.h"
|
||||
#include "retroshare-gui/mainpage.h"
|
||||
|
||||
#include "AlbumCreateDialog.h"
|
||||
|
@ -39,7 +39,7 @@ PhotoSlideShow::PhotoSlideShow(const RsPhotoAlbum& album, QWidget *parent)
|
||||
connect(ui.pushButton_Close, SIGNAL( clicked( void ) ), this, SLOT( closeShow( void ) ) );
|
||||
connect(ui.fullscreenButton, SIGNAL(clicked()),this, SLOT(setFullScreen()));
|
||||
|
||||
mPhotoQueue = new TokenQueue(rsPhotoV2->getTokenService(), this);
|
||||
mPhotoQueue = new TokenQueue(rsPhoto->getTokenService(), this);
|
||||
|
||||
mRunning = true;
|
||||
mShotActive = true;
|
||||
@ -236,7 +236,7 @@ bool PhotoSlideShow::loadPhotoData(const uint32_t &token)
|
||||
std::cerr << std::endl;
|
||||
|
||||
PhotoResult res;
|
||||
rsPhotoV2->getPhoto(token, res);
|
||||
rsPhoto->getPhoto(token, res);
|
||||
PhotoResult::iterator mit = res.begin();
|
||||
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
#include "ui_PhotoSlideShow.h"
|
||||
|
||||
#include <retroshare/rsphotoV2.h>
|
||||
#include <retroshare/rsphoto.h>
|
||||
#include "util/TokenQueue.h"
|
||||
#include "AlbumItem.h"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user