author | zecke <zecke> | 2004-11-03 22:46:40 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-03 22:46:40 (UTC) |
commit | c85842bfd4b008eb6bd7527f0511f36dbf693ba5 (patch) (unidiff) | |
tree | ad58890264a783108700f019a69f9e672f856780 | |
parent | 3c446259f59c03abe2a64b2eba9a65cb11a81a1b (diff) | |
download | opie-c85842bfd4b008eb6bd7527f0511f36dbf693ba5.zip opie-c85842bfd4b008eb6bd7527f0511f36dbf693ba5.tar.gz opie-c85842bfd4b008eb6bd7527f0511f36dbf693ba5.tar.bz2 |
Construct a OApplication instead of a QPEApplication
-rw-r--r-- | core/tools/quicklauncher/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/tools/quicklauncher/main.cpp b/core/tools/quicklauncher/main.cpp index 286aed2..5f0d80b 100644 --- a/core/tools/quicklauncher/main.cpp +++ b/core/tools/quicklauncher/main.cpp | |||
@@ -1,58 +1,58 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2003 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2003 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #define QTOPIA_INTERNAL_INITAPP | 21 | #define QTOPIA_INTERNAL_INITAPP |
22 | #include "dropins.h" | 22 | #include "dropins.h" |
23 | 23 | ||
24 | /* OPIE */ | 24 | /* OPIE */ |
25 | #include <opie2/odebug.h> | 25 | #include <opie2/odebug.h> |
26 | using namespace Opie::Core; | 26 | #include <opie2/oapplication.h> |
27 | 27 | ||
28 | /* QT */ | 28 | /* QT */ |
29 | #include <qpainter.h> | 29 | #include <qpainter.h> |
30 | #include <qstrlist.h> | 30 | #include <qstrlist.h> |
31 | #include <qtimer.h> | 31 | #include <qtimer.h> |
32 | #include <qguardedptr.h> | 32 | #include <qguardedptr.h> |
33 | #include <qcopchannel_qws.h> | 33 | #include <qcopchannel_qws.h> |
34 | 34 | ||
35 | #ifdef private | 35 | #ifdef private |
36 | # undef private | 36 | # undef private |
37 | #endif | 37 | #endif |
38 | #define private public | 38 | #define private public |
39 | #include <qtopia/qpeapplication.h> | 39 | #include <qtopia/qpeapplication.h> |
40 | #undef private | 40 | #undef private |
41 | 41 | ||
42 | /* STD */ | 42 | /* STD */ |
43 | #include <stdio.h> | 43 | #include <stdio.h> |
44 | #include <stdlib.h> | 44 | #include <stdlib.h> |
45 | #include <sys/types.h> | 45 | #include <sys/types.h> |
46 | #include <sys/stat.h> | 46 | #include <sys/stat.h> |
47 | 47 | ||
48 | #ifdef _OS_LINUX_ | 48 | #ifdef _OS_LINUX_ |
49 | #include <sys/prctl.h> | 49 | #include <sys/prctl.h> |
50 | #ifndef PR_SET_NAME | 50 | #ifndef PR_SET_NAME |
51 | #define PR_SET_NAME 15 | 51 | #define PR_SET_NAME 15 |
52 | #endif | 52 | #endif |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | #include <unistd.h> | 55 | #include <unistd.h> |
56 | 56 | ||
57 | 57 | ||
58 | using QuickPrivate::PluginLoader; | 58 | using QuickPrivate::PluginLoader; |
@@ -160,65 +160,65 @@ private slots: | |||
160 | } | 160 | } |
161 | 161 | ||
162 | private: | 162 | private: |
163 | void doQuickLaunch( QStrList &argList ) | 163 | void doQuickLaunch( QStrList &argList ) |
164 | { | 164 | { |
165 | static int myargc = argList.count(); | 165 | static int myargc = argList.count(); |
166 | static char **myargv = new char *[myargc + 1]; | 166 | static char **myargv = new char *[myargc + 1]; |
167 | 167 | ||
168 | for ( int j = 0; j < myargc; j++ ) { | 168 | for ( int j = 0; j < myargc; j++ ) { |
169 | myargv[j] = new char [strlen(argList.at(j))+1]; | 169 | myargv[j] = new char [strlen(argList.at(j))+1]; |
170 | strcpy( myargv[j], argList.at(j) ); | 170 | strcpy( myargv[j], argList.at(j) ); |
171 | } | 171 | } |
172 | 172 | ||
173 | myargv[myargc] = NULL; | 173 | myargv[myargc] = NULL; |
174 | #ifdef _OS_LINUX_ | 174 | #ifdef _OS_LINUX_ |
175 | // Change name of process | 175 | // Change name of process |
176 | setproctitle(myargv[0]); | 176 | setproctitle(myargv[0]); |
177 | prctl( PR_SET_NAME, (unsigned long)myargv[0], 0, 0, 0 ); | 177 | prctl( PR_SET_NAME, (unsigned long)myargv[0], 0, 0, 0 ); |
178 | #endif | 178 | #endif |
179 | 179 | ||
180 | connect(app, SIGNAL(lastWindowClosed()), app, SLOT(hideOrQuit())); | 180 | connect(app, SIGNAL(lastWindowClosed()), app, SLOT(hideOrQuit())); |
181 | app->exit_loop(); | 181 | app->exit_loop(); |
182 | app->initApp( myargc, myargv ); | 182 | app->initApp( myargc, myargv ); |
183 | exec( myargc, myargv ); | 183 | exec( myargc, myargv ); |
184 | } | 184 | } |
185 | 185 | ||
186 | private: | 186 | private: |
187 | QCopChannel *qlChannel; | 187 | QCopChannel *qlChannel; |
188 | }; | 188 | }; |
189 | 189 | ||
190 | int main( int argc, char** argv ) | 190 | int main( int argc, char** argv ) |
191 | { | 191 | { |
192 | app = new QPEApplication( argc, argv ); | 192 | app = new Opie::Core::OApplication( argc, argv ); |
193 | 193 | ||
194 | loader = new PluginLoader( "application" ); | 194 | loader = new PluginLoader( "application" ); |
195 | 195 | ||
196 | unsetenv( "LD_BIND_NOW" ); | 196 | unsetenv( "LD_BIND_NOW" ); |
197 | 197 | ||
198 | QCString arg0 = argv[0]; | 198 | QCString arg0 = argv[0]; |
199 | int sep = arg0.findRev( '/' ); | 199 | int sep = arg0.findRev( '/' ); |
200 | 200 | ||
201 | if ( sep > 0 ) | 201 | if ( sep > 0 ) |
202 | arg0 = arg0.mid( sep+1 ); | 202 | arg0 = arg0.mid( sep+1 ); |
203 | 203 | ||
204 | if ( arg0 != "quicklauncher" ) { | 204 | if ( arg0 != "quicklauncher" ) { |
205 | odebug << "QuickLauncher invoked as: " << arg0.data() << oendl; | 205 | odebug << "QuickLauncher invoked as: " << arg0.data() << oendl; |
206 | QuickLauncher::exec( argc, argv ); | 206 | QuickLauncher::exec( argc, argv ); |
207 | } else { | 207 | } else { |
208 | #ifdef _OS_LINUX_ | 208 | #ifdef _OS_LINUX_ |
209 | // Setup to change proc title | 209 | // Setup to change proc title |
210 | int i; | 210 | int i; |
211 | char **envp = environ; | 211 | char **envp = environ; |
212 | /* Move the environment so we can reuse the memory. | 212 | /* Move the environment so we can reuse the memory. |
213 | * (Code borrowed from sendmail.) */ | 213 | * (Code borrowed from sendmail.) */ |
214 | for (i = 0; envp[i] != NULL; i++) | 214 | for (i = 0; envp[i] != NULL; i++) |
215 | continue; | 215 | continue; |
216 | environ = (char **) malloc(sizeof(char *) * (i + 1)); | 216 | environ = (char **) malloc(sizeof(char *) * (i + 1)); |
217 | if (environ == NULL) | 217 | if (environ == NULL) |
218 | return -1; | 218 | return -1; |
219 | for (i = 0; envp[i] != NULL; i++) | 219 | for (i = 0; envp[i] != NULL; i++) |
220 | if ((environ[i] = strdup(envp[i])) == NULL) | 220 | if ((environ[i] = strdup(envp[i])) == NULL) |
221 | return -1; | 221 | return -1; |
222 | environ[i] = NULL; | 222 | environ[i] = NULL; |
223 | 223 | ||
224 | argv0 = argv; | 224 | argv0 = argv; |