Message Synchronisation now supported by photoshare (photo and comments sync)

Photoshare UI now functional 
- subscribing to an album enables message sync
- TokenQueue now operate with FIFO stack to prevent overlap in request completion
- photos are now load on demand as with comments
- fixed some noddy bugs (subscribe flag initialises incorrectly)


git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5624 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2012-09-30 14:21:17 +00:00
parent bdd6c6041b
commit b06214b779
12 changed files with 240 additions and 102 deletions

View file

@ -104,7 +104,7 @@ void TokenQueueV2::queueRequest(uint32_t token, uint32_t basictype, uint32_t ans
gettimeofday(&req.mRequestTs, NULL);
req.mPollTs = req.mRequestTs;
mRequests.push_back(req);
mRequests.push_back(req);
if (mRequests.size() == 1)
{
@ -123,26 +123,23 @@ void TokenQueueV2::doPoll(float dt)
void TokenQueueV2::pollRequests()
{
std::list<TokenRequestV2>::iterator it;
double pollPeriod = 1.0; // max poll period.
for(it = mRequests.begin(); it != mRequests.end();)
{
if (checkForRequest(it->mToken))
{
/* clean it up and handle */
loadRequest(*it);
it = mRequests.erase(it);
}
else
{
/* calculate desired poll period */
/* if less then current poll period, adjust */
it++;
}
}
TokenRequestV2 req;
if(mRequests.size() > 0){
req = mRequests.front();
}else
{
return;
}
if (checkForRequest(req.mToken))
{
/* clean it up and handle */
loadRequest(req);
mRequests.pop_front();
}
if (mRequests.size() > 0)
{
@ -178,7 +175,7 @@ bool TokenQueueV2::cancelRequest(const uint32_t token)
/* cancel at lower level first */
mService->cancelRequest(token);
std::list<TokenRequestV2>::iterator it;
std::list<TokenRequestV2>::iterator it;
for(it = mRequests.begin(); it != mRequests.end(); it++)
{

View file

@ -64,9 +64,8 @@ class TokenResponseV2
/*!
*
*
*
* An important thing to note is that all requests are stacked (so FIFO)
* This is to prevent overlapped loads on GXS UIs
*/
class TokenQueueV2: public QWidget
{
@ -110,7 +109,7 @@ private slots:
private:
/* Info for Data Requests */
std::list<TokenRequestV2> mRequests;
std::list<TokenRequestV2> mRequests;
RsTokenServiceV2 *mService;
TokenResponseV2 *mResponder;