diff options
author | hjk <[email protected]> | 2024-01-18 10:29:47 +0100 |
---|---|---|
committer | hjk <[email protected]> | 2024-01-18 14:20:24 +0000 |
commit | 6d4bbba27aa68c2ef60de3e15ff7b232aab65f05 (patch) | |
tree | 3f18ba5b37122bf8f36866af9ebf1e9f962583dc /src/plugins/qmlprojectmanager/qmlprojectplugin.cpp | |
parent | aad933c09d2270a06c672b0f08230b1f6de7e946 (diff) |
QmlProjectPlugin: Dissolve QmlProjectPluginPrivate
Not really used anymore.
Change-Id: I125ca6573cb0fd56cc925379dc0e97b0564e1b7c
Reviewed-by: Jarek Kobus <[email protected]>
Diffstat (limited to 'src/plugins/qmlprojectmanager/qmlprojectplugin.cpp')
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectplugin.cpp | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp b/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp index 05f1d22c3d6..c2f9347080d 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp @@ -101,9 +101,6 @@ static void clearAlwaysOpenWithMode() class QmlProjectPluginPrivate { public: - QPointer<QMessageBox> lastMessageBox; - QdsLandingPage *landingPage = nullptr; - QdsLandingPageWidget *landingPageWidget = nullptr; }; void openQDS(const FilePath &fileName) @@ -238,13 +235,12 @@ class QmlProjectPlugin final : public ExtensionSystem::IPlugin public: ~QmlProjectPlugin() { - if (d->lastMessageBox) - d->lastMessageBox->deleteLater(); - if (d->landingPage) - d->landingPage->deleteLater(); - if (d->landingPageWidget) - d->landingPageWidget->deleteLater(); - delete d; + if (m_lastMessageBox) + m_lastMessageBox->deleteLater(); + if (m_landingPage) + m_landingPage->deleteLater(); + if (m_landingPageWidget) + m_landingPageWidget->deleteLater(); } public slots: @@ -267,30 +263,30 @@ private: void hideQmlLandingPage(); void updateQmlLandingPageProjectInfo(const Utils::FilePath &projectFile); - class QmlProjectPluginPrivate *d = nullptr; + QPointer<QMessageBox> m_lastMessageBox; + QdsLandingPage *m_landingPage = nullptr; + QdsLandingPageWidget *m_landingPageWidget = nullptr; }; void QmlProjectPlugin::initialize() { setupQmlProjectRunConfiguration(); - d = new QmlProjectPluginPrivate; - if (!qmlDesignerEnabled()) { - d->landingPage = new QdsLandingPage(); + m_landingPage = new QdsLandingPage(); qmlRegisterSingletonInstance<QdsLandingPage>("LandingPageApi", 1, 0, "LandingPageApi", - d->landingPage); + m_landingPage); - d->landingPageWidget = new QdsLandingPageWidget(); + m_landingPageWidget = new QdsLandingPageWidget(); const QStringList mimeTypes = {Utils::Constants::QMLUI_MIMETYPE}; - auto context = new Internal::DesignModeContext(d->landingPageWidget); + auto context = new Internal::DesignModeContext(m_landingPageWidget); ICore::addContextObject(context); - DesignMode::registerDesignWidget(d->landingPageWidget, mimeTypes, context->context()); + DesignMode::registerDesignWidget(m_landingPageWidget, mimeTypes, context->context()); connect(ModeManager::instance(), &ModeManager::currentModeChanged, this, &QmlProjectPlugin::editorModeChanged); @@ -395,21 +391,21 @@ void QmlProjectPlugin::initialize() void QmlProjectPlugin::displayQmlLandingPage() { - if (!d->landingPage) + if (!m_landingPage) return; - d->landingPage->setWidget(d->landingPageWidget->widget()); + m_landingPage->setWidget(m_landingPageWidget->widget()); updateQmlLandingPageProjectInfo(projectFilePath()); - d->landingPage->setQdsInstalled(qdsInstallationExists()); - d->landingPage->setCmakeResources(ProjectFileContentTools::rootCmakeFiles()); - d->landingPage->show(); + m_landingPage->setQdsInstalled(qdsInstallationExists()); + m_landingPage->setCmakeResources(ProjectFileContentTools::rootCmakeFiles()); + m_landingPage->show(); } void QmlProjectPlugin::hideQmlLandingPage() { - if (d->landingPage) - d->landingPage->hide(); + if (m_landingPage) + m_landingPage->hide(); } static bool isDesignerMode(Id mode) @@ -439,7 +435,7 @@ void QmlProjectPlugin::openQtc(bool permanent) if (permanent) setAlwaysOpenWithMode(Core::Constants::MODE_EDIT); - if (d->landingPage) + if (m_landingPage) hideQmlLandingPage(); ModeManager::activateMode(Core::Constants::MODE_EDIT); @@ -450,7 +446,7 @@ void QmlProjectPlugin::openQds(bool permanent) if (permanent) setAlwaysOpenWithMode(Core::Constants::MODE_DESIGN); - if (d->landingPage) + if (m_landingPage) hideQmlLandingPage(); if (IEditor *editor = EditorManager::currentEditor()) @@ -459,14 +455,14 @@ void QmlProjectPlugin::openQds(bool permanent) void QmlProjectPlugin::updateQmlLandingPageProjectInfo(const FilePath &projectFile) { - if (!d->landingPage) + if (!m_landingPage) return; const QString qtVersionString = ProjectFileContentTools::qtVersion(projectFile); const QString qdsVersionString = ProjectFileContentTools::qdsVersion(projectFile); - d->landingPage->setProjectFileExists(projectFile.exists()); - d->landingPage->setQtVersion(qtVersionString); - d->landingPage->setQdsVersion(qdsVersionString); + m_landingPage->setProjectFileExists(projectFile.exists()); + m_landingPage->setQtVersion(qtVersionString); + m_landingPage->setQdsVersion(qdsVersionString); } FilePath projectFilePath() |