summaryrefslogtreecommitdiff
path: root/library/global.cpp
Unidiff
Diffstat (limited to 'library/global.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/global.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/library/global.cpp b/library/global.cpp
index 5c89430..90954fe 100644
--- a/library/global.cpp
+++ b/library/global.cpp
@@ -168,98 +168,100 @@ static QString dictDir()
168 168
169/*! 169/*!
170 \class Global global.h 170 \class Global global.h
171 \brief The Global class provides application-wide global functions. 171 \brief The Global class provides application-wide global functions.
172 172
173 The Global functions are grouped as follows: 173 The Global functions are grouped as follows:
174 \tableofcontents 174 \tableofcontents
175 175
176 \section1 User Interface 176 \section1 User Interface
177 177
178 The statusMessage() function provides short-duration messages to the 178 The statusMessage() function provides short-duration messages to the
179 user. The showInputMethod() function shows the current input method, 179 user. The showInputMethod() function shows the current input method,
180 and hideInputMethod() hides the input method. 180 and hideInputMethod() hides the input method.
181 181
182 \section1 Document related 182 \section1 Document related
183 183
184 The findDocuments() function creates a set of \link doclnk.html 184 The findDocuments() function creates a set of \link doclnk.html
185 DocLnk\endlink objects in a particular folder. 185 DocLnk\endlink objects in a particular folder.
186 186
187 \section1 Filesystem related 187 \section1 Filesystem related
188 188
189 Global provides an applicationFileName() function that returns the 189 Global provides an applicationFileName() function that returns the
190 full path of an application-specific file. 190 full path of an application-specific file.
191 191
192 The execute() function runs an application. 192 The execute() function runs an application.
193 193
194 \section1 Word list related 194 \section1 Word list related
195 195
196 A list of words relevant to the current locale is maintained by the 196 A list of words relevant to the current locale is maintained by the
197 system. The list is held in a \link qdawg.html DAWG\endlink 197 system. The list is held in a \link qdawg.html DAWG\endlink
198 (implemented by the QDawg class). This list is used, for example, by 198 (implemented by the QDawg class). This list is used, for example, by
199 the pickboard input method. 199 the pickboard input method.
200 200
201 The global QDawg is returned by fixedDawg(); this cannot be updated. 201 The global QDawg is returned by fixedDawg(); this cannot be updated.
202 An updatable copy of the global QDawg is returned by addedDawg(). 202 An updatable copy of the global QDawg is returned by addedDawg().
203 Applications may have their own word lists stored in \l{QDawg}s 203 Applications may have their own word lists stored in \l{QDawg}s
204 which are returned by dawg(). Use addWords() to add words to the 204 which are returned by dawg(). Use addWords() to add words to the
205 updateable copy of the global QDawg or to named application 205 updateable copy of the global QDawg or to named application
206 \l{QDawg}s. 206 \l{QDawg}s.
207 207
208 \section1 Quoting 208 \section1 Quoting
209 209
210 The shellQuote() function quotes a string suitable for passing to a 210 The shellQuote() function quotes a string suitable for passing to a
211 shell. The stringQuote() function backslash escapes '\' and '"' 211 shell. The stringQuote() function backslash escapes '\' and '"'
212 characters. 212 characters.
213 213
214 \section1 Hardware 214 \section1 Hardware
215 215
216 The writeHWClock() function sets the hardware clock to the system 216 The implementation of the writeHWClock() function depends on the AlarmServer
217 clock's date and time. 217 implementation. If the AlarmServer is using atd the clock will be synced to
218 hardware. If opie-alarm is used the hardware clock will be synced before
219 suspending the device. opie-alarm is used by iPAQ and Zaurii implementation
218 220
219 \ingroup qtopiaemb 221 \ingroup qtopiaemb
220*/ 222*/
221 223
222/*! 224/*!
223 \internal 225 \internal
224*/ 226*/
225Global::Global() 227Global::Global()
226{ 228{
227} 229}
228 230
229/*! 231/*!
230 Returns the unchangeable QDawg that contains general 232 Returns the unchangeable QDawg that contains general
231 words for the current locale. 233 words for the current locale.
232 234
233 \sa addedDawg() 235 \sa addedDawg()
234*/ 236*/
235const QDawg& Global::fixedDawg() 237const QDawg& Global::fixedDawg()
236{ 238{
237 if ( !fixed_dawg ) { 239 if ( !fixed_dawg ) {
238 if ( !docDirCreated ) 240 if ( !docDirCreated )
239 createDocDir(); 241 createDocDir();
240 242
241 fixed_dawg = new QDawg; 243 fixed_dawg = new QDawg;
242 QString dawgfilename = dictDir() + "/dawg"; 244 QString dawgfilename = dictDir() + "/dawg";
243 QString words_lang; 245 QString words_lang;
244 QStringList langs = Global::languageList(); 246 QStringList langs = Global::languageList();
245 for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) { 247 for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) {
246 QString lang = *it; 248 QString lang = *it;
247 words_lang = dictDir() + "/words." + lang; 249 words_lang = dictDir() + "/words." + lang;
248 QString dawgfilename_lang = dawgfilename + "." + lang; 250 QString dawgfilename_lang = dawgfilename + "." + lang;
249 if ( QFile::exists(dawgfilename_lang) || 251 if ( QFile::exists(dawgfilename_lang) ||
250 QFile::exists(words_lang) ) { 252 QFile::exists(words_lang) ) {
251 dawgfilename = dawgfilename_lang; 253 dawgfilename = dawgfilename_lang;
252 break; 254 break;
253 } 255 }
254 } 256 }
255 QFile dawgfile(dawgfilename); 257 QFile dawgfile(dawgfilename);
256 258
257 if ( !dawgfile.exists() ) { 259 if ( !dawgfile.exists() ) {
258 QString fn = dictDir() + "/words"; 260 QString fn = dictDir() + "/words";
259 if ( QFile::exists(words_lang) ) 261 if ( QFile::exists(words_lang) )
260 fn = words_lang; 262 fn = words_lang;
261 QFile in(fn); 263 QFile in(fn);
262 if ( in.open(IO_ReadOnly) ) { 264 if ( in.open(IO_ReadOnly) ) {
263 fixed_dawg->createFromWords(&in); 265 fixed_dawg->createFromWords(&in);
264 dawgfile.open(IO_WriteOnly); 266 dawgfile.open(IO_WriteOnly);
265 fixed_dawg->write(&dawgfile); 267 fixed_dawg->write(&dawgfile);