mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
SessionManager: Use relative paths for session files in settings
See #2331
This commit is contained in:
parent
da3e16d7c4
commit
a8763bee06
|
@ -310,11 +310,17 @@ void SessionManager::fillSessionsMetaDataListIfNeeded()
|
|||
|
||||
void SessionManager::loadSettings()
|
||||
{
|
||||
QDir sessionsDir(DataPaths::path(DataPaths::Sessions));
|
||||
|
||||
Settings settings;
|
||||
settings.beginGroup("Web-Browser-Settings");
|
||||
m_lastActiveSessionPath = settings.value("lastActiveSessionPath", defaultSessionPath()).toString();
|
||||
settings.endGroup();
|
||||
|
||||
if (QDir::isRelativePath(m_lastActiveSessionPath)) {
|
||||
m_lastActiveSessionPath = sessionsDir.absoluteFilePath(m_lastActiveSessionPath);
|
||||
}
|
||||
|
||||
// fallback to default session
|
||||
if (!QFile::exists(m_lastActiveSessionPath))
|
||||
m_lastActiveSessionPath = defaultSessionPath();
|
||||
|
@ -322,9 +328,11 @@ void SessionManager::loadSettings()
|
|||
|
||||
void SessionManager::saveSettings()
|
||||
{
|
||||
QDir sessionsDir(DataPaths::path(DataPaths::Sessions));
|
||||
|
||||
Settings settings;
|
||||
settings.beginGroup("Web-Browser-Settings");
|
||||
settings.setValue("lastActiveSessionPath", m_lastActiveSessionPath);
|
||||
settings.setValue("lastActiveSessionPath", sessionsDir.relativeFilePath(m_lastActiveSessionPath));
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user