Add d-ptr to DockRegistry, hides usage of kdbindings
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#include "kddockwidgets/controllers/DockWidget_p.h"
|
||||
#include "kddockwidgets/controllers/DropArea.h"
|
||||
|
||||
#include "kdbindings/signal.h"
|
||||
|
||||
#include <QPointer>
|
||||
#include <QDebug>
|
||||
#include <QGuiApplication>
|
||||
@@ -33,16 +35,24 @@
|
||||
using namespace KDDockWidgets;
|
||||
using namespace KDDockWidgets::Controllers;
|
||||
|
||||
class DockRegistry::Private
|
||||
{
|
||||
public:
|
||||
KDBindings::ConnectionHandle m_connection;
|
||||
};
|
||||
|
||||
DockRegistry::DockRegistry(QObject *parent)
|
||||
: QObject(parent)
|
||||
, d(new Private())
|
||||
{
|
||||
qGuiApp->installEventFilter(this);
|
||||
m_connection = Platform::instance()->focusedViewChanged.connect(&DockRegistry::onFocusedViewChanged, this);
|
||||
d->m_connection = Platform::instance()->focusedViewChanged.connect(&DockRegistry::onFocusedViewChanged, this);
|
||||
}
|
||||
|
||||
DockRegistry::~DockRegistry()
|
||||
{
|
||||
m_connection.disconnect();
|
||||
d->m_connection.disconnect();
|
||||
delete d;
|
||||
}
|
||||
|
||||
void DockRegistry::maybeDelete()
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
|
||||
#include "kdbindings/signal.h"
|
||||
|
||||
/**
|
||||
* DockRegistry is a singleton that knows about all DockWidgets.
|
||||
* It's used so we can restore layouts.
|
||||
@@ -255,6 +253,9 @@ private:
|
||||
void maybeDelete();
|
||||
void setFocusedDockWidget(Controllers::DockWidget *);
|
||||
|
||||
class Private;
|
||||
Private *const d;
|
||||
|
||||
bool m_isProcessingAppQuitEvent = false;
|
||||
QVector<Controllers::DockWidget *> m_dockWidgets;
|
||||
QVector<Controllers::MainWindow *> m_mainWindows;
|
||||
@@ -262,7 +263,6 @@ private:
|
||||
QVector<Controllers::FloatingWindow *> m_floatingWindows;
|
||||
QVector<Controllers::Layout *> m_layouts;
|
||||
QPointer<Controllers::DockWidget> m_focusedDockWidget;
|
||||
KDBindings::ConnectionHandle m_connection;
|
||||
|
||||
///@brief Dock widget id remapping, used by LayoutSaver
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user