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

Remove unused pointer to DisplayApp member variables #2125

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

NeroBurner
Copy link
Contributor

@NeroBurner NeroBurner commented Sep 18, 2024

In the screens that use DisplayApp *app and pass it to a child item, or use the reference just in the constructor. Afterwards the app member is not used. So remove it from the private member variables.

SettingDisplay.h actually never uses DisplayApp *app and the parameter could be removed from the constructor. I'd be happy about feedback whether or not to remove it.
Completely remove app parameter from SettingDisplay constructor as it is unused.

@NeroBurner NeroBurner added the maintenance Background work label Sep 18, 2024
Copy link

github-actions bot commented Sep 18, 2024

Build size and comparison to main:

Section Size Difference
text 374136B -48B
data 948B 0B
bss 63480B 0B

@NeroBurner
Copy link
Contributor Author

build error because of unused variable, removing app from constructor

 /__w/InfiniTime/InfiniTime/src/displayapp/screens/settings/SettingDisplay.cpp:27:68: error: unused parameter 'app' [-Werror=unused-parameter]
   27 | SettingDisplay::SettingDisplay(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController)
      |                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
cc1plus: all warnings being treated as errors

In the screens that use `DisplayApp *app` and pass it to a child item,
or use the reference just in the constructor. Afterwards the `app`
member is not used. So remove it from the private member variables.

Completely remove `app` parameter from `SettingDisplay` constructor as
it is unused.
@NeroBurner NeroBurner requested a review from a team September 18, 2024 19:21
@NeroBurner NeroBurner added this to the 1.15.0 milestone Sep 19, 2024
Copy link
Member

@FintasticMan FintasticMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@NeroBurner NeroBurner merged commit 3db4e01 into main Sep 29, 2024
7 checks passed
@NeroBurner NeroBurner deleted the remove_unused_app_member branch September 29, 2024 17:39
headblockhead added a commit to headblockhead/InfiniTime that referenced this pull request Oct 4, 2024
* Remove unused pointer to DisplayApp member variables (InfiniTimeOrg#2125)

In the screens that use `DisplayApp *app` and pass it to a child item,
or use the reference just in the constructor. Afterwards the `app`
member is not used. So remove it from the private member variables.

Completely remove `app` parameter from `SettingDisplay` constructor as
it is unused.

* MusicService: add missing includes for TickType_t and xTaskGetTickCount (InfiniTimeOrg#2130)

Add `FreeRTOS.h` include for the directly used data type `TickType_t` in the header
and the function `xTaskGetTickCount` from FreeRTOS's `task.h`

* settings: Add global widget selection

Instead of each watch face implementing their own settings for which
widgets to display, we can have a global selection of widgets. All
watch faces can then determine whether it is enabled and so display it
in whichever way makes sense for that face.

Current widgets supported are heart rate, step counter, and weather.

* WatchFaceAnalog: Add configurable widgets

* WatchFaceAnalog: Add weather widget

---------

Co-authored-by: NeroBurner <[email protected]>
Co-authored-by: Victor Kareh <[email protected]>
headblockhead added a commit to headblockhead/InfiniTime that referenced this pull request Oct 4, 2024
* Remove unused pointer to DisplayApp member variables (InfiniTimeOrg#2125)

In the screens that use `DisplayApp *app` and pass it to a child item,
or use the reference just in the constructor. Afterwards the `app`
member is not used. So remove it from the private member variables.

Completely remove `app` parameter from `SettingDisplay` constructor as
it is unused.

* MusicService: add missing includes for TickType_t and xTaskGetTickCount (InfiniTimeOrg#2130)

Add `FreeRTOS.h` include for the directly used data type `TickType_t` in the header
and the function `xTaskGetTickCount` from FreeRTOS's `task.h`

* BatteryIcon: Change color with charge percentage

---------

Co-authored-by: NeroBurner <[email protected]>
Co-authored-by: Victor Kareh <[email protected]>
headblockhead added a commit to headblockhead/InfiniTime that referenced this pull request Oct 4, 2024
* Remove unused pointer to DisplayApp member variables (InfiniTimeOrg#2125)

In the screens that use `DisplayApp *app` and pass it to a child item,
or use the reference just in the constructor. Afterwards the `app`
member is not used. So remove it from the private member variables.

Completely remove `app` parameter from `SettingDisplay` constructor as
it is unused.

* MusicService: add missing includes for TickType_t and xTaskGetTickCount (InfiniTimeOrg#2130)

Add `FreeRTOS.h` include for the directly used data type `TickType_t` in the header
and the function `xTaskGetTickCount` from FreeRTOS's `task.h`

* Improved the Terminal Watchfaces UI

+ Reorder code to match the widgets order in the UI.

+ Use InfintimeTheme Colors instead of hardcoded hex values

+ Added a new InfinitimeTheme color: gray, using it to turn certain
  values gray when they contain no data

+ Implement @vkareh's [variable battery icon](InfiniTimeOrg#1964)
  color to the battery percentage text.

+ Replaced the 'You have mail.' notification message with the message
  '[1]+ Notify' to better fit the terminal lore.

---------

Co-authored-by: NeroBurner <[email protected]>
Co-authored-by: JustScott <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Background work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants