VCS: Do not delete SubmitFileModel before setting the new one

setFileModel() calls QTreeView::clearSelection() before setting the new model.
If the view has no model (because it was deleted earlier), a warning is shown.

Change-Id: Id694b073360b08bd8fd4e8b1db04250a71f792c1
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2016-01-05 23:40:21 +02:00
committed by Orgad Shaneh
parent 6a17eafa05
commit af1127f757

View File

@@ -417,11 +417,11 @@ QStringList VcsBaseSubmitEditor::checkedFiles() const
void VcsBaseSubmitEditor::setFileModel(SubmitFileModel *model)
{
QTC_ASSERT(model, return);
if (SubmitFileModel *oldModel = d->m_widget->fileModel()) {
SubmitFileModel *oldModel = d->m_widget->fileModel();
if (oldModel)
model->updateSelections(oldModel);
delete oldModel;
}
d->m_widget->setFileModel(model);
delete oldModel;
QSet<QString> uniqueSymbols;
const CPlusPlus::Snapshot cppSnapShot = CppTools::CppModelManager::instance()->snapshot();