summaryrefslogtreecommitdiff
authorar <ar>2004-05-02 16:35:53 (UTC)
committer ar <ar>2004-05-02 16:35:53 (UTC)
commitf8add41b2e0b0371754521b44d95f87fa70a6ff2 (patch) (unidiff)
tree5e31a4f036ff20fc3a5961e99a17fc141caf9b8b
parent34f1234b010fa80f9ca06e65f46130713f7362d9 (diff)
downloadopie-f8add41b2e0b0371754521b44d95f87fa70a6ff2.zip
opie-f8add41b2e0b0371754521b44d95f87fa70a6ff2.tar.gz
opie-f8add41b2e0b0371754521b44d95f87fa70a6ff2.tar.bz2
- convert qDebug to odebug
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp8
-rw-r--r--core/launcher/qprocess_unix.cpp8
-rw-r--r--core/launcher/screensaver.cpp8
-rw-r--r--core/launcher/server.cpp4
-rw-r--r--core/launcher/transferserver.cpp3
5 files changed, 17 insertions, 14 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index 19ceb0f..44ceb0c 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -378,63 +378,63 @@ void DocumentList::DiffAppLnks()
378 AppLnk *j; 378 AppLnk *j;
379 bool found; 379 bool found;
380 380
381 while ( (j=it2.current()) ) { 381 while ( (j=it2.current()) ) {
382 it1 = appLnkSet->children(); 382 it1 = appLnkSet->children();
383 found = false; 383 found = false;
384 while ( (i=it1.current()) ){ 384 while ( (i=it1.current()) ){
385 if (strcmp(i->name().ascii(),j->name().ascii()) == 0) 385 if (strcmp(i->name().ascii(),j->name().ascii()) == 0)
386 found = true; 386 found = true;
387 ++it1; 387 ++it1;
388 } 388 }
389 if (!found) { 389 if (!found) {
390 qDebug("Item %s needs to be added",j->name().ascii() ); 390 odebug << "Item " << j->name().ascii() << " needs to be added" << oendl;
391 d->serverGui->applicationAdded( j->type(), *j ); 391 d->serverGui->applicationAdded( j->type(), *j );
392 } 392 }
393 ++it2; 393 ++it2;
394 } 394 }
395 395
396 it1 = appLnkSet->children(); 396 it1 = appLnkSet->children();
397 while ( (i=it1.current()) ) { 397 while ( (i=it1.current()) ) {
398 it2 = appLnkSet2->children(); 398 it2 = appLnkSet2->children();
399 found = false; 399 found = false;
400 while ( (j=it2.current()) ){ 400 while ( (j=it2.current()) ){
401 if (strcmp(i->name().ascii(),j->name().ascii()) == 0) 401 if (strcmp(i->name().ascii(),j->name().ascii()) == 0)
402 found = true; 402 found = true;
403 ++it2; 403 ++it2;
404 } 404 }
405 if (!found) { 405 if (!found) {
406 qDebug("Item %s needs to be removed",i->name().ascii() ); 406 odebug << "Item " << i->name().ascii() << " needs to be removed" << oendl;
407 d->serverGui->applicationRemoved( i->type(), *i ); 407 d->serverGui->applicationRemoved( i->type(), *i );
408 } 408 }
409 409
410 ++it1; 410 ++it1;
411 } 411 }
412 412
413 delete appLnkSet; 413 delete appLnkSet;
414 appLnkSet = appLnkSet2; 414 appLnkSet = appLnkSet2;
415 415
416} 416}
417void DocumentList::storageChanged() 417void DocumentList::storageChanged()
418{ 418{
419 QTime t; 419 QTime t;
420 // ### can implement better 420 // ### can implement better
421 421
422 t.start(); 422 t.start();
423 DiffAppLnks(); 423 DiffAppLnks();
424// reloadAppLnks(); 424// reloadAppLnks();
425 qDebug("Reload App links took %i ms",t.elapsed() ); 425 odebug << "Reload App links took " << t.elapsed() << " ms" << oendl;
426 reloadDocLnks(); 426 reloadDocLnks();
427// odebug << "Reload links took " << t.elapsed() << " ms " << oendl; 427// odebug << "Reload links took " << t.elapsed() << " ms " << oendl;
428 qDebug("Reload All links took %i ms",t.elapsed() ); 428 odebug << "Reload All links took " << t.elapsed() << " ms" << oendl;
429// ### Optimization opportunity 429// ### Optimization opportunity
430 // Could be a bit more intelligent and somehow work out which 430 // Could be a bit more intelligent and somehow work out which
431 // mtab entry has changed and then only scan that and add and remove 431 // mtab entry has changed and then only scan that and add and remove
432 // links appropriately. 432 // links appropriately.
433// rescan(); 433// rescan();
434} 434}
435 435
436void DocumentList::sendAllDocLinks() 436void DocumentList::sendAllDocLinks()
437{ 437{
438 if ( d->tid != 0 ) { 438 if ( d->tid != 0 ) {
439 // We are in the middle of scanning, set a flag so 439 // We are in the middle of scanning, set a flag so
440 // we do this when we finish our scanning 440 // we do this when we finish our scanning
diff --git a/core/launcher/qprocess_unix.cpp b/core/launcher/qprocess_unix.cpp
index 56e1b1d..97c0460 100644
--- a/core/launcher/qprocess_unix.cpp
+++ b/core/launcher/qprocess_unix.cpp
@@ -1023,32 +1023,32 @@ void QProcess::socketRead( int fd )
1023 oldSize = buffer->size(); 1023 oldSize = buffer->size();
1024 buffer->resize( oldSize + bufsize ); 1024 buffer->resize( oldSize + bufsize );
1025 n = ::read( fd, buffer->data()+oldSize, bufsize ); 1025 n = ::read( fd, buffer->data()+oldSize, bufsize );
1026 if ( n > 0 ) 1026 if ( n > 0 )
1027 buffer->resize( oldSize + n ); 1027 buffer->resize( oldSize + n );
1028 else 1028 else
1029 buffer->resize( oldSize ); 1029 buffer->resize( oldSize );
1030 } 1030 }
1031 1031
1032 d->socketReadCalled = TRUE; 1032 d->socketReadCalled = TRUE;
1033 if ( fd == d->proc->socketStdout ) { 1033 if ( fd == d->proc->socketStdout ) {
1034#if defined(QT_QPROCESS_DEBUG) 1034#if defined(QT_QPROCESS_DEBUG)
1035 qDebug( "QProcess::socketRead(): %d bytes read from stdout (%d)", 1035 odebug << "QProcess::socketRead(): " << buffer->size()-oldSize << "bytes read from stdout ("
1036 buffer->size()-oldSize, fd ); 1036 << fd << ")" << oendl;
1037#endif 1037#endif
1038 emit readyReadStdout(); 1038 emit readyReadStdout();
1039 } else if ( fd == d->proc->socketStderr ) { 1039 } else if ( fd == d->proc->socketStderr ) {
1040#if defined(QT_QPROCESS_DEBUG) 1040#if defined(QT_QPROCESS_DEBUG)
1041 qDebug( "QProcess::socketRead(): %d bytes read from stderr (%d)", 1041 odebug << "QProcess::socketRead(): " << buffer->size()-oldSize << " bytes read from stderr ("
1042 buffer->size()-oldSize, fd ); 1042 << fd << ")" << oendl;
1043#endif 1043#endif
1044 emit readyReadStderr(); 1044 emit readyReadStderr();
1045 } 1045 }
1046 d->socketReadCalled = FALSE; 1046 d->socketReadCalled = FALSE;
1047} 1047}
1048 1048
1049 1049
1050/* 1050/*
1051 This private slot is called when the process tries to read data from standard 1051 This private slot is called when the process tries to read data from standard
1052 input. 1052 input.
1053*/ 1053*/
1054void QProcess::socketWrite( int fd ) 1054void QProcess::socketWrite( int fd )
diff --git a/core/launcher/screensaver.cpp b/core/launcher/screensaver.cpp
index a7d23c4..f818d62 100644
--- a/core/launcher/screensaver.cpp
+++ b/core/launcher/screensaver.cpp
@@ -1,19 +1,20 @@
1 1
2#include "screensaver.h" 2#include "screensaver.h"
3 3
4#include <qpe/config.h> 4#include <qpe/config.h>
5#include <qpe/network.h> 5#include <qpe/network.h>
6 6
7#include <opie2/odevice.h> 7#include <opie2/odevice.h>
8#include <opie2/odebug.h>
8 9
9 10
10using namespace Opie::Core; 11using namespace Opie::Core;
11 12
12 13
13 14
14OpieScreenSaver::OpieScreenSaver ( ) 15OpieScreenSaver::OpieScreenSaver ( )
15 : QObject ( 0, "screensaver" ), QWSScreenSaver ( ) 16 : QObject ( 0, "screensaver" ), QWSScreenSaver ( )
16{ 17{
17 m_disable_suspend = 100; 18 m_disable_suspend = 100;
18 m_enable_dim = false; 19 m_enable_dim = false;
19 m_enable_lightoff = false; 20 m_enable_lightoff = false;
@@ -201,25 +202,26 @@ void OpieScreenSaver::setMode ( int mode )
201 * from config file, -2 to toggle backlight on and off, -3 to 202 * from config file, -2 to toggle backlight on and off, -3 to
202 * force backlight off) 203 * force backlight off)
203 */ 204 */
204void OpieScreenSaver::setBacklight ( int bright ) 205void OpieScreenSaver::setBacklight ( int bright )
205{ 206{
206 // Read from config 207 // Read from config
207 Config config ( "apm" ); 208 Config config ( "apm" );
208 config. setGroup ( m_on_ac ? "AC" : "Battery" ); 209 config. setGroup ( m_on_ac ? "AC" : "Battery" );
209 m_backlight_normal = config. readNumEntry ( "Brightness", m_on_ac ? 255 : 127 ); 210 m_backlight_normal = config. readNumEntry ( "Brightness", m_on_ac ? 255 : 127 );
210 int contrast = config. readNumEntry ( "Contrast", 127); 211 int contrast = config. readNumEntry ( "Contrast", 127);
211 m_use_light_sensor = config. readBoolEntry ( "LightSensor", false ); 212 m_use_light_sensor = config. readBoolEntry ( "LightSensor", false );
212 213
213 //qDebug ( "setBacklight: %d (norm: %d) (ls: %d)", bright, m_backlight_normal, m_use_light_sensor ? 1 : 0 ); 214 //odebug << "setBacklight: " << bright << " (norm: " << m_backlight_normal << ") (ls: "
215 // << ( m_use_light_sensor ? 1 : 0 ) << ")" << oendl;
214 216
215 killTimers ( ); 217 killTimers ( );
216 if (( bright < 0 ) && m_use_light_sensor ) { 218 if (( bright < 0 ) && m_use_light_sensor ) {
217 QStringList sl = config. readListEntry ( "LightSensorData", ';' ); 219 QStringList sl = config. readListEntry ( "LightSensorData", ';' );
218 220
219 m_sensordata [LS_SensorMin] = 40; 221 m_sensordata [LS_SensorMin] = 40;
220 m_sensordata [LS_SensorMax] = 215; 222 m_sensordata [LS_SensorMax] = 215;
221 m_sensordata [LS_LightMin] = 1; 223 m_sensordata [LS_LightMin] = 1;
222 m_sensordata [LS_LightMax] = 255; 224 m_sensordata [LS_LightMax] = 255;
223 m_sensordata [LS_Steps] = 12; 225 m_sensordata [LS_Steps] = 12;
224 m_sensordata [LS_Interval] = 2000; 226 m_sensordata [LS_Interval] = 2000;
225 227
@@ -284,25 +286,27 @@ void OpieScreenSaver::timerEvent ( QTimerEvent * )
284 m_backlight_sensor = m_sensordata [LS_LightMax]; 286 m_backlight_sensor = m_sensordata [LS_LightMax];
285 else if ( s >= m_sensordata [LS_SensorMax] ) 287 else if ( s >= m_sensordata [LS_SensorMax] )
286 m_backlight_sensor = m_sensordata [LS_LightMin]; 288 m_backlight_sensor = m_sensordata [LS_LightMin];
287 else { 289 else {
288 int dx = m_sensordata [LS_SensorMax] - m_sensordata [LS_SensorMin]; 290 int dx = m_sensordata [LS_SensorMax] - m_sensordata [LS_SensorMin];
289 int dy = m_sensordata [LS_LightMax] - m_sensordata [LS_LightMin]; 291 int dy = m_sensordata [LS_LightMax] - m_sensordata [LS_LightMin];
290 292
291 int stepno = ( s - m_sensordata [LS_SensorMin] ) * m_sensordata [LS_Steps] / dx; // dx is never 0 293 int stepno = ( s - m_sensordata [LS_SensorMin] ) * m_sensordata [LS_Steps] / dx; // dx is never 0
292 294
293 m_backlight_sensor = m_sensordata [LS_LightMax] - dy * stepno / ( m_sensordata [LS_Steps] - 1 ); 295 m_backlight_sensor = m_sensordata [LS_LightMax] - dy * stepno / ( m_sensordata [LS_Steps] - 1 );
294 } 296 }
295 297
296 //qDebug ( "f(%d) = %d [%d - %d] -> [%d - %d] / %d", s, m_backlight_sensor, m_sensordata [LS_SensorMin], m_sensordata [LS_SensorMax], m_sensordata [LS_LightMin], m_sensordata [LS_LightMax], m_sensordata [LS_Steps] ); 298 odebug << "f(" << s << ") = " << m_backlight_sensor << " [" << m_sensordata [LS_SensorMin]
299 << " - " << m_sensordata [LS_SensorMax] << " ] -> [" << m_sensordata [LS_LightMin]
300 << " - " << m_sensordata [LS_LightMax] << "] / " << m_sensordata [LS_Steps] << oendl;
297 301
298 if ( m_level <= 0 ) 302 if ( m_level <= 0 )
299 setBacklightInternal ( -1 ); 303 setBacklightInternal ( -1 );
300} 304}
301 305
302 306
303/** 307/**
304 * Like ODevice::setDisplayStatus(), but keep current state in m_lcd_status. 308 * Like ODevice::setDisplayStatus(), but keep current state in m_lcd_status.
305 */ 309 */
306void OpieScreenSaver::setDisplayState ( bool on ) 310void OpieScreenSaver::setDisplayState ( bool on )
307{ 311{
308 if ( m_lcd_status != on ) { 312 if ( m_lcd_status != on ) {
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index b9fa1e5..950032d 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -417,26 +417,26 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
417#ifndef QT_NO_COP 417#ifndef QT_NO_COP
418 e << s; 418 e << s;
419#endif 419#endif
420 } else if ( msg == "sendSyncDate(QString)" ) { 420 } else if ( msg == "sendSyncDate(QString)" ) {
421 QString app; 421 QString app;
422 stream >> app; 422 stream >> app;
423 Config cfg( "qpe" ); 423 Config cfg( "qpe" );
424 cfg.setGroup("SyncDate"); 424 cfg.setGroup("SyncDate");
425#ifndef QT_NO_COP 425#ifndef QT_NO_COP
426 QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" ); 426 QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" );
427 e << app << cfg.readEntry( app ); 427 e << app << cfg.readEntry( app );
428#endif 428#endif
429 //qDebug("QPE/System sendSyncDate for %s: response %s", app.latin1(), 429 //odebug << "QPE/System sendSyncDate for " << app.latin1() << ": response "
430 //cfg.readEntry( app ).latin1() ); 430 // << cfg.readEntry( app ).latin1() << oendl;
431 } else if ( msg == "setSyncDate(QString,QString)" ) { 431 } else if ( msg == "setSyncDate(QString,QString)" ) {
432 QString app, date; 432 QString app, date;
433 stream >> app >> date; 433 stream >> app >> date;
434 Config cfg( "qpe" ); 434 Config cfg( "qpe" );
435 cfg.setGroup("SyncDate"); 435 cfg.setGroup("SyncDate");
436 cfg.writeEntry( app, date ); 436 cfg.writeEntry( app, date );
437 //odebug << "setSyncDate(QString,QString) " << app << " " << date << "" << oendl; 437 //odebug << "setSyncDate(QString,QString) " << app << " " << date << "" << oendl;
438 } else if ( msg == "startSync(QString)" ) { 438 } else if ( msg == "startSync(QString)" ) {
439 QString what; 439 QString what;
440 stream >> what; 440 stream >> what;
441 delete syncDialog; 441 delete syncDialog;
442 syncDialog = new SyncDialog( this, what ); 442 syncDialog = new SyncDialog( this, what );
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp
index 4b764e3..c3f936e 100644
--- a/core/launcher/transferserver.cpp
+++ b/core/launcher/transferserver.cpp
@@ -772,26 +772,25 @@ void ServerPI::process( const QString& message )
772bool ServerPI::backupRestoreGzip( const QString &file ) 772bool ServerPI::backupRestoreGzip( const QString &file )
773{ 773{
774 return (file.find( "backup" ) != -1 && // No tr 774 return (file.find( "backup" ) != -1 && // No tr
775 file.findRev( ".tgz" ) == (int)file.length()-4 ); 775 file.findRev( ".tgz" ) == (int)file.length()-4 );
776} 776}
777 777
778bool ServerPI::backupRestoreGzip( const QString &file, QStringList &targets ) 778bool ServerPI::backupRestoreGzip( const QString &file, QStringList &targets )
779{ 779{
780 if ( file.find( "backup" ) != -1 && // No tr 780 if ( file.find( "backup" ) != -1 && // No tr
781 file.findRev( ".tgz" ) == (int)file.length()-4 ) { 781 file.findRev( ".tgz" ) == (int)file.length()-4 ) {
782 QFileInfo info( file ); 782 QFileInfo info( file );
783 targets = info.dirPath( TRUE ); 783 targets = info.dirPath( TRUE );
784 qDebug("ServerPI::backupRestoreGzip for %s = %s", file.latin1(), 784 odebug << "ServerPI::backupRestoreGzip for " << file.latin1() << " = " << targets.join(" ").latin1() << oendl;
785 targets.join(" ").latin1() );
786 return true; 785 return true;
787 } 786 }
788 return false; 787 return false;
789} 788}
790 789
791void ServerPI::sendFile( const QString& file ) 790void ServerPI::sendFile( const QString& file )
792{ 791{
793 if ( passiv ) { 792 if ( passiv ) {
794 wait[SendFile] = TRUE; 793 wait[SendFile] = TRUE;
795 waitfile = file; 794 waitfile = file;
796 if ( waitsocket ) 795 if ( waitsocket )
797 newConnection( waitsocket ); 796 newConnection( waitsocket );