summaryrefslogtreecommitdiff
path: root/core/applets/rotateapplet
Unidiff
Diffstat (limited to 'core/applets/rotateapplet') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/rotateapplet/rotate.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp
index 906063e..b676c74 100644
--- a/core/applets/rotateapplet/rotate.cpp
+++ b/core/applets/rotateapplet/rotate.cpp
@@ -197,58 +197,60 @@ void RotateApplet::activated()
197 if (rotDirection == -1) 197 if (rotDirection == -1)
198 { 198 {
199 rot = ODevice::inst()->direction(); 199 rot = ODevice::inst()->direction();
200 } 200 }
201 else 201 else
202 { 202 {
203 rot = (ODirection) rotDirection; 203 rot = (ODirection) rotDirection;
204 } 204 }
205 205
206 // hide inputs methods before rotation 206 // hide inputs methods before rotation
207 QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" ); 207 QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" );
208 208
209 if ( m_flipped ) 209 if ( m_flipped )
210 { 210 {
211 // if flipped, flip back to the original state, 211 // if flipped, flip back to the original state,
212 // regardless of rotation direction 212 // regardless of rotation direction
213 newRotation = defaultRotation; 213 newRotation = defaultRotation;
214 } 214 }
215 else 215 else
216 { 216 {
217 if ( rot == CCW ) 217 if ( rot == CCW )
218 { 218 {
219 newRotation = ( defaultRotation + 90 ) % 360; 219 newRotation = ( defaultRotation + 90 ) % 360;
220 } 220 }
221 else if ( rot == CW ) 221 else if ( rot == CW )
222 { 222 {
223 newRotation = ( defaultRotation + 270 ) % 360; 223 newRotation = ( defaultRotation + 270 ) % 360;
224 } 224 }
225 else if ( rot == Flip ) 225 else if ( rot == Flip )
226 { 226 {
227 newRotation = ( defaultRotation + 180 ) % 360; 227 newRotation = ( defaultRotation + 180 ) % 360;
228 } 228 }
229 } 229 }
230 230
231 QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" ); 231 QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" );
232 env << newRotation; 232 env << newRotation;
233 233
234 m_flipped = !m_flipped; 234 m_flipped = !m_flipped;
235} 235}
236 236
237 237
238QRESULT RotateApplet::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) 238QRESULT RotateApplet::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
239{ 239{
240 *iface = 0; 240 *iface = 0;
241 if ( uuid == IID_QUnknown ) 241 if ( uuid == IID_QUnknown )
242 *iface = this; 242 *iface = this;
243 else if ( uuid == IID_MenuApplet ) 243 else if ( uuid == IID_MenuApplet )
244 *iface = this; 244 *iface = this;
245 else
246 return QS_FALSE;
245 247
246 if ( *iface ) 248 if ( *iface )
247 (*iface)->addRef(); 249 (*iface)->addRef();
248 return QS_OK; 250 return QS_OK;
249} 251}
250 252
251Q_EXPORT_INTERFACE() 253Q_EXPORT_INTERFACE()
252{ 254{
253 Q_CREATE_INSTANCE( RotateApplet ) 255 Q_CREATE_INSTANCE( RotateApplet )
254} 256}