diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2017-06-29 23:55:02 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2017-07-01 19:25:35 +0000 |
commit | 6c70f22ada8f2604a126f421fc8d7c251a8019da (patch) | |
tree | d7a7f8d3610dbbd83ceb735fd137fd77663f9c02 /src/plugins/vcsbase/vcsbasesubmiteditor.cpp | |
parent | caaf3706601bc0d05d8597b89d2b6c2c3ecbb434 (diff) | |
download | qt-creator-6c70f22ada8f2604a126f421fc8d7c251a8019da.tar.gz |
VCS: Preserve selections in commit editor on refresh
Task-number: QTCREATORBUG-18483
Change-Id: I749f2d4d583f197e7b5b6f69116c3a196e85484b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Diffstat (limited to 'src/plugins/vcsbase/vcsbasesubmiteditor.cpp')
-rw-r--r-- | src/plugins/vcsbase/vcsbasesubmiteditor.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index a06b43ca06..a1c01d7a96 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -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(); |