Commit aada429e authored by Christoph Cullmann's avatar Christoph Cullmann

less public API

parent ff4c8b11
......@@ -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 (KateApp::self()->documentManager()->documents() > 1) {
if (KateApp::self()->documentManager()->documentList().size() > 1) {
QTimer::singleShot(0, mainWin, SLOT(slotFileClose()));
} else {
QTimer::singleShot(0, mainWin, SLOT(slotFileQuit()));
......@@ -140,7 +140,7 @@ bool KateAppCommands::exec(KTextEditor::View *view, const QString &cmd, QString
view->document()->documentSave();
}
if (KateApp::self()->documentManager()->documents() > 1) {
if (KateApp::self()->documentManager()->documentList().size() > 1) {
QTimer::singleShot(0, mainWin, SLOT(slotFileClose()));
} else {
QTimer::singleShot(0, mainWin, SLOT(slotFileQuit()));
......
......@@ -127,11 +127,6 @@ KateDocumentInfo *KateDocManager::documentInfo(KTextEditor::Document *doc)
return m_docInfos.contains(doc) ? m_docInfos[doc] : 0;
}
uint KateDocManager::documents()
{
return m_docList.count();
}
KTextEditor::Document *KateDocManager::findDocument(const QUrl &url) const
{
QUrl u(url.adjusted(QUrl::NormalizePathSegments));
......
......@@ -70,8 +70,6 @@ public:
/** Returns the documentNumber of the doc with url URL or -1 if no such doc is found */
KTextEditor::Document *findDocument(const QUrl &url) const;
uint documents();
const QList<KTextEditor::Document *> &documentList() const {
return m_docList;
}
......
......@@ -404,7 +404,7 @@ void KateMainWindow::setupActions()
void KateMainWindow::slotDocumentCloseAll()
{
if (KateApp::self()->documentManager()->documents() >= 1 && KMessageBox::warningContinueCancel(this,
if (KateApp::self()->documentManager()->documentList().size() >= 1 && KMessageBox::warningContinueCancel(this,
i18n("This will close all open documents. Are you sure you want to continue?"),
i18n("Close all documents"),
KStandardGuiItem::cont(),
......@@ -444,7 +444,7 @@ void KateMainWindow::slotDocumentCloseOther()
bool KateMainWindow::queryClose_internal(KTextEditor::Document *doc)
{
uint documentCount = KateApp::self()->documentManager()->documents();
int documentCount = KateApp::self()->documentManager()->documentList().size();
if (! showModOnDiskPrompt()) {
return false;
......@@ -458,7 +458,7 @@ bool KateMainWindow::queryClose_internal(KTextEditor::Document *doc)
shutdown = KateSaveModifiedDialog::queryClose(this, modifiedDocuments);
}
if (KateApp::self()->documentManager()->documents() > documentCount) {
if (KateApp::self()->documentManager()->documentList().size() > documentCount) {
KMessageBox::information(this,
i18n("New file opened while trying to close Kate, closing aborted."),
i18n("Closing Aborted"));
......@@ -836,7 +836,7 @@ bool KateMainWindow::showModOnDiskPrompt()
KTextEditor::Document *doc;
DocVector list;
list.reserve(KateApp::self()->documentManager()->documents());
list.reserve(KateApp::self()->documentManager()->documentList().size());
foreach(doc, KateApp::self()->documentManager()->documentList()) {
if (KateApp::self()->documentManager()->documentInfo(doc)->modifiedOnDisc) {
list.append(doc);
......
......@@ -272,7 +272,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 ((KateApp::self()->documentManager()->documents() == 1)
if ((KateApp::self()->documentManager()->documentList().size() == 1)
&& !document->isModified()
&& document->url().isEmpty()
&& document->documentEnd() == KTextEditor::Cursor::start()) {
......
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