mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-16 07:09:58 +00:00
add configuration tests
This commit is contained in:
@ -69,7 +69,7 @@ bool AWConfigHelper::dropCache() const
|
||||
}
|
||||
|
||||
|
||||
bool AWConfigHelper::exportConfiguration(QObject *nativeConfig,
|
||||
bool AWConfigHelper::exportConfiguration(const QObject *nativeConfig,
|
||||
const QString fileName) const
|
||||
{
|
||||
qCDebug(LOG_AW) << "Selected filename" << fileName;
|
||||
@ -77,8 +77,8 @@ bool AWConfigHelper::exportConfiguration(QObject *nativeConfig,
|
||||
QSettings settings(fileName, QSettings::IniFormat);
|
||||
|
||||
// plasmoid configuration
|
||||
QQmlPropertyMap *configuration
|
||||
= static_cast<QQmlPropertyMap *>(nativeConfig);
|
||||
const QQmlPropertyMap *configuration
|
||||
= static_cast<const QQmlPropertyMap *>(nativeConfig);
|
||||
settings.beginGroup(QString("plasmoid"));
|
||||
for (auto key : configuration->keys()) {
|
||||
QVariant value = configuration->value(key);
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QStandardPaths>
|
||||
#include <QVariant>
|
||||
|
||||
|
||||
class QSettings;
|
||||
@ -34,7 +35,7 @@ public:
|
||||
virtual ~AWConfigHelper();
|
||||
Q_INVOKABLE QString configurationDirectory() const;
|
||||
Q_INVOKABLE bool dropCache() const;
|
||||
Q_INVOKABLE bool exportConfiguration(QObject *nativeConfig,
|
||||
Q_INVOKABLE bool exportConfiguration(const QObject *nativeConfig,
|
||||
const QString fileName) const;
|
||||
Q_INVOKABLE QVariantMap importConfiguration(const QString fileName,
|
||||
const bool importPlasmoid,
|
||||
|
Reference in New Issue
Block a user