VCS: Preserve selections in commit editor on refresh

Task-number: QTCREATORBUG-18483
Change-Id: I749f2d4d583f197e7b5b6f69116c3a196e85484b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2017-06-29 23:55:02 +03:00
committed by Orgad Shaneh
parent caaf370660
commit 6c70f22ada
3 changed files with 28 additions and 14 deletions

View File

@@ -411,10 +411,15 @@ void VcsBaseSubmitEditor::setFileModel(SubmitFileModel *model)
{
QTC_ASSERT(model, return);
SubmitFileModel *oldModel = d->m_widget->fileModel();
if (oldModel)
QList<int> selected;
if (oldModel) {
model->updateSelections(oldModel);
selected = d->m_widget->selectedRows();
}
d->m_widget->setFileModel(model);
delete oldModel;
if (!selected.isEmpty())
d->m_widget->setSelectedRows(selected);
QSet<QString> uniqueSymbols;
const CPlusPlus::Snapshot cppSnapShot = CppTools::CppModelManager::instance()->snapshot();