summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 86aa53d..4d0b0ea 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -77,92 +77,97 @@
#ifdef QWS
#include "fontmanager.h"
#endif
#include "alarmserver.h"
#include "applnk.h"
#include "qpemenubar.h"
#include "textcodecinterface.h"
#include "imagecodecinterface.h"
#include <unistd.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/soundcard.h>
#include "qt_override_p.h"
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 )
+ 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;
bool preloaded : 1;
bool forceshow : 1;
bool nomaximize : 1;
+ bool qcopQok : 1;
bool keep_running : 1;
+
QStringList langs;
QString appName;
struct QCopRec
{
QCopRec( const QCString &ch, const QCString &msg,
const QByteArray &d ) :
channel( ch ), message( msg ), data( d )
{ }
QCString channel;
QCString message;
QByteArray data;
};
QWidget* qpe_main_widget;
QGuardedPtr<QWidget> lastraised;
QList<QCopRec> qcopq;
QString styleName;
QString decorationName;
void enqueueQCop( const QCString &ch, const QCString &msg,
const QByteArray &data )
{
qcopq.append( 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 )
QCopChannel::sendLocally( r->channel, r->message, r->data );
#endif
qcopq.clear();
}
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
#ifndef QT_QWS_SIMPAD
if ( QPEApplication::desktop() ->width() >= 600 && ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) ) {
( ( QMainWindow* ) mw )->setUsesBigPixmaps( true );
}
#endif
if ( mw->layout() && mw->inherits("QDialog") ) {
QPEApplication::showDialog((QDialog*)mw, nomaximize);
@@ -1872,48 +1877,49 @@ bool QPEApplication::keyboardGrabbed() const
void QPEApplication::ungrabKeyboard()
{
((QPEApplication *) qApp )-> d-> kbgrabbed = false;
}
/*!
Grabs the physical keyboard keys, e.g. the application's launching
keys. Instead of launching applications when these keys are pressed
the signals emitted are sent to this application instead. Some games
programs take over the launch keys in this way to make interaction
easier.
\sa ungrabKeyboard()
*/
void QPEApplication::grabKeyboard()
{
((QPEApplication *) qApp )-> d-> kbgrabbed = true;
}
/*!
\reimp
*/
int QPEApplication::exec()
{
+ d->qcopQok = true;
#ifndef QT_NO_COP
d->sendQCopQ();
#endif
if ( d->keep_running )
//|| d->qpe_main_widget && d->qpe_main_widget->isVisible() )
return QApplication::exec();
#ifndef QT_NO_COP
{
QCopEnvelope e( "QPE/System", "closing(QString)" );
e << d->appName;
}
#endif
processEvents();
return 0;
}
/*!
\internal
External request for application to quit. Quits if possible without
loosing state.
*/