Skip to content

Commit

Permalink
QtQml: Dissolve QQmlImportDatabase
Browse files Browse the repository at this point in the history
It was so tightly coupled to QQmlTypeLoader that the distinction only
added noise and overhead.

QmldirCache is renamed to QmldirInfo.

Change-Id: I3e41008a57f6071be869131ec1426598221b50ea
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
  • Loading branch information
Ulf Hermann committed Jan 3, 2025
1 parent 02bff91 commit 3690057
Show file tree
Hide file tree
Showing 10 changed files with 587 additions and 638 deletions.
15 changes: 7 additions & 8 deletions src/qml/qml/qqmlengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,7 @@ void QQmlEnginePrivate::cleanupScarceResources()
void QQmlEngine::addImportPath(const QString& path)
{
Q_D(QQmlEngine);
d->importDatabase.addImportPath(path);
d->typeLoader.addImportPath(path);
}

/*!
Expand All @@ -1641,7 +1641,7 @@ void QQmlEngine::addImportPath(const QString& path)
QStringList QQmlEngine::importPathList() const
{
Q_D(const QQmlEngine);
return d->importDatabase.importPathList();
return d->typeLoader.importPathList();
}

/*!
Expand All @@ -1659,7 +1659,7 @@ QStringList QQmlEngine::importPathList() const
void QQmlEngine::setImportPathList(const QStringList &paths)
{
Q_D(QQmlEngine);
d->importDatabase.setImportPathList(paths);
d->typeLoader.setImportPathList(paths);
}


Expand All @@ -1677,7 +1677,7 @@ void QQmlEngine::setImportPathList(const QStringList &paths)
void QQmlEngine::addPluginPath(const QString& path)
{
Q_D(QQmlEngine);
d->importDatabase.addPluginPath(path);
d->typeLoader.addPluginPath(path);
}

/*!
Expand All @@ -1692,7 +1692,7 @@ void QQmlEngine::addPluginPath(const QString& path)
QStringList QQmlEngine::pluginPathList() const
{
Q_D(const QQmlEngine);
return d->importDatabase.pluginPathList();
return d->typeLoader.pluginPathList();
}

/*!
Expand All @@ -1708,7 +1708,7 @@ QStringList QQmlEngine::pluginPathList() const
void QQmlEngine::setPluginPathList(const QStringList &paths)
{
Q_D(QQmlEngine);
d->importDatabase.setPluginPathList(paths);
d->typeLoader.setPluginPathList(paths);
}

#if QT_CONFIG(library)
Expand All @@ -1731,8 +1731,7 @@ bool QQmlEngine::importPlugin(const QString &filePath, const QString &uri, QList
{
Q_D(QQmlEngine);
QQmlTypeLoaderQmldirContent qmldir;
QQmlPluginImporter importer(
uri, QTypeRevision(), &d->importDatabase, &qmldir, &d->typeLoader, errors);
QQmlPluginImporter importer(uri, QTypeRevision(), &qmldir, &d->typeLoader, errors);
return importer.importDynamicPlugin(filePath, uri, false).isValid();
}
#endif
Expand Down
3 changes: 1 addition & 2 deletions src/qml/qml/qqmlengine_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Q_QML_EXPORT QQmlEnginePrivate : public QJSEnginePrivate
{
Q_DECLARE_PUBLIC(QQmlEngine)
public:
explicit QQmlEnginePrivate(QQmlEngine *q) : importDatabase(&typeLoader), typeLoader(q) {}
explicit QQmlEnginePrivate(QQmlEngine *q) : typeLoader(q) {}
~QQmlEnginePrivate() override;

void init();
Expand Down Expand Up @@ -152,7 +152,6 @@ class Q_QML_EXPORT QQmlEnginePrivate : public QJSEnginePrivate
void referenceScarceResources();
void dereferenceScarceResources();

QQmlImportDatabase importDatabase;
QQmlTypeLoader typeLoader;

QString offlineStoragePath;
Expand Down
Loading

0 comments on commit 3690057

Please sign in to comment.