GxsForums:

- optimized steps of the progressbar when loading
- added UIStateHelper
- removed debug output
- added Todo button

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6500 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-07-12 17:24:11 +00:00
parent 06b68e4e31
commit 9eeacf7f83
11 changed files with 315 additions and 143 deletions

View file

@ -31,7 +31,9 @@
#include <iostream>
#include <algorithm>
#define DEBUG_FORUMS
//#define DEBUG_FORUMS
#define PROGRESSBAR_MAX 100
GxsForumsFillThread::GxsForumsFillThread(GxsForumThreadWidget *parent)
: QThread(parent), mParent(parent)
@ -153,6 +155,8 @@ void GxsForumsFillThread::run()
int count = msgs.size();
int pos = 0;
int steps = count / PROGRESSBAR_MAX;
int step = 0;
QList<QPair<std::string, QTreeWidgetItem*> > threadList;
QPair<std::string, QTreeWidgetItem*> threadPair;
@ -179,7 +183,11 @@ void GxsForumsFillThread::run()
calculateExpand(msg, item);
mItems.append(item);
emit progress(++pos, count);
if (++step >= steps) {
step = 0;
emit progress(++pos, PROGRESSBAR_MAX);
}
msgIt = msgs.erase(msgIt);
}
@ -222,7 +230,11 @@ void GxsForumsFillThread::run()
/* add item to process list */
threadList.push_back(QPair<std::string, QTreeWidgetItem*>(msg.mMeta.mMsgId, item));
emit progress(++pos, count);
if (++step >= steps) {
step = 0;
emit progress(++pos, PROGRESSBAR_MAX);
}
msgIt = msgs.erase(msgIt);
}
}