Commit e4aae66c authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.model: clears the meta info cache for import changes

If an import changes we have to delete the cache for the meta info.
parent ccf64590
......@@ -95,6 +95,8 @@ public:
bool availableInVersion(int majorVersion, int minorVersion) const;
bool isSubclassOf(const QString& type, int majorVersion, int minorVersio) const;
static void clearCache();
private:
QSharedPointer<Internal::NodeMetaInfoPrivate> m_privateData;
};
......
......@@ -339,6 +339,11 @@ public:
return m_prototypeCache;
}
static void clearCache()
{
m_nodeMetaInfoCache.clear();
}
private:
NodeMetaInfoPrivate(Model *model, QString type, int maj = -1, int min = -1);
......@@ -1003,4 +1008,9 @@ bool NodeMetaInfo::isSubclassOf(const QString &type, int majorVersion, int minor
return false;
}
void NodeMetaInfo::clearCache()
{
Internal::NodeMetaInfoPrivate::clearCache();
}
} // namespace QmlDesigner
......@@ -159,6 +159,8 @@ void ModelPrivate::notifyImportAdded(const Import &import)
resetModel = true;
}
NodeMetaInfo::clearCache();
foreach (const QWeakPointer<AbstractView> &view, m_viewList)
view->importAdded(import);
......@@ -184,6 +186,8 @@ void ModelPrivate::notifyImportRemoved(const Import &import)
resetModel = true;
}
NodeMetaInfo::clearCache();
foreach (const QWeakPointer<AbstractView> &view, m_viewList)
view->importRemoved(import);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment