diff options
author | Steve Kondik <shade@chemlab.org> | 2012-11-18 15:47:18 -0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2012-11-18 15:47:18 -0800 |
commit | a546c7006355a7bd1df4267ee53d0bfa2c017c8c (patch) | |
tree | 01be0bf6c0d6968e1468ec9661fd52110f9b05a7 /distrib/sdl-1.2.15/src/main/qtopia | |
parent | baf3d7830396202df5cc47bd7bcee109c319cdb3 (diff) | |
parent | 0f809250987b64f491bd3b4b73c0f0d33036a786 (diff) | |
download | external_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.zip external_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.tar.gz external_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.tar.bz2 |
Merge branch 'jb-mr1-release' of https://android.googlesource.com/platform/external/qemu into mr1-staging
Change-Id: I8a4a71ac65b08e6e17f26c942f67a15b85211115
Diffstat (limited to 'distrib/sdl-1.2.15/src/main/qtopia')
-rw-r--r-- | distrib/sdl-1.2.15/src/main/qtopia/SDL_qtopia_main.cc | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/distrib/sdl-1.2.15/src/main/qtopia/SDL_qtopia_main.cc b/distrib/sdl-1.2.15/src/main/qtopia/SDL_qtopia_main.cc new file mode 100644 index 0000000..46fd518 --- /dev/null +++ b/distrib/sdl-1.2.15/src/main/qtopia/SDL_qtopia_main.cc @@ -0,0 +1,47 @@ + +/* Include the SDL main definition header */ +#include "SDL_main.h" +#include <stdlib.h> +#include <unistd.h> +#ifdef main +#undef main +#endif +#ifdef QWS +#include <qpe/qpeapplication.h> +#include <qapplication.h> +#include <qpe/qpeapplication.h> +#include <stdlib.h> + +// Workaround for OPIE to remove taskbar icon. Also fixes +// some issues in Qtopia where there are left-over qcop files in /tmp/. +// I'm guessing this will also clean up the taskbar in the Sharp version +// of Qtopia. +static inline void cleanupQCop() { + QString appname(qApp->argv()[0]); + int slash = appname.findRev("/"); + if(slash != -1) { appname = appname.mid(slash+1); } + QString cmd = QPEApplication::qpeDir() + "bin/qcop QPE/System 'closing(QString)' '"+appname+"'"; + system(cmd.latin1()); + cmd = "/tmp/qcop-msg-"+appname; + unlink(cmd.latin1()); +} + +static QPEApplication *app; +#endif + +extern int SDL_main(int argc, char *argv[]); + +int main(int argc, char *argv[]) +{ +#ifdef QWS + // This initializes the Qtopia application. It needs to be done here + // because it parses command line options. + app = new QPEApplication(argc, argv); + QWidget dummy; + app->showMainWidget(&dummy); + atexit(cleanupQCop); +#endif + // Exit here because if return is used, the application + // doesn't seem to quit correctly. + exit(SDL_main(argc, argv)); +} |