diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2009-10-14 14:51:20 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2009-10-14 14:51:20 (GMT) |
commit | 1c313a529ff0893c43c3ccaabe92c4e015acf891 (patch) | |
tree | 4e9b735c04e6579763474dd844eef13a8985ac64 /src/gui/embedded | |
parent | 7750f3821c7cd526c33bfa09378378da3980a2e6 (diff) | |
parent | 81bc22dbd71e2dd0e25156e753afc6d94d808de9 (diff) | |
download | Qt-1c313a529ff0893c43c3ccaabe92c4e015acf891.zip Qt-1c313a529ff0893c43c3ccaabe92c4e015acf891.tar.gz Qt-1c313a529ff0893c43c3ccaabe92c4e015acf891.tar.bz2 |
Merge branch '4.6' into lighthouse
Conflicts:
src/gui/kernel/qapplication.cpp
src/gui/kernel/qwidget.cpp
Diffstat (limited to 'src/gui/embedded')
-rw-r--r-- | src/gui/embedded/qscreenvfb_qws.cpp | 8 | ||||
-rw-r--r-- | src/gui/embedded/qsoundqss_qws.cpp | 11 | ||||
-rw-r--r-- | src/gui/embedded/qvfbhdr.h | 35 | ||||
-rw-r--r-- | src/gui/embedded/qwscommand_qws_p.h | 2 |
4 files changed, 41 insertions, 15 deletions
diff --git a/src/gui/embedded/qscreenvfb_qws.cpp b/src/gui/embedded/qscreenvfb_qws.cpp index 19d4fa8..d71336d 100644 --- a/src/gui/embedded/qscreenvfb_qws.cpp +++ b/src/gui/embedded/qscreenvfb_qws.cpp @@ -196,7 +196,7 @@ bool QVFbScreen::connect(const QString &displaySpec) if (displayArgs.contains(QLatin1String("Gray"))) grayscale = true; - key_t key = ftok(QByteArray(QT_VFB_MOUSE_PIPE).replace("%1", QByteArray::number(displayId)), 'b'); + key_t key = ftok(QT_VFB_MOUSE_PIPE(displayId).toLocal8Bit(), 'b'); if (key == -1) return false; @@ -330,8 +330,7 @@ void QVFbScreen::disconnect() bool QVFbScreen::initDevice() { #ifndef QT_NO_QWS_MOUSE_QVFB - const QString mouseDev = QString::fromLatin1(QT_VFB_MOUSE_PIPE) - .arg(displayId); + const QString mouseDev = QT_VFB_MOUSE_PIPE(displayId); d_ptr->mouse = new QVFbMouseHandler(QLatin1String("QVFbMouse"), mouseDev); qwsServer->setDefaultMouse("None"); if (d_ptr->mouse) @@ -339,8 +338,7 @@ bool QVFbScreen::initDevice() #endif #if !defined(QT_NO_QWS_KBD_QVFB) && !defined(QT_NO_QWS_KEYBOARD) - const QString keyboardDev = QString::fromLatin1(QT_VFB_KEYBOARD_PIPE) - .arg(displayId); + const QString keyboardDev = QT_VFB_KEYBOARD_PIPE(displayId); d_ptr->keyboard = new QVFbKeyboardHandler(keyboardDev); qwsServer->setDefaultKeyboard("None"); #endif diff --git a/src/gui/embedded/qsoundqss_qws.cpp b/src/gui/embedded/qsoundqss_qws.cpp index 6bac8dc..b859be5 100644 --- a/src/gui/embedded/qsoundqss_qws.cpp +++ b/src/gui/embedded/qsoundqss_qws.cpp @@ -67,6 +67,8 @@ #include <qdebug.h> +#include <qvfbhdr.h> + extern int errno; QT_BEGIN_NAMESPACE @@ -79,7 +81,6 @@ QT_BEGIN_NAMESPACE static int sound_speed = 44100; #ifndef QT_NO_QWS_SOUNDSERVER extern int qws_display_id; -#define SOUND_PIPE "/tmp/.qt_soundserver-%1" #endif static char *zeroMem = 0; @@ -708,7 +709,7 @@ protected: #ifndef QT_NO_QWS_SOUNDSERVER QWSSoundServerSocket::QWSSoundServerSocket(QObject *parent) : - QWSServerSocket(QString::fromLatin1(SOUND_PIPE).arg(qws_display_id), parent) + QWSServerSocket(QT_VFB_SOUND_PIPE(qws_display_id), parent) { connect(this, SIGNAL(newConnection()), this, SLOT(newConnection())); } @@ -716,7 +717,7 @@ QWSSoundServerSocket::QWSSoundServerSocket(QObject *parent) : #ifdef QT3_SUPPORT QWSSoundServerSocket::QWSSoundServerSocket(QObject *parent, const char *name) : - QWSServerSocket(QString::fromLatin1(SOUND_PIPE).arg(qws_display_id), parent) + QWSServerSocket(QT_VFB_SOUND_PIPE(qws_display_id), parent) { if (name) setObjectName(QString::fromAscii(name)); @@ -1395,7 +1396,7 @@ void QWSSoundServer::translateSoundCompleted( int, int sid ) QWSSoundClient::QWSSoundClient(QObject* parent) : QWSSocket(parent) { - connectToLocalFile(QString::fromLatin1(SOUND_PIPE).arg(qws_display_id)); + connectToLocalFile(QT_VFB_SOUND_PIPE(qws_display_id)); QObject::connect(this,SIGNAL(readyRead()), this,SLOT(tryReadCommand())); if( state() == QWS_SOCK_BASE::ConnectedState ) QTimer::singleShot(1, this, SIGNAL(connected())); @@ -1409,7 +1410,7 @@ QWSSoundClient::~QWSSoundClient( ) void QWSSoundClient::reconnect() { - connectToLocalFile(QString::fromLatin1(SOUND_PIPE).arg(qws_display_id)); + connectToLocalFile(QT_VFB_SOUND_PIPE(qws_display_id)); if( state() == QWS_SOCK_BASE::ConnectedState ) emit connected(); else emit error( QTcpSocket::ConnectionRefusedError ); } diff --git a/src/gui/embedded/qvfbhdr.h b/src/gui/embedded/qvfbhdr.h index 73e08e0..73b13d3 100644 --- a/src/gui/embedded/qvfbhdr.h +++ b/src/gui/embedded/qvfbhdr.h @@ -52,9 +52,38 @@ QT_BEGIN_NAMESPACE QT_MODULE(Gui) -#define QT_VFB_MOUSE_PIPE "/tmp/.qtvfb_mouse-%1" -#define QT_VFB_KEYBOARD_PIPE "/tmp/.qtvfb_keyboard-%1" -#define QT_VFB_MAP "/tmp/.qtvfb_map-%1" +#ifndef QT_QWS_TEMP_DIR +#define QT_QWS_TEMP_DIR "/tmp" +#endif + +#ifdef QT_PRIVATE_QWS +#define QT_VFB_DATADIR(DISPLAY) QString("%1/qtembedded-%2-%3") \ + .arg(QT_QWS_TEMP_DIR).arg(getuid()).arg(DISPLAY) + +#define QT_VFB_MOUSE_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \ + .append("/qtvfb_mouse") +#define QT_VFB_KEYBOARD_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \ + .append("/qtvfb_keyboard") +#define QT_VFB_MAP(DISPLAY) QT_VFB_DATADIR(DISPLAY) \ + .append("/qtvfb_map") +#define QT_VFB_SOUND_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \ + .append("/qt_soundserver") +#define QTE_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \ + .append("/QtEmbedded") +#define QTE_PIPE_QVFB(DISPLAY) QTE_PIPE(DISPLAY) +#else +#define QT_VFB_DATADIR(DISPLAY) QString("%1/qtembedded-%2") \ + .arg(QT_QWS_TEMP_DIR).arg(DISPLAY) +#define QT_VFB_MOUSE_PIPE(DISPLAY) QString("/tmp/.qtvfb_mouse-%1").arg(DISPLAY) +#define QT_VFB_KEYBOARD_PIPE(DISPLAY) QString("/tmp/.qtvfb_keyboard-%1").arg(DISPLAY) +#define QT_VFB_MAP(DISPLAY) QString("/tmp/.qtvfb_map-%1").arg(DISPLAY) +#define QT_VFB_SOUND_PIPE(DISPLAY) QString("/tmp/.qt_soundserver-%1").arg(DISPLAY) +#define QTE_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \ + .append("/QtEmbedded-%1") \ + .arg(DISPLAY) +#define QTE_PIPE_QVFB(DISPLAY) QString("/tmp/qtembedded-%1/QtEmbedded-%1") \ + .arg(DISPLAY) +#endif struct QVFbHeader { diff --git a/src/gui/embedded/qwscommand_qws_p.h b/src/gui/embedded/qwscommand_qws_p.h index d92c6af..f986a9d 100644 --- a/src/gui/embedded/qwscommand_qws_p.h +++ b/src/gui/embedded/qwscommand_qws_p.h @@ -75,8 +75,6 @@ QT_BEGIN_NAMESPACE QT_MODULE(Gui) -#define QTE_PIPE "QtEmbedded-%1" - class QRect; /********************************************************************* |