summaryrefslogtreecommitdiffstats
path: root/src/gui/embedded
diff options
context:
space:
mode:
authorTakumi ASAKI <takumi.asaki@nokia.com>2009-07-23 07:23:25 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2009-08-21 08:36:18 (GMT)
commit1c3ba5fd9e16ef084a2e17380c4d635c87b2db26 (patch)
tree1e8d56e1c75faa7e7e4984a0fa87bd33a5aba3f4 /src/gui/embedded
parenteffb3815f935e2e8a4699630d258d531efdc6029 (diff)
downloadQt-1c3ba5fd9e16ef084a2e17380c4d635c87b2db26.zip
Qt-1c3ba5fd9e16ef084a2e17380c4d635c87b2db26.tar.gz
Qt-1c3ba5fd9e16ef084a2e17380c4d635c87b2db26.tar.bz2
Allow linuxfb device names like /dev/fb/0
Previously, length of linuxfb device's path must be 8 and start with "/dev/fb". Reviewed-by: Paul
Diffstat (limited to 'src/gui/embedded')
-rw-r--r--src/gui/embedded/qscreenlinuxfb_qws.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/embedded/qscreenlinuxfb_qws.cpp b/src/gui/embedded/qscreenlinuxfb_qws.cpp
index 34fc54c..69e5808 100644
--- a/src/gui/embedded/qscreenlinuxfb_qws.cpp
+++ b/src/gui/embedded/qscreenlinuxfb_qws.cpp
@@ -271,15 +271,13 @@ bool QLinuxFbScreen::connect(const QString &displaySpec)
QScreen::setFrameBufferLittleEndian(true);
#endif
- // Check for explicitly specified device
- const int len = 8; // "/dev/fbx"
- int m = displaySpec.indexOf(QLatin1String("/dev/fb"));
-
- QString dev;
- if (m > 0)
- dev = displaySpec.mid(m, len);
- else
- dev = QLatin1String("/dev/fb0");
+ QString dev = QLatin1String("/dev/fb0");
+ foreach(QString d, args) {
+ if (d.startsWith(QLatin1Char('/'))) {
+ dev = d;
+ break;
+ }
+ }
if (access(dev.toLatin1().constData(), R_OK|W_OK) == 0)
d_ptr->fd = QT_OPEN(dev.toLatin1().constData(), O_RDWR);