mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-19 14:30:43 -04:00
Added disable/enable of GxsIdDetails process.
Disabled GxsIdDetails process when filling gxs id's in forums. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8556 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c3b794afb2
commit
227e7121cc
3 changed files with 82 additions and 45 deletions
|
@ -770,6 +770,8 @@ void GxsForumThreadWidget::fillThreadFinished()
|
|||
mStateHelper->setActive(mTokenTypeInsertThreads, true);
|
||||
ui->threadTreeWidget->setSortingEnabled(false);
|
||||
|
||||
GxsIdDetails::enableProcess(false);
|
||||
|
||||
/* add all messages in! */
|
||||
if (mLastViewType != thread->mViewType || mLastForumID != groupId()) {
|
||||
ui->threadTreeWidget->clear();
|
||||
|
@ -786,6 +788,27 @@ void GxsForumThreadWidget::fillThreadFinished()
|
|||
cleanupItems(thread->mItems);
|
||||
}
|
||||
|
||||
/* Move value from ROLE_THREAD_AUTHOR to GxsIdRSTreeWidgetItem::setId */
|
||||
QTreeWidgetItemIterator itemIterator(ui->threadTreeWidget);
|
||||
QTreeWidgetItem *item = NULL;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
++itemIterator;
|
||||
|
||||
QString gxsId = item->data(COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR).toString();
|
||||
if (gxsId.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
item->setData(COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR, QVariant());
|
||||
|
||||
GxsIdRSTreeWidgetItem *gxsIdItem = dynamic_cast<GxsIdRSTreeWidgetItem*>(item);
|
||||
if (gxsIdItem) {
|
||||
gxsIdItem->setId(RsGxsId(gxsId.toStdString()), COLUMN_THREAD_AUTHOR, false);
|
||||
}
|
||||
}
|
||||
|
||||
GxsIdDetails::enableProcess(true);
|
||||
|
||||
ui->threadTreeWidget->setSortingEnabled(true);
|
||||
|
||||
if (thread->mFocusMsgId.empty() == false) {
|
||||
|
@ -880,7 +903,7 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum
|
|||
item->setText(COLUMN_THREAD_DATE, text);
|
||||
item->setData(COLUMN_THREAD_DATE, ROLE_THREAD_SORT, sort);
|
||||
|
||||
item->setId(msg.mMeta.mAuthorId, COLUMN_THREAD_AUTHOR, false);
|
||||
// Set later with GxsIdRSTreeWidgetItem::setId
|
||||
item->setData(COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR, QString::fromStdString(msg.mMeta.mAuthorId.toStdString()));
|
||||
//#TODO
|
||||
#if 0
|
||||
|
@ -1035,20 +1058,7 @@ static void copyItem(QTreeWidgetItem *item, const QTreeWidgetItem *newItem)
|
|||
{
|
||||
int i;
|
||||
for (i = 0; i < COLUMN_THREAD_COUNT; ++i) {
|
||||
if (i == COLUMN_THREAD_AUTHOR) {
|
||||
QString authorId = newItem->data(COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR).toString();
|
||||
if (authorId != item->data(COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR).toString()) {
|
||||
/* Author has changed? */
|
||||
GxsIdRSTreeWidgetItem *gxsIdItem = dynamic_cast<GxsIdRSTreeWidgetItem*>(item);
|
||||
if (gxsIdItem) {
|
||||
/* Set new gxs id */
|
||||
gxsIdItem->setId(RsGxsId(authorId.toStdString()), i, false);
|
||||
} else {
|
||||
/* Copy text */
|
||||
item->setText(i, newItem->text(i));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (i != COLUMN_THREAD_AUTHOR) {
|
||||
/* Copy text */
|
||||
item->setText(i, newItem->text(i));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue