vcl/inc/qt5/QtDragAndDrop.hxx |    5 ++++-
 vcl/inc/qt5/QtFrame.hxx       |    4 +---
 vcl/qt5/QtFrame.cxx           |   14 --------------
 3 files changed, 5 insertions(+), 18 deletions(-)

New commits:
commit 4637d8f7d5b9a09216b406348853c0a94ac52aa6
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Jun 27 15:51:18 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Jun 27 19:46:03 2025 +0200

    qt: Use QPointer for QtFrame::m_pDropTarget, drop unused method
    
    This is the QtDragSource equivalent of these 3 previous
    commits for QtDropTarget:
    
        Change-Id: Ic36b25a524a880d3d04805dbd1fde1ef80b17ca6
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Fri Jun 27 15:38:59 2025 +0200
    
            qt: Make QtDropTarget a QObject
    
        Change-Id: Idcafdcb571c218fba30f01a0ccca8438e5b258a7
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Fri Jun 27 15:40:20 2025 +0200
    
            qt: Use QPointer for QtFrame::m_pDropTarget
    
        Change-Id: I51e63d1367e8d913a2781a51c2fe64b2ce157d0a
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Fri Jun 27 15:44:19 2025 +0200
    
            qt: Drop unused QtFrame::deregisterDropTarget
    
    (See their commit messages for more details.)
    
    Change-Id: I50abed059ee1ea115239543ff79a6f9f4275c066
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187115
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/inc/qt5/QtDragAndDrop.hxx b/vcl/inc/qt5/QtDragAndDrop.hxx
index ed9d0dd5050c..aeef85083a5b 100644
--- a/vcl/inc/qt5/QtDragAndDrop.hxx
+++ b/vcl/inc/qt5/QtDragAndDrop.hxx
@@ -19,9 +19,12 @@
 
 class QtFrame;
 
-class QtDragSource final : public 
cppu::WeakComponentImplHelper<css::datatransfer::dnd::XDragSource,
+class QtDragSource final : public QObject,
+                           public 
cppu::WeakComponentImplHelper<css::datatransfer::dnd::XDragSource,
                                                                 
css::lang::XServiceInfo>
 {
+    Q_OBJECT
+
     osl::Mutex m_aMutex;
     QtFrame* m_pFrame;
     css::uno::Reference<css::datatransfer::dnd::XDragSourceListener> 
m_xListener;
diff --git a/vcl/inc/qt5/QtFrame.hxx b/vcl/inc/qt5/QtFrame.hxx
index 2f0b4fdfe727..4e3f00a59353 100644
--- a/vcl/inc/qt5/QtFrame.hxx
+++ b/vcl/inc/qt5/QtFrame.hxx
@@ -93,7 +93,7 @@ class VCLPLUG_QT_PUBLIC QtFrame : public QObject, public 
SalFrame
 
     SystemEnvData m_aSystemData;
 
-    QtDragSource* m_pDragSource;
+    QPointer<QtDragSource> m_pDragSource;
     QPointer<QtDropTarget> m_pDropTarget;
     bool m_bInDrag;
 
@@ -163,7 +163,6 @@ public:
     virtual void SetMenu(SalMenu* pMenu) override;
 
     void registerDragSource(QtDragSource* pDragSource);
-    void deregisterDragSource(QtDragSource const* pDragSource);
     void registerDropTarget(QtDropTarget* pDropTarget);
 
     void handleDragLeave();
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index 55ca01e9384f..d57b98eb2fc3 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -1338,13 +1338,6 @@ void QtFrame::registerDragSource(QtDragSource* 
pDragSource)
     m_pDragSource = pDragSource;
 }
 
-void QtFrame::deregisterDragSource(QtDragSource const* pDragSource)
-{
-    assert(m_pDragSource == pDragSource);
-    (void)pDragSource;
-    m_pDragSource = nullptr;
-}
-
 void QtFrame::registerDropTarget(QtDropTarget* pDropTarget)
 {
     assert(!m_pDropTarget);
commit fa3fd52d17b0340571a71dfd667dd3031813108b
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Jun 27 15:44:19 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Jun 27 19:45:57 2025 +0200

    qt: Drop unused QtFrame::deregisterDropTarget
    
    It's unused ever since it was added in
    
        commit 6685793351178364460e1580e07b2bf5ccc043ce
        Date:   Thu Oct 4 17:12:40 2018 +0200
    
            Basic structures for qt5 drag'n'drop support
    
    (calls commented out back then), likely because the qt5
    implementation back then was inspired by the gtk3 one.
    
    By now, there is
    
        Change-Id: Idcafdcb571c218fba30f01a0ccca8438e5b258a7
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Fri Jun 27 15:40:20 2025 +0200
    
            qt: Use QPointer for QtFrame::m_pDropTarget
    
    that implements "deregistering" the drop target
    a different way for the Qt-based VCL plugins.
    
    Change-Id: I51e63d1367e8d913a2781a51c2fe64b2ce157d0a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187114
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/inc/qt5/QtFrame.hxx b/vcl/inc/qt5/QtFrame.hxx
index 782040d18ac2..2f0b4fdfe727 100644
--- a/vcl/inc/qt5/QtFrame.hxx
+++ b/vcl/inc/qt5/QtFrame.hxx
@@ -165,7 +165,6 @@ public:
     void registerDragSource(QtDragSource* pDragSource);
     void deregisterDragSource(QtDragSource const* pDragSource);
     void registerDropTarget(QtDropTarget* pDropTarget);
-    void deregisterDropTarget(QtDropTarget const* pDropTarget);
 
     void handleDragLeave();
     void handleDragMove(QDragMoveEvent* pEvent);
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index b5b08ccae65b..55ca01e9384f 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -1353,13 +1353,6 @@ void QtFrame::registerDropTarget(QtDropTarget* 
pDropTarget)
     GetQtInstance().RunInMainThread([this]() { 
m_pQWidget->setAcceptDrops(true); });
 }
 
-void QtFrame::deregisterDropTarget(QtDropTarget const* pDropTarget)
-{
-    assert(m_pDropTarget == pDropTarget);
-    (void)pDropTarget;
-    m_pDropTarget = nullptr;
-}
-
 static css::uno::Reference<css::datatransfer::XTransferable>
 lcl_getXTransferable(const QMimeData* pMimeData)
 {

Reply via email to