forked from qt-creator/qt-creator
QmlProject: Implement basic support for QmlFileSelector
This patch adds support for QmlFileSelector for QmlProject and Qt Quick Designer. Task-number: QDS-590 Change-Id: I0cc043d3ec9578008ec879b36fe834b70fb8c5ad Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -88,6 +88,10 @@ QmlProjectItem *QmlProjectFileFormat::parseProjectFile(const Utils::FileName &fi
|
||||
if (importPathsProperty.isValid())
|
||||
projectItem->setImportPaths(importPathsProperty.toStringList());
|
||||
|
||||
const QVariant fileSelectorsProperty = rootNode->property(QLatin1String("fileSelectors"));
|
||||
if (fileSelectorsProperty.isValid())
|
||||
projectItem->setFileSelectors(fileSelectorsProperty.toStringList());
|
||||
|
||||
const QVariant targetDirectoryPropery = rootNode->property("targetDirectory");
|
||||
if (targetDirectoryPropery.isValid())
|
||||
projectItem->setTargetDirectory(targetDirectoryPropery.toString());
|
||||
|
||||
@@ -59,6 +59,12 @@ void QmlProjectItem::setImportPaths(const QStringList &importPaths)
|
||||
m_importPaths = importPaths;
|
||||
}
|
||||
|
||||
void QmlProjectItem::setFileSelectors(const QStringList &selectors)
|
||||
{
|
||||
if (m_fileSelectors != selectors)
|
||||
m_fileSelectors = selectors;
|
||||
}
|
||||
|
||||
/* Returns list of absolute paths */
|
||||
QStringList QmlProjectItem::files() const
|
||||
{
|
||||
|
||||
@@ -54,6 +54,9 @@ public:
|
||||
QStringList importPaths() const { return m_importPaths; }
|
||||
void setImportPaths(const QStringList &paths);
|
||||
|
||||
QStringList fileSelectors() const { return m_fileSelectors; }
|
||||
void setFileSelectors(const QStringList &selectors);
|
||||
|
||||
QStringList files() const;
|
||||
bool matchesFile(const QString &filePath) const;
|
||||
|
||||
@@ -72,6 +75,7 @@ protected:
|
||||
QString m_sourceDirectory;
|
||||
QString m_targetDirectory;
|
||||
QStringList m_importPaths;
|
||||
QStringList m_fileSelectors;
|
||||
QString m_mainFile;
|
||||
QList<Utils::EnvironmentItem> m_environment;
|
||||
QList<QmlProjectContentItem *> m_content; // content property
|
||||
|
||||
Reference in New Issue
Block a user