Diffstat (limited to 'core/tools/quicklauncher/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/tools/quicklauncher/main.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/core/tools/quicklauncher/main.cpp b/core/tools/quicklauncher/main.cpp index d467d6e..c2467fb 100644 --- a/core/tools/quicklauncher/main.cpp +++ b/core/tools/quicklauncher/main.cpp | |||
@@ -15,12 +15,18 @@ | |||
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 | #include "dropins.h" | ||
22 | |||
23 | /* OPIE */ | ||
24 | #include <opie2/odebug.h> | ||
25 | |||
26 | /* QT */ | ||
21 | #include <qpainter.h> | 27 | #include <qpainter.h> |
22 | #include <qstrlist.h> | 28 | #include <qstrlist.h> |
23 | #include <qtimer.h> | 29 | #include <qtimer.h> |
24 | #include <qguardedptr.h> | 30 | #include <qguardedptr.h> |
25 | #include <qcopchannel_qws.h> | 31 | #include <qcopchannel_qws.h> |
26 | #define QTOPIA_INTERNAL_INITAPP | 32 | #define QTOPIA_INTERNAL_INITAPP |
@@ -28,19 +34,20 @@ | |||
28 | #ifdef private | 34 | #ifdef private |
29 | # undef private | 35 | # undef private |
30 | #endif | 36 | #endif |
31 | #define private public | 37 | #define private public |
32 | #include <qtopia/qpeapplication.h> | 38 | #include <qtopia/qpeapplication.h> |
33 | #undef private | 39 | #undef private |
40 | |||
41 | /* STD */ | ||
34 | #include <stdio.h> | 42 | #include <stdio.h> |
35 | #include <stdlib.h> | 43 | #include <stdlib.h> |
36 | #include <sys/types.h> | 44 | #include <sys/types.h> |
37 | #include <sys/stat.h> | 45 | #include <sys/stat.h> |
38 | #include <unistd.h> | 46 | #include <unistd.h> |
39 | 47 | ||
40 | #include "dropins.h" | ||
41 | 48 | ||
42 | using QuickPrivate::PluginLoader; | 49 | using QuickPrivate::PluginLoader; |
43 | 50 | ||
44 | static QPEApplication *app = 0; | 51 | static QPEApplication *app = 0; |
45 | static PluginLoader *loader = 0; | 52 | static PluginLoader *loader = 0; |
46 | static ApplicationInterface *appIface = 0; | 53 | static ApplicationInterface *appIface = 0; |
@@ -108,13 +115,13 @@ public: | |||
108 | if ( mainWindow->metaObject()->slotNames().contains("setDocument(const QString&)") ) { | 115 | if ( mainWindow->metaObject()->slotNames().contains("setDocument(const QString&)") ) { |
109 | app->showMainDocumentWidget( mainWindow ); | 116 | app->showMainDocumentWidget( mainWindow ); |
110 | } else { | 117 | } else { |
111 | app->showMainWidget( mainWindow ); | 118 | app->showMainWidget( mainWindow ); |
112 | } | 119 | } |
113 | } else { | 120 | } else { |
114 | qWarning( "Could not create application main window" ); | 121 | owarn << "Could not create application main window" << oendl; |
115 | exit(-1); | 122 | exit(-1); |
116 | } | 123 | } |
117 | } | 124 | } |
118 | 125 | ||
119 | private slots: | 126 | private slots: |
120 | void message(const QCString &msg, const QByteArray & data) | 127 | void message(const QCString &msg, const QByteArray & data) |
@@ -123,21 +130,21 @@ private slots: | |||
123 | 130 | ||
124 | if ( msg == "execute(QStrList)" ) { | 131 | if ( msg == "execute(QStrList)" ) { |
125 | delete qlChannel; | 132 | delete qlChannel; |
126 | QDataStream stream( data, IO_ReadOnly ); | 133 | QDataStream stream( data, IO_ReadOnly ); |
127 | QStrList argList; | 134 | QStrList argList; |
128 | stream >> argList; | 135 | stream >> argList; |
129 | qDebug( "QuickLauncher execute: %s", argList.at(0) ); | 136 | odebug << "QuickLauncher execute: " << argList.at(0) << "" << oendl; |
130 | doQuickLaunch( argList ); | 137 | doQuickLaunch( argList ); |
131 | delete this; | 138 | delete this; |
132 | } else if ( msg == "execute(QString)" ) { | 139 | } else if ( msg == "execute(QString)" ) { |
133 | delete qlChannel; | 140 | delete qlChannel; |
134 | QDataStream stream( data, IO_ReadOnly ); | 141 | QDataStream stream( data, IO_ReadOnly ); |
135 | QString arg; | 142 | QString arg; |
136 | stream >> arg; | 143 | stream >> arg; |
137 | qDebug( "QuickLauncher execute: %s", arg.latin1() ); | 144 | odebug << "QuickLauncher execute: " << arg << "" << oendl; |
138 | QStrList argList; | 145 | QStrList argList; |
139 | argList.append( arg.utf8() ); | 146 | argList.append( arg.utf8() ); |
140 | doQuickLaunch( argList ); | 147 | doQuickLaunch( argList ); |
141 | delete this; | 148 | delete this; |
142 | } | 149 | } |
143 | } | 150 | } |
@@ -177,13 +184,13 @@ int main( int argc, char** argv ) | |||
177 | 184 | ||
178 | QCString arg0 = argv[0]; | 185 | QCString arg0 = argv[0]; |
179 | int sep = arg0.findRev( '/' ); | 186 | int sep = arg0.findRev( '/' ); |
180 | if ( sep > 0 ) | 187 | if ( sep > 0 ) |
181 | arg0 = arg0.mid( sep+1 ); | 188 | arg0 = arg0.mid( sep+1 ); |
182 | if ( arg0 != "quicklauncher" ) { | 189 | if ( arg0 != "quicklauncher" ) { |
183 | qDebug( "QuickLauncher invoked as: %s", arg0.data() ); | 190 | odebug << "QuickLauncher invoked as: " << arg0.data() << "" << oendl; |
184 | QuickLauncher::exec( argc, argv ); | 191 | QuickLauncher::exec( argc, argv ); |
185 | } else { | 192 | } else { |
186 | #ifdef _OS_LINUX_ | 193 | #ifdef _OS_LINUX_ |
187 | // Setup to change proc title | 194 | // Setup to change proc title |
188 | int i; | 195 | int i; |
189 | char **envp = environ; | 196 | char **envp = environ; |
@@ -203,13 +210,13 @@ int main( int argc, char** argv ) | |||
203 | if (i > 0) | 210 | if (i > 0) |
204 | argv_lth = envp[i-1] + strlen(envp[i-1]) - argv0[0]; | 211 | argv_lth = envp[i-1] + strlen(envp[i-1]) - argv0[0]; |
205 | else | 212 | else |
206 | argv_lth = argv0[argc-1] + strlen(argv0[argc-1]) - argv0[0]; | 213 | argv_lth = argv0[argc-1] + strlen(argv0[argc-1]) - argv0[0]; |
207 | #endif | 214 | #endif |
208 | (void)new QuickLauncher(); | 215 | (void)new QuickLauncher(); |
209 | qDebug( "QuickLauncher running" ); | 216 | odebug << "QuickLauncher running" << oendl; |
210 | // Pre-load default fonts | 217 | // Pre-load default fonts |
211 | QFontMetrics fm( QApplication::font() ); | 218 | QFontMetrics fm( QApplication::font() ); |
212 | fm.ascent(); // causes font load. | 219 | fm.ascent(); // causes font load. |
213 | QFont f( QApplication::font() ); | 220 | QFont f( QApplication::font() ); |
214 | f.setWeight( QFont::Bold ); | 221 | f.setWeight( QFont::Bold ); |
215 | QFontMetrics fmb( f ); | 222 | QFontMetrics fmb( f ); |