author | drw <drw> | 2004-04-02 21:41:10 (UTC) |
---|---|---|
committer | drw <drw> | 2004-04-02 21:41:10 (UTC) |
commit | 6f335843b89f60fe009b43a4134e9b3753fff974 (patch) (unidiff) | |
tree | 5734d3080e664131cc575038d59858f1b0633af4 | |
parent | 67cf56e3907fba139e2d1ce612f9df29747b8201 (diff) | |
download | opie-6f335843b89f60fe009b43a4134e9b3753fff974.zip opie-6f335843b89f60fe009b43a4134e9b3753fff974.tar.gz opie-6f335843b89f60fe009b43a4134e9b3753fff974.tar.bz2 |
Use ODebug (another 10 down...)
-rw-r--r-- | core/pim/today/config.in | 2 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 22 |
2 files changed, 13 insertions, 11 deletions
diff --git a/core/pim/today/config.in b/core/pim/today/config.in index c4377e4..c663fc1 100644 --- a/core/pim/today/config.in +++ b/core/pim/today/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config TODAY | 1 | config TODAY |
2 | boolean "opie-today (today gives an overview of appointments and todos)" | 2 | boolean "opie-today (today gives an overview of appointments and todos)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && LIBOPIE2PIM | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && LIBOPIE2PIM |
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index ebcd2dd..3ddb88d 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -13,16 +13,18 @@ | |||
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | #define QTOPIA_INTERNAL_LANGLIST | 17 | #define QTOPIA_INTERNAL_LANGLIST |
18 | 18 | ||
19 | #include "today.h" | 19 | #include "today.h" |
20 | 20 | ||
21 | #include <opie2/odebug.h> | ||
22 | |||
21 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
22 | #include <qpe/qcopenvelope_qws.h> | 24 | #include <qpe/qcopenvelope_qws.h> |
23 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
24 | #include <qpe/qpeapplication.h> | 26 | #include <qpe/qpeapplication.h> |
25 | #include <qpe/contact.h> | 27 | #include <qpe/contact.h> |
26 | 28 | ||
27 | #include <qdir.h> | 29 | #include <qdir.h> |
28 | #include <qtimer.h> | 30 | #include <qtimer.h> |
@@ -183,49 +185,49 @@ void Today::loadPlugins() { | |||
183 | (*tit).library->unload(); | 185 | (*tit).library->unload(); |
184 | delete (*tit).library; | 186 | delete (*tit).library; |
185 | } | 187 | } |
186 | pluginList.clear(); | 188 | pluginList.clear(); |
187 | } | 189 | } |
188 | 190 | ||
189 | QString path = QPEApplication::qpeDir() + "/plugins/today"; | 191 | QString path = QPEApplication::qpeDir() + "/plugins/today"; |
190 | #ifdef Q_OS_MACX | 192 | #ifdef Q_OS_MACX |
191 | qWarning("Searching for Plugins in: %s", path.latin1()); | 193 | Opie::Core::owarn << "Searching for Plugins in: " << path << oendl; |
192 | QDir dir( path, "lib*.dylib" ); | 194 | QDir dir( path, "lib*.dylib" ); |
193 | #else | 195 | #else |
194 | QDir dir( path, "lib*.so" ); | 196 | QDir dir( path, "lib*.so" ); |
195 | #endif | 197 | #endif |
196 | 198 | ||
197 | QStringList list = dir.entryList(); | 199 | QStringList list = dir.entryList(); |
198 | QStringList::Iterator it; | 200 | QStringList::Iterator it; |
199 | 201 | ||
200 | // QMap<QString, TodayPlugin> tempList; | 202 | // QMap<QString, TodayPlugin> tempList; |
201 | 203 | ||
202 | for ( it = list.begin(); it != list.end(); ++it ) { | 204 | for ( it = list.begin(); it != list.end(); ++it ) { |
203 | QInterfacePtr<TodayPluginInterface> iface; | 205 | QInterfacePtr<TodayPluginInterface> iface; |
204 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 206 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
205 | 207 | ||
206 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); | 208 | Opie::Core::odebug << "querying: " << path + "/" + *it << oendl; |
207 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | 209 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { |
208 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); | 210 | Opie::Core::odebug << "accepted: " << path + "/" + *it << oendl; |
209 | qDebug( QString(*it) ); | 211 | Opie::Core::odebug << *it << oendl; |
210 | 212 | ||
211 | TodayPlugin plugin; | 213 | TodayPlugin plugin; |
212 | plugin.library = lib; | 214 | plugin.library = lib; |
213 | plugin.iface = iface; | 215 | plugin.iface = iface; |
214 | plugin.name = QString(*it); | 216 | plugin.name = QString(*it); |
215 | 217 | ||
216 | QString type = (*it).left( (*it).find(".") ); | 218 | QString type = (*it).left( (*it).find(".") ); |
217 | 219 | ||
218 | QString lang; | 220 | QString lang; |
219 | Config config("locale"); | 221 | Config config("locale"); |
220 | config.setGroup("Language"); | 222 | config.setGroup("Language"); |
221 | lang = config.readEntry( "Language", "en" ); | 223 | lang = config.readEntry( "Language", "en" ); |
222 | 224 | ||
223 | qDebug( "Languages: " + lang ); | 225 | Opie::Core::odebug << "Languages: " << lang << oendl; |
224 | QTranslator * trans = new QTranslator( qApp ); | 226 | QTranslator * trans = new QTranslator( qApp ); |
225 | QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm"; | 227 | QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm"; |
226 | if ( trans->load( tfn ) ) { | 228 | if ( trans->load( tfn ) ) { |
227 | qApp->installTranslator( trans ); | 229 | qApp->installTranslator( trans ); |
228 | } else { | 230 | } else { |
229 | delete trans; | 231 | delete trans; |
230 | } | 232 | } |
231 | 233 | ||
@@ -266,17 +268,17 @@ void Today::loadPlugins() { | |||
266 | m_bblayout->addWidget( plugin.guiBox ); | 268 | m_bblayout->addWidget( plugin.guiBox ); |
267 | } | 269 | } |
268 | 270 | ||
269 | // 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 |
270 | else if ( !m_allApplets.contains( plugin.name ) ) { | 272 | else if ( !m_allApplets.contains( plugin.name ) ) { |
271 | pluginList.append( plugin ); | 273 | pluginList.append( plugin ); |
272 | } | 274 | } |
273 | } else { | 275 | } else { |
274 | qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); | 276 | Opie::Core::odebug << "could not recognize " << path + "/" + *it << oendl; |
275 | delete lib; | 277 | delete lib; |
276 | } | 278 | } |
277 | 279 | ||
278 | } | 280 | } |
279 | 281 | ||
280 | 282 | ||
281 | if ( !m_allApplets.isEmpty() ) { | 283 | if ( !m_allApplets.isEmpty() ) { |
282 | TodayPlugin tempPlugin; | 284 | TodayPlugin tempPlugin; |
@@ -310,20 +312,20 @@ void Today::draw() { | |||
310 | } | 312 | } |
311 | 313 | ||
312 | uint count = 0; | 314 | uint count = 0; |
313 | TodayPlugin plugin; | 315 | TodayPlugin plugin; |
314 | for ( uint i = 0; i < pluginList.count(); i++ ) { | 316 | for ( uint i = 0; i < pluginList.count(); i++ ) { |
315 | plugin = pluginList[i]; | 317 | plugin = pluginList[i]; |
316 | 318 | ||
317 | if ( plugin.active ) { | 319 | if ( plugin.active ) { |
318 | // qDebug( plugin.name + " is ACTIVE " ); | 320 | //Opie::Core::odebug << plugin.name << " is ACTIVE " << oendl; |
319 | plugin.guiBox->show(); | 321 | plugin.guiBox->show(); |
320 | } else { | 322 | } else { |
321 | // qDebug( plugin.name + " is INACTIVE" ); | 323 | //Opie::Core::odebug << plugin.name << " is INACTIVE " << oendl; |
322 | plugin.guiBox->hide(); | 324 | plugin.guiBox->hide(); |
323 | } | 325 | } |
324 | count++; | 326 | count++; |
325 | } | 327 | } |
326 | 328 | ||
327 | if ( count == 0 ) { | 329 | if ( count == 0 ) { |
328 | QLabel *noPluginsActive = new QLabel( this ); | 330 | QLabel *noPluginsActive = new QLabel( this ); |
329 | noPluginsActive->setText( tr( "No plugins activated" ) ); | 331 | noPluginsActive->setText( tr( "No plugins activated" ) ); |
@@ -390,17 +392,17 @@ void Today::reinitialize() { | |||
390 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); | 392 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); |
391 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); | 393 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); |
392 | 394 | ||
393 | /* reinitialize all plugins */ | 395 | /* reinitialize all plugins */ |
394 | QValueList<TodayPlugin>::Iterator it; | 396 | QValueList<TodayPlugin>::Iterator it; |
395 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { | 397 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { |
396 | if ( !(*it).excludeRefresh ) { | 398 | if ( !(*it).excludeRefresh ) { |
397 | (*it).guiPart->reinitialize(); | 399 | (*it).guiPart->reinitialize(); |
398 | qDebug( "reinit" ); | 400 | Opie::Core::odebug << "reinit" << oendl; |
399 | } | 401 | } |
400 | 402 | ||
401 | /* check if plugins is still to be shown */ | 403 | /* check if plugins is still to be shown */ |
402 | if ( m_excludeApplets.grep( (*it).name ).isEmpty() ) { | 404 | if ( m_excludeApplets.grep( (*it).name ).isEmpty() ) { |
403 | (*it).active = true; | 405 | (*it).active = true; |
404 | } else { | 406 | } else { |
405 | (*it).active = false; | 407 | (*it).active = false; |
406 | } | 408 | } |
@@ -444,17 +446,17 @@ void Today::reinitialize() { | |||
444 | * | 446 | * |
445 | */ | 447 | */ |
446 | void Today::refresh() { | 448 | void Today::refresh() { |
447 | 449 | ||
448 | QValueList<TodayPlugin>::Iterator it; | 450 | QValueList<TodayPlugin>::Iterator it; |
449 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { | 451 | for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { |
450 | if ( !(*it).excludeRefresh ) { | 452 | if ( !(*it).excludeRefresh ) { |
451 | (*it).guiPart->refresh(); | 453 | (*it).guiPart->refresh(); |
452 | qDebug( "refresh" ); | 454 | Opie::Core::odebug << "refresh" << oendl; |
453 | } | 455 | } |
454 | } | 456 | } |
455 | 457 | ||
456 | DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( QDate::currentDate() ) + "</font>" ) ); | 458 | DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( QDate::currentDate() ) + "</font>" ) ); |
457 | 459 | ||
458 | updateGeometry(); | 460 | updateGeometry(); |
459 | repaint(); | 461 | repaint(); |
460 | } | 462 | } |