QmlDesigner.ItemLibrary: Resources view is now updated when switching files

Task-number: BAUHAUS-599
This commit is contained in:
Jörg Schummer
2010-04-19 14:36:02 +03:00
committed by Kai Koehne
parent d6df0907b7
commit 052e5fa6ab
2 changed files with 3 additions and 0 deletions

View File

@@ -342,6 +342,7 @@ void DesignDocumentController::loadCurrentModel()
m_d->model->attachView(m_d->navigator.data());
m_d->itemLibrary->setMetaInfo(m_d->model->metaInfo());
m_d->itemLibrary->setResourcePath(QFileInfo(m_d->fileName).absolutePath());
if (!m_d->componentAction) {
m_d->componentAction = new ComponentAction(m_d->formEditorView->widget());

View File

@@ -230,6 +230,7 @@ ItemLibrary::~ItemLibrary()
void ItemLibrary::setMetaInfo(const MetaInfo &metaInfo)
{
m_d->m_itemLibraryModel->update(metaInfo);
updateSearch();
}
void ItemLibrary::setSearchFilter(const QString &searchFilter)
@@ -269,6 +270,7 @@ void ItemLibrary::setResourcePath(const QString &resourcePath)
{
if (m_d->m_resourcesView->model() == m_d->m_resourcesDirModel)
m_d->m_resourcesView->setRootIndex(m_d->m_resourcesDirModel->index(resourcePath));
updateSearch();
}
void ItemLibrary::startDragAndDrop(int itemLibId)