Commit ff4c8b11 authored by Christoph Cullmann's avatar Christoph Cullmann

deleteDoc itself shall not be ever called, else hell breaks loose ;)

parent caf582f3
......@@ -122,22 +122,6 @@ KTextEditor::Document *KateDocManager::createDoc(const KateDocumentInfo &docInfo
return doc;
}
void KateDocManager::deleteDoc(KTextEditor::Document *doc)
{
KateApp::self()->emitDocumentClosed(QString::number((qptrdiff)doc));
qCDebug(LOG_KATE) << "deleting document with name:" << doc->documentName();
// document will be deleted, soon
emit documentWillBeDeleted(doc);
// really delete the document and its infos
delete m_docInfos.take(doc);
delete m_docList.takeAt(m_docList.indexOf(doc));
// document is gone, emit our signals
emit documentDeleted(doc);
}
KateDocumentInfo *KateDocManager::documentInfo(KTextEditor::Document *doc)
{
return m_docInfos.contains(doc) ? m_docInfos[doc] : 0;
......@@ -264,7 +248,20 @@ bool KateDocManager::closeDocuments(const QList<KTextEditor::Document *> documen
}
}
deleteDoc(doc);
qCDebug(LOG_KATE) << "deleting document with name:" << doc->documentName();
KateApp::self()->emitDocumentClosed(QString::number((qptrdiff)doc));
// document will be deleted, soon
emit documentWillBeDeleted(doc);
// really delete the document and its infos
delete m_docInfos.take(doc);
delete m_docList.takeAt(m_docList.indexOf(doc));
// document is gone, emit our signals
emit documentDeleted(doc);
last++;
}
......
......@@ -65,8 +65,6 @@ public:
KTextEditor::Document *createDoc(const KateDocumentInfo &docInfo = KateDocumentInfo());
void deleteDoc(KTextEditor::Document *doc);
KateDocumentInfo *documentInfo(KTextEditor::Document *doc);
/** Returns the documentNumber of the doc with url URL or -1 if no such doc is found */
......
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