QmlDesigner: Do not reset CustomFileSystemModel if root path is identical

If the idendtical root path is set again, we should not do anything.

Task-number: QTCREATORBUG-22217
Change-Id: Ifab8e51fd892a5145a0f583e686e16ca6b8d6912
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2019-04-01 11:03:03 +02:00
committed by Tim Jenssen
parent 8fe6d2181e
commit 6ad90c7daa
@@ -117,6 +117,9 @@ QString filterMetaIcons(const QString &fileName)
QModelIndex CustomFileSystemModel::setRootPath(const QString &newPath)
{
if (m_fileSystemModel->rootPath() == newPath)
return QAbstractListModel::index(0, 0);
beginResetModel();
m_fileSystemModel->setRootPath(newPath);