QXmppAccountMigrationManager Class
Allows to export and import account data. More...
| Header: | #include <QXmppAccountMigrationManager> |
| Since: | QXmpp 1.8 |
| Inherits: | QXmppClientExtension |
- List of all members, including inherited members
- QXmppAccountMigrationManager is part of Managers.
Public Functions
| QXmppAccountMigrationManager() | |
| QXmppTask<QXmppAccountMigrationManager::Result<QXmppExportData>> | exportData() |
| QXmppTask<QXmppAccountMigrationManager::Result<>> | importData(const QXmppExportData &account) |
| void | registerExportData(ImportFunc importFunc, ExportFunc exportFunc) |
| void | unregisterExportData() |
Signals
| void | errorOccurred(const QXmppError &error) |
Detailed Description
This manager helps migrating a user account into another server.
You can use exportData() to start a data export. Afterwards you can use the exported data to start a data import on another account using importData().
The data that is exported (or imported) is determined by the other registered client extensions. They can register callbacks for export and import using registerExtension().
Member Function Documentation
QXmppAccountMigrationManager::QXmppAccountMigrationManager()
Constructs an account migration manager.
Note: You would need the `QXmppClient(QXmppClient::NoExtensions, this)` approach to use this manager because it needs to be instantiated before others using it.
[signal] void QXmppAccountMigrationManager::errorOccurred(const QXmppError &error)
Emitted when an error occured during export or import. error is the occured error.
QXmppTask<QXmppAccountMigrationManager::Result<QXmppExportData>> QXmppAccountMigrationManager::exportData()
Creates a data export of the current account.
QXmppTask<QXmppAccountMigrationManager::Result<>> QXmppAccountMigrationManager::importData(const QXmppExportData &account)
Imports QXmppExportData to the currently connected account.
template <typename DataType, typename ImportFunc, typename ExportFunc> void QXmppAccountMigrationManager::registerExportData(ImportFunc importFunc, ExportFunc exportFunc)
Registers a data type that can be imported to an account using importFunc and generated using exportFunc.
The functions are used when importData() or exportData() is called. You can unregister the functions using unregisterExportData().
The data type MUST also be registered via QXmppExportData::registerExtension() so it can be serialized.
template <typename DataType> void QXmppAccountMigrationManager::unregisterExportData()
Unregisters a data type.