From 2d08f989b16dad059d42c94e3a2cdccdbd3c379e Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周一, 04 12月 2023 03:38:52 +0800
Subject: [PATCH] Add more comments

---
 src/core/corewindowagent.cpp |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/core/corewindowagent.cpp b/src/core/corewindowagent.cpp
index c843273..78ed335 100644
--- a/src/core/corewindowagent.cpp
+++ b/src/core/corewindowagent.cpp
@@ -1,6 +1,8 @@
 #include "corewindowagent.h"
 #include "corewindowagent_p.h"
 
+#include "qwkcoreglobal_p.h"
+
 #ifdef Q_OS_WINDOWS
 #  include "win32windowcontext_p.h"
 #else
@@ -11,12 +13,10 @@
 
 namespace QWK {
 
-    CoreWindowAgentPrivate::CoreWindowAgentPrivate() : eventHandler(nullptr) {
+    CoreWindowAgentPrivate::CoreWindowAgentPrivate() : q_ptr(nullptr), context(nullptr) {
     }
 
-    CoreWindowAgentPrivate::~CoreWindowAgentPrivate() {
-        delete eventHandler;
-    }
+    CoreWindowAgentPrivate::~CoreWindowAgentPrivate() = default;
 
     void CoreWindowAgentPrivate::init() {
     }
@@ -38,7 +38,7 @@
             delete handler;
             return false;
         }
-        eventHandler = handler;
+        context.reset(handler);
         return true;
     }
 
@@ -46,12 +46,12 @@
 
     void CoreWindowAgent::showSystemMenu(const QPoint &pos) {
         Q_D(CoreWindowAgent);
-        d->eventHandler->showSystemMenu(pos);
+        d->context->showSystemMenu(pos);
     }
 
     void CoreWindowAgent::startSystemMove(const QPoint &pos) {
         Q_D(CoreWindowAgent);
-        auto win = d->eventHandler->window();
+        auto win = d->context->window();
         if (!win) {
             return;
         }
@@ -62,7 +62,7 @@
 
     void CoreWindowAgent::startSystemResize(Qt::Edges edges, const QPoint &pos) {
         Q_D(CoreWindowAgent);
-        auto win = d->eventHandler->window();
+        auto win = d->context->window();
         if (!win) {
             return;
         }

--
Gitblit v1.9.1