QtDataSync
4.2.0
A simple offline-first synchronisation framework, to synchronize data of Qt applications between devices
|
A helper class to migrate data from DataSync 3.0 to this version. More...
#include <migrationhelper.h>
Public Types | |
enum | MigrationFlag { MigrateData = 0x01, MigrateChanged = (0x02 | MigrateData), MigrateRemoteConfig = 0x04, MigrateWithCleanup = 0x08, MigrateOverwriteConfig = 0x10, MigrateOverwriteData = 0x20, MigrateDefault = (MigrateData | MigrateRemoteConfig | MigrateWithCleanup) } |
Flags to configure what and how should be migrated. More... | |
Public Slots | |
void | startMigration (const QString &storageDir=DefaultOldStorageDir, MigrationFlags flags=MigrateDefault) |
Start the migration process from the given directory with flags. More... | |
Signals | |
void | migrationPrepared (int operations) |
Is emitted when the number of migrate operations has been determined. | |
void | migrationProgress (int current) |
Is emitted for every successful migration step done to give a progress. | |
void | migrationDone (bool ok) |
Is emitted when the migration has been finished. | |
Public Member Functions | |
MigrationHelper (QObject *parent=nullptr) | |
Default constructor, uses the default setup. More... | |
MigrationHelper (const QString &setupName, QObject *parent=nullptr) | |
Constructor with an explicit setup. More... | |
Public Member Functions inherited from QObject | |
virtual const QMetaObject * | metaObject () const const |
virtual void * | qt_metacast (const char *) |
virtual int | qt_metacall (QMetaObject::Call, int, void **) |
QObject (QObject *parent) | |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
QString | objectName () const const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
bool | signalsBlocked () const const |
bool | blockSignals (bool block) |
QThread * | thread () const const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
const QObjectList & | children () const const |
void | setParent (QObject *parent) |
void | installEventFilter (QObject *filterObj) |
void | removeEventFilter (QObject *obj) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
void | dumpObjectTree () const const |
void | dumpObjectInfo () const const |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const const |
QList< QByteArray > | dynamicPropertyNames () const const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
bool | inherits (const char *className) const const |
void | deleteLater () |
Static Public Attributes | |
static const QString | DefaultOldStorageDir |
The previous default path where data was stored. | |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
Protected Member Functions inherited from QObject | |
QObject * | sender () const const |
int | senderSignalIndex () const const |
int | receivers (const char *signal) const const |
bool | isSignalConnected (const QMetaMethod &signal) const const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
Properties inherited from QObject | |
objectName | |
A helper class to migrate data from DataSync 3.0 to this version.
If you used QtDataSync below version 4 before, you will have to use this class to migrate the data from that old datasync to the current new one, as they are not compatible. This is what this class is used for.
The migration is performed asynchronously once started and cannot be stopped. To start a migration, use startMigration().
Definition at line 13 of file migrationhelper.h.
Flags to configure what and how should be migrated.
Definition at line 19 of file migrationhelper.h.
|
explicit |
Default constructor, uses the default setup.
parent | The parent object |
SetupDoesNotExistException | Thrown if the default setup was not created yet |
|
explicit |
Constructor with an explicit setup.
setupName | The name of the setup to connect to |
parent | The parent object |
SetupDoesNotExistException | Thrown if the given setup was not created yet |
|
slot |
Start the migration process from the given directory with flags.
storageDir | The old datasync directory to import the data from |
flags | Flags to configure what and how to migrate the data |
The storageDir
must be the directory that the old datasync used as storage directory. If you did not change it, the DefaultOldStorageDir constant can be used, as it points to the previous default datasync storage dir.
Migration is performed asynchronously with the status beeing reported via the signals. Errors, warnings and other stuff is logged as usual. Use the qtdatasync.<setupName>.migration
logging category to filter for it.