summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/webkit/.tag2
-rw-r--r--src/3rdparty/webkit/ChangeLog9
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/ChangeLog28
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri6
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h12
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog81
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro2
-rw-r--r--src/3rdparty/webkit/WebCore/bridge/qt/qt_class.cpp8
-rw-r--r--src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/css/CSSParser.cpp1
-rw-r--r--src/3rdparty/webkit/WebCore/editing/ApplyStyleCommand.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp6
-rw-r--r--src/3rdparty/webkit/WebKit.pro2
-rw-r--r--src/gui/image/qicon.cpp25
-rw-r--r--src/gui/styles/qgtkpainter.cpp9
-rw-r--r--src/gui/styles/qstylehelper.cpp62
-rw-r--r--src/gui/styles/qstylehelper_p.h33
20 files changed, 211 insertions, 85 deletions
diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index 9d754a4..1973377 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-3d774b9df1f963452b1cfe34f9fafad0d399372a
+807157e42add842605ec67d9363dd3f1861748ca
diff --git a/src/3rdparty/webkit/ChangeLog b/src/3rdparty/webkit/ChangeLog
index a0cf2d0..8f9c7ac 100644
--- a/src/3rdparty/webkit/ChangeLog
+++ b/src/3rdparty/webkit/ChangeLog
@@ -1,3 +1,12 @@
+2010-05-14 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Antti Koivisto.
+
+ [Qt] Rename QtLauncher to QtTestBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=37665
+
+ * WebKit.pro:
+
2010-05-12 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
index a3e6586..016e0dd 100644
--- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
@@ -1,3 +1,31 @@
+2010-04-20 Csaba Osztrogonác <ossy@webkit.org>
+
+ [Qt] Unreviewed speculative buildfix for WinCE after r57882
+ https://bugs.webkit.org/show_bug.cgi?id=37701
+
+ * JavaScriptCore.pri: missing wince* case added.
+
+2010-04-20 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Target(WebCore,jsc,...) must depends on static library of JavaScriptCore
+ https://bugs.webkit.org/show_bug.cgi?id=37701
+
+ * JavaScriptCore.pri: dependency added.
+
+2010-05-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Fix a VS2010 assert in std::copy
+ https://bugs.webkit.org/show_bug.cgi?id=38630
+
+ The assert complains that the output iterator is null.
+
+ * wtf/Vector.h:
+ (WTF::::operator):
+
2010-05-12 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
index b3f74a9..cc4a1b3 100644
--- a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
+++ b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
@@ -75,19 +75,22 @@ defineTest(addJavaScriptCoreLib) {
# Argument is the relative path to JavaScriptCore.pro's qmake output
pathToJavaScriptCoreOutput = $$ARGS/$$JAVASCRIPTCORE_DESTDIR
- win32-msvc* {
+ win32-msvc*|wince* {
LIBS += -L$$pathToJavaScriptCoreOutput
LIBS += -l$$JAVASCRIPTCORE_TARGET
+ POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}$${JAVASCRIPTCORE_TARGET}.lib
} else:symbian {
LIBS += -l$${JAVASCRIPTCORE_TARGET}.lib
# The default symbian build system does not use library paths at all. However when building with
# qmake's symbian makespec that uses Makefiles
QMAKE_LIBDIR += $$pathToJavaScriptCoreOutput
+ POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}$${JAVASCRIPTCORE_TARGET}.lib
} else {
# Make sure jscore will be early in the list of libraries to workaround a bug in MinGW
# that can't resolve symbols from QtCore if libjscore comes after.
QMAKE_LIBDIR = $$pathToJavaScriptCoreOutput $$QMAKE_LIBDIR
LIBS += -l$$JAVASCRIPTCORE_TARGET
+ POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}lib$${JAVASCRIPTCORE_TARGET}.a
}
win32-* {
@@ -101,6 +104,7 @@ defineTest(addJavaScriptCoreLib) {
export(QMAKE_LIBDIR)
export(LIBS)
+ export(POST_TARGETDEPS)
export(CONFIG)
return(true)
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h
index e495067..4d9ea61 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h
@@ -686,6 +686,12 @@ namespace WTF {
return *this;
}
+// Works around an assert in VS2010. See https://connect.microsoft.com/VisualStudio/feedback/details/558044/std-copy-should-not-check-dest-when-first-last
+#if COMPILER(MSVC) && defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL
+ if (!begin())
+ return *this;
+#endif
+
std::copy(other.begin(), other.begin() + size(), begin());
TypeOperations::uninitializedCopy(other.begin() + size(), other.end(), end());
m_size = other.size();
@@ -709,6 +715,12 @@ namespace WTF {
return *this;
}
+// Works around an assert in VS2010. See https://connect.microsoft.com/VisualStudio/feedback/details/558044/std-copy-should-not-check-dest-when-first-last
+#if COMPILER(MSVC) && defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL
+ if (!begin())
+ return *this;
+#endif
+
std::copy(other.begin(), other.begin() + size(), begin());
TypeOperations::uninitializedCopy(other.begin() + size(), other.end(), end());
m_size = other.size();
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index a440c03..79581d1 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
and has the sha1 checksum
- 5cf023650a8da206a8cf3130e9d4820b95e1bc7c
+ cacbdf18fc917122834042d77a9164a490aafde4
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 93d00e4..481b416 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,84 @@
+2010-05-17 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Laszlo Gombos.
+
+ REGRESSION(59563): [Qt] JSValue QtClass::fallbackObject can be optimized
+
+ Patch declared a variable index, which shadowed an earlier declared
+ variable.
+
+ * bridge/qt/qt_class.cpp:
+ (JSC::Bindings::QtClass::fallbackObject):
+
+2010-05-14 Noam Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] GraphicsLayer caches directly composited images
+ https://bugs.webkit.org/show_bug.cgi?id=38444
+
+ Directly-composited images and solid fills shouldn't be cached, as that cache
+ is never used (see GraphicsLayerQtImpl::paint). Cache is only relevant for HTML content,
+ but we were missing that test.
+ The fix makes sure we only cache HTML content.
+
+ No new tests: this is a minor optimization.
+
+ * platform/graphics/qt/GraphicsLayerQt.cpp:
+ (WebCore::GraphicsLayerQtImpl::flushChanges):
+
+2010-05-15 Anders Bakken <agbakken@gmail.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Don't unnecessarily copy data when searching for methods in QtClass.
+
+ [Qt] JSValue QtClass::fallbackObject can be optimized
+ https://bugs.webkit.org/show_bug.cgi?id=37684
+
+ * bridge/qt/qt_class.cpp:
+ (JSC::Bindings::QtClass::fallbackObject):
+
+2010-05-06 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Rubber-stamped by Simon Hausmann.
+
+ [Qt] use QT_MOBILE_THEME in Symbian
+ https://bugs.webkit.org/show_bug.cgi?id=38440
+
+ Putting QT_MOBILE_THEME into use for Symbian.
+
+ * WebCore.pro:
+
+2010-05-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ CSSParser::parseColor() shouldn't alter 'color' unless passed a valid color string.
+ https://bugs.webkit.org/show_bug.cgi?id=39031
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseColor):
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::StyleChange::extractTextStyles): Don't depend on old behavior.
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setShadow): Remove dead code.
+
+2010-05-14 Aaron Kennedy <tffeeb@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] JavaScript unable to invoke methods declared in QML
+ https://bugs.webkit.org/show_bug.cgi?id=38949
+
+ JavaScript code executed by webkit cannot call into QML declared
+ methods, as it does not check for dynamic meta objects.
+
+ * bridge/qt/qt_instance.cpp:
+ (JSC::Bindings::QtInstance::stringValue): Use QMetaObject::metacall.
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::QtRuntimeMetaMethod::call): Ditto.
+
2010-05-12 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 689c5ff..5def728 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -125,7 +125,7 @@ maemo5|symbian|embedded {
DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1
}
-maemo5 {
+maemo5|symbian {
DEFINES += WTF_USE_QT_MOBILE_THEME=1
}
diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.cpp b/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.cpp
index cfd74d9..2e1f6e6 100644
--- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.cpp
+++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.cpp
@@ -98,10 +98,12 @@ JSValue QtClass::fallbackObject(ExecState* exec, Instance* inst, const Identifie
if (m.access() == QMetaMethod::Private)
continue;
- QByteArray signature = m.signature();
- signature.truncate(signature.indexOf('('));
+ int iter = 0;
+ const char* signature = m.signature();
+ while (signature[iter] && signature[iter] != '(')
+ ++iter;
- if (normal == signature) {
+ if (normal == QByteArray::fromRawData(signature, iter)) {
QtRuntimeMetaMethod* val = new (exec) QtRuntimeMetaMethod(exec, identifier, static_cast<QtInstance*>(inst), index, normal, false);
qtinst->m_methods.insert(name, val);
return val;
diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp b/src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp
index f6f368b..d40ab0b 100644
--- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp
+++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp
@@ -287,7 +287,7 @@ JSValue QtInstance::stringValue(ExecState* exec) const
void * qargs[1];
qargs[0] = ret.data();
- if (obj->qt_metacall(QMetaObject::InvokeMetaMethod, index, qargs) < 0) {
+ if (QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, index, qargs) < 0) {
if (ret.isValid() && ret.canConvert(QVariant::String)) {
buf = ret.toString().toLatin1().constData(); // ### Latin 1? Ascii?
useDefault = false;
diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp
index 1775815..4524d97 100644
--- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp
+++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp
@@ -1397,7 +1397,7 @@ JSValue QtRuntimeMetaMethod::call(ExecState* exec, JSObject* functionObject, JSV
int methodIndex;
JSObject* errorObj = 0;
if ((methodIndex = findMethodIndex(exec, obj->metaObject(), d->m_signature, d->m_allowPrivate, args, vargs, (void **)qargs, &errorObj)) != -1) {
- if (obj->qt_metacall(QMetaObject::InvokeMetaMethod, methodIndex, qargs) >= 0)
+ if (QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, methodIndex, qargs) >= 0)
return jsUndefined();
if (vargs[0].isValid())
diff --git a/src/3rdparty/webkit/WebCore/css/CSSParser.cpp b/src/3rdparty/webkit/WebCore/css/CSSParser.cpp
index 214fc51..a5a8b5c 100644
--- a/src/3rdparty/webkit/WebCore/css/CSSParser.cpp
+++ b/src/3rdparty/webkit/WebCore/css/CSSParser.cpp
@@ -279,7 +279,6 @@ bool CSSParser::parseValue(CSSMutableStyleDeclaration* declaration, int id, cons
// possible to set up a default color.
bool CSSParser::parseColor(RGBA32& color, const String& string, bool strict)
{
- color = 0;
CSSParser parser(true);
// First try creating a color specified by name or the "#" syntax.
diff --git a/src/3rdparty/webkit/WebCore/editing/ApplyStyleCommand.cpp b/src/3rdparty/webkit/WebCore/editing/ApplyStyleCommand.cpp
index 1c739ec..529d9d3 100644
--- a/src/3rdparty/webkit/WebCore/editing/ApplyStyleCommand.cpp
+++ b/src/3rdparty/webkit/WebCore/editing/ApplyStyleCommand.cpp
@@ -212,7 +212,7 @@ void StyleChange::extractTextStyles(CSSMutableStyleDeclaration* style)
if (RefPtr<CSSValue> colorValue = style->getPropertyCSSValue(CSSPropertyColor)) {
ASSERT(colorValue->isPrimitiveValue());
CSSPrimitiveValue* primitiveColor = static_cast<CSSPrimitiveValue*>(colorValue.get());
- RGBA32 rgba;
+ RGBA32 rgba = 0;
if (primitiveColor->primitiveType() != CSSPrimitiveValue::CSS_RGBCOLOR) {
CSSParser::parseColor(rgba, colorValue->cssText());
// Need to take care of named color such as green and black
diff --git a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 823ab59..398e4d8 100644
--- a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -873,8 +873,6 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
return;
RGBA32 rgba = makeRGBA32FromFloats(r, g, b, a); // default is transparent black
- if (!state().m_shadowColor.isEmpty())
- CSSParser::parseColor(rgba, state().m_shadowColor);
c->setShadow(IntSize(width, -height), state().m_shadowBlur, Color(rgba), DeviceColorSpace);
}
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
index d9394e1..969e00a 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
@@ -599,8 +599,10 @@ void GraphicsLayerQtImpl::flushChanges(bool recursive, bool forceUpdateTransform
if (m_maskEffect)
m_maskEffect.data()->update();
else if (m_changeMask & DisplayChange) {
- // Recache now: all the content is ready and we don't want to wait until the paint event.
- recache(m_pendingContent.regionToUpdate);
+ // Recache now: all the content is ready and we don't want to wait until the paint event. We only need to do this for HTML content,
+ // there's no point in caching directly composited content like images or solid rectangles.
+ if (m_pendingContent.contentType == HTMLContentType)
+ recache(m_pendingContent.regionToUpdate);
update(m_pendingContent.regionToUpdate.boundingRect());
m_pendingContent.regionToUpdate = QRegion();
}
diff --git a/src/3rdparty/webkit/WebKit.pro b/src/3rdparty/webkit/WebKit.pro
index 6d466e2..84fcb56 100644
--- a/src/3rdparty/webkit/WebKit.pro
+++ b/src/3rdparty/webkit/WebKit.pro
@@ -8,7 +8,7 @@ SUBDIRS += \
WebCore
# If the source exists, built it
-exists($$PWD/WebKitTools/QtLauncher): SUBDIRS += WebKitTools/QtLauncher
+exists($$PWD/WebKitTools/QtTestBrowser): SUBDIRS += WebKitTools/QtTestBrowser
exists($$PWD/JavaScriptCore/jsc.pro): SUBDIRS += JavaScriptCore/jsc.pro
exists($$PWD/WebKit/qt/tests): SUBDIRS += WebKit/qt/tests
exists($$PWD/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro): SUBDIRS += WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index 891b1db..7696632 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -55,6 +55,7 @@
#include "qcache.h"
#include "qdebug.h"
#include "private/qguiplatformplugin_p.h"
+#include "private/qstylehelper_p.h"
#ifdef Q_WS_MAC
#include <private/qt_mac_p.h>
@@ -261,21 +262,17 @@ QPixmap QPixmapIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::St
if (!actualSize.isNull() && (actualSize.width() > size.width() || actualSize.height() > size.height()))
actualSize.scale(size, Qt::KeepAspectRatio);
- QString key = QLatin1String("$qt_icon_")
- + QString::number(pm.cacheKey())
- + QString::number(pe->mode)
- + QString::number(QApplication::palette().cacheKey())
- + QLatin1Char('_')
- + QString::number(actualSize.width())
- + QLatin1Char('_')
- + QString::number(actualSize.height())
- + QLatin1Char('_');
-
+ QString key = QLatin1Literal("qt_")
+ % HexString<quint64>(pm.cacheKey())
+ % HexString<uint>(pe->mode)
+ % HexString<quint64>(QApplication::palette().cacheKey())
+ % HexString<uint>(actualSize.width())
+ % HexString<uint>(actualSize.height());
if (mode == QIcon::Active) {
- if (QPixmapCache::find(key + QString::number(mode), pm))
+ if (QPixmapCache::find(key % HexString<uint>(mode), pm))
return pm; // horray
- if (QPixmapCache::find(key + QString::number(QIcon::Normal), pm)) {
+ if (QPixmapCache::find(key % HexString<uint>(QIcon::Normal), pm)) {
QStyleOption opt(0);
opt.palette = QApplication::palette();
QPixmap active = QApplication::style()->generatedIconPixmap(QIcon::Active, pm, &opt);
@@ -284,7 +281,7 @@ QPixmap QPixmapIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::St
}
}
- if (!QPixmapCache::find(key + QString::number(mode), pm)) {
+ if (!QPixmapCache::find(key % HexString<uint>(mode), pm)) {
if (pm.size() != actualSize)
pm = pm.scaled(actualSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
if (pe->mode != mode && mode != QIcon::Normal) {
@@ -294,7 +291,7 @@ QPixmap QPixmapIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::St
if (!generated.isNull())
pm = generated;
}
- QPixmapCache::insert(key + QString::number(mode), pm);
+ QPixmapCache::insert(key % HexString<uint>(mode), pm);
}
return pm;
}
diff --git a/src/gui/styles/qgtkpainter.cpp b/src/gui/styles/qgtkpainter.cpp
index 1f68f2f..79c53e9 100644
--- a/src/gui/styles/qgtkpainter.cpp
+++ b/src/gui/styles/qgtkpainter.cpp
@@ -47,6 +47,7 @@
// This class is primarily a wrapper around the gtk painter functions
// and takes care of converting all such calls into cached Qt pixmaps.
+#include <private/qstylehelper_p.h>
#include <QtGui/QWidget>
#include <QtGui/QStyleOption>
#include <QtGui/QPixmapCache>
@@ -155,8 +156,12 @@ static QString uniqueName(const QString &key, GtkStateType state, GtkShadowType
const QSize &size, GtkWidget *widget = 0)
{
// Note the widget arg should ideally use the widget path, though would compromise performance
- QString tmp = QString(QLS("%0-%1-%2-%3x%4-%5")).arg(key).arg(uint(state)).arg(shadow)
- .arg(size.width()).arg(size.height()).arg(quintptr(widget));
+ QString tmp = key
+ % HexString<uint>(state)
+ % HexString<uint>(shadow)
+ % HexString<uint>(size.width())
+ % HexString<uint>(size.height())
+ % HexString<quint64>(quint64(widget));
return tmp;
}
diff --git a/src/gui/styles/qstylehelper.cpp b/src/gui/styles/qstylehelper.cpp
index 296c51c..d09d7fa 100644
--- a/src/gui/styles/qstylehelper.cpp
+++ b/src/gui/styles/qstylehelper.cpp
@@ -58,67 +58,23 @@
QT_BEGIN_NAMESPACE
-// internal helper. Converts an integer value to an unique string token
-template <typename T>
-struct HexString
-{
- inline HexString(const T t)
- : val(t)
- {}
-
- inline void write(QChar *&dest) const
- {
- const ushort hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
- const char *c = reinterpret_cast<const char *>(&val);
- for (uint i = 0; i < sizeof(T); ++i) {
- *dest++ = hexChars[*c & 0xf];
- *dest++ = hexChars[(*c & 0xf0) >> 4];
- ++c;
- }
- }
-
- const T val;
-};
-
-// specialization to enable fast concatenating of our string tokens to a string
-template <typename T>
-struct QConcatenable<HexString<T> >
-{
- typedef HexString<T> type;
- enum { ExactSize = true };
- static int size(const HexString<T> &str) { return sizeof(str.val) * 2; }
- static inline void appendTo(const HexString<T> &str, QChar *&out) { str.write(out); }
-};
-
namespace QStyleHelper {
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)
{
const QStyleOptionComplex *complexOption = qstyleoption_cast<const QStyleOptionComplex *>(option);
-
- QString tmp = key
- % QLatin1Char('-')
- % HexString<uint>(option->state)
- % QLatin1Char('-')
- % HexString<uint>(option->direction)
- % QLatin1Char('-')
- % HexString<uint>(complexOption ? uint(complexOption->activeSubControls) : 0u)
- % QLatin1Char('-')
- % HexString<quint64>(option->palette.cacheKey())
- % QLatin1Char('-')
- % HexString<uint>(size.width())
- % QLatin1Char('x')
- % HexString<uint>(size.height());
+ QString tmp = key % HexString<uint>(option->state)
+ % HexString<uint>(option->direction)
+ % HexString<uint>(complexOption ? uint(complexOption->activeSubControls) : 0u)
+ % HexString<quint64>(option->palette.cacheKey())
+ % HexString<uint>(size.width())
+ % HexString<uint>(size.height());
#ifndef QT_NO_SPINBOX
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
- tmp = tmp
- % QLatin1Char('-')
- % HexString<uint>(spinBox->buttonSymbols)
- % QLatin1Char('-')
- % HexString<uint>(spinBox->stepEnabled)
- % QLatin1Char('-')
- % QLatin1Char(spinBox->frame ? '1' : '0');
+ tmp = tmp % HexString<uint>(spinBox->buttonSymbols)
+ % HexString<uint>(spinBox->stepEnabled)
+ % QLatin1Char(spinBox->frame ? '1' : '0'); ;
}
#endif // QT_NO_SPINBOX
return tmp;
diff --git a/src/gui/styles/qstylehelper_p.h b/src/gui/styles/qstylehelper_p.h
index 31cc4ed..71fce55 100644
--- a/src/gui/styles/qstylehelper_p.h
+++ b/src/gui/styles/qstylehelper_p.h
@@ -41,7 +41,9 @@
#include <QtCore/qglobal.h>
#include <QtCore/qpoint.h>
+#include <QtCore/qstring.h>
#include <QtGui/qpolygon.h>
+#include <QtCore/qstringbuilder.h>
#ifndef QSTYLEHELPER_P_H
#define QSTYLEHELPER_P_H
@@ -79,6 +81,37 @@ namespace QStyleHelper
int bottom = 0);
}
+// internal helper. Converts an integer value to an unique string token
+template <typename T>
+ struct HexString
+{
+ inline HexString(const T t)
+ : val(t)
+ {}
+
+ inline void write(QChar *&dest) const
+ {
+ const ushort hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
+ const char *c = reinterpret_cast<const char *>(&val);
+ for (uint i = 0; i < sizeof(T); ++i) {
+ *dest++ = hexChars[*c & 0xf];
+ *dest++ = hexChars[(*c & 0xf0) >> 4];
+ ++c;
+ }
+ }
+ const T val;
+};
+
+// specialization to enable fast concatenating of our string tokens to a string
+template <typename T>
+ struct QConcatenable<HexString<T> >
+{
+ typedef HexString<T> type;
+ enum { ExactSize = true };
+ static int size(const HexString<T> &str) { return sizeof(str.val) * 2; }
+ static inline void appendTo(const HexString<T> &str, QChar *&out) { str.write(out); }
+};
+
QT_END_NAMESPACE
#endif // QSTYLEHELPER_P_H