diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-05 22:52:50 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-05 22:52:50 (GMT) |
commit | 7f6deb2d42933f59adbebc95b872e670978de3e6 (patch) | |
tree | 329bc78a9766c296186605fab85acecb16293dbe /src/gui | |
parent | 84c519862aa3a089471af6fd2174b16a88c10844 (diff) | |
parent | 58bac5551cbeed83a99e257226bb7b40d363bab9 (diff) | |
download | Qt-7f6deb2d42933f59adbebc95b872e670978de3e6.zip Qt-7f6deb2d42933f59adbebc95b872e670978de3e6.tar.gz Qt-7f6deb2d42933f59adbebc95b872e670978de3e6.tar.bz2 |
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (72 commits)
Fix opening a network session multiple times in succession.
Fix synchronous dispatch in ICD in non-main threads.
Russian translation update
QNAM HTTP: Download last chunk properly when readBufferSize() limited
Remove code changes that were NOT intended as part of the fix
Prevent access to non-existent memory in QGL2PEXVertexArray
Wordwrap QInputDialog label in Symbian
Prevent excessive seeks in xbm detection
Use qtmain.lib to provide entry point for all Symbian applications
Give the toplevel widget a layout
Doc: Correcting character escape bug
fix tests when using Qt in a namespace
Fix tst_symbols auto test
Doc: Clarified the lifetime of the session bus connection.
Doc: Added a snippet showing the default BorderImage tiling behavior.
Doc: using pointer member variables and language change
Doc: Added more instructions to help with device file permissions.
Doc: Mentioned default values for the BorderImage tile modes.
Document the difference between +0.0 and -0.0 for QPointF and QSizeF.
trivial: fix build
...
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/qinputdialog.cpp | 3 | ||||
-rw-r--r-- | src/gui/image/qxbmhandler.cpp | 25 | ||||
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 12 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_x11.cpp | 24 | ||||
-rw-r--r-- | src/gui/kernel/qt_x11_p.h | 1 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 18 | ||||
-rw-r--r-- | src/gui/styles/qs60style_p.h | 1 |
7 files changed, 55 insertions, 29 deletions
diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp index 778e796..9e4b9b6 100644 --- a/src/gui/dialogs/qinputdialog.cpp +++ b/src/gui/dialogs/qinputdialog.cpp @@ -561,6 +561,9 @@ void QInputDialog::setLabelText(const QString &text) } else { d->label->setText(text); } +#ifdef Q_OS_SYMBIAN + d->label->setWordWrap(true); +#endif } QString QInputDialog::labelText() const diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp index 0dd4e99..f9c2e0c 100644 --- a/src/gui/image/qxbmhandler.cpp +++ b/src/gui/image/qxbmhandler.cpp @@ -66,27 +66,36 @@ static inline int hex2byte(register char *p) static bool read_xbm_header(QIODevice *device, int& w, int& h) { const int buflen = 300; + const int maxlen = 4096; char buf[buflen + 1]; QRegExp r1(QLatin1String("^#define[ \t]+[a-zA-Z0-9._]+[ \t]+")); QRegExp r2(QLatin1String("[0-9]+")); qint64 readBytes = 0; + qint64 totalReadBytes = 0; - // "#define .._width <num>" - readBytes = device->readLine(buf, buflen); - if (readBytes <= 0) - return false; - buf[readBytes - 1] = '\0'; + buf[0] = '\0'; // skip initial comment, if any - while (buf[0] != '#' && (readBytes = device->readLine( buf, buflen )) > 0) {} + while (buf[0] != '#') { + readBytes = device->readLine(buf, buflen); + + // if readBytes >= buflen, it's very probably not a C file + if (readBytes <= 0 || readBytes >= buflen -1) + return false; + + // limit xbm headers to the first 4k in the file to prevent + // excessive reads on non-xbm files + totalReadBytes += readBytes; + if (totalReadBytes >= maxlen) + return false; + } - if (readBytes <= 0) - return false; buf[readBytes - 1] = '\0'; QString sbuf; sbuf = QString::fromLatin1(buf); + // "#define .._width <num>" if (r1.indexIn(sbuf) == 0 && r2.indexIn(sbuf, r1.matchedLength()) == r1.matchedLength()) w = QByteArray(&buf[r1.matchedLength()]).trimmed().toInt(); diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 1d80809..833e803 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -1433,10 +1433,18 @@ QStyle *QApplication::style() // Compile-time search for default style // QString style; - if (!QApplicationPrivate::styleOverride.isEmpty()) +#ifdef QT_BUILD_INTERNAL + QString envStyle = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE")); +#else + QString envStyle; +#endif + if (!QApplicationPrivate::styleOverride.isEmpty()) { style = QApplicationPrivate::styleOverride; - else + } else if (!envStyle.isEmpty()) { + style = envStyle; + } else { style = QApplicationPrivate::desktopStyleKey(); + } QStyle *&app_style = QApplicationPrivate::app_style; app_style = QStyleFactory::create(style); diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index cbc2356..ff98229 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -2335,6 +2335,30 @@ void qt_init(QApplicationPrivate *priv, int, X11->desktopEnvironment = DE_4DWM; break; } + + if (XGetWindowProperty(X11->display, QX11Info::appRootWindow(), + ATOM(_NET_SUPPORTING_WM_CHECK), + 0, 1024, False, XA_WINDOW, &type, + &format, &length, &after, &data) == Success) { + if (type == XA_WINDOW && format == 32) { + Window windowManagerWindow = *((Window*) data); + XFree(data); + data = 0; + + if (windowManagerWindow != XNone) { + Atom utf8atom = ATOM(UTF8_STRING); + if (XGetWindowProperty(QX11Info::display(), windowManagerWindow, ATOM(_NET_WM_NAME), + 0, 1024, False, utf8atom, &type, + &format, &length, &after, &data) == Success) { + if (type == utf8atom && format == 8) { + if (qstrcmp((const char *)data, "MCompositor") == 0) + X11->desktopEnvironment = DE_MEEGO_COMPOSITOR; + } + } + } + } + } + } while(0); if (data) diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h index d62d9c3..56c8094 100644 --- a/src/gui/kernel/qt_x11_p.h +++ b/src/gui/kernel/qt_x11_p.h @@ -338,6 +338,7 @@ enum DesktopEnvironment { DE_KDE, DE_GNOME, DE_CDE, + DE_MEEGO_COMPOSITOR, DE_4DWM }; diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 1262340..6fb3689 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -112,8 +112,6 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { // *** End of generated data *** }; -QSet<const QWidget *> *QS60StylePrivate::m_autoFillDisabledWidgets = 0; - const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0]; // theme background texture @@ -154,8 +152,6 @@ const double KTabFontMul = 0.72; QS60StylePrivate::~QS60StylePrivate() { - delete m_autoFillDisabledWidgets; - m_autoFillDisabledWidgets = 0; clearCaches(); //deletes also background image deleteThemePalette(); #ifdef Q_WS_S60 @@ -3188,13 +3184,6 @@ void QS60Style::polish(QWidget *widget) } d->setThemePalette(widget); d->setFont(widget); - - if (widget->autoFillBackground()) { - if (!d->m_autoFillDisabledWidgets) - d->m_autoFillDisabledWidgets = new QSet<const QWidget *>; - widget->setAutoFillBackground(false); - d->m_autoFillDisabledWidgets->insert(widget); - } } /*! @@ -3229,13 +3218,6 @@ void QS60Style::unpolish(QWidget *widget) if (widget) widget->setPalette(QPalette()); - - if (d->m_autoFillDisabledWidgets && - !d->m_autoFillDisabledWidgets->isEmpty() && - d->m_autoFillDisabledWidgets->contains(widget)) { - widget->setAutoFillBackground(true); - d->m_autoFillDisabledWidgets->remove(widget); - } #if defined(Q_WS_S60) && !defined(QT_NO_PROGRESSBAR) if (QProgressBar *bar = qobject_cast<QProgressBar *>(widget)) { diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 3d66c40..b46f75e 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -625,7 +625,6 @@ private: static qint64 m_webPaletteKey; static QPointer<QWidget> m_pressedWidget; - static QSet<const QWidget *> *m_autoFillDisabledWidgets; #ifdef Q_WS_S60 //list of progress bars having animation running |