Skip to content

Commit abc3002

Browse files
author
panky-codes
committed
Removed unused variables. Tested.
1 parent bc6d447 commit abc3002

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/displayapp/DisplayApp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void DisplayApp::RunningState() {
205205
case Apps::Twos: currentScreen.reset(new Screens::Twos(this)); break;
206206
case Apps::Paint: currentScreen.reset(new Screens::InfiniPaint(this, lvgl)); break;
207207
//TODO: Change it back
208-
case Apps::StopWatch: currentScreen.reset(new Screens::StopWatch(this, dateTimeController)); break;
208+
case Apps::StopWatch: currentScreen.reset(new Screens::StopWatch(this)); break;
209209
case Apps::Brightness : currentScreen.reset(new Screens::Brightness(this, brightnessController)); break;
210210
case Apps::Music : currentScreen.reset(new Screens::Music(this, systemTask.nimble().music())); break;
211211
case Apps::Navigation : currentScreen.reset(new Screens::Navigation(this, systemTask.nimble().navigation())); break;

src/displayapp/screens/StopWatch.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ namespace {
3636
}
3737

3838
static void play_pause_event_handler(lv_obj_t* obj, lv_event_t event) {
39-
StopWatch* stopWatch = static_cast<StopWatch*>(obj->user_data);
39+
auto stopWatch = static_cast<StopWatch*>(obj->user_data);
4040
stopWatch->playPauseBtnEventHandler(event);
4141
}
4242

4343
static void stop_lap_event_handler(lv_obj_t* obj, lv_event_t event) {
44-
StopWatch* stopWatch = static_cast<StopWatch*>(obj->user_data);
44+
auto stopWatch = static_cast<StopWatch*>(obj->user_data);
4545
stopWatch->stopLapBtnEventHandler(event);
4646
}
4747

48-
StopWatch::StopWatch(DisplayApp* app, const Pinetime::Controllers::DateTime& dateTime)
49-
: Screen(app), dateTime {dateTime}, running {true}, currentState {States::INIT}, currentEvent {Events::STOP}, startTime {},
50-
oldTimeElapsed {}, currentTimeSeparated {}, lapBuffer {}, lapNr {}, lapPressed {false} {
48+
StopWatch::StopWatch(DisplayApp* app)
49+
: Screen(app), running {true}, currentState {States::INIT}, currentEvent {Events::STOP}, startTime {}, oldTimeElapsed {},
50+
currentTimeSeparated {}, lapBuffer {}, lapNr {}, lapPressed {false} {
5151

5252
time = lv_label_create(lv_scr_act(), nullptr);
5353
lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_extrabold_compressed);

src/displayapp/screens/StopWatch.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,14 @@ namespace Pinetime::Applications::Screens {
6363

6464
class StopWatch : public Screen {
6565
public:
66-
StopWatch(DisplayApp* app, const Pinetime::Controllers::DateTime& dateTime);
66+
StopWatch(DisplayApp* app);
6767
~StopWatch() override;
6868
bool Refresh() override;
6969
bool OnButtonPushed() override;
7070
void playPauseBtnEventHandler(lv_event_t event);
7171
void stopLapBtnEventHandler(lv_event_t event);
7272

7373
private:
74-
const Pinetime::Controllers::DateTime& dateTime;
7574
bool running;
7675
States currentState;
7776
Events currentEvent;
@@ -84,4 +83,4 @@ namespace Pinetime::Applications::Screens {
8483
lv_obj_t *time, *msecTime, *btnPlayPause, *btnStopLap, *txtPlayPause, *txtStopLap;
8584
lv_obj_t *lapOneText, *lapTwoText;
8685
};
87-
}
86+
}

0 commit comments

Comments
 (0)