forked from qt-creator/qt-creator
QmlProject: Add support for supportedLanguages
Task-number: QDS-5187 Change-Id: Ieb1cb90225db4093178fafe4ebe948d5967a529d Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
committed by
Thomas Hartmann
parent
fded7e4edd
commit
e3d9ba8f59
@@ -99,6 +99,10 @@ QmlProjectItem *QmlProjectFileFormat::parseProjectFile(const Utils::FilePath &fi
|
||||
if (fileSelectorsProperty.isValid())
|
||||
projectItem->setFileSelectors(fileSelectorsProperty.value.toStringList());
|
||||
|
||||
const auto languagesProperty = rootNode->property(QLatin1String("supportedLanguages"));
|
||||
if (languagesProperty.isValid())
|
||||
projectItem->setSupportedLanguages(languagesProperty.value.toStringList());
|
||||
|
||||
const auto forceFreeTypeProperty = rootNode->property("forceFreeType");
|
||||
if (forceFreeTypeProperty.isValid())
|
||||
projectItem->setForceFreeType(forceFreeTypeProperty.value.toBool());
|
||||
|
@@ -77,6 +77,12 @@ void QmlProjectItem::setFileSelectors(const QStringList &selectors)
|
||||
m_fileSelectors = selectors;
|
||||
}
|
||||
|
||||
void QmlProjectItem::setSupportedLanguages(const QStringList &languages)
|
||||
{
|
||||
if (m_supportedLanguages != languages)
|
||||
m_supportedLanguages = languages;
|
||||
}
|
||||
|
||||
/* Returns list of absolute paths */
|
||||
QStringList QmlProjectItem::files() const
|
||||
{
|
||||
|
@@ -63,6 +63,9 @@ public:
|
||||
QStringList fileSelectors() const { return m_fileSelectors; }
|
||||
void setFileSelectors(const QStringList &selectors);
|
||||
|
||||
QStringList supportedLanguages() const { return m_supportedLanguages; }
|
||||
void setSupportedLanguages(const QStringList &languages);
|
||||
|
||||
QStringList files() const;
|
||||
bool matchesFile(const QString &filePath) const;
|
||||
|
||||
@@ -85,6 +88,7 @@ protected:
|
||||
QString m_targetDirectory;
|
||||
QStringList m_importPaths;
|
||||
QStringList m_fileSelectors;
|
||||
QStringList m_supportedLanguages;
|
||||
QString m_mainFile;
|
||||
Utils::EnvironmentItems m_environment;
|
||||
QVector<QmlProjectContentItem *> m_content; // content property
|
||||
|
@@ -340,6 +340,13 @@ QStringList QmlBuildSystem::customFileSelectors() const
|
||||
return {};
|
||||
}
|
||||
|
||||
QStringList QmlBuildSystem::supportedLanguages() const
|
||||
{
|
||||
if (m_projectItem)
|
||||
return m_projectItem.data()->supportedLanguages();
|
||||
return {};
|
||||
}
|
||||
|
||||
void QmlBuildSystem::refreshProjectFile()
|
||||
{
|
||||
refresh(QmlBuildSystem::ProjectFile | Files);
|
||||
@@ -509,6 +516,8 @@ QVariant QmlBuildSystem::additionalData(Id id) const
|
||||
{
|
||||
if (id == Constants::customFileSelectorsData)
|
||||
return customFileSelectors();
|
||||
if (id == Constants::supportedLanguagesData)
|
||||
return supportedLanguages();
|
||||
if (id == Constants::customForceFreeTypeData)
|
||||
return forceFreeType();
|
||||
if (id == Constants::customQtForMCUs)
|
||||
|
@@ -88,6 +88,7 @@ public:
|
||||
Utils::EnvironmentItems environment() const;
|
||||
QStringList customImportPaths() const;
|
||||
QStringList customFileSelectors() const;
|
||||
QStringList supportedLanguages() const;
|
||||
bool forceFreeType() const;
|
||||
|
||||
bool addFiles(const QStringList &filePaths);
|
||||
|
@@ -32,6 +32,7 @@ namespace Constants {
|
||||
|
||||
const char * const QMLPROJECT_MIMETYPE = QmlJSTools::Constants::QMLPROJECT_MIMETYPE;
|
||||
const char customFileSelectorsData[] = "CustomFileSelectorsData";
|
||||
const char supportedLanguagesData[] = "SupportedLanguagesData";
|
||||
const char customForceFreeTypeData[] = "CustomForceFreeType";
|
||||
const char customQtForMCUs[] = "CustomQtForMCUs";
|
||||
const char customQt6Project[] = "CustomQt6Project";
|
||||
|
Reference in New Issue
Block a user