The ILocalStoragePatch class represents the interface for patches of local storage. Each such patch somehow changes the layout of local storage persistence so that only compliant & corresponding versions of libquentier can be used to work with it.
More...
#include <ILocalStoragePatch.h>
|
| ILocalStoragePatch (QObject *parent=nullptr) |
|
|
class | LocalStorageDatabaseUpgrader |
|
The ILocalStoragePatch class represents the interface for patches of local storage. Each such patch somehow changes the layout of local storage persistence so that only compliant & corresponding versions of libquentier can be used to work with it.
◆ apply()
virtual bool quentier::ILocalStoragePatch::apply |
( |
ErrorString & |
errorDescription | ) |
|
|
pure virtual |
Apply the patch to local storage
- Parameters
-
errorDescription | The textual description of the error in case of patch application failure |
- Returns
- True in case of successful patch application, false otherwise
◆ backupLocalStorage()
virtual bool quentier::ILocalStoragePatch::backupLocalStorage |
( |
ErrorString & |
errorDescription | ) |
|
|
pure virtual |
Backup either the entire local storage or its parts affected by the particular patch, should be called before applying the patch (but can be skipped if not desired).
- Parameters
-
errorDescription | The textual description of the error in case of backup preparation failure |
- Returns
- True if the local storage was backed up for the patch successfully, false otherwise
◆ backupProgress
void quentier::ILocalStoragePatch::backupProgress |
( |
double |
progress | ) |
|
|
signal |
Local storage backup preparation progress
- Parameters
-
progress | Backup preparation progress value, from 0 to 1 |
◆ fromVersion()
virtual int quentier::ILocalStoragePatch::fromVersion |
( |
| ) |
const |
|
pure virtual |
- Returns
- Version of local storage to which the patch needs to be applied
◆ patchLongDescription()
virtual QString quentier::ILocalStoragePatch::patchLongDescription |
( |
| ) |
const |
|
pure virtual |
- Returns
- Long i.e. detailed description of the patch
◆ patchShortDescription()
virtual QString quentier::ILocalStoragePatch::patchShortDescription |
( |
| ) |
const |
|
pure virtual |
- Returns
- Short description of the patch
◆ progress
void quentier::ILocalStoragePatch::progress |
( |
double |
progress | ) |
|
|
signal |
Patch application progress signal
- Parameters
-
progress | Patch application progress value, from 0 to 1 |
◆ removeLocalStorageBackup()
virtual bool quentier::ILocalStoragePatch::removeLocalStorageBackup |
( |
ErrorString & |
errorDescription | ) |
|
|
pure virtual |
Remove the previously made backup of local storage, presumably after successful application of the patch so the backup is no longer needed. It won't work if no backup was made before applying a patch, obviously.
- Parameters
-
errorDescription | The textual description of the error in case of failure to remove the local storage backup |
- Returns
- True if local storage backup was successfully removed, false otherwise
◆ restoreBackupProgress
void quentier::ILocalStoragePatch::restoreBackupProgress |
( |
double |
progress | ) |
|
|
signal |
Local storage restoration from backup progress
- Parameters
-
progress | Local storage restoration from backup progress value, from 0 to 1 |
◆ restoreLocalStorageFromBackup()
virtual bool quentier::ILocalStoragePatch::restoreLocalStorageFromBackup |
( |
ErrorString & |
errorDescription | ) |
|
|
pure virtual |
Restore local storage from previously made backup, presumably after the failed attempt to apply a patch. Won't work if no backup was made before applying a patch, obviously.
- Parameters
-
errorDescription | The textual description of the error in case of failure to restore the local storage from backup |
- Returns
- True if local storage was successfully restored from backup, false otherwise
◆ toVersion()
virtual int quentier::ILocalStoragePatch::toVersion |
( |
| ) |
const |
|
pure virtual |
- Returns
- Version of local storage to which the patch would upgrade the local storage