author | mickeyl <mickeyl> | 2004-04-04 17:22:44 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 17:22:44 (UTC) |
commit | ea3708cbc40ebc5f1db70546f0a93e8a23ba967c (patch) (unidiff) | |
tree | 7262b5c61f96db0062d8e079dbb50d9ad5f2045e | |
parent | 5dc77f8c1ef0b22d208a629ebbb61476909569be (diff) | |
download | opie-ea3708cbc40ebc5f1db70546f0a93e8a23ba967c.zip opie-ea3708cbc40ebc5f1db70546f0a93e8a23ba967c.tar.gz opie-ea3708cbc40ebc5f1db70546f0a93e8a23ba967c.tar.bz2 |
fix odebug usage
-rw-r--r-- | core/pim/today/today.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 3ddb88d..0a6269e 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -181,57 +181,57 @@ void Today::loadPlugins() { | |||
181 | for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { | 181 | for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { |
182 | (*tit).guiBox->hide(); | 182 | (*tit).guiBox->hide(); |
183 | (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); | 183 | (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); |
184 | delete (*tit).guiBox; | 184 | delete (*tit).guiBox; |
185 | (*tit).library->unload(); | 185 | (*tit).library->unload(); |
186 | delete (*tit).library; | 186 | delete (*tit).library; |
187 | } | 187 | } |
188 | pluginList.clear(); | 188 | pluginList.clear(); |
189 | } | 189 | } |
190 | 190 | ||
191 | QString path = QPEApplication::qpeDir() + "/plugins/today"; | 191 | QString path = QPEApplication::qpeDir() + "/plugins/today"; |
192 | #ifdef Q_OS_MACX | 192 | #ifdef Q_OS_MACX |
193 | Opie::Core::owarn << "Searching for Plugins in: " << path << oendl; | 193 | owarn << "Searching for Plugins in: " << path << oendl; |
194 | QDir dir( path, "lib*.dylib" ); | 194 | QDir dir( path, "lib*.dylib" ); |
195 | #else | 195 | #else |
196 | QDir dir( path, "lib*.so" ); | 196 | QDir dir( path, "lib*.so" ); |
197 | #endif | 197 | #endif |
198 | 198 | ||
199 | QStringList list = dir.entryList(); | 199 | QStringList list = dir.entryList(); |
200 | QStringList::Iterator it; | 200 | QStringList::Iterator it; |
201 | 201 | ||
202 | // QMap<QString, TodayPlugin> tempList; | 202 | // QMap<QString, TodayPlugin> tempList; |
203 | 203 | ||
204 | for ( it = list.begin(); it != list.end(); ++it ) { | 204 | for ( it = list.begin(); it != list.end(); ++it ) { |
205 | QInterfacePtr<TodayPluginInterface> iface; | 205 | QInterfacePtr<TodayPluginInterface> iface; |
206 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 206 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
207 | 207 | ||
208 | Opie::Core::odebug << "querying: " << path + "/" + *it << oendl; | 208 | odebug << "querying: " << path + "/" + *it << oendl; |
209 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | 209 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { |
210 | Opie::Core::odebug << "accepted: " << path + "/" + *it << oendl; | 210 | odebug << "accepted: " << path + "/" + *it << oendl; |
211 | Opie::Core::odebug << *it << oendl; | 211 | odebug << *it << oendl; |
212 | 212 | ||
213 | TodayPlugin plugin; | 213 | TodayPlugin plugin; |
214 | plugin.library = lib; | 214 | plugin.library = lib; |
215 | plugin.iface = iface; | 215 | plugin.iface = iface; |
216 | plugin.name = QString(*it); | 216 | plugin.name = QString(*it); |
217 | 217 | ||
218 | QString type = (*it).left( (*it).find(".") ); | 218 | QString type = (*it).left( (*it).find(".") ); |
219 | 219 | ||
220 | QString lang; | 220 | QString lang; |
221 | Config config("locale"); | 221 | Config config("locale"); |
222 | config.setGroup("Language"); | 222 | config.setGroup("Language"); |
223 | lang = config.readEntry( "Language", "en" ); | 223 | lang = config.readEntry( "Language", "en" ); |
224 | 224 | ||
225 | Opie::Core::odebug << "Languages: " << lang << oendl; | 225 | odebug << "Languages: " << lang << oendl; |
226 | QTranslator * trans = new QTranslator( qApp ); | 226 | QTranslator * trans = new QTranslator( qApp ); |
227 | QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm"; | 227 | QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm"; |
228 | if ( trans->load( tfn ) ) { | 228 | if ( trans->load( tfn ) ) { |
229 | qApp->installTranslator( trans ); | 229 | qApp->installTranslator( trans ); |
230 | } else { | 230 | } else { |
231 | delete trans; | 231 | delete trans; |
232 | } | 232 | } |
233 | 233 | ||
234 | 234 | ||
235 | // find out if plugins should be shown | 235 | // find out if plugins should be shown |
236 | if ( m_excludeApplets.grep( *it ).isEmpty() ) { | 236 | if ( m_excludeApplets.grep( *it ).isEmpty() ) { |
237 | plugin.active = true; | 237 | plugin.active = true; |
@@ -264,25 +264,25 @@ void Today::loadPlugins() { | |||
264 | 264 | ||
265 | // on first start the list is off course empty | 265 | // on first start the list is off course empty |
266 | if ( m_allApplets.isEmpty() ) { | 266 | if ( m_allApplets.isEmpty() ) { |
267 | pluginList.append( plugin ); | 267 | pluginList.append( plugin ); |
268 | m_bblayout->addWidget( plugin.guiBox ); | 268 | m_bblayout->addWidget( plugin.guiBox ); |
269 | } | 269 | } |
270 | 270 | ||
271 | // if plugin is not yet in the list, add it to the layout too | 271 | // if plugin is not yet in the list, add it to the layout too |
272 | else if ( !m_allApplets.contains( plugin.name ) ) { | 272 | else if ( !m_allApplets.contains( plugin.name ) ) { |
273 | pluginList.append( plugin ); | 273 | pluginList.append( plugin ); |
274 | } | 274 | } |
275 | } else { | 275 | } else { |
276 | Opie::Core::odebug << "could not recognize " << path + "/" + *it << oendl; | 276 | odebug << "could not recognize " << path + "/" + *it << oendl; |
277 | delete lib; | 277 | delete lib; |
278 | } | 278 | } |
279 | 279 | ||
280 | } | 280 | } |
281 | 281 | ||
282 | 282 | ||
283 | if ( !m_allApplets.isEmpty() ) { | 283 | if ( !m_allApplets.isEmpty() ) { |
284 | TodayPlugin tempPlugin; | 284 | TodayPlugin tempPlugin; |
285 | QStringList::Iterator stringit; | 285 | QStringList::Iterator stringit; |
286 | 286 | ||
287 | for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { | 287 | for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { |
288 | tempPlugin = ( tempList.find( *stringit ) ).data(); | 288 | tempPlugin = ( tempList.find( *stringit ) ).data(); |
@@ -308,28 +308,28 @@ void Today::draw() { | |||
308 | QLabel *noPlugins = new QLabel( this ); | 308 | QLabel *noPlugins = new QLabel( this ); |
309 | noPlugins->setText( tr( "No plugins found" ) ); | 309 | noPlugins->setText( tr( "No plugins found" ) ); |
310 | layout->addWidget( noPlugins ); | 310 | layout->addWidget( noPlugins ); |
311 | return; | 311 | return; |
312 | } | 312 | } |
313 | 313 | ||
314 | uint count = 0; | 314 | uint count = 0; |
315 | TodayPlugin plugin; | 315 | TodayPlugin plugin; |
316 | for ( uint i = 0; i < pluginList.count(); i++ ) { | 316 | for ( uint i = 0; i < pluginList.count(); i++ ) { |
317 | plugin = pluginList[i]; | 317 | plugin = pluginList[i]; |
318 | 318 | ||
319 | if ( plugin.active ) { | 319 | if ( plugin.active ) { |
320 | //Opie::Core::odebug << plugin.name << " is ACTIVE " << oendl; | 320 | //odebug << plugin.name << " is ACTIVE " << oendl; |
321 | plugin.guiBox->show(); | 321 | plugin.guiBox->show(); |
322 | } else { | 322 | } else { |
323 | //Opie::Core::odebug << plugin.name << " is INACTIVE " << oendl; | 323 | //odebug << plugin.name << " is INACTIVE " << oendl; |
324 | plugin.guiBox->hide(); | 324 | plugin.guiBox->hide(); |
325 | } | 325 | } |
326 | count++; | 326 | count++; |
327 | } | 327 | } |
328 | 328 | ||
329 | if ( count == 0 ) { | 329 | if ( count == 0 ) { |
330 | QLabel *noPluginsActive = new QLabel( this ); | 330 | QLabel *noPluginsActive = new QLabel( this ); |
331 | noPluginsActive->setText( tr( "No plugins activated" ) ); | 331 | noPluginsActive->setText( tr( "No plugins activated" ) ); |
332 | layout->addWidget( noPluginsActive ); | 332 | layout->addWidget( noPluginsActive ); |
333 | } | 333 | } |
334 | repaint(); | 334 | repaint(); |
335 | } | 335 | } |
@@ -388,25 +388,25 @@ void Today::startConfig() { | |||
388 | void Today::reinitialize() { | 388 | void Today::reinitialize() { |
389 | 389 | ||
390 | Config cfg( "today" ); | 390 | Config cfg( "today" ); |
391 | cfg.setGroup( "Plugins" ); | 391 | cfg.setGroup( "Plugins" ); |
392 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); | 392 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); |
393 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); | 393 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); |
394 | 394 | ||
395 | /* reinitialize all plugins */ | 395 | /* reinitialize all plugins */ |
396 | QValueList<TodayPlugin>::Iterator it; | 396 | QValueList<TodayPlugin>::Iterator it; |
397 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { | 397 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { |
398 | if ( !(*it).excludeRefresh ) { | 398 | if ( !(*it).excludeRefresh ) { |
399 | (*it).guiPart->reinitialize(); | 399 | (*it).guiPart->reinitialize(); |
400 | Opie::Core::odebug << "reinit" << oendl; | 400 | odebug << "reinit" << oendl; |
401 | } | 401 | } |
402 | 402 | ||
403 | /* check if plugins is still to be shown */ | 403 | /* check if plugins is still to be shown */ |
404 | if ( m_excludeApplets.grep( (*it).name ).isEmpty() ) { | 404 | if ( m_excludeApplets.grep( (*it).name ).isEmpty() ) { |
405 | (*it).active = true; | 405 | (*it).active = true; |
406 | } else { | 406 | } else { |
407 | (*it).active = false; | 407 | (*it).active = false; |
408 | } | 408 | } |
409 | 409 | ||
410 | } | 410 | } |
411 | 411 | ||
412 | cfg.setGroup( "General" ); | 412 | cfg.setGroup( "General" ); |
@@ -442,25 +442,25 @@ void Today::reinitialize() { | |||
442 | } | 442 | } |
443 | 443 | ||
444 | /** | 444 | /** |
445 | * Refresh for the view. Reload all applets | 445 | * Refresh for the view. Reload all applets |
446 | * | 446 | * |
447 | */ | 447 | */ |
448 | void Today::refresh() { | 448 | void Today::refresh() { |
449 | 449 | ||
450 | QValueList<TodayPlugin>::Iterator it; | 450 | QValueList<TodayPlugin>::Iterator it; |
451 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { | 451 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { |
452 | if ( !(*it).excludeRefresh ) { | 452 | if ( !(*it).excludeRefresh ) { |
453 | (*it).guiPart->refresh(); | 453 | (*it).guiPart->refresh(); |
454 | Opie::Core::odebug << "refresh" << oendl; | 454 | odebug << "refresh" << oendl; |
455 | } | 455 | } |
456 | } | 456 | } |
457 | 457 | ||
458 | DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( QDate::currentDate() ) + "</font>" ) ); | 458 | DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( QDate::currentDate() ) + "</font>" ) ); |
459 | 459 | ||
460 | updateGeometry(); | 460 | updateGeometry(); |
461 | repaint(); | 461 | repaint(); |
462 | } | 462 | } |
463 | 463 | ||
464 | void Today::startApplication() { | 464 | void Today::startApplication() { |
465 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 465 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
466 | e << QString( sender()->name() ); | 466 | e << QString( sender()->name() ); |