mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-27 19:10:41 -05:00
fixed selection of current item from link in channels
This commit is contained in:
parent
1c2e094f20
commit
97ad766863
2 changed files with 4 additions and 8 deletions
|
|
@ -719,7 +719,7 @@ QModelIndex RsGxsChannelPostsModel::getIndexOfMessage(const RsGxsMessageId& mid)
|
||||||
quintptr ref ;
|
quintptr ref ;
|
||||||
convertTabEntryToRefPointer(i,ref); // we dont use i+1 here because i is not a row, but an index in the mPosts tab
|
convertTabEntryToRefPointer(i,ref); // we dont use i+1 here because i is not a row, but an index in the mPosts tab
|
||||||
|
|
||||||
return createIndex(i%mColumns, i/mColumns,ref);
|
return createIndex(i/mColumns,i%mColumns, ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mPosts[mFilteredPosts[i]].mMeta.mMsgId == postId)
|
if(mPosts[mFilteredPosts[i]].mMeta.mMsgId == postId)
|
||||||
|
|
@ -727,7 +727,7 @@ QModelIndex RsGxsChannelPostsModel::getIndexOfMessage(const RsGxsMessageId& mid)
|
||||||
quintptr ref ;
|
quintptr ref ;
|
||||||
convertTabEntryToRefPointer(i,ref); // we dont use i+1 here because i is not a row, but an index in the mPosts tab
|
convertTabEntryToRefPointer(i,ref); // we dont use i+1 here because i is not a row, but an index in the mPosts tab
|
||||||
|
|
||||||
return createIndex(i%mColumns, i/mColumns,ref);
|
return createIndex(i/mColumns,i%mColumns, ref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -425,8 +425,6 @@ void GxsChannelPostsWidgetWithModel::showPostDetails()
|
||||||
ui->postTime_LB->hide();
|
ui->postTime_LB->hide();
|
||||||
mChannelPostFilesModel->clear();
|
mChannelPostFilesModel->clear();
|
||||||
|
|
||||||
std::cerr << "showPostDetails: no valid post. Clearing mSelectedPost." << std::endl;
|
|
||||||
mSelectedPost.clear();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -540,9 +538,8 @@ void GxsChannelPostsWidgetWithModel::postChannelPostLoad()
|
||||||
<< mSelectedPost.toStdString() << std::endl;
|
<< mSelectedPost.toStdString() << std::endl;
|
||||||
|
|
||||||
ui->postsTree->selectionModel()->setCurrentIndex(index,QItemSelectionModel::ClearAndSelect);
|
ui->postsTree->selectionModel()->setCurrentIndex(index,QItemSelectionModel::ClearAndSelect);
|
||||||
ui->postsTree->scrollTo(ui->postsTree->currentIndex());//May change if model reloaded
|
ui->postsTree->scrollTo(index);//May change if model reloaded
|
||||||
ui->postsTree->setFocus();
|
ui->postsTree->setFocus();
|
||||||
ui->postsTree->update();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
std::cerr << "No pre-selected channel post." << std::endl;
|
std::cerr << "No pre-selected channel post." << std::endl;
|
||||||
|
|
@ -1049,9 +1046,8 @@ bool GxsChannelPostsWidgetWithModel::navigate(const RsGxsMessageId& msgId)
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->postsTree->selectionModel()->setCurrentIndex(index,QItemSelectionModel::ClearAndSelect);
|
ui->postsTree->selectionModel()->setCurrentIndex(index,QItemSelectionModel::ClearAndSelect);
|
||||||
ui->postsTree->scrollTo(ui->postsTree->currentIndex());//May change if model reloaded
|
ui->postsTree->scrollTo(index);//May change if model reloaded
|
||||||
ui->postsTree->setFocus();
|
ui->postsTree->setFocus();
|
||||||
ui->postsTree->update();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue