From c3f2c04a28b356bdf9063d0404153021a04fe4bd Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Sun, 17 Aug 2025 11:41:08 -0400 Subject: [PATCH] refactor: remove IAppUtil. AppUtil is the base class now --- src/lib/deskflow/AppUtil.h | 20 +++++++++++++++----- src/lib/deskflow/CMakeLists.txt | 1 - src/lib/deskflow/IAppUtil.h | 26 -------------------------- 3 files changed, 15 insertions(+), 32 deletions(-) delete mode 100644 src/lib/deskflow/IAppUtil.h diff --git a/src/lib/deskflow/AppUtil.h b/src/lib/deskflow/AppUtil.h index 5e6efff1d..ea340d306 100644 --- a/src/lib/deskflow/AppUtil.h +++ b/src/lib/deskflow/AppUtil.h @@ -1,5 +1,6 @@ /* * Deskflow -- mouse and keyboard sharing utility + * SPDX-FileCopyrightText: (C) 2025 Deskflow Developers * SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd. * SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception @@ -8,16 +9,19 @@ #pragma once #include "deskflow/DeskflowException.h" -#include "deskflow/IAppUtil.h" +#include "deskflow/IApp.h" -class AppUtil : public IAppUtil +#include +#include + +class AppUtil { public: AppUtil(); - ~AppUtil() override = default; + virtual ~AppUtil() = default; - void adoptApp(IApp *app) override; - IApp &app() const override; + void adoptApp(IApp *app); + IApp &app() const; virtual void exitApp(int code) { throw ExitAppException(code); @@ -29,6 +33,12 @@ public: instance().exitApp(code); } + // Virtual Methods subclasses can impliment + virtual int run(int argc, char **argv) = 0; + virtual void startNode() = 0; + virtual std::vector getKeyboardLayoutList() = 0; + virtual std::string getCurrentLanguageCode() = 0; + private: IApp *m_app = nullptr; static AppUtil *s_instance; diff --git a/src/lib/deskflow/CMakeLists.txt b/src/lib/deskflow/CMakeLists.txt index ded418d5a..9edd316ae 100644 --- a/src/lib/deskflow/CMakeLists.txt +++ b/src/lib/deskflow/CMakeLists.txt @@ -89,7 +89,6 @@ add_library(${lib_name} STATIC ${PLATFORM_CODE} DeskflowException.h DisplayInvalidException.h IApp.h - IAppUtil.h IClient.h IClipboard.cpp IClipboard.h diff --git a/src/lib/deskflow/IAppUtil.h b/src/lib/deskflow/IAppUtil.h deleted file mode 100644 index f0108a2ae..000000000 --- a/src/lib/deskflow/IAppUtil.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * SPDX-FileCopyrightText: (C) 2025 Deskflow Developers - * SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd. - * SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman - * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception - */ - -#pragma once - -#include "deskflow/IApp.h" - -#include -#include - -class IAppUtil -{ -public: - virtual ~IAppUtil() = default; - virtual void adoptApp(IApp *app) = 0; - virtual IApp &app() const = 0; - virtual int run(int argc, char **argv) = 0; - virtual void startNode() = 0; - virtual std::vector getKeyboardLayoutList() = 0; - virtual std::string getCurrentLanguageCode() = 0; -};