From 96f615b4772615e64262d78f6e805414292efb09 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 28 Feb 2017 17:16:07 +0100 Subject: [PATCH] QmlDesigner: Fix warning Change-Id: Ifbf626a484c0acb65d3d980c81e8d2ab535cab19 Reviewed-by: Christian Stenger Reviewed-by: Tim Jenssen --- .../components/itemlibrary/customfilesystemmodel.cpp | 3 +-- .../qmldesigner/components/itemlibrary/customfilesystemmodel.h | 2 +- .../qmldesigner/components/itemlibrary/itemlibrarywidget.cpp | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.cpp b/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.cpp index 1371ec8d9a8..c9fb697d981 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.cpp @@ -83,7 +83,6 @@ CustomFileSystemModel::CustomFileSystemModel(QObject *parent) : QAbstractListMod connect(m_fileSystemWatcher, &Utils::FileSystemWatcher::directoryChanged, [this] { setRootPath(m_fileSystemModel->rootPath()); }); - } void CustomFileSystemModel::setFilter(QDir::Filters) @@ -152,7 +151,7 @@ int CustomFileSystemModel::columnCount(const QModelIndex &) const return 1; } -QModelIndex CustomFileSystemModel::index(const QString &path, int /*column*/) const +QModelIndex CustomFileSystemModel::indexForPath(const QString &path, int /*column*/) const { return QAbstractListModel::index(m_files.indexOf(path), 0); } diff --git a/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.h b/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.h index 98928486684..31cd9fcb984 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.h +++ b/src/plugins/qmldesigner/components/itemlibrary/customfilesystemmodel.h @@ -51,7 +51,7 @@ public: int rowCount(const QModelIndex & parent = QModelIndex()) const override; int columnCount(const QModelIndex & parent = QModelIndex()) const override; - QModelIndex index(const QString & path, int column = 0) const; + QModelIndex indexForPath(const QString & path, int column = 0) const; QIcon fileIcon(const QModelIndex & index) const; QString fileName(const QModelIndex & index) const; diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp index 4ec968284ca..3aa5a0a216b 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp @@ -261,7 +261,7 @@ void ItemLibraryWidget::setResourcePath(const QString &resourcePath) { if (m_resourcesView->model() == m_resourcesFileSystemModel.data()) { m_resourcesFileSystemModel->setRootPath(resourcePath); - m_resourcesView->setRootIndex(m_resourcesFileSystemModel->index(resourcePath)); + m_resourcesView->setRootIndex(m_resourcesFileSystemModel->indexForPath(resourcePath)); } updateSearch(); }