1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 09:42:10 +02: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 "updater.h"
#include "qztools.h"
#include "restoremanager.h"
#include "sqldatabase.h"
#include <QDir>
@ -226,7 +225,7 @@ void ProfileManager::copyDataToProfile()
}
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();
if (oldVersion.isEmpty()) {
oldVersion = QSL("unknown-version");