1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +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:
David Rosca 2018-01-31 19:12:19 +01:00
parent 4124c67c5f
commit 1c7288204c
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -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");