summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--library/qpeapplication.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index acad81d..35f433c 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -125,22 +125,27 @@ public:
{
Config cfg( "qpe" );
cfg.setGroup( "Appearance" );
useBigPixmaps = cfg.readBoolEntry( "useBigPixmaps", false );
fontFamily = cfg.readEntry( "FontFamily", "Vera" );
fontSize = cfg.readNumEntry( "FontSize", 10 );
smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 );
bigIconSize = cfg.readNumEntry( "BigIconSize", 32 );
+#ifdef OPIE_ROHFEEDBACK
RoH = 0;
+#endif
}
int presstimer;
QWidget* presswidget;
QPoint presspos;
+#ifdef OPIE_ROHFEEDBACK
+ Opie::Internal::RoHFeedback *RoH;
+#endif
bool rightpressed : 1;
bool kbgrabbed : 1;
bool notbusysent : 1;
bool preloaded : 1;
bool forceshow : 1;
bool nomaximize : 1;
bool keep_running : 1;
@@ -492,18 +497,16 @@ static void qpe_show_dialog( QDialog* d, bool nomax )
}
}
else {
lib->unload();
delete lib;
}
}
}
-
- Opie::Internal::RoHFeedback * RoH;
};
class ResourceMimeFactory : public QMimeSourceFactory
{
public:
ResourceMimeFactory() : resImage( 0 )
{
setFilePath( Global::helpPath() );
@@ -1207,17 +1210,19 @@ QPEApplication::~QPEApplication()
{
ungrabKeyboard();
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
// Need to delete QCopChannels early, since the display will
// be gone by the time we get to ~QObject().
delete sysChannel;
delete pidChannel;
#endif
+#ifdef OPIE_ROHFEEDBACK
delete d->RoH;
+#endif
delete d;
}
/*!
Returns <tt>$OPIEDIR/</tt>.
*/
QString QPEApplication::qpeDir()
{
@@ -2030,43 +2035,43 @@ bool QPEApplication::eventFilter( QObject *o, QEvent *e )
switch ( me->type() ) {
case QEvent::MouseButtonPress:
if ( me->button() == LeftButton ) {
d->presswidget = (QWidget*)o;
d->presspos = me->pos();
d->rightpressed = FALSE;
// just for the time being
static int pref = 500;
-#ifdef WITHROHFEEDBACK
+#ifdef OPIE_ROHFEEDBACK
if( ! d->RoH )
d->RoH = new Opie::Internal::RoHFeedback;
d->RoH->init( me->globalPos(), d->presswidget );
pref = d->RoH->delay();
#endif
if (!d->presstimer )
d->presstimer = startTimer( pref ); // #### pref.
}
break;
case QEvent::MouseMove:
if (d->presstimer && (me->pos() - d->presspos).manhattanLength() > 8) {
killTimer(d->presstimer);
-#ifdef WITHROHFEEDBACK
+#ifdef OPIE_ROHFEEDBACK
if( d->RoH )
d->RoH->stop( );
#endif
d->presstimer = 0;
}
break;
case QEvent::MouseButtonRelease:
if ( me->button() == LeftButton ) {
if ( d->presstimer ) {
killTimer(d->presstimer);
-#ifdef WITHROHFEEDBACK
+#ifdef OPIE_ROHFEEDBACK
if( d->RoH )
d->RoH->stop( );
#endif
d->presstimer = 0;
}
if ( d->rightpressed && d->presswidget ) {
// Right released
postEvent( d->presswidget,
@@ -2113,17 +2118,19 @@ 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();
+#endif
}
}
void QPEApplication::removeSenderFromStylusDict()
{
stylusDict->remove
( ( void* ) sender() );
if ( d->presswidget == sender() )