summaryrefslogtreecommitdiff
path: root/core/applets/rotateapplet/rotate.cpp
Unidiff
Diffstat (limited to 'core/applets/rotateapplet/rotate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/rotateapplet/rotate.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp
index f621aa9..f23423d 100644
--- a/core/applets/rotateapplet/rotate.cpp
+++ b/core/applets/rotateapplet/rotate.cpp
@@ -28,12 +28,13 @@
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#include "rotate.h" 31#include "rotate.h"
32 32
33/* OPIE */ 33/* OPIE */
34#include <opie2/odebug.h>
34#include <opie2/odevice.h> 35#include <opie2/odevice.h>
35#include <qpe/config.h> 36#include <qpe/config.h>
36#include <qpe/power.h> 37#include <qpe/power.h>
37#include <qpe/qcopenvelope_qws.h> 38#include <qpe/qcopenvelope_qws.h>
38#include <qpe/resource.h> 39#include <qpe/resource.h>
39using namespace Opie::Core; 40using namespace Opie::Core;
@@ -59,23 +60,23 @@ RotateApplet::~RotateApplet ( )
59 60
60/** 61/**
61 * Qcop receive method. 62 * Qcop receive method.
62 */ 63 */
63void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data ) 64void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data )
64{ 65{
65 qDebug( "RotateApplet::channelReceived( '%s' )", (const char*) msg ); 66 odebug << "RotateApplet::channelReceived( '" << msg << "' )" << oendl;
66 67
67 if ( ODevice::inst()->hasHingeSensor() ) 68 if ( ODevice::inst()->hasHingeSensor() )
68 { 69 {
69 struct timespec interval; 70 struct timespec interval;
70 struct timespec remain; 71 struct timespec remain;
71 interval.tv_sec = 0; 72 interval.tv_sec = 0;
72 interval.tv_nsec = 600000; 73 interval.tv_nsec = 600000;
73 ::nanosleep( &interval, &remain ); 74 ::nanosleep( &interval, &remain );
74 OHingeStatus status = ODevice::inst()->readHingeSensor(); 75 OHingeStatus status = ODevice::inst()->readHingeSensor();
75 qDebug( "RotateApplet::readHingeSensor = %d", (int) status ); 76 odebug << "RotateApplet::readHingeSensor = " << (int) status << "" << oendl;
76 77
77 Config cfg( "apm" ); 78 Config cfg( "apm" );
78 cfg.setGroup( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ? "AC" : "Battery" ); 79 cfg.setGroup( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ? "AC" : "Battery" );
79 int action = cfg.readNumEntry( "CloseHingeAction", 0 ); 80 int action = cfg.readNumEntry( "CloseHingeAction", 0 );
80 81
81 if ( status == CASE_CLOSED ) 82 if ( status == CASE_CLOSED )
@@ -93,13 +94,13 @@ void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data
93 { 94 {
94 case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 127 ); break; 95 case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 127 ); break;
95 case 2: /* SUSPEND */ /* How to wake up the device from kernel? */; break; 96 case 2: /* SUSPEND */ /* How to wake up the device from kernel? */; break;
96 default: /* IGNORE */ break; 97 default: /* IGNORE */ break;
97 } 98 }
98 } 99 }
99 qDebug( "RotateApplet::switchAction %d performed.", cfg.readNumEntry( "CloseHingeAction", 0 ) ); 100 odebug << "RotateApplet::switchAction " << cfg.readNumEntry( "CloseHingeAction" ) << " performed." << oendl;
100 } 101 }
101 102
102 QDataStream stream( data, IO_ReadOnly ); 103 QDataStream stream( data, IO_ReadOnly );
103 if ( msg == "flip()" ) 104 if ( msg == "flip()" )
104 { 105 {
105 activated ( ); 106 activated ( );
@@ -236,13 +237,13 @@ QRESULT RotateApplet::queryInterface( const QUuid &uuid, QUnknownInterface **ifa
236 *iface = 0; 237 *iface = 0;
237 if ( uuid == IID_QUnknown ) 238 if ( uuid == IID_QUnknown )
238 *iface = this; 239 *iface = this;
239 else if ( uuid == IID_MenuApplet ) 240 else if ( uuid == IID_MenuApplet )
240 *iface = this; 241 *iface = this;
241 else 242 else
242 return QS_FALSE; 243 return QS_FALSE;
243 244
244 if ( *iface ) 245 if ( *iface )
245 (*iface)->addRef(); 246 (*iface)->addRef();
246 return QS_OK; 247 return QS_OK;
247} 248}
248 249