summaryrefslogtreecommitdiff
path: root/libopie2
Side-by-side diff
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_htc.cpp3
-rw-r--r--libopie2/opiepim/private/opimeventsortvector.cpp9
2 files changed, 4 insertions, 8 deletions
diff --git a/libopie2/opiecore/device/odevice_htc.cpp b/libopie2/opiecore/device/odevice_htc.cpp
index c21e10d..4e5200b 100644
--- a/libopie2/opiecore/device/odevice_htc.cpp
+++ b/libopie2/opiecore/device/odevice_htc.cpp
@@ -417,22 +417,21 @@ bool HTC::setDisplayStatus( bool on )
return res;
}
Transformation HTC::rotation() const
{
qDebug( "HTC::rotation()" );
- Transformation rot;
+ 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;
- else rot = Rot270;
}
break;
}
qDebug( "HTC::rotation() - returning '%d'", rot );
return rot;
diff --git a/libopie2/opiepim/private/opimeventsortvector.cpp b/libopie2/opiepim/private/opimeventsortvector.cpp
index 4220c63..b85f848 100644
--- a/libopie2/opiepim/private/opimeventsortvector.cpp
+++ b/libopie2/opiepim/private/opimeventsortvector.cpp
@@ -34,15 +34,13 @@
#include <qvaluelist.h>
namespace Opie {
namespace Internal {
-namespace{
-
-inline int testAlarmNotifiers( const OPimNotifyManager& leftnotifiers, const OPimNotifyManager& rightnotifiers ){
+int testAlarmNotifiers( const OPimNotifyManager& leftnotifiers, const OPimNotifyManager& rightnotifiers ){
OPimNotifyManager::Alarms left_alarms = leftnotifiers.alarms();
OPimNotifyManager::Alarms right_alarms = rightnotifiers.alarms();
// Well.. How could we compare two lists of alarms? I think we should find the most early datetimes
// and compare them.. (se)
// Find the first alarm of the left list
@@ -57,26 +55,25 @@ inline int testAlarmNotifiers( const OPimNotifyManager& leftnotifiers, const OPi
for ( it = right_alarms.begin(); it != right_alarms.end(); ++it ){
if ( !right_earliest.isValid() || right_earliest > (*it).dateTime() ){
right_earliest = (*it).dateTime();
}
}
- int ret;
+ int ret = 0;
// Now compare this found alarms
if ( !left_earliest .isValid() ) ret++;
if ( !right_earliest.isValid() ) ret--;
if ( left_earliest.isValid() && right_earliest.isValid() ){
- ret += left_earliest < right_earliest ? -1 : 1;
+ left_earliest < right_earliest ? ret-- : ret++;
}
return ret;
}
-}
OPimEventSortVector::OPimEventSortVector( uint size, bool asc, int sort )
: OPimSortVector<OPimEvent>( size, asc, sort ) {}
int OPimEventSortVector::compareItems( const OPimEvent& left,
const OPimEvent& right ) {