Fix sporadic Kate crash first reported in KDE bug 140135

pull/2/head
Timothy Pearson 12 years ago
parent b5c729ae44
commit f29ac1d284

@ -364,11 +364,16 @@ void KateFileList::updateFileListLocations()
TQListViewItem* item = firstChild(); TQListViewItem* item = firstChild();
int i=0; int i=0;
while (item) { while (item) {
Kate::Document* itemDocument = ((KateFileListItem *)item)->document();
if (m_sort == KateFileList::sortManual) { if (m_sort == KateFileList::sortManual) {
((KateFileListItem *)item)->document()->setDocumentListPosition(i); if (KateDocManager::self()->findDocument(itemDocument) >= 0) {
itemDocument->setDocumentListPosition(i);
}
} }
else { else {
((KateFileListItem *)item)->document()->setDocumentListPosition(-1); if (KateDocManager::self()->findDocument(itemDocument) >= 0) {
itemDocument->setDocumentListPosition(-1);
}
} }
item = item->itemBelow(); item = item->itemBelow();
i++; i++;

Loading…
Cancel
Save