summaryrefslogtreecommitdiff
path: root/libopie2
authorerik <erik>2007-02-08 23:11:26 (UTC)
committer erik <erik>2007-02-08 23:11:26 (UTC)
commit98353ac16bb90ee4b5df18945acf4fa7f05f9a85 (patch) (side-by-side diff)
tree67ccd74ecfcc9006bece74089b6739736d78243f /libopie2
parent497621fb3ba39ea511842a30cddfcdbda090e7ba (diff)
downloadopie-98353ac16bb90ee4b5df18945acf4fa7f05f9a85.zip
opie-98353ac16bb90ee4b5df18945acf4fa7f05f9a85.tar.gz
opie-98353ac16bb90ee4b5df18945acf4fa7f05f9a85.tar.bz2
This commit provides fixes that quiet warnings associated to device
information. It should cause no change in behavior.
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_htc.cpp10
-rw-r--r--libopie2/opiecore/device/odevice_motorola_ezx.cpp45
-rw-r--r--libopie2/opiecore/device/odevice_palm.cpp4
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp10
4 files changed, 16 insertions, 53 deletions
diff --git a/libopie2/opiecore/device/odevice_htc.cpp b/libopie2/opiecore/device/odevice_htc.cpp
index a6ade11..44b33c0 100644
--- a/libopie2/opiecore/device/odevice_htc.cpp
+++ b/libopie2/opiecore/device/odevice_htc.cpp
@@ -98,31 +98,31 @@ struct htc_button htc_buttons_universal [] = {
"buttonsettings", "raise()" },
{ Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
"devicebuttons/z_menu",
"QPE/TaskBar", "toggleMenu()",
"QPE/TaskBar", "toggleStartMenu()" },
{ Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
"devicebuttons/z_mail",
"opiemail", "raise()",
"opiemail", "newMail()" },
{ Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Hinge1"),
"devicebuttons/z_hinge1",
- "QPE/Rotation", "rotateDefault()",0},
+ "QPE/Rotation", "rotateDefault()",0,0},
{ Qt::Key_F16, QT_TRANSLATE_NOOP("Button", "Hinge2"),
"devicebuttons/z_hinge2",
- "QPE/Rotation", "rotateDefault()",0},
+ "QPE/Rotation", "rotateDefault()",0,0},
{ Qt::Key_F17, QT_TRANSLATE_NOOP("Button", "Hinge3"),
"devicebuttons/z_hinge3",
- "QPE/Rotation", "rotateDefault()",0},
+ "QPE/Rotation", "rotateDefault()",0,0},
};
//
// HTC-Universal (PXA-model w/ 480x640 3.6" lcd)
// HTC-Alpine (PXA-model w/ 240x320 3.5" lcd)
// HTC-Apache (PXA-model w/ 240x320 2.8" lcd)
// HTC-Beetles (PXA-model w/ 240x240 3.0" lcd)
// HTC-Blueangel (PXA-model w/ 240x320 3.5" lcd)
// HTC-Himalaya (PXA-model w/ 240x320 3.5" lcd)
// HTC-Magician (PXA-model w/ 240x320 2.8" lcd)
@@ -346,25 +346,25 @@ QValueList <OLedState> HTC::ledStateList( OLed l ) const
vl << Led_Off << Led_On << Led_BlinkSlow;
return vl;
}
OLedState HTC::ledState( OLed which ) const
{
if ( which == Led_Mail )
return m_leds [0];
else
return Led_Off;
}
-bool HTC::setLedState( OLed which, OLedState st )
+bool HTC::setLedState( OLed, OLedState )
{
qDebug( "HTC::setLedState: ODevice handling not yet implemented" );
return false;
}
int HTC::displayBrightnessResolution() const
{
int res = 1;
int fd = ::open( m_backlightdev + "max_brightness", O_RDONLY|O_NONBLOCK );
if ( fd )
@@ -422,24 +422,26 @@ Transformation HTC::rotation() const
qDebug( "HTC::rotation()" );
Transformation rot = Rot270;
switch ( d->m_model ) {
case Model_HTC_Universal:
{
OHingeStatus hs = readHingeSensor();
qDebug( "HTC::rotation() - hinge sensor = %d", (int) hs );
if ( hs == CASE_PORTRAIT ) rot = Rot0;
else if ( hs == CASE_UNKNOWN ) rot = Rot270;
}
break;
+ default:
+ break;
}
qDebug( "HTC::rotation() - returning '%d'", rot );
return rot;
}
ODirection HTC::direction() const
{
ODirection dir;
switch ( d->m_model ) {
case Model_HTC_Universal: {
OHingeStatus hs = readHingeSensor();
diff --git a/libopie2/opiecore/device/odevice_motorola_ezx.cpp b/libopie2/opiecore/device/odevice_motorola_ezx.cpp
index eed81ac..67a2b9b 100644
--- a/libopie2/opiecore/device/odevice_motorola_ezx.cpp
+++ b/libopie2/opiecore/device/odevice_motorola_ezx.cpp
@@ -118,65 +118,24 @@ void Motorola_EZX::init(const QString& cpu_info)
m_leds[0] = Led_Off;
qDebug( "Motorola_EZX::init() - Using the 2.6 OpenEZX HAL on a %s", (const char*) d->m_modelstr );
}
void Motorola_EZX::initButtons()
{
qDebug( "Motorola_EZX::initButtons()" );
if ( d->m_buttons )
return;
d->m_buttons = new QValueList <ODeviceButton>;
-
- struct ezx_button * ezx_buttons;
- int buttoncount;
-
-/*
-
- switch ( d->m_model )
- {
- case Model_Motorola_EZX_SL6000:
- pezx_buttons = ezx_buttons_6000;
- buttoncount = ARRAY_SIZE(ezx_buttons_6000);
- break;
- case Model_Motorola_EZX_SLC3100: // fallthrough
- case Model_Motorola_EZX_SLC3000: // fallthrough
- case Model_Motorola_EZX_SLC1000: // fallthrough
- case Model_Motorola_EZX_SLC7x0:
- if ( isQWS( ) )
- {
- addPreHandler(this);
- }
- pezx_buttons = ezx_buttons_c700;
- buttoncount = ARRAY_SIZE(ezx_buttons_c700);
- break;
- default:
- pezx_buttons = ezx_buttons;
- buttoncount = ARRAY_SIZE(ezx_buttons);
- break;
- }
-
- for ( int i = 0; i < buttoncount; i++ ) {
- struct ezx_button *zb = pezx_buttons + i;
- ODeviceButton b;
-
- b.setKeycode( zb->code );
- b.setUserText( QObject::tr( "Button", zb->utext ));
- b.setPixmap( OResource::loadPixmap( zb->pix ));
- b.setFactoryPresetPressedAction( OQCopMessage( makeChannel ( zb->fpressedservice ), zb->fpressedaction ));
- b.setFactoryPresetHeldAction( OQCopMessage( makeChannel ( zb->fheldservice ), zb->fheldaction ));
- d->m_buttons->append( b );
- }
-*/
reloadButtonMapping();
}
void Motorola_EZX::playAlarmSound()
{
#ifndef QT_NO_SOUND
static Sound snd ( "alarm" );
if(!snd.isFinished())
return;
changeMixerForAlarm(0, "/dev/sound/mixer", &snd );
snd. play();
@@ -198,25 +157,25 @@ QValueList <OLedState> Motorola_EZX::ledStateList( OLed l ) const
vl << Led_Off << Led_On << Led_BlinkSlow;
return vl;
}
OLedState Motorola_EZX::ledState( OLed which ) const
{
if ( which == Led_Mail )
return m_leds [0];
else
return Led_Off;
}
-bool Motorola_EZX::setLedState( OLed which, OLedState st )
+bool Motorola_EZX::setLedState( OLed, OLedState )
{
// Currently not supported
qDebug( "Motorola_EZX::setLedState: ODevice handling not yet implemented" );
return false;
}
int Motorola_EZX::displayBrightnessResolution() const
{
int res = 1;
int fd = ::open( m_backlightdev + "max_brightness", O_RDONLY|O_NONBLOCK );
if ( fd )
{
@@ -271,22 +230,22 @@ void Motorola_EZX::systemMessage( const QCString &msg, const QByteArray & )
if ( msg == "deviceButtonMappingChanged()" ) {
reloadButtonMapping();
}
}
bool Motorola_EZX::suspend() {
if ( !isQWS( ) ) // only qwsserver is allowed to suspend
return false;
bool res = false;
QCopChannel::send( "QPE/System", "aboutToSuspend()" );
- struct timeval tvs, tvn;
+ struct timeval tvs;
::gettimeofday ( &tvs, 0 );
::sync(); // flush fs caches
res = ( ::system ( "apm --suspend" ) == 0 );
QCopChannel::send( "QPE/System", "returnFromSuspend()" );
return res;
}
diff --git a/libopie2/opiecore/device/odevice_palm.cpp b/libopie2/opiecore/device/odevice_palm.cpp
index 76399f8..399c08c 100644
--- a/libopie2/opiecore/device/odevice_palm.cpp
+++ b/libopie2/opiecore/device/odevice_palm.cpp
@@ -80,25 +80,25 @@ struct palm_button palm_buttons [] = {
Qt::Key_F12, QT_TRANSLATE_NOOP( "Button", "Mail Button" ),
"devicebuttons/palm_mail",
"opiemail", "raise()",
"opiemail", "newmail()" },
{ Model_Palm_LD,
Qt::Key_F7, QT_TRANSLATE_NOOP( "Button", "Voice Memo Button" ),
"devicebuttons/palm_voice_memo",
"QPE/TaskBar", "toggleMenu()",
"QPE/TaskBar", "toggleStartMenu()" },
{ Model_Palm_LD,
Qt::Key_F8, QT_TRANSLATE_NOOP( "Button", "Rotate Button" ),
"devicebuttons/palm_rotate",
- "QPE/Rotation", "flip()",0},
+ "QPE/Rotation", "flip()",0,0},
};
void Palm::init(const QString& cpu_info)
{
d->m_vendorstr = "Palm";
d->m_vendor = Vendor_Palm;
QString model = "unknown";
int loc = cpu_info.find( ":" );
if ( loc != -1 )
model = cpu_info.mid( loc+2 ).simplifyWhiteSpace();
@@ -209,24 +209,26 @@ bool Palm::suspend()
switch ( d->m_model ) {
case Model_Palm_LD:
case Model_Palm_Z72:
{
QCopChannel::send( "QPE/System", "aboutToSuspend()" );
::sync(); // flush fs caches
res = ( ::system ( "apm --suspend" ) == 0 );
QCopChannel::send( "QPE/System", "returnFromSuspend()" );
}
break;
+ default:
+ break;
}
return res;
}
int Palm::displayBrightnessResolution() const
{
int res = 1;
switch ( d->m_model )
{
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index 4963f54..9d2ebbb 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -98,31 +98,31 @@ struct z_button z_buttons_c700 [] = {
"buttonsettings", "raise()" },
{ Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
"devicebuttons/z_menu",
"QPE/TaskBar", "toggleMenu()",
"QPE/TaskBar", "toggleStartMenu()" },
{ Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
"devicebuttons/z_mail",
"opiemail", "raise()",
"opiemail", "newMail()" },
{ Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Hinge1"),
"devicebuttons/z_hinge1",
- "QPE/Rotation", "rotateDefault()",0},
+ "QPE/Rotation", "rotateDefault()",0,0},
{ Qt::Key_F16, QT_TRANSLATE_NOOP("Button", "Hinge2"),
"devicebuttons/z_hinge2",
- "QPE/Rotation", "rotateDefault()",0},
+ "QPE/Rotation", "rotateDefault()",0,0},
{ Qt::Key_F17, QT_TRANSLATE_NOOP("Button", "Hinge3"),
"devicebuttons/z_hinge3",
- "QPE/Rotation", "rotateDefault()",0},
+ "QPE/Rotation", "rotateDefault()",0,0},
};
struct z_button z_buttons_6000 [] = {
{ Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
"devicebuttons/z_calendar",
"datebook", "nextView()",
"today", "raise()" },
{ Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
"devicebuttons/z_contact",
"addressbook", "raise()",
"addressbook", "beamBusinessCard()" },
{ Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
@@ -130,26 +130,26 @@ struct z_button z_buttons_6000 [] = {
"QPE/Launcher", "home()",
"buttonsettings", "raise()" },
{ Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
"devicebuttons/z_menu",
"QPE/TaskBar", "toggleMenu()",
"QPE/TaskBar", "toggleStartMenu()" },
{ Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
"devicebuttons/z_mail",
"opiemail", "raise()",
"opiemail", "newMail()" },
{ Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Rotate Button"),
"devicebuttons/z_rotate",
- 0,
- "QPE/Rotation", "rotateDefault()" },
+ 0, "QPE/Rotation",
+ "rotateDefault()", 0 },
{ Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"),
"devicebuttons/z_hinge3",
"QPE/VMemo", "toggleRecord()",
"sound", "raise()" },
};
// FIXME This gets unnecessary complicated. We should think about splitting the Zaurus
// class up into individual classes. We would need three classes
//
// Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000)
// Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600)
// Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, C860, C3000, C1000, C3100)