diff --git a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp index a1f4ff9e285e13123b1f01b5eb4b65097189386f..43cb7d252d6baa87e6e64ea6a802e49d20752a21 100644 --- a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp +++ b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp @@ -69,18 +69,14 @@ void FileFilterBaseItem::setRecursive(bool recursive) updateFileList(); } -QString FileFilterBaseItem::pathsProperty() const +QStringList FileFilterBaseItem::pathsProperty() const { - return QStringList(m_explicitFiles.toList()).join(","); + return m_explicitFiles; } -void FileFilterBaseItem::setPathsProperty(const QString &path) +void FileFilterBaseItem::setPathsProperty(const QStringList &path) { - // we support listening paths both in an array, and in one string - m_explicitFiles.clear(); - foreach (const QString &subpath, path.split(QLatin1Char(','), QString::SkipEmptyParts)) { - m_explicitFiles += subpath.trimmed(); - } + m_explicitFiles = path; updateFileList(); } diff --git a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.h b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.h index 0a1e53ef5eef280e23fa2514630e27ffc5f6a3d4..24744b72426ff3c4e4de55d5a29a1f1e551dc3d0 100644 --- a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.h +++ b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.h @@ -16,7 +16,7 @@ class FileFilterBaseItem : public QmlProjectContentItem { Q_PROPERTY(QString directory READ directory WRITE setDirectory NOTIFY directoryChanged) Q_PROPERTY(bool recursive READ recursive WRITE setRecursive NOTIFY recursiveChanged) - Q_PROPERTY(QString paths READ pathsProperty WRITE setPathsProperty NOTIFY pathsPropertyChanged) + Q_PROPERTY(QStringList paths READ pathsProperty WRITE setPathsProperty NOTIFY pathsPropertyChanged) Q_PROPERTY(QStringList files READ files NOTIFY filesChanged DESIGNABLE false) @@ -34,8 +34,8 @@ public: bool recursive() const; void setRecursive(bool recursive); - QString pathsProperty() const; - void setPathsProperty(const QString &path); + QStringList pathsProperty() const; + void setPathsProperty(const QStringList &paths); virtual QStringList files() const; bool matchesFile(const QString &filePath) const; @@ -43,7 +43,7 @@ public: signals: void directoryChanged(); void recursiveChanged(); - void pathsPropertyChanged(); + void pathsChanged(); void filesChanged(); void filterChanged(); @@ -62,7 +62,7 @@ private: QString m_filter; QList<QRegExp> m_regExpList; bool m_recursive; - QSet<QString> m_explicitFiles; + QStringList m_explicitFiles; QFileSystemWatcher m_fsWatcher; diff --git a/tests/auto/qml/qmlprojectmanager/fileformat/tst_fileformat.cpp b/tests/auto/qml/qmlprojectmanager/fileformat/tst_fileformat.cpp index d32b731078a7c8c659203179a8c6e8c987471424..385a7e696eae9248483f65e99cd23f04da45b60b 100644 --- a/tests/auto/qml/qmlprojectmanager/fileformat/tst_fileformat.cpp +++ b/tests/auto/qml/qmlprojectmanager/fileformat/tst_fileformat.cpp @@ -153,8 +153,8 @@ void TestProject::testFileFilter() "import QmlProject 1.0\n" "Project {\n" " QmlFiles {\n" - " paths: \"file1.qml,\n" - "file2.qml\"\n" + " paths: [ \"file1.qml\",\n" + "\"file2.qml\" ]\n" " }\n" "}\n");