Skip to content

Commit

Permalink
fix(tray): fix warning around converting a string constant
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Dec 31, 2023
1 parent a6ffeb4 commit 8ab46af
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/system_tray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ using namespace std::literals;

// system_tray namespace
namespace system_tray {
static char tooltipText[] = "Sunshine";

/**
* @brief Callback for opening the UI from the system tray.
Expand Down Expand Up @@ -126,9 +127,7 @@ namespace system_tray {
// Tray menu
static struct tray tray = {
.icon = TRAY_ICON,
#if defined(_WIN32)
.tooltip = const_cast<char *>("Sunshine"), // cast the string literal to a non-const char* pointer
#endif
.tooltip = tooltipText,
.menu =
(struct tray_menu[]) {
// todo - use boost/locale to translate menu strings
Expand Down Expand Up @@ -340,7 +339,7 @@ namespace system_tray {
tray.notification_icon = TRAY_ICON;
tray.notification_title = "Application Stopped";
tray.notification_text = msg;
tray.tooltip = "Sunshine";
tray.tooltip = tooltipText;
tray_update(&tray);
}

Expand All @@ -359,7 +358,7 @@ namespace system_tray {
tray.notification_title = "Incoming Pairing Request";
tray.notification_text = "Click here to complete the pairing process";
tray.notification_icon = TRAY_ICON_LOCKED;
tray.tooltip = "Sunshine";
tray.tooltip = tooltipText;
tray.notification_cb = []() {
launch_ui_with_path("/pin");
};
Expand Down

0 comments on commit 8ab46af

Please sign in to comment.