Add Qt-only autosave recovery fallback

Provide a small KAutoSaveFile-compatible implementation for the no-KF5 build path and use it to keep the existing crash-recovery code active when BUILD_WITH_KF5=OFF.

The normal KF5 build still uses the KDE KAutoSaveFile implementation.

Assisted-by: pi coding agent / Mika (OpenAI GPT-5.5)
This commit is contained in:
Gerhard Schwanzer
2026-07-05 13:16:19 +02:00
parent d0cea474a6
commit e6124e941a
8 changed files with 350 additions and 32 deletions
+1 -10
View File
@@ -30,6 +30,7 @@
#include "titleblockproperties.h"
#ifdef BUILD_WITHOUT_KF5
# include "ui/nokde/kautosavefile.h"
#else
# include <KAutoSaveFile>
#endif
@@ -48,10 +49,6 @@ class XmlElementCollection;
class QTimer;
class TerminalStrip;
#ifdef BUILD_WITHOUT_KF5
#else
class KAutoSaveFile;
#endif
/**
This class represents a QET project. Typically saved as a .qet file, it
@@ -79,10 +76,7 @@ class QETProject : public QObject
public:
QETProject (QObject *parent = nullptr);
QETProject (const QString &path, QObject * = nullptr);
#ifdef BUILD_WITHOUT_KF5
#else
QETProject (KAutoSaveFile *backup, QObject *parent=nullptr);
#endif
~QETProject() override;
private:
@@ -297,10 +291,7 @@ class QETProject : public QObject
QTimer m_save_backup_timer,
m_autosave_timer;
QFuture<bool> m_backup_future;
#ifdef BUILD_WITHOUT_KF5
#else
KAutoSaveFile m_backup_file;
#endif
QUuid m_uuid = QUuid::createUuid();
projectDataBase m_data_base;
QVector<TerminalStrip *> m_terminal_strip_vector;