mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-12 07:59:29 -05:00
fixed selection of current item from link in channels
This commit is contained in:
parent
1c2e094f20
commit
97ad766863
@ -719,7 +719,7 @@ QModelIndex RsGxsChannelPostsModel::getIndexOfMessage(const RsGxsMessageId& mid)
|
||||
quintptr ref ;
|
||||
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)
|
||||
@ -727,7 +727,7 @@ QModelIndex RsGxsChannelPostsModel::getIndexOfMessage(const RsGxsMessageId& mid)
|
||||
quintptr ref ;
|
||||
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();
|
||||
mChannelPostFilesModel->clear();
|
||||
|
||||
std::cerr << "showPostDetails: no valid post. Clearing mSelectedPost." << std::endl;
|
||||
mSelectedPost.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -540,9 +538,8 @@ void GxsChannelPostsWidgetWithModel::postChannelPostLoad()
|
||||
<< mSelectedPost.toStdString() << std::endl;
|
||||
|
||||
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->update();
|
||||
}
|
||||
else
|
||||
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->scrollTo(ui->postsTree->currentIndex());//May change if model reloaded
|
||||
ui->postsTree->scrollTo(index);//May change if model reloaded
|
||||
ui->postsTree->setFocus();
|
||||
ui->postsTree->update();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user