mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-09 14:52:28 -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;
|
m_bProcessSettings = false;
|
||||||
subscribeFlags = 0;
|
subscribeFlags = 0;
|
||||||
|
mFillthreadCount = 0;
|
||||||
|
|
||||||
|
|
||||||
connect( ui.forumTreeWidget, SIGNAL( treeCustomContextMenuRequested( QPoint ) ), this, SLOT( forumListCustomPopupMenu( QPoint ) ) );
|
connect( ui.forumTreeWidget, SIGNAL( treeCustomContextMenuRequested( QPoint ) ), this, SLOT( forumListCustomPopupMenu( QPoint ) ) );
|
||||||
connect( ui.threadTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( threadListCustomPopupMenu( 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> forumIds;
|
||||||
std::list<std::string>::iterator it;
|
std::list<std::string>::iterator it;
|
||||||
if (!rsForums)
|
|
||||||
|
// suspend access to forum while thread is running
|
||||||
|
if (!rsForums || (mFillthreadCount != 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (rsForums->forumsChanged(forumIds))
|
if (rsForums->forumsChanged(forumIds))
|
||||||
|
@ -770,9 +774,11 @@ void ForumsDialog::fillThreadFinished()
|
||||||
thread = NULL;
|
thread = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mFillthreadCount -= 1;
|
||||||
#ifdef DEBUG_FORUMS
|
#ifdef DEBUG_FORUMS
|
||||||
std::cerr << "ForumsDialog::fillThreadFinished done" << std::endl;
|
std::cerr << "ForumsDialog::fillThreadFinished done" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ForumsDialog::fillThreadProgress(int current, int count)
|
void ForumsDialog::fillThreadProgress(int current, int count)
|
||||||
|
@ -866,6 +872,8 @@ void ForumsDialog::insertThreads()
|
||||||
std::cerr << "ForumsDialog::insertThreads() Start fill thread" << std::endl;
|
std::cerr << "ForumsDialog::insertThreads() Start fill thread" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
mFillthreadCount +=1;
|
||||||
|
|
||||||
// start thread
|
// start thread
|
||||||
fillThread->start();
|
fillThread->start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,6 +136,7 @@ private:
|
||||||
QFont m_ForumNameFont;
|
QFont m_ForumNameFont;
|
||||||
int lastViewType;
|
int lastViewType;
|
||||||
std::string lastForumID;
|
std::string lastForumID;
|
||||||
|
int mFillthreadCount;
|
||||||
|
|
||||||
ForumsFillThread *fillThread;
|
ForumsFillThread *fillThread;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue