summaryrefslogtreecommitdiff
authorsandman <sandman>2002-09-29 13:32:19 (UTC)
committer sandman <sandman>2002-09-29 13:32:19 (UTC)
commit3e8ee39d31b43f01524670df6cb048efc2194b9a (patch) (unidiff)
treef0f20464e77c4d0e3d03cf5065dc77070279c4f9
parentb7fcdc189dacc8e054a32090af4677bc86955491 (diff)
downloadopie-3e8ee39d31b43f01524670df6cb048efc2194b9a.zip
opie-3e8ee39d31b43f01524670df6cb048efc2194b9a.tar.gz
opie-3e8ee39d31b43f01524670df6cb048efc2194b9a.tar.bz2
Fast-load should work now again -- I think this was a Qtopia merge problem
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/global.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/global.cpp b/library/global.cpp
index 7438891..2e4d03f 100644
--- a/library/global.cpp
+++ b/library/global.cpp
@@ -1,813 +1,816 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 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#define QTOPIA_INTERNAL_LANGLIST 20#define QTOPIA_INTERNAL_LANGLIST
21#include <qpe/qpedebug.h> 21#include <qpe/qpedebug.h>
22#include <qpe/global.h> 22#include <qpe/global.h>
23#include <qpe/qdawg.h> 23#include <qpe/qdawg.h>
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25#include <qpe/resource.h> 25#include <qpe/resource.h>
26#include <qpe/storage.h> 26#include <qpe/storage.h>
27#include <qpe/applnk.h> 27#include <qpe/applnk.h>
28#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 28#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
29#include "qpe/qcopenvelope_qws.h" 29#include "qpe/qcopenvelope_qws.h"
30#endif 30#endif
31 31
32#include <qfile.h> 32#include <qfile.h>
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qtimer.h> 34#include <qtimer.h>
35#include <qmap.h> 35#include <qmap.h>
36#include <qdict.h> 36#include <qdict.h>
37#include <qdir.h> 37#include <qdir.h>
38#include <qmessagebox.h> 38#include <qmessagebox.h>
39#include <qregexp.h> 39#include <qregexp.h>
40 40
41#include <stdlib.h> 41#include <stdlib.h>
42#include <sys/stat.h> 42#include <sys/stat.h>
43#include <sys/wait.h> 43#include <sys/wait.h>
44#include <sys/types.h> 44#include <sys/types.h>
45#include <fcntl.h> 45#include <fcntl.h>
46#include <unistd.h> 46#include <unistd.h>
47 47
48#ifdef QWS 48#ifdef QWS
49#include <qwindowsystem_qws.h> // for qwsServer 49#include <qwindowsystem_qws.h> // for qwsServer
50#endif 50#endif
51#include <qdatetime.h> 51#include <qdatetime.h>
52 52
53#include <qfile.h> 53#include <qfile.h>
54 54
55namespace { 55namespace {
56 // checks if the storage should be searched 56 // checks if the storage should be searched
57 bool checkStorage(const QString &path ){ // this is a small Config replacement cause config is too limited -zecke 57 bool checkStorage(const QString &path ){ // this is a small Config replacement cause config is too limited -zecke
58 QFile file(path ); 58 QFile file(path );
59 if(!file.open(IO_ReadOnly ) ) 59 if(!file.open(IO_ReadOnly ) )
60 return true; 60 return true;
61 61
62 QByteArray array = file.readAll(); 62 QByteArray array = file.readAll();
63 QStringList list = QStringList::split('\n', QString( array ) ); 63 QStringList list = QStringList::split('\n', QString( array ) );
64 for(QStringList::Iterator it = list.begin(); it != list.end(); ++it ){ 64 for(QStringList::Iterator it = list.begin(); it != list.end(); ++it ){
65 if( (*it).startsWith("autocheck = 0" ) ){ 65 if( (*it).startsWith("autocheck = 0" ) ){
66 return false; 66 return false;
67 }else if( (*it).startsWith("autocheck = 1" ) ){ 67 }else if( (*it).startsWith("autocheck = 1" ) ){
68 return true; 68 return true;
69 } 69 }
70 } 70 }
71 return true; 71 return true;
72 } 72 }
73} 73}
74 74
75//#include "quickexec_p.h" 75//#include "quickexec_p.h"
76 76
77class Emitter : public QObject { 77class Emitter : public QObject {
78 Q_OBJECT 78 Q_OBJECT
79public: 79public:
80 Emitter( QWidget* receiver, const QString& document ) 80 Emitter( QWidget* receiver, const QString& document )
81 { 81 {
82 connect(this, SIGNAL(setDocument(const QString&)), 82 connect(this, SIGNAL(setDocument(const QString&)),
83 receiver, SLOT(setDocument(const QString&))); 83 receiver, SLOT(setDocument(const QString&)));
84 emit setDocument(document); 84 emit setDocument(document);
85 disconnect(this, SIGNAL(setDocument(const QString&)), 85 disconnect(this, SIGNAL(setDocument(const QString&)),
86 receiver, SLOT(setDocument(const QString&))); 86 receiver, SLOT(setDocument(const QString&)));
87 } 87 }
88 88
89signals: 89signals:
90 void setDocument(const QString&); 90 void setDocument(const QString&);
91}; 91};
92 92
93 93
94class StartingAppList : public QObject { 94class StartingAppList : public QObject {
95 Q_OBJECT 95 Q_OBJECT
96public: 96public:
97 static void add( const QString& name ); 97 static void add( const QString& name );
98 static bool isStarting( const QString name ); 98 static bool isStarting( const QString name );
99private slots: 99private slots:
100 void handleNewChannel( const QString &); 100 void handleNewChannel( const QString &);
101private: 101private:
102 StartingAppList( QObject *parent=0, const char* name=0 ) ; 102 StartingAppList( QObject *parent=0, const char* name=0 ) ;
103 103
104 QDict<QTime> dict; 104 QDict<QTime> dict;
105 static StartingAppList *appl; 105 static StartingAppList *appl;
106}; 106};
107 107
108StartingAppList* StartingAppList::appl = 0; 108StartingAppList* StartingAppList::appl = 0;
109 109
110StartingAppList::StartingAppList( QObject *parent, const char* name ) 110StartingAppList::StartingAppList( QObject *parent, const char* name )
111 :QObject( parent, name ) 111 :QObject( parent, name )
112{ 112{
113#ifdef QWS 113#ifdef QWS
114#if QT_VERSION >= 232 && !defined(QT_NO_COP) 114#if QT_VERSION >= 232 && !defined(QT_NO_COP)
115 connect( qwsServer, SIGNAL( newChannel(const QString&)), 115 connect( qwsServer, SIGNAL( newChannel(const QString&)),
116 this, SLOT( handleNewChannel(const QString&)) ); 116 this, SLOT( handleNewChannel(const QString&)) );
117 dict.setAutoDelete( TRUE ); 117 dict.setAutoDelete( TRUE );
118#endif 118#endif
119#endif 119#endif
120} 120}
121 121
122void StartingAppList::add( const QString& name ) 122void StartingAppList::add( const QString& name )
123{ 123{
124#if QT_VERSION >= 232 && !defined(QT_NO_COP) 124#if QT_VERSION >= 232 && !defined(QT_NO_COP)
125 if ( !appl ) 125 if ( !appl )
126 appl = new StartingAppList; 126 appl = new StartingAppList;
127 QTime *t = new QTime; 127 QTime *t = new QTime;
128 t->start(); 128 t->start();
129 appl->dict.insert( "QPE/Application/" + name, t ); 129 appl->dict.insert( "QPE/Application/" + name, t );
130#endif 130#endif
131} 131}
132 132
133bool StartingAppList::isStarting( const QString name ) 133bool StartingAppList::isStarting( const QString name )
134{ 134{
135#if QT_VERSION >= 232 && !defined(QT_NO_COP) 135#if QT_VERSION >= 232 && !defined(QT_NO_COP)
136 if ( appl ) { 136 if ( appl ) {
137 QTime *t = appl->dict.find( "QPE/Application/" + name ); 137 QTime *t = appl->dict.find( "QPE/Application/" + name );
138 if ( !t ) 138 if ( !t )
139 return FALSE; 139 return FALSE;
140 if ( t->elapsed() > 10000 ) { 140 if ( t->elapsed() > 10000 ) {
141 // timeout in case of crash or something 141 // timeout in case of crash or something
142 appl->dict.remove( "QPE/Application/" + name ); 142 appl->dict.remove( "QPE/Application/" + name );
143 return FALSE; 143 return FALSE;
144 } 144 }
145 return TRUE; 145 return TRUE;
146 } 146 }
147#endif 147#endif
148 return FALSE; 148 return FALSE;
149} 149}
150 150
151void StartingAppList::handleNewChannel( const QString & name ) 151void StartingAppList::handleNewChannel( const QString & name )
152{ 152{
153#if QT_VERSION >= 232 && !defined(QT_NO_COP) 153#if QT_VERSION >= 232 && !defined(QT_NO_COP)
154 dict.remove( name ); 154 dict.remove( name );
155#endif 155#endif
156} 156}
157 157
158static bool docDirCreated = FALSE; 158static bool docDirCreated = FALSE;
159static QDawg* fixed_dawg = 0; 159static QDawg* fixed_dawg = 0;
160static QDict<QDawg> *named_dawg = 0; 160static QDict<QDawg> *named_dawg = 0;
161 161
162static QString qpeDir() 162static QString qpeDir()
163{ 163{
164 QString dir = getenv("OPIEDIR"); 164 QString dir = getenv("OPIEDIR");
165 if ( dir.isEmpty() ) dir = ".."; 165 if ( dir.isEmpty() ) dir = "..";
166 return dir; 166 return dir;
167} 167}
168 168
169static QString dictDir() 169static QString dictDir()
170{ 170{
171 return qpeDir() + "/etc/dict"; 171 return qpeDir() + "/etc/dict";
172} 172}
173 173
174/*! 174/*!
175 \class Global global.h 175 \class Global global.h
176 \brief The Global class provides application-wide global functions. 176 \brief The Global class provides application-wide global functions.
177 177
178 The Global functions are grouped as follows: 178 The Global functions are grouped as follows:
179 \tableofcontents 179 \tableofcontents
180 180
181 \section1 User Interface 181 \section1 User Interface
182 182
183 The statusMessage() function provides short-duration messages to the 183 The statusMessage() function provides short-duration messages to the
184 user. The showInputMethod() function shows the current input method, 184 user. The showInputMethod() function shows the current input method,
185 and hideInputMethod() hides the input method. 185 and hideInputMethod() hides the input method.
186 186
187 \section1 Document related 187 \section1 Document related
188 188
189 The findDocuments() function creates a set of \link doclnk.html 189 The findDocuments() function creates a set of \link doclnk.html
190 DocLnk\endlink objects in a particular folder. 190 DocLnk\endlink objects in a particular folder.
191 191
192 \section1 Filesystem related 192 \section1 Filesystem related
193 193
194 Global provides an applicationFileName() function that returns the 194 Global provides an applicationFileName() function that returns the
195 full path of an application-specific file. 195 full path of an application-specific file.
196 196
197 The execute() function runs an application. 197 The execute() function runs an application.
198 198
199 \section1 Word list related 199 \section1 Word list related
200 200
201 A list of words relevant to the current locale is maintained by the 201 A list of words relevant to the current locale is maintained by the
202 system. The list is held in a \link qdawg.html DAWG\endlink 202 system. The list is held in a \link qdawg.html DAWG\endlink
203 (implemented by the QDawg class). This list is used, for example, by 203 (implemented by the QDawg class). This list is used, for example, by
204 the pickboard input method. 204 the pickboard input method.
205 205
206 The global QDawg is returned by fixedDawg(); this cannot be updated. 206 The global QDawg is returned by fixedDawg(); this cannot be updated.
207 An updatable copy of the global QDawg is returned by addedDawg(). 207 An updatable copy of the global QDawg is returned by addedDawg().
208 Applications may have their own word lists stored in \l{QDawg}s 208 Applications may have their own word lists stored in \l{QDawg}s
209 which are returned by dawg(). Use addWords() to add words to the 209 which are returned by dawg(). Use addWords() to add words to the
210 updateable copy of the global QDawg or to named application 210 updateable copy of the global QDawg or to named application
211 \l{QDawg}s. 211 \l{QDawg}s.
212 212
213 \section1 Quoting 213 \section1 Quoting
214 214
215 The shellQuote() function quotes a string suitable for passing to a 215 The shellQuote() function quotes a string suitable for passing to a
216 shell. The stringQuote() function backslash escapes '\' and '"' 216 shell. The stringQuote() function backslash escapes '\' and '"'
217 characters. 217 characters.
218 218
219 \section1 Hardware 219 \section1 Hardware
220 220
221 The writeHWClock() function sets the hardware clock to the system 221 The writeHWClock() function sets the hardware clock to the system
222 clock's date and time. 222 clock's date and time.
223 223
224 \ingroup qtopiaemb 224 \ingroup qtopiaemb
225*/ 225*/
226 226
227/*! 227/*!
228 \internal 228 \internal
229*/ 229*/
230Global::Global() 230Global::Global()
231{ 231{
232} 232}
233 233
234/*! 234/*!
235 Returns the unchangeable QDawg that contains general 235 Returns the unchangeable QDawg that contains general
236 words for the current locale. 236 words for the current locale.
237 237
238 \sa addedDawg() 238 \sa addedDawg()
239*/ 239*/
240const QDawg& Global::fixedDawg() 240const QDawg& Global::fixedDawg()
241{ 241{
242 if ( !fixed_dawg ) { 242 if ( !fixed_dawg ) {
243 if ( !docDirCreated ) 243 if ( !docDirCreated )
244 createDocDir(); 244 createDocDir();
245 245
246 fixed_dawg = new QDawg; 246 fixed_dawg = new QDawg;
247 QString dawgfilename = dictDir() + "/dawg"; 247 QString dawgfilename = dictDir() + "/dawg";
248 QString words_lang; 248 QString words_lang;
249 QStringList langs = Global::languageList(); 249 QStringList langs = Global::languageList();
250 for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) { 250 for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) {
251 QString lang = *it; 251 QString lang = *it;
252 words_lang = dictDir() + "/words." + lang; 252 words_lang = dictDir() + "/words." + lang;
253 QString dawgfilename_lang = dawgfilename + "." + lang; 253 QString dawgfilename_lang = dawgfilename + "." + lang;
254 if ( QFile::exists(dawgfilename_lang) || 254 if ( QFile::exists(dawgfilename_lang) ||
255 QFile::exists(words_lang) ) { 255 QFile::exists(words_lang) ) {
256 dawgfilename = dawgfilename_lang; 256 dawgfilename = dawgfilename_lang;
257 break; 257 break;
258 } 258 }
259 } 259 }
260 QFile dawgfile(dawgfilename); 260 QFile dawgfile(dawgfilename);
261 261
262 if ( !dawgfile.exists() ) { 262 if ( !dawgfile.exists() ) {
263 QString fn = dictDir() + "/words"; 263 QString fn = dictDir() + "/words";
264 if ( QFile::exists(words_lang) ) 264 if ( QFile::exists(words_lang) )
265 fn = words_lang; 265 fn = words_lang;
266 QFile in(fn); 266 QFile in(fn);
267 if ( in.open(IO_ReadOnly) ) { 267 if ( in.open(IO_ReadOnly) ) {
268 fixed_dawg->createFromWords(&in); 268 fixed_dawg->createFromWords(&in);
269 dawgfile.open(IO_WriteOnly); 269 dawgfile.open(IO_WriteOnly);
270 fixed_dawg->write(&dawgfile); 270 fixed_dawg->write(&dawgfile);
271 dawgfile.close(); 271 dawgfile.close();
272 } 272 }
273 } else { 273 } else {
274 fixed_dawg->readFile(dawgfilename); 274 fixed_dawg->readFile(dawgfilename);
275 } 275 }
276 } 276 }
277 277
278 return *fixed_dawg; 278 return *fixed_dawg;
279} 279}
280 280
281/*! 281/*!
282 Returns the changeable QDawg that contains general 282 Returns the changeable QDawg that contains general
283 words for the current locale. 283 words for the current locale.
284 284
285 \sa fixedDawg() 285 \sa fixedDawg()
286*/ 286*/
287const QDawg& Global::addedDawg() 287const QDawg& Global::addedDawg()
288{ 288{
289 return dawg("local"); 289 return dawg("local");
290} 290}
291 291
292/*! 292/*!
293 Returns the QDawg with the given \a name. 293 Returns the QDawg with the given \a name.
294 This is an application-specific word list. 294 This is an application-specific word list.
295 295
296 \a name should not contain "/". 296 \a name should not contain "/".
297*/ 297*/
298const QDawg& Global::dawg(const QString& name) 298const QDawg& Global::dawg(const QString& name)
299{ 299{
300 createDocDir(); 300 createDocDir();
301 if ( !named_dawg ) 301 if ( !named_dawg )
302 named_dawg = new QDict<QDawg>; 302 named_dawg = new QDict<QDawg>;
303 QDawg* r = named_dawg->find(name); 303 QDawg* r = named_dawg->find(name);
304 if ( !r ) { 304 if ( !r ) {
305 r = new QDawg; 305 r = new QDawg;
306 named_dawg->insert(name,r); 306 named_dawg->insert(name,r);
307 QString dawgfilename = applicationFileName("Dictionary", name ) + ".dawg"; 307 QString dawgfilename = applicationFileName("Dictionary", name ) + ".dawg";
308 QFile dawgfile(dawgfilename); 308 QFile dawgfile(dawgfilename);
309 if ( dawgfile.open(IO_ReadOnly) ) 309 if ( dawgfile.open(IO_ReadOnly) )
310 r->readFile(dawgfilename); 310 r->readFile(dawgfilename);
311 } 311 }
312 return *r; 312 return *r;
313} 313}
314 314
315/*! 315/*!
316 \overload 316 \overload
317 Adds \a wordlist to the addedDawg(). 317 Adds \a wordlist to the addedDawg().
318 318
319 Note that the addition of words persists between program executions 319 Note that the addition of words persists between program executions
320 (they are saved in the dictionary files), so you should confirm the 320 (they are saved in the dictionary files), so you should confirm the
321 words with the user before adding them. 321 words with the user before adding them.
322*/ 322*/
323void Global::addWords(const QStringList& wordlist) 323void Global::addWords(const QStringList& wordlist)
324{ 324{
325 addWords("local",wordlist); 325 addWords("local",wordlist);
326} 326}
327 327
328/*! 328/*!
329 \overload 329 \overload
330 Adds \a wordlist to the addedDawg(). 330 Adds \a wordlist to the addedDawg().
331 331
332 Note that the addition of words persists between program executions 332 Note that the addition of words persists between program executions
333 (they are saved in the dictionary files), so you should confirm the 333 (they are saved in the dictionary files), so you should confirm the
334 words with the user before adding them. 334 words with the user before adding them.
335*/ 335*/
336void Global::addWords(const QString& dictname, const QStringList& wordlist) 336void Global::addWords(const QString& dictname, const QStringList& wordlist)
337{ 337{
338 QDawg& d = (QDawg&)dawg(dictname); 338 QDawg& d = (QDawg&)dawg(dictname);
339 QStringList all = d.allWords() + wordlist; 339 QStringList all = d.allWords() + wordlist;
340 d.createFromWords(all); 340 d.createFromWords(all);
341 341
342 QString dawgfilename = applicationFileName("Dictionary", dictname) + ".dawg"; 342 QString dawgfilename = applicationFileName("Dictionary", dictname) + ".dawg";
343 QFile dawgfile(dawgfilename); 343 QFile dawgfile(dawgfilename);
344 if ( dawgfile.open(IO_WriteOnly) ) { 344 if ( dawgfile.open(IO_WriteOnly) ) {
345 d.write(&dawgfile); 345 d.write(&dawgfile);
346 dawgfile.close(); 346 dawgfile.close();
347 } 347 }
348 348
349 // #### Re-read the dawg here if we use mmap(). 349 // #### Re-read the dawg here if we use mmap().
350 350
351 // #### Signal other processes to re-read. 351 // #### Signal other processes to re-read.
352} 352}
353 353
354 354
355/*! 355/*!
356 Returns the full path for the application called \a appname, with the 356 Returns the full path for the application called \a appname, with the
357 given \a filename. Returns QString::null if there was a problem creating 357 given \a filename. Returns QString::null if there was a problem creating
358 the directory tree for \a appname. 358 the directory tree for \a appname.
359 If \a filename contains "/", it is the caller's responsibility to 359 If \a filename contains "/", it is the caller's responsibility to
360 ensure that those directories exist. 360 ensure that those directories exist.
361*/ 361*/
362QString Global::applicationFileName(const QString& appname, const QString& filename) 362QString Global::applicationFileName(const QString& appname, const QString& filename)
363{ 363{
364 QDir d; 364 QDir d;
365 QString r = getenv("HOME"); 365 QString r = getenv("HOME");
366 r += "/Applications/"; 366 r += "/Applications/";
367 if ( !QFile::exists( r ) ) 367 if ( !QFile::exists( r ) )
368 if ( d.mkdir(r) == false ) 368 if ( d.mkdir(r) == false )
369 return QString::null; 369 return QString::null;
370 r += appname; 370 r += appname;
371 if ( !QFile::exists( r ) ) 371 if ( !QFile::exists( r ) )
372 if ( d.mkdir(r) == false ) 372 if ( d.mkdir(r) == false )
373 return QString::null; 373 return QString::null;
374 r += "/"; r += filename; 374 r += "/"; r += filename;
375 return r; 375 return r;
376} 376}
377 377
378/*! 378/*!
379 \internal 379 \internal
380*/ 380*/
381void Global::createDocDir() 381void Global::createDocDir()
382{ 382{
383 if ( !docDirCreated ) { 383 if ( !docDirCreated ) {
384 docDirCreated = TRUE; 384 docDirCreated = TRUE;
385 mkdir( QPEApplication::documentDir().latin1(), 0755 ); 385 mkdir( QPEApplication::documentDir().latin1(), 0755 );
386 } 386 }
387} 387}
388 388
389 389
390/*! 390/*!
391 Displays a status \a message to the user. This usually appears 391 Displays a status \a message to the user. This usually appears
392 in the taskbar for a short amount of time, then disappears. 392 in the taskbar for a short amount of time, then disappears.
393*/ 393*/
394void Global::statusMessage(const QString& message) 394void Global::statusMessage(const QString& message)
395{ 395{
396#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 396#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
397 QCopEnvelope e( "QPE/TaskBar", "message(QString)" ); 397 QCopEnvelope e( "QPE/TaskBar", "message(QString)" );
398 e << message; 398 e << message;
399#endif 399#endif
400} 400}
401 401
402/*! 402/*!
403 \internal 403 \internal
404*/ 404*/
405void Global::applyStyle() 405void Global::applyStyle()
406{ 406{
407#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 407#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
408 QCopChannel::send( "QPE/System", "applyStyle()" ); 408 QCopChannel::send( "QPE/System", "applyStyle()" );
409#else 409#else
410 ((QPEApplication *)qApp)->applyStyle(); // apply without needing QCop for floppy version 410 ((QPEApplication *)qApp)->applyStyle(); // apply without needing QCop for floppy version
411#endif 411#endif
412} 412}
413 413
414/*! 414/*!
415 \internal 415 \internal
416*/ 416*/
417QWidget *Global::shutdown( bool ) 417QWidget *Global::shutdown( bool )
418{ 418{
419#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 419#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
420 QCopChannel::send( "QPE/System", "shutdown()" ); 420 QCopChannel::send( "QPE/System", "shutdown()" );
421#endif 421#endif
422 return 0; 422 return 0;
423} 423}
424 424
425/*! 425/*!
426 \internal 426 \internal
427*/ 427*/
428QWidget *Global::restart( bool ) 428QWidget *Global::restart( bool )
429{ 429{
430#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 430#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
431 QCopChannel::send( "QPE/System", "restart()" ); 431 QCopChannel::send( "QPE/System", "restart()" );
432#endif 432#endif
433 return 0; 433 return 0;
434} 434}
435 435
436/*! 436/*!
437 Explicitly show the current input method. 437 Explicitly show the current input method.
438 438
439 Input methods are indicated in the taskbar by a small icon. If the 439 Input methods are indicated in the taskbar by a small icon. If the
440 input method is activated (shown) then it takes up some proportion 440 input method is activated (shown) then it takes up some proportion
441 of the bottom of the screen, to allow the user to interact (input 441 of the bottom of the screen, to allow the user to interact (input
442 characters) with it. 442 characters) with it.
443 443
444 \sa hideInputMethod() 444 \sa hideInputMethod()
445*/ 445*/
446void Global::showInputMethod() 446void Global::showInputMethod()
447{ 447{
448#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 448#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
449 QCopChannel::send( "QPE/TaskBar", "showInputMethod()" ); 449 QCopChannel::send( "QPE/TaskBar", "showInputMethod()" );
450#endif 450#endif
451} 451}
452 452
453/*! 453/*!
454 Explicitly hide the current input method. 454 Explicitly hide the current input method.
455 455
456 The current input method is still indicated in the taskbar, but no 456 The current input method is still indicated in the taskbar, but no
457 longer takes up screen space, and can no longer be interacted with. 457 longer takes up screen space, and can no longer be interacted with.
458 458
459 \sa showInputMethod() 459 \sa showInputMethod()
460*/ 460*/
461void Global::hideInputMethod() 461void Global::hideInputMethod()
462{ 462{
463#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 463#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
464 QCopChannel::send( "QPE/TaskBar", "hideInputMethod()" ); 464 QCopChannel::send( "QPE/TaskBar", "hideInputMethod()" );
465#endif 465#endif
466} 466}
467 467
468 468
469/*! 469/*!
470 \internal 470 \internal
471*/ 471*/
472bool Global::isBuiltinCommand( const QString &name ) 472bool Global::isBuiltinCommand( const QString &name )
473{ 473{
474 if(!builtin) 474 if(!builtin)
475 return FALSE; // yes, it can happen 475 return FALSE; // yes, it can happen
476 for (int i = 0; builtin[i].file; i++) { 476 for (int i = 0; builtin[i].file; i++) {
477 if ( builtin[i].file == name ) { 477 if ( builtin[i].file == name ) {
478 return TRUE; 478 return TRUE;
479 } 479 }
480 } 480 }
481 return FALSE; 481 return FALSE;
482} 482}
483 483
484Global::Command* Global::builtin=0; 484Global::Command* Global::builtin=0;
485QGuardedPtr<QWidget> *Global::running=0; 485QGuardedPtr<QWidget> *Global::running=0;
486 486
487/*! 487/*!
488 \class Global::Command 488 \class Global::Command
489 \brief The Global::Command class is internal. 489 \brief The Global::Command class is internal.
490 \internal 490 \internal
491*/ 491*/
492 492
493/*! 493/*!
494 \internal 494 \internal
495*/ 495*/
496void Global::setBuiltinCommands( Command* list ) 496void Global::setBuiltinCommands( Command* list )
497{ 497{
498 if ( running ) 498 if ( running )
499 delete [] running; 499 delete [] running;
500 500
501 builtin = list; 501 builtin = list;
502 int count = 0; 502 int count = 0;
503 if (!builtin) 503 if (!builtin)
504 return; 504 return;
505 while ( builtin[count].file ) 505 while ( builtin[count].file )
506 count++; 506 count++;
507 507
508 running = new QGuardedPtr<QWidget> [ count ]; 508 running = new QGuardedPtr<QWidget> [ count ];
509} 509}
510 510
511/*! 511/*!
512 \internal 512 \internal
513*/ 513*/
514void Global::setDocument( QWidget* receiver, const QString& document ) 514void Global::setDocument( QWidget* receiver, const QString& document )
515{ 515{
516 Emitter emitter(receiver,document); 516 Emitter emitter(receiver,document);
517} 517}
518 518
519/*! 519/*!
520 \internal 520 \internal
521*/ 521*/
522bool Global::terminateBuiltin( const QString& n ) 522bool Global::terminateBuiltin( const QString& n )
523{ 523{
524 if (!builtin) 524 if (!builtin)
525 return FALSE; 525 return FALSE;
526 for (int i = 0; builtin[i].file; i++) { 526 for (int i = 0; builtin[i].file; i++) {
527 if ( builtin[i].file == n ) { 527 if ( builtin[i].file == n ) {
528 delete running[i]; 528 delete running[i];
529 return TRUE; 529 return TRUE;
530 } 530 }
531 } 531 }
532 return FALSE; 532 return FALSE;
533} 533}
534 534
535/*! 535/*!
536 \internal 536 \internal
537*/ 537*/
538void Global::terminate( const AppLnk* app ) 538void Global::terminate( const AppLnk* app )
539{ 539{
540 //if ( terminateBuiltin(app->exec()) ) return; // maybe? haven't tried this 540 //if ( terminateBuiltin(app->exec()) ) return; // maybe? haven't tried this
541 541
542#ifndef QT_NO_COP 542#ifndef QT_NO_COP
543 QCString channel = "QPE/Application/" + app->exec().utf8(); 543 QCString channel = "QPE/Application/" + app->exec().utf8();
544 if ( QCopChannel::isRegistered(channel) ) { 544 if ( QCopChannel::isRegistered(channel) ) {
545 QCopEnvelope e(channel, "quit()"); 545 QCopEnvelope e(channel, "quit()");
546 } 546 }
547#endif 547#endif
548} 548}
549 549
550/*! 550/*!
551 Low-level function to run command \a c. 551 Low-level function to run command \a c.
552 552
553 \warning Do not use this function. Use execute instead. 553 \warning Do not use this function. Use execute instead.
554 554
555 \sa execute() 555 \sa execute()
556*/ 556*/
557void Global::invoke(const QString &c) 557void Global::invoke(const QString &c)
558{ 558{
559 // Convert the command line in to a list of arguments 559 // Convert the command line in to a list of arguments
560 QStringList list = QStringList::split(QRegExp(" *"),c); 560 QStringList list = QStringList::split(QRegExp(" *"),c);
561 561
562#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 562#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
563 QString ap=list[0]; 563 QString ap=list[0];
564 // see if the application is already running 564 // see if the application is already running
565 // XXX should lock file /tmp/qcop-msg-ap 565 // XXX should lock file /tmp/qcop-msg-ap
566 if ( QCopChannel::isRegistered( ("QPE/Application/" + ap).latin1() ) ) { 566 if ( QCopChannel::isRegistered( ("QPE/Application/" + ap).latin1() ) ) {
567 // If the channel is already register, the app is already running, so show it.
568 { QCopEnvelope env( ("QPE/Application/" + ap).latin1(), "raise()" ); }
569
567 QCopEnvelope e("QPE/System", "notBusy(QString)" ); 570 QCopEnvelope e("QPE/System", "notBusy(QString)" );
568 e << ap; 571 e << ap;
569 return; 572 return;
570 } 573 }
571 // XXX should unlock file /tmp/qcop-msg-ap 574 // XXX should unlock file /tmp/qcop-msg-ap
572 //see if it is being started 575 //see if it is being started
573 if ( StartingAppList::isStarting( ap ) ) { 576 if ( StartingAppList::isStarting( ap ) ) {
574 QCopEnvelope e("QPE/System", "notBusy(QString)" ); 577 QCopEnvelope e("QPE/System", "notBusy(QString)" );
575 e << ap; 578 e << ap;
576 return; 579 return;
577 } 580 }
578 581
579#endif 582#endif
580 583
581#ifdef QT_NO_QWS_MULTIPROCESS 584#ifdef QT_NO_QWS_MULTIPROCESS
582 QMessageBox::warning( 0, "Error", "Could not find the application " + c, "Ok", 0, 0, 0, 1 ); 585 QMessageBox::warning( 0, "Error", "Could not find the application " + c, "Ok", 0, 0, 0, 1 );
583#else 586#else
584 587
585 QStrList slist; 588 QStrList slist;
586 unsigned int j; 589 unsigned int j;
587 for ( j = 0; j < list.count(); j++ ) 590 for ( j = 0; j < list.count(); j++ )
588 slist.append( list[j].utf8() ); 591 slist.append( list[j].utf8() );
589 592
590 const char **args = new (const char *)[slist.count() + 1]; 593 const char **args = new (const char *)[slist.count() + 1];
591 for ( j = 0; j < slist.count(); j++ ) 594 for ( j = 0; j < slist.count(); j++ )
592 args[j] = slist.at(j); 595 args[j] = slist.at(j);
593 args[j] = NULL; 596 args[j] = NULL;
594 597
595#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 598#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
596 // an attempt to show a wait... 599 // an attempt to show a wait...
597 // more logic should be used, but this will be fine for the moment... 600 // more logic should be used, but this will be fine for the moment...
598 QCopEnvelope ( "QPE/System", "busy()" ); 601 QCopEnvelope ( "QPE/System", "busy()" );
599#endif 602#endif
600 603
601#ifdef HAVE_QUICKEXEC 604#ifdef HAVE_QUICKEXEC
602 QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so"; 605 QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so";
603 qDebug("libfile = %s", libexe.latin1() ); 606 qDebug("libfile = %s", libexe.latin1() );
604 if ( QFile::exists( libexe ) ) { 607 if ( QFile::exists( libexe ) ) {
605 qDebug("calling quickexec %s", libexe.latin1() ); 608 qDebug("calling quickexec %s", libexe.latin1() );
606 quickexecv( libexe.utf8().data(), (const char **)args ); 609 quickexecv( libexe.utf8().data(), (const char **)args );
607 } else 610 } else
608#endif 611#endif
609 { 612 {
610 if ( !::vfork() ) { 613 if ( !::vfork() ) {
611 for ( int fd = 3; fd < 100; fd++ ) 614 for ( int fd = 3; fd < 100; fd++ )
612 ::close( fd ); 615 ::close( fd );
613 ::setpgid( ::getpid(), ::getppid() ); 616 ::setpgid( ::getpid(), ::getppid() );
614 // Try bindir first, so that foo/bar works too 617 // Try bindir first, so that foo/bar works too
615 ::execv( qpeDir()+"/bin/"+args[0], (char * const *)args ); 618 ::execv( qpeDir()+"/bin/"+args[0], (char * const *)args );
616 ::execvp( args[0], (char * const *)args ); 619 ::execvp( args[0], (char * const *)args );
617 _exit( -1 ); 620 _exit( -1 );
618 } 621 }
619 } 622 }
620 StartingAppList::add( list[0] ); 623 StartingAppList::add( list[0] );
621#endif //QT_NO_QWS_MULTIPROCESS 624#endif //QT_NO_QWS_MULTIPROCESS
622} 625}
623 626
624 627
625/*! 628/*!
626 Executes the application identfied by \a c, passing \a 629 Executes the application identfied by \a c, passing \a
627 document if it isn't null. 630 document if it isn't null.
628 631
629 Note that a better approach might be to send a QCop message to the 632 Note that a better approach might be to send a QCop message to the
630 application's QPE/Application/\e{appname} channel. 633 application's QPE/Application/\e{appname} channel.
631*/ 634*/
632void Global::execute( const QString &c, const QString& document ) 635void Global::execute( const QString &c, const QString& document )
633{ 636{
634 if ( qApp->type() != QApplication::GuiServer ) { 637 if ( qApp->type() != QApplication::GuiServer ) {
635 // ask the server to do the work 638 // ask the server to do the work
636#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 639#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
637 if ( document.isNull() ) { 640 if ( document.isNull() ) {
638 QCopEnvelope e( "QPE/System", "execute(QString)" ); 641 QCopEnvelope e( "QPE/System", "execute(QString)" );
639 e << c; 642 e << c;
640 } else { 643 } else {
641 QCopEnvelope e( "QPE/System", "execute(QString,QString)" ); 644 QCopEnvelope e( "QPE/System", "execute(QString,QString)" );
642 e << c << document; 645 e << c << document;
643 } 646 }
644#endif 647#endif
645 return; 648 return;
646 } 649 }
647 650
648 // Attempt to execute the app using a builtin class for the app first 651 // Attempt to execute the app using a builtin class for the app first
649 // else try and find it in the bin directory 652 // else try and find it in the bin directory
650 if (builtin) { 653 if (builtin) {
651 for (int i = 0; builtin[i].file; i++) { 654 for (int i = 0; builtin[i].file; i++) {
652 if ( builtin[i].file == c ) { 655 if ( builtin[i].file == c ) {
653 if ( running[i] ) { 656 if ( running[i] ) {
654 if ( !document.isNull() && builtin[i].documentary ) 657 if ( !document.isNull() && builtin[i].documentary )
655 setDocument(running[i], document); 658 setDocument(running[i], document);
656 running[i]->raise(); 659 running[i]->raise();
657 running[i]->show(); 660 running[i]->show();
658 running[i]->setActiveWindow(); 661 running[i]->setActiveWindow();
659 } else { 662 } else {
660 running[i] = builtin[i].func( builtin[i].maximized ); 663 running[i] = builtin[i].func( builtin[i].maximized );
661 } 664 }
662#ifndef QT_NO_COP 665#ifndef QT_NO_COP
663 QCopEnvelope e("QPE/System", "notBusy(QString)" ); 666 QCopEnvelope e("QPE/System", "notBusy(QString)" );
664 e << c; // that was quick ;-) 667 e << c; // that was quick ;-)
665#endif 668#endif
666 return; 669 return;
667 } 670 }
668 } 671 }
669 } 672 }
670 673
671 //Global::invoke(c, document); 674 //Global::invoke(c, document);
672 675
673 // Convert the command line in to a list of arguments 676 // Convert the command line in to a list of arguments
674 QStringList list = QStringList::split(QRegExp(" *"),c); 677 QStringList list = QStringList::split(QRegExp(" *"),c);
675 678
676#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 679#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
677 QString ap=list[0]; 680 QString ap=list[0];
678 681
679 qDebug("executing %s", ap.latin1() ); 682 qDebug("executing %s", ap.latin1() );
680 if ( ap == "suspend" ) { 683 if ( ap == "suspend" ) {
681 QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); 684 QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE );
682 return; 685 return;
683 } 686 }
684 687
685 /* if need be, sending a qcop message will result in an invoke, see 688 /* if need be, sending a qcop message will result in an invoke, see
686 preceeding function */ 689 preceeding function */
687 invoke( ap ); 690 invoke( ap );
688 //{ QCopEnvelope env( ("QPE/Application/" + ap).latin1(), "raise()" ); } 691 //{ QCopEnvelope env( ("QPE/Application/" + ap).latin1(), "raise()" ); }
689 if ( !document.isEmpty() ) { 692 if ( !document.isEmpty() ) {
690 QCopEnvelope env( ("QPE/Application/" + ap).latin1(), "setDocument(QString)" ); 693 QCopEnvelope env( ("QPE/Application/" + ap).latin1(), "setDocument(QString)" );
691 env << document; 694 env << document;
692 } 695 }
693#endif 696#endif
694} 697}
695 698
696/*! 699/*!
697 Returns the string \a s with the characters '\', '"', and '$' quoted 700 Returns the string \a s with the characters '\', '"', and '$' quoted
698 by a preceeding '\'. 701 by a preceeding '\'.
699 702
700 \sa stringQuote() 703 \sa stringQuote()
701*/ 704*/
702QString Global::shellQuote(const QString& s) 705QString Global::shellQuote(const QString& s)
703{ 706{
704 QString r="\""; 707 QString r="\"";
705 for (int i=0; i<(int)s.length(); i++) { 708 for (int i=0; i<(int)s.length(); i++) {
706 char c = s[i].latin1(); 709 char c = s[i].latin1();
707 switch (c) { 710 switch (c) {
708 case '\\': case '"': case '$': 711 case '\\': case '"': case '$':
709 r+="\\"; 712 r+="\\";
710 } 713 }
711 r += s[i]; 714 r += s[i];
712 } 715 }
713 r += "\""; 716 r += "\"";
714 return r; 717 return r;
715} 718}
716 719
717/*! 720/*!
718 Returns the string \a s with the characters '\' and '"' quoted by a 721 Returns the string \a s with the characters '\' and '"' quoted by a
719 preceeding '\'. 722 preceeding '\'.
720 723
721 \sa shellQuote() 724 \sa shellQuote()
722*/ 725*/
723QString Global::stringQuote(const QString& s) 726QString Global::stringQuote(const QString& s)
724{ 727{
725 QString r="\""; 728 QString r="\"";
726 for (int i=0; i<(int)s.length(); i++) { 729 for (int i=0; i<(int)s.length(); i++) {
727 char c = s[i].latin1(); 730 char c = s[i].latin1();
728 switch (c) { 731 switch (c) {
729 case '\\': case '"': 732 case '\\': case '"':
730 r+="\\"; 733 r+="\\";
731 } 734 }
732 r += s[i]; 735 r += s[i];
733 } 736 }
734 r += "\""; 737 r += "\"";
735 return r; 738 return r;
736} 739}
737 740
738/*! 741/*!
739 Finds all documents on the system's document directories which 742 Finds all documents on the system's document directories which
740 match the filter \a mimefilter, and appends the resulting DocLnk 743 match the filter \a mimefilter, and appends the resulting DocLnk
741 objects to \a folder. 744 objects to \a folder.
742*/ 745*/
743void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter) 746void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter)
744{ 747{
745 QString homedocs = QString(getenv("HOME")) + "/Documents"; 748 QString homedocs = QString(getenv("HOME")) + "/Documents";
746 DocLnkSet d(homedocs,mimefilter); 749 DocLnkSet d(homedocs,mimefilter);
747 folder->appendFrom(d); 750 folder->appendFrom(d);
748 /** let's do intellegint way of searching these files 751 /** let's do intellegint way of searching these files
749 * a) the user don't want to check mediums global 752 * a) the user don't want to check mediums global
750 * b) the user wants to check but use the global options for it 753 * b) the user wants to check but use the global options for it
751 * c) the user wants to check it but not this medium 754 * c) the user wants to check it but not this medium
752 * d) the user wants to check and this medium as well 755 * d) the user wants to check and this medium as well
753 * 756 *
754 * In all cases we need to apply a different mimefilter to 757 * In all cases we need to apply a different mimefilter to
755 * the medium. 758 * the medium.
756 * a) mimefilter.isEmpty() we need to apply the responding filter 759 * a) mimefilter.isEmpty() we need to apply the responding filter
757 * either the global or the one on the medium 760 * either the global or the one on the medium
758 * 761 *
759 * b) mimefilter is set to an application we need to find out if the 762 * b) mimefilter is set to an application we need to find out if the
760 * mimetypes are included in the mime mask of the medium 763 * mimetypes are included in the mime mask of the medium
761 */ 764 */
762 StorageInfo storage; 765 StorageInfo storage;
763 const QList<FileSystem> &fs = storage.fileSystems(); 766 const QList<FileSystem> &fs = storage.fileSystems();
764 QListIterator<FileSystem> it ( fs ); 767 QListIterator<FileSystem> it ( fs );
765 for ( ; it.current(); ++it ) { 768 for ( ; it.current(); ++it ) {
766 if ( (*it)->isRemovable() ) { // let's find out if we should search on it 769 if ( (*it)->isRemovable() ) { // let's find out if we should search on it
767 // this is a candidate look at the cf and see if we should search on it 770 // this is a candidate look at the cf and see if we should search on it
768 QString path = (*it)->path(); 771 QString path = (*it)->path();
769 if( !checkStorage((*it)->path() + "/.opiestorage.cf" ) ) 772 if( !checkStorage((*it)->path() + "/.opiestorage.cf" ) )
770 continue; 773 continue;
771 DocLnkSet ide( path, mimefilter ); 774 DocLnkSet ide( path, mimefilter );
772 folder->appendFrom(ide); 775 folder->appendFrom(ide);
773 } else if ( (*it)->disk() == "/dev/mtdblock6" || (*it)->disk() == "tmpfs" ) { 776 } else if ( (*it)->disk() == "/dev/mtdblock6" || (*it)->disk() == "tmpfs" ) {
774 QString path = (*it)->path() + "/Documents"; 777 QString path = (*it)->path() + "/Documents";
775 DocLnkSet ide( path, mimefilter ); 778 DocLnkSet ide( path, mimefilter );
776 folder->appendFrom(ide); 779 folder->appendFrom(ide);
777 } 780 }
778 } 781 }
779} 782}
780 783
781QStringList Global::languageList() 784QStringList Global::languageList()
782{ 785{
783 QString lang = getenv("LANG"); 786 QString lang = getenv("LANG");
784 QStringList langs; 787 QStringList langs;
785 langs.append(lang); 788 langs.append(lang);
786 int i = lang.find("."); 789 int i = lang.find(".");
787 if ( i > 0 ) 790 if ( i > 0 )
788 lang = lang.left( i ); 791 lang = lang.left( i );
789 i = lang.find( "_" ); 792 i = lang.find( "_" );
790 if ( i > 0 ) 793 if ( i > 0 )
791 langs.append(lang.left(i)); 794 langs.append(lang.left(i));
792 return langs; 795 return langs;
793} 796}
794 797
795QStringList Global::helpPath() 798QStringList Global::helpPath()
796{ 799{
797 QStringList path; 800 QStringList path;
798 QStringList langs = Global::languageList(); 801 QStringList langs = Global::languageList();
799 for (QStringList::ConstIterator it = langs.fromLast(); it!=langs.end(); --it) { 802 for (QStringList::ConstIterator it = langs.fromLast(); it!=langs.end(); --it) {
800 QString lang = *it; 803 QString lang = *it;
801 if ( !lang.isEmpty() ) 804 if ( !lang.isEmpty() )
802 path += QPEApplication::qpeDir() + "/help/" + lang + "/html"; 805 path += QPEApplication::qpeDir() + "/help/" + lang + "/html";
803 } 806 }
804 path += QPEApplication::qpeDir() + "/pics"; 807 path += QPEApplication::qpeDir() + "/pics";
805 path += QPEApplication::qpeDir() + "/help/html"; 808 path += QPEApplication::qpeDir() + "/help/html";
806 path += QPEApplication::qpeDir() + "/docs"; 809 path += QPEApplication::qpeDir() + "/docs";
807 810
808 811
809 return path; 812 return path;
810} 813}
811 814
812 815
813#include "global.moc" 816#include "global.moc"