prevent an invalid active column index if columns have been deleted

svn path=/trunk/KDE/kdebase/apps/; revision=716384
This commit is contained in:
Peter Penz 2007-09-24 16:18:29 +00:00
parent 7446edabe4
commit 4616d291ca

View file

@ -536,6 +536,12 @@ void DolphinColumnView::showColumn(const KUrl& url)
(*it)->deleteLater();
}
m_columns.erase(start, end);
const int maxIndex = m_columns.count() - 1;
Q_ASSERT(maxIndex >= 0);
if (m_index > maxIndex) {
m_index = maxIndex;
}
break;
}
}