-rw-r--r-- | core/applets/rotateapplet/rotate.cpp | 6 | ||||
-rw-r--r-- | core/applets/rotateapplet/rotate.h | 1 |
2 files changed, 3 insertions, 4 deletions
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp index 8f323d6..653c61f 100644 --- a/core/applets/rotateapplet/rotate.cpp +++ b/core/applets/rotateapplet/rotate.cpp @@ -32,25 +32,24 @@ #include <qpe/qpeapplication.h> #include <qiconset.h> #include <qpopupmenu.h> #include "rotate.h" RotateApplet::RotateApplet ( ) : QObject ( 0, "RotateApplet" ), ref ( 0 ) { m_native = true; - m_startupRot = QPEApplication::defaultRotation(); } RotateApplet::~RotateApplet ( ) { } int RotateApplet::position ( ) const { return 2; } QString RotateApplet::name ( ) const @@ -81,29 +80,30 @@ QIconSet RotateApplet::icon ( ) const if ( !img. isNull ( )) pix. convertFromImage ( img. smoothScale ( 14, 14 )); return pix; } QPopupMenu *RotateApplet::popup ( QWidget * ) const { return 0; } void RotateApplet::activated ( ) { + int currentRotation = QPEApplication::defaultRotation(); int newRotation; if ( m_native == true ) { - newRotation = m_startupRot + 90; + newRotation = currentRotation + 90; } else { - newRotation = m_startupRot; + newRotation = currentRotation - 90; } QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" ); env << newRotation; QCopEnvelope env2( "QPE/System", "setDefaultRotation(int)" ); env2 << newRotation; m_native = !m_native; } QRESULT RotateApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) diff --git a/core/applets/rotateapplet/rotate.h b/core/applets/rotateapplet/rotate.h index 11e2ec9..c4087f9 100644 --- a/core/applets/rotateapplet/rotate.h +++ b/core/applets/rotateapplet/rotate.h @@ -46,17 +46,16 @@ public: virtual QString name ( ) const; virtual QIconSet icon ( ) const; virtual QString text ( ) const; virtual QString tr( const char* ) const; virtual QString tr( const char*, const char* ) const; virtual QPopupMenu *popup ( QWidget *parent ) const; virtual void activated ( ); private: bool m_native; - int m_startupRot; ulong ref; }; #endif |