-rw-r--r-- | library/qpeapplication.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 4d0b0ea..98af70a 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp @@ -17,16 +17,17 @@ ** not clear to you. ** */ #define QTOPIA_INTERNAL_LANGLIST #include <stdlib.h> #include <unistd.h> #include <linux/limits.h> // needed for some toolchains (PATH_MAX) #include <qfile.h> +#include <qqueue.h> #ifdef Q_WS_QWS #ifndef QT_NO_COP #if QT_VERSION <= 231 #define private public #define sendLocally processEvent #include "qcopenvelope_qws.h" #undef private #else @@ -95,19 +96,17 @@ 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 ) - { - qcopq.setAutoDelete( TRUE ); - } + {} int presstimer; QWidget* presswidget; QPoint presspos; bool rightpressed : 1; bool kbgrabbed : 1; bool notbusysent : 1; @@ -128,38 +127,41 @@ public: { } QCString channel; QCString message; QByteArray data; }; QWidget* qpe_main_widget; QGuardedPtr<QWidget> lastraised; - QList<QCopRec> qcopq; + QQueue<QCopRec> qcopq; QString styleName; QString decorationName; void enqueueQCop( const QCString &ch, const QCString &msg, const QByteArray &data ) { - qcopq.append( new QCopRec( ch, msg, data ) ); + qcopq.enqueue( new QCopRec( ch, msg, data ) ); } void sendQCopQ() { if (!qcopQok ) return; QCopRec * r; #ifndef QT_NO_COP - - for ( QListIterator<QCopRec> it( qcopq ); ( r = it.current() ); ++it ) + while((r=qcopq.dequeue())) { + // remove from queue before sending... + // event loop can come around again before getting + // back from sendLocally QCopChannel::sendLocally( r->channel, r->message, r->data ); #endif - qcopq.clear(); + delete r; + } } static void show_mx(QWidget* mw, bool nomaximize, const QString & = QString::null ) { // ugly hack, remove that later after finding a sane solution // Addendum: Only Sharp currently has models with high resolution but (physically) small displays, // so this is only useful if QT_QWS_SIMPAD is NOT defined. E.g. SIMpad has 800x600 but has // a (physically) large enough display to use the small icons |