author | mickeyl <mickeyl> | 2005-02-06 21:22:57 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-02-06 21:22:57 (UTC) |
commit | f1a89d7deff682ea52f34a7d160eaa69886aa340 (patch) (unidiff) | |
tree | 1386de093a1dd0f8f7ae9f9f415fd4ba9efe4bcc /libopie2/opiecore/device/odevice_zaurus.cpp | |
parent | 03c2e693a5aa0f73f88ce37bbfa1f51b7cdc7043 (diff) | |
download | opie-f1a89d7deff682ea52f34a7d160eaa69886aa340.zip opie-f1a89d7deff682ea52f34a7d160eaa69886aa340.tar.gz opie-f1a89d7deff682ea52f34a7d160eaa69886aa340.tar.bz2 |
fix default orientation on 2.6 (this time taking hinge sensor into account)
Diffstat (limited to 'libopie2/opiecore/device/odevice_zaurus.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index a59e799..7377965 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -507,34 +507,47 @@ bool Zaurus::suspend() | |||
507 | ::usleep ( 200 * 1000 ); | 507 | ::usleep ( 200 * 1000 ); |
508 | ::gettimeofday ( &tvn, 0 ); | 508 | ::gettimeofday ( &tvn, 0 ); |
509 | } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 ); | 509 | } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 ); |
510 | } | 510 | } |
511 | 511 | ||
512 | QCopEnvelope ( "QPE/Rotation", "rotateDefault()" ); | 512 | QCopEnvelope ( "QPE/Rotation", "rotateDefault()" ); |
513 | return res; | 513 | return res; |
514 | } | 514 | } |
515 | 515 | ||
516 | 516 | ||
517 | Transformation Zaurus::rotation() const | 517 | Transformation Zaurus::rotation() const |
518 | { | 518 | { |
519 | qDebug( "Zaurus::rotation()" ); | ||
519 | Transformation rot; | 520 | Transformation rot; |
520 | 521 | ||
521 | switch ( d->m_model ) { | 522 | switch ( d->m_model ) { |
522 | case Model_Zaurus_SLC3000: // fallthrough | 523 | case Model_Zaurus_SLC3000: // fallthrough |
523 | case Model_Zaurus_SLC7x0: { | 524 | case Model_Zaurus_SLC7x0: |
525 | { | ||
524 | OHingeStatus hs = readHingeSensor(); | 526 | OHingeStatus hs = readHingeSensor(); |
527 | qDebug( "Zaurus::rotation() - hinge sensor = %d", (int) hs ); | ||
528 | |||
529 | if ( m_embedix ) | ||
530 | { | ||
525 | if ( hs == CASE_PORTRAIT ) rot = Rot0; | 531 | if ( hs == CASE_PORTRAIT ) rot = Rot0; |
526 | else if ( hs == CASE_UNKNOWN ) rot = Rot0; | 532 | else if ( hs == CASE_UNKNOWN ) rot = Rot0; |
527 | else rot = Rot270; | 533 | else rot = Rot270; |
528 | } | 534 | } |
535 | else | ||
536 | { | ||
537 | if ( hs == CASE_PORTRAIT ) rot = Rot270; | ||
538 | else if ( hs == CASE_UNKNOWN ) rot = Rot0; | ||
539 | else rot = Rot0; | ||
540 | } | ||
541 | } | ||
529 | break; | 542 | break; |
530 | case Model_Zaurus_SL6000: | 543 | case Model_Zaurus_SL6000: |
531 | case Model_Zaurus_SLB600: | 544 | case Model_Zaurus_SLB600: |
532 | case Model_Zaurus_SLA300: | 545 | case Model_Zaurus_SLA300: |
533 | case Model_Zaurus_SL5500: | 546 | case Model_Zaurus_SL5500: |
534 | case Model_Zaurus_SL5000: | 547 | case Model_Zaurus_SL5000: |
535 | default: | 548 | default: |
536 | rot = d->m_rotation; | 549 | rot = d->m_rotation; |
537 | break; | 550 | break; |
538 | } | 551 | } |
539 | 552 | ||
540 | return rot; | 553 | return rot; |