Changeset View
Changeset View
Standalone View
Standalone View
kate/kateviewmanager.cpp
Show First 20 Lines • Show All 258 Lines • ▼ Show 20 Line(s) | 224 | { | |||
---|---|---|---|---|---|
259 | docInfo.openedByUser = true; | 259 | docInfo.openedByUser = true; | ||
260 | if (KTextEditor::Document *lastID = openUrls(urls, QString(), false, docInfo)) { | 260 | if (KTextEditor::Document *lastID = openUrls(urls, QString(), false, docInfo)) { | ||
261 | activateView(lastID); | 261 | activateView(lastID); | ||
262 | } | 262 | } | ||
263 | } | 263 | } | ||
264 | 264 | | |||
265 | void KateViewManager::slotDocumentClose(KTextEditor::Document *document) | 265 | void KateViewManager::slotDocumentClose(KTextEditor::Document *document) | ||
266 | { | 266 | { | ||
267 | // prevent close document if only one view alive and the document of | 267 | bool shutdownKate = m_mainWindow->modCloseAfterLast() && KateApp::self()->documentManager()->documentList().size() == 1; | ||
268 | // it is not modified and empty !!! | | |||
269 | if ((KateApp::self()->documentManager()->documentList().size() == 1) | | |||
270 | && !document->isModified() | | |||
271 | && document->url().isEmpty() | | |||
272 | && document->documentEnd() == KTextEditor::Cursor::start()) { | | |||
273 | document->closeUrl(); | | |||
274 | return; | | |||
275 | } | | |||
276 | 268 | | |||
277 | // close document | 269 | // close document | ||
278 | KateApp::self()->documentManager()->closeDocument(document); | 270 | if (KateApp::self()->documentManager()->closeDocument(document) && shutdownKate) { | ||
271 | KateApp::self()->shutdownKate(m_mainWindow); | ||||
272 | } | ||||
279 | } | 273 | } | ||
280 | 274 | | |||
281 | void KateViewManager::slotDocumentClose() | 275 | void KateViewManager::slotDocumentClose() | ||
282 | { | 276 | { | ||
283 | // no active view, do nothing | 277 | // no active view, do nothing | ||
284 | if (!activeView()) { | 278 | if (!activeView()) { | ||
285 | return; | 279 | return; | ||
286 | } | 280 | } | ||
▲ Show 20 Lines • Show All 955 Lines • Show Last 20 Lines |