forked from qt-creator/qt-creator
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:
@@ -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())
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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); }
|
||||
|
||||
Reference in New Issue
Block a user