Use Utils::Storage instead of QVariantMap in a few places

Change-Id: I02833cf2bc3caaadc22ff93ae530e4aebe4c3868
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2023-08-23 16:11:48 +02:00
parent 55b5b8a975
commit dc6b40a5c0
191 changed files with 525 additions and 491 deletions

View File

@@ -3,6 +3,8 @@
#include "qmljscodestylepreferences.h"
using namespace Utils;
namespace QmlJSTools {
QmlJSCodeStylePreferences::QmlJSCodeStylePreferences(QObject *parent) :
@@ -78,7 +80,7 @@ QVariantMap QmlJSCodeStylePreferences::toMap() const
return map;
}
void QmlJSCodeStylePreferences::fromMap(const QVariantMap &map)
void QmlJSCodeStylePreferences::fromMap(const Storage &map)
{
ICodeStylePreferences::fromMap(map);
if (!currentDelegate())

View File

@@ -25,8 +25,8 @@ public:
// tracks parent hierarchy until currentParentSettings is null
QmlJSCodeStyleSettings currentCodeStyleSettings() const;
QVariantMap toMap() const override;
void fromMap(const QVariantMap &map) override;
Utils::Storage toMap() const override;
void fromMap(const Utils::Storage &map) override;
public slots:
void setCodeStyleSettings(const QmlJSCodeStyleSettings &data);

View File

@@ -19,9 +19,11 @@
static const char lineLengthKey[] = "LineLength";
using namespace Utils;
namespace QmlJSTools {
// ------------------ QmlJSCodeStyleSettingsWidget
// QmlJSCodeStyleSettings
QmlJSCodeStyleSettings::QmlJSCodeStyleSettings() = default;
@@ -32,7 +34,7 @@ QVariantMap QmlJSCodeStyleSettings::toMap() const
};
}
void QmlJSCodeStyleSettings::fromMap(const QVariantMap &map)
void QmlJSCodeStyleSettings::fromMap(const Storage &map)
{
lineLength = map.value(lineLengthKey, lineLength).toInt();
}

View File

@@ -5,7 +5,7 @@
#include "qmljstools_global.h"
#include <QVariantMap>
#include <utils/storage.h>
#include <optional>
@@ -20,8 +20,8 @@ public:
int lineLength = 80;
QVariantMap toMap() const;
void fromMap(const QVariantMap &map);
Utils::Storage toMap() const;
void fromMap(const Utils::Storage &map);
bool equals(const QmlJSCodeStyleSettings &rhs) const;
bool operator==(const QmlJSCodeStyleSettings &s) const { return equals(s); }