summaryrefslogtreecommitdiff
path: root/library/qpeapplication.cpp
Side-by-side diff
Diffstat (limited to 'library/qpeapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp58
1 files changed, 30 insertions, 28 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 35f433c..c6d9cfd 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -98,10 +98,9 @@
#include "qt_override_p.h"
-#include <qpe/rohfeedback.h>
+#include <backend/rohfeedback.h>
static bool useBigPixmaps = 0;
-
class HackWidget : public QWidget
{
@@ -117,6 +116,6 @@ class QPEApplicationData
{
public:
- QPEApplicationData ( )
- : presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ),
+ QPEApplicationData ( ) :
+ presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ),
notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ),
keep_running( true ), qcopQok( false ),
@@ -131,5 +130,5 @@ public:
smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 );
bigIconSize = cfg.readNumEntry( "BigIconSize", 32 );
-#ifdef OPIE_ROHFEEDBACK
+#ifdef OPIE_WITHROHFEEDBACK
RoH = 0;
#endif
@@ -139,5 +138,5 @@ public:
QWidget* presswidget;
QPoint presspos;
-#ifdef OPIE_ROHFEEDBACK
+#ifdef OPIE_WITHROHFEEDBACK
Opie::Internal::RoHFeedback *RoH;
#endif
@@ -503,4 +502,5 @@ static void qpe_show_dialog( QDialog* d, bool nomax )
}
}
+
};
@@ -1216,6 +1216,8 @@ QPEApplication::~QPEApplication()
delete pidChannel;
#endif
-#ifdef OPIE_ROHFEEDBACK
- delete d->RoH;
+
+#ifdef OPIE_WITHROHFEEDBACK
+ if( d->RoH )
+ delete d->RoH;
#endif
delete d;
@@ -2036,18 +2038,18 @@ bool QPEApplication::eventFilter( QObject *o, QEvent *e )
case QEvent::MouseButtonPress:
if ( me->button() == LeftButton ) {
+ static long Pref = 500; // #### pref.
d->presswidget = (QWidget*)o;
d->presspos = me->pos();
d->rightpressed = FALSE;
- // just for the time being
- static int pref = 500;
-#ifdef OPIE_ROHFEEDBACK
+#ifdef OPIE_WITHROHFEEDBACK
if( ! d->RoH )
d->RoH = new Opie::Internal::RoHFeedback;
d->RoH->init( me->globalPos(), d->presswidget );
- pref = d->RoH->delay();
+ Pref = d->RoH->delay();
+
#endif
if (!d->presstimer )
- d->presstimer = startTimer( pref ); // #### pref.
+ d->presstimer = startTimer( Pref ); // #### pref.
}
@@ -2056,7 +2058,6 @@ bool QPEApplication::eventFilter( QObject *o, QEvent *e )
if (d->presstimer && (me->pos() - d->presspos).manhattanLength() > 8) {
killTimer(d->presstimer);
-#ifdef OPIE_ROHFEEDBACK
- if( d->RoH )
- d->RoH->stop( );
+#ifdef OPIE_WITHROHFEEDBACK
+ d->RoH->stop();
#endif
d->presstimer = 0;
@@ -2067,11 +2068,11 @@ bool QPEApplication::eventFilter( QObject *o, QEvent *e )
if ( d->presstimer ) {
killTimer(d->presstimer);
-#ifdef OPIE_ROHFEEDBACK
- if( d->RoH )
- d->RoH->stop( );
+#ifdef OPIE_WITHROHFEEDBACK
+ d->RoH->stop( );
#endif
d->presstimer = 0;
}
if ( d->rightpressed && d->presswidget ) {
+ printf( "Send ButtonRelease\n" );
// Right released
postEvent( d->presswidget,
@@ -2117,13 +2118,14 @@ void QPEApplication::timerEvent( QTimerEvent *e )
{
if ( e->timerId() == d->presstimer && d->presswidget ) {
- // Right pressed
- postEvent( d->presswidget,
- new QMouseEvent( QEvent::MouseButtonPress, d->presspos,
- RightButton, LeftButton ) );
- killTimer( d->presstimer );
- d->presstimer = 0;
- d->rightpressed = TRUE;
-#ifdef OPIE_ROHFEEDBACK
- d->RoH->stop();
+
+ // Right pressed
+ postEvent( d->presswidget,
+ new QMouseEvent( QEvent::MouseButtonPress, d->presspos,
+ RightButton, LeftButton ) );
+ killTimer( d->presstimer );
+ d->presstimer = 0;
+ d->rightpressed = TRUE;
+#ifdef OPIE_WITHROHFEEDBACK
+ d->RoH->stop();
#endif
}