forked from qt-creator/qt-creator
QmlDesigner: Use C++ 20 designated initializer for update
It makes it easier to add new arguments without breaking the tests. Change-Id: Id03053ac17e4da26a2abf2a23e6cc20848ed9af5 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -260,11 +260,13 @@ std::vector<IdPaths> createIdPaths(ProjectStorageUpdater::WatchedSourceIdsIds wa
|
||||
|
||||
} // namespace
|
||||
|
||||
void ProjectStorageUpdater::update(QStringList directories,
|
||||
QStringList qmlTypesPaths,
|
||||
const QString &propertyEditorResourcesPath,
|
||||
const QStringList &typeAnnotationPaths)
|
||||
void ProjectStorageUpdater::update(Update update)
|
||||
{
|
||||
QStringList directories = std::move(update.directories);
|
||||
QStringList qmlTypesPaths = std::move(update.qmlTypesPaths);
|
||||
const QString &propertyEditorResourcesPath = update.propertyEditorResourcesPath;
|
||||
const QStringList &typeAnnotationPaths = update.typeAnnotationPaths;
|
||||
|
||||
NanotraceHR::Tracer tracer{"update"_t,
|
||||
category(),
|
||||
keyValue("directories", directories),
|
||||
|
||||
@@ -59,10 +59,15 @@ public:
|
||||
, m_projectPartId{projectPartId}
|
||||
{}
|
||||
|
||||
void update(QStringList directories,
|
||||
QStringList qmlTypesPaths,
|
||||
const QString &propertyEditorResourcesPath,
|
||||
const QStringList &typeAnnotationPaths);
|
||||
struct Update
|
||||
{
|
||||
QStringList directories = {};
|
||||
QStringList qmlTypesPaths = {};
|
||||
const QString propertyEditorResourcesPath = {};
|
||||
const QStringList typeAnnotationPaths = {};
|
||||
};
|
||||
|
||||
void update(Update update);
|
||||
void pathsWithIdsChanged(const std::vector<IdPaths> &idPaths) override;
|
||||
void pathsChanged(const SourceIds &filePathIds) override;
|
||||
|
||||
|
||||
@@ -586,15 +586,15 @@ void QmlDesignerProjectManager::update()
|
||||
return;
|
||||
|
||||
if constexpr (isUsingQmlDesignerLite()) {
|
||||
m_projectData->projectStorageData->updater.update(directoriesForLiteDesigner(),
|
||||
qmlTypesForLiteDesigner(),
|
||||
propertyEditorResourcesPath(),
|
||||
{qtCreatorItemLibraryPath()});
|
||||
m_projectData->projectStorageData->updater.update({directoriesForLiteDesigner(),
|
||||
qmlTypesForLiteDesigner(),
|
||||
propertyEditorResourcesPath(),
|
||||
{qtCreatorItemLibraryPath()}});
|
||||
} else {
|
||||
m_projectData->projectStorageData->updater.update(directories(m_projectData->activeTarget),
|
||||
qmlTypes(m_projectData->activeTarget),
|
||||
propertyEditorResourcesPath(),
|
||||
{qtCreatorItemLibraryPath()});
|
||||
m_projectData->projectStorageData->updater.update({directories(m_projectData->activeTarget),
|
||||
qmlTypes(m_projectData->activeTarget),
|
||||
propertyEditorResourcesPath(),
|
||||
{qtCreatorItemLibraryPath()}});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user