QmlDesigner: Limit clearing effect maker to starting a new project

Fixes: QDS-11713
Change-Id: I8d1c33ed7ad731e710646b330af8251b61f425db
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Mahmoud Badri
2024-01-22 16:20:49 +02:00
parent 44f0e0819a
commit 860e87993d
2 changed files with 12 additions and 3 deletions

View File

@@ -7,9 +7,9 @@
#include "effectmakernodesmodel.h"
#include "effectmakerwidget.h"
#include "qmldesignerconstants.h"
#include <documentmanager.h>
#include <modelnodeoperations.h>
#include <qmldesignerconstants.h>
#include <coreplugin/icore.h>
@@ -79,7 +79,15 @@ void EffectMakerView::modelAttached(QmlDesigner::Model *model)
AbstractView::modelAttached(model);
m_widget->effectMakerNodesModel()->loadModel();
m_widget->effectMakerModel()->clear();
QString currProjectPath = QmlDesigner::DocumentManager::currentProjectDirPath().toString();
// if starting a new project, clear the effect maker
if (m_currProjectPath != currProjectPath)
m_widget->effectMakerModel()->clear();
m_currProjectPath = currProjectPath;
m_widget->initView();
}