Commit af1127f7 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

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: default avatarAndré Hartmann <aha_1980@gmx.de>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 6a17eafa
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment