14#include <system_error>
19namespace Akonadi::Server
23class TableDescription;
35 virtual ~UIDelegate() =
default;
37 virtual Result questionYesNoSkip(
const QString &question) = 0;
40class DbMigrator :
public QObject
44 explicit DbMigrator(
const QString &targetEngine, UIDelegate *delegate,
QObject *
parent =
nullptr);
45 ~DbMigrator()
override;
47 void startMigration();
50 void info(
const QString &message);
51 void error(
const QString &message);
52 void progress(
const QString &message,
int tablesDone,
int tablesTotal);
53 void tableProgress(
const QString &table,
int rowsDone,
int rowsTotal);
55 void migrationCompleted(
bool success);
58 [[nodiscard]]
bool runMigrationThread();
59 bool copyTable(DataStore *sourceStore, DataStore *destStore,
const TableDescription &table);
61 [[nodiscard]]
bool migrateTables(DataStore *sourceStore, DataStore *destStore, DbConfig *destConfig);
62 [[nodiscard]]
bool moveDatabaseToMainLocation(DbConfig *destConfig,
const QString &destServerCfgFile);
63 std::optional<QString> moveDatabaseToBackupLocation(DbConfig *config);
64 std::optional<QString> backupAkonadiServerRc();
65 bool runStorageJanitor(DbConfig *sourceConfig);
67 void emitInfo(
const QString &message);
68 void emitError(
const QString &message);
69 void emitProgress(
const QString &message,
int tablesDone,
int tablesTotal);
70 void emitTableProgress(
const QString &table,
int done,
int total);
71 void emitCompletion(
bool success);
72 [[nodiscard]] UIDelegate::Result questionYesNo(
const QString &question);
73 [[nodiscard]] UIDelegate::Result questionYesNoSkip(
const QString &question);
76 std::unique_ptr<QThread> m_thread;
77 UIDelegate *m_uiDelegate =
nullptr;
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:30 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.