summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogs/qinputdialog.cpp3
-rw-r--r--src/gui/image/qxbmhandler.cpp25
-rw-r--r--src/gui/kernel/qapplication.cpp12
-rw-r--r--src/gui/kernel/qapplication_x11.cpp24
-rw-r--r--src/gui/kernel/qt_x11_p.h1
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp38
-rw-r--r--src/gui/styles/qs60style.cpp18
-rw-r--r--src/gui/styles/qs60style_p.h1
8 files changed, 75 insertions, 47 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/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index a2da94c..8088e63 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -4629,38 +4629,40 @@ void QClipData::fixup()
return;
}
-// qDebug("QClipData::fixup: count=%d",count);
int y = -1;
ymin = m_spans[0].y;
ymax = m_spans[count-1].y + 1;
xmin = INT_MAX;
xmax = 0;
+ const int firstLeft = m_spans[0].x;
+ const int firstRight = m_spans[0].x + m_spans[0].len;
bool isRect = true;
- int left = m_spans[0].x;
- int right = m_spans[0].x + m_spans[0].len;
for (int i = 0; i < count; ++i) {
- if (m_spans[i].y != y) {
- if (m_spans[i].y != y + 1 && y != -1) {
+ QT_FT_Span_& span = m_spans[i];
+
+ if (span.y != y) {
+ if (span.y != y + 1 && y != -1)
isRect = false;
- }
- y = m_spans[i].y;
- m_clipLines[y].spans = m_spans+i;
- m_clipLines[y].count = 0;
-// qDebug() << " new line: y=" << y;
- }
- ++m_clipLines[y].count;
- int sl = (int) m_spans[i].x;
- int sr = sl + m_spans[i].len;
+ y = span.y;
+ m_clipLines[y].spans = &span;
+ m_clipLines[y].count = 1;
+ } else
+ ++m_clipLines[y].count;
+
+ const int spanLeft = span.x;
+ const int spanRight = spanLeft + span.len;
+
+ if (spanLeft < xmin)
+ xmin = spanLeft;
- xmin = qMin(xmin, (int)m_spans[i].x);
- xmax = qMax(xmax, (int)m_spans[i].x + m_spans[i].len);
+ if (spanRight > xmax)
+ xmax = spanRight;
- if (sl != left || sr != right)
+ if (spanLeft != firstLeft || spanRight != firstRight)
isRect = false;
}
-// qDebug("xmin=%d,xmax=%d,ymin=%d,ymax=%d %s", xmin, xmax, ymin, ymax, isRect ? "rectangular" : "");
if (isRect) {
hasRectClip = true;
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