From c05a87b7166894a18616e5cf3e60f1ea3e069a9d Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Tue, 26 Nov 2024 23:01:58 -0500 Subject: [PATCH] refactor: rm src/lib/common/copyright, add to src/lib/common/constants --- src/gui/src/dialogs/AboutDialog.cpp | 3 +-- src/lib/common/CMakeLists.txt | 1 - src/lib/common/constants.h.in | 6 ++++++ src/lib/common/copyright.h | 27 --------------------------- src/lib/deskflow/App.cpp | 3 +-- 5 files changed, 8 insertions(+), 32 deletions(-) delete mode 100644 src/lib/common/copyright.h diff --git a/src/gui/src/dialogs/AboutDialog.cpp b/src/gui/src/dialogs/AboutDialog.cpp index ee4a60add..748241ab8 100644 --- a/src/gui/src/dialogs/AboutDialog.cpp +++ b/src/gui/src/dialogs/AboutDialog.cpp @@ -20,7 +20,6 @@ #include "AboutDialog.h" #include "common/constants.h" -#include "common/copyright.h" #include "gui/style_utils.h" #include @@ -55,7 +54,7 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent) auto lblLogo = new QLabel(this); lblLogo->setPixmap(deskflow::gui::isDarkMode() ? s_darkLogo : s_lightLogo); - auto lblCopyright = new QLabel(QString::fromStdString(deskflow::kCopyright)); + auto lblCopyright = new QLabel(kCopyright, this); auto boldFont = font(); boldFont.setBold(true); diff --git a/src/lib/common/CMakeLists.txt b/src/lib/common/CMakeLists.txt index d521ef02f..0efa646ac 100644 --- a/src/lib/common/CMakeLists.txt +++ b/src/lib/common/CMakeLists.txt @@ -8,7 +8,6 @@ configure_file(constants.h.in constants.h @ONLY) add_library(common INTERFACE basic_types.h common.h - copyright.h IInterface.h ipc.h stdbitset.h diff --git a/src/lib/common/constants.h.in b/src/lib/common/constants.h.in index cdf773156..486f9d9a0 100644 --- a/src/lib/common/constants.h.in +++ b/src/lib/common/constants.h.in @@ -12,6 +12,12 @@ const auto kAppDescription = "@CMAKE_PROJECT_DESCRIPTION@"; const auto kVersion = "@CMAKE_PROJECT_VERSION@"; const auto kVersionGitSha = "@GIT_SHA_SHORT@"; +const auto kCopyright = // + "Copyright (C) 2024 Deskflow Developers\n" + "Copyright (C) 2012-2024 Symless Ltd.\n" + "Copyright (C) 2009-2012 Nick Bolton\n" + "Copyright (C) 2002-2009 Chris Schoeneman"; + #ifndef NDEBUG const auto kDebugBuild = true; #else diff --git a/src/lib/common/copyright.h b/src/lib/common/copyright.h deleted file mode 100644 index 6ae10d2fb..000000000 --- a/src/lib/common/copyright.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * Copyright (C) 2024 Symless Ltd. - * - * This package is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * found in the file LICENSE that should have accompanied this file. - * - * This package is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -namespace deskflow { - -const auto kCopyright = // - "Copyright (C) 2024 Deskflow Developers\n" - "Copyright (C) 2012-2024 Symless Ltd.\n" - "Copyright (C) 2009-2012 Nick Bolton\n" - "Copyright (C) 2002-2009 Chris Schoeneman"; -} // namespace deskflow diff --git a/src/lib/deskflow/App.cpp b/src/lib/deskflow/App.cpp index 1e284417a..eef004368 100644 --- a/src/lib/deskflow/App.cpp +++ b/src/lib/deskflow/App.cpp @@ -27,7 +27,6 @@ #include "base/XBase.h" #include "base/log_outputters.h" #include "common/constants.h" -#include "common/copyright.h" #include "common/ipc.h" #include "deskflow/ArgsBase.h" #include "deskflow/Config.h" @@ -96,7 +95,7 @@ void App::version() std::vector buffer(kBufferLength); std::snprintf( // NOSONAR buffer.data(), kBufferLength, "%s v%s, protocol v%d.%d\n%s", // - argsBase().m_pname, kVersion, kProtocolMajorVersion, kProtocolMinorVersion, deskflow::kCopyright + argsBase().m_pname, kVersion, kProtocolMajorVersion, kProtocolMinorVersion, kCopyright ); std::cout << std::string(buffer.data()) << std::endl;