From ff3cca08675ec961174880e427bfc72d8cc14048 Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Fri, 12 Aug 2016 10:22:00 +0200 Subject: [PATCH] [Escher] Remove App::runningApp Change-Id: I4953bae09391079b77c93ee482c6e9cd8202c2d4 --- apps/graph/list/list_controller.cpp | 2 +- escher/include/escher/app.h | 1 - escher/src/app.cpp | 10 ---------- escher/src/tab_view_controller.cpp | 2 +- 4 files changed, 2 insertions(+), 13 deletions(-) diff --git a/apps/graph/list/list_controller.cpp b/apps/graph/list/list_controller.cpp index 467e4d254..31ba3a2ec 100644 --- a/apps/graph/list/list_controller.cpp +++ b/apps/graph/list/list_controller.cpp @@ -34,7 +34,7 @@ void ListController::setActiveCell(int index) { m_tableView.scrollToRow(index); FunctionCell * cell = (FunctionCell *)(m_tableView.cellAtIndex(index)); cell->setParentResponder(this); - App::runningApp()->focus(cell); + app()->focus(cell); } bool ListController::handleEvent(ion_event_t event) { diff --git a/escher/include/escher/app.h b/escher/include/escher/app.h index 9624c3cec..2c5e9a83a 100644 --- a/escher/include/escher/app.h +++ b/escher/include/escher/app.h @@ -7,7 +7,6 @@ class App : public Responder { public: App(); - static App * runningApp(); void run(); void focus(Responder * responder); protected: diff --git a/escher/src/app.cpp b/escher/src/app.cpp index ec2e8ad0e..9cd5d4081 100644 --- a/escher/src/app.cpp +++ b/escher/src/app.cpp @@ -4,8 +4,6 @@ extern "C" { #include } -static App * sRunningApp = nullptr; - App::App() : Responder(nullptr), m_focusedResponder(nullptr) @@ -13,8 +11,6 @@ App::App() : } void App::run() { - sRunningApp = this; - Window window; window.setFrame(KDRect(0, 0, ION_SCREEN_WIDTH, ION_SCREEN_HEIGHT)); View * rootView = rootViewController()->view(); @@ -31,12 +27,6 @@ void App::run() { dispatchEvent(event); window.redraw(); } - - sRunningApp = nullptr; -} - -App * App::runningApp() { - return sRunningApp; } void App::dispatchEvent(ion_event_t event) { diff --git a/escher/src/tab_view_controller.cpp b/escher/src/tab_view_controller.cpp index 51b5dfd7a..af029930c 100644 --- a/escher/src/tab_view_controller.cpp +++ b/escher/src/tab_view_controller.cpp @@ -110,7 +110,7 @@ void TabViewController::setActiveTab(uint8_t i) { m_view.m_tabView.setActiveIndex(i); m_activeChildIndex = i; - App::runningApp()->focus(activeVC); + app()->focus(activeVC); } View * TabViewController::view() {