From 73de5e964ee933012faf3588384111efc063eaf1 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Fri, 14 Mar 2025 18:17:52 -0400 Subject: [PATCH] chore: remove unused archsystem classes --- src/lib/arch/Arch.h | 3 -- src/lib/arch/CMakeLists.txt | 8 ---- src/lib/arch/IArchSystem.h | 43 ------------------ src/lib/arch/unix/ArchSystemUnix.cpp | 52 --------------------- src/lib/arch/unix/ArchSystemUnix.h | 26 ----------- src/lib/arch/win32/ArchSystemWindows.cpp | 57 ------------------------ src/lib/arch/win32/ArchSystemWindows.h | 25 ----------- 7 files changed, 214 deletions(-) delete mode 100644 src/lib/arch/IArchSystem.h delete mode 100644 src/lib/arch/unix/ArchSystemUnix.cpp delete mode 100644 src/lib/arch/unix/ArchSystemUnix.h delete mode 100644 src/lib/arch/win32/ArchSystemWindows.cpp delete mode 100644 src/lib/arch/win32/ArchSystemWindows.h diff --git a/src/lib/arch/Arch.h b/src/lib/arch/Arch.h index 94a72f558..c8719e16b 100644 --- a/src/lib/arch/Arch.h +++ b/src/lib/arch/Arch.h @@ -36,7 +36,6 @@ #include "arch/win32/ArchNetworkWinsock.h" #include "arch/win32/ArchSleepWindows.h" #include "arch/win32/ArchStringWindows.h" -#include "arch/win32/ArchSystemWindows.h" #include "arch/win32/ArchTimeWindows.h" #elif SYSAPI_UNIX @@ -48,7 +47,6 @@ #include "arch/unix/ArchNetworkBSD.h" #include "arch/unix/ArchSleepUnix.h" #include "arch/unix/ArchStringUnix.h" -#include "arch/unix/ArchSystemUnix.h" #include "arch/unix/ArchTimeUnix.h" #if HAVE_PTHREAD @@ -81,7 +79,6 @@ class Arch : public ARCH_CONSOLE, public ARCH_NETWORK, public ARCH_SLEEP, public ARCH_STRING, - public ARCH_SYSTEM, public ARCH_TIME { public: diff --git a/src/lib/arch/CMakeLists.txt b/src/lib/arch/CMakeLists.txt index f31adcfee..a45f07392 100644 --- a/src/lib/arch/CMakeLists.txt +++ b/src/lib/arch/CMakeLists.txt @@ -24,8 +24,6 @@ if(WIN32) win32/ArchSleepWindows.h win32/ArchStringWindows.cpp win32/ArchStringWindows.h - win32/ArchSystemWindows.cpp - win32/ArchSystemWindows.h win32/ArchTimeWindows.cpp win32/ArchTimeWindows.h win32/XArchWindows.cpp @@ -50,8 +48,6 @@ elseif(UNIX) unix/ArchSleepUnix.h unix/ArchStringUnix.cpp unix/ArchStringUnix.h - unix/ArchSystemUnix.cpp - unix/ArchSystemUnix.h unix/ArchTimeUnix.cpp unix/ArchTimeUnix.h unix/XArchUnix.cpp @@ -75,7 +71,6 @@ add_library(arch STATIC ${PLATFORM_CODE} IArchSleep.h IArchString.cpp IArchString.h - IArchSystem.h IArchTime.h multibyte.h XArch.h @@ -83,7 +78,4 @@ add_library(arch STATIC ${PLATFORM_CODE} if(UNIX) target_link_libraries(arch ${libs}) - if(NOT APPLE) - target_link_libraries(arch Qt6::DBus) - endif() endif() diff --git a/src/lib/arch/IArchSystem.h b/src/lib/arch/IArchSystem.h deleted file mode 100644 index ee283d009..000000000 --- a/src/lib/arch/IArchSystem.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd. - * SPDX-FileCopyrightText: (C) 2004 Chris Schoeneman - * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception - */ - -#pragma once - -#include "common/IInterface.h" -#include - -//! Interface for architecture dependent system queries -/*! -This interface defines operations for querying system info. -*/ -class IArchSystem : public IInterface -{ -public: - //! @name accessors - //@{ - - //! Get a Deskflow setting - /*! - Reads a Deskflow setting from the system. - */ - virtual std::string setting(const std::string &valueName) const = 0; - //@} - - //! Set a Deskflow setting - /*! - Writes a Deskflow setting from the system. - */ - virtual void setting(const std::string &valueName, const std::string &valueString) const = 0; - //@} - - //! Delete settings - /*! - Deletes all Core settings from the system. - */ - virtual void clearSettings() const = 0; - //@} -}; diff --git a/src/lib/arch/unix/ArchSystemUnix.cpp b/src/lib/arch/unix/ArchSystemUnix.cpp deleted file mode 100644 index 9b16eb95e..000000000 --- a/src/lib/arch/unix/ArchSystemUnix.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd. - * SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman - * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception - */ - -#include "arch/unix/ArchSystemUnix.h" -#include - -#include -#include - -#ifndef __APPLE__ -#include -#include -#include -#include -#endif - -// -// ArchSystemUnix -// - -ArchSystemUnix::ArchSystemUnix() -{ - // do nothing -} - -ArchSystemUnix::~ArchSystemUnix() -{ - // do nothing -} - -std::string ArchSystemUnix::setting(const std::string &) const -{ - return ""; -} - -void ArchSystemUnix::setting(const std::string &, const std::string &) const -{ -} - -void ArchSystemUnix::clearSettings() const -{ - // Not implemented -} - -std::string ArchSystemUnix::getLibsUsed(void) const -{ - return "not implemented.\nuse lsof on shell"; -} diff --git a/src/lib/arch/unix/ArchSystemUnix.h b/src/lib/arch/unix/ArchSystemUnix.h deleted file mode 100644 index bf56cb352..000000000 --- a/src/lib/arch/unix/ArchSystemUnix.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * 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 "arch/IArchSystem.h" - -#define ARCH_SYSTEM ArchSystemUnix - -//! Unix implementation of IArchString -class ArchSystemUnix : public IArchSystem -{ -public: - ArchSystemUnix(); - virtual ~ArchSystemUnix(); - - // IArchSystem overrides - virtual std::string setting(const std::string &) const; - virtual void setting(const std::string &, const std::string &) const; - virtual std::string getLibsUsed(void) const; - virtual void clearSettings() const; -}; diff --git a/src/lib/arch/win32/ArchSystemWindows.cpp b/src/lib/arch/win32/ArchSystemWindows.cpp deleted file mode 100644 index a66e4fb93..000000000 --- a/src/lib/arch/win32/ArchSystemWindows.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd. - * SPDX-FileCopyrightText: (C) 2004 Chris Schoeneman - * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception - */ - -#include "arch/win32/ArchSystemWindows.h" -#include "arch/win32/ArchMiscWindows.h" - -#include "arch/XArch.h" -#include "base/Log.h" -#include "common/constants.h" - -#include "tchar.h" -#include - -#include -#include - -static const TCHAR *s_settingsKeyNames[] = {_T("SOFTWARE"), _T(kAppName), NULL}; - -// -// ArchSystemWindows -// - -ArchSystemWindows::ArchSystemWindows() -{ - // do nothing -} - -ArchSystemWindows::~ArchSystemWindows() -{ - // do nothing -} - -std::string ArchSystemWindows::setting(const std::string &valueName) const -{ - HKEY key = ArchMiscWindows::openKey(HKEY_LOCAL_MACHINE, s_settingsKeyNames); - if (key == NULL) - return ""; - - return ArchMiscWindows::readValueString(key, valueName.c_str()); -} - -void ArchSystemWindows::setting(const std::string &valueName, const std::string &valueString) const -{ - HKEY key = ArchMiscWindows::addKey(HKEY_LOCAL_MACHINE, s_settingsKeyNames); - if (key == NULL) - throw XArch(std::string("could not access registry key: ") + valueName); - ArchMiscWindows::setValue(key, valueName.c_str(), valueString.c_str()); -} - -void ArchSystemWindows::clearSettings() const -{ - ArchMiscWindows::deleteKeyTree(HKEY_LOCAL_MACHINE, kWindowsRegistryKey); -} diff --git a/src/lib/arch/win32/ArchSystemWindows.h b/src/lib/arch/win32/ArchSystemWindows.h deleted file mode 100644 index 9c91671f9..000000000 --- a/src/lib/arch/win32/ArchSystemWindows.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd. - * SPDX-FileCopyrightText: (C) 2004 Chris Schoeneman - * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception - */ - -#pragma once - -#include "arch/IArchSystem.h" - -#define ARCH_SYSTEM ArchSystemWindows - -//! Win32 implementation of IArchString -class ArchSystemWindows : public IArchSystem -{ -public: - ArchSystemWindows(); - virtual ~ArchSystemWindows(); - - // IArchSystem overrides - virtual std::string setting(const std::string &valueName) const; - virtual void setting(const std::string &valueName, const std::string &valueString) const; - virtual void clearSettings() const; -};