forked from qt-creator/qt-creator
QmlDesigner: Update resources file system model on model attach
Removed the update from old places. ViewManager::attachItemLibraryView one was never called and the other DesignDocument::updateFileName one gets called incorrectly on any file rename, not just the currently open one. Change-Id: I822ced6fe32dd9625d605e33046c808eb2272028 Fixes: QDS-2721 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -207,8 +207,6 @@ void DesignDocument::updateFileName(const Utils::FilePath & /*oldFileName*/, con
|
|||||||
if (m_inFileComponentModel)
|
if (m_inFileComponentModel)
|
||||||
m_inFileComponentModel->setFileUrl(QUrl::fromLocalFile(newFileName.toString()));
|
m_inFileComponentModel->setFileUrl(QUrl::fromLocalFile(newFileName.toString()));
|
||||||
|
|
||||||
viewManager().setItemLibraryViewResourcePath(newFileName.toFileInfo().absolutePath());
|
|
||||||
|
|
||||||
emit displayNameChanged(displayName());
|
emit displayNameChanged(displayName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#include <bindingproperty.h>
|
#include <bindingproperty.h>
|
||||||
#include <nodelistproperty.h>
|
#include <nodelistproperty.h>
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
#include <qmldesignerplugin.h>
|
||||||
#include "metainfo.h"
|
#include "metainfo.h"
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
@@ -75,6 +76,7 @@ void ItemLibraryView::modelAttached(Model *model)
|
|||||||
model->attachView(m_importManagerView);
|
model->attachView(m_importManagerView);
|
||||||
m_hasErrors = !rewriterView()->errors().isEmpty();
|
m_hasErrors = !rewriterView()->errors().isEmpty();
|
||||||
m_widget->setFlowMode(QmlItemNode(rootModelNode()).isFlowView());
|
m_widget->setFlowMode(QmlItemNode(rootModelNode()).isFlowView());
|
||||||
|
setResourcePath(QmlDesignerPlugin::instance()->documentManager().currentDesignDocument()->fileName().toFileInfo().absolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ItemLibraryView::modelAboutToBeDetached(Model *model)
|
void ItemLibraryView::modelAboutToBeDetached(Model *model)
|
||||||
|
@@ -224,7 +224,6 @@ void ViewManager::detachViewsExceptRewriterAndComponetView()
|
|||||||
|
|
||||||
void ViewManager::attachItemLibraryView()
|
void ViewManager::attachItemLibraryView()
|
||||||
{
|
{
|
||||||
setItemLibraryViewResourcePath(currentDesignDocument()->fileName().toFileInfo().absolutePath());
|
|
||||||
currentModel()->attachView(&d->itemLibraryView);
|
currentModel()->attachView(&d->itemLibraryView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user