QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlMovieSettingsMigration Class Reference

Migration of QtlMovie settings from old to new format. More...

Public Member Functions

 QtlMovieSettingsMigration (QtlMovieSettings *settings, QtlLogger *log)
 Constructor If an old-style XML configuration file exists, the configuration is loaded into the new format and the old file is renamed with an old prefix. More...
 

Private Member Functions

bool getBool (const QString &name, void(QtlMovieSettings::*setter)(bool))
 Decode an XML element with a "value" boolean attribute. More...
 
bool getGeometry (const QString &name, void(QtlMovieSettings::*setter)(const QWidget *))
 Decode an XML element with geometry attributes. More...
 
template<typename INT >
bool getInt (const QString &name, void(QtlMovieSettings::*setter)(INT))
 Decode an XML element with a "value" integer or enum attribute. More...
 
bool getList (const QString &name, void(QtlMovieSettings::*setter)(const QStringList &))
 Decode an XML element with a "value" comma-separated string list attribute. More...
 
bool getString (const QString &name, void(QtlMovieSettings::*setter)(const QString &))
 XML reader for the old-style configuration file. More...
 
bool getString2 (const QString &name, void(QtlMovieSettings::*setter)(const QString &type, const QString &value))
 Decode an XML element with "type" and "value" string attributes. More...
 

Private Attributes

QtlMovieSettings_settings
 
QXmlStreamReader _xml
 The settings to fill from an old-style configuration file. More...
 

Detailed Description

Migration of QtlMovie settings from old to new format.

The old format used an XML-file to store the settings. The new format is based QSettings and uses a platform-dependent backing store.

This class manipulates legacy data and shall not be modified.

Constructor & Destructor Documentation

◆ QtlMovieSettingsMigration()

QtlMovieSettingsMigration::QtlMovieSettingsMigration ( QtlMovieSettings settings,
QtlLogger log 
)

Constructor If an old-style XML configuration file exists, the configuration is loaded into the new format and the old file is renamed with an old prefix.

Parameters
[in,out]settingsWhere to store the converted old configuration.
[in]logWhere to log errors.

Member Function Documentation

◆ getString()

bool QtlMovieSettingsMigration::getString ( const QString &  name,
void(QtlMovieSettings::*)(const QString &)  setter 
)
private

XML reader for the old-style configuration file.

Decode an XML element with a "value" string attribute.

Parameters
[in]nameExpected element name.
[in]setterThe setter method to invoke with the decoded value.
Returns
True on success, false if not the expected element.

◆ getString2()

bool QtlMovieSettingsMigration::getString2 ( const QString &  name,
void(QtlMovieSettings::*)(const QString &type, const QString &value)  setter 
)
private

Decode an XML element with "type" and "value" string attributes.

Parameters
[in]nameExpected element name.
[in]setterThe setter method to invoke with the decoded type and value.
Returns
True on success, false if not the expected element.

◆ getList()

bool QtlMovieSettingsMigration::getList ( const QString &  name,
void(QtlMovieSettings::*)(const QStringList &)  setter 
)
private

Decode an XML element with a "value" comma-separated string list attribute.

Parameters
[in]nameExpected element name.
[in]setterThe setter method to invoke with the decoded value.
Returns
True on success, false if not the expected element.

◆ getBool()

bool QtlMovieSettingsMigration::getBool ( const QString &  name,
void(QtlMovieSettings::*)(bool)  setter 
)
private

Decode an XML element with a "value" boolean attribute.

Parameters
[in]nameExpected element name.
[in]setterThe setter method to invoke with the decoded value.
Returns
True on success, false on error: not the expected element, "value" attribute not found, not a valid boolean.

◆ getInt()

template<typename INT >
bool QtlMovieSettingsMigration::getInt ( const QString &  name,
void(QtlMovieSettings::*)(INT)  setter 
)
inlineprivate

Decode an XML element with a "value" integer or enum attribute.

Template Parameters
INTAn integer or enum type.
Parameters
[in]nameExpected element name.
[in]setterThe setter method to invoke with the decoded value.
Returns
True on success, false on error: not the expected element, "value" attribute not found, not a valid integer.

◆ getGeometry()

bool QtlMovieSettingsMigration::getGeometry ( const QString &  name,
void(QtlMovieSettings::*)(const QWidget *)  setter 
)
private

Decode an XML element with geometry attributes.

Parameters
[in]nameExpected element name.
[in]setterThe setter method to invoke with a widget of the decoded geometry.
Returns
True on success, false on error: not the expected element, "value" attribute not found, not a valid boolean.

Member Data Documentation

◆ _settings

QtlMovieSettings* QtlMovieSettingsMigration::_settings
private

◆ _xml

QXmlStreamReader QtlMovieSettingsMigration::_xml
private

The settings to fill from an old-style configuration file.


The documentation for this class was generated from the following files: