diff options
74 files changed, 655 insertions, 470 deletions
diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl index 0c0538c..a85f073 100755 --- a/bin/patch_capabilities.pl +++ b/bin/patch_capabilities.pl @@ -46,7 +46,13 @@ # ####################################################################### +# +# Note: Please make sure to output all changes done to the pkg file in a print statements +# starting with "Patching: " to ease integration into IDEs! +# + use File::Copy; +use File::Spec; sub Usage() { print("This script can be used to set capabilities of all binaries\n"); @@ -142,39 +148,56 @@ if (@ARGV) # Parse each line. while (<PKG>) { - # Patch pkg UID my $line = $_; my $newLine = $line; - if ($line =~ m/^\#.*\(0x[0-9|a-f|A-F]*\).*$/) + + # Patch pkg UID if it's in protected range + if ($line =~ m/^\#.*\((0x[0-7][0-9|a-f|A-F]*)\).*$/) { - $newLine =~ s/\(0x./\(0xE/; + my $oldUID = $1; + my $newUID = $oldUID; + $newUID =~ s/0x./0xE/i; + $newLine =~ s/$oldUID/$newUID/; + print ("Patching: UID $oldUID is not compatible with self-signing! Changed to: $newUID.\n"); } - # Patch embedded sis name and UID - if ($line =~ m/^@.*\.sis.*\(0x[0-9|a-f|A-F]*\).*$/) + # Patch embedded sis name and UID if UID is in protected range + if ($line =~ m/^@\"*(.*\.sis).*\((0x[0-7][0-9|a-f|A-F]*)\).*$/) { - $newLine =~ s/\(0x./\(0xE/; - if ($line !~ m/^.*_selfsigned.sis.*$/) + my $oldSisName = $1; + my $oldUID = $2; + my $newUID = $oldUID; + $newUID =~ s/0x./0xE/i; + $newLine =~ s/$oldUID/$newUID/; + print ("Patching: Embedded sis $oldSisName UID $oldUID changed to: $newUID.\n"); + + if ($oldSisName !~ m/^.*_selfsigned.sis$/i) { - $newLine =~ s/\.sis/_selfsigned\.sis/i; + my $newSisName = $oldSisName; + $newSisName =~ s/\.sis$/_selfsigned\.sis/i; + $newLine =~ s/$oldSisName/$newSisName/i; + print ("Patching: Embedded sis $oldSisName name changed to: $newSisName.\n"); } } - # Remove dependencies to known problem packages (i.e. packages that are likely to be patched, also) + # Remove dependencies to known problem packages (i.e. packages that are likely to be patched, too) # to reduce unnecessary error messages. - if ($line =~ m/^\(0x2002af5f\).*\{.*\}$/) + if ($line =~ m/^\((0x2002af5f)\).*\{.*\}$/) { - $newLine = "\n" + $newLine = "\n"; + print ("Patching: Removed dependency to sqlite3.sis ($1) to avoid installation issues in case sqlite3.sis is also patched.\n"); } - if ($line =~ m/^\(0x2001E61C\).*\{.*\}$/) + if ($line =~ m/^\((0x2001E61C)\).*\{.*\}$/) { - $newLine = "\n" + $newLine = "\n"; + print ("Patching: Removed dependency to qt.sis ($1) to avoid installation issues in case qt.sis is also patched.\n"); } # Remove manufacturer ifdef if ($line =~ m/^.*\(MANUFACTURER\)\=\(.*\).*$/) { $newLine = "\n"; + print ("Patching: Removed manufacturer check as it is usually not desirable in self-signed packages.\n"); } if ($line =~ m/^ELSEIF.*MANUFACTURER$/) @@ -240,7 +263,9 @@ if (@ARGV) foreach my $binaryPath(@binaries) { # Create the command line for setting the capabilities. + my ($binaryVolume, $binaryDirs, $binaryBaseName) = File::Spec->splitpath($binaryPath); my $commandToExecute = $baseCommandToExecute; + my $executeNeeded = 0; if (@capabilitiesSpecified) { $commandToExecute = sprintf($baseCommandToExecute, join(" ", @capabilitiesSpecified)); @@ -250,34 +275,54 @@ if (@ARGV) my $dllCaps; open($dllCaps, "elftran -dump s $binaryPath |") or die ("Could not execute elftran"); my $capsFound = 0; + my $originalVid; my @capabilitiesToSet; my $capabilitiesToAllow = join(" ", @capabilitiesToAllow); + my @capabilitiesToDrop; while (<$dllCaps>) { + if (/^Vendor ID: (.*)$/) { + $originalVid = "$1"; + } if (!$capsFound) { $capsFound = 1 if (/Capabilities:/); } else { $_ = trim($_); if ($capabilitiesToAllow =~ /$_/) { push(@capabilitiesToSet, $_); + } else { + push(@capabilitiesToDrop, $_); } } } close($dllCaps); + if ($originalVid !~ "00000000") { + print ("Patching: Vendor ID (0x$originalVid) incompatible with self-signed packages, setting it to zero for \"$binaryBaseName\".\n"); + $executeNeeded = 1; + } + if ($#capabilitiesToDrop) { + my $capsToDropStr = join("\", \"", @capabilitiesToDrop); + $capsToDropStr =~ s/\", \"$//; + + print ("Patching: The following capabilities used in \"$binaryBaseName\" are not compatible with a self-signed package and will be removed: \"$capsToDropStr\".\n"); + $executeNeeded = 1; + } $commandToExecute = sprintf($baseCommandToExecute, join(" ", @capabilitiesToSet)); } $commandToExecute .= $binaryPath; - # Actually execute the elftran command to set the capabilities. - print ("Executing ".$commandToExecute."\n"); - system ($commandToExecute." > $nullDevice"); - + if ($executeNeeded) { + # Actually execute the elftran command to set the capabilities. + print ("\n"); + system ("$commandToExecute > $nullDevice"); + } ## Create another command line to check that the set capabilities are correct. #$commandToExecute = "elftran -dump s ".$binaryPath; } print ("\n"); - print ("NOTE: A patched package may not work as expected due to reduced capabilities.\n"); - print (" Therefore it should not be used for any kind of Symbian signing or distribution!\n"); + print ("NOTE: A patched package may not work as expected due to reduced capabilities and other modifications,\n"); + print (" so it should not be used for any kind of Symbian signing or distribution!\n"); + print (" Use a proper certificate to avoid the need to patch the package.\n"); print ("\n"); } } @@ -686,7 +686,7 @@ CFG_AUDIO_BACKEND=auto CFG_SVG=auto CFG_DECLARATIVE=auto CFG_DECLARATIVE_DEBUG=yes -CFG_WEBKIT=auto # (yes|no|auto) +CFG_WEBKIT=auto # (yes|no|auto|debug) CFG_JAVASCRIPTCORE_JIT=auto CFG_GFX_AVAILABLE="linuxfb transformed qvfb vnc multiscreen directfb" @@ -939,13 +939,26 @@ while [ "$#" -gt 0 ]; do VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"` VAL=`echo $1 | sed "s,^-\([^-]*\).*,\1,"` ;; + #WebKit options + -webkit) + VAR="webkit" + VAL="yes" + ;; + -webkit-debug) + VAR="webkit" + VAL="debug" + ;; + -no-webkit) + VAR="webkit" + VAL="no" + ;; #Qt style no options -no-*) VAR=`echo $1 | sed "s,^-no-\(.*\),\1,"` VAL=no ;; #Qt style yes options - -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles) + -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; @@ -2010,15 +2023,8 @@ while [ "$#" -gt 0 ]; do fi ;; webkit) - if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then - CFG_WEBKIT="yes" - else - if [ "$VAL" = "no" ]; then - CFG_WEBKIT="no" - else - UNKNOWN_OPT=yes - fi - fi + [ "$VAL" = "auto" ] && VAL="yes" + CFG_WEBKIT="$VAL" ;; javascript-jit) if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ] || [ "$VAL" = "no" ]; then @@ -3535,10 +3541,10 @@ Usage: $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir [-no-multimedia] [-multimedia] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend] [-no-media-backend] [-media-backend] [-no-audio-backend] [-audio-backend] [-no-openssl] [-openssl] [-openssl-linked] - [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-no-javascript-jit] [-javascript-jit] + [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-webkit-debug] + [-no-javascript-jit] [-javascript-jit] [-no-script] [-script] [-no-scripttools] [-scripttools] [-no-declarative] [-declarative][-no-declarative-debug] [-declarative-debug] - [additional platform specific options (see below)] @@ -3690,6 +3696,7 @@ fi -no-webkit ......... Do not build the WebKit module. + -webkit ............ Build the WebKit module. WebKit is built if a decent C++ compiler is used. + -webkit-debug ...... Build the WebKit module with debug symbols. -no-javascript-jit . Do not build the JavaScriptCore JIT compiler. + -javascript-jit .... Build the JavaScriptCore JIT compiler. @@ -7191,14 +7198,15 @@ if [ "$CFG_WEBKIT" = "auto" ]; then CFG_WEBKIT="$canBuildWebKit" fi -if [ "$CFG_WEBKIT" = "yes" ]; then +if [ "$CFG_WEBKIT" != "no" ]; then # This include takes care of adding "webkit" to QT_CONFIG. cp -f "$relpath/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri" "$outpath/mkspecs/modules/qt_webkit_version.pri" # The reason we set CFG_WEBKIT, is such that the printed overview of what will be enabled, shows correctly. - CFG_WEBKIT="yes" + if [ "$CFG_WEBKIT" = "debug" ]; then + QMAKE_CONFIG="$QMAKE_CONFIG webkit-debug" + fi else rm -f "$outpath/mkspecs/modules/qt_webkit_version.pri" - CFG_WEBKIT="no" QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_WEBKIT" fi @@ -8130,7 +8138,7 @@ EOF *) ;; esac -if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" = "no" ] && [ "$CFG_WEBKIT" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then +if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" = "no" ] && [ "$CFG_WEBKIT" != "no" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then cat <<EOF WARNING: DWARF2 debug symbols are not enabled. Linking webkit in debug mode will run out of memory on systems with 2GB or less. @@ -8207,8 +8215,12 @@ echo "QtXmlPatterns module ... $CFG_XMLPATTERNS" echo "Phonon module .......... $CFG_PHONON" echo "Multimedia module ...... $CFG_MULTIMEDIA" echo "SVG module ............. $CFG_SVG" -echo "WebKit module .......... $CFG_WEBKIT" -if [ "$CFG_WEBKIT" = "yes" ]; then +case "$CFG_WEBKIT" in + yes) echo "WebKit module .......... yes" ;; + debug) echo "WebKit module .......... yes (debug)" ;; + no) echo "WebKit module .......... no" ;; +esac +if [ "$CFG_WEBKIT" != "no" ]; then if [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then echo "JavaScriptCore JIT ..... To be decided by JavaScriptCore" else diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc index 9929cfe..3f075bb 100644 --- a/doc/src/declarative/examples.qdoc +++ b/doc/src/declarative/examples.qdoc @@ -28,7 +28,7 @@ /*! \page qdeclarativeexamples.html \title QML Examples and Demos - \brief Building UI's with QML + \brief Building UIs with QML \ingroup all-examples diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index e8c85e6..a5f3446 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -273,7 +273,7 @@ \page examples-painting.html \ingroup all-examples \title Painting Examples - \brief How to use the Qt painting system + \brief How to use the Qt painting system. \image painting-examples.png @@ -303,7 +303,7 @@ \page examples-richtext.html \ingroup all-examples \title Rich Text Examples - \brief Using the document-oriented rich text engine + \brief Using the document-oriented rich text engine. \image richtext-examples.png @@ -324,7 +324,7 @@ \page examples-desktop.html \ingroup all-examples \title Desktop Examples - \brief Integrating your Qt application with your favorite desktop + \brief Integrating your Qt application with your favorite desktop. \image desktop-examples.png @@ -371,7 +371,7 @@ \page examples-threadandconcurrent.html \ingroup all-examples \title Threading and Concurrent Programming Examples - \brief Threading and concurrent programming in Qt + \brief Threading and concurrent programming in Qt. \image thread-examples.png @@ -409,7 +409,7 @@ \page examples.tools.html \ingroup all-examples \title Tools Examples - \brief Using Qt's containers, iterators, and other tool classes + \brief Using Qt's containers, iterators, and other tool classes. \image tool-examples.png @@ -445,7 +445,7 @@ \page examples-network.html \ingroup all-examples \title Network Examples - \brief How to do network programming in Qt + \brief How to do network programming in Qt. \image network-examples.png @@ -482,7 +482,7 @@ \page examples-ipc.html \ingroup all-examples \title IPC Examples - \brief Inter-Process Communication with Qt + \brief Inter-Process Communication with Qt. \image ipc-examples.png @@ -497,7 +497,7 @@ \page examples-opengl.html \ingroup all-examples \title OpenGL Examples - \brief Accessing OpenGL from Qt + \brief Accessing OpenGL from Qt. \image opengl-examples.png @@ -529,7 +529,7 @@ \page examples-openvg.html \ingroup all-examples \title OpenVG Examples - \brief Accessing OpenVG from Qt + \brief Accessing OpenVG from Qt. \image opengl-examples.png @@ -548,7 +548,7 @@ \page examples-multimedia.html \ingroup all-examples \title Multimedia Examples - \brief Audio, video, and Phonon with Qt + \brief Audio, video, and Phonon with Qt. \image phonon-examples.png @@ -595,7 +595,7 @@ \page examples-sql.html \ingroup all-examples \title SQL Examples - \brief Accessing your SQL database from Qt + \brief Accessing your SQL database from Qt. \image sql-examples.png @@ -623,7 +623,7 @@ \page examples-xml.html \ingroup all-examples \title XML Examples - \brief Using XML with Qt + \brief Using XML with Qt. \image xml-examples.png XML @@ -658,7 +658,7 @@ \page examples-designer.html \ingroup all-examples \title Qt Designer Examples - \brief Using Qt Designer to build your UI + \brief Using Qt Designer to build your UI. \image designer-examples.png QtDesigner @@ -681,7 +681,7 @@ \page examples-uitools.html \ingroup all-examples \title UiTools Examples - \brief Using the QtUiTools module + \brief Using the QtUiTools module. \image uitools-examples.png UiTools @@ -695,7 +695,7 @@ \page examples-linguist.html \ingroup all-examples \title Qt Linguist Examples - \brief Using Qt Linguist to internationalize your Qt application + \brief Using Qt Linguist to internationalize your Qt application. \image linguist-examples.png @@ -713,7 +713,7 @@ \page examples-script.html \ingroup all-examples \title Qt Script Examples - \brief Using the Qt scripting environment + \brief Using the Qt scripting environment. \image qtscript-examples.png QtScript @@ -740,7 +740,7 @@ \page examples-webkit.html \ingroup all-examples \title WebKit Examples - \brief Using WebKit in your Qt application + \brief Using WebKit in your Qt application. \image webkit-examples.png WebKit @@ -779,7 +779,7 @@ \page examples-helpsystem.html \ingroup all-examples \title Help System Examples - \brief Adding interactive help to your Qt application + \brief Adding interactive help to your Qt application. \image assistant-examples.png HelpSystem @@ -800,7 +800,7 @@ \page examples-statemachine.html \ingroup all-examples \title State Machine Examples - \brief Using Qt's finite state machine classes + \brief Using Qt's finite state machine classes. \image statemachine-examples.png StateMachine @@ -824,7 +824,7 @@ \page examples-animation.html \ingroup all-examples \title Animation Framework Examples - \brief Doing animations with Qt + \brief Doing animations with Qt. \image animation-examples.png Animation @@ -844,7 +844,7 @@ \page examples-touch.html \ingroup all-examples \title Touch Input Examples - \brief Using Qt's touch input capability + \brief Using Qt's touch input capability. Support for touch input makes it possible for developers to create extensible and intuitive user interfaces. @@ -861,7 +861,7 @@ \page examples-gestures.html \ingroup all-examples \title Gestures Examples - \brief Gesture programming examples + \brief Gesture programming examples. The API of the gesture framework is not yet finalized and still subject to change. @@ -875,7 +875,7 @@ \page examples-dbus.html \ingroup all-examples \title D-Bus Examples - \brief Using D-Bus from Qt applications + \brief Using D-Bus from Qt applications. \list \o \l{dbus/dbus-chat}{Chat} @@ -892,7 +892,7 @@ \page examples-embeddedlinux.html \ingroup all-examples \title Qt for Embedded Linux Examples - \brief Using Qt in Embedded Linux + \brief Using Qt in Embedded Linux. \image qt-embedded-examples.png QtEmbedded @@ -912,7 +912,7 @@ \page examples-activeqt.html \ingroup all-examples \title ActiveQt Examples - \brief Using ActiveX from Qt applications + \brief Using ActiveX from Qt applications. \image activeqt-examples.png ActiveQt diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp index bc2324e..451cc67 100644 --- a/examples/multimedia/audiooutput/audiooutput.cpp +++ b/examples/multimedia/audiooutput/audiooutput.cpp @@ -132,9 +132,9 @@ void Generator::generateData(const QAudioFormat &format, qint64 durationUs, int qint64 Generator::readData(char *data, qint64 len) { qint64 total = 0; - while (len - total) { + while (len - total > 0) { const qint64 chunk = qMin((m_buffer.size() - m_pos), len - total); - memcpy(data, m_buffer.constData() + m_pos, chunk); + memcpy(data + total, m_buffer.constData() + m_pos, chunk); m_pos = (m_pos + chunk) % m_buffer.size(); total += chunk; } diff --git a/mkspecs/common/g++.conf b/mkspecs/common/g++.conf index d3db24a..0d511fc 100644 --- a/mkspecs/common/g++.conf +++ b/mkspecs/common/g++.conf @@ -8,6 +8,7 @@ QMAKE_CFLAGS_DEPS += -M QMAKE_CFLAGS_WARN_ON += -Wall -W QMAKE_CFLAGS_WARN_OFF += -w QMAKE_CFLAGS_RELEASE += -O2 +QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g QMAKE_CFLAGS_DEBUG += -g QMAKE_CFLAGS_SHLIB += -fPIC QMAKE_CFLAGS_STATIC_LIB += -fPIC @@ -22,6 +23,7 @@ QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE +QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB diff --git a/mkspecs/common/mac-g++.conf b/mkspecs/common/mac-g++.conf index 446547d..29b7408 100644 --- a/mkspecs/common/mac-g++.conf +++ b/mkspecs/common/mac-g++.conf @@ -10,6 +10,7 @@ QMAKE_CFLAGS_DEPS += -M QMAKE_CFLAGS_WARN_ON += -Wall -W QMAKE_CFLAGS_WARN_OFF += -w QMAKE_CFLAGS_RELEASE += -O2 +QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g -gdwarf-2 QMAKE_CFLAGS_DEBUG += -g QMAKE_CFLAGS_SHLIB += -fPIC QMAKE_CFLAGS_STATIC_LIB += -fPIC @@ -33,6 +34,7 @@ QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE +QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB @@ -52,6 +54,7 @@ QMAKE_LINK_C = $$QMAKE_CC QMAKE_LINK_C_SHLIB = $$QMAKE_CC QMAKE_LFLAGS += -headerpad_max_install_names QMAKE_LFLAGS_RELEASE += +QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += -g -gdwarf-2 QMAKE_LFLAGS_DEBUG += QMAKE_LFLAGS_APP += QMAKE_LFLAGS_SHLIB += -single_module -dynamiclib diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf index d844385..59a5e86 100644 --- a/mkspecs/features/default_post.prf +++ b/mkspecs/features/default_post.prf @@ -1,3 +1,15 @@ +QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH) +!isEmpty(QT_BREAKPAD_ROOT_PATH): \ # quick test first whether requested ... + !staticlib:!static:CONFIG(release, debug|release):contains(TEMPLATE, .*(app|lib)): \ # is it applicable? + !contains(TARGET, .*phony_target.*): \ # monster hack, you don't really see this here, right? ;) + system($$QT_BREAKPAD_ROOT_PATH/qtbreakpadsymbols --breakpad-exists) { # do we really have it? + CONFIG += breakpad + CONFIG -= no_debug_info separate_debug_info + QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO + QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO + QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO +} + CONFIG(debug, debug|release):load(debug) else:load(release) debug_and_release:load(debug_and_release) @@ -6,6 +18,82 @@ incredibuild_xge { CONFIG = incredibuild_xge $$CONFIG } +breakpad { + !contains(DESTDIR, (/|.:[/\\\\]).*):TARGET_BASEPATH = $${OUT_PWD}/ + !isEmpty(DESTDIR):TARGET_BASEPATH = $${TARGET_BASEPATH}$${DESTDIR}/ + + win32 { + TARGET_BASEPATH ~= s,/,\\, + contains(TEMPLATE, .*lib) { + isEmpty(TARGET_VERSION_EXT):!isEmpty(VERSION) { + TARGET_VERSION_EXT = $$section(VERSION, ., 0, 0) + isEqual(TARGET_VERSION_EXT, 0):unset(TARGET_VERSION_EXT) + } + TARGET_EXT = .dll + } else { + TARGET_EXT = .exe + } + + DEBUGFILENAME = $${TARGET_BASEPATH}$${TARGET}$${TARGET_VERSION_EXT}$${TARGET_EXT} + PDBFILENAME = $${TARGET_BASEPATH}$${TARGET}$${TARGET_VERSION_EXT}.pdb + DEBUGFILENAME ~= s,/,\\, + PDBFILENAME ~= s,/,\\, + QMAKE_CLEAN += $$PDBFILENAME # for the debug case it is hardcoded in qmake + } else { + contains(TEMPLATE, .*lib):LIBPREFIX = lib + + macx { + equals(TEMPLATE, lib) { + lib_bundle { + TARGET_FILENAME = $${TARGET_BASEPATH}$${TARGET}.framework/$${TARGET} + } else { + TARGET_FILENAME = $${TARGET_BASEPATH}$${LIBPREFIX}$${TARGET} + !plugin { + TEMP_VERSION = $$section(VERSION, ., 0, 0) + isEmpty(TEMP_VERSION):TEMP_VERSION = 1 + TARGET_FILENAME = $${TARGET_FILENAME}.$${TEMP_VERSION} + } + TARGET_FILENAME = $${TARGET_FILENAME}.$${QMAKE_EXTENSION_SHLIB} + } + } else { + app_bundle { + TARGET_FILENAME = $${TARGET_BASEPATH}$${TARGET}.app/Contents/MacOS/$${TARGET} + } else { + TARGET_FILENAME = $${TARGET_BASEPATH}$${TARGET} + } + } + DEBUGFILENAME = $$TARGET_FILENAME + } else { + equals(TEMPLATE, lib) { + plugin { + TARGET_FILENAME = $${TARGET_BASEPATH}$${LIBPREFIX}$${TARGET}.so + } else { + TEMP_VERSION = $$VERSION + isEmpty(TEMP_VERSION):TEMP_VERSION = 1.0.0 + TARGET_FILENAME = $${TARGET_BASEPATH}$${LIBPREFIX}$${TARGET}.so.$${TEMP_VERSION} + } + } else { + TARGET_BASEPATH = $${TARGET_BASEPATH}$${TARGET} + } + DEBUGFILENAME = $$TARGET_BASEPATH + } + } + + PROJECTPATH = $$OUT_PWD + win32:PROJECTPATH ~= s,/,\\, + + !isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t) + QMAKE_POST_LINK += $$quote($${QT_BREAKPAD_ROOT_PATH}$${DIR_SEPARATOR}qtbreakpadsymbols \"$$DEBUGFILENAME\" \"$$PROJECTPATH\") + !isEmpty(QMAKE_STRIP):QMAKE_POST_LINK = $$quote($$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$QMAKE_STRIP \"$$DEBUGFILENAME\") + + unset(TARGET_BASEPATH) + unset(TARGET_FILENAME) + unset(SYMBOLFILENAME) + unset(TARGET_EXT) + unset(TARGET_VERSION_EXT) + unset(TEMP_VERSION) +} + QMAKE_INCDIR += $$QMAKE_INCDIR_POST QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf index abda78f..15e7fd9 100644 --- a/mkspecs/features/moc.prf +++ b/mkspecs/features/moc.prf @@ -45,10 +45,10 @@ defineReplace(mocCmd) { if(contains(TEMPLATE, "vc.*")|contains(TEMPLATE_PREFIX, "vc")) { RET += $$mocinclude.commands } - RET += $$QMAKE_MOC $(DEFINES) @$$WIN_INCLUDETEMP $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$1 -o $$2 + RET += $$QMAKE_MOC $(DEFINES) @$$WIN_INCLUDETEMP $$join(QMAKE_COMPILER_DEFINES, " -D", -D) \"$$1\" -o $$2 return($$RET) } - return($$QMAKE_MOC $(DEFINES) $(INCPATH) $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$1 -o $$2) + return($$QMAKE_MOC $(DEFINES) $(INCPATH) $$join(QMAKE_COMPILER_DEFINES, " -D", -D) \"$$1\" -o $$2) } #moc headers diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf index 3b26f7d..af56a9a 100644 --- a/mkspecs/linux-icc/qmake.conf +++ b/mkspecs/linux-icc/qmake.conf @@ -21,7 +21,7 @@ QMAKE_LEX = flex QMAKE_LEXFLAGS = QMAKE_YACC = yacc QMAKE_YACCFLAGS = -d -QMAKE_CFLAGS = +QMAKE_CFLAGS = -falign-stack=maintain-16-byte QMAKE_CFLAGS_DEPS = -M QMAKE_CFLAGS_WARN_ON = -w1 -Wcheck -wd654,1572,411,873,1125 QMAKE_CFLAGS_WARN_OFF = -w diff --git a/mkspecs/win32-msvc2003/qmake.conf b/mkspecs/win32-msvc2003/qmake.conf index 0230b30..63d1ffd 100644 --- a/mkspecs/win32-msvc2003/qmake.conf +++ b/mkspecs/win32-msvc2003/qmake.conf @@ -20,6 +20,7 @@ QMAKE_CFLAGS = -nologo -Zm300 QMAKE_CFLAGS_WARN_ON = -W3 QMAKE_CFLAGS_WARN_OFF = -W0 QMAKE_CFLAGS_RELEASE = -O2 -MD +QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi QMAKE_CFLAGS_DEBUG = -Zi -MDd QMAKE_CFLAGS_YACC = @@ -28,6 +29,7 @@ QMAKE_CXXFLAGS = $$QMAKE_CFLAGS QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189 QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE +QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_STL_ON = -EHsc @@ -51,6 +53,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link QMAKE_LFLAGS = /NOLOGO QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO +QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /INCREMENTAL:NO /DEBUG QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS diff --git a/mkspecs/win32-msvc2005/qmake.conf b/mkspecs/win32-msvc2005/qmake.conf index 0406fd0..265d028 100644 --- a/mkspecs/win32-msvc2005/qmake.conf +++ b/mkspecs/win32-msvc2005/qmake.conf @@ -20,6 +20,7 @@ QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t- QMAKE_CFLAGS_WARN_ON = -W3 QMAKE_CFLAGS_WARN_OFF = -W0 QMAKE_CFLAGS_RELEASE = -O2 -MD +QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi QMAKE_CFLAGS_DEBUG = -Zi -MDd QMAKE_CFLAGS_YACC = QMAKE_CFLAGS_LTCG = -GL @@ -29,6 +30,7 @@ QMAKE_CXXFLAGS = $$QMAKE_CFLAGS QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189 QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE +QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG @@ -53,6 +55,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link QMAKE_LFLAGS = /NOLOGO QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO +QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /INCREMENTAL:NO /DEBUG QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" diff --git a/mkspecs/win32-msvc2008/qmake.conf b/mkspecs/win32-msvc2008/qmake.conf index 9a69aaa..1432645 100644 --- a/mkspecs/win32-msvc2008/qmake.conf +++ b/mkspecs/win32-msvc2008/qmake.conf @@ -20,6 +20,7 @@ QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t- QMAKE_CFLAGS_WARN_ON = -W3 QMAKE_CFLAGS_WARN_OFF = -W0 QMAKE_CFLAGS_RELEASE = -O2 -MD +QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi QMAKE_CFLAGS_DEBUG = -Zi -MDd QMAKE_CFLAGS_YACC = QMAKE_CFLAGS_LTCG = -GL @@ -30,6 +31,7 @@ QMAKE_CXXFLAGS = $$QMAKE_CFLAGS QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189 QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE +QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG @@ -55,6 +57,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link QMAKE_LFLAGS = /NOLOGO QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO +QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /INCREMENTAL:NO /DEBUG QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" diff --git a/mkspecs/win32-msvc2010/qmake.conf b/mkspecs/win32-msvc2010/qmake.conf index 8331c14..84086e2 100644 --- a/mkspecs/win32-msvc2010/qmake.conf +++ b/mkspecs/win32-msvc2010/qmake.conf @@ -20,6 +20,7 @@ QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t- QMAKE_CFLAGS_WARN_ON = -W3 QMAKE_CFLAGS_WARN_OFF = -W0 QMAKE_CFLAGS_RELEASE = -O2 -MD +QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi QMAKE_CFLAGS_DEBUG = -Zi -MDd QMAKE_CFLAGS_YACC = QMAKE_CFLAGS_LTCG = -GL @@ -30,6 +31,7 @@ QMAKE_CXXFLAGS = $$QMAKE_CFLAGS QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189 QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE +QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG @@ -55,6 +57,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link QMAKE_LFLAGS = /NOLOGO QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO +QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /INCREMENTAL:NO /DEBUG QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" diff --git a/src/3rdparty/libjpeg.pri b/src/3rdparty/libjpeg.pri index 4551d7b..63f2aca 100644 --- a/src/3rdparty/libjpeg.pri +++ b/src/3rdparty/libjpeg.pri @@ -1,3 +1,18 @@ +wince*: { + DEFINES += NO_GETENV + contains(CE_ARCH,x86):CONFIG -= stl exceptions + contains(CE_ARCH,x86):CONFIG += exceptions_off +} + +#Disable warnings in 3rdparty code due to unused arguments +symbian: { + QMAKE_CXXFLAGS.CW += -W nounusedarg + TARGET.UID3=0x2001E61B +} else:contains(QMAKE_CC, gcc): { + QMAKE_CFLAGS_WARN_ON += -Wno-unused-parameter -Wno-main +} + + INCLUDEPATH += $$PWD/libjpeg SOURCES += \ $$PWD/libjpeg/jaricom.c \ diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index 5f688f3..981dba2 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -104,7 +104,7 @@ freebsd-*: DEFINES += HAVE_PTHREAD_NP_H DEFINES += BUILD_WEBKIT # Remove whole program optimizations due to miscompilations -win32-msvc2005|win32-msvc2008:{ +win32-msvc2005|win32-msvc2008|wince*:{ QMAKE_CFLAGS_RELEASE -= -GL QMAKE_CXXFLAGS_RELEASE -= -GL } @@ -2952,7 +2952,7 @@ HEADERS += $$WEBKIT_API_HEADERS } } -CONFIG(QTDIR_build) { +!CONFIG(webkit-debug):CONFIG(QTDIR_build) { # Remove the following 2 lines if you want debug information in WebCore CONFIG -= separate_debug_info CONFIG += no_debug_info diff --git a/src/3rdparty/webkit/WebKit.pri b/src/3rdparty/webkit/WebKit.pri index a080c43..bb3fd71 100644 --- a/src/3rdparty/webkit/WebKit.pri +++ b/src/3rdparty/webkit/WebKit.pri @@ -79,5 +79,5 @@ contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools # Disable a few warnings on Windows. The warnings are also # disabled in WebKitLibraries/win/tools/vsprops/common.vsprops -win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996 +win32-msvc*|wince*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996 diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 8f27b03..d04133b 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -44,11 +44,11 @@ #include <stddef.h> -#define QT_VERSION_STR "4.7.0" +#define QT_VERSION_STR "4.7.1" /* QT_VERSION is (major << 16) + (minor << 8) + patch. */ -#define QT_VERSION 0x040700 +#define QT_VERSION 0x040701 /* can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0)) */ @@ -1050,7 +1050,7 @@ redefine to built-in booleans to make autotests work properly */ #if defined(__i386__) || defined(_WIN32) || defined(_WIN32_WCE) # if defined(Q_CC_GNU) -#if !defined(Q_CC_INTEL) && ((100*(__GNUC__ - 0) + 10*(__GNUC_MINOR__ - 0) + __GNUC_PATCHLEVEL__) >= 332) +#if ((100*(__GNUC__ - 0) + 10*(__GNUC_MINOR__ - 0) + __GNUC_PATCHLEVEL__) >= 332) # define QT_FASTCALL __attribute__((regparm(3))) #else # define QT_FASTCALL diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index d1fab2d..6a3037d 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -176,7 +176,6 @@ */ #include "qplatformdefs.h" #include "qurl.h" -#include "private/qunicodetables_p.h" #include "qatomic.h" #include "qbytearray.h" #include "qdir.h" diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 033da90..b0c784e 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -46,7 +46,6 @@ #include "qlist.h" #include "qlocale.h" #include "qlocale_p.h" -#include "qunicodetables_p.h" #include "qscopedpointer.h" #include <qdatastream.h> diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index ed0af4e..bb777cd 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -1630,21 +1630,4 @@ static void canonicalOrderHelper(QString *str, QChar::UnicodeVersion version, in } } -int QT_FASTCALL QUnicodeTables::script(unsigned int uc) -{ - if (uc > 0xffff) - return Common; - int script = uc_scripts[uc >> 7]; - if (script < ScriptSentinel) - return script; - script = (((script - ScriptSentinel) * UnicodeBlockSize) + UnicodeBlockCount); - script = uc_scripts[script + (uc & 0x7f)]; - return script; -} - -Q_CORE_EXPORT QUnicodeTables::LineBreakClass QT_FASTCALL QUnicodeTables::lineBreakClass(uint ucs4) -{ - return (QUnicodeTables::LineBreakClass) qGetProp(ucs4)->line_break_class; -} - QT_END_NAMESPACE diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 3521b31..5be885b 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -6941,6 +6941,27 @@ QString QString::multiArg(int numArgs, const QString **args) const return result; } +static bool isStringRightToLeft(const ushort *p, const ushort *end) +{ + bool righttoleft = false; + while (p < end) { + switch(QChar::direction(*p)) + { + case QChar::DirL: + goto end; + case QChar::DirR: + case QChar::DirAL: + righttoleft = true; + goto end; + default: + break; + } + ++p; + } + end: + return righttoleft; +} + /*! \internal */ void QString::updateProperties() const @@ -6957,31 +6978,13 @@ void QString::updateProperties() const p++; } - d->righttoleft = isRightToLeft(); + d->righttoleft = isStringRightToLeft(d->data, d->data + d->size); d->clean = true; } bool QString::isRightToLeft() const { - ushort *p = d->data; - const ushort * const end = p + d->size; - bool righttoleft = false; - while (p < end) { - switch(QChar::direction(*p)) - { - case QChar::DirL: - goto end; - case QChar::DirR: - case QChar::DirAL: - righttoleft = true; - goto end; - default: - break; - } - ++p; - } - end: - return righttoleft; + return isStringRightToLeft(d->data, d->data + d->size); } /*! \fn bool QString::isSimpleText() const diff --git a/src/corelib/tools/qstringmatcher.cpp b/src/corelib/tools/qstringmatcher.cpp index 80a8457..d445ed4 100644 --- a/src/corelib/tools/qstringmatcher.cpp +++ b/src/corelib/tools/qstringmatcher.cpp @@ -40,7 +40,6 @@ ****************************************************************************/ #include "qstringmatcher.h" -#include "qunicodetables_p.h" QT_BEGIN_NAMESPACE diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp index 9df31e5..68e72cc 100644 --- a/src/corelib/tools/qunicodetables.cpp +++ b/src/corelib/tools/qunicodetables.cpp @@ -4345,6 +4345,11 @@ Q_CORE_EXPORT const QUnicodeTables::Properties * QT_FASTCALL QUnicodeTables::pro return uc_properties + index; } +Q_CORE_EXPORT QUnicodeTables::LineBreakClass QT_FASTCALL QUnicodeTables::lineBreakClass(uint ucs4) +{ + return (QUnicodeTables::LineBreakClass)qGetProp(ucs4)->line_break_class; +} + static const ushort specialCaseMap[] = { 0x53, 0x73, 0x0, 0x53, 0x53, 0x0, @@ -8561,7 +8566,7 @@ static const unsigned char uc_scripts[] = { Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Common, Common, Common, Common, Greek, Greek, Common, Common, - Common, Common, Greek, Greek, Greek, Greek, Common, Common, + Common, Common, Greek, Greek, Greek, Greek, Common, Common, /* U+0380-03ff at offset 640 */ Common, Common, Common, Common, Greek, Greek, Greek, Common, @@ -8579,7 +8584,7 @@ static const unsigned char uc_scripts[] = { Greek, Greek, Coptic, Coptic, Coptic, Coptic, Coptic, Coptic, Coptic, Coptic, Coptic, Coptic, Coptic, Coptic, Coptic, Coptic, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, - Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, + Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, /* U+0480-04ff at offset 768 */ Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Common, @@ -8597,7 +8602,7 @@ static const unsigned char uc_scripts[] = { Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, - Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, + Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, /* U+0500-057f at offset 896 */ Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, Cyrillic, @@ -8615,7 +8620,7 @@ static const unsigned char uc_scripts[] = { Common, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, - Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, + Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, /* U+0580-05ff at offset 1024 */ Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, Armenian, @@ -8633,7 +8638,7 @@ static const unsigned char uc_scripts[] = { Hebrew, Hebrew, Hebrew, Hebrew, Hebrew, Hebrew, Hebrew, Hebrew, Hebrew, Hebrew, Hebrew, Common, Common, Common, Common, Common, Hebrew, Hebrew, Hebrew, Hebrew, Hebrew, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+0600-067f at offset 1152 */ Common, Common, Common, Common, Common, Common, Common, Common, @@ -8651,7 +8656,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Inherited, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, - Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, + Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, /* U+0680-06ff at offset 1280 */ Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, @@ -8669,7 +8674,7 @@ static const unsigned char uc_scripts[] = { Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, - Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, + Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, /* U+0700-077f at offset 1408 */ Syriac, Syriac, Syriac, Syriac, Syriac, Syriac, Syriac, Syriac, @@ -8687,7 +8692,7 @@ static const unsigned char uc_scripts[] = { Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+0780-07ff at offset 1536 */ Thaana, Thaana, Thaana, Thaana, Thaana, Thaana, Thaana, Thaana, @@ -8705,7 +8710,7 @@ static const unsigned char uc_scripts[] = { Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, Nko, - Nko, Nko, Nko, Common, Common, Common, Common, Common, + Nko, Nko, Nko, Common, Common, Common, Common, Common, /* U+0900-097f at offset 1664 */ Common, Devanagari, Devanagari, Devanagari, Devanagari, Devanagari, Devanagari, Devanagari, @@ -8723,7 +8728,7 @@ static const unsigned char uc_scripts[] = { Devanagari, Devanagari, Devanagari, Devanagari, Common, Common, Devanagari, Devanagari, Devanagari, Devanagari, Devanagari, Devanagari, Devanagari, Devanagari, Devanagari, Devanagari, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Devanagari, Devanagari, Devanagari, Devanagari, Devanagari, + Common, Common, Common, Devanagari, Devanagari, Devanagari, Devanagari, Devanagari, /* U+0980-09ff at offset 1792 */ Common, Bengali, Bengali, Bengali, Common, Bengali, Bengali, Bengali, @@ -8741,7 +8746,7 @@ static const unsigned char uc_scripts[] = { Bengali, Bengali, Bengali, Bengali, Common, Common, Bengali, Bengali, Bengali, Bengali, Bengali, Bengali, Bengali, Bengali, Bengali, Bengali, Bengali, Bengali, Bengali, Bengali, Bengali, Bengali, Bengali, Bengali, - Bengali, Bengali, Bengali, Common, Common, Common, Common, Common, + Bengali, Bengali, Bengali, Common, Common, Common, Common, Common, /* U+0a00-0a7f at offset 1920 */ Common, Gurmukhi, Gurmukhi, Gurmukhi, Common, Gurmukhi, Gurmukhi, Gurmukhi, @@ -8759,7 +8764,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Gurmukhi, Gurmukhi, Gurmukhi, Gurmukhi, Gurmukhi, Gurmukhi, Gurmukhi, Gurmukhi, Gurmukhi, Gurmukhi, Gurmukhi, Gurmukhi, Gurmukhi, Gurmukhi, Gurmukhi, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+0a80-0aff at offset 2048 */ Common, Gujarati, Gujarati, Gujarati, Common, Gujarati, Gujarati, Gujarati, @@ -8777,7 +8782,7 @@ static const unsigned char uc_scripts[] = { Gujarati, Gujarati, Gujarati, Gujarati, Common, Common, Gujarati, Gujarati, Gujarati, Gujarati, Gujarati, Gujarati, Gujarati, Gujarati, Gujarati, Gujarati, Common, Gujarati, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+0b00-0b7f at offset 2176 */ Common, Oriya, Oriya, Oriya, Common, Oriya, Oriya, Oriya, @@ -8795,7 +8800,7 @@ static const unsigned char uc_scripts[] = { Oriya, Oriya, Common, Common, Common, Common, Oriya, Oriya, Oriya, Oriya, Oriya, Oriya, Oriya, Oriya, Oriya, Oriya, Oriya, Oriya, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+0b80-0bff at offset 2304 */ Common, Common, Tamil, Tamil, Common, Tamil, Tamil, Tamil, @@ -8813,7 +8818,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Tamil, Tamil, Tamil, Tamil, Tamil, Tamil, Tamil, Tamil, Tamil, Tamil, Tamil, Tamil, Tamil, Tamil, Tamil, Tamil, Tamil, Tamil, - Tamil, Tamil, Tamil, Common, Common, Common, Common, Common, + Tamil, Tamil, Tamil, Common, Common, Common, Common, Common, /* U+0c00-0c7f at offset 2432 */ Common, Telugu, Telugu, Telugu, Common, Telugu, Telugu, Telugu, @@ -8831,7 +8836,7 @@ static const unsigned char uc_scripts[] = { Telugu, Telugu, Common, Common, Common, Common, Telugu, Telugu, Telugu, Telugu, Telugu, Telugu, Telugu, Telugu, Telugu, Telugu, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+0c80-0cff at offset 2560 */ Common, Common, Kannada, Kannada, Common, Kannada, Kannada, Kannada, @@ -8849,7 +8854,7 @@ static const unsigned char uc_scripts[] = { Kannada, Kannada, Kannada, Kannada, Common, Common, Kannada, Kannada, Kannada, Kannada, Kannada, Kannada, Kannada, Kannada, Kannada, Kannada, Common, Kannada, Kannada, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+0d00-0d7f at offset 2688 */ Common, Common, Malayalam, Malayalam, Common, Malayalam, Malayalam, Malayalam, @@ -8867,7 +8872,7 @@ static const unsigned char uc_scripts[] = { Malayalam, Malayalam, Common, Common, Common, Common, Malayalam, Malayalam, Malayalam, Malayalam, Malayalam, Malayalam, Malayalam, Malayalam, Malayalam, Malayalam, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+0d80-0dff at offset 2816 */ Common, Common, Sinhala, Sinhala, Common, Sinhala, Sinhala, Sinhala, @@ -8885,7 +8890,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Sinhala, Sinhala, Sinhala, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+0e00-0e7f at offset 2944 */ Common, Thai, Thai, Thai, Thai, Thai, Thai, Thai, @@ -8903,7 +8908,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+0e80-0eff at offset 3072 */ Common, Lao, Lao, Common, Lao, Common, Common, Lao, @@ -8921,7 +8926,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+0f00-0f7f at offset 3200 */ Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, @@ -8939,7 +8944,7 @@ static const unsigned char uc_scripts[] = { Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Common, Common, Common, Common, Common, Common, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, - Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, + Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, /* U+0f80-0fff at offset 3328 */ Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, Tibetan, @@ -8957,7 +8962,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+1000-107f at offset 3456 */ Myanmar, Myanmar, Myanmar, Myanmar, Myanmar, Myanmar, Myanmar, Myanmar, @@ -8975,7 +8980,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+1080-10ff at offset 3584 */ Common, Common, Common, Common, Common, Common, Common, Common, @@ -8993,7 +8998,7 @@ static const unsigned char uc_scripts[] = { Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, - Georgian, Georgian, Georgian, Common, Georgian, Common, Common, Common, + Georgian, Georgian, Georgian, Common, Georgian, Common, Common, Common, /* U+1100-117f at offset 3712 */ Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, @@ -9011,7 +9016,7 @@ static const unsigned char uc_scripts[] = { Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, - Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, + Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, /* U+1180-11ff at offset 3840 */ Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, @@ -9029,7 +9034,7 @@ static const unsigned char uc_scripts[] = { Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, - Hangul, Hangul, Common, Common, Common, Common, Common, Common, + Hangul, Hangul, Common, Common, Common, Common, Common, Common, /* U+1680-16ff at offset 3968 */ Ogham, Ogham, Ogham, Ogham, Ogham, Ogham, Ogham, Ogham, @@ -9047,7 +9052,7 @@ static const unsigned char uc_scripts[] = { Runic, Runic, Runic, Runic, Runic, Runic, Runic, Runic, Runic, Runic, Runic, Common, Common, Common, Runic, Runic, Runic, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+1780-17ff at offset 4096 */ Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, @@ -9065,7 +9070,7 @@ static const unsigned char uc_scripts[] = { Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Common, Common, Common, Common, Common, Common, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, - Khmer, Khmer, Common, Common, Common, Common, Common, Common, + Khmer, Khmer, Common, Common, Common, Common, Common, Common, /* U+1980-19ff at offset 4224 */ NewTaiLue, NewTaiLue, NewTaiLue, NewTaiLue, NewTaiLue, NewTaiLue, NewTaiLue, NewTaiLue, @@ -9083,7 +9088,7 @@ static const unsigned char uc_scripts[] = { Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, - Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, + Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, Khmer, /* U+1d00-1d7f at offset 4352 */ Latin, Latin, Latin, Latin, Latin, Latin, Latin, Latin, @@ -9101,7 +9106,7 @@ static const unsigned char uc_scripts[] = { Greek, Greek, Latin, Latin, Latin, Latin, Greek, Greek, Greek, Greek, Greek, Latin, Latin, Latin, Latin, Latin, Latin, Latin, Latin, Latin, Latin, Latin, Latin, Latin, - Cyrillic, Latin, Latin, Latin, Latin, Latin, Latin, Latin, + Cyrillic, Latin, Latin, Latin, Latin, Latin, Latin, Latin, /* U+1d80-1dff at offset 4480 */ Latin, Latin, Latin, Latin, Latin, Latin, Latin, Latin, @@ -9119,7 +9124,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Inherited, Inherited, + Common, Common, Common, Common, Common, Common, Inherited, Inherited, /* U+1f00-1f7f at offset 4608 */ Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, @@ -9137,7 +9142,7 @@ static const unsigned char uc_scripts[] = { Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, - Greek, Greek, Greek, Greek, Greek, Greek, Common, Common, + Greek, Greek, Greek, Greek, Greek, Greek, Common, Common, /* U+1f80-1fff at offset 4736 */ Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, @@ -9155,7 +9160,7 @@ static const unsigned char uc_scripts[] = { Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Greek, Common, Common, Greek, Greek, Greek, Common, Greek, Greek, - Greek, Greek, Greek, Greek, Greek, Greek, Greek, Common, + Greek, Greek, Greek, Greek, Greek, Greek, Greek, Common, /* U+2000-207f at offset 4864 */ Common, Common, Common, Common, Common, Common, Common, Common, @@ -9173,7 +9178,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Latin, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Latin, + Common, Common, Common, Common, Common, Common, Common, Latin, /* U+2080-20ff at offset 4992 */ Common, Common, Common, Common, Common, Common, Common, Common, @@ -9191,7 +9196,7 @@ static const unsigned char uc_scripts[] = { Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+2100-217f at offset 5120 */ Common, Common, Common, Common, Common, Common, Common, Common, @@ -9209,7 +9214,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+2d00-2d7f at offset 5248 */ Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, Georgian, @@ -9227,7 +9232,7 @@ static const unsigned char uc_scripts[] = { Tifinagh, Tifinagh, Tifinagh, Tifinagh, Tifinagh, Tifinagh, Common, Common, Common, Common, Common, Common, Common, Common, Common, Tifinagh, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+3000-307f at offset 5376 */ Common, Common, Common, Common, Common, Han, Common, Han, @@ -9245,7 +9250,7 @@ static const unsigned char uc_scripts[] = { Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, - Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, + Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, /* U+3080-30ff at offset 5504 */ Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, Hiragana, @@ -9263,7 +9268,7 @@ static const unsigned char uc_scripts[] = { Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, - Katakana, Katakana, Katakana, Common, Common, Katakana, Katakana, Katakana, + Katakana, Katakana, Katakana, Common, Common, Katakana, Katakana, Katakana, /* U+3100-317f at offset 5632 */ Common, Common, Common, Common, Common, Bopomofo, Bopomofo, Bopomofo, @@ -9281,7 +9286,7 @@ static const unsigned char uc_scripts[] = { Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, - Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, + Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, /* U+3180-31ff at offset 5760 */ Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, @@ -9299,7 +9304,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, - Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, + Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, /* U+3200-327f at offset 5888 */ Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, @@ -9317,7 +9322,7 @@ static const unsigned char uc_scripts[] = { Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, - Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Common, Common, + Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Common, Common, /* U+d780-d7ff at offset 6016 */ Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, Hangul, @@ -9335,7 +9340,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common, + Common, Common, Common, Common, Common, Common, Common, Common, /* U+fb00-fb7f at offset 6144 */ Latin, Latin, Latin, Latin, Latin, Latin, Latin, Common, @@ -9353,7 +9358,7 @@ static const unsigned char uc_scripts[] = { Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, - Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, + Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, /* U+fb80-fbff at offset 6272 */ Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, @@ -9371,7 +9376,7 @@ static const unsigned char uc_scripts[] = { Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, - Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, + Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, /* U+fd00-fd7f at offset 6400 */ Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, @@ -9389,7 +9394,7 @@ static const unsigned char uc_scripts[] = { Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, - Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, + Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, /* U+fd80-fdff at offset 6528 */ Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, @@ -9407,7 +9412,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, - Arabic, Arabic, Arabic, Arabic, Arabic, Common, Common, Common, + Arabic, Arabic, Arabic, Arabic, Arabic, Common, Common, Common, /* U+fe00-fe7f at offset 6656 */ Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, Inherited, @@ -9425,7 +9430,7 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Arabic, Arabic, Arabic, Arabic, Arabic, Common, Arabic, Arabic, - Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, + Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, /* U+fe80-feff at offset 6784 */ Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, @@ -9443,7 +9448,7 @@ static const unsigned char uc_scripts[] = { Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, Arabic, - Arabic, Arabic, Arabic, Arabic, Arabic, Common, Common, Common, + Arabic, Arabic, Arabic, Arabic, Arabic, Common, Common, Common, /* U+ff80-ffff at offset 6912 */ Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, Katakana, @@ -9461,9 +9466,21 @@ static const unsigned char uc_scripts[] = { Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, Common, - Common, Common, Common, Common, Common, Common, Common, Common + Common, Common, Common, Common, Common, Common, Common, Common }; } // namespace QUnicodeTables +Q_CORE_EXPORT int QT_FASTCALL QUnicodeTables::script(uint ucs4) +{ + if (ucs4 > 0xffff) + return Common; + int script = uc_scripts[ucs4 >> 7]; + if (script < ScriptSentinel) + return script; + script = (((script - ScriptSentinel) * UnicodeBlockSize) + UnicodeBlockCount); + script = uc_scripts[script + (ucs4 & 0x7f)]; + return script; +} + QT_END_NAMESPACE diff --git a/src/corelib/tools/qunicodetables_p.h b/src/corelib/tools/qunicodetables_p.h index 5c7cc08..be52bf9 100644 --- a/src/corelib/tools/qunicodetables_p.h +++ b/src/corelib/tools/qunicodetables_p.h @@ -162,20 +162,6 @@ namespace QUnicodeTables { enum { ScriptSentinel = 32 }; - // see http://www.unicode.org/reports/tr14/tr14-19.html - // we don't use the XX, AI and CB properties and map them to AL instead. - // as we don't support any EBDIC based OS'es, NL is ignored and mapped to AL as well. - enum LineBreakClass { - LineBreak_OP, LineBreak_CL, LineBreak_QU, LineBreak_GL, LineBreak_NS, - LineBreak_EX, LineBreak_SY, LineBreak_IS, LineBreak_PR, LineBreak_PO, - LineBreak_NU, LineBreak_AL, LineBreak_ID, LineBreak_IN, LineBreak_HY, - LineBreak_BA, LineBreak_BB, LineBreak_B2, LineBreak_ZW, LineBreak_CM, - LineBreak_WJ, LineBreak_H2, LineBreak_H3, LineBreak_JL, LineBreak_JV, - LineBreak_JT, LineBreak_SA, LineBreak_SG, - LineBreak_SP, LineBreak_CR, LineBreak_LF, LineBreak_BK - }; - - enum GraphemeBreak { GraphemeBreakOther, GraphemeBreakCR, @@ -217,6 +203,20 @@ namespace QUnicodeTables { }; + // see http://www.unicode.org/reports/tr14/tr14-19.html + // we don't use the XX, AI and CB properties and map them to AL instead. + // as we don't support any EBDIC based OS'es, NL is ignored and mapped to AL as well. + enum LineBreakClass { + LineBreak_OP, LineBreak_CL, LineBreak_QU, LineBreak_GL, LineBreak_NS, + LineBreak_EX, LineBreak_SY, LineBreak_IS, LineBreak_PR, LineBreak_PO, + LineBreak_NU, LineBreak_AL, LineBreak_ID, LineBreak_IN, LineBreak_HY, + LineBreak_BA, LineBreak_BB, LineBreak_B2, LineBreak_ZW, LineBreak_CM, + LineBreak_WJ, LineBreak_H2, LineBreak_H3, LineBreak_JL, LineBreak_JV, + LineBreak_JT, LineBreak_SA, LineBreak_SG, + LineBreak_SP, LineBreak_CR, LineBreak_LF, LineBreak_BK + }; + + Q_CORE_EXPORT QUnicodeTables::LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4); inline int lineBreakClass(const QChar &ch) { return lineBreakClass(ch.unicode()); } diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h index 81af2c7..1bd00da 100644 --- a/src/dbus/qdbusconnection_p.h +++ b/src/dbus/qdbusconnection_p.h @@ -160,6 +160,9 @@ public: struct WatchedServiceData { WatchedServiceData() : refcount(0) {} + WatchedServiceData(const QString &owner, int refcount = 0) + : owner(owner), refcount(refcount) + {} QString owner; int refcount; }; diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 3833874..31588e7 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -71,6 +71,17 @@ QT_BEGIN_NAMESPACE static bool isDebugging; #define qDBusDebug if (!::isDebugging); else qDebug +Q_GLOBAL_STATIC_WITH_ARGS(const QString, orgFreedesktopDBusString, (QLatin1String(DBUS_SERVICE_DBUS))) + +static inline QString dbusServiceString() +{ return *orgFreedesktopDBusString(); } +static inline QString dbusInterfaceString() +{ + // it's the same string, but just be sure + Q_ASSERT(*orgFreedesktopDBusString() == QLatin1String(DBUS_INTERFACE_DBUS)); + return *orgFreedesktopDBusString(); +} + static inline QDebug operator<<(QDebug dbg, const QThread *th) { dbg.nospace() << "QThread(ptr=" << (void*)th; @@ -962,6 +973,14 @@ QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p) QDBusMetaTypeId::init(); rootNode.flags = 0; + + // prepopulate watchedServices: + // we know that the owner of org.freedesktop.DBus is itself + watchedServices.insert(dbusServiceString(), WatchedServiceData(dbusServiceString(), 1)); + + // prepopulate matchRefCounts: + // we know that org.freedesktop.DBus will never change owners + matchRefCounts.insert("type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.freedesktop.DBus'", 1); } QDBusConnectionPrivate::~QDBusConnectionPrivate() @@ -1646,43 +1665,34 @@ void QDBusConnectionPrivate::setConnection(DBusConnection *dbc, const QDBusError connection = dbc; mode = ClientMode; + const char *service = q_dbus_bus_get_unique_name(connection); + Q_ASSERT(service); + baseService = QString::fromUtf8(service); + q_dbus_connection_set_exit_on_disconnect(connection, false); q_dbus_connection_set_watch_functions(connection, qDBusAddWatch, qDBusRemoveWatch, qDBusToggleWatch, this, 0); q_dbus_connection_set_timeout_functions(connection, qDBusAddTimeout, qDBusRemoveTimeout, qDBusToggleTimeout, this, 0); q_dbus_connection_set_dispatch_status_function(connection, qDBusUpdateDispatchStatus, this, 0); + q_dbus_connection_add_filter(connection, qDBusSignalFilter, this, 0); - // Initialize the match rules - // We want all messages that have us as destination - // signals don't have destinations, but connectSignal() takes care of them - const char *service = q_dbus_bus_get_unique_name(connection); - if (service) { - QVarLengthArray<char, 56> filter; - filter.append("destination='", 13); - filter.append(service, qstrlen(service)); - filter.append("\'\0", 2); - - QDBusErrorInternal error; - q_dbus_bus_add_match(connection, filter.constData(), error); - if (handleError(error)) { - closeConnection(); - return; - } - - baseService = QString::fromUtf8(service); - } else { - qWarning("QDBusConnectionPrivate::setConnection: Unable to get base service"); - } - - QString busService = QLatin1String(DBUS_SERVICE_DBUS); - connectSignal(busService, QString(), QString(), QLatin1String("NameAcquired"), QStringList(), QString(), - this, SLOT(registerService(QString))); - connectSignal(busService, QString(), QString(), QLatin1String("NameLost"), QStringList(), QString(), - this, SLOT(unregisterService(QString))); + // Initialize the hooks for the NameAcquired and NameLost signals + // we don't use connectSignal here because we don't need the rules to be sent to the bus + // the bus will always send us these two signals + SignalHook hook; + hook.service = dbusServiceString(); + hook.path.clear(); // no matching + hook.obj = this; + hook.params << QMetaType::Void << QVariant::String; // both functions take a QString as parameter and return void + hook.midx = staticMetaObject.indexOfSlot("registerService(QString)"); + Q_ASSERT(hook.midx != -1); + signalHooks.insert(QLatin1String("NameAcquired:" DBUS_INTERFACE_DBUS), hook); - q_dbus_connection_add_filter(connection, qDBusSignalFilter, this, 0); + hook.midx = staticMetaObject.indexOfSlot("unregisterService(QString)"); + Q_ASSERT(hook.midx != -1); + signalHooks.insert(QLatin1String("NameLost:" DBUS_INTERFACE_DBUS), hook); qDBusDebug() << this << ": connected successfully"; @@ -2069,8 +2079,7 @@ void QDBusConnectionPrivate::connectSignal(const QString &key, const SignalHook WatchedServicesHash::mapped_type &data = watchedServices[hook.service]; if (++data.refcount == 1) { // we need to watch for this service changing - QString dbusServerService = QLatin1String(DBUS_SERVICE_DBUS); - connectSignal(dbusServerService, QString(), QLatin1String(DBUS_INTERFACE_DBUS), + connectSignal(dbusServiceString(), QString(), dbusInterfaceString(), QLatin1String("NameOwnerChanged"), QStringList() << hook.service, QString(), this, SLOT(_q_serviceOwnerChanged(QString,QString,QString))); data.owner = getNameOwnerNoCache(hook.service); @@ -2149,8 +2158,7 @@ QDBusConnectionPrivate::disconnectSignal(SignalHookHash::Iterator &it) if (sit != watchedServices.end()) { if (--sit.value().refcount == 0) { watchedServices.erase(sit); - QString dbusServerService = QLatin1String(DBUS_SERVICE_DBUS); - disconnectSignal(dbusServerService, QString(), QLatin1String(DBUS_INTERFACE_DBUS), + disconnectSignal(dbusServiceString(), QString(), dbusInterfaceString(), QLatin1String("NameOwnerChanged"), QStringList() << hook.service, QString(), this, SLOT(_q_serviceOwnerChanged(QString,QString,QString))); } @@ -2272,8 +2280,8 @@ QString QDBusConnectionPrivate::getNameOwner(const QString& serviceName) QString QDBusConnectionPrivate::getNameOwnerNoCache(const QString &serviceName) { - QDBusMessage msg = QDBusMessage::createMethodCall(QLatin1String(DBUS_SERVICE_DBUS), - QLatin1String(DBUS_PATH_DBUS), QLatin1String(DBUS_INTERFACE_DBUS), + QDBusMessage msg = QDBusMessage::createMethodCall(dbusServiceString(), + QLatin1String(DBUS_PATH_DBUS), dbusInterfaceString(), QLatin1String("GetNameOwner")); QDBusMessagePrivate::setParametersValidated(msg, true); msg << serviceName; diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index cb74a3c..fc3c186 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -302,7 +302,6 @@ QT_BEGIN_INCLUDE_NAMESPACE #endif #include <qshortcut.h> #ifdef Q_WS_MAC -#include <private/qunicodetables_p.h> #include <qmacstyle_mac.h> #endif QT_END_INCLUDE_NAMESPACE diff --git a/src/gui/image/qjpeghandler.cpp b/src/gui/image/qjpeghandler.cpp index e685694..b9eda05 100644 --- a/src/gui/image/qjpeghandler.cpp +++ b/src/gui/image/qjpeghandler.cpp @@ -515,29 +515,10 @@ inline my_jpeg_destination_mgr::my_jpeg_destination_mgr(QIODevice *device) free_in_buffer = max_buf; } -static bool can_write_format(QImage::Format fmt) -{ - switch (fmt) { - case QImage::Format_Mono: - case QImage::Format_MonoLSB: - case QImage::Format_Indexed8: - case QImage::Format_RGB888: - case QImage::Format_RGB32: - case QImage::Format_ARGB32: - case QImage::Format_ARGB32_Premultiplied: - return true; - break; - default: - break; - } - return false; -} -static bool write_jpeg_image(const QImage &sourceImage, QIODevice *device, int sourceQuality) +static bool write_jpeg_image(const QImage &image, QIODevice *device, int sourceQuality) { bool success = false; - const QImage image = can_write_format(sourceImage.format()) ? - sourceImage : sourceImage.convertToFormat(QImage::Format_RGB888); const QVector<QRgb> cmap = image.colorTable(); struct jpeg_compress_struct cinfo; @@ -614,7 +595,7 @@ static bool write_jpeg_image(const QImage &sourceImage, QIODevice *device, int s case QImage::Format_Mono: case QImage::Format_MonoLSB: if (gray) { - const uchar* data = image.scanLine(cinfo.next_scanline); + const uchar* data = image.constScanLine(cinfo.next_scanline); if (image.format() == QImage::Format_MonoLSB) { for (int i=0; i<w; i++) { bool bit = !!(*(data + (i >> 3)) & (1 << (i & 7))); @@ -627,7 +608,7 @@ static bool write_jpeg_image(const QImage &sourceImage, QIODevice *device, int s } } } else { - const uchar* data = image.scanLine(cinfo.next_scanline); + const uchar* data = image.constScanLine(cinfo.next_scanline); if (image.format() == QImage::Format_MonoLSB) { for (int i=0; i<w; i++) { bool bit = !!(*(data + (i >> 3)) & (1 << (i & 7))); @@ -647,13 +628,13 @@ static bool write_jpeg_image(const QImage &sourceImage, QIODevice *device, int s break; case QImage::Format_Indexed8: if (gray) { - const uchar* pix = image.scanLine(cinfo.next_scanline); + const uchar* pix = image.constScanLine(cinfo.next_scanline); for (int i=0; i<w; i++) { *row = qRed(cmap[*pix]); ++row; ++pix; } } else { - const uchar* pix = image.scanLine(cinfo.next_scanline); + const uchar* pix = image.constScanLine(cinfo.next_scanline); for (int i=0; i<w; i++) { *row++ = qRed(cmap[*pix]); *row++ = qGreen(cmap[*pix]); @@ -663,12 +644,12 @@ static bool write_jpeg_image(const QImage &sourceImage, QIODevice *device, int s } break; case QImage::Format_RGB888: - memcpy(row, image.scanLine(cinfo.next_scanline), w * 3); + memcpy(row, image.constScanLine(cinfo.next_scanline), w * 3); break; case QImage::Format_RGB32: case QImage::Format_ARGB32: case QImage::Format_ARGB32_Premultiplied: { - QRgb* rgb = (QRgb*)image.scanLine(cinfo.next_scanline); + const QRgb* rgb = (const QRgb*)image.constScanLine(cinfo.next_scanline); for (int i=0; i<w; i++) { *row++ = qRed(*rgb); *row++ = qGreen(*rgb); @@ -678,8 +659,12 @@ static bool write_jpeg_image(const QImage &sourceImage, QIODevice *device, int s break; } default: - qWarning("QJpegHandler: unable to write image of format %i", - image.format()); + for (int i=0; i<w; i++) { + QRgb pix = image.pixel(i, cinfo.next_scanline); + *row++ = qRed(pix); + *row++ = qGreen(pix); + *row++ = qBlue(pix); + } break; } jpeg_write_scanlines(&cinfo, row_pointer, 1); diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index aa3a6d5..9c5095d 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -530,12 +530,12 @@ public: #ifndef QT_NO_GESTURES QGestureManager *gestureManager; QWidget *gestureWidget; +#endif #if defined(Q_WS_X11) || defined(Q_WS_WIN) QPixmap *move_cursor; QPixmap *copy_cursor; QPixmap *link_cursor; #endif -#endif #if defined(Q_WS_WIN) QPixmap *ignore_cursor; #endif diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index e7b7ed8..d8fb74c 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -74,7 +74,6 @@ #include "qevent_p.h" #include "qvarlengtharray.h" #include "qdebug.h" -#include <private/qunicodetables_p.h> #include <private/qcrashhandler_p.h> #include <private/qcolor_p.h> #include <private/qcursor_p.h> diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp index 2a9b31a..54c81ba 100644 --- a/src/gui/painting/qbezier.cpp +++ b/src/gui/painting/qbezier.cpp @@ -293,36 +293,6 @@ static ShiftResult good_offset(const QBezier *b1, const QBezier *b2, qreal offse return Ok; } -static inline QLineF qline_shifted(const QPointF &p1, const QPointF &p2, qreal offset) -{ - QLineF l(p1, p2); - QLineF ln = l.normalVector().unitVector(); - l.translate(ln.dx() * offset, ln.dy() * offset); - return l; -} - -static bool qbezier_is_line(QPointF *points, int pointCount) -{ - Q_ASSERT(pointCount > 2); - - qreal dx13 = points[2].x() - points[0].x(); - qreal dy13 = points[2].y() - points[0].y(); - - qreal dx12 = points[1].x() - points[0].x(); - qreal dy12 = points[1].y() - points[0].y(); - - if (pointCount == 3) { - return qFuzzyCompare(dx12 * dy13, dx13 * dy12); - } else if (pointCount == 4) { - qreal dx14 = points[3].x() - points[0].x(); - qreal dy14 = points[3].y() - points[0].y(); - - return (qFuzzyCompare(dx12 * dy13, dx13 * dy12) && qFuzzyCompare(dx12 * dy14, dx14 * dy12)); - } - - return false; -} - static ShiftResult shift(const QBezier *orig, QBezier *shifted, qreal offset, qreal threshold) { int map[4]; @@ -353,17 +323,6 @@ static ShiftResult shift(const QBezier *orig, QBezier *shifted, qreal offset, qr if (np == 1) return Discard; - // We need to specialcase lines of 3 or 4 points due to numerical - // instability in intersections below - if (np > 2 && qbezier_is_line(points, np)) { - if (points[0] == points[np-1]) - return Discard; - - QLineF l = qline_shifted(points[0], points[np-1], offset); - *shifted = QBezier::fromPoints(l.p1(), l.pointAt(qreal(0.33)), l.pointAt(qreal(0.66)), l.p2()); - return Ok; - } - QRectF b = orig->bounds(); if (np == 4 && b.width() < .1*offset && b.height() < .1*offset) { qreal l = (orig->x1 - orig->x2)*(orig->x1 - orig->x2) + diff --git a/src/gui/painting/qprintengine_ps.cpp b/src/gui/painting/qprintengine_ps.cpp index 28e9a7a..ca694ae 100644 --- a/src/gui/painting/qprintengine_ps.cpp +++ b/src/gui/painting/qprintengine_ps.cpp @@ -64,7 +64,6 @@ #include "qbitmap.h" #include "qregion.h" #include "qimagewriter.h" -#include <private/qunicodetables_p.h> #include <private/qpainterpath_p.h> #include <qdebug.h> #include <private/qdrawhelper_p.h> diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 631a9cf..b609f7b 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -47,10 +47,6 @@ #include "private/qnativeimage_p.h" #include "private/qfontengine_ft_p.h" -#ifndef QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH -#define QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH 256 -#endif - QT_BEGIN_NAMESPACE // #define CACHE_DEBUG @@ -137,10 +133,18 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const m_currentRowHeight = qMax(m_currentRowHeight, c.h + margin * 2); if (m_cx + c.w > m_w) { - // no room on the current line, start new glyph strip - m_cx = 0; - m_cy += m_currentRowHeight + paddingDoubled; - m_currentRowHeight = 0; // New row + int new_width = m_w*2; + while (new_width < m_cx + c.w) + new_width *= 2; + if (new_width <= maxTextureWidth()) { + resizeTextureData(new_width, m_h); + m_w = new_width; + } else { + // no room on the current line, start new glyph strip + m_cx = 0; + m_cy += m_currentRowHeight + paddingDoubled; + m_currentRowHeight = 0; // New row + } } if (m_cy + c.h > m_h) { int new_height = m_h*2; diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h index a818978..e6d2b22 100644 --- a/src/gui/painting/qtextureglyphcache_p.h +++ b/src/gui/painting/qtextureglyphcache_p.h @@ -64,6 +64,10 @@ # undef m_type #endif +#ifndef QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH +#define QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH 256 +#endif + struct glyph_metrics_t; typedef unsigned int glyph_t; @@ -113,6 +117,8 @@ public: QHash<glyph_t, Coord> coords; QImage textureMapForGlyph(glyph_t g) const; + virtual int maxTextureWidth() const { return QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH; } + virtual int maxTextureHeight() const { return 32768; } protected: QFontEngine *m_current_fontengine; diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 5996032..bafc5f3 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -3436,8 +3436,7 @@ bool QS60Style::eventFilter(QObject *object, QEvent *event) break; } case QEvent::MouseButtonRelease: { - const QWidget *w = QApplication::widgetAt(QCursor::pos()); - if (w && d->m_pressedWidget) { + if (d->m_pressedWidget) { d->m_pressedWidget->update(); d->m_pressedWidget = 0; } diff --git a/src/gui/text/qtextdocumentfragment.cpp b/src/gui/text/qtextdocumentfragment.cpp index 7c5f973..26346ca 100644 --- a/src/gui/text/qtextdocumentfragment.cpp +++ b/src/gui/text/qtextdocumentfragment.cpp @@ -43,7 +43,6 @@ #include "qtextdocumentfragment_p.h" #include "qtextcursor_p.h" #include "qtextlist.h" -#include "private/qunicodetables_p.h" #include <qdebug.h> #include <qtextcodec.h> diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index e190379..ca0942e 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -53,7 +53,6 @@ #include "qtextdocument_p.h" #include "qtextcursor.h" #include "qfont_p.h" -#include "private/qunicodetables_p.h" #include "private/qfunctions_p.h" #ifndef QT_NO_TEXTHTMLPARSER diff --git a/src/network/access/qfilenetworkreply.cpp b/src/network/access/qfilenetworkreply.cpp index 4ac9a8c..00bd29e 100644 --- a/src/network/access/qfilenetworkreply.cpp +++ b/src/network/access/qfilenetworkreply.cpp @@ -97,7 +97,10 @@ QFileNetworkReply::QFileNetworkReply(QObject *parent, const QNetworkRequest &req QString fileName = url.toLocalFile(); if (fileName.isEmpty()) { - fileName = url.toString(QUrl::RemoveAuthority | QUrl::RemoveFragment | QUrl::RemoveQuery); + if (url.scheme() == QLatin1String("qrc")) + fileName = QLatin1Char(':') + url.path(); + else + fileName = url.toString(QUrl::RemoveAuthority | QUrl::RemoveFragment | QUrl::RemoveQuery); } QFileInfo fi(fileName); diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index b35c318..a637474 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -946,10 +946,10 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera // fast path for GET on file:// URLs // Also if the scheme is empty we consider it a file. - // The QNetworkAccessFileBackend will right now only be used - // for PUT or qrc:// + // The QNetworkAccessFileBackend will right now only be used for PUT if ((op == QNetworkAccessManager::GetOperation || op == QNetworkAccessManager::HeadOperation) && (req.url().scheme() == QLatin1String("file") + || req.url().scheme() == QLatin1String("qrc") || req.url().scheme().isEmpty())) { return new QFileNetworkReply(this, req, op); } diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index 410cf21..f353995 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -129,7 +129,7 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height) GLuint oldTexture = m_texture; createTextureData(width, height); - + if (ctx->d_ptr->workaround_brokenFBOReadBack) { QImageTextureGlyphCache::resizeTextureData(width, height); Q_ASSERT(image().depth() == 8); @@ -281,4 +281,13 @@ int QGLTextureGlyphCache::glyphPadding() const return 1; } +int QGLTextureGlyphCache::maxTextureWidth() const +{ + return ctx->d_ptr->maxTextureSize(); +} + +int QGLTextureGlyphCache::maxTextureHeight() const +{ + return ctx->d_ptr->maxTextureSize(); +} QT_END_NAMESPACE diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h index 6bcd655..eb3693c 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h @@ -73,6 +73,8 @@ public: virtual void resizeTextureData(int width, int height); virtual void fillTexture(const Coord &c, glyph_t glyph); virtual int glyphPadding() const; + virtual int maxTextureWidth() const; + virtual int maxTextureHeight() const; inline GLuint texture() const { return m_texture; } diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp index bfb232d..f3a4c95 100644 --- a/src/opengl/qgl_x11.cpp +++ b/src/opengl/qgl_x11.cpp @@ -54,6 +54,7 @@ #include <private/qt_x11_p.h> #include <private/qpixmap_x11_p.h> #include <private/qimagepixmapcleanuphooks_p.h> +#include <private/qunicodetables_p.h> #ifdef Q_OS_HPUX // for GLXPBuffer #include <private/qglpixelbuffer_p.h> diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index a5ec12f..58778ea 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -4735,9 +4735,11 @@ void QGLGlyphCache::cacheGlyphs(QGLContext *context, QFontEngine *fontEngine, font_cache = new QGLFontGlyphHash; // qDebug() << "new context" << context << font_cache; qt_context_cache.insert(context, font_cache); - if (context->isValid() && context->device()->devType() == QInternal::Widget) { - QWidget *widget = static_cast<QWidget *>(context->device()); - connect(widget, SIGNAL(destroyed(QObject*)), SLOT(widgetDestroyed(QObject*))); + if (context->isValid()) { + if (context->device()->devType() == QInternal::Widget) { + QWidget *widget = static_cast<QWidget *>(context->device()); + connect(widget, SIGNAL(destroyed(QObject*)), SLOT(widgetDestroyed(QObject*))); + } connect(QGLSignalProxy::instance(), SIGNAL(aboutToDestroyContext(const QGLContext*)), SLOT(cleanupContext(const QGLContext*))); diff --git a/src/plugins/graphicssystems/meego/qmeegoextensions.h b/src/plugins/graphicssystems/meego/qmeegoextensions.h index f1a74f5..ee20bd8 100644 --- a/src/plugins/graphicssystems/meego/qmeegoextensions.h +++ b/src/plugins/graphicssystems/meego/qmeegoextensions.h @@ -42,12 +42,12 @@ #ifndef MEXTENSIONS_H #define MEXTENSIONS_H -#include <EGL/egl.h> -#include <GLES2/gl2.h> -#include <GLES2/gl2ext.h> #include <private/qgl_p.h> #include <private/qeglcontext_p.h> #include <private/qpixmapdata_gl_p.h> +#include <EGL/egl.h> +#include <GLES2/gl2.h> +#include <GLES2/gl2ext.h> /* Extensions decls */ diff --git a/src/plugins/imageformats/jpeg/jpeg.pro b/src/plugins/imageformats/jpeg/jpeg.pro index c5671c3..fb254b8 100644 --- a/src/plugins/imageformats/jpeg/jpeg.pro +++ b/src/plugins/imageformats/jpeg/jpeg.pro @@ -3,20 +3,6 @@ include(../../qpluginbase.pri) QTDIR_build:REQUIRES = "!contains(QT_CONFIG, no-jpeg)" -wince*: { - DEFINES += NO_GETENV - contains(CE_ARCH,x86):CONFIG -= stl exceptions - contains(CE_ARCH,x86):CONFIG += exceptions_off -} - -#Disable warnings in 3rdparty code due to unused arguments -symbian: { - QMAKE_CXXFLAGS.CW += -W nounusedarg - TARGET.UID3=0x2001E61B -} else:contains(QMAKE_CC, gcc): { - QMAKE_CFLAGS_WARN_ON += -Wno-unused-parameter -Wno-main -} - include(../../../gui/image/qjpeghandler.pri) SOURCES += main.cpp diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri index 8b119b5..84009d8 100644 --- a/src/plugins/qpluginbase.pri +++ b/src/plugins/qpluginbase.pri @@ -1,6 +1,6 @@ TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { - VERSION=4.7.0 + VERSION=4.7.1 } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } diff --git a/src/qbase.pri b/src/qbase.pri index f6af22f..680693f 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -4,7 +4,7 @@ INCLUDEPATH *= $$QMAKE_INCDIR_QT/$$TARGET #just for today to have some compat isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCH #another compat that will rot for change #215700 TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { - VERSION=4.7.0 + VERSION=4.7.1 } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } diff --git a/src/qt3support/dialogs/q3filedialog.cpp b/src/qt3support/dialogs/q3filedialog.cpp index 35f7890..f9dfaa1 100644 --- a/src/qt3support/dialogs/q3filedialog.cpp +++ b/src/qt3support/dialogs/q3filedialog.cpp @@ -106,7 +106,6 @@ #ifdef Q_WS_MAC #include "qmacstyle_mac.h" #include "private/qt_mac_p.h" -#include "private/qunicodetables_p.h" #undef check #endif diff --git a/src/qt3support/text/q3richtext.cpp b/src/qt3support/text/q3richtext.cpp index 8614076..d82d0f0 100644 --- a/src/qt3support/text/q3richtext.cpp +++ b/src/qt3support/text/q3richtext.cpp @@ -64,7 +64,6 @@ #include "q3stylesheet.h" #include "qtextstream.h" #include <private/qtextengine_p.h> -#include <private/qunicodetables_p.h> #include <stdlib.h> diff --git a/src/xmlpatterns/schema/qxsdtypechecker.cpp b/src/xmlpatterns/schema/qxsdtypechecker.cpp index 4bb03f5..217932e 100644 --- a/src/xmlpatterns/schema/qxsdtypechecker.cpp +++ b/src/xmlpatterns/schema/qxsdtypechecker.cpp @@ -171,6 +171,7 @@ XsdTypeChecker::XsdTypeChecker(const XsdSchemaContext::Ptr &context, const QVect XsdTypeChecker::~XsdTypeChecker() { + delete m_reflection; } QString XsdTypeChecker::normalizedValue(const QString &value, const XsdFacet::Hash &facets) diff --git a/tests/auto/linguist/lupdate/testdata/good/heuristics/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/heuristics/expectedoutput.txt index 093610d..1eed403 100644 --- a/tests/auto/linguist/lupdate/testdata/good/heuristics/expectedoutput.txt +++ b/tests/auto/linguist/lupdate/testdata/good/heuristics/expectedoutput.txt @@ -1,4 +1,3 @@ -*.*Function 'eval' is not implemented Updating 'project\.ts'\.\.\. Found 3 source text\(s\) \(3 new and 0 already existing\) Removed 5 obsolete entries diff --git a/tests/auto/linguist/lupdate/tst_lupdate.cpp b/tests/auto/linguist/lupdate/tst_lupdate.cpp index 5ba6c52..e6d2135 100644 --- a/tests/auto/linguist/lupdate/tst_lupdate.cpp +++ b/tests/auto/linguist/lupdate/tst_lupdate.cpp @@ -122,12 +122,19 @@ static bool prepareMatch(const QString &expect, QString *tmpl, int *require, int return true; } -void tst_lupdate::doCompare(const QStringList &actual, const QString &expectedFn, bool err) +void tst_lupdate::doCompare(const QStringList &_actual, const QString &expectedFn, bool err) { QFile file(expectedFn); QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Text), qPrintable(expectedFn)); QStringList expected = QString(file.readAll()).split('\n'); + QStringList actual; + actual.reserve(_actual.size()); + QRegExp niRx(".*:Function '\\w+' is not implemented"); + foreach (const QString &a, _actual) + if (!niRx.exactMatch(a)) + actual << a; + int ei = 0, ai = 0, em = expected.size(), am = actual.size(); int oei = 0, oai = 0, oem = em, oam = am; int require = 0, accept = 0; diff --git a/tests/auto/selftests/expected_cmptest.txt b/tests/auto/selftests/expected_cmptest.txt index fd5b486..7f3aa9a 100644 --- a/tests/auto/selftests/expected_cmptest.txt +++ b/tests/auto/selftests/expected_cmptest.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_Cmptest ********* -Config: Using QTest library 4.7.0, Qt 4.7.0 +Config: Using QTest library 4.7.1, Qt 4.7.1 PASS : tst_Cmptest::initTestCase() PASS : tst_Cmptest::compare_boolfuncs() PASS : tst_Cmptest::compare_pointerfuncs() diff --git a/tests/auto/selftests/expected_crashes_3.txt b/tests/auto/selftests/expected_crashes_3.txt index 3aced25..7ded525 100644 --- a/tests/auto/selftests/expected_crashes_3.txt +++ b/tests/auto/selftests/expected_crashes_3.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_Crashes ********* -Config: Using QTest library 4.7.0, Qt 4.7.0 +Config: Using QTest library 4.7.1, Qt 4.7.1 PASS : tst_Crashes::initTestCase() QFATAL : tst_Crashes::crash() Received signal 11 FAIL! : tst_Crashes::crash() Received a fatal error. diff --git a/tests/auto/selftests/expected_longstring.txt b/tests/auto/selftests/expected_longstring.txt index 1461bc6..9ad6f56 100644 --- a/tests/auto/selftests/expected_longstring.txt +++ b/tests/auto/selftests/expected_longstring.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_LongString ********* -Config: Using QTest library 4.7.0, Qt 4.7.0 +Config: Using QTest library 4.7.1, Qt 4.7.1 PASS : tst_LongString::initTestCase() FAIL! : tst_LongString::failWithLongString() Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. diff --git a/tests/auto/selftests/expected_maxwarnings.txt b/tests/auto/selftests/expected_maxwarnings.txt index 908bd5d..949da13 100644 --- a/tests/auto/selftests/expected_maxwarnings.txt +++ b/tests/auto/selftests/expected_maxwarnings.txt @@ -1,5 +1,5 @@ ********* Start testing of MaxWarnings ********* -Config: Using QTest library 4.7.0, Qt 4.7.0 +Config: Using QTest library 4.7.1, Qt 4.7.1 PASS : MaxWarnings::initTestCase() QWARN : MaxWarnings::warn() 0 QWARN : MaxWarnings::warn() 1 diff --git a/tests/auto/selftests/expected_skip.txt b/tests/auto/selftests/expected_skip.txt index e5bf1ff..1f5bf7b 100644 --- a/tests/auto/selftests/expected_skip.txt +++ b/tests/auto/selftests/expected_skip.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_Skip ********* -Config: Using QTest library 4.7.0, Qt 4.7.0 +Config: Using QTest library 4.7.1, Qt 4.7.1 PASS : tst_Skip::initTestCase() SKIP : tst_Skip::test() skipping all Loc: [/home/user/depot/qt-git/mainline/tests/auto/selftests/skip/tst_skip.cpp(68)] diff --git a/tools/assistant/tools/assistant/doc/assistant.qdocconf b/tools/assistant/tools/assistant/doc/assistant.qdocconf index 3b4b5f8..26cdafb 100644 --- a/tools/assistant/tools/assistant/doc/assistant.qdocconf +++ b/tools/assistant/tools/assistant/doc/assistant.qdocconf @@ -12,5 +12,5 @@ HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \ "<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \ "<td width=\"30%\" align=\"left\">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \ "<td width=\"40%\" align=\"center\">Trademarks</td>\n" \ - "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.7.0</div></td>\n" \ + "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.7.1</div></td>\n" \ "</tr></table></div></address>" diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index a2c7fe9..17bbadf 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -958,6 +958,8 @@ void Configure::parseCmdLine() dictionary[ "WEBKIT" ] = "no"; } else if (configCmdLine.at(i) == "-webkit") { dictionary[ "WEBKIT" ] = "yes"; + } else if (configCmdLine.at(i) == "-webkit-debug") { + dictionary[ "WEBKIT" ] = "debug"; } else if (configCmdLine.at(i) == "-no-declarative") { dictionary[ "DECLARATIVE" ] = "no"; } else if (configCmdLine.at(i) == "-declarative") { @@ -1651,7 +1653,7 @@ bool Configure::displayHelp() "[-phonon] [-no-phonon-backend] [-phonon-backend]\n" "[-no-multimedia] [-multimedia] [-no-audio-backend] [-audio-backend]\n" "[-no-script] [-script] [-no-scripttools] [-scripttools]\n" - "[-no-webkit] [-webkit] [-graphicssystem raster|opengl|openvg]\n\n", 0, 7); + "[-no-webkit] [-webkit] [-webkit-debug] [-graphicssystem raster|opengl|openvg]\n\n", 0, 7); desc("Installation options:\n\n"); @@ -1835,6 +1837,7 @@ bool Configure::displayHelp() desc("AUDIO_BACKEND", "yes","-audio-backend", "Compile in the platform audio backend into QtMultimedia"); desc("WEBKIT", "no", "-no-webkit", "Do not compile in the WebKit module"); desc("WEBKIT", "yes", "-webkit", "Compile in the WebKit module (WebKit is built if a decent C++ compiler is used.)"); + desc("WEBKIT", "debug", "-webkit-debug", "Compile in the WebKit module with debug symbols."); desc("SCRIPT", "no", "-no-script", "Do not build the QtScript module."); desc("SCRIPT", "yes", "-script", "Build the QtScript module."); desc("SCRIPTTOOLS", "no", "-no-scripttools", "Do not build the QtScriptTools module."); @@ -2692,10 +2695,12 @@ void Configure::generateOutputVars() QString dst = buildPath + "/mkspecs/modules/qt_webkit_version.pri"; QFile::remove(dst); - if (dictionary["WEBKIT"] == "yes") { + if (dictionary["WEBKIT"] != "no") { // This include takes care of adding "webkit" to QT_CONFIG. QString src = sourcePath + "/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri"; QFile::copy(src, dst); + if (dictionary["WEBKIT"] == "debug") + qtConfig += "webkit-debug"; } if (dictionary["DECLARATIVE"] == "yes") { @@ -3406,7 +3411,12 @@ void Configure::displayConfig() cout << "QtXmlPatterns support......." << dictionary[ "XMLPATTERNS" ] << endl; cout << "Phonon support.............." << dictionary[ "PHONON" ] << endl; cout << "QtMultimedia support........" << dictionary[ "MULTIMEDIA" ] << endl; - cout << "WebKit support.............." << dictionary[ "WEBKIT" ] << endl; + { + QString webkit = dictionary[ "WEBKIT" ]; + if (webkit == "debug") + webkit = "yes (debug)"; + cout << "WebKit support.............." << webkit; + } cout << "Declarative support........." << dictionary[ "DECLARATIVE" ] << endl; cout << "Declarative debugging......." << dictionary[ "DECLARATIVE_DEBUG" ] << endl; cout << "QtScript support............" << dictionary[ "SCRIPT" ] << endl; diff --git a/tools/qdoc3/doc/files/qt.qdocconf b/tools/qdoc3/doc/files/qt.qdocconf index 09c112a..4546c7a 100644 --- a/tools/qdoc3/doc/files/qt.qdocconf +++ b/tools/qdoc3/doc/files/qt.qdocconf @@ -22,7 +22,7 @@ edition.DesktopLight.groups = -graphicsview-api qhp.projects = Qt qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.470 +qhp.Qt.namespace = com.trolltech.qt.471 qhp.Qt.virtualFolder = qdoc qhp.Qt.indexTitle = Qt Reference Documentation qhp.Qt.indexRoot = @@ -36,9 +36,9 @@ qhp.Qt.extraFiles = classic.css \ images/dynamiclayouts-example.png \ images/stylesheet-coffee-plastique.png -qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc -qhp.Qt.customFilters.Qt.name = Qt 4.7.0 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 +qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc +qhp.Qt.customFilters.Qt.name = Qt 4.7.1 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 qhp.Qt.subprojects = classes overviews examples qhp.Qt.subprojects.classes.title = Classes qhp.Qt.subprojects.classes.indexTitle = Qt's Classes diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index 836c4bf..74b68df 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -13,7 +13,7 @@ indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = Assistant qhp.Assistant.file = assistant.qhp -qhp.Assistant.namespace = com.trolltech.assistant.470 +qhp.Assistant.namespace = com.trolltech.assistant.471 qhp.Assistant.virtualFolder = qdoc qhp.Assistant.indexTitle = Qt Assistant Manual qhp.Assistant.extraFiles = images/bg_l.png \ @@ -50,7 +50,7 @@ qhp.Assistant.extraFiles = images/bg_l.png \ style/style_ie8.css \ style/style.css -qhp.Assistant.filterAttributes = qt 4.7.0 tools assistant +qhp.Assistant.filterAttributes = qt 4.7.1 tools assistant qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual qhp.Assistant.customFilters.Assistant.filterAttributes = qt tools assistant qhp.Assistant.subprojects = manual examples diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index 9136619..ab66792 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -13,7 +13,7 @@ indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = Designer qhp.Designer.file = designer.qhp -qhp.Designer.namespace = com.trolltech.designer.470 +qhp.Designer.namespace = com.trolltech.designer.471 qhp.Designer.virtualFolder = qdoc qhp.Designer.indexTitle = Qt Designer Manual qhp.Designer.extraFiles = images/bg_l.png \ @@ -50,7 +50,7 @@ qhp.Designer.extraFiles = images/bg_l.png \ style/style_ie8.css \ style/style.css -qhp.Designer.filterAttributes = qt 4.7.0 tools designer +qhp.Designer.filterAttributes = qt 4.7.1 tools designer qhp.Designer.customFilters.Designer.name = Qt Designer Manual qhp.Designer.customFilters.Designer.filterAttributes = qt tools designer qhp.Designer.subprojects = manual examples diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf index 696802a..0d920e2 100644 --- a/tools/qdoc3/test/linguist.qdocconf +++ b/tools/qdoc3/test/linguist.qdocconf @@ -13,7 +13,7 @@ indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = Linguist qhp.Linguist.file = linguist.qhp -qhp.Linguist.namespace = com.trolltech.linguist.470 +qhp.Linguist.namespace = com.trolltech.linguist.471 qhp.Linguist.virtualFolder = qdoc qhp.Linguist.indexTitle = Qt Linguist Manual qhp.Linguist.extraFiles = images/bg_l.png \ @@ -50,7 +50,7 @@ qhp.Linguist.extraFiles = images/bg_l.png \ style/style_ie8.css \ style/style.css -qhp.Linguist.filterAttributes = qt 4.7.0 tools linguist +qhp.Linguist.filterAttributes = qt 4.7.1 tools linguist qhp.Linguist.customFilters.Linguist.name = Qt Linguist Manual qhp.Linguist.customFilters.Linguist.filterAttributes = qt tools linguist qhp.Linguist.subprojects = manual examples diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf index 45f48a6..9aaebcb 100644 --- a/tools/qdoc3/test/qdeclarative.qdocconf +++ b/tools/qdoc3/test/qdeclarative.qdocconf @@ -21,7 +21,7 @@ edition.DesktopLight.groups = -graphicsview-api qhp.projects = Qml qhp.Qml.file = qml.qhp -qhp.Qml.namespace = com.trolltech.qml.470 +qhp.Qml.namespace = com.trolltech.qml.471 qhp.Qml.virtualFolder = qdoc qhp.Qml.indexTitle = Qml Reference @@ -61,9 +61,9 @@ qhp.Qml.extraFiles = images/bg_l.png \ style/style_ie8.css \ style/style.css -qhp.Qml.filterAttributes = qt 4.7.0 qtrefdoc -qhp.Qml.customFilters.Qt.name = Qt 4.7.0 -qhp.Qml.customFilters.Qt.filterAttributes = qt 4.7.0 +qhp.Qml.filterAttributes = qt 4.7.1 qtrefdoc +qhp.Qml.customFilters.Qt.name = Qt 4.7.1 +qhp.Qml.customFilters.Qt.filterAttributes = qt 4.7.1 qhp.Qml.subprojects = classes qhp.Qml.subprojects.classes.title = Elements qhp.Qml.subprojects.classes.indexTitle = Qml Elements diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf index 8125166..be2e9d3 100644 --- a/tools/qdoc3/test/qmake.qdocconf +++ b/tools/qdoc3/test/qmake.qdocconf @@ -13,7 +13,7 @@ indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = qmake qhp.qmake.file = qmake.qhp -qhp.qmake.namespace = com.trolltech.qmake.470 +qhp.qmake.namespace = com.trolltech.qmake.471 qhp.qmake.virtualFolder = qdoc qhp.qmake.indexTitle = QMake Manual qhp.qmake.extraFiles = images/bg_l.png \ @@ -50,7 +50,7 @@ qhp.qmake.extraFiles = images/bg_l.png \ style/style_ie8.css \ style/style.css -qhp.qmake.filterAttributes = qt 4.7.0 tools qmake +qhp.qmake.filterAttributes = qt 4.7.1 tools qmake qhp.qmake.customFilters.qmake.name = qmake Manual qhp.qmake.customFilters.qmake.filterAttributes = qt tools qmake qhp.qmake.subprojects = manual diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index 639585c..dcabeb4 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -15,7 +15,7 @@ naturallanguage = en_US qhp.projects = Qt qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.470 +qhp.Qt.namespace = com.trolltech.qt.471 qhp.Qt.virtualFolder = qdoc qhp.Qt.indexTitle = Qt Reference Documentation qhp.Qt.indexRoot = @@ -59,9 +59,9 @@ qhp.Qt.extraFiles = index.html \ -qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc -qhp.Qt.customFilters.Qt.name = Qt 4.7.0 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 +qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc +qhp.Qt.customFilters.Qt.name = Qt 4.7.1 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 qhp.Qt.subprojects = classes overviews examples qhp.Qt.subprojects.classes.title = Classes qhp.Qt.subprojects.classes.indexTitle = Qt's Classes diff --git a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf index c24ddef..7e28fa2 100644 --- a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf @@ -17,15 +17,15 @@ indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = Qt qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.470 +qhp.Qt.namespace = com.trolltech.qt.471 qhp.Qt.virtualFolder = qdoc qhp.Qt.title = Qt qhp.Qt.indexTitle = Qt qhp.Qt.selectors = fake:example -qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc ja_JP -qhp.Qt.customFilters.Qt.name = Qt 4.7.0 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 +qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc ja_JP +qhp.Qt.customFilters.Qt.name = Qt 4.7.1 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf index a983faa..cfcc76d 100644 --- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf @@ -17,15 +17,15 @@ indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = Qt qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.470 +qhp.Qt.namespace = com.trolltech.qt.471 qhp.Qt.virtualFolder = qdoc qhp.Qt.title = 教程 qhp.Qt.indexTitle = 教程 qhp.Qt.selectors = fake:example -qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc zh_CN -qhp.Qt.customFilters.Qt.name = Qt 4.7.0 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 +qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc zh_CN +qhp.Qt.customFilters.Qt.name = Qt 4.7.1 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index b716f7c..44aa918 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -40,7 +40,7 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " <li><a href=\"#\">Qt Topics</a> \n" \ " <ul id=\"topmenuTopic\"> \n" \ " <li><a href=\"qt-basic-concepts.html\">Programming with Qt</a></li> \n" \ - " <li><a href=\"qtquick.html\">Device UI's & Qt Quick</a></li> \n" \ + " <li><a href=\"qtquick.html\">Device UIs & Qt Quick</a></li> \n" \ " <li><a href=\"qt-gui-concepts.html\">UI Design with Qt</a></li> \n" \ " <li><a href=\"developing-with-qt.html\">Cross-platform and Platform-specific</a></li> \n" \ " <li><a href=\"platform-specific.html\">Platform-specific info</a></li> \n" \ @@ -94,7 +94,7 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " <div id=\"list002\" class=\"list\">\n" \ " <ul id=\"ul002\" >\n" \ " <li class=\"defaultLink\"><a href=\"qt-basic-concepts.html\">Programming with Qt</a></li> \n" \ - " <li class=\"defaultLink\"><a href=\"qtquick.html\">Device UI's & Qt Quick</a></li> \n" \ + " <li class=\"defaultLink\"><a href=\"qtquick.html\">Device UIs & Qt Quick</a></li> \n" \ " <li class=\"defaultLink\"><a href=\"qt-gui-concepts.html\">UI Design with Qt</a></li> \n" \ " <li class=\"defaultLink\"><a href=\"developing-with-qt.html\">Cross-platform and Platform-specific</a></li> \n" \ " <li class=\"defaultLink\"><a href=\"platform-specific.html\">Platform-specific info</a></li> \n" \ diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index 215e0d6..ea97205 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -17,7 +17,7 @@ naturallanguage = en_US qhp.projects = Qt qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.470 +qhp.Qt.namespace = com.trolltech.qt.471 qhp.Qt.virtualFolder = qdoc qhp.Qt.indexTitle = Qt Reference Documentation qhp.Qt.indexRoot = @@ -59,9 +59,9 @@ qhp.Qt.extraFiles = index.html \ style/style_ie8.css \ style/style.css -qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc -qhp.Qt.customFilters.Qt.name = Qt 4.7.0 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 +qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc +qhp.Qt.customFilters.Qt.name = Qt 4.7.1 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 qhp.Qt.subprojects = classes overviews examples qhp.Qt.subprojects.classes.title = Classes qhp.Qt.subprojects.classes.indexTitle = Qt's Classes diff --git a/tools/qdoc3/test/qt_ja_JP.qdocconf b/tools/qdoc3/test/qt_ja_JP.qdocconf index f9ce142..32bba06 100644 --- a/tools/qdoc3/test/qt_ja_JP.qdocconf +++ b/tools/qdoc3/test/qt_ja_JP.qdocconf @@ -19,15 +19,15 @@ indexes = $QTDIR/doc/html/qt.index qhp.projects = Qt qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.470 +qhp.Qt.namespace = com.trolltech.qt.471 qhp.Qt.virtualFolder = qdoc qhp.Qt.title = Qt qhp.Qt.indexTitle = Qt qhp.Qt.selectors = fake:example -qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc ja_JP -qhp.Qt.customFilters.Qt.name = Qt 4.7.0 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 +qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc ja_JP +qhp.Qt.customFilters.Qt.name = Qt 4.7.1 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML diff --git a/tools/qdoc3/test/qt_zh_CN.qdocconf b/tools/qdoc3/test/qt_zh_CN.qdocconf index 5bf8171..40d3d5a 100644 --- a/tools/qdoc3/test/qt_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt_zh_CN.qdocconf @@ -19,15 +19,15 @@ indexes = $QTDIR/doc/html/qt.index qhp.projects = Qt qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.470 +qhp.Qt.namespace = com.trolltech.qt.471 qhp.Qt.virtualFolder = qdoc qhp.Qt.title = 教程 qhp.Qt.indexTitle = 教程 qhp.Qt.selectors = fake:example -qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc zh_CN -qhp.Qt.customFilters.Qt.name = Qt 4.7.0 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 +qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc zh_CN +qhp.Qt.customFilters.Qt.name = Qt 4.7.1 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp index f2ebe7c..cfe5956 100644 --- a/util/unicode/main.cpp +++ b/util/unicode/main.cpp @@ -403,7 +403,7 @@ struct PropertyFlags { // from DerivedAge.txt QChar::UnicodeVersion age : 4; int digitValue; - uint line_break_class : 6; + LineBreakClass line_break_class; int mirrorDiff : 16; @@ -429,7 +429,7 @@ static int appendToSpecialCaseMap(const QList<int> &map) QList<int> utf16map; for (int i = 0; i < map.size(); ++i) { int val = map.at(i); - if (val > 0xffff) { + if (val >= 0x10000) { utf16map << QChar::highSurrogate(val); utf16map << QChar::lowSurrogate(val); } else { @@ -505,7 +505,7 @@ struct UnicodeData { // from BidiMirroring.txt int mirroredChar; - // CompositionExclusions.txt + // DerivedNormalizationProps.txt bool excludedComposition; // computed position of unicode property set @@ -726,8 +726,8 @@ static void readUnicodeData() data.p.category = categoryMap.value(properties[UD_Category], QChar::NoCategory); if (data.p.category == QChar::NoCategory) qFatal("unassigned char category: %s", properties[UD_Category].constData()); - data.p.combiningClass = properties[UD_CombiningClass].toInt(); + data.p.combiningClass = properties[UD_CombiningClass].toInt(); if (!combiningClassUsage.contains(data.p.combiningClass)) combiningClassUsage[data.p.combiningClass] = 1; else @@ -738,27 +738,29 @@ static void readUnicodeData() if (!properties[UD_UpperCase].isEmpty()) { int upperCase = properties[UD_UpperCase].toInt(&ok, 16); Q_ASSERT(ok); - if (qAbs(upperCase - codepoint) >= (1<<14)) + int diff = upperCase - codepoint; + if (qAbs(diff) >= (1<<14)) qWarning() << "upperCaseDiff exceeded (" << hex << codepoint << "->" << upperCase << ")"; - data.p.upperCaseDiff = upperCase - codepoint; - maxUpperCaseDiff = qMax(maxUpperCaseDiff, qAbs(data.p.upperCaseDiff)); - if (codepoint > 0xffff) { - // if the condition below doesn't hold anymore we need to modify our case folding code - //qDebug() << codepoint << QChar::highSurrogate(codepoint) << QChar::highSurrogate(foldMap.at(0)); + data.p.upperCaseDiff = diff; + maxUpperCaseDiff = qMax(maxUpperCaseDiff, qAbs(diff)); + if (codepoint >= 0x10000 || upperCase >= 0x10000) { + // if the conditions below doesn't hold anymore we need to modify our upper casing code Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(upperCase)); + Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(upperCase)); } } if (!properties[UD_LowerCase].isEmpty()) { int lowerCase = properties[UD_LowerCase].toInt(&ok, 16); Q_ASSERT(ok); - if (qAbs(lowerCase - codepoint) >= (1<<14)) + int diff = lowerCase - codepoint; + if (qAbs(diff) >= (1<<14)) qWarning() << "lowerCaseDiff exceeded (" << hex << codepoint << "->" << lowerCase << ")"; - data.p.lowerCaseDiff = lowerCase - codepoint; - maxLowerCaseDiff = qMax(maxLowerCaseDiff, qAbs(data.p.lowerCaseDiff)); - if (codepoint > 0xffff) { - // if the condition below doesn't hold anymore we need to modify our case folding code - //qDebug() << codepoint << QChar::highSurrogate(codepoint) << QChar::highSurrogate(foldMap.at(0)); + data.p.lowerCaseDiff = diff; + maxLowerCaseDiff = qMax(maxLowerCaseDiff, qAbs(diff)); + if (codepoint >= 0x10000 || lowerCase >= 0x10000) { + // if the conditions below doesn't hold anymore we need to modify our lower casing code Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(lowerCase)); + Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(lowerCase)); } } // we want toTitleCase to map to ToUpper in case we don't have any titlecase. @@ -767,14 +769,15 @@ static void readUnicodeData() if (!properties[UD_TitleCase].isEmpty()) { int titleCase = properties[UD_TitleCase].toInt(&ok, 16); Q_ASSERT(ok); - if (qAbs(titleCase - codepoint) >= (1<<14)) + int diff = titleCase - codepoint; + if (qAbs(diff) >= (1<<14)) qWarning() << "titleCaseDiff exceeded (" << hex << codepoint << "->" << titleCase << ")"; - data.p.titleCaseDiff = titleCase - codepoint; - maxTitleCaseDiff = qMax(maxTitleCaseDiff, qAbs(data.p.titleCaseDiff)); - if (codepoint > 0xffff) { - // if the condition below doesn't hold anymore we need to modify our case folding code - //qDebug() << codepoint << QChar::highSurrogate(codepoint) << QChar::highSurrogate(foldMap.at(0)); + data.p.titleCaseDiff = diff; + maxTitleCaseDiff = qMax(maxTitleCaseDiff, qAbs(diff)); + if (codepoint >= 0x10000 || titleCase >= 0x10000) { + // if the conditions below doesn't hold anymore we need to modify our title casing code Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(titleCase)); + Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(titleCase)); } } @@ -1003,16 +1006,16 @@ static void readDerivedNormalizationProps() && d.decomposition.size() > 1) { Q_ASSERT(d.decomposition.size() == 2); - uint part1 = d.decomposition.at(0); - uint part2 = d.decomposition.at(1); + int part1 = d.decomposition.at(0); + int part2 = d.decomposition.at(1); // all non-starters are listed in DerivedNormalizationProps.txt // and already excluded from composition Q_ASSERT(unicodeData.value(part1, UnicodeData(part1)).p.combiningClass == 0); ++numLigatures; - highestLigature = qMax(highestLigature, (int)part1); - Ligature l = {(ushort)part1, (ushort)part2, codepoint}; + highestLigature = qMax(highestLigature, part1); + Ligature l = {(ushort)part1, (ushort)part2, (ushort)codepoint}; ligatureHashes[part2].append(l); } } @@ -1109,6 +1112,7 @@ static void computeUniqueProperties() static void readLineBreak() { + qDebug() << "Reading LineBreak.txt"; QFile f("data/LineBreak.txt"); if (!f.exists()) qFatal("Couldn't find LineBreak.txt"); @@ -1145,7 +1149,7 @@ static void readLineBreak() Q_ASSERT(ok); } - LineBreakClass lb = line_break_map.value(l[1].trimmed(), LineBreak_Unassigned); + LineBreakClass lb = line_break_map.value(l[1], LineBreak_Unassigned); if (lb == LineBreak_Unassigned) qFatal("unassigned line break class: %s", l[1].constData()); @@ -1190,7 +1194,10 @@ static void readSpecialCasing() bool ok; int codepoint = l[0].trimmed().toInt(&ok, 16); Q_ASSERT(ok); - Q_ASSERT(codepoint <= 0xffff); + + // if the condition below doesn't hold anymore we need to modify our + // lower/upper/title casing code and case folding code + Q_ASSERT(codepoint < 0x10000); // qDebug() << "codepoint" << hex << codepoint; // qDebug() << line; @@ -1290,16 +1297,18 @@ static void readCaseFolding() UnicodeData ud = unicodeData.value(codepoint, UnicodeData(codepoint)); if (foldMap.size() == 1) { - if (qAbs(foldMap.at(0) - codepoint) >= (1<<14)) - qWarning() << "caseFoldDiff exceeded (" << hex << codepoint << "->" << foldMap.at(0) << ")"; - ud.p.caseFoldDiff = foldMap.at(0) - codepoint; - maxCaseFoldDiff = qMax(maxCaseFoldDiff, qAbs(ud.p.caseFoldDiff)); - if (codepoint > 0xffff) { - // if the condition below doesn't hold anymore we need to modify our case folding code - //qDebug() << codepoint << QChar::highSurrogate(codepoint) << QChar::highSurrogate(foldMap.at(0)); - Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(foldMap.at(0))); + int caseFolded = foldMap.at(0); + int diff = caseFolded - codepoint; + if (qAbs(diff) >= (1<<14)) + qWarning() << "caseFoldDiff exceeded (" << hex << codepoint << "->" << caseFolded << ")"; + ud.p.caseFoldDiff = diff; + maxCaseFoldDiff = qMax(maxCaseFoldDiff, qAbs(diff)); + if (codepoint >= 0x10000 || caseFolded >= 0x10000) { + // if the conditions below doesn't hold anymore we need to modify our case folding code + Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(caseFolded)); + Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(caseFolded)); } - if (foldMap.at(0) != codepoint + ud.p.lowerCaseDiff) + if (caseFolded != codepoint + ud.p.lowerCaseDiff) qDebug() << hex << codepoint; } else { qFatal("we currently don't support full case foldings"); @@ -1329,13 +1338,15 @@ static void readGraphemeBreak() int comment = line.indexOf('#'); if (comment >= 0) line = line.left(comment); + line.replace(" ", ""); if (line.isEmpty()) continue; QList<QByteArray> l = line.split(';'); + Q_ASSERT(l.size() == 2); - QByteArray codes = l[0].trimmed(); + QByteArray codes = l[0]; codes.replace("..", "."); QList<QByteArray> cl = codes.split('.'); @@ -1348,7 +1359,7 @@ static void readGraphemeBreak() Q_ASSERT(ok); } - GraphemeBreak brk = grapheme_break_map.value(l[1].trimmed(), GraphemeBreak_Unassigned); + GraphemeBreak brk = grapheme_break_map.value(l[1], GraphemeBreak_Unassigned); if (brk == GraphemeBreak_Unassigned) qFatal("unassigned grapheme break class: %s", l[1].constData()); @@ -1378,13 +1389,15 @@ static void readWordBreak() int comment = line.indexOf('#'); if (comment >= 0) line = line.left(comment); + line.replace(" ", ""); if (line.isEmpty()) continue; QList<QByteArray> l = line.split(';'); + Q_ASSERT(l.size() == 2); - QByteArray codes = l[0].trimmed(); + QByteArray codes = l[0]; codes.replace("..", "."); QList<QByteArray> cl = codes.split('.'); @@ -1397,7 +1410,7 @@ static void readWordBreak() Q_ASSERT(ok); } - WordBreak brk = word_break_map.value(l[1].trimmed(), WordBreak_Unassigned); + WordBreak brk = word_break_map.value(l[1], WordBreak_Unassigned); if (brk == WordBreak_Unassigned) qFatal("unassigned word break class: %s", l[1].constData()); @@ -1427,13 +1440,15 @@ static void readSentenceBreak() int comment = line.indexOf('#'); if (comment >= 0) line = line.left(comment); + line.replace(" ", ""); if (line.isEmpty()) continue; QList<QByteArray> l = line.split(';'); + Q_ASSERT(l.size() == 2); - QByteArray codes = l[0].trimmed(); + QByteArray codes = l[0]; codes.replace("..", "."); QList<QByteArray> cl = codes.split('.'); @@ -1446,7 +1461,7 @@ static void readSentenceBreak() Q_ASSERT(ok); } - SentenceBreak brk = sentence_break_map.value(l[1].trimmed(), SentenceBreak_Unassigned); + SentenceBreak brk = sentence_break_map.value(l[1], SentenceBreak_Unassigned); if (brk == SentenceBreak_Unassigned) qFatal("unassigned sentence break class: %s", l[1].constData()); @@ -1624,17 +1639,22 @@ static void readBlocks() QByteArray blockName = line.mid(semicolon + 1); int blockIndex = blockNames.indexOf(blockName); - if (blockIndex < 0) { + if (blockIndex == -1) { + blockIndex = blockNames.size(); blockNames.append(blockName); - blockIndex = blockNames.indexOf(blockName); - Q_ASSERT(blockIndex >= 0); } - int dotdot = codePoints.indexOf(".."); - Q_ASSERT(dotdot >= 0); - bool unused; - int first = codePoints.left(dotdot).toInt(&unused, 16); - int last = codePoints.mid(dotdot + 2).toInt(&unused, 16); + codePoints.replace("..", "."); + QList<QByteArray> cl = codePoints.split('.'); + + bool ok; + int first = cl[0].toInt(&ok, 16); + Q_ASSERT(ok); + int last = first; + if (cl.size() == 2) { + last = cl[1].toInt(&ok, 16); + Q_ASSERT(ok); + } BlockInfo blockInfo = { blockIndex, first, last }; blockInfoList.append(blockInfo); @@ -1670,7 +1690,6 @@ static void readScripts() if (!f.exists()) qFatal("Couldn't find %s", files[i]); - f.open(QFile::ReadOnly); while (!f.atEnd()) { @@ -1693,28 +1712,25 @@ static void readScripts() QByteArray scriptName = line.mid(semicolon + 1); int scriptIndex = scriptNames.indexOf(scriptName); - if (scriptIndex < 0) { + if (scriptIndex == -1) { + scriptIndex = scriptNames.size(); scriptNames.append(scriptName); - scriptIndex = scriptNames.indexOf(scriptName); - Q_ASSERT(scriptIndex >= 0); } - int dotdot = codePoints.indexOf(".."); - bool unused; - int first = -1, last = -1; - if (dotdot >= 0) { - first = codePoints.left(dotdot).toInt(&unused, 16); - last = codePoints.mid(dotdot + 2).toInt(&unused, 16); - } else { - first = codePoints.toInt(&unused, 16); - } + codePoints.replace("..", "."); + QList<QByteArray> cl = codePoints.split('.'); - if (last != -1) { - for (int i = first; i <= last; ++i) - scriptAssignment[i] = scriptIndex; - } else { - scriptAssignment[first] = scriptIndex; + bool ok; + int first = cl[0].toInt(&ok, 16); + Q_ASSERT(ok); + int last = first; + if (cl.size() == 2) { + last = cl[1].toInt(&ok, 16); + Q_ASSERT(ok); } + + for (int i = first; i <= last; ++i) + scriptAssignment[i] = scriptIndex; } } } @@ -1849,21 +1865,18 @@ QByteArray createScriptTableDeclaration() declaration += ", /* U+"; declaration += QByteArray::number(block, 16).rightJustified(4, '0'); declaration += '-'; - declaration += - QByteArray::number(block + unicodeBlockSize - 1, 16).rightJustified(4, '0'); + declaration += QByteArray::number(block + unicodeBlockSize - 1, 16).rightJustified(4, '0'); declaration += " */\n"; } else { const int value = extraBlockList.size() + scriptSentinel; - const int offset = - ((value - scriptSentinel) * unicodeBlockSize) + unicodeBlockCount; + const int offset = ((value - scriptSentinel) * unicodeBlockSize) + unicodeBlockCount; declaration += " "; declaration += QByteArray::number(value); declaration += ", /* U+"; declaration += QByteArray::number(block, 16).rightJustified(4, '0'); declaration += '-'; - declaration += - QByteArray::number(block + unicodeBlockSize - 1, 16).rightJustified(4, '0'); + declaration += QByteArray::number(block + unicodeBlockSize - 1, 16).rightJustified(4, '0'); declaration += " at offset "; declaration += QByteArray::number(offset); declaration += " */\n"; @@ -1880,16 +1893,14 @@ QByteArray createScriptTableDeclaration() for (int i = 0; i < extraBlockList.size(); ++i) { const int value = i + scriptSentinel; - const int offset = - ((value - scriptSentinel) * unicodeBlockSize) + unicodeBlockCount; + const int offset = ((value - scriptSentinel) * unicodeBlockSize) + unicodeBlockCount; const ExtraBlock &extraBlock = extraBlockList.at(i); const int block = extraBlock.block; declaration += "\n\n /* U+"; declaration += QByteArray::number(block, 16).rightJustified(4, '0'); declaration += '-'; - declaration += - QByteArray::number(block + unicodeBlockSize - 1, 16).rightJustified(4, '0'); + declaration += QByteArray::number(block + unicodeBlockSize - 1, 16).rightJustified(4, '0'); declaration += " at offset "; declaration += QByteArray::number(offset); declaration += " */\n "; @@ -1905,9 +1916,24 @@ QByteArray createScriptTableDeclaration() else declaration += ' '; } + if (declaration.endsWith(' ')) + declaration.chop(1); } declaration += "\n};\n\n} // namespace QUnicodeTables\n\n"; + declaration += + "Q_CORE_EXPORT int QT_FASTCALL QUnicodeTables::script(uint ucs4)\n" + "{\n" + " if (ucs4 > 0xffff)\n" + " return Common;\n" + " int script = uc_scripts[ucs4 >> 7];\n" + " if (script < ScriptSentinel)\n" + " return script;\n" + " script = (((script - ScriptSentinel) * UnicodeBlockSize) + UnicodeBlockCount);\n" + " script = uc_scripts[script + (ucs4 & 0x7f)];\n" + " return script;\n" + "}\n\n"; + qDebug("createScriptTableDeclaration: table size is %d bytes", unicodeBlockCount + (extraBlockList.size() * unicodeBlockSize)); @@ -2168,6 +2194,11 @@ static QByteArray createPropertyInfo() " return uc_properties + index;\n" "}\n\n"; + out += "Q_CORE_EXPORT QUnicodeTables::LineBreakClass QT_FASTCALL QUnicodeTables::lineBreakClass(uint ucs4)\n" + "{\n" + " return (QUnicodeTables::LineBreakClass)qGetProp(ucs4)->line_break_class;\n" + "}\n\n"; + out += "static const ushort specialCaseMap[] = {\n "; for (int i = 0; i < specialCaseMap.size(); ++i) { out += QByteArray(" 0x") + QByteArray::number(specialCaseMap.at(i), 16); @@ -2204,7 +2235,7 @@ static QByteArray createCompositionInfo() const int SMP_BLOCKSIZE = 256; const int SMP_SHIFT = 8; - if(SMP_END <= highestComposedCharacter) + if (SMP_END <= highestComposedCharacter) qFatal("end of table smaller than highest composed character at %x", highestComposedCharacter); QList<DecompositionBlock> blocks; @@ -2417,15 +2448,15 @@ static QByteArray createLigatureInfo() int uc = block*BMP_BLOCKSIZE + i; QList<Ligature> l = ligatureHashes.value(uc); if (!l.isEmpty()) { - b.decompositionPositions.append(tableIndex); qSort(l); ligatures.append(l.size()); - for (int i = 0; i < l.size(); ++i) { - Q_ASSERT(l.at(i).u2 == uc); - ligatures.append(l.at(i).u1); - ligatures.append(l.at(i).ligature); + for (int j = 0; j < l.size(); ++j) { + Q_ASSERT(l.at(j).u2 == uc); + ligatures.append(l.at(j).u1); + ligatures.append(l.at(j).ligature); } + b.decompositionPositions.append(tableIndex); tableIndex += 2*l.size() + 1; } else { b.decompositionPositions.append(0xffff); @@ -2450,12 +2481,11 @@ static QByteArray createLigatureInfo() qDebug(" %d unique blocks in BMP.", blocks.size()); qDebug(" block data uses: %d bytes", bmp_block_data); qDebug(" trie data uses : %d bytes", bmp_trie); - qDebug(" ligature data uses : %d bytes", ligatures.size()*2); - qDebug(" memory usage: %d bytes", bmp_mem + ligatures.size() * 2); + qDebug("\n ligature data uses : %d bytes", ligatures.size()*2); + qDebug(" memory usage: %d bytes", bmp_mem + ligatures.size() * 2); QByteArray out; - out += "static const unsigned short uc_ligature_trie[] = {\n"; // first write the map @@ -2531,6 +2561,7 @@ QByteArray createCasingInfo() return out; } + int main(int, char **) { initAgeMap(); @@ -2650,14 +2681,14 @@ int main(int, char **) f.write("\n"); f.write(scriptEnumDeclaration); f.write("\n"); - f.write(lineBreakClass); - f.write("\n"); f.write(grapheme_break_string); f.write("\n"); f.write(word_break_string); f.write("\n"); f.write(sentence_break_string); f.write("\n"); + f.write(lineBreakClass); + f.write("\n"); f.write(methods); f.write("} // namespace QUnicodeTables\n\n" "QT_END_NAMESPACE\n\n" |