diff --git a/src/gmenu2x.cpp b/src/gmenu2x.cpp index 8d75a18..ba0230f 100644 --- a/src/gmenu2x.cpp +++ b/src/gmenu2x.cpp @@ -85,7 +85,11 @@ int main(int /*argc*/, char */*argv*/[]) { cout << "----" << endl; signal(SIGINT,&exit); - GMenu2X app(); + GMenu2X app; +#ifdef DEBUG + cout << "Starting main()" << endl; +#endif + app.main(); return 0; } @@ -283,19 +287,14 @@ GMenu2X::GMenu2X() { readTmp(); if (lastSelectorElement>-1 && menu->selLinkApp()!=NULL && (!menu->selLinkApp()->getSelectorDir().empty() || !lastSelectorDir.empty())) menu->selLinkApp()->selector(lastSelectorElement,lastSelectorDir); +} -#ifdef DEBUG - cout << "Starting main()" << endl; -#endif - main(); +GMenu2X::~GMenu2X() { writeConfig(); if (fwType=="open2x") writeConfigOpen2x(); quit(); - exit(0); -} -GMenu2X::~GMenu2X() { free(menu); free(s); free(font); @@ -768,7 +767,7 @@ int GMenu2X::getBackLight() return val; } -int GMenu2X::main() { +void GMenu2X::main() { uint linksPerPage = linkColumns*linkRows; int linkSpacingX = (resX-10 - linkColumns*skinConfInt["linkWidth"])/linkColumns; int linkSpacingY = (resY-35 - skinConfInt["topBarHeight"] - linkRows*skinConfInt["linkHeight"])/linkRows; @@ -997,8 +996,6 @@ int GMenu2X::main() { usleep(LOOP_DELAY); } - - return -1; } void GMenu2X::explorer() { diff --git a/src/gmenu2x.h b/src/gmenu2x.h index 343d905..d9b0efe 100644 --- a/src/gmenu2x.h +++ b/src/gmenu2x.h @@ -193,7 +193,7 @@ public: ASFont *font; //Status functions - int main(); + void main(); void options(); void settingsOpen2x(); void skinMenu();