mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Working XML Backup and Restore
The ConfigureDiveComputer class now has functions for complete XML backup and restore. These dump the loaded settings on a dive computer to an XML file, and there is an option to restore them. Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com> Signed-off-by: Thiago Macieira <thiago@macieira.org>
This commit is contained in:
parent
e54d7d9178
commit
aad60ef6da
4 changed files with 115 additions and 13 deletions
|
@ -8,6 +8,8 @@
|
|||
#include "configuredivecomputerthreads.h"
|
||||
#include <QDateTime>
|
||||
|
||||
#include "libxml/xmlreader.h"
|
||||
|
||||
class ConfigureDiveComputer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -31,6 +33,7 @@ public:
|
|||
void saveDeviceDetails(DeviceDetails *details, device_data_t *data);
|
||||
void fetchDeviceDetails();
|
||||
bool saveXMLBackup(QString fileName, DeviceDetails *details, device_data_t *data, QString errorText);
|
||||
bool restoreXMLBackup(QString fileName, DeviceDetails *details, QString errorText);
|
||||
signals:
|
||||
void message(QString msg);
|
||||
void error(QString err);
|
||||
|
@ -43,7 +46,7 @@ private:
|
|||
ReadSettingsThread *readThread;
|
||||
WriteSettingsThread *writeThread;
|
||||
void setState(states newState);
|
||||
|
||||
QString addSettingToXML(QString settingName, QVariant value);
|
||||
private slots:
|
||||
void readThreadFinished();
|
||||
void writeThreadFinished();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue