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:
@@ -70,12 +70,12 @@ void QmlMainFileAspect::addToLayout(Layouting::LayoutItem &parent)
|
||||
parent.addItems({Tr::tr("Main QML file:"), m_fileListCombo.data()});
|
||||
}
|
||||
|
||||
void QmlMainFileAspect::toMap(QVariantMap &map) const
|
||||
void QmlMainFileAspect::toMap(Storage &map) const
|
||||
{
|
||||
map.insert(Constants::QML_MAINSCRIPT_KEY, m_scriptFile);
|
||||
}
|
||||
|
||||
void QmlMainFileAspect::fromMap(const QVariantMap &map)
|
||||
void QmlMainFileAspect::fromMap(const Storage &map)
|
||||
{
|
||||
m_scriptFile = map.value(Constants::QML_MAINSCRIPT_KEY, M_CURRENT_FILE).toString();
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ public:
|
||||
};
|
||||
|
||||
void addToLayout(Layouting::LayoutItem &parent) final;
|
||||
void toMap(QVariantMap &map) const final;
|
||||
void fromMap(const QVariantMap &map) final;
|
||||
void toMap(Utils::Storage &map) const final;
|
||||
void fromMap(const Utils::Storage &map) final;
|
||||
|
||||
void updateFileComboBox();
|
||||
MainScriptSource mainScriptSource() const;
|
||||
|
||||
@@ -105,14 +105,14 @@ Utils::FilePath QmlMultiLanguageAspect::databaseFilePath() const
|
||||
return m_databaseFilePath;
|
||||
}
|
||||
|
||||
void QmlMultiLanguageAspect::toMap(QVariantMap &map) const
|
||||
void QmlMultiLanguageAspect::toMap(Storage &map) const
|
||||
{
|
||||
BoolAspect::toMap(map);
|
||||
if (!m_currentLocale.isEmpty())
|
||||
map.insert(Constants::LAST_USED_LANGUAGE, m_currentLocale);
|
||||
}
|
||||
|
||||
void QmlMultiLanguageAspect::fromMap(const QVariantMap &map)
|
||||
void QmlMultiLanguageAspect::fromMap(const Storage &map)
|
||||
{
|
||||
BoolAspect::fromMap(map);
|
||||
setCurrentLocale(map.value(Constants::LAST_USED_LANGUAGE, "en").toString());
|
||||
|
||||
@@ -23,8 +23,8 @@ public:
|
||||
QString currentLocale() const;
|
||||
void setCurrentLocale(const QString &locale);
|
||||
Utils::FilePath databaseFilePath() const;
|
||||
void toMap(QVariantMap &map) const final;
|
||||
void fromMap(const QVariantMap &map) final;
|
||||
void toMap(Utils::Storage &map) const final;
|
||||
void fromMap(const Utils::Storage &map) final;
|
||||
|
||||
static QmlMultiLanguageAspect *current();
|
||||
static QmlMultiLanguageAspect *current(ProjectExplorer::Project *project);
|
||||
|
||||
@@ -40,8 +40,10 @@
|
||||
|
||||
using namespace Core;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace QmlProjectManager {
|
||||
|
||||
QmlProject::QmlProject(const Utils::FilePath &fileName)
|
||||
: Project(QString::fromLatin1(Constants::QMLPROJECT_MIMETYPE), fileName)
|
||||
{
|
||||
@@ -87,7 +89,7 @@ void QmlProject::parsingFinished(const Target *target, bool success)
|
||||
openFile(fileToOpen);
|
||||
}
|
||||
|
||||
Project::RestoreResult QmlProject::fromMap(const QVariantMap &map, QString *errorMessage)
|
||||
Project::RestoreResult QmlProject::fromMap(const Storage &map, QString *errorMessage)
|
||||
{
|
||||
RestoreResult result = Project::fromMap(map, errorMessage);
|
||||
if (result != RestoreResult::Ok)
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final;
|
||||
|
||||
protected:
|
||||
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
|
||||
RestoreResult fromMap(const Utils::Storage &map, QString *errorMessage) override;
|
||||
|
||||
private:
|
||||
ProjectExplorer::DeploymentKnowledge deploymentKnowledge() const override;
|
||||
|
||||
Reference in New Issue
Block a user