summaryrefslogtreecommitdiff
path: root/library/global.cpp
Unidiff
Diffstat (limited to 'library/global.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/global.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/global.cpp b/library/global.cpp
index e1bbf3e..e5fc2b3 100644
--- a/library/global.cpp
+++ b/library/global.cpp
@@ -89,97 +89,97 @@ StartingAppList::StartingAppList( QObject *parent, const char* name )
89 connect( qwsServer, SIGNAL( newChannel(const QString&)), 89 connect( qwsServer, SIGNAL( newChannel(const QString&)),
90 this, SLOT( handleNewChannel(const QString&)) ); 90 this, SLOT( handleNewChannel(const QString&)) );
91 dict.setAutoDelete( TRUE ); 91 dict.setAutoDelete( TRUE );
92#endif 92#endif
93} 93}
94 94
95void StartingAppList::add( const QString& name ) 95void StartingAppList::add( const QString& name )
96{ 96{
97#if QT_VERSION >= 232 && !defined(QT_NO_COP) 97#if QT_VERSION >= 232 && !defined(QT_NO_COP)
98 if ( !appl ) 98 if ( !appl )
99 appl = new StartingAppList; 99 appl = new StartingAppList;
100 QTime *t = new QTime; 100 QTime *t = new QTime;
101 t->start(); 101 t->start();
102 appl->dict.insert( "QPE/Application/" + name, t ); 102 appl->dict.insert( "QPE/Application/" + name, t );
103#endif 103#endif
104} 104}
105 105
106bool StartingAppList::isStarting( const QString name ) 106bool StartingAppList::isStarting( const QString name )
107{ 107{
108#if QT_VERSION >= 232 && !defined(QT_NO_COP) 108#if QT_VERSION >= 232 && !defined(QT_NO_COP)
109 if ( appl ) { 109 if ( appl ) {
110 QTime *t = appl->dict.find( "QPE/Application/" + name ); 110 QTime *t = appl->dict.find( "QPE/Application/" + name );
111 if ( !t ) 111 if ( !t )
112 return FALSE; 112 return FALSE;
113 if ( t->elapsed() > 10000 ) { 113 if ( t->elapsed() > 10000 ) {
114 // timeout in case of crash or something 114 // timeout in case of crash or something
115 appl->dict.remove( "QPE/Application/" + name ); 115 appl->dict.remove( "QPE/Application/" + name );
116 return FALSE; 116 return FALSE;
117 } 117 }
118 return TRUE; 118 return TRUE;
119 } 119 }
120#endif 120#endif
121 return FALSE; 121 return FALSE;
122} 122}
123 123
124void StartingAppList::handleNewChannel( const QString & name ) 124void StartingAppList::handleNewChannel( const QString & name )
125{ 125{
126#if QT_VERSION >= 232 && !defined(QT_NO_COP) 126#if QT_VERSION >= 232 && !defined(QT_NO_COP)
127 dict.remove( name ); 127 dict.remove( name );
128#endif 128#endif
129} 129}
130 130
131static bool docDirCreated = FALSE; 131static bool docDirCreated = FALSE;
132static QDawg* fixed_dawg = 0; 132static QDawg* fixed_dawg = 0;
133static QDict<QDawg> *named_dawg = 0; 133static QDict<QDawg> *named_dawg = 0;
134 134
135static QString qpeDir() 135static QString qpeDir()
136{ 136{
137 QString dir = getenv("QPEDIR"); 137 QString dir = getenv("OPIEDIR");
138 if ( dir.isEmpty() ) dir = ".."; 138 if ( dir.isEmpty() ) dir = "..";
139 return dir; 139 return dir;
140} 140}
141 141
142static QString dictDir() 142static QString dictDir()
143{ 143{
144 return qpeDir() + "/etc/dict"; 144 return qpeDir() + "/etc/dict";
145} 145}
146 146
147/*! 147/*!
148 \class Global global.h 148 \class Global global.h
149 \brief The Global class collects application-wide global functions. 149 \brief The Global class collects application-wide global functions.
150*/ 150*/
151 151
152/*! 152/*!
153 \internal 153 \internal
154*/ 154*/
155Global::Global() 155Global::Global()
156{ 156{
157} 157}
158 158
159/*! 159/*!
160 Returns the unchangeable QDawg that contains general 160 Returns the unchangeable QDawg that contains general
161 words for the current locale. 161 words for the current locale.
162 162
163 \sa addedDawg() 163 \sa addedDawg()
164*/ 164*/
165const QDawg& Global::fixedDawg() 165const QDawg& Global::fixedDawg()
166{ 166{
167 if ( !fixed_dawg ) { 167 if ( !fixed_dawg ) {
168 if ( !docDirCreated ) 168 if ( !docDirCreated )
169 createDocDir(); 169 createDocDir();
170 170
171 fixed_dawg = new QDawg; 171 fixed_dawg = new QDawg;
172 QString dawgfilename = dictDir() + "/dawg"; 172 QString dawgfilename = dictDir() + "/dawg";
173 QString lang = getenv( "LANG" ); 173 QString lang = getenv( "LANG" );
174 QString dawgfilename_lang = dawgfilename + "." + lang; 174 QString dawgfilename_lang = dawgfilename + "." + lang;
175 QString words_lang = dictDir() + "/words." + lang; 175 QString words_lang = dictDir() + "/words." + lang;
176 if ( QFile::exists(dawgfilename_lang) || 176 if ( QFile::exists(dawgfilename_lang) ||
177 QFile::exists(words_lang) ) 177 QFile::exists(words_lang) )
178 dawgfilename = dawgfilename_lang; 178 dawgfilename = dawgfilename_lang;
179 QFile dawgfile(dawgfilename); 179 QFile dawgfile(dawgfilename);
180 180
181 if ( !dawgfile.exists() ) { 181 if ( !dawgfile.exists() ) {
182 QString fn = dictDir() + "/words"; 182 QString fn = dictDir() + "/words";
183 if ( QFile::exists(words_lang) ) 183 if ( QFile::exists(words_lang) )
184 fn = words_lang; 184 fn = words_lang;
185 QFile in(fn); 185 QFile in(fn);