forked from qt-creator/qt-creator
VCS: Generalize selections preserving on model refresh
Default implementation is between O(n) (for identical models) to O(n*m) (for disjoint models). If sort order is known, this can be reduced to O(n+m), like in Git implementation. Change-Id: I44662a22961311cb882601d20efa9d445f74748b Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -479,6 +479,11 @@ QStringList VcsBaseSubmitEditor::checkedFiles() const
|
||||
|
||||
void VcsBaseSubmitEditor::setFileModel(SubmitFileModel *m, const QString &repositoryDirectory)
|
||||
{
|
||||
Q_ASSERT(m);
|
||||
if (SubmitFileModel *oldModel = d->m_widget->fileModel()) {
|
||||
m->updateSelections(oldModel);
|
||||
delete oldModel;
|
||||
}
|
||||
d->m_widget->setFileModel(m);
|
||||
|
||||
QSet<QString> uniqueSymbols;
|
||||
|
||||
Reference in New Issue
Block a user