mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Qt4: Fixed broken session restoring.
Adding Qt version into sessionVersion number only when using Qt 5. Closes #689
This commit is contained in:
parent
02ea92ad28
commit
64355e2a3d
@ -269,6 +269,9 @@ MainApplication::MainApplication(int &argc, char** argv)
|
||||
}
|
||||
if (m_startingAfterCrash || afterLaunch == 3) {
|
||||
m_restoreManager = new RestoreManager(m_activeProfil + "session.dat");
|
||||
if (!m_restoreManager->isValid()) {
|
||||
destroyRestoreManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,9 +30,9 @@ namespace Qz
|
||||
{
|
||||
// Version of session.dat file
|
||||
#if QT_VERSION >= 0x050000
|
||||
static const int sessionVersion = 0x0003 & 0x050000;
|
||||
static const int sessionVersion = 0x0003 | 0x050000;
|
||||
#else
|
||||
static const int sessionVersion = 0x0003 & 0x040000;
|
||||
static const int sessionVersion = 0x0003;
|
||||
#endif
|
||||
|
||||
enum AppMessageType {
|
||||
|
@ -30,6 +30,11 @@ RestoreData RestoreManager::restoreData() const
|
||||
return m_data;
|
||||
}
|
||||
|
||||
bool RestoreManager::isValid() const
|
||||
{
|
||||
return !m_data.isEmpty();
|
||||
}
|
||||
|
||||
void RestoreManager::createFromFile(const QString &file)
|
||||
{
|
||||
if (!QFile::exists(file)) {
|
||||
@ -42,6 +47,7 @@ void RestoreManager::createFromFile(const QString &file)
|
||||
|
||||
int version;
|
||||
stream >> version;
|
||||
|
||||
if (version != Qz::sessionVersion) {
|
||||
return;
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ public:
|
||||
RestoreManager(const QString &sessionFile);
|
||||
|
||||
QList<RestoreManager::WindowData> restoreData() const;
|
||||
bool isValid() const;
|
||||
|
||||
private:
|
||||
void createFromFile(const QString &file);
|
||||
|
Loading…
Reference in New Issue
Block a user