Mercurial > sdl-ios-xcode
comparison src/main/qtopia/SDL_qtopia_main.cc @ 1895:c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 10 Jul 2006 21:04:37 +0000 |
parents | 623b453a3219 |
children |
comparison
equal
deleted
inserted
replaced
1894:c69cee13dd76 | 1895:c121d94672cb |
---|---|
14 | 14 |
15 // Workaround for OPIE to remove taskbar icon. Also fixes | 15 // Workaround for OPIE to remove taskbar icon. Also fixes |
16 // some issues in Qtopia where there are left-over qcop files in /tmp/. | 16 // some issues in Qtopia where there are left-over qcop files in /tmp/. |
17 // I'm guessing this will also clean up the taskbar in the Sharp version | 17 // I'm guessing this will also clean up the taskbar in the Sharp version |
18 // of Qtopia. | 18 // of Qtopia. |
19 static inline void cleanupQCop() { | 19 static inline void |
20 QString appname(qApp->argv()[0]); | 20 cleanupQCop() |
21 int slash = appname.findRev("/"); | 21 { |
22 if(slash != -1) { appname = appname.mid(slash+1); } | 22 QString appname(qApp->argv()[0]); |
23 QString cmd = QPEApplication::qpeDir() + "bin/qcop QPE/System 'closing(QString)' '"+appname+"'"; | 23 int slash = appname.findRev("/"); |
24 system(cmd.latin1()); | 24 if (slash != -1) { |
25 cmd = "/tmp/qcop-msg-"+appname; | 25 appname = appname.mid(slash + 1); |
26 unlink(cmd.latin1()); | 26 } |
27 QString cmd = | |
28 QPEApplication::qpeDir() + | |
29 "bin/qcop QPE/System 'closing(QString)' '" + appname + "'"; | |
30 system(cmd.latin1()); | |
31 cmd = "/tmp/qcop-msg-" + appname; | |
32 unlink(cmd.latin1()); | |
27 } | 33 } |
28 | 34 |
29 static QPEApplication *app; | 35 static QPEApplication *app; |
30 #endif | 36 #endif |
31 | 37 |
32 extern int SDL_main(int argc, char *argv[]); | 38 extern int SDL_main(int argc, char *argv[]); |
33 | 39 |
34 int main(int argc, char *argv[]) | 40 int |
41 main(int argc, char *argv[]) | |
35 { | 42 { |
36 #ifdef QWS | 43 #ifdef QWS |
37 // This initializes the Qtopia application. It needs to be done here | 44 // This initializes the Qtopia application. It needs to be done here |
38 // because it parses command line options. | 45 // because it parses command line options. |
39 app = new QPEApplication(argc, argv); | 46 app = new QPEApplication(argc, argv); |
40 QWidget dummy; | 47 QWidget dummy; |
41 app->showMainWidget(&dummy); | 48 app->showMainWidget(&dummy); |
42 atexit(cleanupQCop); | 49 atexit(cleanupQCop); |
43 #endif | 50 #endif |
44 // Exit here because if return is used, the application | 51 // Exit here because if return is used, the application |
45 // doesn't seem to quit correctly. | 52 // doesn't seem to quit correctly. |
46 exit(SDL_main(argc, argv)); | 53 exit(SDL_main(argc, argv)); |
47 } | 54 } |
55 | |
56 /* vi: set ts=4 sw=4 expandtab: */ |