1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

SessionManager: Use QSaveFile for writing session to file

See #2331
This commit is contained in:
David Rosca 2017-06-08 10:04:45 +02:00
parent 2a2c49ca47
commit 1a818e5b6c

View File

@ -33,7 +33,7 @@
#include <QMenu>
#include <QMessageBox>
#include <QVBoxLayout>
#include <QSaveFile>
SessionManager::SessionManager(QObject* parent)
: QObject(parent)
@ -377,12 +377,12 @@ void SessionManager::backupSavedSessions()
void SessionManager::writeCurrentSession(const QString &filePath)
{
QFile file(filePath);
QSaveFile file(filePath);
if (!file.open(QIODevice::WriteOnly) || file.write(mApp->saveState()) == -1) {
qWarning() << "Error! can not write the current session file: " << filePath << file.errorString();
return;
}
file.close();
file.commit();
}
void SessionManager::autoSaveLastSession()