aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Haumann <dhaumann@kde.org>2014-01-22 11:37:30 (GMT)
committerDominik Haumann <dhaumann@kde.org>2014-01-22 11:37:51 (GMT)
commit3ff416ea03d1f5e79a15da40793e0fd91c68bf52 (patch)
tree3f63bed66fe2ba82dc9651fd445cd42b09574344
parentdb0734e5a309bcb26a150e7373dbddc8369bc3bb (diff)
track document name changes
-rw-r--r--kate/app/kateviewspace.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/kate/app/kateviewspace.cpp b/kate/app/kateviewspace.cpp
index 370f3fa..4716bb6 100644
--- a/kate/app/kateviewspace.cpp
+++ b/kate/app/kateviewspace.cpp
@@ -113,7 +113,7 @@ KTextEditor::View *KateViewSpace::createView (KTextEditor::Document *doc)
}
}
- // make sure the document is registered
+ // just register document, it is shown below through showView() then
if ( ! m_docToTabId.contains(doc)) {
registerDocument(doc);
Q_ASSERT(m_docToTabId.contains(doc));
@@ -221,6 +221,8 @@ void KateViewSpace::registerDocument(KTextEditor::Document *doc)
const int index = m_tabBar->addTab(doc->url().toString(), doc->documentName());
m_docToTabId[doc] = index;
+ connect(doc, SIGNAL(documentNameChanged(KTextEditor::Document*)),
+ this, SLOT(updateDocumentName(KTextEditor::Document*)));
connect(doc, SIGNAL(destroyed(QObject*)), this, SLOT(documentDestroyed(QObject*)));
}
@@ -230,7 +232,7 @@ void KateViewSpace::documentDestroyed(QObject * doc)
const int index = m_docToTabId[static_cast<KTextEditor::Document*>(doc)];
m_tabBar->removeTab(index);
m_docToTabId.remove(static_cast<KTextEditor::Document*>(doc));
- disconnect(doc, SIGNAL(destroyed(QObject*)), this, SLOT(documentDestroyed(QObject*)));
+ disconnect(doc, 0, this, 0);
}
void KateViewSpace::updateDocumentName(KTextEditor::Document* doc)