Commit 5be11ad9 authored by Méven Car's avatar Méven Car Committed by Christoph Cullmann
Browse files

Avoid errors like 'QDir::mkdir: Empty or null file name'

parent 04d5e019
...@@ -416,12 +416,16 @@ void KateDocManager::saveDocumentList(KConfig *config) ...@@ -416,12 +416,16 @@ void KateDocManager::saveDocumentList(KConfig *config)
// prepare stash directory // prepare stash directory
const QString appDataPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); const QString appDataPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
const QString sessionName = KateApp::self()->sessionManager()->activeSession()->name();
QDir dir(appDataPath); QDir dir(appDataPath);
dir.mkdir(QStringLiteral("stash")); dir.mkdir(QStringLiteral("stash"));
dir.cd(QStringLiteral("stash")); dir.cd(QStringLiteral("stash"));
dir.mkdir(sessionName);
dir.cd(sessionName); const auto session = KateApp::self()->sessionManager()->activeSession();
if (session) {
const QString sessionName = session->name();
dir.mkdir(sessionName);
dir.cd(sessionName);
}
int i = 0; int i = 0;
for (KTextEditor::Document *doc : qAsConst(m_docList)) { for (KTextEditor::Document *doc : qAsConst(m_docList)) {
......
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