diff options
Diffstat (limited to 'src/plugins/qmldesigner/components/materialbrowser/materialbrowserbundlemodel.cpp')
-rw-r--r-- | src/plugins/qmldesigner/components/materialbrowser/materialbrowserbundlemodel.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/plugins/qmldesigner/components/materialbrowser/materialbrowserbundlemodel.cpp b/src/plugins/qmldesigner/components/materialbrowser/materialbrowserbundlemodel.cpp index 441cdc7a69..7cb2a39c0d 100644 --- a/src/plugins/qmldesigner/components/materialbrowser/materialbrowserbundlemodel.cpp +++ b/src/plugins/qmldesigner/components/materialbrowser/materialbrowserbundlemodel.cpp @@ -94,7 +94,7 @@ QHash<int, QByteArray> MaterialBrowserBundleModel::roleNames() const void MaterialBrowserBundleModel::loadMaterialBundle() { - if (m_matBundleExists || m_probeMatBundleDir) + if (m_matBundleLoaded || m_probeMatBundleDir) return; QDir matBundleDir(qEnvironmentVariable("MATERIAL_BUNDLE_PATH")); @@ -130,7 +130,7 @@ void MaterialBrowserBundleModel::loadMaterialBundle() } } - m_matBundleExists = true; + m_matBundleLoaded = true; QString bundleId = m_matBundleObj.value("id").toString(); @@ -184,20 +184,6 @@ void MaterialBrowserBundleModel::loadMaterialBundle() }); } -bool MaterialBrowserBundleModel::hasQuick3DImport() const -{ - return m_hasQuick3DImport; -} - -void MaterialBrowserBundleModel::setHasQuick3DImport(bool b) -{ - if (b == m_hasQuick3DImport) - return; - - m_hasQuick3DImport = b; - emit hasQuick3DImportChanged(); -} - bool MaterialBrowserBundleModel::hasMaterialRoot() const { return m_hasMaterialRoot; @@ -212,6 +198,11 @@ void MaterialBrowserBundleModel::setHasMaterialRoot(bool b) emit hasMaterialRootChanged(); } +bool MaterialBrowserBundleModel::matBundleExists() const +{ + return m_matBundleLoaded && m_quick3dMajorVersion == 6 && m_quick3dMinorVersion >= 3; +} + Internal::BundleImporter *MaterialBrowserBundleModel::bundleImporter() const { return m_importer; @@ -253,6 +244,17 @@ void MaterialBrowserBundleModel::updateImportedState(const QStringList &imported resetModel(); } +void MaterialBrowserBundleModel::setQuick3DImportVersion(int major, int minor) +{ + bool bundleExisted = matBundleExists(); + + m_quick3dMajorVersion = major; + m_quick3dMinorVersion = minor; + + if (bundleExisted != matBundleExists()) + emit matBundleExistsChanged(); +} + void MaterialBrowserBundleModel::resetModel() { beginResetModel(); |