From e1fd6074935cd0be0df14d89eb0244fcbd1677cf Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 1 Feb 2019 11:50:05 +0100 Subject: [PATCH] Remove leftovers from QML1 QML1 is not supported anymore, remove the leftover hooks for it. Change-Id: I2900726714c5faea3523b2ebe39bb393364b3bfb Reviewed-by: Lars Knoll --- config_help.txt | 3 +-- configure | 1 - configure.json | 1 - configure.pri | 3 --- qmake/property.cpp | 1 - src/corelib/global/qlibraryinfo.cpp | 2 -- src/corelib/global/qlibraryinfo.h | 1 - src/corelib/kernel/qobject.cpp | 12 ++---------- src/corelib/kernel/qobject_p.h | 9 --------- src/widgets/graphicsview/qgraphicsitem.cpp | 9 ++------- src/widgets/kernel/qwidget.cpp | 9 ++------- tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 3 +-- 12 files changed, 8 insertions(+), 46 deletions(-) diff --git a/config_help.txt b/config_help.txt index 2c46592c319..6ed291b621a 100644 --- a/config_help.txt +++ b/config_help.txt @@ -38,8 +38,7 @@ except -sysconfdir should be located under -prefix/-hostprefix: -plugindir ...... Plugins [ARCHDATADIR/plugins] -libexecdir ..... Helper programs [ARCHDATADIR/bin on Windows, ARCHDATADIR/libexec otherwise] - -importdir ...... QML1 imports [ARCHDATADIR/imports] - -qmldir ......... QML2 imports [ARCHDATADIR/qml] + -qmldir ......... QML imports [ARCHDATADIR/qml] -datadir ........ Arch-independent data [PREFIX] -docdir ......... Documentation [DATADIR/doc] -translationdir . Translations [DATADIR/translations] diff --git a/configure b/configure index 19016d5c121..d350ca5c7fa 100755 --- a/configure +++ b/configure @@ -417,7 +417,6 @@ while [ "$#" -gt 0 ]; do -docdir| \ -headerdir| \ -plugindir| \ - -importdir| \ -qmldir| \ -archdatadir| \ -datadir| \ diff --git a/configure.json b/configure.json index ce71e679936..e3ff6caf54a 100644 --- a/configure.json +++ b/configure.json @@ -40,7 +40,6 @@ "hostbindir": "string", "hostdatadir": "string", "hostlibdir": "string", - "importdir": "string", "libdir": "string", "libexecdir": "string", "plugindir": "string", diff --git a/configure.pri b/configure.pri index 5f82efbf075..35cc08d6941 100644 --- a/configure.pri +++ b/configure.pri @@ -699,7 +699,6 @@ defineReplace(printInstallPaths) { $$printInstallPath(LibraryExecutables, libexecdir, $$DEFAULT_LIBEXEC) \ $$printInstallPath(Binaries, bindir, bin) \ $$printInstallPath(Plugins, plugindir, plugins) \ - $$printInstallPath(Imports, importdir, imports) \ $$printInstallPath(Qml2Imports, qmldir, qml) \ $$printInstallPath(ArchData, archdatadir, .) \ $$printInstallPath(Data, datadir, .) \ @@ -794,7 +793,6 @@ defineTest(qtConfOutput_preparePaths) { archdata_pfx = $$config.rel_input.archdatadir/ processQtPath("", libexecdir, $${archdata_pfx}$$DEFAULT_LIBEXEC) processQtPath("", plugindir, $${archdata_pfx}plugins) - processQtPath("", importdir, $${archdata_pfx}imports) processQtPath("", qmldir, $${archdata_pfx}qml) processQtPath("", sysconfdir, $$DEFAULT_SYSCONFDIR) $$have_hostprefix { @@ -838,7 +836,6 @@ defineTest(qtConfOutput_preparePaths) { addConfStr($$config.rel_input.libexecdir) addConfStr($$config.rel_input.bindir) addConfStr($$config.rel_input.plugindir) - addConfStr($$config.rel_input.importdir) addConfStr($$config.rel_input.qmldir) addConfStr($$config.rel_input.archdatadir) addConfStr($$config.rel_input.datadir) diff --git a/qmake/property.cpp b/qmake/property.cpp index 432ff55664b..31d6cdc9d65 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -54,7 +54,6 @@ static const struct { { "QT_INSTALL_BINS", QLibraryInfo::BinariesPath, false, false }, { "QT_INSTALL_TESTS", QLibraryInfo::TestsPath, false, false }, { "QT_INSTALL_PLUGINS", QLibraryInfo::PluginsPath, false, false }, - { "QT_INSTALL_IMPORTS", QLibraryInfo::ImportsPath, false, false }, { "QT_INSTALL_QML", QLibraryInfo::Qml2ImportsPath, false, false }, { "QT_INSTALL_TRANSLATIONS", QLibraryInfo::TranslationsPath, false, false }, { "QT_INSTALL_CONFIGURATION", QLibraryInfo::SettingsPath, false, false }, diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 6476b7404ab..434b657df3c 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -419,7 +419,6 @@ static const struct { #endif { "Binaries", "bin" }, { "Plugins", "plugins" }, // should be ${ArchData}/plugins - { "Imports", "imports" }, // should be ${ArchData}/imports { "Qml2Imports", "qml" }, // should be ${ArchData}/qml { "ArchData", "." }, { "Data", "." }, @@ -834,7 +833,6 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName) \value LibraryExecutablesPath The location of installed executables required by libraries at runtime. \value BinariesPath The location of installed Qt binaries (tools and applications). \value PluginsPath The location of installed Qt plugins. - \value ImportsPath The location of installed QML extensions to import (QML 1.x). \value Qml2ImportsPath The location of installed QML extensions to import (QML 2.x). \value ArchDataPath The location of general architecture-dependent Qt data. \value DataPath The location of general architecture-independent Qt data. diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h index ed60b170a5a..031dfe37e2d 100644 --- a/src/corelib/global/qlibraryinfo.h +++ b/src/corelib/global/qlibraryinfo.h @@ -79,7 +79,6 @@ public: LibraryExecutablesPath, BinariesPath, PluginsPath, - ImportsPath, Qml2ImportsPath, ArchDataPath, DataPath, diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 003c8a8643b..aac55ce8edc 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -161,7 +161,6 @@ extern "C" Q_CORE_EXPORT void qt_removeObject(QObject *) #endif void (*QAbstractDeclarativeData::destroyed)(QAbstractDeclarativeData *, QObject *) = 0; -void (*QAbstractDeclarativeData::destroyed_qml1)(QAbstractDeclarativeData *, QObject *) = 0; void (*QAbstractDeclarativeData::parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *) = 0; void (*QAbstractDeclarativeData::signalEmitted)(QAbstractDeclarativeData *, QObject *, int, void **) = 0; int (*QAbstractDeclarativeData::receivers)(QAbstractDeclarativeData *, const QObject *, int) = 0; @@ -1013,15 +1012,8 @@ QObject::~QObject() emit destroyed(this); } - if (d->declarativeData) { - if (static_cast(d->declarativeData)->ownedByQml1) { - if (QAbstractDeclarativeData::destroyed_qml1) - QAbstractDeclarativeData::destroyed_qml1(d->declarativeData, this); - } else { - if (QAbstractDeclarativeData::destroyed) - QAbstractDeclarativeData::destroyed(d->declarativeData, this); - } - } + if (d->declarativeData && QAbstractDeclarativeData::destroyed) + QAbstractDeclarativeData::destroyed(d->declarativeData, this); QObjectPrivate::ConnectionData *cd = d->connections.loadRelaxed(); if (cd) { diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index d19d10b47ca..11ebba7787c 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -89,7 +89,6 @@ class Q_CORE_EXPORT QAbstractDeclarativeData { public: static void (*destroyed)(QAbstractDeclarativeData *, QObject *); - static void (*destroyed_qml1)(QAbstractDeclarativeData *, QObject *); static void (*parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *); static void (*signalEmitted)(QAbstractDeclarativeData *, QObject *, int, void **); static int (*receivers)(QAbstractDeclarativeData *, const QObject *, int); @@ -97,14 +96,6 @@ public: static void (*setWidgetParent)(QObject *, QObject *); // Used by the QML engine to specify parents for widgets. Set by QtWidgets. }; -// This is an implementation of QAbstractDeclarativeData that is identical with -// the implementation in QtDeclarative and QtQml for the first bit -struct QAbstractDeclarativeDataImpl : public QAbstractDeclarativeData -{ - quint32 ownedByQml1:1; - quint32 unused: 31; -}; - class Q_CORE_EXPORT QObjectPrivate : public QObjectData { Q_DECLARE_PUBLIC(QObject) diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index bb00db4c017..88baf8015ab 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -1580,13 +1580,8 @@ QGraphicsItem::~QGraphicsItem() p->wasDeleted = true; if (p->declarativeData) { p->wasDeleted = true; // needed, so that destroying the declarative data does the right thing - if (static_cast(p->declarativeData)->ownedByQml1) { - if (QAbstractDeclarativeData::destroyed_qml1) - QAbstractDeclarativeData::destroyed_qml1(p->declarativeData, o); - } else { - if (QAbstractDeclarativeData::destroyed) - QAbstractDeclarativeData::destroyed(p->declarativeData, o); - } + if (QAbstractDeclarativeData::destroyed) + QAbstractDeclarativeData::destroyed(p->declarativeData, o); p->declarativeData = 0; p->wasDeleted = false; } diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 6889c2e9e5f..ea9299f36ee 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1513,13 +1513,8 @@ QWidget::~QWidget() if (d->declarativeData) { d->wasDeleted = true; // needed, so that destroying the declarative data does the right thing - if (static_cast(d->declarativeData)->ownedByQml1) { - if (QAbstractDeclarativeData::destroyed_qml1) - QAbstractDeclarativeData::destroyed_qml1(d->declarativeData, this); - } else { - if (QAbstractDeclarativeData::destroyed) - QAbstractDeclarativeData::destroyed(d->declarativeData, this); - } + if (QAbstractDeclarativeData::destroyed) + QAbstractDeclarativeData::destroyed(d->declarativeData, this); d->declarativeData = 0; // don't activate again in ~QObject d->wasDeleted = false; } diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 676999a08cb..5b576fe1547 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -6926,8 +6926,7 @@ void tst_QObject::noDeclarativeParentChangedOnDestruction() QObject *parent = new QObject; QObject *child = new QObject; - QAbstractDeclarativeDataImpl dummy; - dummy.ownedByQml1 = false; + QAbstractDeclarativeData dummy; QObjectPrivate::get(child)->declarativeData = &dummy; parentChangeCalled = false;