summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-24 01:44:07 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-24 01:44:07 (GMT)
commit5b252b9cf92420e4777c4aa1be3410abf616340b (patch)
treed624ba5a42ad4bf17d66c374da8ccb7b007c63f3
parent41c5c74ae49b6278d6b261e779440148077c9055 (diff)
start to remove more API
-rw-r--r--kate/src/katedocmanager.cpp12
-rw-r--r--kate/src/katedocmanager.h3
-rw-r--r--kate/src/katemainwindow.cpp4
-rw-r--r--kate/src/kateviewmanager.cpp4
-rw-r--r--kate/src/kateviewspace.cpp2
5 files changed, 6 insertions, 19 deletions
diff --git a/kate/src/katedocmanager.cpp b/kate/src/katedocmanager.cpp
index b0b68bc..b337a0b 100644
--- a/kate/src/katedocmanager.cpp
+++ b/kate/src/katedocmanager.cpp
@@ -138,11 +138,6 @@ void KateDocManager::deleteDoc(KTextEditor::Document *doc)
emit documentDeleted(doc);
}
-KTextEditor::Document *KateDocManager::document(uint n)
-{
- return m_docList.at(n);
-}
-
KateDocumentInfo *KateDocManager::documentInfo(KTextEditor::Document *doc)
{
return m_docInfos.contains(doc) ? m_docInfos[doc] : 0;
@@ -308,11 +303,6 @@ bool KateDocManager::closeDocument(KTextEditor::Document *doc, bool closeUrl)
return closeDocuments(documents, closeUrl);
}
-bool KateDocManager::closeOtherDocuments(uint n)
-{
- return closeOtherDocuments(document(n));
-}
-
bool KateDocManager::closeDocumentList(QList<KTextEditor::Document *> documents)
{
bool res = true;
@@ -535,7 +525,7 @@ void KateDocManager::restoreDocumentList(KConfig *config)
KTextEditor::Document *doc = 0;
if (i == 0) {
- doc = document(0);
+ doc = m_docList.first();
} else {
doc = createDoc();
}
diff --git a/kate/src/katedocmanager.h b/kate/src/katedocmanager.h
index 70a604f..72bc586 100644
--- a/kate/src/katedocmanager.h
+++ b/kate/src/katedocmanager.h
@@ -67,8 +67,6 @@ public:
void deleteDoc(KTextEditor::Document *doc);
- KTextEditor::Document *document(uint n);
-
KateDocumentInfo *documentInfo(KTextEditor::Document *doc);
int findDocument(KTextEditor::Document *doc);
@@ -98,7 +96,6 @@ public:
bool closeDocumentList(QList<KTextEditor::Document *> documents);
bool closeAllDocuments(bool closeUrl = true);
bool closeOtherDocuments(KTextEditor::Document *);
- bool closeOtherDocuments(uint);
QList<KTextEditor::Document *> modifiedDocumentList();
bool queryCloseDocuments(KateMainWindow *w);
diff --git a/kate/src/katemainwindow.cpp b/kate/src/katemainwindow.cpp
index 3df5361..2b45bc2 100644
--- a/kate/src/katemainwindow.cpp
+++ b/kate/src/katemainwindow.cpp
@@ -183,8 +183,8 @@ KateMainWindow::KateMainWindow(KConfig *sconfig, const QString &sgroup)
KateApp::self()->pluginManager()->enableAllPluginsGUI(this, sconfig);
// caption update
- for (uint i = 0; i < KateApp::self()->documentManager()->documents(); i++) {
- slotDocumentCreated(KateApp::self()->documentManager()->document(i));
+ Q_FOREACH (auto doc, KateApp::self()->documentManager()->documentList()) {
+ slotDocumentCreated(doc);
}
connect(KateApp::self()->documentManager(), SIGNAL(documentCreated(KTextEditor::Document*)), this, SLOT(slotDocumentCreated(KTextEditor::Document*)));
diff --git a/kate/src/kateviewmanager.cpp b/kate/src/kateviewmanager.cpp
index 8fa2b0d..a915d4a 100644
--- a/kate/src/kateviewmanager.cpp
+++ b/kate/src/kateviewmanager.cpp
@@ -375,8 +375,8 @@ void KateViewManager::documentDeleted(KTextEditor::Document *)
// just for the case we close a document out of many and this was the active one
// if all docs are closed, this will be handled by the documentCreated
- if (!activeView() && (KateApp::self()->documentManager()->documents() > 0)) {
- createView(KateApp::self()->documentManager()->document(KateApp::self()->documentManager()->documents() - 1));
+ if (!activeView() && !KateApp::self()->documentManager()->documentList().isEmpty()) {
+ createView(KateApp::self()->documentManager()->documentList().last());
}
}
diff --git a/kate/src/kateviewspace.cpp b/kate/src/kateviewspace.cpp
index 579c570..c3ad891 100644
--- a/kate/src/kateviewspace.cpp
+++ b/kate/src/kateviewspace.cpp
@@ -456,7 +456,7 @@ void KateViewSpace::restoreConfig(KateViewManager *viewMan, const KConfigBase *c
// avoid empty view space
if (m_docToView.isEmpty()) {
- viewMan->createView(KateApp::self()->documentManager()->document(0), this);
+ viewMan->createView (KateApp::self()->documentManager()->documentList().first(), this);
}
m_group = groupname; // used for restroing view configs later