mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
ProfileManager: Never allow to use session from newer profile version
Always make a backup instead of possibly corrupting it.
This commit is contained in:
parent
4124c67c5f
commit
1c7288204c
@ -20,7 +20,6 @@
|
|||||||
#include "datapaths.h"
|
#include "datapaths.h"
|
||||||
#include "updater.h"
|
#include "updater.h"
|
||||||
#include "qztools.h"
|
#include "qztools.h"
|
||||||
#include "restoremanager.h"
|
|
||||||
#include "sqldatabase.h"
|
#include "sqldatabase.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@ -226,7 +225,7 @@ void ProfileManager::copyDataToProfile()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QFile sessionFile(profileDir.filePath(QSL("session.dat")));
|
QFile sessionFile(profileDir.filePath(QSL("session.dat")));
|
||||||
if (sessionFile.exists() && !RestoreManager::validateFile(sessionFile.fileName())) {
|
if (sessionFile.exists()) {
|
||||||
QString oldVersion = QzTools::readAllFileContents(profileDir.filePath(QSL("version"))).trimmed();
|
QString oldVersion = QzTools::readAllFileContents(profileDir.filePath(QSL("version"))).trimmed();
|
||||||
if (oldVersion.isEmpty()) {
|
if (oldVersion.isEmpty()) {
|
||||||
oldVersion = QSL("unknown-version");
|
oldVersion = QSL("unknown-version");
|
||||||
|
Loading…
Reference in New Issue
Block a user