Commit 3b71f28f authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

ensure kwrite doesn't mess with kate sessions

use different dir for some settings that we store in e.g.
the anon session

ensures zero clashs with Kate
parent d4a5177e
......@@ -58,7 +58,9 @@ KateApp::KateApp(const QCommandLineParser &args, const ApplicationMode mode)
, m_docManager(this)
, m_adaptor(this)
, m_pluginManager(this)
, m_sessionManager(this)
, m_sessionManager(this,
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
+ (isKate() ? QStringLiteral("/kate/sessions") : QStringLiteral("/kwrite/sessions")))
, m_stashManager(this)
{
/**
......
......@@ -38,14 +38,10 @@
KateSessionManager::KateSessionManager(QObject *parent, const QString &sessionsDir)
: QObject(parent)
, m_sessionsDir(sessionsDir)
{
if (sessionsDir.isEmpty()) {
m_sessionsDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/kate/sessions");
} else {
m_sessionsDir = sessionsDir;
}
// create dir if needed
Q_ASSERT(!m_sessionsDir.isEmpty());
QDir().mkpath(m_sessionsDir);
m_dirWatch = std::make_unique<KDirWatch>(this);
......
......@@ -26,7 +26,7 @@ class KATE_TESTS_EXPORT KateSessionManager : public QObject
friend class KateSessionManageDialog;
public:
KateSessionManager(QObject *parent = nullptr, const QString &sessionsDir = QString());
KateSessionManager(QObject *parent, const QString &sessionsDir);
/**
* allow access to the session list
......@@ -237,7 +237,7 @@ private:
/**
* absolute path to dir in home dir where to store the sessions
*/
QString m_sessionsDir;
const QString m_sessionsDir;
/**
* list of current available sessions
......
Supports Markdown
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