diff --git a/cmake/Definitions.cmake b/cmake/Definitions.cmake index 7dd2b8779..a9d4f8e72 100644 --- a/cmake/Definitions.cmake +++ b/cmake/Definitions.cmake @@ -54,10 +54,6 @@ endmacro() macro(configure_meta) - set(DESKFLOW_APP_NAME - "Deskflow" - CACHE STRING "App name (used in GUI title bar, etc)") - set(DESKFLOW_AUTHOR_NAME "Deskflow" CACHE STRING "Author name (also used as organization name)") @@ -90,7 +86,6 @@ macro(configure_meta) true CACHE BOOL "Show developer thanks message") - message(VERBOSE "App name: ${DESKFLOW_APP_NAME}") message(VERBOSE "Author name: ${DESKFLOW_AUTHOR_NAME}") message(VERBOSE "Maintainer: ${DESKFLOW_MAINTAINER}") message(VERBOSE "Website URL: ${DESKFLOW_WEBSITE_URL}") @@ -101,7 +96,6 @@ macro(configure_meta) message(VERBOSE "Show dev thanks: ${DESKFLOW_SHOW_DEV_THANKS}") # TODO: We need to move this to configure_file() in the future, which is much cleaner. - add_definitions(-DDESKFLOW_APP_NAME="${DESKFLOW_APP_NAME}") add_definitions(-DDESKFLOW_AUTHOR_NAME="${DESKFLOW_AUTHOR_NAME}") add_definitions(-DDESKFLOW_MAINTAINER="${DESKFLOW_MAINTAINER}") add_definitions(-DDESKFLOW_WEBSITE_URL="${DESKFLOW_WEBSITE_URL}") diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index 3254d4a7d..8493341f7 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -85,7 +85,7 @@ macro(configure_mac_packaging) set(DESKFLOW_BUNDLE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/deploy/dist/mac/bundle CACHE PATH "Path to the macOS app bundle") - set(DESKFLOW_BUNDLE_DIR ${PROJECT_BINARY_DIR}/bundle/${DESKFLOW_APP_NAME}.app) + set(DESKFLOW_BUNDLE_DIR ${PROJECT_BINARY_DIR}/bundle/Deskflow.app) set(DESKFLOW_BUNDLE_BINARY_DIR ${DESKFLOW_BUNDLE_DIR}/Contents/MacOS) configure_files(${DESKFLOW_BUNDLE_SOURCE_DIR} ${DESKFLOW_BUNDLE_DIR}) diff --git a/deploy/dist/mac/bundle/Contents/Info.plist.in b/deploy/dist/mac/bundle/Contents/Info.plist.in index e25e88bb2..a2f202805 100644 --- a/deploy/dist/mac/bundle/Contents/Info.plist.in +++ b/deploy/dist/mac/bundle/Contents/Info.plist.in @@ -4,17 +4,17 @@ CFBundleDevelopmentRegion English CFBundleDisplayName - @DESKFLOW_APP_NAME@ + Deskflow CFBundleExecutable deskflow CFBundleIconFile - @DESKFLOW_APP_NAME@.icns + Deskflow.icns CFBundleIdentifier org.deskflow.deskflow CFBundleInfoDictionaryVersion 6.0 CFBundleName - @DESKFLOW_APP_NAME@ + Deskflow CFBundlePackageType APPL CFBundleSignature diff --git a/deploy/dist/wix/Include.wxi.in b/deploy/dist/wix/Include.wxi.in index 467f9ab66..874669f87 100644 --- a/deploy/dist/wix/Include.wxi.in +++ b/deploy/dist/wix/Include.wxi.in @@ -1,7 +1,7 @@ - + diff --git a/deploy/version.rc.in b/deploy/version.rc.in index 9c46c631a..a88298227 100644 --- a/deploy/version.rc.in +++ b/deploy/version.rc.in @@ -13,13 +13,13 @@ https://learn.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource?redi #define VER_PRODUCTVERSION_STR "@DESKFLOW_VERSION@\0" #define VER_COMPANYNAME_STR "@DESKFLOW_AUTHOR_NAME@\0" -#define VER_FILEDESCRIPTION_STR "@DESKFLOW_APP_NAME@\0" -#define VER_INTERNALNAME_STR "@DESKFLOW_APP_NAME@\0" +#define VER_FILEDESCRIPTION_STR "Deskflow\0" +#define VER_INTERNALNAME_STR "Deskflow\0" #define VER_LEGALCOPYRIGHT_STR "© 2024 Deskflow Developers\0" #define VER_LEGALTRADEMARKS1_STR "All Rights Reserved\0" #define VER_LEGALTRADEMARKS2_STR "\0" #define VER_ORIGINALFILENAME_STR "\0" -#define VER_PRODUCTNAME_STR "@DESKFLOW_APP_NAME@\0" +#define VER_PRODUCTNAME_STR "Deskflow\0" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION diff --git a/src/gui/src/SetupWizard.cpp b/src/gui/src/SetupWizard.cpp index 3c52301b0..3177b7aa6 100644 --- a/src/gui/src/SetupWizard.cpp +++ b/src/gui/src/SetupWizard.cpp @@ -12,6 +12,7 @@ #include #include +#include "common/constants.h" #include "gui/config/AppConfig.h" #include "gui/styles.h" #include "gui/validators/ScreenNameValidator.h" @@ -23,7 +24,7 @@ SetupWizard::SetupWizard(AppConfig &appConfig) m_lineName{new QLineEdit(this)}, m_btnApply{new QPushButton(tr("Continue"), this)} { - setWindowTitle(tr("Setup %1").arg(DESKFLOW_APP_NAME)); + setWindowTitle(tr("Setup %1").arg(kAppName)); setFixedSize(740, 550); diff --git a/src/gui/src/dialogs/ServerConfigDialog.cpp b/src/gui/src/dialogs/ServerConfigDialog.cpp index 469b215aa..5cc48dfa6 100644 --- a/src/gui/src/dialogs/ServerConfigDialog.cpp +++ b/src/gui/src/dialogs/ServerConfigDialog.cpp @@ -19,6 +19,7 @@ #include "ServerConfigDialog.h" #include "ui_ServerConfigDialog.h" +#include "common/constants.h" #include "dialogs/ActionDialog.h" #include "dialogs/HotkeyDialog.h" #include "dialogs/ScreenSettingsDialog.h" @@ -447,12 +448,14 @@ void ServerConfigDialog::on_m_pCheckBoxUseExternalConfig_toggled(bool checked) bool ServerConfigDialog::on_m_pButtonBrowseConfigFile_clicked() { #if defined(Q_OS_WIN) - const QString deskflowConfigFilter(QString("%1 Configurations (*.sgc);;All files (*.*)").arg(DESKFLOW_APP_NAME)); + static const auto configExt = QStringLiteral("sgc"); #else - const QString deskflowConfigFilter(QString("%1 Configurations (*.conf);;All files (*.*)").arg(DESKFLOW_APP_NAME)); + static const auto configExt = QStringLiteral("conf"); #endif + static const auto deskflowConfigFilter = QStringLiteral("%1 Configurations (*.%2);;All files (*.*)"); - QString fileName = QFileDialog::getOpenFileName(this, "Browse for a config file", "", deskflowConfigFilter); + QString fileName = + QFileDialog::getOpenFileName(this, "Browse for a config file", "", deskflowConfigFilter.arg(kAppName, configExt)); if (!fileName.isEmpty()) { ui->m_pEditConfigFile->setText(fileName); diff --git a/src/gui/src/main.cpp b/src/gui/src/main.cpp index 695fe8423..7f7f367ea 100644 --- a/src/gui/src/main.cpp +++ b/src/gui/src/main.cpp @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) qInstallMessageHandler(deskflow::gui::messages::messageHandler); QString version = QString::fromStdString(deskflow::version()); - qInfo(DESKFLOW_APP_NAME " v%s", qPrintable(version)); + qInfo("%s v%s", kAppName, qPrintable(version)); dotenv(); Logger::instance().loadEnvVars(); @@ -101,11 +101,9 @@ int main(int argc, char *argv[]) #if defined(Q_OS_MAC) if (app.applicationDirPath().startsWith("/Volumes/")) { - QMessageBox::information( - NULL, DESKFLOW_APP_NAME, - "Please drag " DESKFLOW_APP_NAME " to the Applications folder, " - "and open it from there." - ); + QString msgBody = QStringLiteral("Please drag %1 to the Applications folder, " + "and open it from there."); + QMessageBox::information(NULL, kAppName, msgBody.arg(kAppName)); return 1; } @@ -179,12 +177,10 @@ bool checkMacAssistiveDevices() // now deprecated in mavericks. bool result = AXAPIEnabled(); if (!result) { - QMessageBox::information( - NULL, DESKFLOW_APP_NAME, - "Please enable access to assistive devices " - "System Preferences -> Security & Privacy -> " - "Privacy -> Accessibility, then re-open " DESKFLOW_APP_NAME "." - ); + QString msgBody = QString("Please enable access to assistive devices " + "System Preferences -> Security & Privacy -> " + "Privacy -> Accessibility, then re-open %1."); + QMessageBox::information(NULL, kAppName, msgBody.arg(kAppName)); } return result; diff --git a/src/lib/arch/unix/ArchFileUnix.cpp b/src/lib/arch/unix/ArchFileUnix.cpp index 652704229..0f04336e0 100644 --- a/src/lib/arch/unix/ArchFileUnix.cpp +++ b/src/lib/arch/unix/ArchFileUnix.cpp @@ -18,6 +18,7 @@ #include "arch/unix/ArchFileUnix.h" +#include "common/constants.h" #include #include #include @@ -90,7 +91,9 @@ std::string ArchFileUnix::getInstalledDirectory() #if WINAPI_XWINDOWS return "/usr/bin"; #else - return "/Applications/" DESKFLOW_APP_NAME ".app/Contents/MacOS"; + std::string rtn = "/Applications/"; + rtn.append(kAppName).append(".app/Contents/MacOS"); + return rtn; #endif } @@ -121,12 +124,12 @@ std::string ArchFileUnix::getProfileDirectory() #if WINAPI_XWINDOWS const auto xdgDir = std::getenv("XDG_CONFIG_HOME"); if (xdgDir != nullptr) { - return std::filesystem::path(xdgDir) / DESKFLOW_APP_NAME; + return std::filesystem::path(xdgDir) / kAppName; } else { - return homeDir / ".config" / DESKFLOW_APP_NAME; + return homeDir / ".config" / kAppName; } #else - return homeDir / "Library" / DESKFLOW_APP_NAME; + return homeDir / "Library" / kAppName; #endif } } diff --git a/src/lib/arch/unix/ArchSystemUnix.cpp b/src/lib/arch/unix/ArchSystemUnix.cpp index bb607866a..b86608e64 100644 --- a/src/lib/arch/unix/ArchSystemUnix.cpp +++ b/src/lib/arch/unix/ArchSystemUnix.cpp @@ -19,6 +19,7 @@ #include "arch/unix/ArchSystemUnix.h" #include +#include #include #ifndef __APPLE__ @@ -112,9 +113,8 @@ bool ArchSystemUnix::DBusInhibitScreenCall(InhibitScreenServices serviceID, bool return false; } - reply = screenSaverInterface.call( - "Inhibit", DESKFLOW_APP_NAME, "Sleep is manually prevented by the " DESKFLOW_APP_NAME " preferences" - ); + QString msg = "Sleep is manually prevented by the %1 preferences"; + reply = screenSaverInterface.call("Inhibit", kAppName, msg.arg(kAppName)); if (reply.isValid()) cookies[serviceNum] = reply.value(); } else { diff --git a/src/lib/arch/win32/ArchDaemonWindows.h b/src/lib/arch/win32/ArchDaemonWindows.h index 0e6f11a7c..ed95191b7 100644 --- a/src/lib/arch/win32/ArchDaemonWindows.h +++ b/src/lib/arch/win32/ArchDaemonWindows.h @@ -20,6 +20,7 @@ #include "arch/IArchDaemon.h" #include "arch/IArchMultithread.h" +#include "common/constants.h" #include "common/stdstring.h" #define WIN32_LEAN_AND_MEAN @@ -144,8 +145,8 @@ private: std::string m_commandLine; }; -#define DEFAULT_DAEMON_NAME _T(DESKFLOW_APP_NAME) -#define DEFAULT_DAEMON_INFO _T("Manages the " DESKFLOW_APP_NAME " foreground processes.") +#define DEFAULT_DAEMON_NAME _T(kAppName) +#define DEFAULT_DAEMON_INFO _T("Manages the Deskflow foreground processes.") -#define LEGACY_SERVER_DAEMON_NAME _T(DESKFLOW_APP_NAME " Server") -#define LEGACY_CLIENT_DAEMON_NAME _T(DESKFLOW_APP_NAME " Client") +#define LEGACY_SERVER_DAEMON_NAME _T("Deskflow Server") +#define LEGACY_CLIENT_DAEMON_NAME _T("Deskflow Client") diff --git a/src/lib/arch/win32/ArchFileWindows.cpp b/src/lib/arch/win32/ArchFileWindows.cpp index 1cf59ca96..fef30154b 100644 --- a/src/lib/arch/win32/ArchFileWindows.cpp +++ b/src/lib/arch/win32/ArchFileWindows.cpp @@ -156,7 +156,7 @@ std::string ArchFileWindows::getProfileDirectory() } // HACK: append program name, this seems wrong. - dir.append("\\" DESKFLOW_APP_NAME); + dir.append("\\Deskflow"); return dir; } diff --git a/src/lib/arch/win32/ArchSystemWindows.cpp b/src/lib/arch/win32/ArchSystemWindows.cpp index 0be455c4c..63c9d7f4c 100644 --- a/src/lib/arch/win32/ArchSystemWindows.cpp +++ b/src/lib/arch/win32/ArchSystemWindows.cpp @@ -20,6 +20,7 @@ #include "arch/win32/ArchMiscWindows.h" #include "arch/XArch.h" +#include "common/constants.h" #include "tchar.h" #include @@ -27,7 +28,7 @@ #include #include -static const char *s_settingsKeyNames[] = {_T("SOFTWARE"), _T(DESKFLOW_APP_NAME), NULL}; +static const char *s_settingsKeyNames[] = {_T("SOFTWARE"), _T(kAppName), NULL}; // // ArchSystemWindows diff --git a/src/lib/common/constants.h b/src/lib/common/constants.h index 127a7c6b0..eefce2826 100644 --- a/src/lib/common/constants.h +++ b/src/lib/common/constants.h @@ -22,7 +22,7 @@ #error version was not passed to the compiler #endif -const auto kAppName = DESKFLOW_APP_NAME; +const auto kAppName = "Deskflow"; const auto kAppId = "deskflow"; const auto kAppDescription = "Mouse and keyboard sharing utility"; const auto kVersion = DESKFLOW_VERSION; diff --git a/src/lib/deskflow/ClientApp.cpp b/src/lib/deskflow/ClientApp.cpp index bb7bb5871..93f518450 100644 --- a/src/lib/deskflow/ClientApp.cpp +++ b/src/lib/deskflow/ClientApp.cpp @@ -26,6 +26,7 @@ #include "base/String.h" #include "base/TMethodEventJob.h" #include "client/Client.h" +#include "common/constants.h" #include "deskflow/ArgParser.h" #include "deskflow/ClientArgs.h" #include "deskflow/Screen.h" @@ -134,7 +135,7 @@ void ClientApp::help() #endif << HELP_SYS_ARGS << HELP_COMMON_ARGS << " " << "\n\n" - << "Connect to a " DESKFLOW_APP_NAME " mouse/keyboard sharing server.\n" + << "Connect to a " << kAppName << " mouse/keyboard sharing server.\n" << "\n" << " -a, --address
local network interface address.\n" << HELP_COMMON_INFO_1 << HELP_SYS_INFO << " --yscroll defines the vertical scrolling delta,\n" @@ -165,7 +166,7 @@ void ClientApp::help() const char *ClientApp::daemonName() const { #if SYSAPI_WIN32 - return DESKFLOW_APP_NAME " Client"; + return "Deskflow Client"; #elif SYSAPI_UNIX return CLIENT_BINARY_NAME; #endif diff --git a/src/lib/deskflow/DaemonApp.cpp b/src/lib/deskflow/DaemonApp.cpp index d9af19f96..6500ef22a 100644 --- a/src/lib/deskflow/DaemonApp.cpp +++ b/src/lib/deskflow/DaemonApp.cpp @@ -25,6 +25,7 @@ #include "base/Log.h" #include "base/TMethodEventJob.h" #include "base/log_outputters.h" +#include "common/constants.h" #include "common/ipc.h" #include "deskflow/App.h" #include "deskflow/ArgParser.h" @@ -178,10 +179,10 @@ int DaemonApp::run(int argc, char **argv) } else { #if SYSAPI_WIN32 LOG((CLOG_PRINT "daemonizing windows service")); - arch.daemonize(DESKFLOW_APP_NAME, winMainLoopStatic); + arch.daemonize(kAppName, winMainLoopStatic); #elif SYSAPI_UNIX LOG((CLOG_PRINT "daemonizing unix service")); - arch.daemonize(DESKFLOW_APP_NAME, unixMainLoopStatic); + arch.daemonize(kAppName, unixMainLoopStatic); #endif } diff --git a/src/lib/deskflow/ServerApp.cpp b/src/lib/deskflow/ServerApp.cpp index bb3782f54..126b011d8 100644 --- a/src/lib/deskflow/ServerApp.cpp +++ b/src/lib/deskflow/ServerApp.cpp @@ -23,6 +23,7 @@ #include "base/Log.h" #include "base/Path.h" #include "base/TMethodEventJob.h" +#include "common/constants.h" #include "deskflow/App.h" #include "deskflow/ArgParser.h" #include "deskflow/Screen.h" @@ -123,8 +124,8 @@ void ServerApp::parseArgs(int argc, const char *const *argv) void ServerApp::help() { - const auto userConfig = ARCH->concatPath(ARCH->getUserDirectory(), USER_CONFIG_NAME); - const auto sysConfig = ARCH->concatPath(ARCH->getSystemDirectory(), SYSTEM_CONFIG_NAME); + const auto userConfig = ARCH->concatPath(ARCH->getUserDirectory(), CONFIG_NAME); + const auto sysConfig = ARCH->concatPath(ARCH->getSystemDirectory(), CONFIG_NAME); std::stringstream help; help << "Usage: " << args().m_pname @@ -141,7 +142,7 @@ void ServerApp::help() #endif << HELP_SYS_ARGS HELP_COMMON_ARGS "\n\n" - << "Start the " DESKFLOW_APP_NAME " mouse/keyboard sharing server.\n" + << "Start the " << kAppName << " mouse/keyboard sharing server.\n" << "\n" << " -a, --address
listen for clients on the given address.\n" << " -c, --config use the named configuration file " @@ -208,7 +209,7 @@ void ServerApp::loadConfig() path = ARCH->getUserDirectory(); if (!path.empty()) { // complete path - path = ARCH->concatPath(path, USER_CONFIG_NAME); + path = ARCH->concatPath(path, CONFIG_NAME); // now try loading the user's configuration if (loadConfig(path)) { @@ -220,7 +221,7 @@ void ServerApp::loadConfig() // try the system-wide config file path = ARCH->getSystemDirectory(); if (!path.empty()) { - path = ARCH->concatPath(path, SYSTEM_CONFIG_NAME); + path = ARCH->concatPath(path, CONFIG_NAME); if (loadConfig(path)) { loaded = true; args().m_configFile = path; @@ -844,7 +845,7 @@ int ServerApp::foregroundStartup(int argc, char **argv) const char *ServerApp::daemonName() const { #if SYSAPI_WIN32 - return DESKFLOW_APP_NAME " Server"; + return "Deskflow Server"; #elif SYSAPI_UNIX return SERVER_BINARY_NAME; #endif diff --git a/src/lib/deskflow/ServerApp.h b/src/lib/deskflow/ServerApp.h index 979126568..8ef031928 100644 --- a/src/lib/deskflow/ServerApp.h +++ b/src/lib/deskflow/ServerApp.h @@ -145,13 +145,9 @@ private: ClientListener *m_listener; EventQueueTimer *m_timer; NetworkAddress *m_deskflowAddress; -}; - -// configuration file name #if SYSAPI_WIN32 -#define USER_CONFIG_NAME "deskflow.sgc" -#define SYSTEM_CONFIG_NAME "deskflow.sgc" + inline static const std::string CONFIG_NAME = "%s.sgc", kAppName; #elif SYSAPI_UNIX -#define USER_CONFIG_NAME ".deskflow.conf" -#define SYSTEM_CONFIG_NAME "deskflow.conf" + inline static const std::string CONFIG_NAME = "%s.conf", kAppName; #endif +}; diff --git a/src/lib/deskflow/unix/AppUtilUnix.cpp b/src/lib/deskflow/unix/AppUtilUnix.cpp index 80bdcba03..fac1b6ea8 100644 --- a/src/lib/deskflow/unix/AppUtilUnix.cpp +++ b/src/lib/deskflow/unix/AppUtilUnix.cpp @@ -31,6 +31,7 @@ #endif #include "base/Log.h" #include "base/log_outputters.h" +#include "common/constants.h" #if HAVE_LIBNOTIFY #include @@ -168,7 +169,7 @@ void AppUtilUnix::showNotification(const String &title, const String &text) cons { #if HAVE_LIBNOTIFY LOG((CLOG_INFO "showing notification, title=\"%s\", text=\"%s\"", title.c_str(), text.c_str())); - if (!notify_init(DESKFLOW_APP_NAME)) { + if (!notify_init(kAppName)) { LOG((CLOG_INFO "failed to initialize libnotify")); return; } diff --git a/src/lib/deskflow/win32/AppUtilWindows.cpp b/src/lib/deskflow/win32/AppUtilWindows.cpp index fe668d626..f2c4a9690 100644 --- a/src/lib/deskflow/win32/AppUtilWindows.cpp +++ b/src/lib/deskflow/win32/AppUtilWindows.cpp @@ -252,9 +252,15 @@ void AppUtilWindows::showNotification(const String &title, const String &text) c return; } if (!WinToastLib::WinToast::instance()->isInitialized()) { - WinToastLib::WinToast::instance()->setAppName(L"" DESKFLOW_APP_NAME); + WinToastLib::WinToast::instance()->setAppName(L"" + "Deskflow"); const auto aumi = WinToastLib::WinToast::configureAUMI( - L"" DESKFLOW_AUTHOR_NAME, L"" DESKFLOW_APP_NAME, L"" DESKFLOW_APP_NAME, L"1.14.1+" + L"" DESKFLOW_AUTHOR_NAME, + L"" + "Deskflow", + L"" + "Deskflow", + L"1.14.1+" ); WinToastLib::WinToast::instance()->setAppUserModelId(aumi); diff --git a/src/lib/gui/OSXHelpers.mm b/src/lib/gui/OSXHelpers.mm index 04319da87..96dcb4d84 100644 --- a/src/lib/gui/OSXHelpers.mm +++ b/src/lib/gui/OSXHelpers.mm @@ -54,7 +54,7 @@ bool isOSXDevelopmentBuild() { std::string bundleURL = [[[NSBundle mainBundle] bundleURL].absoluteString UTF8String]; - return (bundleURL.find("Applications/" DESKFLOW_APP_NAME ".app") == std::string::npos); + return (bundleURL.find("Applications/Deskflow.app") == std::string::npos); } bool diff --git a/src/lib/gui/VersionChecker.cpp b/src/lib/gui/VersionChecker.cpp index 8b3805873..bc06b341d 100644 --- a/src/lib/gui/VersionChecker.cpp +++ b/src/lib/gui/VersionChecker.cpp @@ -44,8 +44,8 @@ void VersionChecker::checkLatest() const auto request = QNetworkRequest(url); auto userAgent = QString("%1 %2 on %3").arg(kAppName, kVersion, QSysInfo::prettyProductName()); request.setHeader(QNetworkRequest::UserAgentHeader, userAgent); - request.setRawHeader("X-" DESKFLOW_APP_NAME "-Version", kVersion); - request.setRawHeader("X-" DESKFLOW_APP_NAME "-Language", QLocale::system().name().toStdString().c_str()); + request.setRawHeader("X-Deskflow-Version", kVersion); + request.setRawHeader("X-Deskflow-Language", QLocale::system().name().toStdString().c_str()); m_network->get(request); } diff --git a/src/lib/gui/tls/TlsCertificate.cpp b/src/lib/gui/tls/TlsCertificate.cpp index dd2306e05..c927348ee 100644 --- a/src/lib/gui/tls/TlsCertificate.cpp +++ b/src/lib/gui/tls/TlsCertificate.cpp @@ -19,6 +19,8 @@ #include "TlsFingerprint.h" +#include "common/constants.h" + #include #include #include @@ -26,7 +28,6 @@ static const char *const kCertificateKeyLength = "rsa:"; static const char *const kCertificateHashAlgorithm = "-sha256"; static const char *const kCertificateLifetime = "365"; -static const char *const kCertificateSubjectInfo = "/CN=" DESKFLOW_APP_NAME; #if defined(Q_OS_WIN) static const char *const kWinOpenSslDir = "OpenSSL"; @@ -167,8 +168,8 @@ bool TlsCertificate::generateCertificate(const QString &path, int keyLength) // subject information arguments.append("-subj"); - QString subInfo(kCertificateSubjectInfo); - arguments.append(subInfo); + QString subInfo("/CN=%1"); + arguments.append(subInfo.arg(kAppName)); // private key arguments.append("-newkey"); diff --git a/src/lib/platform/MSWindowsClipboard.cpp b/src/lib/platform/MSWindowsClipboard.cpp index f40c2d49e..a4740e576 100644 --- a/src/lib/platform/MSWindowsClipboard.cpp +++ b/src/lib/platform/MSWindowsClipboard.cpp @@ -202,7 +202,7 @@ bool MSWindowsClipboard::isOwnedByDeskflow() { // create ownership format if we haven't yet if (s_ownershipFormat == 0) { - s_ownershipFormat = RegisterClipboardFormat(TEXT(DESKFLOW_APP_NAME "Ownership")); + s_ownershipFormat = RegisterClipboardFormat(TEXT("Deskflow Ownership")); } return (IsClipboardFormatAvailable(getOwnershipFormat()) != 0); } @@ -211,7 +211,7 @@ UINT MSWindowsClipboard::getOwnershipFormat() { // create ownership format if we haven't yet if (s_ownershipFormat == 0) { - s_ownershipFormat = RegisterClipboardFormat(TEXT(DESKFLOW_APP_NAME "Ownership")); + s_ownershipFormat = RegisterClipboardFormat(TEXT("Deskflow Ownership")); } // return the format diff --git a/src/lib/platform/MSWindowsDesks.cpp b/src/lib/platform/MSWindowsDesks.cpp index 4c91ae002..08e4bd4c6 100644 --- a/src/lib/platform/MSWindowsDesks.cpp +++ b/src/lib/platform/MSWindowsDesks.cpp @@ -376,7 +376,7 @@ ATOM MSWindowsDesks::createDeskWindowClass(bool isPrimary) const classInfo.hCursor = m_cursor; classInfo.hbrBackground = NULL; classInfo.lpszMenuName = NULL; - classInfo.lpszClassName = DESKFLOW_APP_NAME "Desk"; + classInfo.lpszClassName = "DeskflowDesk"; classInfo.hIconSm = NULL; return RegisterClassEx(&classInfo); } @@ -592,7 +592,7 @@ void MSWindowsDesks::deskThread(void *vdesk) // create a window. we use this window to hide the cursor. try { - desk->m_window = createWindow(m_deskClass, DESKFLOW_APP_NAME "Desk"); + desk->m_window = createWindow(m_deskClass, "DeskflowDesk"); LOG((CLOG_DEBUG "desk %s window is 0x%08x", desk->m_name.c_str(), desk->m_window)); } catch (...) { // ignore diff --git a/src/lib/platform/MSWindowsScreen.cpp b/src/lib/platform/MSWindowsScreen.cpp index e25dd5a64..e9647fb21 100644 --- a/src/lib/platform/MSWindowsScreen.cpp +++ b/src/lib/platform/MSWindowsScreen.cpp @@ -149,7 +149,7 @@ MSWindowsScreen::MSWindowsScreen( updateScreenShape(); m_class = createWindowClass(); - m_window = createWindow(m_class, DESKFLOW_APP_NAME); + m_window = createWindow(m_class, kAppName); forceShowCursor(); LOG((CLOG_DEBUG "screen shape: %d,%d %dx%d %s", m_x, m_y, m_w, m_h, m_multimon ? "(multi-monitor)" : "")); LOG((CLOG_DEBUG "window is 0x%08x", m_window)); @@ -851,7 +851,7 @@ ATOM MSWindowsScreen::createWindowClass() const classInfo.hCursor = NULL; classInfo.hbrBackground = NULL; classInfo.lpszMenuName = NULL; - classInfo.lpszClassName = DESKFLOW_APP_NAME; + classInfo.lpszClassName = kAppName; classInfo.hIconSm = NULL; return RegisterClassEx(&classInfo); } diff --git a/src/lib/platform/OSXPowerManager.cpp b/src/lib/platform/OSXPowerManager.cpp index 36b46eaca..e0eaaf3b9 100644 --- a/src/lib/platform/OSXPowerManager.cpp +++ b/src/lib/platform/OSXPowerManager.cpp @@ -31,7 +31,7 @@ OSXPowerManager::~OSXPowerManager() void OSXPowerManager::disableSleep() { if (!m_sleepPreventionAssertionID) { - CFStringRef reasonForActivity = CFSTR(DESKFLOW_APP_NAME " application"); + CFStringRef reasonForActivity = CFSTR("Deskflow application"); IOReturn result = IOPMAssertionCreateWithName( kIOPMAssertPreventUserIdleDisplaySleep, kIOPMAssertionLevelOn, reasonForActivity, &m_sleepPreventionAssertionID );