forked from qt-creator/qt-creator
ProjectExplorer: Change signature to Project::toMap(QVariantMap &)
More aspect-friendly. Change-Id: Ia107dbab65f3772b315d735e4c46f9dfe1043d5a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -26,11 +26,10 @@ NimbleProject::NimbleProject(const Utils::FilePath &fileName)
|
||||
setBuildSystemCreator([] (Target *t) { return new NimbleBuildSystem(t); });
|
||||
}
|
||||
|
||||
QVariantMap NimbleProject::toMap() const
|
||||
void NimbleProject::toMap(QVariantMap &map) const
|
||||
{
|
||||
QVariantMap result = Project::toMap();
|
||||
result[Constants::C_NIMPROJECT_EXCLUDEDFILES] = m_excludedFiles;
|
||||
return result;
|
||||
Project::toMap(map);
|
||||
map[Constants::C_NIMPROJECT_EXCLUDEDFILES] = m_excludedFiles;
|
||||
}
|
||||
|
||||
Project::RestoreResult NimbleProject::fromMap(const QVariantMap &map, QString *errorMessage)
|
||||
|
@@ -16,7 +16,7 @@ public:
|
||||
NimbleProject(const Utils::FilePath &filename);
|
||||
|
||||
// Keep for compatibility with Qt Creator 4.10
|
||||
QVariantMap toMap() const final;
|
||||
void toMap(QVariantMap &map) const final;
|
||||
|
||||
QStringList excludedFiles() const;
|
||||
void setExcludedFiles(const QStringList &excludedFiles);
|
||||
|
@@ -27,7 +27,7 @@ public:
|
||||
Tasks projectIssues(const Kit *k) const final;
|
||||
|
||||
// Keep for compatibility with Qt Creator 4.10
|
||||
QVariantMap toMap() const final;
|
||||
void toMap(QVariantMap &map) const final;
|
||||
|
||||
QStringList excludedFiles() const;
|
||||
void setExcludedFiles(const QStringList &excludedFiles);
|
||||
@@ -63,11 +63,10 @@ Tasks NimProject::projectIssues(const Kit *k) const
|
||||
return result;
|
||||
}
|
||||
|
||||
QVariantMap NimProject::toMap() const
|
||||
void NimProject::toMap(QVariantMap &map) const
|
||||
{
|
||||
QVariantMap result = Project::toMap();
|
||||
result[Constants::C_NIMPROJECT_EXCLUDEDFILES] = m_excludedFiles;
|
||||
return result;
|
||||
Project::toMap(map);
|
||||
map[Constants::C_NIMPROJECT_EXCLUDEDFILES] = m_excludedFiles;
|
||||
}
|
||||
|
||||
Project::RestoreResult NimProject::fromMap(const QVariantMap &map, QString *errorMessage)
|
||||
|
@@ -634,8 +634,11 @@ void Project::saveSettings()
|
||||
emit aboutToSaveSettings();
|
||||
if (!d->m_accessor)
|
||||
d->m_accessor = std::make_unique<Internal::UserFileAccessor>(this);
|
||||
if (!targets().isEmpty())
|
||||
d->m_accessor->saveSettings(toMap(), ICore::dialogParent());
|
||||
if (!targets().isEmpty()) {
|
||||
QVariantMap map;
|
||||
toMap(map);
|
||||
d->m_accessor->saveSettings(map, ICore::dialogParent());
|
||||
}
|
||||
}
|
||||
|
||||
Project::RestoreResult Project::restoreSettings(QString *errorMessage)
|
||||
@@ -688,11 +691,10 @@ FilePaths Project::files(const NodeMatcher &filter) const
|
||||
creating new build configurations.
|
||||
*/
|
||||
|
||||
QVariantMap Project::toMap() const
|
||||
void Project::toMap(QVariantMap &map) const
|
||||
{
|
||||
const QList<Target *> ts = targets();
|
||||
|
||||
QVariantMap map;
|
||||
map.insert(QLatin1String(ACTIVE_TARGET_KEY), ts.indexOf(d->m_activeTarget));
|
||||
map.insert(QLatin1String(TARGET_COUNT_KEY), ts.size());
|
||||
for (int i = 0; i < ts.size(); ++i)
|
||||
@@ -701,8 +703,6 @@ QVariantMap Project::toMap() const
|
||||
map.insert(QLatin1String(EDITOR_SETTINGS_KEY), d->m_editorConfiguration.toMap());
|
||||
if (!d->m_pluginSettings.isEmpty())
|
||||
map.insert(QLatin1String(PLUGIN_SETTINGS_KEY), d->m_pluginSettings);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@@ -111,7 +111,7 @@ public:
|
||||
const NodeMatcher &extraMatcher = {}) const;
|
||||
Utils::FilePaths binariesForSourceFile(const Utils::FilePath &sourceFile) const;
|
||||
|
||||
virtual QVariantMap toMap() const;
|
||||
virtual void toMap(QVariantMap &map) const;
|
||||
|
||||
Core::Context projectContext() const;
|
||||
Core::Context projectLanguages() const;
|
||||
|
Reference in New Issue
Block a user