mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-06 21:34:22 -04:00
reduce contention from ForumDialog
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-cacheopt@4415 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8c4a92bd5b
commit
c1a9ed9e25
2 changed files with 10 additions and 1 deletions
|
@ -134,6 +134,8 @@ ForumsDialog::ForumsDialog(QWidget *parent)
|
|||
|
||||
m_bProcessSettings = false;
|
||||
subscribeFlags = 0;
|
||||
mFillthreadCount = 0;
|
||||
|
||||
|
||||
connect( ui.forumTreeWidget, SIGNAL( treeCustomContextMenuRequested( QPoint ) ), this, SLOT( forumListCustomPopupMenu( QPoint ) ) );
|
||||
connect( ui.threadTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( threadListCustomPopupMenu( QPoint ) ) );
|
||||
|
@ -465,7 +467,9 @@ void ForumsDialog::updateDisplay()
|
|||
{
|
||||
std::list<std::string> forumIds;
|
||||
std::list<std::string>::iterator it;
|
||||
if (!rsForums)
|
||||
|
||||
// suspend access to forum while thread is running
|
||||
if (!rsForums || (mFillthreadCount != 0))
|
||||
return;
|
||||
|
||||
if (rsForums->forumsChanged(forumIds))
|
||||
|
@ -770,9 +774,11 @@ void ForumsDialog::fillThreadFinished()
|
|||
thread = NULL;
|
||||
}
|
||||
|
||||
mFillthreadCount -= 1;
|
||||
#ifdef DEBUG_FORUMS
|
||||
std::cerr << "ForumsDialog::fillThreadFinished done" << std::endl;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void ForumsDialog::fillThreadProgress(int current, int count)
|
||||
|
@ -866,6 +872,8 @@ void ForumsDialog::insertThreads()
|
|||
std::cerr << "ForumsDialog::insertThreads() Start fill thread" << std::endl;
|
||||
#endif
|
||||
|
||||
mFillthreadCount +=1;
|
||||
|
||||
// start thread
|
||||
fillThread->start();
|
||||
}
|
||||
|
|
|
@ -136,6 +136,7 @@ private:
|
|||
QFont m_ForumNameFont;
|
||||
int lastViewType;
|
||||
std::string lastForumID;
|
||||
int mFillthreadCount;
|
||||
|
||||
ForumsFillThread *fillThread;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue