summaryrefslogtreecommitdiff
path: root/core/applets/rotateapplet/rotate.cpp
Side-by-side diff
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
@@ -22,24 +22,25 @@
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-= this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "rotate.h"
/* OPIE */
+#include <opie2/odebug.h>
#include <opie2/odevice.h>
#include <qpe/config.h>
#include <qpe/power.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/resource.h>
using namespace Opie::Core;
/* QT */
#include <time.h>
RotateApplet::RotateApplet()
@@ -53,59 +54,59 @@ RotateApplet::RotateApplet()
#endif
}
RotateApplet::~RotateApplet ( )
{}
/**
* Qcop receive method.
*/
void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data )
{
- qDebug( "RotateApplet::channelReceived( '%s' )", (const char*) msg );
+ odebug << "RotateApplet::channelReceived( '" << msg << "' )" << oendl;
if ( ODevice::inst()->hasHingeSensor() )
{
struct timespec interval;
struct timespec remain;
interval.tv_sec = 0;
interval.tv_nsec = 600000;
::nanosleep( &interval, &remain );
OHingeStatus status = ODevice::inst()->readHingeSensor();
- qDebug( "RotateApplet::readHingeSensor = %d", (int) status );
+ odebug << "RotateApplet::readHingeSensor = " << (int) status << "" << oendl;
Config cfg( "apm" );
cfg.setGroup( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ? "AC" : "Battery" );
int action = cfg.readNumEntry( "CloseHingeAction", 0 );
if ( status == CASE_CLOSED )
{
switch ( action )
{
case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 0 ); break;
case 2: /* SUSPEND */ ODevice::inst()->suspend(); break;
default: /* IGNORE */ break;
}
}
else /* status != CASE_CLOSED */
{
switch ( action )
{
case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 127 ); break;
case 2: /* SUSPEND */ /* How to wake up the device from kernel? */; break;
default: /* IGNORE */ break;
}
}
- qDebug( "RotateApplet::switchAction %d performed.", cfg.readNumEntry( "CloseHingeAction", 0 ) );
+ odebug << "RotateApplet::switchAction " << cfg.readNumEntry( "CloseHingeAction" ) << " performed." << oendl;
}
QDataStream stream( data, IO_ReadOnly );
if ( msg == "flip()" )
{
activated ( );
}
else if ( msg == "rotateDefault()")
{
rotateDefault();
}
}
@@ -230,23 +231,23 @@ void RotateApplet::activated()
m_flipped = !m_flipped;
}
QRESULT RotateApplet::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
{
*iface = 0;
if ( uuid == IID_QUnknown )
*iface = this;
else if ( uuid == IID_MenuApplet )
*iface = this;
else
- return QS_FALSE;
+ return QS_FALSE;
if ( *iface )
(*iface)->addRef();
return QS_OK;
}
Q_EXPORT_INTERFACE()
{
Q_CREATE_INSTANCE( RotateApplet )
}