summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJeremy Katz <jeremy.katz@nokia.com>2009-10-01 12:08:11 (GMT)
committerJeremy Katz <jeremy.katz@nokia.com>2009-10-01 12:12:28 (GMT)
commit072e748adbdab1d51b240b9983ce82b213b66f18 (patch)
tree67d170ab4e0bba06adc3479ea6af3214e24636e4 /tools
parent938ba08e7bf90063127b298da25a124441659e89 (diff)
downloadQt-072e748adbdab1d51b240b9983ce82b213b66f18.zip
Qt-072e748adbdab1d51b240b9983ce82b213b66f18.tar.gz
Qt-072e748adbdab1d51b240b9983ce82b213b66f18.tar.bz2
Enable qws/qvfb use for multiple users on one machine
Task-number: QTBUG-1711 Reviewed-by: Paul
Diffstat (limited to 'tools')
-rw-r--r--tools/qvfb/qvfb.cpp7
-rw-r--r--tools/qvfb/qvfbprotocol.cpp6
-rw-r--r--tools/qvfb/qvfbshmem.cpp8
3 files changed, 11 insertions, 10 deletions
diff --git a/tools/qvfb/qvfb.cpp b/tools/qvfb/qvfb.cpp
index 879fb6b..6119419 100644
--- a/tools/qvfb/qvfb.cpp
+++ b/tools/qvfb/qvfb.cpp
@@ -41,6 +41,7 @@
#include "qvfb.h"
#include "qvfbview.h"
+#include "qvfbhdr.h"
#ifdef Q_WS_X11
#include "qvfbx11view.h"
#endif
@@ -134,7 +135,7 @@ static const char *red_off_led_xpm[] = {
static bool copyButtonConfiguration(const QString &prefix, int displayId)
{
- const QString destDir = QString(QLatin1String("/tmp/qtembedded-%1/")).arg(displayId);
+ const QString destDir = QT_VFB_DATADIR(displayId);
const QFileInfo src(prefix + QLatin1String("defaultbuttons.conf"));
const QFileInfo dst(destDir + QLatin1String("defaultbuttons.conf"));
unlink(dst.absoluteFilePath().toLatin1().constData());
@@ -351,9 +352,9 @@ void QVFb::init( int display_id, int pw, int ph, int d, int r, const QString& sk
ph += 2; // avoid scrollbar
scroller->show();
// delete defaultbuttons.conf if it was left behind...
- unlink(QFileInfo(QString("/tmp/qtembedded-%1/defaultbuttons.conf").arg(view->displayId())).absoluteFilePath().toLatin1().constData());
+ unlink(QFileInfo(QT_VFB_DATADIR(view->displayId()).append("/defaultbuttons.conf")).absoluteFilePath().toLatin1().constData());
if (secondaryView)
- unlink(QFileInfo(QString("/tmp/qtembedded-%1/defaultbuttons.conf").arg(view->displayId()+1)).absoluteFilePath().toLatin1().constData());
+ unlink(QFileInfo(QT_VFB_DATADIR(view->displayId() + 1).append("/defaultbuttons.conf")).absoluteFilePath().toLatin1().constData());
}
view->setRate(refreshRate);
if (secondaryView) {
diff --git a/tools/qvfb/qvfbprotocol.cpp b/tools/qvfb/qvfbprotocol.cpp
index b09ed0e..df6c110 100644
--- a/tools/qvfb/qvfbprotocol.cpp
+++ b/tools/qvfb/qvfbprotocol.cpp
@@ -56,6 +56,8 @@
#include <unistd.h>
#endif
+#include "qvfbshmem.h"
+
QT_BEGIN_NAMESPACE
QVFbViewProtocol::QVFbViewProtocol(int display_id, QObject *parent) :
@@ -90,7 +92,7 @@ static int openPipe(const char *fileName)
QVFbKeyPipeProtocol::QVFbKeyPipeProtocol(int display_id)
: QVFbKeyProtocol(display_id)
{
- fileName = QString(QT_VFB_KEYBOARD_PIPE).arg(display_id);
+ fileName = QT_VFB_KEYBOARD_PIPE(display_id);
fd = openPipe(fileName.toLocal8Bit().constData());
if (fd == -1)
@@ -119,7 +121,7 @@ void QVFbKeyPipeProtocol::sendKeyboardData(QString unicode, int keycode,
QVFbMousePipe::QVFbMousePipe(int display_id)
: QVFbMouseProtocol(display_id)
{
- fileName = QString(QT_VFB_MOUSE_PIPE).arg(display_id);
+ fileName = QT_VFB_MOUSE_PIPE(display_id);
fd = openPipe(fileName.toLocal8Bit().constData());
if (fd == -1)
diff --git a/tools/qvfb/qvfbshmem.cpp b/tools/qvfb/qvfbshmem.cpp
index 0d2b3ca..8c4cdb9 100644
--- a/tools/qvfb/qvfbshmem.cpp
+++ b/tools/qvfb/qvfbshmem.cpp
@@ -44,8 +44,6 @@
#include "qvfbshmem.h"
#include "qvfbhdr.h"
-#define QTE_PIPE "QtEmbedded-%1"
-
#include <QFile>
#include <QTimer>
@@ -71,7 +69,7 @@ QT_BEGIN_NAMESPACE
// live.
static QString qws_dataDir(int qws_display_id)
{
- QByteArray dataDir = QString("/tmp/qtembedded-%1").arg(qws_display_id).toLocal8Bit();
+ QByteArray dataDir = QT_VFB_DATADIR(qws_display_id).toLocal8Bit();
if (mkdir(dataDir, 0700)) {
if (errno != EEXIST) {
qFatal("Cannot create Qt for Embedded Linux data directory: %s", dataDir.constData());
@@ -151,6 +149,8 @@ QShMemViewProtocol::QShMemViewProtocol(int displayid, const QSize &s,
}
}
+ displayPipe = qws_dataDir(displayid).append(QTE_PIPE);
+
kh = new QVFbKeyPipeProtocol(displayid);
/* should really depend on receiving qt version, but how can
one tell? */
@@ -209,8 +209,6 @@ QShMemViewProtocol::QShMemViewProtocol(int displayid, const QSize &s,
hdr->brightness = 255;
hdr->windowId = 0;
- displayPipe = qws_dataDir(displayid) + QString(QTE_PIPE).arg(displayid);
-
displayPiped = displayPipe + 'd';