From acece00ae291d143c3b712a98814a64b9dd43f14 Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周一, 11 12月 2023 17:12:41 +0800
Subject: [PATCH] Remove VersionHelper

---
 src/core/windowagentbase.cpp |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/core/windowagentbase.cpp b/src/core/windowagentbase.cpp
index 94d1fca..65b7dad 100644
--- a/src/core/windowagentbase.cpp
+++ b/src/core/windowagentbase.cpp
@@ -13,6 +13,9 @@
 
 namespace QWK {
 
+    WindowAgentBasePrivate::WindowContextFactoryMethod
+        WindowAgentBasePrivate::windowContextFactoryMethod = nullptr;
+
     WindowAgentBasePrivate::WindowAgentBasePrivate() : q_ptr(nullptr), context(nullptr) {
     }
 
@@ -22,15 +25,15 @@
     }
 
     AbstractWindowContext *WindowAgentBasePrivate::createContext() const {
-        return
+        if (windowContextFactoryMethod) {
+            return windowContextFactoryMethod();
+        }
 #ifdef Q_OS_WINDOWS
-            new Win32WindowContext()
+        return new Win32WindowContext();
 #else
-            new QtWindowContext()
+        return new QtWindowContext();
 #endif
-                ;
     }
-
 
     bool WindowAgentBasePrivate::setup(QObject *host, WindowItemDelegate *delegate) {
         std::unique_ptr<AbstractWindowContext> ctx(createContext());

--
Gitblit v1.9.1