aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-23 15:01:48 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-23 15:01:48 (GMT)
commit7ce75cee8304c2711fd82ff93ef8be41a9662f90 (patch)
tree6cfda87a4a184a11d5231793729d5e704ceb6d54
parent87d5a0fdb44a5569db573f45fcff54b3791143eb (diff)
cleanup internal API
-rw-r--r--kate/app/kateappcommands.cpp14
-rw-r--r--kate/app/kateconfigdialog.cpp12
-rw-r--r--kate/app/katedocmanager.cpp5
-rw-r--r--kate/app/katedocmanager.h2
-rw-r--r--kate/app/katemainwindow.cpp48
-rw-r--r--kate/app/katemwmodonhddialog.cpp11
-rw-r--r--kate/app/kateviewmanager.cpp23
-rw-r--r--kate/app/kateviewspace.cpp4
-rw-r--r--kate/session/katesessionmanager.cpp4
9 files changed, 59 insertions, 64 deletions
diff --git a/kate/app/kateappcommands.cpp b/kate/app/kateappcommands.cpp
index 1b19335..45378b6 100644
--- a/kate/app/kateappcommands.cpp
+++ b/kate/app/kateappcommands.cpp
@@ -84,7 +84,7 @@ bool KateAppCommands::exec(KTextEditor::View *view, const QString &cmd, QString
if (re_write.exactMatch(command)) { //TODO: handle writing to specific file
if (!re_write.cap(1).isEmpty()) { // [a]ll
- KateDocManager::self()->saveAll();
+ KateApp::self()->documentManager()->saveAll();
msg = i18n("All documents written to disk");
} else {
view->document()->documentSave();
@@ -101,11 +101,11 @@ bool KateAppCommands::exec(KTextEditor::View *view, const QString &cmd, QString
if (allDocuments) {
if (save) {
- KateDocManager::self()->saveAll();
+ KateApp::self()->documentManager()->saveAll();
}
if (doNotPromptForSave) {
- foreach(KTextEditor::Document * doc, KateDocManager::self()->documentList())
+ foreach(KTextEditor::Document * doc, KateApp::self()->documentManager()->documentList())
if (doc->isModified()) {
doc->setModified(false);
}
@@ -124,7 +124,7 @@ bool KateAppCommands::exec(KTextEditor::View *view, const QString &cmd, QString
if (mainWin->viewManager()->count() > 1) {
QTimer::singleShot(0, mainWin->viewManager(), SLOT(slotCloseCurrentViewSpace()));
} else {
- if (KateDocManager::self()->documents() > 1) {
+ if (KateApp::self()->documentManager()->documents() > 1) {
QTimer::singleShot(0, mainWin, SLOT(slotFileClose()));
} else {
QTimer::singleShot(0, mainWin, SLOT(slotFileQuit()));
@@ -133,14 +133,14 @@ bool KateAppCommands::exec(KTextEditor::View *view, const QString &cmd, QString
}
} else if (re_exit.exactMatch(command)) {
if (!re_exit.cap(1).isEmpty()) { // a[ll]
- KateDocManager::self()->saveAll();
+ KateApp::self()->documentManager()->saveAll();
QTimer::singleShot(0, mainWin, SLOT(slotFileQuit()));
} else {
if (view->document()->isModified()) {
view->document()->documentSave();
}
- if (KateDocManager::self()->documents() > 1) {
+ if (KateApp::self()->documentManager()->documents() > 1) {
QTimer::singleShot(0, mainWin, SLOT(slotFileClose()));
} else {
QTimer::singleShot(0, mainWin, SLOT(slotFileQuit()));
@@ -161,7 +161,7 @@ bool KateAppCommands::exec(KTextEditor::View *view, const QString &cmd, QString
url = QUrl(QUrl(QDir::currentPath() + QStringLiteral("/")).resolved(arg2path)); // + "/" is needed because of http://lists.qt.nokia.com/public/qt-interest/2011-May/033913.html
}
QFileInfo file(url.toLocalFile());
- KTextEditor::Document *doc = KateDocManager::self()->findDocument(url);
+ KTextEditor::Document *doc = KateApp::self()->documentManager()->findDocument(url);
if (doc) {
mainWin->viewManager()->activateView(doc);
} else if (file.exists()) {
diff --git a/kate/app/kateconfigdialog.cpp b/kate/app/kateconfigdialog.cpp
index 896f71a..9bce159 100644
--- a/kate/app/kateconfigdialog.cpp
+++ b/kate/app/kateconfigdialog.cpp
@@ -105,7 +105,7 @@ KateConfigDialog::KateConfigDialog(KateMainWindow *parent, KTextEditor::View *vi
// save meta infos
m_saveMetaInfos = new QCheckBox(buttonGroup);
m_saveMetaInfos->setText(i18n("Keep &meta-information past sessions"));
- m_saveMetaInfos->setChecked(KateDocManager::self()->getSaveMetaInfos());
+ m_saveMetaInfos->setChecked(KateApp::self()->documentManager()->getSaveMetaInfos());
m_saveMetaInfos->setWhatsThis(i18n(
"Check this if you want document configuration like for example "
"bookmarks to be saved past editor sessions. The configuration will be "
@@ -118,13 +118,13 @@ KateConfigDialog::KateConfigDialog(KateMainWindow *parent, KTextEditor::View *vi
QFrame *metaInfos = new QFrame(buttonGroup);
QHBoxLayout *hlayout = new QHBoxLayout(metaInfos);
- metaInfos->setEnabled(KateDocManager::self()->getSaveMetaInfos());
+ metaInfos->setEnabled(KateApp::self()->documentManager()->getSaveMetaInfos());
QLabel *label = new QLabel(i18n("&Delete unused meta-information after:"), metaInfos);
hlayout->addWidget(label);
m_daysMetaInfos = new QSpinBox(metaInfos);
m_daysMetaInfos->setMaximum(180);
m_daysMetaInfos->setSpecialValueText(i18n("(never)"));
- m_daysMetaInfos->setValue(KateDocManager::self()->getDaysMetaInfos());
+ m_daysMetaInfos->setValue(KateApp::self()->documentManager()->getDaysMetaInfos());
hlayout->addWidget(m_daysMetaInfos);
label->setBuddy(m_daysMetaInfos);
connect(m_saveMetaInfos, SIGNAL(toggled(bool)), metaInfos, SLOT(setEnabled(bool)));
@@ -336,16 +336,16 @@ void KateConfigDialog::slotApply()
}
cg.writeEntry("Save Meta Infos", m_saveMetaInfos->isChecked());
- KateDocManager::self()->setSaveMetaInfos(m_saveMetaInfos->isChecked());
+ KateApp::self()->documentManager()->setSaveMetaInfos(m_saveMetaInfos->isChecked());
cg.writeEntry("Days Meta Infos", m_daysMetaInfos->value());
- KateDocManager::self()->setDaysMetaInfos(m_daysMetaInfos->value());
+ KateApp::self()->documentManager()->setDaysMetaInfos(m_daysMetaInfos->value());
cg.writeEntry("Modified Notification", m_modNotifications->isChecked());
m_mainWindow->setModNotificationEnabled(m_modNotifications->isChecked());
// patch document modified warn state
- const QList<KTextEditor::Document *> &docs = KateDocManager::self()->documentList();
+ const QList<KTextEditor::Document *> &docs = KateApp::self()->documentManager()->documentList();
foreach(KTextEditor::Document * doc, docs)
if (qobject_cast<KTextEditor::ModificationInterface *>(doc)) {
qobject_cast<KTextEditor::ModificationInterface *>(doc)->setModifiedOnDiskWarning(!m_modNotifications->isChecked());
diff --git a/kate/app/katedocmanager.cpp b/kate/app/katedocmanager.cpp
index 0228f0b..b0b68bc 100644
--- a/kate/app/katedocmanager.cpp
+++ b/kate/app/katedocmanager.cpp
@@ -93,11 +93,6 @@ KateDocManager::~KateDocManager()
delete m_metaInfos;
}
-KateDocManager *KateDocManager::self()
-{
- return KateApp::self()->documentManager();
-}
-
KTextEditor::Document *KateDocManager::createDoc(const KateDocumentInfo &docInfo)
{
qCDebug(LOG_KATE) << "createDoc" << endl;
diff --git a/kate/app/katedocmanager.h b/kate/app/katedocmanager.h
index 0b54970..70a604f 100644
--- a/kate/app/katedocmanager.h
+++ b/kate/app/katedocmanager.h
@@ -63,8 +63,6 @@ public:
KateDocManager(QObject *parent);
~KateDocManager();
- static KateDocManager *self();
-
KTextEditor::Document *createDoc(const KateDocumentInfo &docInfo = KateDocumentInfo());
void deleteDoc(KTextEditor::Document *doc);
diff --git a/kate/app/katemainwindow.cpp b/kate/app/katemainwindow.cpp
index cc9ba0e..ea08cf4 100644
--- a/kate/app/katemainwindow.cpp
+++ b/kate/app/katemainwindow.cpp
@@ -183,11 +183,11 @@ KateMainWindow::KateMainWindow(KConfig *sconfig, const QString &sgroup)
KateApp::self()->pluginManager()->enableAllPluginsGUI(this, sconfig);
// caption update
- for (uint i = 0; i < KateDocManager::self()->documents(); i++) {
- slotDocumentCreated(KateDocManager::self()->document(i));
+ for (uint i = 0; i < KateApp::self()->documentManager()->documents(); i++) {
+ slotDocumentCreated(KateApp::self()->documentManager()->document(i));
}
- connect(KateDocManager::self(), SIGNAL(documentCreated(KTextEditor::Document*)), this, SLOT(slotDocumentCreated(KTextEditor::Document*)));
+ connect(KateApp::self()->documentManager(), SIGNAL(documentCreated(KTextEditor::Document*)), this, SLOT(slotDocumentCreated(KTextEditor::Document*)));
readOptions();
@@ -284,17 +284,17 @@ void KateMainWindow::setupActions()
a->setIcon(QIcon::fromTheme(QStringLiteral("document-save-all")));
a->setText(i18n("Save A&ll"));
a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
- connect(a, SIGNAL(triggered()), KateDocManager::self(), SLOT(saveAll()));
+ connect(a, SIGNAL(triggered()), KateApp::self()->documentManager(), SLOT(saveAll()));
a->setWhatsThis(i18n("Save all open, modified documents to disk."));
a = actionCollection()->addAction(QStringLiteral("file_reload_all"));
a->setText(i18n("&Reload All"));
- connect(a, SIGNAL(triggered()), KateDocManager::self(), SLOT(reloadAll()));
+ connect(a, SIGNAL(triggered()), KateApp::self()->documentManager(), SLOT(reloadAll()));
a->setWhatsThis(i18n("Reload all open documents."));
a = actionCollection()->addAction(QStringLiteral("file_close_orphaned"));
a->setText(i18n("Close Orphaned"));
- connect(a, SIGNAL(triggered()), KateDocManager::self(), SLOT(closeOrphaned()));
+ connect(a, SIGNAL(triggered()), KateApp::self()->documentManager(), SLOT(closeOrphaned()));
a->setWhatsThis(i18n("Close all documents in the file list that could not be reopened, because they are not accessible anymore."));
actionCollection()->addAction(KStandardAction::Close, QStringLiteral("file_close"), m_viewManager, SLOT(slotDocumentClose()))
@@ -404,14 +404,14 @@ void KateMainWindow::setupActions()
void KateMainWindow::slotDocumentCloseAll()
{
- if (KateDocManager::self()->documents() >= 1 && KMessageBox::warningContinueCancel(this,
+ if (KateApp::self()->documentManager()->documents() >= 1 && KMessageBox::warningContinueCancel(this,
i18n("This will close all open documents. Are you sure you want to continue?"),
i18n("Close all documents"),
KStandardGuiItem::cont(),
KStandardGuiItem::cancel(),
QStringLiteral("closeAll")) != KMessageBox::Cancel) {
if (queryClose_internal()) {
- KateDocManager::self()->closeAllDocuments(false);
+ KateApp::self()->documentManager()->closeAllDocuments(false);
}
}
}
@@ -419,7 +419,7 @@ void KateMainWindow::slotDocumentCloseAll()
void KateMainWindow::slotDocumentCloseOther(KTextEditor::Document *document)
{
if (queryClose_internal(document)) {
- KateDocManager::self()->closeOtherDocuments(document);
+ KateApp::self()->documentManager()->closeOtherDocuments(document);
}
}
@@ -432,25 +432,25 @@ void KateMainWindow::slotDocumentCloseSelected(const QList<KTextEditor::Document
}
}
- KateDocManager::self()->closeDocuments(documents);
+ KateApp::self()->documentManager()->closeDocuments(documents);
}
void KateMainWindow::slotDocumentCloseOther()
{
if (queryClose_internal(m_viewManager->activeView()->document())) {
- KateDocManager::self()->closeOtherDocuments(m_viewManager->activeView()->document());
+ KateApp::self()->documentManager()->closeOtherDocuments(m_viewManager->activeView()->document());
}
}
bool KateMainWindow::queryClose_internal(KTextEditor::Document *doc)
{
- uint documentCount = KateDocManager::self()->documents();
+ uint documentCount = KateApp::self()->documentManager()->documents();
if (! showModOnDiskPrompt()) {
return false;
}
- QList<KTextEditor::Document *> modifiedDocuments = KateDocManager::self()->modifiedDocumentList();
+ QList<KTextEditor::Document *> modifiedDocuments = KateApp::self()->documentManager()->modifiedDocumentList();
modifiedDocuments.removeAll(doc);
bool shutdown = (modifiedDocuments.count() == 0);
@@ -458,7 +458,7 @@ bool KateMainWindow::queryClose_internal(KTextEditor::Document *doc)
shutdown = KateSaveModifiedDialog::queryClose(this, modifiedDocuments);
}
- if (KateDocManager::self()->documents() > documentCount) {
+ if (KateApp::self()->documentManager()->documents() > documentCount) {
KMessageBox::information(this,
i18n("New file opened while trying to close Kate, closing aborted."),
i18n("Closing Aborted"));
@@ -540,8 +540,8 @@ void KateMainWindow::readOptions()
const KConfigGroup generalGroup(config, "General");
m_modNotification = generalGroup.readEntry("Modified Notification", false);
- KateDocManager::self()->setSaveMetaInfos(generalGroup.readEntry("Save Meta Infos", true));
- KateDocManager::self()->setDaysMetaInfos(generalGroup.readEntry("Days Meta Infos", 30));
+ KateApp::self()->documentManager()->setSaveMetaInfos(generalGroup.readEntry("Save Meta Infos", true));
+ KateApp::self()->documentManager()->setDaysMetaInfos(generalGroup.readEntry("Days Meta Infos", 30));
m_paShowPath->setChecked(generalGroup.readEntry("Show Full Path in Title", false));
m_paShowStatusBar->setChecked(generalGroup.readEntry("Show Status Bar", true));
@@ -556,9 +556,9 @@ void KateMainWindow::saveOptions()
KConfigGroup generalGroup(config, "General");
- generalGroup.writeEntry("Save Meta Infos", KateDocManager::self()->getSaveMetaInfos());
+ generalGroup.writeEntry("Save Meta Infos", KateApp::self()->documentManager()->getSaveMetaInfos());
- generalGroup.writeEntry("Days Meta Infos", KateDocManager::self()->getDaysMetaInfos());
+ generalGroup.writeEntry("Days Meta Infos", KateApp::self()->documentManager()->getDaysMetaInfos());
generalGroup.writeEntry("Show Full Path in Title", m_paShowPath->isChecked());
generalGroup.writeEntry("Show Status Bar", m_paShowStatusBar->isChecked());
@@ -656,7 +656,7 @@ void KateMainWindow::slotDropEvent(QDropEvent *event)
//
else if (event->mimeData()->hasText()) {
KTextEditor::Document *doc =
- KateDocManager::self()->createDoc();
+ KateApp::self()->documentManager()->createDoc();
doc->setText(event->mimeData()->text());
m_viewManager->activateView(doc);
}
@@ -691,7 +691,7 @@ void KateMainWindow::editKeys()
}
dlg.configure();
- QList<KTextEditor::Document *> l = KateDocManager::self()->documentList();
+ QList<KTextEditor::Document *> l = KateApp::self()->documentManager()->documentList();
for (int i = 0; i < l.count(); i++) {
// qCDebug(LOG_KATE)<<"reloading Keysettings for document "<<i;
l.at(i)->reloadXML();
@@ -836,9 +836,9 @@ bool KateMainWindow::showModOnDiskPrompt()
KTextEditor::Document *doc;
DocVector list;
- list.reserve(KateDocManager::self()->documents());
- foreach(doc, KateDocManager::self()->documentList()) {
- if (KateDocManager::self()->documentInfo(doc)->modifiedOnDisc) {
+ list.reserve(KateApp::self()->documentManager()->documents());
+ foreach(doc, KateApp::self()->documentManager()->documentList()) {
+ if (KateApp::self()->documentManager()->documentInfo(doc)->modifiedOnDisc) {
list.append(doc);
}
}
@@ -941,7 +941,7 @@ void KateMainWindow::readProperties(const KConfigGroup &config)
void KateMainWindow::saveGlobalProperties(KConfig *sessionConfig)
{
- KateDocManager::self()->saveDocumentList(sessionConfig);
+ KateApp::self()->documentManager()->saveDocumentList(sessionConfig);
KConfigGroup cg(sessionConfig, "General");
cg.writeEntry("Last Session", KateApp::self()->sessionManager()->activeSession()->name());
diff --git a/kate/app/katemwmodonhddialog.cpp b/kate/app/katemwmodonhddialog.cpp
index ecfc547..6bcd79a 100644
--- a/kate/app/katemwmodonhddialog.cpp
+++ b/kate/app/katemwmodonhddialog.cpp
@@ -19,6 +19,7 @@
#include "katemwmodonhddialog.h"
+#include "kateapp.h"
#include "katedocmanager.h"
#include "katemainwindow.h"
@@ -95,7 +96,7 @@ KateMwModOnHdDialog::KateMwModOnHdDialog(DocVector docs, QWidget *parent, const
m_stateTexts << QString() << i18n("Modified") << i18n("Created") << i18n("Deleted");
for (int i = 0; i < docs.size(); i++) {
- new KateDocItem(docs[i], m_stateTexts[(uint)KateDocManager::self()->documentInfo(docs[i])->modifiedOnDiscReason ], twDocuments);
+ new KateDocItem(docs[i], m_stateTexts[(uint)KateApp::self()->documentManager()->documentInfo(docs[i])->modifiedOnDiscReason ], twDocuments);
}
twDocuments->header()->setStretchLastSection(false);
twDocuments->header()->setSectionResizeMode(0, QHeaderView::Stretch);
@@ -171,7 +172,7 @@ void KateMwModOnHdDialog::handleSelected(int action)
for (QTreeWidgetItemIterator it(twDocuments); *it; ++it) {
KateDocItem *item = (KateDocItem *) * it;
if (item->checkState(0) == Qt::Checked) {
- KTextEditor::ModificationInterface::ModifiedOnDiskReason reason = KateDocManager::self()->documentInfo(item->document)->modifiedOnDiscReason;
+ KTextEditor::ModificationInterface::ModifiedOnDiskReason reason = KateApp::self()->documentManager()->documentInfo(item->document)->modifiedOnDiscReason;
bool success = true;
if (KTextEditor::ModificationInterface *iface = qobject_cast<KTextEditor::ModificationInterface *>(item->document)) {
@@ -221,7 +222,7 @@ void KateMwModOnHdDialog::slotSelectionChanged(QTreeWidgetItem *current, QTreeWi
{
// set the diff button enabled
btnDiff->setEnabled(current &&
- KateDocManager::self()->documentInfo((static_cast<KateDocItem *>(current))->document)->modifiedOnDiscReason != KTextEditor::ModificationInterface::OnDiskDeleted);
+ KateApp::self()->documentManager()->documentInfo((static_cast<KateDocItem *>(current))->document)->modifiedOnDiscReason != KTextEditor::ModificationInterface::OnDiskDeleted);
}
// ### the code below is slightly modified from kdelibs/kate/part/katedialogs,
@@ -239,7 +240,7 @@ void KateMwModOnHdDialog::slotDiff()
KTextEditor::Document *doc = (static_cast<KateDocItem *>(twDocuments->currentItem()))->document;
// don't try to diff a deleted file
- if (KateDocManager::self()->documentInfo(doc)->modifiedOnDiscReason == KTextEditor::ModificationInterface::OnDiskDeleted) {
+ if (KateApp::self()->documentManager()->documentInfo(doc)->modifiedOnDiscReason == KTextEditor::ModificationInterface::OnDiskDeleted) {
return;
}
@@ -323,7 +324,7 @@ void KateMwModOnHdDialog::addDocument(KTextEditor::Document *doc)
break;
}
}
- new KateDocItem(doc, m_stateTexts[(uint)KateDocManager::self()->documentInfo(doc)->modifiedOnDiscReason ], twDocuments);
+ new KateDocItem(doc, m_stateTexts[(uint)KateApp::self()->documentManager()->documentInfo(doc)->modifiedOnDiscReason ], twDocuments);
}
void KateMwModOnHdDialog::keyPressEvent(QKeyEvent *event)
diff --git a/kate/app/kateviewmanager.cpp b/kate/app/kateviewmanager.cpp
index 92339b5..ed2ffbe 100644
--- a/kate/app/kateviewmanager.cpp
+++ b/kate/app/kateviewmanager.cpp
@@ -21,6 +21,7 @@
//BEGIN Includes
#include "kateviewmanager.h"
+#include "kateapp.h"
#include "katemainwindow.h"
#include "katedocmanager.h"
#include "kateviewspace.h"
@@ -87,12 +88,12 @@ KateViewManager::KateViewManager(QWidget *parentW, KateMainWindow *parent)
connect(this, SIGNAL(viewChanged(KTextEditor::View*)), this, SLOT(slotViewChanged()));
- connect(KateDocManager::self(), SIGNAL(documentCreatedViewManager(KTextEditor::Document*)), this, SLOT(documentCreated(KTextEditor::Document*)));
- connect(KateDocManager::self(), SIGNAL(documentDeleted(KTextEditor::Document*)), this, SLOT(documentDeleted(KTextEditor::Document*)));
+ connect(KateApp::self()->documentManager(), SIGNAL(documentCreatedViewManager(KTextEditor::Document*)), this, SLOT(documentCreated(KTextEditor::Document*)));
+ connect(KateApp::self()->documentManager(), SIGNAL(documentDeleted(KTextEditor::Document*)), this, SLOT(documentDeleted(KTextEditor::Document*)));
// register all already existing documents
m_blockViewCreationAndActivation = true;
- const QList<KTextEditor::Document *> &docs = KateDocManager::self()->documentList();
+ const QList<KTextEditor::Document *> &docs = KateApp::self()->documentManager()->documentList();
foreach(KTextEditor::Document * doc, docs)
documentCreated(doc);
m_blockViewCreationAndActivation = false;
@@ -246,7 +247,7 @@ void KateViewManager::slotDocumentClose(KTextEditor::Document *document)
{
// prevent close document if only one view alive and the document of
// it is not modified and empty !!!
- if ((KateDocManager::self()->documents() == 1)
+ if ((KateApp::self()->documentManager()->documents() == 1)
&& !document->isModified()
&& document->url().isEmpty()
&& document->documentEnd() == KTextEditor::Cursor::start()) {
@@ -255,7 +256,7 @@ void KateViewManager::slotDocumentClose(KTextEditor::Document *document)
}
// close document
- KateDocManager::self()->closeDocument(document);
+ KateApp::self()->documentManager()->closeDocument(document);
}
void KateViewManager::slotDocumentClose()
@@ -275,7 +276,7 @@ KTextEditor::Document *KateViewManager::openUrl(const QUrl &url,
bool isTempFile,
const KateDocumentInfo &docInfo)
{
- KTextEditor::Document *doc = KateDocManager::self()->openUrl(url, encoding, isTempFile, docInfo);
+ KTextEditor::Document *doc = KateApp::self()->documentManager()->openUrl(url, encoding, isTempFile, docInfo);
if (!doc->url().isEmpty()) {
m_mainWindow->fileOpenRecent()->addUrl(doc->url());
@@ -293,7 +294,7 @@ KTextEditor::Document *KateViewManager::openUrls(const QList<QUrl> &urls,
bool isTempFile,
const KateDocumentInfo &docInfo)
{
- QList<KTextEditor::Document *> docs = KateDocManager::self()->openUrls(urls, encoding, isTempFile, docInfo);
+ QList<KTextEditor::Document *> docs = KateApp::self()->documentManager()->openUrls(urls, encoding, isTempFile, docInfo);
foreach(const KTextEditor::Document * doc, docs) {
if (!doc->url().isEmpty()) {
@@ -306,7 +307,7 @@ KTextEditor::Document *KateViewManager::openUrls(const QList<QUrl> &urls,
KTextEditor::View *KateViewManager::openUrlWithView(const QUrl &url, const QString &encoding)
{
- KTextEditor::Document *doc = KateDocManager::self()->openUrl(url, encoding);
+ KTextEditor::Document *doc = KateApp::self()->documentManager()->openUrl(url, encoding);
if (!doc) {
return 0;
@@ -356,8 +357,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() && (KateDocManager::self()->documents() > 0)) {
- createView(KateDocManager::self()->document(KateDocManager::self()->documents() - 1));
+ if (!activeView() && (KateApp::self()->documentManager()->documents() > 0)) {
+ createView(KateApp::self()->documentManager()->document(KateApp::self()->documentManager()->documents() - 1));
}
}
@@ -376,7 +377,7 @@ bool KateViewManager::createView(KTextEditor::Document *doc, KateViewSpace *vs)
// create doc
if (!doc) {
- doc = KateDocManager::self()->createDoc();
+ doc = KateApp::self()->documentManager()->createDoc();
}
/**
diff --git a/kate/app/kateviewspace.cpp b/kate/app/kateviewspace.cpp
index a49fa39..2dcd6d2 100644
--- a/kate/app/kateviewspace.cpp
+++ b/kate/app/kateviewspace.cpp
@@ -335,7 +335,7 @@ void KateViewSpace::restoreConfig(KateViewManager *viewMan, const KConfigBase *c
QString fn = group.readEntry("Active View");
if (!fn.isEmpty()) {
- KTextEditor::Document *doc = KateDocManager::self()->findDocument(QUrl(fn));
+ KTextEditor::Document *doc = KateApp::self()->documentManager()->findDocument(QUrl(fn));
if (doc) {
// view config, group: "ViewSpace <n> url"
@@ -353,7 +353,7 @@ void KateViewSpace::restoreConfig(KateViewManager *viewMan, const KConfigBase *c
}
if (mViewList.isEmpty()) {
- viewMan->createView(KateDocManager::self()->document(0));
+ viewMan->createView(KateApp::self()->documentManager()->document(0));
}
m_group = groupname; // used for restroing view configs later
diff --git a/kate/session/katesessionmanager.cpp b/kate/session/katesessionmanager.cpp
index 05911b6..e5bcef4 100644
--- a/kate/session/katesessionmanager.cpp
+++ b/kate/session/katesessionmanager.cpp
@@ -151,7 +151,7 @@ bool KateSessionManager::activateSession(KateSession::Ptr session,
saveActiveSession();
// really close last
- KateDocManager::self()->closeAllDocuments();
+ KateApp::self()->documentManager()->closeAllDocuments();
}
// set the new session
@@ -302,7 +302,7 @@ void KateSessionManager::saveSessionTo(KConfig *sc) const
KateApp::self()->pluginManager()->writeConfig(sc);
// save document configs + which documents to load
- KateDocManager::self()->saveDocumentList(sc);
+ KateApp::self()->documentManager()->saveDocumentList(sc);
sc->group("Open MainWindows").writeEntry("Count", KateApp::self()->mainWindowsCount());