Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tray): use PROJECT_NAME definition for tooltip #1958

Conversation

ReenigneArcher
Copy link
Member

@ReenigneArcher ReenigneArcher commented Dec 31, 2023

Description

  • Use common variable for tray tooltip assignment, using PROJECT_NAME definition.
  • Two warnings are generated during build due to converting a string constant to char* fixed in Constify tooltip string pointer tray#8.
#18 57.17 /build/sunshine/src/system_tray.cpp: In function 'void system_tray::update_tray_stopped(std::string)':
#18 57.17 /build/sunshine/src/system_tray.cpp:343:20: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
#18 57.17   343 |     tray.tooltip = "Sunshine";
#18 57.17       |                    ^~~~~~~~~~
#18 57.17 /build/sunshine/src/system_tray.cpp: In function 'void system_tray::update_tray_require_pin()':
#18 57.17 /build/sunshine/src/system_tray.cpp:362:20: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
#18 57.17   362 |     tray.tooltip = "Sunshine";
#18 57.17       |                    ^~~~~~~~~~

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

@ReenigneArcher ReenigneArcher force-pushed the fix(tray)-fix-warning-around-converting-a-string-constant branch 2 times, most recently from 8ab46af to b2b7af3 Compare December 31, 2023 19:41
@cgutman
Copy link
Collaborator

cgutman commented Dec 31, 2023

I think we should fix this on the tray side by making that field a const char*. I'm going to upstream a PR to do that.

@cgutman
Copy link
Collaborator

cgutman commented Dec 31, 2023

dmikushin/tray#15

@ReenigneArcher
Copy link
Member Author

Can you make a PR against our fork as well? https://github.com/LizardByte/tray

I'm not sure how far we've diverged from upstream, but would be nice to get it all in upstream.

@ReenigneArcher ReenigneArcher changed the title fix(tray): fix warning around converting a string constant fix(tray): use PROJECT_NAME definition for tooltip Dec 31, 2023
src/system_tray.cpp Outdated Show resolved Hide resolved
@ReenigneArcher ReenigneArcher force-pushed the fix(tray)-fix-warning-around-converting-a-string-constant branch 2 times, most recently from 9e55ee4 to 0969b0a Compare December 31, 2023 20:35
@ReenigneArcher ReenigneArcher marked this pull request as ready for review December 31, 2023 20:35
@ReenigneArcher ReenigneArcher force-pushed the fix(tray)-fix-warning-around-converting-a-string-constant branch from 0969b0a to c7ff199 Compare December 31, 2023 20:58
@ReenigneArcher ReenigneArcher merged commit fe3bf0e into nightly Dec 31, 2023
42 checks passed
@ReenigneArcher ReenigneArcher deleted the fix(tray)-fix-warning-around-converting-a-string-constant branch December 31, 2023 21:34
KuleRucket pushed a commit to KuleRucket/Sunshine that referenced this pull request Jun 6, 2024
e-dong pushed a commit to e-dong/Sunshine that referenced this pull request Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants