summaryrefslogtreecommitdiff
authorzecke <zecke>2003-10-04 07:23:27 (UTC)
committer zecke <zecke>2003-10-04 07:23:27 (UTC)
commit271ba635536db4a9f4ae1e575194d0f388b1c991 (patch) (side-by-side diff)
treedbd2664b1a6422c6195a3b4eb17b591ff82a4499
parenta4793f5226e9eb5c8a718cca9335c23530e08b08 (diff)
downloadopie-271ba635536db4a9f4ae1e575194d0f388b1c991.zip
opie-271ba635536db4a9f4ae1e575194d0f388b1c991.tar.gz
opie-271ba635536db4a9f4ae1e575194d0f388b1c991.tar.bz2
merges of qcopQok
and QPIxmapCache 'calibration' for PDA needs
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 0e469ae..28fb13a 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -50,8 +50,9 @@
#include <qtooltip.h>
#include <qsignal.h>
#include <qmainwindow.h>
#include <qwidgetlist.h>
+#include <qpixmapcache.h>
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
#define QTOPIA_INTERNAL_INITAPP
#include "qpeapplication.h"
@@ -98,9 +99,9 @@ class QPEApplicationData
public:
QPEApplicationData ( )
: presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ),
notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ),
- keep_running( true ), qpe_main_widget( 0 ), qcopQok( false )
+ keep_running( true ), qcopQok( false ), qpe_main_widget( 0 )
{}
int presstimer;
@@ -112,10 +113,10 @@ public:
bool notbusysent : 1;
bool preloaded : 1;
bool forceshow : 1;
bool nomaximize : 1;
- bool qcopQok : 1;
bool keep_running : 1;
+ bool qcopQok : 1;
QStringList langs;
QString appName;
@@ -213,8 +214,9 @@ public:
{
setWidgetCaptionFromAppName( mw, appName, QPEApplication::qpeDir() + "apps" );
nomaximize = nomax;
qpe_main_widget = mw;
+ qcopQok = TRUE;
#ifndef QT_NO_COP
sendQCopQ();
#endif
@@ -575,8 +577,10 @@ void QPEApplication::processQCopFile()
*/
QPEApplication::QPEApplication( int & argc, char **argv, Type t )
: QApplication( hack(argc), argv, t ), pidChannel( 0 )
{
+ QPixmapCache::setCacheLimit(256); // sensible default for smaller devices.
+
d = new QPEApplicationData;
d->loadTextCodecs();
d->loadImageCodecs();
int dw = desktop() ->width();
@@ -1775,17 +1779,21 @@ void QPEApplication::setStylusOperation( QWidget * w, StylusMode mode )
\reimp
*/
bool QPEApplication::eventFilter( QObject *o, QEvent *e )
{
+ if ( !o->isWidgetType() )
+ return FALSE;
+
if ( stylusDict && e->type() >= QEvent::MouseButtonPress && e->type() <= QEvent::MouseMove ) {
QMouseEvent * me = ( QMouseEvent* ) e;
StylusMode mode = (StylusMode)(int)stylusDict->find(o);
switch (mode) {
case RightOnHold:
switch ( me->type() ) {
case QEvent::MouseButtonPress:
if ( me->button() == LeftButton ) {
- d->presstimer = startTimer(500); // #### pref.
+ if (!d->presstimer )
+ d->presstimer = startTimer(500); // #### pref.
d->presswidget = (QWidget*)o;
d->presspos = me->pos();
d->rightpressed = FALSE;
}
@@ -1903,8 +1911,10 @@ int QPEApplication::exec()
{
d->qcopQok = true;
#ifndef QT_NO_COP
d->sendQCopQ();
+ if ( !d->keep_running )
+ processEvents(); // we may have received QCop messages in the meantime.
#endif
if ( d->keep_running )
//|| d->qpe_main_widget && d->qpe_main_widget->isVisible() )