[Escher] Remove App::runningApp

Change-Id: I4953bae09391079b77c93ee482c6e9cd8202c2d4
This commit is contained in:
Romain Goyet
2016-08-12 10:22:00 +02:00
parent 53cf3e2ead
commit ff3cca0867
4 changed files with 2 additions and 13 deletions

View File

@@ -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) {

View File

@@ -7,7 +7,6 @@
class App : public Responder {
public:
App();
static App * runningApp();
void run();
void focus(Responder * responder);
protected:

View File

@@ -4,8 +4,6 @@ extern "C" {
#include <ion.h>
}
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) {

View File

@@ -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() {