From 13a0327a7c83e4289ea585b51c2e7cb1bb7d60d7 Mon Sep 17 00:00:00 2001 From: Pierre Lamot <pierre@videolabs.io> Date: Fri, 26 Nov 2021 09:34:39 +0100 Subject: [PATCH] qt: remove unsued QmlMainContext --- modules/gui/qt/Makefile.am | 3 -- modules/gui/qt/maininterface/mainui.cpp | 5 -- modules/gui/qt/maininterface/videosurface.hpp | 1 - modules/gui/qt/menus/qml_menu_wrapper.cpp | 1 - .../gui/qt/network/networksourcelistener.hpp | 2 - modules/gui/qt/util/qml_main_context.cpp | 42 ---------------- modules/gui/qt/util/qml_main_context.hpp | 48 ------------------- 7 files changed, 102 deletions(-) delete mode 100644 modules/gui/qt/util/qml_main_context.cpp delete mode 100644 modules/gui/qt/util/qml_main_context.hpp diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am index fb1262919140..5d022f0e8ee2 100644 --- a/modules/gui/qt/Makefile.am +++ b/modules/gui/qt/Makefile.am @@ -238,8 +238,6 @@ libqt_plugin_la_SOURCES = \ gui/qt/util/listcache.hpp \ gui/qt/util/listcacheloader.hpp \ gui/qt/util/navigation_history.cpp gui/qt/util/navigation_history.hpp \ - gui/qt/util/qml_main_context.cpp \ - gui/qt/util/qml_main_context.hpp \ gui/qt/util/item_key_event_filter.cpp \ gui/qt/util/item_key_event_filter.hpp \ gui/qt/util/qt_dirs.cpp gui/qt/util/qt_dirs.hpp \ @@ -417,7 +415,6 @@ nodist_libqt_plugin_la_SOURCES = \ gui/qt/util/keyhelper.moc.cpp \ gui/qt/util/listcache.moc.cpp \ gui/qt/util/navigation_history.moc.cpp \ - gui/qt/util/qml_main_context.moc.cpp \ gui/qt/util/item_key_event_filter.moc.cpp \ gui/qt/util/mouse_event_filter.moc.cpp \ gui/qt/util/qvlcapp.moc.cpp \ diff --git a/modules/gui/qt/maininterface/mainui.cpp b/modules/gui/qt/maininterface/mainui.cpp index 699320d03417..a8eb2d5b4401 100644 --- a/modules/gui/qt/maininterface/mainui.cpp +++ b/modules/gui/qt/maininterface/mainui.cpp @@ -28,7 +28,6 @@ #include "playlist/playlist_model.hpp" #include "playlist/playlist_controller.hpp" -#include "util/qml_main_context.hpp" #include "util/item_key_event_filter.hpp" #include "util/imageluminanceextractor.hpp" #include "util/i18n.hpp" @@ -48,8 +47,6 @@ #include "network/networksourcesmodel.hpp" #include "network/servicesdiscoverymodel.hpp" -#include "maininterface/main_interface.hpp" - #include "menus/qml_menu_wrapper.hpp" #include "widgets/native/roundimage.hpp" @@ -108,7 +105,6 @@ bool MainUI::setup(QQmlEngine* engine) rootCtx->setContextProperty( "history", new NavigationHistory(this) ); rootCtx->setContextProperty( "player", m_intf->p_mainPlayerController ); rootCtx->setContextProperty( "i18n", new I18n(this) ); - rootCtx->setContextProperty( "mainctx", new QmlMainContext(m_intf, m_mainInterface, this)); rootCtx->setContextProperty( "mainInterface", m_mainInterface); rootCtx->setContextProperty( "topWindow", m_interfaceWindow); rootCtx->setContextProperty( "dialogProvider", DialogsProvider::getInstance()); @@ -220,7 +216,6 @@ void MainUI::registerQMLTypes() qmlRegisterUncreatableType<ControlListModel>( uri, versionMajor, versionMinor, "ControlListModel", "" ); qmlRegisterSingletonType(uri, versionMajor, versionMinor, "PlayerListModel", PlayerControlbarModel::getPlaylistIdentifierListModel); - qRegisterMetaType<QmlMainContext*>(); qmlRegisterType<StringListMenu>( uri, versionMajor, versionMinor, "StringListMenu" ); qmlRegisterType<SortMenu>( uri, versionMajor, versionMinor, "SortMenu" ); qmlRegisterType<QmlGlobalMenu>( uri, versionMajor, versionMinor, "QmlGlobalMenu" ); diff --git a/modules/gui/qt/maininterface/videosurface.hpp b/modules/gui/qt/maininterface/videosurface.hpp index 0b015a173dbe..ca43cb90fd9e 100644 --- a/modules/gui/qt/maininterface/videosurface.hpp +++ b/modules/gui/qt/maininterface/videosurface.hpp @@ -21,7 +21,6 @@ #include <QtQuick/QQuickItem> #include <QCursor> #include <QMutex> -#include <util/qml_main_context.hpp> #include "qt.hpp" #include "vlc_vout_window.h" diff --git a/modules/gui/qt/menus/qml_menu_wrapper.cpp b/modules/gui/qt/menus/qml_menu_wrapper.cpp index 5eb690fbd4fc..280c60375b03 100644 --- a/modules/gui/qt/menus/qml_menu_wrapper.cpp +++ b/modules/gui/qt/menus/qml_menu_wrapper.cpp @@ -17,7 +17,6 @@ *****************************************************************************/ #include "qml_menu_wrapper.hpp" #include "menus.hpp" -#include "util/qml_main_context.hpp" #include "medialibrary/medialib.hpp" #include "medialibrary/mlvideomodel.hpp" #include "medialibrary/mlgrouplistmodel.hpp" diff --git a/modules/gui/qt/network/networksourcelistener.hpp b/modules/gui/qt/network/networksourcelistener.hpp index a2fbfe6f6023..332ce3ef08ba 100644 --- a/modules/gui/qt/network/networksourcelistener.hpp +++ b/modules/gui/qt/network/networksourcelistener.hpp @@ -28,8 +28,6 @@ #include <vlc_threads.h> #include <vlc_cxx_helpers.hpp> -#include <util/qml_main_context.hpp> - #include <memory> #include <functional> diff --git a/modules/gui/qt/util/qml_main_context.cpp b/modules/gui/qt/util/qml_main_context.cpp deleted file mode 100644 index 80b9dd841066..000000000000 --- a/modules/gui/qt/util/qml_main_context.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/***************************************************************************** - * Copyright (C) 2019 VLC authors and VideoLAN - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * ( at your option ) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. - *****************************************************************************/ -#include "qml_main_context.hpp" -#include "maininterface/main_interface.hpp" - -QmlMainContext::QmlMainContext(qt_intf_t* intf, MainInterface* mainInterface, QObject* parent) - : QObject(parent) - , m_intf( intf ) - , m_playlist(intf->p_playlist) - , m_mainInterface(mainInterface) -{ -} - -MainInterface*QmlMainContext::getMainInterface() const -{ - return m_mainInterface; -} - -qt_intf_t*QmlMainContext::getIntf() const -{ - return m_intf; -} - -PlaylistPtr QmlMainContext::getPlaylist() const -{ - return m_playlist; -} diff --git a/modules/gui/qt/util/qml_main_context.hpp b/modules/gui/qt/util/qml_main_context.hpp deleted file mode 100644 index f76ca30ec3d8..000000000000 --- a/modules/gui/qt/util/qml_main_context.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/***************************************************************************** - * Copyright (C) 2019 VLC authors and VideoLAN - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * ( at your option ) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. - *****************************************************************************/ -#ifndef QML_MAIN_CONTEXT_HPP -#define QML_MAIN_CONTEXT_HPP - -#include "qt.hpp" - -#include <QObject> -#include <playlist/playlist_common.hpp> - -class MainInterface; -/** - * @brief The QmlMainContext class - */ -class QmlMainContext : public QObject -{ - Q_OBJECT - Q_PROPERTY(PlaylistPtr playlist READ getPlaylist CONSTANT FINAL) - -public: - explicit QmlMainContext(qt_intf_t *intf, MainInterface *mainInterface, QObject* parent = nullptr); - - MainInterface* getMainInterface() const; - qt_intf_t* getIntf() const; - PlaylistPtr getPlaylist() const; - -private: - qt_intf_t* m_intf; - PlaylistPtr m_playlist; - MainInterface* m_mainInterface; -}; - -#endif // QML_MAIN_CONTEXT_HPP -- GitLab