summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2010-06-30 17:06:37 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2010-06-30 17:06:37 (GMT)
commit0713442baa4120050e85c13998797415bb40efce (patch)
tree2735cae5573363fd5edceae71ae8b7af60518df2
parent08478207ee9a6563ae63ebcef833925db6426bd8 (diff)
parent01648005f1f546dc0281155fecd94b4f47a94584 (diff)
downloadQt-0713442baa4120050e85c13998797415bb40efce.zip
Qt-0713442baa4120050e85c13998797415bb40efce.tar.gz
Qt-0713442baa4120050e85c13998797415bb40efce.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Conflicts: tools/qdoc3/test/qt-html-templates.qdocconf
-rw-r--r--.gitignore1
-rwxr-xr-xbin/elf2e32_qtwrapper145
-rwxr-xr-xbin/syncqt6
-rw-r--r--config.tests/mac/corewlan/corewlantest.mm2
-rwxr-xr-xconfigure2
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.pro9
-rw-r--r--demos/embedded/qmlcalculator/deployment.pri2
-rw-r--r--demos/embedded/qmlclocks/deployment.pri2
-rw-r--r--demos/embedded/qmldialcontrol/deployment.pri2
-rw-r--r--demos/embedded/qmleasing/deployment.pri2
-rw-r--r--demos/embedded/qmlflickr/deployment.pri2
-rw-r--r--demos/embedded/qmlphotoviewer/deployment.pri2
-rw-r--r--demos/embedded/qmltwitter/deployment.pri2
-rw-r--r--demos/spectrum/3rdparty/fftreal/fftreal.pro2
-rw-r--r--demos/spectrum/app/app.pro2
-rw-r--r--demos/spectrum/spectrum.pro2
-rw-r--r--doc/src/declarative/basictypes.qdoc16
-rw-r--r--doc/src/declarative/dynamicobjects.qdoc14
-rw-r--r--doc/src/scripting/ecmascript.qdoc50
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.pro2
-rw-r--r--examples/declarative/cppextensions/qwidgets/qwidgets.pro2
-rw-r--r--examples/network/bearercloud/bearercloud.cpp2
-rw-r--r--examples/network/bearercloud/main.cpp2
-rw-r--r--examples/network/bearermonitor/bearermonitor.cpp11
-rw-r--r--examples/network/bearermonitor/bearermonitor_240_320.ui2
-rw-r--r--examples/network/bearermonitor/bearermonitor_640_480.ui2
-rw-r--r--examples/network/bearermonitor/bearermonitor_maemo.ui2
-rw-r--r--examples/network/bearermonitor/main.cpp2
-rw-r--r--examples/network/bearermonitor/sessionwidget.ui2
-rw-r--r--examples/network/bearermonitor/sessionwidget_maemo.ui2
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknLayoutFont.h2
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknsBasicBackgroundControlContext.h1
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknsConstants.h1
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknsDrawUtils.h1
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknsItemID.h1
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknsSkinInstance.h1
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknsUtils.h1
-rw-r--r--mkspecs/common/symbian/symbian-makefile.conf2
-rw-r--r--mkspecs/features/sis_targets.prf25
-rw-r--r--mkspecs/features/symbian/data_caging_paths.prf3
-rw-r--r--mkspecs/features/symbian/def_files.prf4
-rw-r--r--mkspecs/features/symbian/run_on_phone.prf10
-rw-r--r--mkspecs/features/symbian/symbian_building.prf126
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp1
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp7
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp1
-rw-r--r--qmake/generators/win32/msvc_vcxproj.cpp1
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-global.h2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-thai.c8
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog46
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h2
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp8
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h9
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h2
-rw-r--r--src/3rdparty/javascriptcore/VERSION4
-rw-r--r--src/3rdparty/webkit/.tag2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/ChangeLog34
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h206
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog87
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro9
-rw-r--r--src/3rdparty/webkit/WebCore/loader/DocLoader.cpp15
-rw-r--r--src/3rdparty/webkit/WebCore/loader/DocLoader.h5
-rw-r--r--src/3rdparty/webkit/WebCore/page/FrameView.cpp12
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp8
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderBlock.h9
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp8
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderLayer.h1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog59
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro9
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp8
-rw-r--r--src/corelib/animation/qabstractanimation.cpp16
-rw-r--r--src/corelib/animation/qabstractanimation_p.h11
-rw-r--r--src/corelib/global/qglobal.h6
-rw-r--r--src/corelib/io/qiodevice.cpp4
-rw-r--r--src/corelib/io/qsettings.cpp6
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp46
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian_p.h20
-rw-r--r--src/corelib/kernel/qmetaobject_p.h11
-rw-r--r--src/corelib/thread/qsemaphore.cpp7
-rw-r--r--src/corelib/tools/qbytearray.cpp5
-rw-r--r--src/corelib/tools/qsimd_p.h3
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp12
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp22
-rw-r--r--src/declarative/qml/qdeclarativeexpression.cpp8
-rw-r--r--src/declarative/qml/qdeclarativeglobalscriptclass.cpp39
-rw-r--r--src/declarative/qml/qdeclarativeglobalscriptclass_p.h4
-rw-r--r--src/declarative/qml/qdeclarativeinclude.cpp2
-rw-r--r--src/gui/accessible/qaccessible_mac_cocoa.mm4
-rw-r--r--src/gui/effects/qgraphicseffect.cpp9
-rw-r--r--src/gui/egl/qegl_x11.cpp5
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp8
-rw-r--r--src/gui/graphicsview/qgraphicsitem.h3
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h6
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp2
-rw-r--r--src/gui/image/qpixmap.cpp23
-rw-r--r--src/gui/image/qpixmap.h2
-rw-r--r--src/gui/image/qpixmap_raster.cpp11
-rw-r--r--src/gui/image/qpixmap_raster_p.h1
-rw-r--r--src/gui/image/qpixmapdata.cpp7
-rw-r--r--src/gui/image/qpixmapdata_p.h4
-rw-r--r--src/gui/kernel/qapplication_win.cpp23
-rw-r--r--src/gui/kernel/qapplication_x11.cpp2
-rw-r--r--src/gui/kernel/qkeymapper_mac.cpp15
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac.mm7
-rw-r--r--src/gui/kernel/qwidget_mac.mm2
-rw-r--r--src/gui/kernel/qwidget_s60.cpp3
-rw-r--r--src/gui/painting/qdrawhelper_sse2.cpp2
-rw-r--r--src/gui/painting/qgraphicssystem.cpp4
-rw-r--r--src/gui/painting/qgraphicssystem_p.h1
-rw-r--r--src/gui/painting/qgraphicssystem_runtime.cpp2
-rw-r--r--src/gui/painting/qpainter.cpp2
-rw-r--r--src/gui/painting/qpathclipper.cpp48
-rw-r--r--src/gui/painting/qpathclipper_p.h4
-rw-r--r--src/gui/styles/qs60style_s60.cpp14
-rw-r--r--src/gui/text/qfontdatabase.cpp2
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp2
-rw-r--r--src/gui/text/qtextengine.cpp4
-rw-r--r--src/gui/text/qtextengine_p.h2
-rw-r--r--src/gui/widgets/qcommandlinkbutton.cpp18
-rw-r--r--src/gui/widgets/qmenubar.cpp2
-rw-r--r--src/multimedia/audio/qaudio_mac.cpp9
-rw-r--r--src/multimedia/audio/qaudioinput_mac_p.cpp49
-rw-r--r--src/multimedia/audio/qaudiooutput_mac_p.cpp15
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp14
-rw-r--r--src/network/ssl/qsslsocket.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp66
-rw-r--r--src/network/ssl/qsslsocket_p.h12
-rw-r--r--src/opengl/qgl.cpp63
-rw-r--r--src/opengl/qgl.h7
-rw-r--r--src/opengl/qgl_egl.cpp2
-rw-r--r--src/opengl/qgl_p.h4
-rw-r--r--src/opengl/qpixmapdata_gl_p.h2
-rw-r--r--src/opengl/qwindowsurface_gl_p.h2
-rw-r--r--src/plugins/bearer/icd/qnetworksession_impl.cpp55
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.cpp330
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.h8
-rw-r--r--src/plugins/bearer/symbian/symbianengine.cpp361
-rw-r--r--src/plugins/bearer/symbian/symbianengine.h12
-rw-r--r--src/plugins/codecs/cn/qgb18030codec.cpp21
-rw-r--r--src/plugins/phonon/mmf/mmf.pro250
-rw-r--r--src/s60installs/bwins/QtCoreu.def2
-rw-r--r--src/s60installs/bwins/QtDeclarativeu.def4
-rw-r--r--src/s60installs/bwins/QtGuiu.def4
-rw-r--r--src/s60installs/eabi/QtCoreu.def2
-rw-r--r--src/s60installs/eabi/QtDeclarativeu.def5
-rw-r--r--src/s60installs/eabi/QtGuiu.def8
-rw-r--r--src/s60installs/eabi/QtScriptu.def2
-rw-r--r--src/s60installs/s60installs.pro7
-rw-r--r--src/s60main/s60main.pro4
-rw-r--r--src/script/api/qscriptengine.cpp59
-rw-r--r--src/script/api/qscriptengine_p.h25
-rw-r--r--src/script/bridge/bridge.pri2
-rw-r--r--src/script/bridge/qscriptdeclarativeclass.cpp36
-rw-r--r--src/script/bridge/qscriptdeclarativeclass_p.h5
-rw-r--r--src/script/bridge/qscriptstaticscopeobject.cpp157
-rw-r--r--src/script/bridge/qscriptstaticscopeobject_p.h103
-rw-r--r--src/script/script.pri1
-rw-r--r--src/script/utils/qscriptdate.cpp365
-rw-r--r--src/script/utils/qscriptdate_p.h52
-rw-r--r--src/script/utils/utils.pri5
-rw-r--r--tests/auto/checkxmlfiles/checkxmlfiles.pro2
-rw-r--r--tests/auto/corelib.pro7
-rw-r--r--tests/auto/gui.pro8
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt3
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result12
-rwxr-xr-xtests/auto/mediaobject/mediaobject.pro2
-rw-r--r--tests/auto/moc/tst_moc.cpp19
-rw-r--r--tests/auto/networkselftest/networkselftest.pro2
-rw-r--r--tests/auto/patternistexamples/patternistexamples.pro2
-rw-r--r--tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro5
-rw-r--r--tests/auto/qapplication/test/test.pro2
-rw-r--r--tests/auto/qaudiooutput/qaudiooutput.pro2
-rw-r--r--tests/auto/qbearertestcommon.h2
-rw-r--r--tests/auto/qchar/qchar.pro4
-rw-r--r--tests/auto/qclipboard/test/test.pro4
-rw-r--r--tests/auto/qcryptographichash/qcryptographichash.pro4
-rw-r--r--tests/auto/qdiriterator/qdiriterator.pro2
-rw-r--r--tests/auto/qdom/qdom.pro2
-rw-r--r--tests/auto/qfile/qfile.pro2
-rw-r--r--tests/auto/qfileinfo/qfileinfo.pro2
-rw-r--r--tests/auto/qftp/qftp.pro2
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp54
-rw-r--r--tests/auto/qgraphicsscene/qgraphicsscene.pro4
-rw-r--r--tests/auto/qhash/qhash.pro4
-rw-r--r--tests/auto/qhttp/qhttp.pro2
-rw-r--r--tests/auto/qicoimageformat/qicoimageformat.pro2
-rw-r--r--tests/auto/qimage/qimage.pro2
-rw-r--r--tests/auto/qimagereader/qimagereader.pro2
-rw-r--r--tests/auto/qimagewriter/qimagewriter.pro2
-rw-r--r--tests/auto/qitemmodel/qitemmodel.pro2
-rw-r--r--tests/auto/qlayout/qlayout.pro2
-rw-r--r--tests/auto/qlibrary/tst/tst.pro2
-rw-r--r--tests/auto/qline/qline.pro2
-rw-r--r--tests/auto/qlocalsocket/qlocalsocket.pro2
-rw-r--r--tests/auto/qmenubar/qmenubar.pro2
-rw-r--r--tests/auto/qmenubar/tst_qmenubar.cpp29
-rw-r--r--tests/auto/qmetaobject/tst_qmetaobject.cpp2
-rw-r--r--tests/auto/qmovie/qmovie.pro2
-rw-r--r--tests/auto/qnetworksession/test/tst_qnetworksession.cpp123
-rw-r--r--tests/auto/qpainter/qpainter.pro2
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp16
-rw-r--r--tests/auto/qpathclipper/qpathclipper.pro2
-rw-r--r--tests/auto/qpixmap/loadFromData/designer_indexed8_with_alpha_animated.gifbin0 -> 4138 bytes
-rw-r--r--tests/auto/qpixmap/qpixmap.pro4
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp61
-rw-r--r--tests/auto/qprocess/testDetached/testDetached.pro2
-rw-r--r--tests/auto/qresourceengine/qresourceengine.pro2
-rw-r--r--tests/auto/qscriptengine/qscriptengine.pro2
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp242
-rw-r--r--tests/auto/qsemaphore/tst_qsemaphore.cpp49
-rw-r--r--tests/auto/qset/qset.pro4
-rw-r--r--tests/auto/qsound/qsound.pro2
-rw-r--r--tests/auto/qsplitter/qsplitter.pro2
-rw-r--r--tests/auto/qstyle/qstyle.pro2
-rw-r--r--tests/auto/qtcpsocket/qtcpsocket.pro2
-rw-r--r--tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro2
-rw-r--r--tests/auto/qtextbrowser/qtextbrowser.pro4
-rw-r--r--tests/auto/qtextedit/qtextedit.pro2
-rw-r--r--tests/auto/qthread/qthread.pro2
-rw-r--r--tests/auto/qthreadstorage/qthreadstorage.pro2
-rw-r--r--tests/auto/qtipc/qsharedmemory/test/test.pro2
-rw-r--r--tests/auto/qtransform/qtransform.pro2
-rw-r--r--tests/auto/qtranslator/qtranslator.pro2
-rw-r--r--tests/auto/qtwidgets/qtwidgets.pro2
-rw-r--r--tests/auto/qudpsocket/test/test.pro2
-rw-r--r--tests/auto/qwmatrix/qwmatrix.pro2
-rw-r--r--tests/auto/qxml/qxml.pro2
-rw-r--r--tests/auto/qxmlformatter/qxmlformatter.pro2
-rw-r--r--tests/auto/qxmlquery/qxmlquery.pro2
-rw-r--r--tests/auto/qxmlsimplereader/qxmlsimplereader.pro2
-rw-r--r--tests/auto/qxmlstream/qxmlstream.pro2
-rw-r--r--tests/benchmarks/opengl/main.cpp51
-rw-r--r--tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp52
-rw-r--r--tests/manual/bearerex/bearerex.cpp91
-rw-r--r--tests/manual/bearerex/bearerex.h15
-rw-r--r--tests/manual/bearerex/bearerex.pro6
-rw-r--r--tests/manual/bearerex/datatransferer.cpp220
-rw-r--r--tests/manual/bearerex/datatransferer.h130
-rw-r--r--tests/manual/bearerex/main.cpp2
-rw-r--r--tests/manual/bearerex/sessiondialog.ui168
-rw-r--r--tests/manual/bearerex/xqlistwidget.cpp2
-rw-r--r--tests/manual/bearerex/xqlistwidget.h2
-rw-r--r--tests/manual/qtabletevent/regular_widgets/main.cpp150
-rw-r--r--tests/manual/qtabletevent/regular_widgets/regular_widgets.pro3
-rw-r--r--tools/linguist/lupdate/cpp.cpp16
-rw-r--r--tools/qdoc3/codechunk.h2
-rw-r--r--tools/qdoc3/codemarker.cpp12
-rw-r--r--tools/qdoc3/cppcodeparser.cpp39
-rw-r--r--tools/qdoc3/ditaxmlgenerator.cpp231
-rw-r--r--tools/qdoc3/ditaxmlgenerator.h7
-rw-r--r--tools/qdoc3/htmlgenerator.cpp10
-rw-r--r--tools/qdoc3/node.cpp52
-rw-r--r--tools/qdoc3/node.h161
-rw-r--r--tools/qdoc3/pagegenerator.cpp3
-rw-r--r--tools/qdoc3/test/qt-build-docs.qdocconf76
-rw-r--r--tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf67
-rw-r--r--tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf14
-rw-r--r--tools/qdoc3/test/qt-html-templates.qdocconf6
-rw-r--r--tools/qdoc3/tree.cpp10
263 files changed, 4239 insertions, 1771 deletions
diff --git a/.gitignore b/.gitignore
index f187b23..fdb6843 100644
--- a/.gitignore
+++ b/.gitignore
@@ -134,6 +134,7 @@ qrc_*.cpp
*.ncb
*.vcxproj
*.vcxproj.filters
+*.vcxproj.user
# MinGW generated files
*.Debug
diff --git a/bin/elf2e32_qtwrapper b/bin/elf2e32_qtwrapper
new file mode 100755
index 0000000..694d54a
--- /dev/null
+++ b/bin/elf2e32_qtwrapper
@@ -0,0 +1,145 @@
+#!/usr/bin/perl -w
+
+# A script to get around some shortcomings in elf2e32, namely:
+# - Returning 0 even when there are errors.
+# - Excluding symbols from the dso file even when they are present in the ELF file.
+# - Including symbols in the the dso file even when they are not present in the ELF file.
+# - Overwriting the old dso file even when there are no changes (increases build time).
+
+use File::Copy;
+
+my @args = ();
+my @definput;
+my @defoutput;
+my @dso;
+my @tmpdso;
+foreach (@ARGV) {
+ if (/^--definput/o) {
+ @definput = split('=', $_);
+ } elsif (/^--defoutput/o) {
+ @defoutput = split('=', $_);
+ } elsif (/^--dso/o) {
+ @dso = split('=', $_);
+ } elsif (/^--tmpdso/o) {
+ @tmpdso = split('=', $_);
+ $tmpdso[0] = "--dso";
+ } else {
+ push(@args, $_);
+ }
+}
+
+@definput = () if (!@definput || ! -e $definput[1]);
+
+if (@dso && !@tmpdso || !@dso && @tmpdso) {
+ print("--dso and --tmpdso must be used together.\n");
+ exit 1;
+}
+
+my $buildingLibrary = (@defoutput && @dso) ? 1 : 0;
+
+my $fixupFile = "";
+my $runCount = 0;
+my $returnCode = 0;
+
+while (1) {
+ if (++$runCount > 2) {
+ print("Internal error in $0, link succeeded, but exports may be wrong.\n");
+ last;
+ }
+
+ my $elf2e32Pipe;
+ my $elf2e32Cmd = "elf2e32 @args"
+ . " " . join("=", @definput)
+ . " " . join("=", @defoutput)
+ . " " . join("=", @tmpdso);
+ open($elf2e32Pipe, "$elf2e32Cmd 2>&1 |") or die ("Could not run elf2e32");
+
+ my %fixupSymbols;
+ my $foundBrokenSymbols = 0;
+ my $errors = 0;
+ while (<$elf2e32Pipe>) {
+ print;
+ if (/Error:/io) {
+ $errors = 1;
+ } elsif (/symbol ([a-z0-9_]+) absent in the DEF file, but present in the ELF file/io) {
+ $fixupSymbols{$1} = 1;
+ $foundBrokenSymbols = 1;
+ } elsif (/[0-9]+ Frozen Export\(s\) missing from the ELF file/io) {
+ $foundBrokenSymbols = 1;
+ }
+ }
+ close($elf2e32Pipe);
+
+ if ($errors) {
+ $returnCode = 1;
+ last;
+ }
+
+ if ($buildingLibrary) {
+ my $tmpDefFile;
+ my $defFile;
+ open($defFile, "< $defoutput[1]") or die("Could not open $defoutput[1]");
+ open($tmpDefFile, "> $defoutput[1].tmp") or die("Could not open $defoutput[1].tmp");
+ $fixupFile = "$defoutput[1].tmp";
+ while (<$defFile>) {
+ s/\r//;
+ s/\n//;
+ next if (/; NEW:/);
+ if (/([a-z0-9_]+) @/i) {
+ if (exists($fixupSymbols{$1})) {
+ s/ ABSENT//;
+ } elsif (s/; MISSING://) {
+ s/$/ ABSENT/;
+ }
+ }
+ print($tmpDefFile "$_\n");
+ }
+ close($defFile);
+ close($tmpDefFile);
+
+ $definput[1] = "$defoutput[1].tmp";
+
+ if (!$foundBrokenSymbols || $errors) {
+ last;
+ }
+
+ print("Rerunning elf2e32 due to DEF file / ELF file mismatch\n");
+ } else {
+ last;
+ }
+};
+
+if ($fixupFile) {
+ unlink($defoutput[1]);
+ move($fixupFile, $defoutput[1]);
+}
+
+exit $returnCode if ($returnCode != 0);
+
+if ($buildingLibrary) {
+ my $differenceFound = 0;
+
+ if (-e $dso[1]) {
+ my $dsoFile;
+ my $tmpdsoFile;
+ my $dsoBuf;
+ my $tmpdsoBuf;
+ open($dsoFile, "< $dso[1]") or die("Could not open $dso[1]");
+ open($tmpdsoFile, "< $tmpdso[1]") or die("Could not open $tmpdso[1]");
+ binmode($dsoFile);
+ binmode($tmpdsoFile);
+ while(read($dsoFile, $dsoBuf, 4096) && read($tmpdsoFile, $tmpdsoBuf, 4096)) {
+ if ($dsoBuf ne $tmpdsoBuf) {
+ $differenceFound = 1;
+ }
+ }
+ close($tmpdsoFile);
+ close($dsoFile);
+ } else {
+ $differenceFound = 1;
+ }
+
+ if ($differenceFound) {
+ copy($tmpdso[1], $dso[1]);
+ }
+}
diff --git a/bin/syncqt b/bin/syncqt
index f499bbc..11b1d72 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -834,12 +834,12 @@ foreach (@modules_to_sync) {
# write forwarding headers to include/Qt
if ("$lib" ne "phonon" && "$subdir" =~ /^$basedir\/src/) {
my $file_name = "$out_basedir/include/Qt/$header";
+ my $file_op = '>';
my $header_content = '';
if (exists $colliding_headers{$file_name}) {
- $file_name = ">>$file_name";
+ $file_op = '>>';
} else {
$colliding_headers{$file_name} = 1;
- $file_name = ">$file_name";
my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.';
$header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" .
" #if defined(__GNUC__)\n" .
@@ -850,7 +850,7 @@ foreach (@modules_to_sync) {
"#endif\n\n";
}
$header_content .= '#include "' . "../$lib/$header" . "\"\n";
- open HEADERFILE, $file_name;
+ open HEADERFILE, $file_op, $file_name or die "unable to open '$file_name' : $!\n";
print HEADERFILE $header_content;
close HEADERFILE;
}
diff --git a/config.tests/mac/corewlan/corewlantest.mm b/config.tests/mac/corewlan/corewlantest.mm
index 3a29d84..ee6f661 100644
--- a/config.tests/mac/corewlan/corewlantest.mm
+++ b/config.tests/mac/corewlan/corewlantest.mm
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/configure b/configure
index 5d97405..7f6d43b 100755
--- a/configure
+++ b/configure
@@ -2340,7 +2340,7 @@ if [ "$OPT_SHADOW" = "yes" ]; then
chmod 755 "$outpath/bin/syncqt"
fi
- for i in createpackage patch_capabilities; do
+ for i in elf2e32_qtwrapper createpackage patch_capabilities; do
rm -f "$outpath/bin/$i"
if [ -x "$relpath/bin/$i" ]; then
mkdir -p "$outpath/bin"
diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro
index 416e58b..ca74c38 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.pro
+++ b/demos/embedded/fluidlauncher/fluidlauncher.pro
@@ -118,7 +118,7 @@ symbian {
}
contains(QT_CONFIG, multimedia) {
- reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/spectrum_reg.rsc
+ reg_resource.sources += $$regResourceDir(demos/spectrum/app/spectrum_reg.rsc)
}
@@ -202,10 +202,11 @@ symbian {
}
contains(QT_CONFIG, multimedia) {
- executables.sources += spectrum.exe fftreal.dll
- resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/spectrum.rsc
+ executables.sources += $$QT_BUILD_TREE/demos/spectrum/app/spectrum.exe
+ executables.sources += $$QT_BUILD_TREE/demos/spectrum/3rdparty/fftreal/fftreal.dll
+ resource.sources += $$appResourceDir(demos/spectrum/app/spectrum.rsc)
mifs.sources += \
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/spectrum.mif
+ $$appResourceDir(demos/spectrum/app/spectrum.mif)
}
contains(QT_CONFIG, script) {
diff --git a/demos/embedded/qmlcalculator/deployment.pri b/demos/embedded/qmlcalculator/deployment.pri
index a0bfbb6..53c6dbf 100644
--- a/demos/embedded/qmlcalculator/deployment.pri
+++ b/demos/embedded/qmlcalculator/deployment.pri
@@ -1,7 +1,7 @@
qmlcalculator_src = $$PWD/../../declarative/calculator
symbian {
qmlcalculator_uid3 = A000E3FB
- qmlcalculator_files.path = ../$$qmlcalculator_uid3
+ qmlcalculator_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlcalculator_uid3
}
qmlcalculator_files.sources = $$qmlcalculator_src/calculator.qml $$qmlcalculator_src/Core
DEPLOYMENT += qmlcalculator_files
diff --git a/demos/embedded/qmlclocks/deployment.pri b/demos/embedded/qmlclocks/deployment.pri
index a30e403..03ba129 100644
--- a/demos/embedded/qmlclocks/deployment.pri
+++ b/demos/embedded/qmlclocks/deployment.pri
@@ -1,7 +1,7 @@
qmlclocks_src = $$PWD/../../../examples/declarative/toys/clocks
symbian {
qmlclocks_uid3 = A000E3FC
- qmlclocks_files.path = ../$$qmlclocks_uid3
+ qmlclocks_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlclocks_uid3
}
qmlclocks_files.sources = $$qmlclocks_src/clocks.qml $$qmlclocks_src/content
DEPLOYMENT += qmlclocks_files
diff --git a/demos/embedded/qmldialcontrol/deployment.pri b/demos/embedded/qmldialcontrol/deployment.pri
index c04ed05..097c74c 100644
--- a/demos/embedded/qmldialcontrol/deployment.pri
+++ b/demos/embedded/qmldialcontrol/deployment.pri
@@ -1,7 +1,7 @@
qmldialcontrol_src = $$PWD/../../../examples/declarative/ui-components/dialcontrol
symbian {
qmldialcontrol_uid3 = A000E3FD
- qmldialcontrol_files.path = ../$$qmldialcontrol_uid3
+ qmldialcontrol_files.path = $$APP_PRIVATE_DIR_BASE/$$qmldialcontrol_uid3
}
qmldialcontrol_files.sources = $$qmldialcontrol_src/dialcontrol.qml $$qmldialcontrol_src/content
DEPLOYMENT += qmldialcontrol_files
diff --git a/demos/embedded/qmleasing/deployment.pri b/demos/embedded/qmleasing/deployment.pri
index bc37348..47192e6 100644
--- a/demos/embedded/qmleasing/deployment.pri
+++ b/demos/embedded/qmleasing/deployment.pri
@@ -1,7 +1,7 @@
qmleasing_src = $$PWD/../../../examples/declarative/animation/easing
symbian {
qmleasing_uid3 = A000E3FE
- qmleasing_files.path = ../$$qmleasing_uid3
+ qmleasing_files.path = $$APP_PRIVATE_DIR_BASE/$$qmleasing_uid3
}
qmleasing_files.sources = $$qmleasing_src/easing.qml
DEPLOYMENT += qmleasing_files
diff --git a/demos/embedded/qmlflickr/deployment.pri b/demos/embedded/qmlflickr/deployment.pri
index c1f82df..c8fef1a 100644
--- a/demos/embedded/qmlflickr/deployment.pri
+++ b/demos/embedded/qmlflickr/deployment.pri
@@ -1,7 +1,7 @@
qmlflickr_src = $$PWD/../../declarative/flickr
symbian {
qmlflickr_uid3 = A000E3FF
- qmlflickr_files.path = ../$$qmlflickr_uid3
+ qmlflickr_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlflickr_uid3
}
qmlflickr_files.sources = $$qmlflickr_src/flickr.qml $$qmlflickr_src/common $$qmlflickr_src/mobile
DEPLOYMENT += qmlflickr_files
diff --git a/demos/embedded/qmlphotoviewer/deployment.pri b/demos/embedded/qmlphotoviewer/deployment.pri
index 0a457de..128a1f7 100644
--- a/demos/embedded/qmlphotoviewer/deployment.pri
+++ b/demos/embedded/qmlphotoviewer/deployment.pri
@@ -1,7 +1,7 @@
qmlphotoviewer_src = $$PWD/../../declarative/photoviewer
symbian {
qmlphotoviewer_uid3 = A000E400
- qmlphotoviewer_files.path = ../$$qmlphotoviewer_uid3
+ qmlphotoviewer_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlphotoviewer_uid3
}
qmlphotoviewer_files.sources = $$qmlphotoviewer_src/photoviewer.qml $$qmlphotoviewer_src/PhotoViewerCore
DEPLOYMENT += qmlphotoviewer_files
diff --git a/demos/embedded/qmltwitter/deployment.pri b/demos/embedded/qmltwitter/deployment.pri
index 34c8cd1..40c53ad 100644
--- a/demos/embedded/qmltwitter/deployment.pri
+++ b/demos/embedded/qmltwitter/deployment.pri
@@ -1,7 +1,7 @@
qmltwitter_src = $$PWD/../../declarative/twitter
symbian {
qmltwitter_uid3 = A000E401
- qmltwitter_files.path = ../$$qmltwitter_uid3
+ qmltwitter_files.path = $$APP_PRIVATE_DIR_BASE/$$qmltwitter_uid3
}
qmltwitter_files.sources = $$qmltwitter_src/twitter.qml $$qmltwitter_src/TwitterCore
DEPLOYMENT += qmltwitter_files
diff --git a/demos/spectrum/3rdparty/fftreal/fftreal.pro b/demos/spectrum/3rdparty/fftreal/fftreal.pro
index 8d9f46e..6801b42 100644
--- a/demos/spectrum/3rdparty/fftreal/fftreal.pro
+++ b/demos/spectrum/3rdparty/fftreal/fftreal.pro
@@ -29,7 +29,7 @@ DEFINES += FFTREAL_LIBRARY
symbian {
# Provide unique ID for the generated binary, required by Symbian OS
- TARGET.UID3 = 0xA000E3FB
+ TARGET.UID3 = 0xA000E403
TARGET.CAPABILITY = UserEnvironment
} else {
macx {
diff --git a/demos/spectrum/app/app.pro b/demos/spectrum/app/app.pro
index c4b0943..c15edf9 100644
--- a/demos/spectrum/app/app.pro
+++ b/demos/spectrum/app/app.pro
@@ -48,7 +48,7 @@ symbian {
TARGET.CAPABILITY = UserEnvironment
# Provide unique ID for the generated binary, required by Symbian OS
- TARGET.UID3 = 0xA000E3FA
+ TARGET.UID3 = 0xA000E402
}
diff --git a/demos/spectrum/spectrum.pro b/demos/spectrum/spectrum.pro
index d5a07f7..df14a7d 100644
--- a/demos/spectrum/spectrum.pro
+++ b/demos/spectrum/spectrum.pro
@@ -19,7 +19,7 @@ symbian {
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
# UID for the SIS file
- TARGET.UID3 = 0xA000E3FA
+ TARGET.UID3 = 0xA000E402
}
sources.files = README.txt spectrum.pri spectrum.pro TODO.txt
diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc
index 734175c..159f40d 100644
--- a/doc/src/declarative/basictypes.qdoc
+++ b/doc/src/declarative/basictypes.qdoc
@@ -157,8 +157,8 @@
Rectangle { color: "#800000FF" }
\endqml
- Or with the \l{Qt::rgba()}{Qt.rgba()}, \l{Qt::hsla()}{Qt.hsla()}, \l{Qt::darker()}{Qt.darker()},
- \l{Qt::lighter()}{Qt.lighter()} or \l{Qt::tint()}{Qt.tint()} functions:
+ Or with the \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()},
+ \l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()} functions:
\qml
Rectangle { color: Qt.rgba(255, 0, 0, 1) }
@@ -181,7 +181,7 @@
CustomObject { myPointProperty: "0,20" }
\endqml
- Or use the \l{Qt::point()}{Qt.point()} function:
+ Or use the \l{QML:Qt::point()}{Qt.point()} function:
\qml
CustomObject { myPointProperty: Qt.point(0, 20) }
@@ -213,7 +213,7 @@
LayoutItem { preferredSize: "150x50" }
\endqml
- Or use the \l{Qt::size()}{Qt.size()} function:
+ Or use the \l{QML:Qt::size()}{Qt.size()} function:
\qml
LayoutItem { preferredSize: Qt.size(150, 50) }
@@ -246,7 +246,7 @@
CustomObject { myRectProperty: "50,50,100x100" }
\endqml
- Or use the \l{Qt::rect()}{Qt.rect()} function:
+ Or use the \l{QML:Qt::rect()}{Qt.rect()} function:
\qml
CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
@@ -269,7 +269,7 @@
\endqml
To read a date value returned from a C++ extension class, use
- \l{Qt::formatDate()}{Qt.formatDate()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}.
+ \l{QML:Qt::formatDate()}{Qt.formatDate()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
\sa {QML Basic Types}
*/
@@ -288,7 +288,7 @@
\endqml
To read a time value returned from a C++ extension class, use
- \l{Qt::formatTime()}{Qt.formatTime()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}.
+ \l{QML:Qt::formatTime()}{Qt.formatTime()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
\sa {QML Basic Types}
*/
@@ -386,7 +386,7 @@
Rotation { angle: 60; axis: "0,1,0" }
\endqml
- or with the \l{Qt::vector3d()}{Qt.vector3d()} function:
+ or with the \l{QML:Qt::vector3d()}{Qt.vector3d()} function:
\qml
Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }
diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc
index 0ffdbc9..de65a12 100644
--- a/doc/src/declarative/dynamicobjects.qdoc
+++ b/doc/src/declarative/dynamicobjects.qdoc
@@ -42,15 +42,15 @@ application, and there are no C++ components involved.
\section1 Creating Objects Dynamically
There are two ways to create objects dynamically from JavaScript. You can either call
-\l {Qt::createComponent()}{Qt.createComponent()} to create
-a component which instantiates items, or use \l{Qt::createQmlObject()}{Qt.createQmlObject()}
+\l {QML:Qt::createComponent()}{Qt.createComponent()} to create
+a component which instantiates items, or use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
to create an item from a string of QML.
Creating a component is better if you have a predefined
item, and you want to create dynamic instances of that item; creating an item from
a string of QML is useful when the item QML itself is generated at runtime.
If you have a component specified in a QML file, you can dynamically load it with
-the \l {Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}.
+the \l {QML:Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}.
This function takes the URL of the QML file as its only argument and returns
a component object which can be used to create and load that QML file.
@@ -84,10 +84,10 @@ in \c main.qml). After creating an item, you must set its parent to an item with
Otherwise your dynamically created item will not appear in the scene.
When using files with relative paths, the path should
-be relative to the file where \l {Qt::createComponent()}{Qt.createComponent()} is executed.
+be relative to the file where \l {QML:Qt::createComponent()}{Qt.createComponent()} is executed.
If the QML component does not exist until runtime, you can create a QML item from
-a string of QML using the \l{Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example:
+a string of QML using the \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example:
\snippet doc/src/snippets/declarative/createQmlObject.qml 0
@@ -107,9 +107,9 @@ the bindings in the dynamic item will no longer work.
The actual creation context depends on how an item is created:
\list
-\o If \l {Qt::createComponent()}{Qt.createComponent()} is used, the creation context
+\o If \l {QML:Qt::createComponent()}{Qt.createComponent()} is used, the creation context
is the QDeclarativeContext in which this method is called
-\o If \l{Qt::createQmlObject()}{Qt.createQmlObject()}
+\o If \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
if called, it is the context of the item used as the second argument to this method
\o If a \c {Component{}} item is defined and \l {Component::createObject()}{createObject()}
is called on that item, it is the context in which the \c Component is defined
diff --git a/doc/src/scripting/ecmascript.qdoc b/doc/src/scripting/ecmascript.qdoc
index 4497a0b..508bf3b 100644
--- a/doc/src/scripting/ecmascript.qdoc
+++ b/doc/src/scripting/ecmascript.qdoc
@@ -30,8 +30,9 @@
\title ECMAScript Reference
\brief A list of objects, functions and properties supported by QtScript.
- This reference contains a list of objects, functions and
- properties supported by QtScript.
+ This reference contains a list of built-in objects, functions and
+ properties supported by QtScript. For a detailed description, see
+ the \l{ECMA-262} specification.
\tableofcontents
@@ -43,7 +44,6 @@
\o NaN
\o Infinity
\o undefined
- \o Math
\endlist
\section2 Function Properties
@@ -80,10 +80,33 @@
\o URIError
\endlist
+ \section2 Other Properties
+
+ \list
+ \o Math
+ \o JSON
+ \endlist
+
\section1 Object Objects
+ \section2 Object Constructor
+
+ \section3 Function Properties
+
+ \list
+ \o getPrototypeOf(O)
+ \o getOwnPropertyDescriptor(O, P)
+ \o getOwnPropertyNames(O)
+ \o create(O [, Properties])
+ \o defineProperty(O, P, Attributes)
+ \o defineProperties(O, Properties)
+ \o keys(O)
+ \endlist
+
\section2 Object Prototype Object
+ \section3 Function Properties
+
\list
\o toString()
\o toLocaleString()
@@ -124,6 +147,15 @@
\o sort(comparefn)
\o splice(start, deleteCount[, item1 [, item2 [, ...]]])
\o unshift([item1 [, item2 [, ...]]])
+ \o indexOf(searchElement [, fromIndex])
+ \o lastIndexOf(searchElement [, fromIndex])
+ \o every(callbackfn [, thisArg])
+ \o some(callbackfn [, thisArg])
+ \o forEach(callbackfn [, thisArg])
+ \o map(callbackfn [, thisArg])
+ \o filter(callbackfn [, thisArg])
+ \o reduce(callbackfn [, initialValue])
+ \o reduceRight(callbackfn [, initialValue])
\endlist
\section1 String Objects
@@ -151,6 +183,7 @@
\o toLocaleLowerCase()
\o toUpperCase()
\o toLocaleUpperCase()
+ \o trim()
\endlist
\section1 Boolean Objects
@@ -264,6 +297,8 @@
\o setFullYear(year [, month [, date]])
\o setUTCFullYear(year [, month [, date]])
\o toUTCString()
+ \o toISOString()
+ \o toJSON()
\endlist
\section1 RegExp Objects
@@ -295,4 +330,13 @@
\o toString()
\endlist
+ \section1 The JSON Object
+
+ \section2 Function Properties
+
+ \list
+ \o parse(text [, reviver])
+ \o stringify(value [, replacer [, space]])
+ \endlist
+
*/
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.pro b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
index c7e7843..7149986 100644
--- a/examples/declarative/cppextensions/imageprovider/imageprovider.pro
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
@@ -22,7 +22,7 @@ symbian:{
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
TARGET.EPOCALLOWDLLDATA = 1
- importFiles.sources = qmlimageproviderplugin.dll ImageProviderCore/qmldir
+ importFiles.sources = ImageProviderCore/qmlimageproviderplugin.dll ImageProviderCore/qmldir
importFiles.path = ImageProviderCore
DEPLOYMENT = importFiles
}
diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.pro b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
index 3ec7d29..2e610f9 100644
--- a/examples/declarative/cppextensions/qwidgets/qwidgets.pro
+++ b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
@@ -17,7 +17,7 @@ symbian:{
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
TARGET.EPOCALLOWDLLDATA = 1
- importFiles.sources = qmlqwidgetsplugin.dll QWidgets/qmldir
+ importFiles.sources = QWidgets/qmlqwidgetsplugin.dll QWidgets/qmldir
importFiles.path = QWidgets
DEPLOYMENT = importFiles
diff --git a/examples/network/bearercloud/bearercloud.cpp b/examples/network/bearercloud/bearercloud.cpp
index 9e58c73..cc73954 100644
--- a/examples/network/bearercloud/bearercloud.cpp
+++ b/examples/network/bearercloud/bearercloud.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/bearercloud/main.cpp b/examples/network/bearercloud/main.cpp
index c0c0023..6665311 100644
--- a/examples/network/bearercloud/main.cpp
+++ b/examples/network/bearercloud/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp
index 4a04b4c..98869ea 100644
--- a/examples/network/bearermonitor/bearermonitor.cpp
+++ b/examples/network/bearermonitor/bearermonitor.cpp
@@ -80,7 +80,7 @@ BearerMonitor::BearerMonitor(QWidget *parent)
break;
}
}
-
+ connect(&manager, SIGNAL(onlineStateChanged(bool)), this ,SLOT(onlineStateChanged(bool)));
connect(&manager, SIGNAL(configurationAdded(const QNetworkConfiguration&)),
this, SLOT(configurationAdded(const QNetworkConfiguration&)));
connect(&manager, SIGNAL(configurationRemoved(const QNetworkConfiguration&)),
@@ -88,7 +88,6 @@ BearerMonitor::BearerMonitor(QWidget *parent)
connect(&manager, SIGNAL(configurationChanged(const QNetworkConfiguration&)),
this, SLOT(configurationChanged(const QNetworkConfiguration)));
connect(&manager, SIGNAL(updateCompleted()), this, SLOT(updateConfigurations()));
- connect(&manager, SIGNAL(onlineStateChanged(bool)), this ,SLOT(onlineStateChanged(bool)));
#ifdef Q_OS_WIN
connect(registerButton, SIGNAL(clicked()), this, SLOT(registerNetwork()));
@@ -111,6 +110,10 @@ BearerMonitor::BearerMonitor(QWidget *parent)
#endif
connect(scanButton, SIGNAL(clicked()),
this, SLOT(performScan()));
+
+ // Just in case update all configurations so that all
+ // configurations are up to date.
+ manager.updateConfigurations();
}
BearerMonitor::~BearerMonitor()
@@ -209,6 +212,10 @@ void BearerMonitor::updateConfigurations()
progressBar->hide();
scanButton->show();
+ // Just in case update online state, on Symbian platform
+ // WLAN scan needs to be triggered initially to have their true state.
+ onlineStateChanged(manager.isOnline());
+
QList<QTreeWidgetItem *> items = treeWidget->findItems(QLatin1String("*"), Qt::MatchWildcard);
QMap<QString, QTreeWidgetItem *> itemMap;
while (!items.isEmpty()) {
diff --git a/examples/network/bearermonitor/bearermonitor_240_320.ui b/examples/network/bearermonitor/bearermonitor_240_320.ui
index ce9c2d1..93cfc5e 100644
--- a/examples/network/bearermonitor/bearermonitor_240_320.ui
+++ b/examples/network/bearermonitor/bearermonitor_240_320.ui
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
- <string>Form</string>
+ <string>BearerMonitor</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
diff --git a/examples/network/bearermonitor/bearermonitor_640_480.ui b/examples/network/bearermonitor/bearermonitor_640_480.ui
index 941eaa0..52866bc 100644
--- a/examples/network/bearermonitor/bearermonitor_640_480.ui
+++ b/examples/network/bearermonitor/bearermonitor_640_480.ui
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
- <string>Form</string>
+ <string>BearerMonitor</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
diff --git a/examples/network/bearermonitor/bearermonitor_maemo.ui b/examples/network/bearermonitor/bearermonitor_maemo.ui
index 5f17e7d..a7940c6 100644
--- a/examples/network/bearermonitor/bearermonitor_maemo.ui
+++ b/examples/network/bearermonitor/bearermonitor_maemo.ui
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
- <string>Form</string>
+ <string>BearerMonitor</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
diff --git a/examples/network/bearermonitor/main.cpp b/examples/network/bearermonitor/main.cpp
index 0bbbb56..1a22c13 100644
--- a/examples/network/bearermonitor/main.cpp
+++ b/examples/network/bearermonitor/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/bearermonitor/sessionwidget.ui b/examples/network/bearermonitor/sessionwidget.ui
index 56a2d0e..4199109 100644
--- a/examples/network/bearermonitor/sessionwidget.ui
+++ b/examples/network/bearermonitor/sessionwidget.ui
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
- <string>Form</string>
+ <string>Session Details</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
diff --git a/examples/network/bearermonitor/sessionwidget_maemo.ui b/examples/network/bearermonitor/sessionwidget_maemo.ui
index 86f915c..ca68246 100644
--- a/examples/network/bearermonitor/sessionwidget_maemo.ui
+++ b/examples/network/bearermonitor/sessionwidget_maemo.ui
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
- <string>Form</string>
+ <string>Session Details</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
diff --git a/mkspecs/common/symbian/header-wrappers/AknLayoutFont.h b/mkspecs/common/symbian/header-wrappers/AknLayoutFont.h
new file mode 100644
index 0000000..b5954e1
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknLayoutFont.h
@@ -0,0 +1,2 @@
+#include <aknlayoutfont.h>
+
diff --git a/mkspecs/common/symbian/header-wrappers/AknsBasicBackgroundControlContext.h b/mkspecs/common/symbian/header-wrappers/AknsBasicBackgroundControlContext.h
new file mode 100644
index 0000000..d121122
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsBasicBackgroundControlContext.h
@@ -0,0 +1 @@
+#include <aknsbasicbackgroundcontrolcontext.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsConstants.h b/mkspecs/common/symbian/header-wrappers/AknsConstants.h
new file mode 100644
index 0000000..c262866
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsConstants.h
@@ -0,0 +1 @@
+#include <aknsconstants.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsDrawUtils.h b/mkspecs/common/symbian/header-wrappers/AknsDrawUtils.h
new file mode 100644
index 0000000..7d71624
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsDrawUtils.h
@@ -0,0 +1 @@
+#include <aknsdrawutils.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsItemID.h b/mkspecs/common/symbian/header-wrappers/AknsItemID.h
new file mode 100644
index 0000000..fe3b80e
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsItemID.h
@@ -0,0 +1 @@
+#include <aknsitemid.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsSkinInstance.h b/mkspecs/common/symbian/header-wrappers/AknsSkinInstance.h
new file mode 100644
index 0000000..4a9dcd8
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsSkinInstance.h
@@ -0,0 +1 @@
+#include <aknsskininstance.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsUtils.h b/mkspecs/common/symbian/header-wrappers/AknsUtils.h
new file mode 100644
index 0000000..1b9bece
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsUtils.h
@@ -0,0 +1 @@
+#include <aknsutils.h>
diff --git a/mkspecs/common/symbian/symbian-makefile.conf b/mkspecs/common/symbian/symbian-makefile.conf
index ab0c5b9..b1ca367 100644
--- a/mkspecs/common/symbian/symbian-makefile.conf
+++ b/mkspecs/common/symbian/symbian-makefile.conf
@@ -14,8 +14,6 @@ QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
QMAKE_ELF2E32_FLAGS = --dlldata \
- --heap=0x00020000,0x00800000 \
- --stack=0x00014000 \
--fpu=softvfp \
--unfrozen \
--compressionmethod bytepair \
diff --git a/mkspecs/features/sis_targets.prf b/mkspecs/features/sis_targets.prf
index 4207e0b..c31e38f 100644
--- a/mkspecs/features/sis_targets.prf
+++ b/mkspecs/features/sis_targets.prf
@@ -126,35 +126,38 @@ equals(GENERATE_SIS_TARGETS, true) {
}
} else {
sis_destdir = $$DESTDIR
- !isEmpty(sis_destdir):!contains(sis_destdir, "[/\\\\]$"):sis_destdir = $${sis_destdir}/
- contains(QMAKE_HOST.os, "Windows"):sis_destdir = $$replace(sis_destdir, "/", "\\")
+ isEmpty(sis_destdir):sis_destdir = .
+ baseTarget = $$basename(TARGET)
+ !equals(TARGET, "$$baseTarget"):sis_destdir = $$sis_destdir/$$dirname(TARGET)
sis_target.target = sis
- sis_target.commands = createpackage $(QT_SIS_OPTIONS) $$basename(TARGET)_template.pkg \
+ sis_target.commands = createpackage $(QT_SIS_OPTIONS) $${baseTarget}_template.pkg \
- $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)
sis_target.depends = first
unsigned_sis_target.target = unsigned_sis
- unsigned_sis_target.commands = createpackage $(QT_SIS_OPTIONS) -o $$basename(TARGET)_template.pkg
+ unsigned_sis_target.commands = createpackage $(QT_SIS_OPTIONS) -o $${baseTarget}_template.pkg
unsigned_sis_target.depends = first
- target_sis_target.target = $${sis_destdir}$${TARGET}.sis
+ target_sis_target.target = $${sis_destdir}/$${baseTarget}.sis
target_sis_target.commands = $(MAKE) -f $(MAKEFILE) sis
installer_sis_target.target = installer_sis
- installer_sis_target.commands = createpackage $(QT_SIS_OPTIONS) $$basename(TARGET)_installer.pkg - \
+ installer_sis_target.commands = createpackage $(QT_SIS_OPTIONS) $${baseTarget}_installer.pkg - \
$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)
- installer_sis_target.depends = $${sis_destdir}$${TARGET}.sis
+ installer_sis_target.depends = $${sis_destdir}/$${baseTarget}.sis
- !isEmpty(DESTDIR) {
- sis_target.commands += && $$QMAKE_MOVE $$basename(TARGET).sis $$DESTDIR
- installer_sis_target.commands += && $$QMAKE_MOVE $$basename(TARGET).sis $$DESTDIR
+ !isEmpty(sis_destdir):!equals(sis_destdir, "."):!equals(sis_destdir, "./") {
+ sis_target.commands += && $$QMAKE_MOVE $${baseTarget}.sis $$sis_destdir
+ installer_sis_target.commands += && $$QMAKE_MOVE $${baseTarget}.sis $$sis_destdir
}
QMAKE_EXTRA_TARGETS += sis_target \
unsigned_sis_target \
target_sis_target \
installer_sis_target
+
+ QMAKE_DISTCLEAN += $${sis_destdir}/$${baseTarget}.sis
}
} else {
contains(TEMPLATE, subdirs) {
@@ -177,5 +180,3 @@ equals(GENERATE_SIS_TARGETS, true) {
QMAKE_EXTRA_TARGETS += store_build_target
}
}
-
-QMAKE_DISTCLEAN += $${sis_destdir}$${TARGET}.sis
diff --git a/mkspecs/features/symbian/data_caging_paths.prf b/mkspecs/features/symbian/data_caging_paths.prf
index 6b38d4d..2f03128 100644
--- a/mkspecs/features/symbian/data_caging_paths.prf
+++ b/mkspecs/features/symbian/data_caging_paths.prf
@@ -76,4 +76,5 @@ exists($${EPOCROOT}epoc32/include/data_caging_paths.prf) {
isEmpty(HW_ZDIR): HW_ZDIR = epoc32/data/z
isEmpty(REG_RESOURCE_DIR): REG_RESOURCE_DIR = /private/10003a3f/apps
-isEmpty(REG_RESOURCE_IMPORT_DIR): REG_RESOURCE_IMPORT_DIR = /private/10003a3f/import/apps \ No newline at end of file
+isEmpty(REG_RESOURCE_IMPORT_DIR): REG_RESOURCE_IMPORT_DIR = /private/10003a3f/import/apps
+isEmpty(APP_PRIVATE_DIR_BASE): APP_PRIVATE_DIR_BASE = /private
diff --git a/mkspecs/features/symbian/def_files.prf b/mkspecs/features/symbian/def_files.prf
index 1b8e551..bae9d2d 100644
--- a/mkspecs/features/symbian/def_files.prf
+++ b/mkspecs/features/symbian/def_files.prf
@@ -56,7 +56,7 @@ symbian-abld|symbian-sbsv2 {
} else {
elf2e32FileToAdd = $$_PRO_FILE_PWD_/$$defFile
}
- QMAKE_ELF2E32_FLAGS += "`test -e $$elf2e32FileToAdd && echo --definput=$$elf2e32FileToAdd`"
+ QMAKE_ELF2E32_FLAGS += "--definput=$$elf2e32FileToAdd"
symbianObjdir = $$OBJECTS_DIR
isEmpty(symbianObjdir):symbianObjdir = .
@@ -64,7 +64,7 @@ symbian-abld|symbian-sbsv2 {
freeze_target.target = freeze
freeze_target.depends = first
# The perl part is to convert to unix line endings and remove comments, which the s60 tools refuse to do.
- freeze_target.commands = perl -n -e \'next if (/; NEW/); s/\\r//g; if (/MISSING:(.*)/x) { print(\"\$\$1 ABSENT\\n\"); } else { print; }\' < $$symbianObjdir/$${TARGET}.def > $$elf2e32FileToAdd
+ freeze_target.commands = $$QMAKE_COPY $$symbianObjdir/$${TARGET}.def $$elf2e32FileToAdd
QMAKE_EXTRA_TARGETS += freeze_target
} else:contains(TEMPLATE, subdirs) {
freeze_target.target = freeze
diff --git a/mkspecs/features/symbian/run_on_phone.prf b/mkspecs/features/symbian/run_on_phone.prf
index 6948a48..818151a 100644
--- a/mkspecs/features/symbian/run_on_phone.prf
+++ b/mkspecs/features/symbian/run_on_phone.prf
@@ -11,9 +11,13 @@ else:!equals(DEPLOYMENT, default_deployment) {
}
equals(GENERATE_RUN_TARGETS, true) {
- sis_destdir = $$DESTDIR
- !isEmpty(sis_destdir):!contains(sis_destdir, "[/\\\\]$"):sis_destdir = $${sis_destdir}/
- contains(QMAKE_HOST.os, "Windows"):sis_destdir = $$replace(sis_destdir, "/", "\\")
+ symbian-abld|symbian-sbsv2 {
+ sis_destdir =
+ } else {
+ sis_destdir = $$DESTDIR
+ !isEmpty(sis_destdir):!contains(sis_destdir, "[/\\\\]$"):sis_destdir = $${sis_destdir}/
+ contains(QMAKE_HOST.os, "Windows"):sis_destdir = $$replace(sis_destdir, "/", "\\")
+ }
contains(SYMBIAN_PLATFORMS, "WINSCW"):contains(TEMPLATE, "app") {
run_target.target = run
diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index 9fc4d1e..fbaefca 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -8,6 +8,11 @@
QMAKE_LFLAGS += -Ttext 0x80000 -Tdata 0x400000
}
+isEmpty(TARGET.EPOCSTACKSIZE):TARGET.EPOCSTACKSIZE = 0x14000
+isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x020000 0x800000
+epoc_heap_size = $$split(TARGET.EPOCHEAPSIZE, " ")
+epoc_heap_size = $$join(epoc_heap_size, ",")
+
symbianObjdir=$$OBJECTS_DIR
isEmpty(symbianObjdir) {
symbianObjdir = .
@@ -16,6 +21,8 @@ symbianDestdir=$$DESTDIR
isEmpty(symbianDestdir) {
symbianDestdir = .
}
+baseTarget = $$basename(TARGET)
+!equals(TARGET, "$$baseTarget"):symbianDestdir = $$symbianDestdir/$$dirname(TARGET)
contains(QMAKE_CFLAGS, "--thumb")|contains(QMAKE_CXXFLAGS, "--thumb")|contains(QMAKE_CFLAGS, "-mthumb")|contains(QMAKE_CXXFLAGS, "-mthumb") {
DEFINES += __MARM_THUMB__
@@ -99,34 +106,29 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
contains(CONFIG, plugin):QMAKE_ELF2E32_FLAGS += --definput=plugin_commonu.def
- # The tee and grep at the end work around the issue that elf2e32 doesn't return non-null on error.
- # The comparison of dso files is to avoid extra building of modules that depend on this dso, in
- # case it has not changed.
- QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET}.dll $$symbianDestdir/$${TARGET}.sym \
- && elf2e32 --version=$$decVersion \
+ QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget}.dll $$symbianDestdir/$${baseTarget}.sym \
+ && elf2e32_qtwrapper --version=$$decVersion \
--sid=$$TARGET.SID \
--uid1=0x10000079 \
--uid2=$$TARGET.UID2 \
--uid3=$$TARGET.UID3 \
--targettype=DLL \
- --elfinput=$${symbianDestdir}/$${TARGET}.sym \
- --output=$${symbianDestdir}/$${TARGET}.dll \
- --dso=$$symbianObjdir/$${TARGET}.dso \
- --defoutput=$$symbianObjdir/$${TARGET}.def \
- --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
+ --elfinput=$${symbianDestdir}/$${baseTarget}.sym \
+ --output=$${symbianDestdir}/$${baseTarget}.dll \
+ --tmpdso=$${symbianObjdir}/$${baseTarget}.dso \
+ --dso=$${symbianDestdir}/$${baseTarget}.dso \
+ --defoutput=$$symbianObjdir/$${baseTarget}.def \
+ --linkas=$${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
+ --heap=$$epoc_heap_size \
+ --stack=$$TARGET.EPOCSTACKSIZE \
$$elf2e32_LIBPATH \
$$capability \
$$QMAKE_ELF2E32_FLAGS \
- | tee elf2e32.log && test `grep -c 'Error:' elf2e32.log` = 0 && rm elf2e32.log \
- && if ! diff -q $${symbianObjdir}/$${TARGET}.dso $${symbianDestdir}/$${TARGET}.dso \
- > /dev/null 2>&1; then \
- $$QMAKE_COPY $${symbianObjdir}/$${TARGET}.dso $${symbianDestdir}/$${TARGET}.dso; \
- fi \
$$QMAKE_POST_LINK
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.sym
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.dso
- QMAKE_CLEAN += $${symbianObjdir}/$${TARGET}.dso
- QMAKE_CLEAN += $${symbianObjdir}/$${TARGET}.def
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.sym
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.dso
+ QMAKE_CLEAN += $${symbianObjdir}/$${baseTarget}.dso
+ QMAKE_CLEAN += $${symbianObjdir}/$${baseTarget}.def
linux-armcc: {
LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
@@ -142,7 +144,7 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
-lgcc
}
- QMAKE_LFLAGS += --soname $${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll
+ QMAKE_LFLAGS += --soname $${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll
DEFINES += __DLL__
}
@@ -152,26 +154,26 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
QMAKE_POST_LINK = $$replace(QMAKE_POST_LINK, "^@", "")
QMAKE_POST_LINK = && $$QMAKE_POST_LINK
}
- # the tee and grep at the end work around the issue that elf2e32 doesn't return non-null on error
- QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET} $$symbianDestdir/$${TARGET}.sym \
- && elf2e32 --version $$decVersion \
+ QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget} $$symbianDestdir/$${baseTarget}.sym \
+ && elf2e32_qtwrapper --version $$decVersion \
--sid=$$TARGET.SID \
--uid1=0x1000007a \
--uid2=$$TARGET.UID2 \
--uid3=$$TARGET.UID3 \
--targettype=EXE \
- --elfinput=$${symbianDestdir}/$${TARGET}.sym \
- --output=$${symbianDestdir}/$${TARGET}.exe \
- --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
+ --elfinput=$${symbianDestdir}/$${baseTarget}.sym \
+ --output=$${symbianDestdir}/$${baseTarget}.exe \
+ --linkas=$${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
+ --heap=$$epoc_heap_size \
+ --stack=$$TARGET.EPOCSTACKSIZE \
$$elf2e32_LIBPATH \
$$capability \
$$QMAKE_ELF2E32_FLAGS \
- | tee elf2e32.log && test `grep -c 'Error:' elf2e32.log` = 0 && rm elf2e32.log \
- && ln "$${symbianDestdir}/$${TARGET}.exe" "$${symbianDestdir}/$$TARGET" \
+ && ln "$${symbianDestdir}/$${baseTarget}.exe" "$${symbianDestdir}/$${baseTarget}" \
$$QMAKE_POST_LINK
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.sym
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.exe
- QMAKE_CLEAN += $${symbianDestdir}/$${TARGET}
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.sym
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.exe
+ QMAKE_CLEAN += $${symbianDestdir}/$${baseTarget}
linux-armcc: {
QMAKE_LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
@@ -200,7 +202,7 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
QMAKE_LFLAGS += --shared
}
- QMAKE_LFLAGS += --soname $${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe
+ QMAKE_LFLAGS += --soname $${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe
DEFINES += __EXE__
}
@@ -241,47 +243,47 @@ symbianresources.CONFIG = no_link target_predeps
QMAKE_EXTRA_COMPILERS += symbianresources
contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
- baseTarget = $$basename(TARGET)
+ baseResourceTarget = $$basename(TARGET)
# If you change this, also see application_icon.prf
- baseTarget = $$replace(baseTarget, " ",_)
+ baseResourceTarget = $$replace(baseResourceTarget, " ",_)
# Make our own extra target in order to get dependencies for generated
# files right. This also avoids the warning about files not found.
- symbianGenResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
+ symbianGenResource.target = $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
symbianGenResource.commands = cpp -nostdinc -undef \
$$symbian_resources_INCLUDES \
$$symbian_resources_DEFINES \
- $${baseTarget}.rss \
- -o $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
+ $${baseResourceTarget}.rss \
+ -o $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp \
&& rcomp -u -m045,046,047 \
- -s$${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
- -o$${symbianDestdir}/$${baseTarget}.rsc \
- -h$${symbian_resources_RCC_DIR}/$${baseTarget}.rsg \
- -i$${baseTarget}.rss
- symbianGenResource.depends = $${baseTarget}.rss
- PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp
- QMAKE_DISTCLEAN += $${baseTarget}.rss
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.rsc
+ -s$${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp \
+ -o$${symbianDestdir}/$${baseResourceTarget}.rsc \
+ -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg \
+ -i$${baseResourceTarget}.rss
+ symbianGenResource.depends = $${baseResourceTarget}.rss
+ PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
+ QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
+ QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp
+ QMAKE_DISTCLEAN += $${baseResourceTarget}.rss
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseResourceTarget}.rsc
- symbianGenRegResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
+ symbianGenRegResource.target = $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
symbianGenRegResource.commands = cpp -nostdinc -undef \
$$symbian_resources_INCLUDES \
$$symbian_resources_DEFINES \
- $${baseTarget}_reg.rss \
- -o $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
+ $${baseResourceTarget}_reg.rss \
+ -o $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp \
&& rcomp -u -m045,046,047 \
- -s$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
- -o$${symbianDestdir}/$${baseTarget}_reg.rsc \
- -h$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg \
- -i$${baseTarget}_reg.rss
- symbianGenRegResource.depends = $${baseTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp
- QMAKE_DISTCLEAN += $${TARGET}_reg.rss
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}_reg.rsc
+ -s$${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp \
+ -o$${symbianDestdir}/$${baseResourceTarget}_reg.rsc \
+ -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg \
+ -i$${baseResourceTarget}_reg.rss
+ symbianGenRegResource.depends = $${baseResourceTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
+ PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
+ QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
+ QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp
+ QMAKE_DISTCLEAN += $${baseResourceTarget}_reg.rss
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseResourceTarget}_reg.rsc
# Trick to get qmake to create the RCC_DIR for us.
symbianRccDirCreation.input = SOURCES
@@ -292,9 +294,9 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
QMAKE_EXTRA_TARGETS += symbianGenResource symbianGenRegResource
QMAKE_EXTRA_COMPILERS += symbianRccDirCreation
- QMAKE_DISTCLEAN += $${TARGET}.loc
+ QMAKE_DISTCLEAN += $${baseTarget}.loc
}
# Generated pkg files
-QMAKE_DISTCLEAN += $${TARGET}_template.pkg
+QMAKE_DISTCLEAN += $${baseTarget}_template.pkg
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index bf874b2..75fc910 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -385,7 +385,6 @@ VCXCLCompilerTool::VCXCLCompilerTool()
DisableLanguageExtensions(unset),
EnableFiberSafeOptimizations(unset),
EnablePREfast(unset),
- ExceptionHandling("false"),
ExpandAttributedSource(unset),
FloatingPointExceptions(unset),
ForceConformanceInForLoopScope(unset),
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index e23e119..1e060a0 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -360,11 +360,8 @@ inline XmlOutput::xml_output xformUsePrecompiledHeaderForNET2005(pchOption whatP
inline XmlOutput::xml_output xformExceptionHandlingNET2005(exceptionHandling eh, DotNET compilerVersion)
{
- if (eh == ehDefault) {
- if (compilerVersion >= NET2005)
- return attrE(_ExceptionHandling, ehNone);
- return attrS(_ExceptionHandling, "false");
- }
+ if (eh == ehDefault)
+ return noxml();
if (compilerVersion >= NET2005)
return attrE(_ExceptionHandling, eh);
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 35e4896..8686ae8 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -900,6 +900,7 @@ void VcprojGenerator::initCompilerTool()
conf.compiler.AssemblerListingLocation = placement ;
conf.compiler.ProgramDataBaseFileName = ".\\" ;
conf.compiler.ObjectFile = placement ;
+ conf.compiler.ExceptionHandling = ehNone;
// PCH
if (usePCH) {
conf.compiler.UsePrecompiledHeader = pchUseUsingSpecific;
diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp
index 05c1511..f68a435 100644
--- a/qmake/generators/win32/msvc_vcxproj.cpp
+++ b/qmake/generators/win32/msvc_vcxproj.cpp
@@ -274,6 +274,7 @@ void VcxprojGenerator::initCompilerTool()
conf.compiler.AssemblerListingLocation = placement ;
conf.compiler.ProgramDataBaseFileName = ".\\" ;
conf.compiler.ObjectFileName = placement ;
+ conf.compiler.ExceptionHandling = "false";
// PCH
if (usePCH) {
conf.compiler.PrecompiledHeader = "Use";
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-global.h b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
index 5b2b679..bccd6a2 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-global.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
@@ -39,7 +39,7 @@
#define HB_END_HEADER /* nothing */
#endif
-#if defined(__GNUC__) || defined(__ARMCC__) || defined(__CC_ARM) || defined(_MSC_VER)
+#if defined(__GNUC__) || defined(_MSC_VER)
#define HB_USE_PACKED_STRUCTS
#endif
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
index fc2bdbf..e153ba9 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
@@ -53,6 +53,8 @@ static void to_tis620(const HB_UChar16 *string, hb_uint32 len, const char *cstr)
else
result[i] = '?';
}
+
+ result[len] = 0;
}
static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttributes *attributes)
@@ -70,8 +72,8 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri
if (!th_brk)
return;
- if (len > 128)
- cstr = (char *)malloc(len*sizeof(char));
+ if (len >= 128)
+ cstr = (char *)malloc(len*sizeof(char) + 1);
to_tis620(string, len, cstr);
@@ -96,7 +98,7 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri
if (break_positions != brp)
free(break_positions);
- if (len > 128)
+ if (len >= 128)
free(cstr);
}
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog
index b0873ab..93431df 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog
@@ -1,3 +1,49 @@
+2010-06-19 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Don't use __attribute__((may_alias)) with the Intel compiler,
+ as it doesn't understand it.
+
+ * wtf/Vector.h:
+
+2010-06-19 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Fix compilation with the Intel C++ compiler (11.1.072).
+
+ Like RVCT, label pointers must be void*, not const void*.
+
+ * bytecode/Opcode.h:
+
+2010-06-19 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add the WTF_COMPILER_INTEL for when the Intel compiler is used
+ for building. Usually, the Intel compiler masquerades as
+ another compiler in the system and gets away with it, but some
+ times specific fixes are required (such as when using language
+ extensions).
+
+ * wtf/Platform.h:
+
+2010-06-07 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Crash when compiling on Snow Leopard and running on Leopard
+ https://bugs.webkit.org/show_bug.cgi?id=31403
+
+ Disable the use of pthread_setname_np and other symbols
+ when targetting Leopard.
+
+ Use the defines TARGETING_XX instead of BUILDING_ON_XX
+ for features that cannot be used before Snow Leopard.
+
+ * wtf/Platform.h:
+
2010-05-10 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Darin Adler.
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h
index d9b2153..9ac17ec 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h
@@ -196,7 +196,7 @@ namespace JSC {
#undef VERIFY_OPCODE_ID
#if HAVE(COMPUTED_GOTO)
-#if COMPILER(RVCT)
+#if COMPILER(RVCT) || COMPILER(INTEL)
typedef void* Opcode;
#else
typedef const void* Opcode;
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
index eafcc23..24873c8 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
@@ -217,9 +217,7 @@ void Heap::destroy()
NEVER_INLINE CollectorBlock* Heap::allocateBlock()
{
- // Disable the use of vm_map for the Qt build on Darwin, because when compiled on 10.4
- // it crashes on 10.5
-#if OS(DARWIN) && !PLATFORM(QT)
+#if OS(DARWIN)
vm_address_t address = 0;
vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE | VM_TAG_FOR_COLLECTOR_MEMORY, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT);
#elif OS(SYMBIAN)
@@ -315,9 +313,7 @@ NEVER_INLINE void Heap::freeBlock(size_t block)
NEVER_INLINE void Heap::freeBlockPtr(CollectorBlock* block)
{
- // Disable the use of vm_deallocate for the Qt build on Darwin, because when compiled on 10.4
- // it crashes on 10.5
-#if OS(DARWIN) && !PLATFORM(QT)
+#if OS(DARWIN)
vm_deallocate(current_task(), reinterpret_cast<vm_address_t>(block), BLOCK_SIZE);
#elif OS(SYMBIAN)
userChunk->Free(reinterpret_cast<TAny*>(block));
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
index be5f51b..5abe9a1 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
@@ -98,6 +98,11 @@
#define WTF_COMPILER_WINSCW 1
#endif
+/* COMPILER(INTEL) - Intel C++ Compiler */
+#if defined(__INTEL_COMPILER)
+#define WTF_COMPILER_INTEL 1
+#endif
+
/* COMPILER(ACC) - HP aCC */
#if defined(__HP_aCC)
#define WTF_COMPILER_ACC 1
@@ -703,11 +708,11 @@
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TIMEB_H 1
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD)
#define HAVE_DISPATCH_H 1
-#if !PLATFORM(IPHONE) && !PLATFORM(QT)
+#if !PLATFORM(IPHONE)
#define HAVE_MADV_FREE_REUSE 1
#define HAVE_MADV_FREE 1
#define HAVE_PTHREAD_SETNAME_NP 1
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h
index 8a4ffba..156ff1a 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h
@@ -48,7 +48,7 @@ namespace WTF {
#define WTF_ALIGN_OF(type) 0
#endif
- #if COMPILER(GCC) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 303)
+ #if COMPILER(GCC) && !COMPILER(INTEL) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 303)
typedef char __attribute__((__may_alias__)) AlignedBufferChar;
#else
typedef char AlignedBufferChar;
diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION
index daecc37..6f5fb7c 100644
--- a/src/3rdparty/javascriptcore/VERSION
+++ b/src/3rdparty/javascriptcore/VERSION
@@ -4,8 +4,8 @@ This is a snapshot of JavaScriptCore from
The commit imported was from the
- javascriptcore-snapshot-16062010 branch/tag
+ javascriptcore-snapshot-28062010 branch/tag
and has the sha1 checksum
- 8b2d3443afca194f8ac50a63151dc9d19a150582
+ 0fccd26d3624e80cf68873701ef70ad72ca66bec
diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index 1eb0d78..aa30784 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-45d1c9149ef8940081fa8dd35854d2b95ebaf3cd
+38d650efc92427cd6452f6685d3c40d22428cdb7
diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
index 676ed23..8fa3a72 100644
--- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
@@ -1,3 +1,37 @@
+2010-05-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add an inlineCapacity template parameter to ListHashSet and use it to shrink the positioned object list hash set.
+ https://bugs.webkit.org/show_bug.cgi?id=39304
+ <rdar://problem/7998366>
+
+ Add an inlineCapacity template parameter to ListHashSet.
+
+ * wtf/ListHashSet.h:
+ (WTF::::ListHashSet):
+ (WTF::::operator):
+ (WTF::::swap):
+ (WTF::::~ListHashSet):
+ (WTF::::size):
+ (WTF::::capacity):
+ (WTF::::isEmpty):
+ (WTF::::begin):
+ (WTF::::end):
+ (WTF::::find):
+ (WTF::::contains):
+ (WTF::::add):
+ (WTF::::insertBefore):
+ (WTF::::remove):
+ (WTF::::clear):
+ (WTF::::unlinkAndDelete):
+ (WTF::::appendNode):
+ (WTF::::insertNodeBefore):
+ (WTF::::deleteAllNodes):
+ (WTF::::makeIterator):
+ (WTF::::makeConstIterator):
+ (WTF::deleteAllValues):
+
2010-06-18 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h b/src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h
index 54ed36b..09355ad 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h
@@ -37,27 +37,27 @@ namespace WTF {
// and an append that moves the element to the end even if already present,
// but unclear yet if these are needed.
- template<typename Value, typename HashFunctions> class ListHashSet;
+ template<typename Value, size_t inlineCapacity, typename HashFunctions> class ListHashSet;
template<typename T> struct IdentityExtractor;
- template<typename Value, typename HashFunctions>
- void deleteAllValues(const ListHashSet<Value, HashFunctions>&);
+ template<typename Value, size_t inlineCapacity, typename HashFunctions>
+ void deleteAllValues(const ListHashSet<Value, inlineCapacity, HashFunctions>&);
- template<typename ValueArg, typename HashArg> class ListHashSetIterator;
- template<typename ValueArg, typename HashArg> class ListHashSetConstIterator;
+ template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetIterator;
+ template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetConstIterator;
- template<typename ValueArg> struct ListHashSetNode;
- template<typename ValueArg> struct ListHashSetNodeAllocator;
- template<typename ValueArg, typename HashArg> struct ListHashSetNodeHashFunctions;
+ template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNode;
+ template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNodeAllocator;
+ template<typename ValueArg, size_t inlineCapacity, typename HashArg> struct ListHashSetNodeHashFunctions;
- template<typename ValueArg, typename HashArg = typename DefaultHash<ValueArg>::Hash> class ListHashSet : public FastAllocBase {
+ template<typename ValueArg, size_t inlineCapacity = 256, typename HashArg = typename DefaultHash<ValueArg>::Hash> class ListHashSet : public FastAllocBase {
private:
- typedef ListHashSetNode<ValueArg> Node;
- typedef ListHashSetNodeAllocator<ValueArg> NodeAllocator;
+ typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
+ typedef ListHashSetNodeAllocator<ValueArg, inlineCapacity> NodeAllocator;
typedef HashTraits<Node*> NodeTraits;
- typedef ListHashSetNodeHashFunctions<ValueArg, HashArg> NodeHash;
+ typedef ListHashSetNodeHashFunctions<ValueArg, inlineCapacity, HashArg> NodeHash;
typedef HashTable<Node*, Node*, IdentityExtractor<Node*>, NodeHash, NodeTraits, NodeTraits> ImplType;
typedef HashTableIterator<Node*, Node*, IdentityExtractor<Node*>, NodeHash, NodeTraits, NodeTraits> ImplTypeIterator;
@@ -67,10 +67,10 @@ namespace WTF {
public:
typedef ValueArg ValueType;
- typedef ListHashSetIterator<ValueType, HashArg> iterator;
- typedef ListHashSetConstIterator<ValueType, HashArg> const_iterator;
+ typedef ListHashSetIterator<ValueType, inlineCapacity, HashArg> iterator;
+ typedef ListHashSetConstIterator<ValueType, inlineCapacity, HashArg> const_iterator;
- friend class ListHashSetConstIterator<ValueType, HashArg>;
+ friend class ListHashSetConstIterator<ValueType, inlineCapacity, HashArg>;
ListHashSet();
ListHashSet(const ListHashSet&);
@@ -119,9 +119,9 @@ namespace WTF {
OwnPtr<NodeAllocator> m_allocator;
};
- template<typename ValueArg> struct ListHashSetNodeAllocator {
- typedef ListHashSetNode<ValueArg> Node;
- typedef ListHashSetNodeAllocator<ValueArg> NodeAllocator;
+ template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNodeAllocator {
+ typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
+ typedef ListHashSetNodeAllocator<ValueArg, inlineCapacity> NodeAllocator;
ListHashSetNodeAllocator()
: m_freeList(pool())
@@ -181,15 +181,15 @@ namespace WTF {
Node* m_freeList;
bool m_isDoneWithInitialFreeList;
- static const size_t m_poolSize = 256;
+ static const size_t m_poolSize = inlineCapacity;
union {
char pool[sizeof(Node) * m_poolSize];
double forAlignment;
} m_pool;
};
- template<typename ValueArg> struct ListHashSetNode {
- typedef ListHashSetNodeAllocator<ValueArg> NodeAllocator;
+ template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNode {
+ typedef ListHashSetNodeAllocator<ValueArg, inlineCapacity> NodeAllocator;
ListHashSetNode(ValueArg value)
: m_value(value)
@@ -220,25 +220,25 @@ namespace WTF {
#endif
};
- template<typename ValueArg, typename HashArg> struct ListHashSetNodeHashFunctions {
- typedef ListHashSetNode<ValueArg> Node;
+ template<typename ValueArg, size_t inlineCapacity, typename HashArg> struct ListHashSetNodeHashFunctions {
+ typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
static unsigned hash(Node* const& key) { return HashArg::hash(key->m_value); }
static bool equal(Node* const& a, Node* const& b) { return HashArg::equal(a->m_value, b->m_value); }
static const bool safeToCompareToEmptyOrDeleted = false;
};
- template<typename ValueArg, typename HashArg> class ListHashSetIterator {
+ template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetIterator {
private:
- typedef ListHashSet<ValueArg, HashArg> ListHashSetType;
- typedef ListHashSetIterator<ValueArg, HashArg> iterator;
- typedef ListHashSetConstIterator<ValueArg, HashArg> const_iterator;
- typedef ListHashSetNode<ValueArg> Node;
+ typedef ListHashSet<ValueArg, inlineCapacity, HashArg> ListHashSetType;
+ typedef ListHashSetIterator<ValueArg, inlineCapacity, HashArg> iterator;
+ typedef ListHashSetConstIterator<ValueArg, inlineCapacity, HashArg> const_iterator;
+ typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
typedef ValueArg ValueType;
typedef ValueType& ReferenceType;
typedef ValueType* PointerType;
- friend class ListHashSet<ValueArg, HashArg>;
+ friend class ListHashSet<ValueArg, inlineCapacity, HashArg>;
ListHashSetIterator(const ListHashSetType* set, Node* position) : m_iterator(set, position) { }
@@ -271,18 +271,18 @@ namespace WTF {
const_iterator m_iterator;
};
- template<typename ValueArg, typename HashArg> class ListHashSetConstIterator {
+ template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetConstIterator {
private:
- typedef ListHashSet<ValueArg, HashArg> ListHashSetType;
- typedef ListHashSetIterator<ValueArg, HashArg> iterator;
- typedef ListHashSetConstIterator<ValueArg, HashArg> const_iterator;
- typedef ListHashSetNode<ValueArg> Node;
+ typedef ListHashSet<ValueArg, inlineCapacity, HashArg> ListHashSetType;
+ typedef ListHashSetIterator<ValueArg, inlineCapacity, HashArg> iterator;
+ typedef ListHashSetConstIterator<ValueArg, inlineCapacity, HashArg> const_iterator;
+ typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
typedef ValueArg ValueType;
typedef const ValueType& ReferenceType;
typedef const ValueType* PointerType;
- friend class ListHashSet<ValueArg, HashArg>;
- friend class ListHashSetIterator<ValueArg, HashArg>;
+ friend class ListHashSet<ValueArg, inlineCapacity, HashArg>;
+ friend class ListHashSetIterator<ValueArg, inlineCapacity, HashArg>;
ListHashSetConstIterator(const ListHashSetType* set, Node* position)
: m_set(set)
@@ -341,11 +341,11 @@ namespace WTF {
};
- template<typename ValueType, typename HashFunctions>
+ template<typename ValueType, size_t inlineCapacity, typename HashFunctions>
struct ListHashSetTranslator {
private:
- typedef ListHashSetNode<ValueType> Node;
- typedef ListHashSetNodeAllocator<ValueType> NodeAllocator;
+ typedef ListHashSetNode<ValueType, inlineCapacity> Node;
+ typedef ListHashSetNodeAllocator<ValueType, inlineCapacity> NodeAllocator;
public:
static unsigned hash(const ValueType& key) { return HashFunctions::hash(key); }
static bool equal(Node* const& a, const ValueType& b) { return HashFunctions::equal(a->m_value, b); }
@@ -355,16 +355,16 @@ namespace WTF {
}
};
- template<typename T, typename U>
- inline ListHashSet<T, U>::ListHashSet()
+ template<typename T, size_t inlineCapacity, typename U>
+ inline ListHashSet<T, inlineCapacity, U>::ListHashSet()
: m_head(0)
, m_tail(0)
, m_allocator(new NodeAllocator)
{
}
- template<typename T, typename U>
- inline ListHashSet<T, U>::ListHashSet(const ListHashSet& other)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline ListHashSet<T, inlineCapacity, U>::ListHashSet(const ListHashSet& other)
: m_head(0)
, m_tail(0)
, m_allocator(new NodeAllocator)
@@ -374,16 +374,16 @@ namespace WTF {
add(*it);
}
- template<typename T, typename U>
- inline ListHashSet<T, U>& ListHashSet<T, U>::operator=(const ListHashSet& other)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline ListHashSet<T, inlineCapacity, U>& ListHashSet<T, inlineCapacity, U>::operator=(const ListHashSet& other)
{
ListHashSet tmp(other);
swap(tmp);
return *this;
}
- template<typename T, typename U>
- inline void ListHashSet<T, U>::swap(ListHashSet& other)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline void ListHashSet<T, inlineCapacity, U>::swap(ListHashSet& other)
{
m_impl.swap(other.m_impl);
std::swap(m_head, other.m_head);
@@ -391,95 +391,95 @@ namespace WTF {
m_allocator.swap(other.m_allocator);
}
- template<typename T, typename U>
- inline ListHashSet<T, U>::~ListHashSet()
+ template<typename T, size_t inlineCapacity, typename U>
+ inline ListHashSet<T, inlineCapacity, U>::~ListHashSet()
{
deleteAllNodes();
}
- template<typename T, typename U>
- inline int ListHashSet<T, U>::size() const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline int ListHashSet<T, inlineCapacity, U>::size() const
{
return m_impl.size();
}
- template<typename T, typename U>
- inline int ListHashSet<T, U>::capacity() const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline int ListHashSet<T, inlineCapacity, U>::capacity() const
{
return m_impl.capacity();
}
- template<typename T, typename U>
- inline bool ListHashSet<T, U>::isEmpty() const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline bool ListHashSet<T, inlineCapacity, U>::isEmpty() const
{
return m_impl.isEmpty();
}
- template<typename T, typename U>
- inline typename ListHashSet<T, U>::iterator ListHashSet<T, U>::begin()
+ template<typename T, size_t inlineCapacity, typename U>
+ inline typename ListHashSet<T, inlineCapacity, U>::iterator ListHashSet<T, inlineCapacity, U>::begin()
{
return makeIterator(m_head);
}
- template<typename T, typename U>
- inline typename ListHashSet<T, U>::iterator ListHashSet<T, U>::end()
+ template<typename T, size_t inlineCapacity, typename U>
+ inline typename ListHashSet<T, inlineCapacity, U>::iterator ListHashSet<T, inlineCapacity, U>::end()
{
return makeIterator(0);
}
- template<typename T, typename U>
- inline typename ListHashSet<T, U>::const_iterator ListHashSet<T, U>::begin() const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline typename ListHashSet<T, inlineCapacity, U>::const_iterator ListHashSet<T, inlineCapacity, U>::begin() const
{
return makeConstIterator(m_head);
}
- template<typename T, typename U>
- inline typename ListHashSet<T, U>::const_iterator ListHashSet<T, U>::end() const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline typename ListHashSet<T, inlineCapacity, U>::const_iterator ListHashSet<T, inlineCapacity, U>::end() const
{
return makeConstIterator(0);
}
- template<typename T, typename U>
- inline typename ListHashSet<T, U>::iterator ListHashSet<T, U>::find(const ValueType& value)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline typename ListHashSet<T, inlineCapacity, U>::iterator ListHashSet<T, inlineCapacity, U>::find(const ValueType& value)
{
- typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+ typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
ImplTypeIterator it = m_impl.template find<ValueType, Translator>(value);
if (it == m_impl.end())
return end();
return makeIterator(*it);
}
- template<typename T, typename U>
- inline typename ListHashSet<T, U>::const_iterator ListHashSet<T, U>::find(const ValueType& value) const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline typename ListHashSet<T, inlineCapacity, U>::const_iterator ListHashSet<T, inlineCapacity, U>::find(const ValueType& value) const
{
- typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+ typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
ImplTypeConstIterator it = m_impl.template find<ValueType, Translator>(value);
if (it == m_impl.end())
return end();
return makeConstIterator(*it);
}
- template<typename T, typename U>
- inline bool ListHashSet<T, U>::contains(const ValueType& value) const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline bool ListHashSet<T, inlineCapacity, U>::contains(const ValueType& value) const
{
- typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+ typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
return m_impl.template contains<ValueType, Translator>(value);
}
- template<typename T, typename U>
- pair<typename ListHashSet<T, U>::iterator, bool> ListHashSet<T, U>::add(const ValueType &value)
+ template<typename T, size_t inlineCapacity, typename U>
+ pair<typename ListHashSet<T, inlineCapacity, U>::iterator, bool> ListHashSet<T, inlineCapacity, U>::add(const ValueType &value)
{
- typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+ typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
pair<typename ImplType::iterator, bool> result = m_impl.template add<ValueType, NodeAllocator*, Translator>(value, m_allocator.get());
if (result.second)
appendNode(*result.first);
return std::make_pair(makeIterator(*result.first), result.second);
}
- template<typename T, typename U>
- pair<typename ListHashSet<T, U>::iterator, bool> ListHashSet<T, U>::insertBefore(iterator it, const ValueType& newValue)
+ template<typename T, size_t inlineCapacity, typename U>
+ pair<typename ListHashSet<T, inlineCapacity, U>::iterator, bool> ListHashSet<T, inlineCapacity, U>::insertBefore(iterator it, const ValueType& newValue)
{
- typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+ typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
pair<typename ImplType::iterator, bool> result = m_impl.template add<ValueType, NodeAllocator*, Translator>(newValue, m_allocator.get());
if (result.second)
insertNodeBefore(it.node(), *result.first);
@@ -487,14 +487,14 @@ namespace WTF {
}
- template<typename T, typename U>
- pair<typename ListHashSet<T, U>::iterator, bool> ListHashSet<T, U>::insertBefore(const ValueType& beforeValue, const ValueType& newValue)
+ template<typename T, size_t inlineCapacity, typename U>
+ pair<typename ListHashSet<T, inlineCapacity, U>::iterator, bool> ListHashSet<T, inlineCapacity, U>::insertBefore(const ValueType& beforeValue, const ValueType& newValue)
{
return insertBefore(find(beforeValue), newValue);
}
- template<typename T, typename U>
- inline void ListHashSet<T, U>::remove(iterator it)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline void ListHashSet<T, inlineCapacity, U>::remove(iterator it)
{
if (it == end())
return;
@@ -502,14 +502,14 @@ namespace WTF {
unlinkAndDelete(it.node());
}
- template<typename T, typename U>
- inline void ListHashSet<T, U>::remove(const ValueType& value)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline void ListHashSet<T, inlineCapacity, U>::remove(const ValueType& value)
{
remove(find(value));
}
- template<typename T, typename U>
- inline void ListHashSet<T, U>::clear()
+ template<typename T, size_t inlineCapacity, typename U>
+ inline void ListHashSet<T, inlineCapacity, U>::clear()
{
deleteAllNodes();
m_impl.clear();
@@ -517,8 +517,8 @@ namespace WTF {
m_tail = 0;
}
- template<typename T, typename U>
- void ListHashSet<T, U>::unlinkAndDelete(Node* node)
+ template<typename T, size_t inlineCapacity, typename U>
+ void ListHashSet<T, inlineCapacity, U>::unlinkAndDelete(Node* node)
{
if (!node->m_prev) {
ASSERT(node == m_head);
@@ -539,8 +539,8 @@ namespace WTF {
node->destroy(m_allocator.get());
}
- template<typename T, typename U>
- void ListHashSet<T, U>::appendNode(Node* node)
+ template<typename T, size_t inlineCapacity, typename U>
+ void ListHashSet<T, inlineCapacity, U>::appendNode(Node* node)
{
node->m_prev = m_tail;
node->m_next = 0;
@@ -556,8 +556,8 @@ namespace WTF {
m_tail = node;
}
- template<typename T, typename U>
- void ListHashSet<T, U>::insertNodeBefore(Node* beforeNode, Node* newNode)
+ template<typename T, size_t inlineCapacity, typename U>
+ void ListHashSet<T, inlineCapacity, U>::insertNodeBefore(Node* beforeNode, Node* newNode)
{
if (!beforeNode)
return appendNode(newNode);
@@ -572,8 +572,8 @@ namespace WTF {
m_head = newNode;
}
- template<typename T, typename U>
- void ListHashSet<T, U>::deleteAllNodes()
+ template<typename T, size_t inlineCapacity, typename U>
+ void ListHashSet<T, inlineCapacity, U>::deleteAllNodes()
{
if (!m_head)
return;
@@ -582,16 +582,16 @@ namespace WTF {
node->destroy(m_allocator.get());
}
- template<typename T, typename U>
- inline ListHashSetIterator<T, U> ListHashSet<T, U>::makeIterator(Node* position)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline ListHashSetIterator<T, inlineCapacity, U> ListHashSet<T, inlineCapacity, U>::makeIterator(Node* position)
{
- return ListHashSetIterator<T, U>(this, position);
+ return ListHashSetIterator<T, inlineCapacity, U>(this, position);
}
- template<typename T, typename U>
- inline ListHashSetConstIterator<T, U> ListHashSet<T, U>::makeConstIterator(Node* position) const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline ListHashSetConstIterator<T, inlineCapacity, U> ListHashSet<T, inlineCapacity, U>::makeConstIterator(Node* position) const
{
- return ListHashSetConstIterator<T, U>(this, position);
+ return ListHashSetConstIterator<T, inlineCapacity, U>(this, position);
}
template<bool, typename ValueType, typename HashTableType>
@@ -603,10 +603,10 @@ namespace WTF {
delete (*it)->m_value;
}
- template<typename T, typename U>
- inline void deleteAllValues(const ListHashSet<T, U>& collection)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline void deleteAllValues(const ListHashSet<T, inlineCapacity, U>& collection)
{
- deleteAllValues<true, typename ListHashSet<T, U>::ValueType>(collection.m_impl);
+ deleteAllValues<true, typename ListHashSet<T, inlineCapacity, U>::ValueType>(collection.m_impl);
}
} // namespace WTF
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 1a343eb..980e01a 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
and has the sha1 checksum
- 45d1c9149ef8940081fa8dd35854d2b95ebaf3cd
+ 38d650efc92427cd6452f6685d3c40d22428cdb7
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index fd259e0..a84f177 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,90 @@
+2010-06-24 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed Symbian build fix.
+
+ The QML WebKit integration needs to be part of QtWebKit.sis
+
+ * WebCore.pro: Deploy qmlwebkitplugin.dll.
+
+2010-06-23 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Do not render the full frame when there is some elements with fixed positioning
+ https://bugs.webkit.org/show_bug.cgi?id=33150
+
+ Do not render the full frame when there is some elements with fixed positioning
+ https://bugs.webkit.org/show_bug.cgi?id=33150
+
+ The frame view take into acount the list of fixed object when scrolling
+ the view. If the number of object is lower than a certain threshold, the pixel
+ are blitted, and the invalidated area updated.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::addFixedObject):
+ (WebCore::FrameView::removeFixedObject):
+ (WebCore::FrameView::scrollContentsFastPath):
+ * page/FrameView.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::scrollContents):
+ (WebCore::ScrollView::scrollContentsFastPath):
+ * platform/ScrollView.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::repaintRectIncludingDescendants):
+ * rendering/RenderLayer.h:
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::styleWillChange):
+
+2010-05-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Allocate the m_preloads list hash set dynamically and free it when done.
+ https://bugs.webkit.org/show_bug.cgi?id=39309
+ <rdar://problem/7998495>
+
+ This saves about 6000 bytes on a fully loaded document.
+
+ * loader/DocLoader.cpp:
+ (WebCore::DocLoader::requestPreload):
+ (WebCore::DocLoader::clearPreloads):
+ * loader/DocLoader.h:
+
+2010-05-18 Anders Carlsson <andersca@apple.com>
+
+ Revert unintended indentation and unnecessary nested name specifier.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::clipOutPositionedObjects):
+ (WebCore::RenderBlock::insertPositionedObject):
+
+2010-05-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add an inlineCapacity template parameter to ListHashSet and use it to shrink the positioned object list hash set.
+ https://bugs.webkit.org/show_bug.cgi?id=39304
+ <rdar://problem/7998366>
+
+ Set the inlineCapacity for the positionedObjects ListHashSet to 4 instead of 256. Since a RenderBlock usually has
+ few positioned objects, this saves memory.
+
+ * WebCore.base.exp:
+ * rendering/RenderBlock.cpp:
+ (WebCore::clipOutPositionedObjects):
+ (WebCore::RenderBlock::insertPositionedObject):
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::positionedObjects):
+
+2010-06-22 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed Qt/Symbian build fix.
+
+ Fix "make clean" to not try to execute clean commands for
+ the extra targets we use to simulate "make install".
+
+ * WebCore.pro: Use no_clean in CONFIG of extra compilers.
+
2010-06-21 Balazs Kelemen <kb@inf.u-szeged.hu>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index e0b4905..c1661a4 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -25,6 +25,13 @@ symbian: {
webkitbackup.sources = ../WebKit/qt/symbian/backup_registration.xml
webkitbackup.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
+ contains(QT_CONFIG, declarative) {
+ declarativeImport.sources = $$QT_BUILD_TREE/imports/QtWebKit/qmlwebkitplugin$${QT_LIBINFIX}.dll
+ declarativeImport.sources += ../WebKit/qt/declarative/qmldir
+ declarativeImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
+ DEPLOYMENT += declarativeImport
+ }
+
DEPLOYMENT += webkitlibs webkitbackup
# Need to guarantee that these come before system includes of /epoc32/include
@@ -2866,6 +2873,7 @@ HEADERS += $$WEBKIT_API_HEADERS
# INSTALLS is not implemented in qmake's s60 generators, copy headers manually
inst_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
inst_headers.input = WEBKIT_INSTALL_HEADERS
+ inst_headers.CONFIG = no_clean
!isEmpty(INSTALL_HEADERS): inst_headers.output = $$INSTALL_HEADERS/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
else: inst_headers.output = $$[QT_INSTALL_HEADERS]/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
@@ -2875,6 +2883,7 @@ HEADERS += $$WEBKIT_API_HEADERS
inst_modfile.commands = $$inst_headers.commands
inst_modfile.input = moduleFile
inst_modfile.output = $$[QMAKE_MKSPECS]/modules
+ inst_modfile.CONFIG = no_clean
QMAKE_EXTRA_COMPILERS += inst_modfile
diff --git a/src/3rdparty/webkit/WebCore/loader/DocLoader.cpp b/src/3rdparty/webkit/WebCore/loader/DocLoader.cpp
index 0053e7b..4597704 100644
--- a/src/3rdparty/webkit/WebCore/loader/DocLoader.cpp
+++ b/src/3rdparty/webkit/WebCore/loader/DocLoader.cpp
@@ -407,10 +407,14 @@ void DocLoader::requestPreload(CachedResource::Type type, const String& url, con
encoding = charset.isEmpty() ? m_doc->frame()->loader()->encoding() : charset;
CachedResource* resource = requestResource(type, url, encoding, true);
- if (!resource || m_preloads.contains(resource))
+ if (!resource || (m_preloads && m_preloads->contains(resource)))
return;
resource->increasePreloadCount();
- m_preloads.add(resource);
+
+ if (!m_preloads)
+ m_preloads.set(new ListHashSet<CachedResource*>);
+ m_preloads->add(resource);
+
#if PRELOAD_DEBUG
printf("PRELOADING %s\n", resource->url().latin1().data());
#endif
@@ -421,8 +425,11 @@ void DocLoader::clearPreloads()
#if PRELOAD_DEBUG
printPreloadStats();
#endif
- ListHashSet<CachedResource*>::iterator end = m_preloads.end();
- for (ListHashSet<CachedResource*>::iterator it = m_preloads.begin(); it != end; ++it) {
+ if (!m_preloads)
+ return;
+
+ ListHashSet<CachedResource*>::iterator end = m_preloads->end();
+ for (ListHashSet<CachedResource*>::iterator it = m_preloads->begin(); it != end; ++it) {
CachedResource* res = *it;
res->decreasePreloadCount();
if (res->canDelete() && !res->inCache())
diff --git a/src/3rdparty/webkit/WebCore/loader/DocLoader.h b/src/3rdparty/webkit/WebCore/loader/DocLoader.h
index 8ec73e1..66e4164 100644
--- a/src/3rdparty/webkit/WebCore/loader/DocLoader.h
+++ b/src/3rdparty/webkit/WebCore/loader/DocLoader.h
@@ -47,8 +47,7 @@ class ImageLoader;
class KURL;
// The DocLoader manages the loading of scripts/images/stylesheets for a single document.
-class DocLoader : public Noncopyable
-{
+class DocLoader : public Noncopyable {
friend class Cache;
friend class ImageLoader;
@@ -117,7 +116,7 @@ private:
int m_requestCount;
- ListHashSet<CachedResource*> m_preloads;
+ OwnPtr<ListHashSet<CachedResource*> > m_preloads;
struct PendingPreload {
CachedResource::Type m_type;
String m_url;
diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.cpp b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
index a53db36..639414b 100644
--- a/src/3rdparty/webkit/WebCore/page/FrameView.cpp
+++ b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
@@ -884,7 +884,7 @@ bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
{
const size_t fixedObjectThreshold = 5;
- ListHashSet<RenderBox*>* positionedObjects = 0;
+ RenderBlock::PositionedObjectsListHashSet* positionedObjects = 0;
if (RenderView* root = m_frame->contentRenderer())
positionedObjects = root->positionedObjects();
@@ -896,14 +896,14 @@ bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
// Get the rects of the fixed objects visible in the rectToScroll
Vector<IntRect, fixedObjectThreshold> subRectToUpdate;
bool updateInvalidatedSubRect = true;
- ListHashSet<RenderBox*>::const_iterator end = positionedObjects->end();
- for (ListHashSet<RenderBox*>::const_iterator it = positionedObjects->begin(); it != end; ++it) {
+ RenderBlock::PositionedObjectsListHashSet::const_iterator end = positionedObjects->end();
+ for (RenderBlock::PositionedObjectsListHashSet::const_iterator it = positionedObjects->begin(); it != end; ++it) {
RenderBox* renderBox = *it;
if (renderBox->style()->position() != FixedPosition)
continue;
- IntRect topLevelRect;
- IntRect updateRect = renderBox->paintingRootRect(topLevelRect);
- updateRect.move(-scrollX(), -scrollY());
+ IntRect updateRect = renderBox->layer()->repaintRectIncludingDescendants();
+ updateRect = contentsToWindow(updateRect);
+
updateRect.intersect(rectToScroll);
if (!updateRect.isEmpty()) {
if (subRectToUpdate.size() >= fixedObjectThreshold) {
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp
index a7b8a02..798663e 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp
@@ -1982,13 +1982,13 @@ void RenderBlock::paintSelection(PaintInfo& paintInfo, int tx, int ty)
}
#ifndef BUILDING_ON_TIGER
-static void clipOutPositionedObjects(const RenderObject::PaintInfo* paintInfo, int tx, int ty, ListHashSet<RenderBox*>* positionedObjects)
+static void clipOutPositionedObjects(const RenderObject::PaintInfo* paintInfo, int tx, int ty, RenderBlock::PositionedObjectsListHashSet* positionedObjects)
{
if (!positionedObjects)
return;
- ListHashSet<RenderBox*>::const_iterator end = positionedObjects->end();
- for (ListHashSet<RenderBox*>::const_iterator it = positionedObjects->begin(); it != end; ++it) {
+ RenderBlock::PositionedObjectsListHashSet::const_iterator end = positionedObjects->end();
+ for (RenderBlock::PositionedObjectsListHashSet::const_iterator it = positionedObjects->begin(); it != end; ++it) {
RenderBox* r = *it;
paintInfo->context->clipOut(IntRect(tx + r->x(), ty + r->y(), r->width(), r->height()));
}
@@ -2274,7 +2274,7 @@ void RenderBlock::insertPositionedObject(RenderBox* o)
{
// Create the list of special objects if we don't aleady have one
if (!m_positionedObjects)
- m_positionedObjects = new ListHashSet<RenderBox*>;
+ m_positionedObjects = new PositionedObjectsListHashSet;
m_positionedObjects->add(o);
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h
index 184f983..d555d31 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h
@@ -74,7 +74,9 @@ public:
void insertPositionedObject(RenderBox*);
void removePositionedObject(RenderBox*);
void removePositionedObjects(RenderBlock*);
- ListHashSet<RenderBox*>* positionedObjects() const { return m_positionedObjects; }
+
+ typedef ListHashSet<RenderBox*, 4> PositionedObjectsListHashSet;
+ PositionedObjectsListHashSet* positionedObjects() const { return m_positionedObjects; }
void addPercentHeightDescendant(RenderBox*);
static void removePercentHeightDescendant(RenderBox*);
@@ -483,9 +485,10 @@ private:
void setCollapsedBottomMargin(const MarginInfo&);
// End helper functions and structs used by layoutBlockChildren.
- typedef ListHashSet<RenderBox*>::const_iterator Iterator;
+ typedef PositionedObjectsListHashSet::const_iterator Iterator;
DeprecatedPtrList<FloatingObject>* m_floatingObjects;
- ListHashSet<RenderBox*>* m_positionedObjects;
+
+ PositionedObjectsListHashSet* m_positionedObjects;
// An inline can be split with blocks occurring in between the inline content.
// When this occurs we need a pointer to our next object. We can basically be
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
index 3314772..a012868 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
@@ -325,6 +325,14 @@ void RenderLayer::updateLayerPositions(UpdateLayerPositionsFlags flags)
m_marquee->updateMarqueePosition();
}
+IntRect RenderLayer::repaintRectIncludingDescendants() const
+{
+ IntRect repaintRect = m_repaintRect;
+ for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
+ repaintRect.unite(child->repaintRectIncludingDescendants());
+ return repaintRect;
+}
+
void RenderLayer::computeRepaintRects()
{
RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint();
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
index 81a66e1..e221f28 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
@@ -394,6 +394,7 @@ public:
// Return a cached repaint rect, computed relative to the layer renderer's containerForRepaint.
IntRect repaintRect() const { return m_repaintRect; }
+ IntRect repaintRectIncludingDescendants() const;
void computeRepaintRects();
void updateRepaintRectsAfterScroll(bool fixed = false);
void setNeedsFullRepaint(bool f = true) { m_needsFullRepaint = f; }
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
index 7a25646..c4d240c 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
@@ -442,6 +442,8 @@ QRectF QGraphicsWebViewPrivate::graphicsItemVisibleRect() const
#if ENABLE(TILED_BACKING_STORE)
void QGraphicsWebViewPrivate::updateTiledBackingStoreScale()
{
+ if (!page)
+ return;
WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page->mainFrame())->tiledBackingStore();
if (!backingStore)
return;
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 0e73680..8fb929e 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,62 @@
+2010-06-28 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QGraphicsWebView crash when calling setScale() before setUrl()
+ https://bugs.webkit.org/show_bug.cgi?id=40000
+
+ Check 'page' before dereference in _q_scaleChanged()
+ Autotest included.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::_q_scaleChanged):
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (tst_QGraphicsWebView::crashOnSetScaleBeforeSetUrl):
+
+2010-06-24 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed Symbian build fix.
+
+ The QML WebKit integration needs to be part of QtWebKit.sis
+
+ * declarative/declarative.pro: Removed non-working deployment.
+
+2010-06-23 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Doc: Fixed documentation errors.
+
+ * docs/qtwebkit-bridge.qdoc:
+
+2010-06-23 Alessandro Portale <alessandro.portale@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Provide the Webkit Qml plugin with a UID3 on Symbian
+
+ ...otherwise we cannot Symbian sign it.
+
+ * declarative/declarative.pro:
+
+2010-06-23 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed Qt package build fix.
+
+ When building without build-webkit, set OUTPUT_DIR if necessary, like
+ in the other .pro files.
+
+ * declarative/declarative.pro:
+
+2010-06-22 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix compilation with QT_NO_COMBOBOX.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createSelectPopup):
+
2010-06-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by nobody, build fix.
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 7d1c794..e253161 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -576,7 +576,7 @@ QtAbstractWebPopup* ChromeClientQt::createSelectPopup()
#elif !defined(QT_NO_COMBOBOX)
return new QtFallbackWebPopup;
#else
- return result;
+ return 0;
#endif
}
diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro b/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro
index 1371e57..75268f3 100644
--- a/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro
+++ b/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro
@@ -6,6 +6,8 @@ CONFIG += qt plugin
win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../..
+
QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir
copy2build.input = QMLDIRFILE
CONFIG(QTDIR_build) {
@@ -65,13 +67,6 @@ qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
symbian:{
TARGET.UID3 = 0x20021321
- load(data_caging_paths)
- include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
-
- importFiles.sources = qmlwebkitplugin.dll qmldir
- importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
-
- DEPLOYMENT = importFiles
}
INSTALLS += target qmldir
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
index e06524d..a04ff17 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
@@ -34,6 +34,7 @@ private slots:
void crashOnViewlessWebPages();
void microFocusCoordinates();
void focusInputTypes();
+ void crashOnSetScaleBeforeSetUrl();
};
void tst_QGraphicsWebView::qgraphicswebview()
@@ -132,6 +133,13 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages()
delete page;
}
+void tst_QGraphicsWebView::crashOnSetScaleBeforeSetUrl()
+{
+ QGraphicsWebView* webView = new QGraphicsWebView;
+ webView->setScale(2.0);
+ delete webView;
+}
+
void tst_QGraphicsWebView::microFocusCoordinates()
{
QWebPage* page = new QWebPage;
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 04342e7..641b42b 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -168,7 +168,7 @@ Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer)
QUnifiedTimer::QUnifiedTimer() :
QObject(), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL),
currentAnimationIdx(0), consistentTiming(false), slowMode(false),
- isPauseTimerActive(false), runningLeafAnimations(0)
+ slowdownFactor(5.0f), isPauseTimerActive(false), runningLeafAnimations(0)
{
time.invalidate();
}
@@ -205,12 +205,18 @@ void QUnifiedTimer::ensureTimerUpdate()
void QUnifiedTimer::updateAnimationsTime()
{
+ qint64 totalElapsed = time.elapsed();
// ignore consistentTiming in case the pause timer is active
int delta = (consistentTiming && !isPauseTimerActive) ?
- timingInterval : time.elapsed() - lastTick;
- if (slowMode)
- delta /= 5;
- lastTick = time.elapsed();
+ timingInterval : totalElapsed - lastTick;
+ if (slowMode) {
+ if (slowdownFactor > 0)
+ delta = qRound(delta / slowdownFactor);
+ else
+ delta = 0;
+ }
+
+ lastTick = totalElapsed;
//we make sure we only call update time if the time has actually changed
//it might happen in some cases that the time doesn't change because events are delayed
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index fcfe824..d3d4098 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -145,8 +145,9 @@ public:
*/
void setConsistentTiming(bool consistent) { consistentTiming = consistent; }
- //this facilitates fine-tuning of complex animations
+ //these facilitate fine-tuning of complex animations
void setSlowModeEnabled(bool enabled) { slowMode = enabled; }
+ void setSlowdownFactor(qreal factor) { slowdownFactor = factor; }
/*
this is used for updating the currentTime of all animations in case the pause
@@ -171,11 +172,17 @@ private:
ElapsedTimer time;
- int lastTick;
+ qint64 lastTick;
int timingInterval;
int currentAnimationIdx;
bool consistentTiming;
bool slowMode;
+
+ // This factor will be used to divide the DEFAULT_TIMER_INTERVAL at each tick
+ // when slowMode is enabled. Setting it to 0 or higher than DEFAULT_TIMER_INTERVAL (16)
+ // stops all animations.
+ qreal slowdownFactor;
+
// bool to indicate that only pause animations are active
bool isPauseTimerActive;
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 1eab394..76f35ac 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -412,15 +412,13 @@ namespace QT_NAMESPACE {}
# if defined(__INTEL_COMPILER)
# define Q_CC_INTEL
# endif
-/* x64 does not support mmx intrinsics on windows */
-# if (defined(Q_OS_WIN64) && defined(_M_X64))
+/* MSVC does not support SSE/MMX on x64 */
+# if (defined(Q_CC_MSVC) && defined(_M_X64))
# undef QT_HAVE_SSE
-# undef QT_HAVE_SSE2
# undef QT_HAVE_MMX
# undef QT_HAVE_3DNOW
# endif
-
#elif defined(__BORLANDC__) || defined(__TURBOC__)
# define Q_CC_BOR
# define Q_INLINE_TEMPLATE
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index ea60792..26e587d 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1452,7 +1452,7 @@ qint64 QIODevicePrivate::peek(char *data, qint64 maxSize)
return readBytes;
buffer.ungetBlock(data, readBytes);
- pos -= readBytes;
+ *pPos -= readBytes;
return readBytes;
}
@@ -1467,7 +1467,7 @@ QByteArray QIODevicePrivate::peek(qint64 maxSize)
return result;
buffer.ungetBlock(result.constData(), result.size());
- pos -= result.size();
+ *pPos -= result.size();
return result;
}
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 64015ce..f802412 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -2274,9 +2274,9 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
be different instances of your application running at the same
time or different applications altogether) to read and write to
the same system locations. It uses advisory file locking and a
- smart merging algorithm to ensure data integrity. Changes
- performed by another process aren't visible in the current
- process until sync() is called.
+ smart merging algorithm to ensure data integrity. Note that sync()
+ imports changes made by other processes (in addition to writing
+ the changes from this QSettings).
\section1 Platform-Specific Notes
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index 9d8ee5a..e86efb2 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -100,40 +100,25 @@ static inline int qt_socket_select(int nfds, fd_set *readfds, fd_set *writefds,
class QSelectMutexGrabber
{
public:
- QSelectMutexGrabber(int fd, QMutex *threadMutex, QMutex *selectCallMutex)
- : m_threadMutex(threadMutex), m_selectCallMutex(selectCallMutex), bHasThreadLock(false)
+ QSelectMutexGrabber(int fd, QMutex *mutex)
+ : m_mutex(mutex)
{
- // see if selectThread is waiting m_waitCond
- // if yes ... dont write to pipe
- if (m_threadMutex->tryLock()) {
- bHasThreadLock = true;
+ if (m_mutex->tryLock())
return;
- }
-
- // still check that SelectThread
- // is in select call
- if (m_selectCallMutex->tryLock()) {
- m_selectCallMutex->unlock();
- return;
- }
char dummy = 0;
qt_pipe_write(fd, &dummy, 1);
- m_threadMutex->lock();
- bHasThreadLock = true;
+ m_mutex->lock();
}
~QSelectMutexGrabber()
{
- if(bHasThreadLock)
- m_threadMutex->unlock();
+ m_mutex->unlock();
}
private:
- QMutex *m_threadMutex;
- QMutex *m_selectCallMutex;
- bool bHasThreadLock;
+ QMutex *m_mutex;
};
/*
@@ -415,12 +400,7 @@ void QSelectThread::run()
int ret;
int savedSelectErrno;
- {
- // helps fighting the race condition between
- // selctthread and new socket requests (cancel, restart ...)
- QMutexLocker locker(&m_selectCallMutex);
- ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0);
- }
+ ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0);
savedSelectErrno = errno;
char buffer;
@@ -515,9 +495,7 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
start();
}
- QMutexLocker locker(&m_grabberMutex);
-
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
+ QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
Q_ASSERT(!m_AOStatuses.contains(notifier));
@@ -528,9 +506,7 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
{
- QMutexLocker locker(&m_grabberMutex);
-
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
+ QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
m_AOStatuses.remove(notifier);
@@ -539,9 +515,7 @@ void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
void QSelectThread::restart()
{
- QMutexLocker locker(&m_grabberMutex);
-
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
+ QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
m_waitCond.wakeAll();
}
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
index 211ded4..bc42753 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -211,26 +211,6 @@ private:
QMutex m_mutex;
QWaitCondition m_waitCond;
bool m_quit;
-
- // to protect when several
- // requests like:
- // requestSocketEvents
- // cancelSocketEvents
- // kick in the same time
- // all will fight for m_mutex
- //
- // TODO: fix more elegantely
- //
- QMutex m_grabberMutex;
-
- // this one will tell
- // if selectthread is
- // really in select call
- // and will prevent
- // writing to pipe that
- // causes later in locking
- // of the thread in waitcond
- QMutex m_selectCallMutex;
};
class Q_CORE_EXPORT CQtActiveScheduler : public CActiveScheduler
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index b538787..4a03874 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -276,12 +276,15 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc
++templdepth;
if (c == '>')
--templdepth;
- if (templdepth == 0) {
+ if (templdepth == 0 || (templdepth == 1 && c == ',')) {
result += normalizeTypeInternal(tt, t-1, fixScope, false);
result += c;
- if (*t == '>')
- result += ' '; // avoid >>
- break;
+ if (templdepth == 0) {
+ if (*t == '>')
+ result += ' '; // avoid >>
+ break;
+ }
+ tt = t;
}
}
}
diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp
index 9dc828d..8e8a88a 100644
--- a/src/corelib/thread/qsemaphore.cpp
+++ b/src/corelib/thread/qsemaphore.cpp
@@ -44,6 +44,8 @@
#ifndef QT_NO_THREAD
#include "qmutex.h"
#include "qwaitcondition.h"
+#include "qelapsedtimer.h"
+#include "qdatetime.h"
QT_BEGIN_NAMESPACE
@@ -218,8 +220,11 @@ bool QSemaphore::tryAcquire(int n, int timeout)
while (n > d->avail)
d->cond.wait(locker.mutex());
} else {
+ QElapsedTimer timer;
+ timer.start();
while (n > d->avail) {
- if (!d->cond.wait(locker.mutex(), timeout))
+ if (timer.hasExpired(timeout)
+ || !d->cond.wait(locker.mutex(), timeout - timer.elapsed()))
return false;
}
}
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 05d38f6..b46af1f 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -1805,6 +1805,11 @@ QByteArray &QByteArray::replace(int pos, int len, const QByteArray &after)
/*! \fn QByteArray &QByteArray::replace(int pos, int len, const char *after)
\overload
+
+ Replaces \a len bytes from index position \a pos with the zero terminated
+ string \a after.
+
+ Notice: this can change the lenght of the byte array.
*/
QByteArray &QByteArray::replace(int pos, int len, const char *after)
{
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index cbe6146..58d2dcb 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -58,7 +58,8 @@ QT_BEGIN_HEADER
#endif
// SSE intrinsics
-#if defined(__SSE2__) && defined(QT_HAVE_SSE2) && !defined(QT_BOOTSTRAPPED)
+#if defined(QT_HAVE_SSE2) && !defined(QT_BOOTSTRAPPED) && (defined(__SSE2__) \
+ || (defined(Q_CC_MSVC) && (defined(_M_X64) || _M_IX86_FP == 2)))
#if defined(QT_LINUXBASE)
/// this is an evil hack - the posix_memalign declaration in LSB
/// is wrong - see http://bugs.linuxbase.org/show_bug.cgi?id=2431
diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp
index 2221d78..60e9dd3 100644
--- a/src/declarative/qml/qdeclarativecontext.cpp
+++ b/src/declarative/qml/qdeclarativecontext.cpp
@@ -660,10 +660,9 @@ void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
scriptContext->pushScope(enginePriv->contextClass->newUrlContext(url));
- scriptContext->pushScope(enginePriv->globalClass->globalObject());
+ scriptContext->pushScope(enginePriv->globalClass->staticGlobalObject());
- QScriptValue scope = scriptEngine->newObject();
- scriptContext->setActivationObject(scope);
+ QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(scriptEngine);
scriptContext->pushScope(scope);
scriptEngine->evaluate(code, url, 1);
@@ -686,10 +685,9 @@ void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
scriptContext->pushScope(enginePriv->contextClass->newUrlContext(this, 0, url));
- scriptContext->pushScope(enginePriv->globalClass->globalObject());
-
- QScriptValue scope = scriptEngine->newObject();
- scriptContext->setActivationObject(scope);
+ scriptContext->pushScope(enginePriv->globalClass->staticGlobalObject());
+
+ QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(scriptEngine);
scriptContext->pushScope(scope);
scriptEngine->evaluate(code, url, 1);
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 5c4d229..86053c4 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -183,11 +183,11 @@ data types. This is primarily useful when setting the properties of an item
when the property has one of the following types:
\list
-\o \c color - use \l{Qt::rgba()}{Qt.rgba()}, \l{Qt::hsla()}{Qt.hsla()}, \l{Qt::darker()}{Qt.darker()}, \l{Qt::lighter()}{Qt.lighter()} or \l{Qt::tint()}{Qt.tint()}
-\o \c rect - use \l{Qt::rect()}{Qt.rect()}
-\o \c point - use \l{Qt::point()}{Qt.point()}
-\o \c size - use \l{Qt::size()}{Qt.size()}
-\o \c vector3d - use \l{Qt::vector3d()}{Qt.vector3d()}
+\o \c color - use \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()}, \l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()}
+\o \c rect - use \l{QML:Qt::rect()}{Qt.rect()}
+\o \c point - use \l{QML:Qt::point()}{Qt.point()}
+\o \c size - use \l{QML:Qt::size()}{Qt.size()}
+\o \c vector3d - use \l{QML:Qt::vector3d()}{Qt.vector3d()}
\endlist
There are also string based constructors for these types. See \l{qdeclarativebasictypes.html}{QML Basic Types} for more information.
@@ -197,12 +197,12 @@ There are also string based constructors for these types. See \l{qdeclarativebas
The Qt object contains several functions for formatting dates and times.
\list
- \o \l{Qt::formatDateTime}{string Qt.formatDateTime(datetime date, variant format)}
- \o \l{Qt::formatDate}{string Qt.formatDate(datetime date, variant format)}
- \o \l{Qt::formatTime}{string Qt.formatTime(datetime date, variant format)}
+ \o \l{QML:Qt::formatDateTime}{string Qt.formatDateTime(datetime date, variant format)}
+ \o \l{QML:Qt::formatDate}{string Qt.formatDate(datetime date, variant format)}
+ \o \l{QML:Qt::formatTime}{string Qt.formatTime(datetime date, variant format)}
\endlist
-The format specification is described at \l{Qt::formatDateTime}{Qt.formatDateTime}.
+The format specification is described at \l{QML:Qt::formatDateTime}{Qt.formatDateTime}.
\section1 Dynamic Object Creation
@@ -211,8 +211,8 @@ items from files or strings. See \l{Dynamic Object Management} for an overview
of their use.
\list
- \o \l{Qt::createComponent()}{object Qt.createComponent(url)}
- \o \l{Qt::createQmlObject()}{object Qt.createQmlObject(string qml, object parent, string filepath)}
+ \o \l{QML:Qt::createComponent()}{object Qt.createComponent(url)}
+ \o \l{QML:Qt::createQmlObject()}{object Qt.createQmlObject(string qml, object parent, string filepath)}
\endlist
*/
diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp
index b1aecfa..8ae5f2f 100644
--- a/src/declarative/qml/qdeclarativeexpression.cpp
+++ b/src/declarative/qml/qdeclarativeexpression.cpp
@@ -145,7 +145,7 @@ void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, void *ex
if (!dd->cachedClosures.at(progIdx)) {
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
scriptContext->pushScope(ep->contextClass->newSharedContext());
- scriptContext->pushScope(ep->globalClass->globalObject());
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
dd->cachedClosures[progIdx] = new QScriptValue(scriptEngine->evaluate(data->expression, data->url, data->line));
scriptEngine->popContext();
}
@@ -188,7 +188,7 @@ QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContex
} else {
scriptContext->pushScope(ep->contextClass->newContext(context, object));
}
- scriptContext->pushScope(ep->globalClass->globalObject());
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
QScriptValue rv = ep->scriptEngine.evaluate(program, fileName, lineNumber);
ep->scriptEngine.popContext();
return rv;
@@ -206,7 +206,7 @@ QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContex
} else {
scriptContext->pushScope(ep->contextClass->newContext(context, object));
}
- scriptContext->pushScope(ep->globalClass->globalObject());
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
QScriptValue rv = ep->scriptEngine.evaluate(program);
ep->scriptEngine.popContext();
return rv;
@@ -369,7 +369,7 @@ QScriptValue QDeclarativeExpressionPrivate::eval(QObject *secondaryScope, bool *
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
data->expressionContext = ep->contextClass->newContext(data->context(), data->me);
scriptContext->pushScope(data->expressionContext);
- scriptContext->pushScope(ep->globalClass->globalObject());
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
if (data->expressionRewritten) {
data->expressionFunction = scriptEngine->evaluate(data->expression,
diff --git a/src/declarative/qml/qdeclarativeglobalscriptclass.cpp b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
index 6e107fb..39ea101 100644
--- a/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
@@ -41,10 +41,13 @@
#include "private/qdeclarativeglobalscriptclass_p.h"
+#include <QtCore/qvector.h>
#include <QtScript/qscriptstring.h>
#include <QtScript/qscriptengine.h>
#include <QtScript/qscriptvalueiterator.h>
+#include <private/qscriptdeclarativeclass_p.h>
+
QT_BEGIN_NAMESPACE
/*
@@ -55,23 +58,31 @@ QDeclarativeGlobalScriptClass::QDeclarativeGlobalScriptClass(QScriptEngine *engi
{
QString eval = QLatin1String("eval");
- QScriptValue globalObject = engine->globalObject();
+ QScriptValue originalGlobalObject = engine->globalObject();
- m_globalObject = engine->newObject();
QScriptValue newGlobalObject = engine->newObject();
- QScriptValueIterator iter(globalObject);
-
- while (iter.hasNext()) {
- iter.next();
-
- QString name = iter.name();
-
- if (name != eval)
- m_globalObject.setProperty(iter.scriptName(), iter.value());
- newGlobalObject.setProperty(iter.scriptName(), iter.value());
-
- m_illegalNames.insert(name);
+ {
+ QScriptValueIterator iter(originalGlobalObject);
+ QVector<QString> names;
+ QVector<QScriptValue> values;
+ QVector<QScriptValue::PropertyFlags> flags;
+ while (iter.hasNext()) {
+ iter.next();
+
+ QString name = iter.name();
+
+ if (name != eval) {
+ names.append(name);
+ values.append(iter.value());
+ flags.append(iter.flags() | QScriptValue::Undeletable);
+ }
+ newGlobalObject.setProperty(iter.scriptName(), iter.value());
+
+ m_illegalNames.insert(name);
+ }
+ m_staticGlobalObject = QScriptDeclarativeClass::newStaticScopeObject(
+ engine, names.size(), names.constData(), values.constData(), flags.constData());
}
newGlobalObject.setScriptClass(this);
diff --git a/src/declarative/qml/qdeclarativeglobalscriptclass_p.h b/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
index 7690edd..414bf02 100644
--- a/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
@@ -75,13 +75,13 @@ public:
void explicitSetProperty(const QString &, const QScriptValue &);
- const QScriptValue &globalObject() const { return m_globalObject; }
+ const QScriptValue &staticGlobalObject() const { return m_staticGlobalObject; }
const QSet<QString> &illegalNames() const { return m_illegalNames; }
private:
QSet<QString> m_illegalNames;
- QScriptValue m_globalObject;
+ QScriptValue m_staticGlobalObject;
};
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeinclude.cpp b/src/declarative/qml/qdeclarativeinclude.cpp
index c29005a..f26b54f 100644
--- a/src/declarative/qml/qdeclarativeinclude.cpp
+++ b/src/declarative/qml/qdeclarativeinclude.cpp
@@ -240,7 +240,7 @@ QScriptValue QDeclarativeInclude::include(QScriptContext *ctxt, QScriptEngine *e
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(engine);
scriptContext->pushScope(ep->contextClass->newUrlContext(context, 0, urlString));
- scriptContext->pushScope(ep->globalClass->globalObject());
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
QScriptValue scope = QScriptDeclarativeClass::scopeChainValue(ctxt, -5);
scriptContext->pushScope(scope);
scriptContext->setActivationObject(scope);
diff --git a/src/gui/accessible/qaccessible_mac_cocoa.mm b/src/gui/accessible/qaccessible_mac_cocoa.mm
index 1688404..ada927e 100644
--- a/src/gui/accessible/qaccessible_mac_cocoa.mm
+++ b/src/gui/accessible/qaccessible_mac_cocoa.mm
@@ -58,11 +58,15 @@ QT_BEGIN_NAMESPACE
//#define MAC_ACCESSIBILTY_DEVELOPER_MODE
+#ifndef QT_NO_DEBUG_STREAM
#ifdef MAC_ACCESSIBILTY_DEVELOPER_MODE
#define MAC_ACCESSIBILTY_DEBUG QT_PREPEND_NAMESPACE(qDebug)
#else
#define MAC_ACCESSIBILTY_DEBUG if (0) QT_PREPEND_NAMESPACE(qDebug)
#endif
+#else
+#define MAC_ACCESSIBILTY_DEBUG if (0) QT_PREPEND_NAMESPACE(QNoDebug)
+#endif
typedef QMap<QAccessible::Role, NSString *> QMacAccessibiltyRoleMap;
Q_GLOBAL_STATIC(QMacAccessibiltyRoleMap, qMacAccessibiltyRoleMap);
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index 5e4e49e..0029017 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -488,13 +488,10 @@ void QGraphicsEffect::setEnabled(bool enable)
*/
/*!
- Schedules a redraw of the source. Call this function whenever the source
- needs to be redrawn.
-
- This convenience function is equivalent to calling
- QGraphicsEffectSource::update().
+ Schedules a redraw of the effect. Call this function whenever the effect
+ needs to be redrawn. This function does not trigger a redraw of the source.
- \sa updateBoundingRect(), QGraphicsEffectSource::update()
+ \sa updateBoundingRect()
*/
void QGraphicsEffect::update()
{
diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp
index 969acc4..fea6e8d 100644
--- a/src/gui/egl/qegl_x11.cpp
+++ b/src/gui/egl/qegl_x11.cpp
@@ -415,7 +415,10 @@ EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig config, const QEg
// At this point, the widget's window should be created and have the correct visual. Now we
// just need to create the EGL surface for it:
- return eglCreateWindowSurface(QEgl::display(), config, (EGLNativeWindowType)widget->winId(), 0);
+ EGLSurface surf = eglCreateWindowSurface(QEgl::display(), config, (EGLNativeWindowType)widget->winId(), 0);
+ if (surf == EGL_NO_SURFACE)
+ qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
+ return surf;
}
if (x11PixmapData) {
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 2de3638..61285d2 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -411,6 +411,11 @@
these notifications are disabled by default. You must enable this flag
to receive notifications for scene position changes. This flag was
introduced in Qt 4.6.
+
+ \omitvalue ItemStopsClickFocusPropagation \omit The item stops propagating
+ click focus to items underneath when being clicked on. This flag
+ allows you create a non-focusable item that can be clicked on without
+ changing the focus. \endomit
*/
/*!
@@ -11432,6 +11437,9 @@ QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlag flag)
case QGraphicsItem::ItemSendsScenePositionChanges:
str = "ItemSendsScenePositionChanges";
break;
+ case QGraphicsItem::ItemStopsClickFocusPropagation:
+ str = "ItemStopsClickFocusPropagation";
+ break;
}
debug << str;
return debug;
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index d7d5332..3c193cd 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -106,7 +106,8 @@ public:
ItemNegativeZStacksBehindParent = 0x2000,
ItemIsPanel = 0x4000,
ItemIsFocusScope = 0x8000, // internal
- ItemSendsScenePositionChanges = 0x10000
+ ItemSendsScenePositionChanges = 0x10000,
+ ItemStopsClickFocusPropagation = 0x20000
// NB! Don't forget to increase the d_ptr->flags bit field by 1 when adding a new flag.
};
Q_DECLARE_FLAGS(GraphicsItemFlags, GraphicsItemFlag)
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index bde6e7d..f9f5d3d 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -556,7 +556,7 @@ public:
quint32 dirtyChildrenBoundingRect : 1;
// Packed 32 bits
- quint32 flags : 17;
+ quint32 flags : 18;
quint32 paintedViewBoundingRectsNeedRepaint : 1;
quint32 dirtySceneTransform : 1;
quint32 geometryChanged : 1;
@@ -571,9 +571,9 @@ public:
quint32 notifyBoundingRectChanged : 1;
quint32 notifyInvalidated : 1;
quint32 mouseSetsFocus : 1;
- quint32 explicitActivate : 1;
// New 32 bits
+ quint32 explicitActivate : 1;
quint32 wantsActive : 1;
quint32 holesInSiblingIndex : 1;
quint32 sequentialOrdering : 1;
@@ -582,7 +582,7 @@ public:
quint32 pendingPolish : 1;
quint32 mayHaveChildWithGraphicsEffect : 1;
quint32 isDeclarativeItem : 1;
- quint32 padding : 24;
+ quint32 padding : 23;
// Optional stacking order
int globalStackingOrder;
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index ca3b56f..d04074a 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -1336,6 +1336,8 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou
break;
}
}
+ if (item->d_ptr->flags & QGraphicsItem::ItemStopsClickFocusPropagation)
+ break;
if (item->isPanel())
break;
}
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index fd2c139..ef9be8f 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -2018,7 +2018,7 @@ void QPixmap::detach()
the color table. If this is too expensive an operation, you can
use QBitmap::fromImage() instead.
- \sa toImage(), {QPixmap#Pixmap Conversion}{Pixmap Conversion}
+ \sa fromImageReader(), toImage(), {QPixmap#Pixmap Conversion}{Pixmap Conversion}
*/
QPixmap QPixmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags)
{
@@ -2033,6 +2033,27 @@ QPixmap QPixmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags)
}
/*!
+ \fn QPixmap QPixmap::fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags)
+
+ Create a QPixmap from an image read directly from an \a imageReader.
+ The \a flags argument is a bitwise-OR of the \l{Qt::ImageConversionFlags}.
+ Passing 0 for \a flags sets all the default options.
+
+ On some systems, reading an image directly to QPixmap can use less memory than
+ reading a QImage to convert it to QPixmap.
+
+ \sa fromImage(), toImage(), {QPixmap#Pixmap Conversion}{Pixmap Conversion}
+*/
+QPixmap QPixmap::fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags)
+{
+ QGraphicsSystem *gs = QApplicationPrivate::graphicsSystem();
+ QScopedPointer<QPixmapData> data(gs ? gs->createPixmapData(QPixmapData::PixmapType)
+ : QGraphicsSystem::createDefaultPixmapData(QPixmapData::PixmapType));
+ data->fromImageReader(imageReader, flags);
+ return QPixmap(data.take());
+}
+
+/*!
\fn QPixmap QPixmap::grabWindow(WId window, int x, int y, int
width, int height)
diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h
index 82546da..64ca8a3 100644
--- a/src/gui/image/qpixmap.h
+++ b/src/gui/image/qpixmap.h
@@ -62,6 +62,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
class QImageWriter;
+class QImageReader;
class QColor;
class QVariant;
class QX11Info;
@@ -134,6 +135,7 @@ public:
QImage toImage() const;
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ static QPixmap fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags = Qt::AutoColor);
bool load(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
bool loadFromData(const uchar *buf, uint len, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index e188745..53f3559 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -152,6 +152,17 @@ void QRasterPixmapData::fromImage(const QImage &sourceImage,
createPixmapForImage(image, flags, /* inplace = */false);
}
+void QRasterPixmapData::fromImageReader(QImageReader *imageReader,
+ Qt::ImageConversionFlags flags)
+{
+ Q_UNUSED(flags);
+ QImage image = imageReader->read();
+ if (image.isNull())
+ return;
+
+ createPixmapForImage(image, flags, /* inplace = */true);
+}
+
// from qwindowsurface.cpp
extern void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset);
diff --git a/src/gui/image/qpixmap_raster_p.h b/src/gui/image/qpixmap_raster_p.h
index a46e054..36a9b2f 100644
--- a/src/gui/image/qpixmap_raster_p.h
+++ b/src/gui/image/qpixmap_raster_p.h
@@ -74,6 +74,7 @@ public:
void fromFile(const QString &filename, Qt::ImageConversionFlags flags);
bool fromData(const uchar *buffer, uint len, const char *format, Qt::ImageConversionFlags flags);
void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
+ void fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags);
void copy(const QPixmapData *data, const QRect &rect);
bool scroll(int dx, int dy, const QRect &rect);
diff --git a/src/gui/image/qpixmapdata.cpp b/src/gui/image/qpixmapdata.cpp
index 345e3cf..ef1f6c4 100644
--- a/src/gui/image/qpixmapdata.cpp
+++ b/src/gui/image/qpixmapdata.cpp
@@ -124,6 +124,13 @@ static QImage makeBitmapCompliantIfNeeded(QPixmapData *d, const QImage &image, Q
return image;
}
+void QPixmapData::fromImageReader(QImageReader *imageReader,
+ Qt::ImageConversionFlags flags)
+{
+ const QImage image = imageReader->read();
+ fromImage(image, flags);
+}
+
bool QPixmapData::fromFile(const QString &fileName, const char *format,
Qt::ImageConversionFlags flags)
{
diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h
index 9a1505a..ec62b0b 100644
--- a/src/gui/image/qpixmapdata_p.h
+++ b/src/gui/image/qpixmapdata_p.h
@@ -58,6 +58,8 @@
QT_BEGIN_NAMESPACE
+class QImageReader;
+
class Q_GUI_EXPORT QPixmapData
{
public:
@@ -83,6 +85,8 @@ public:
virtual void resize(int width, int height) = 0;
virtual void fromImage(const QImage &image,
Qt::ImageConversionFlags flags) = 0;
+ virtual void fromImageReader(QImageReader *imageReader,
+ Qt::ImageConversionFlags flags);
virtual bool fromFile(const QString &filename, const char *format,
Qt::ImageConversionFlags flags);
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 2a85fdc..ef719ca 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -3065,6 +3065,11 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
break;
}
}
+#ifndef Q_OS_WINCE
+ static bool trackMouseEventLookup = false;
+ typedef BOOL (WINAPI *PtrTrackMouseEvent)(LPTRACKMOUSEEVENT);
+ static PtrTrackMouseEvent ptrTrackMouseEvent = 0;
+#endif
state = translateButtonState(msg.wParam, type, button); // button state
const QPoint widgetPos = mapFromGlobal(QPoint(msg.pt.x, msg.pt.y));
QWidget *alienWidget = !internalWinId() ? this : childAt(widgetPos);
@@ -3129,9 +3134,6 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
#ifndef Q_OS_WINCE
if (curWin != 0) {
- static bool trackMouseEventLookup = false;
- typedef BOOL (WINAPI *PtrTrackMouseEvent)(LPTRACKMOUSEEVENT);
- static PtrTrackMouseEvent ptrTrackMouseEvent = 0;
if (!trackMouseEventLookup) {
trackMouseEventLookup = true;
ptrTrackMouseEvent = (PtrTrackMouseEvent)QLibrary::resolve(QLatin1String("comctl32"), "_TrackMouseEvent");
@@ -3245,6 +3247,21 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
qt_button_down = 0;
}
+#ifndef Q_OS_WINCE
+ if (type == QEvent::MouseButtonPress
+ && QApplication::activePopupWidget() != activePopupWidget
+ && ptrTrackMouseEvent
+ && curWin) {
+ // Since curWin is already the window we clicked on,
+ // we have to setup the mouse tracking here.
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(TRACKMOUSEEVENT);
+ tme.dwFlags = 0x00000002; // TME_LEAVE
+ tme.hwndTrack = curWin; // Track on window receiving msgs
+ tme.dwHoverTime = (DWORD)-1; // HOVER_DEFAULT
+ ptrTrackMouseEvent(&tme);
+ }
+#endif
if (type == QEvent::MouseButtonPress
&& QApplication::activePopupWidget() != activePopupWidget
&& replayPopupMouseEvent) {
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 3664743..e4d9848 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -2155,7 +2155,7 @@ void qt_init(QApplicationPrivate *priv, int,
X11->fc_scale = fc_scale;
for (int s = 0; s < ScreenCount(X11->display); ++s) {
int subpixel = FC_RGBA_UNKNOWN;
-#if RENDER_MAJOR > 0 || RENDER_MINOR >= 6
+#if !defined(QT_NO_XRENDER) && (RENDER_MAJOR > 0 || RENDER_MINOR >= 6)
if (X11->use_xrender) {
int rsp = XRenderQuerySubpixelOrder(X11->display, s);
switch (rsp) {
diff --git a/src/gui/kernel/qkeymapper_mac.cpp b/src/gui/kernel/qkeymapper_mac.cpp
index 873b8f9..3dc6afc 100644
--- a/src/gui/kernel/qkeymapper_mac.cpp
+++ b/src/gui/kernel/qkeymapper_mac.cpp
@@ -866,14 +866,27 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, EventHandlerCallRef e
UInt32 macModifiers = 0;
GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, 0,
sizeof(macModifiers), 0, &macModifiers);
+#ifdef QT_MAC_USE_COCOA
+ // The unicode characters in the range 0xF700-0xF747 are reserved
+ // by Mac OS X for transient use as keyboard function keys. We
+ // wont send 'text' for such key events. This is done to match
+ // behavior on other platforms.
+ unsigned int *unicodeKey = (unsigned int*)info;
+ if (*unicodeKey >= 0xf700 && *unicodeKey <= 0xf747)
+ text = QString();
+ bool isAccepted;
+#endif
handled_event = QKeyMapper::sendKeyEvent(widget, grab,
(ekind == kEventRawKeyUp) ? QEvent::KeyRelease : QEvent::KeyPress,
qtKey, modifiers, text, ekind == kEventRawKeyRepeat, 0,
macScanCode, macVirtualKey, macModifiers
#ifdef QT_MAC_USE_COCOA
- ,static_cast<bool *>(info)
+ ,&isAccepted
#endif
);
+#ifdef QT_MAC_USE_COCOA
+ *unicodeKey = (unsigned int)isAccepted;
+#endif
}
return handled_event;
}
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm
index 8cef03c..3fc27f4 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
+++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
@@ -682,10 +682,12 @@ bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEve
NSEvent *event = static_cast<NSEvent *>(keyEvent);
EventRef key_event = static_cast<EventRef>(const_cast<void *>([event eventRef]));
Q_ASSERT(key_event);
+ unsigned int info = 0;
if ([event type] == NSKeyDown) {
NSString *characters = [event characters];
unichar value = [characters characterAtIndex:0];
qt_keymapper_private()->updateKeyMap(0, key_event, (void *)&value);
+ info = value;
}
// Redirect keys to alien widgets.
@@ -701,9 +703,8 @@ bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEve
if (mustUseCocoaKeyEvent())
return qt_dispatchKeyEventWithCocoa(keyEvent, widgetToGetEvent);
- bool isAccepted;
- bool consumed = qt_keymapper_private()->translateKeyEvent(widgetToGetEvent, 0, key_event, &isAccepted, true);
- return consumed && isAccepted;
+ bool consumed = qt_keymapper_private()->translateKeyEvent(widgetToGetEvent, 0, key_event, &info, true);
+ return consumed && (info != 0);
#endif
}
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 280712a..a9bb691 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2804,7 +2804,7 @@ void QWidgetPrivate::setSubWindowStacking(bool set)
QList<QWidget *> widgets = q->findChildren<QWidget *>();
for (int i=0; i<widgets.size(); ++i) {
QWidget *child = widgets.at(i);
- if (child->isWindow() && child->testAttribute(Qt::WA_WState_Created)) {
+ if (child->isWindow() && child->testAttribute(Qt::WA_WState_Created) && child->isVisibleTo(q)) {
if (set)
[qt_mac_window_for(q) addChildWindow:qt_mac_window_for(child) ordered:NSWindowAbove];
else
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 68f9470..3f351d9 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -738,9 +738,6 @@ void QWidgetPrivate::s60UpdateIsOpaque()
if (!q->testAttribute(Qt::WA_WState_Created) || !q->testAttribute(Qt::WA_TranslucentBackground))
return;
- if ((data.window_flags & Qt::FramelessWindowHint) == 0)
- return;
-
RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index 04fe825..6cd8688 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -299,7 +299,7 @@ void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
void QT_FASTCALL comp_func_SourceOver_sse2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha)
{
- Q_ASSERT(const_alpha > 0); // if const_alpha == 0, this should never be called
+ Q_ASSERT(const_alpha >= 0);
Q_ASSERT(const_alpha < 256);
const quint32 *src = (const quint32 *) srcPixels;
diff --git a/src/gui/painting/qgraphicssystem.cpp b/src/gui/painting/qgraphicssystem.cpp
index 2ea3d33..69ce47e 100644
--- a/src/gui/painting/qgraphicssystem.cpp
+++ b/src/gui/painting/qgraphicssystem.cpp
@@ -79,5 +79,9 @@ QPixmapData *QGraphicsSystem::createDefaultPixmapData(QPixmapData::PixelType typ
return 0;
}
+QPixmapData *QGraphicsSystem::createPixmapData(QPixmapData *origin)
+{
+ return createPixmapData(origin->pixelType());
+}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qgraphicssystem_p.h b/src/gui/painting/qgraphicssystem_p.h
index ddca788..1211505 100644
--- a/src/gui/painting/qgraphicssystem_p.h
+++ b/src/gui/painting/qgraphicssystem_p.h
@@ -64,6 +64,7 @@ class Q_GUI_EXPORT QGraphicsSystem
{
public:
virtual QPixmapData *createPixmapData(QPixmapData::PixelType type) const = 0;
+ virtual QPixmapData *createPixmapData(QPixmapData *origin);
virtual QWindowSurface *createWindowSurface(QWidget *widget) const = 0;
virtual ~QGraphicsSystem() = 0;
diff --git a/src/gui/painting/qgraphicssystem_runtime.cpp b/src/gui/painting/qgraphicssystem_runtime.cpp
index 32a8578..1c3ae10 100644
--- a/src/gui/painting/qgraphicssystem_runtime.cpp
+++ b/src/gui/painting/qgraphicssystem_runtime.cpp
@@ -416,7 +416,7 @@ void QRuntimeGraphicsSystem::setGraphicsSystem(const QString &name)
for (int i = 0; i < m_pixmapDatas.size(); ++i) {
QRuntimePixmapData *proxy = m_pixmapDatas.at(i);
- QPixmapData *newData = m_graphicsSystem->createPixmapData(proxy->m_data->pixelType());
+ QPixmapData *newData = m_graphicsSystem->createPixmapData(proxy->m_data);
// ### TODO Optimize. Openvg and s60raster graphics systems could switch internal ARGB32_PRE QImage buffers.
newData->fromImage(proxy->m_data->toImage(), Qt::AutoColor | Qt::OrderedAlphaDither);
delete proxy->m_data;
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 71bc990..2ea6673 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5958,7 +5958,7 @@ void QPainter::drawText(const QPointF &p, const QString &str, int tf, int justif
Q_ASSERT_X(false, Q_FUNC_INFO, "stringToCMap shouldn't fail twice");
}
- QTextItemInt gf(glyphs, &d->state->font, fontEngine);
+ QTextItemInt gf(glyphs, &d->state->font, str.data(), len, fontEngine);
drawTextItem(p, gf);
return;
}
diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp
index 78553c9..a17b7c1 100644
--- a/src/gui/painting/qpathclipper.cpp
+++ b/src/gui/painting/qpathclipper.cpp
@@ -86,9 +86,11 @@ static qreal dot(const QPointF &a, const QPointF &b)
return a.x() * b.x() + a.y() * b.y();
}
-static QPointF normalize(const QPointF &p)
+static void normalize(double &x, double &y)
{
- return p / qSqrt(p.x() * p.x() + p.y() * p.y());
+ double reciprocal = 1 / qSqrt(x * x + y * y);
+ x *= reciprocal;
+ y *= reciprocal;
}
struct QIntersection
@@ -1017,8 +1019,8 @@ qreal QWingedEdge::delta(int vertex, int a, int b) const
const QPathEdge *ap = edge(a);
const QPathEdge *bp = edge(b);
- qreal a_angle = ap->angle;
- qreal b_angle = bp->angle;
+ double a_angle = ap->angle;
+ double b_angle = bp->angle;
if (vertex == ap->second)
a_angle = ap->invAngle;
@@ -1026,7 +1028,7 @@ qreal QWingedEdge::delta(int vertex, int a, int b) const
if (vertex == bp->second)
b_angle = bp->invAngle;
- qreal result = b_angle - a_angle;
+ double result = b_angle - a_angle;
if (result >= 128.)
return result - 128.;
@@ -1036,26 +1038,6 @@ qreal QWingedEdge::delta(int vertex, int a, int b) const
return result;
}
-static inline QPointF tangentAt(const QWingedEdge &list, int vi, int ei)
-{
- const QPathEdge *ep = list.edge(ei);
- Q_ASSERT(ep);
-
- qreal sign;
-
- if (ep->first == vi) {
- sign = 1;
- } else {
- sign = -1;
- }
-
- const QPointF a = *list.vertex(ep->first);
- const QPointF b = *list.vertex(ep->second);
- QPointF normal = b - a;
-
- return normalize(sign * normal);
-}
-
static inline QPointF midPoint(const QWingedEdge &list, int ei)
{
const QPathEdge *ep = list.edge(ei);
@@ -1191,7 +1173,7 @@ static int commonEdge(const QWingedEdge &list, int a, int b)
return -1;
}
-static qreal computeAngle(const QPointF &v)
+static double computeAngle(const QPointF &v)
{
#if 1
if (v.x() == 0) {
@@ -1200,15 +1182,17 @@ static qreal computeAngle(const QPointF &v)
return v.x() <= 0 ? 32. : 96.;
}
- QPointF nv = normalize(v);
- if (nv.y() < 0) {
- if (nv.x() < 0) { // 0 - 32
- return -32. * nv.x();
+ double vx = v.x();
+ double vy = v.y();
+ normalize(vx, vy);
+ if (vy < 0) {
+ if (vx < 0) { // 0 - 32
+ return -32. * vx;
} else { // 96 - 128
- return 128. - 32. * nv.x();
+ return 128. - 32. * vx;
}
} else { // 32 - 96
- return 64. + 32 * nv.x();
+ return 64. + 32. * vx;
}
#else
// doesn't seem to be robust enough
diff --git a/src/gui/painting/qpathclipper_p.h b/src/gui/painting/qpathclipper_p.h
index fab618d..bdad4e1 100644
--- a/src/gui/painting/qpathclipper_p.h
+++ b/src/gui/painting/qpathclipper_p.h
@@ -148,8 +148,8 @@ public:
int first;
int second;
- qreal angle;
- qreal invAngle;
+ double angle;
+ double invAngle;
int next(Traversal traversal, Direction direction) const;
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 4bb2ea8..2527662 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -50,17 +50,17 @@
#include "qapplication.h"
#include <w32std.h>
-#include <aknsconstants.h>
+#include <AknsConstants.h>
#include <aknconsts.h>
-#include <aknsitemid.h>
-#include <aknsutils.h>
-#include <aknsdrawutils.h>
-#include <aknsskininstance.h>
-#include <aknsbasicbackgroundcontrolcontext.h>
+#include <AknsItemID.h>
+#include <AknsUtils.h>
+#include <AknsDrawUtils.h>
+#include <AknsSkinInstance.h>
+#include <AknsBasicBackgroundControlContext.h>
#include <avkon.mbg>
#include <aknfontaccess.h>
#include <aknlayoutfont.h>
-#include <aknutils.h>
+#include <AknUtils.h>
#include <aknnavi.h>
#include <gulicon.h>
#include <aknbitmapanimation.h>
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 139139f..e6c36a4 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -413,7 +413,7 @@ struct QtFontFamily
bool fixedPitchComputed : 1;
#endif
#ifdef Q_WS_X11
- bool symbol_checked;
+ bool symbol_checked : 1;
#endif
QString name;
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index 5148568..0b38aab 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -162,6 +162,8 @@ void qt_cleanup_symbianFontDatabaseExtras()
{
const QSymbianFontDatabaseExtrasImplementation *dbExtras =
static_cast<const QSymbianFontDatabaseExtrasImplementation*>(privateDb()->symbianExtras);
+ if (!dbExtras)
+ return; // initializeDb() has never been called
#ifdef Q_SYMBIAN_HAS_FONTTABLE_API
qDeleteAll(dbExtras->m_extrasHash);
#else // Q_SYMBIAN_HAS_FONTTABLE_API
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 60195a8..439f2a4 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2668,9 +2668,9 @@ QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFo
flags |= QTextItem::StrikeOut;
}
-QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, QFontEngine *fe)
+QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars_, int numChars, QFontEngine *fe)
: flags(0), justified(false), underlineStyle(QTextCharFormat::NoUnderline),
- num_chars(0), chars(0), logClusters(0), f(font), glyphs(g), fontEngine(fe)
+ num_chars(numChars), chars(chars_), logClusters(0), f(font), glyphs(g), fontEngine(fe)
{
}
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index 908a0ec..e623fa5 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -311,7 +311,7 @@ public:
logClusters(0), f(0), fontEngine(0)
{}
QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat());
- QTextItemInt(const QGlyphLayout &g, QFont *font, QFontEngine *fe);
+ QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars, int numChars, QFontEngine *fe);
/// copy the structure items, adjusting the glyphs arrays to the right subarrays.
/// the width of the returned QTextItemInt is not adjusted, for speed reasons
diff --git a/src/gui/widgets/qcommandlinkbutton.cpp b/src/gui/widgets/qcommandlinkbutton.cpp
index e8fe299..d3b5869 100644
--- a/src/gui/widgets/qcommandlinkbutton.cpp
+++ b/src/gui/widgets/qcommandlinkbutton.cpp
@@ -118,7 +118,7 @@ public:
int topMargin() const { return 10; }
int leftMargin() const { return 7; }
int rightMargin() const { return 4; }
- int bottomMargin() const { return 4; }
+ int bottomMargin() const { return 10; }
QString description;
QColor currentColor;
@@ -174,8 +174,15 @@ QFont QCommandLinkButtonPrivate::descriptionFont() const
QRect QCommandLinkButtonPrivate::titleRect() const
{
Q_Q(const QCommandLinkButton);
- return q->rect().adjusted(textOffset(), topMargin(),
- -rightMargin(), 0);
+ QRect r = q->rect().adjusted(textOffset(), topMargin(), -rightMargin(), 0);
+ if (description.isEmpty())
+ {
+ QFontMetrics fm(titleFont());
+ r.setTop(r.top() + qMax(0, (q->icon().actualSize(q->iconSize()).height()
+ - fm.height()) / 2));
+ }
+
+ return r;
}
QRect QCommandLinkButtonPrivate::descriptionRect() const
@@ -254,7 +261,7 @@ QSize QCommandLinkButton::minimumSizeHint() const
Q_D(const QCommandLinkButton);
QSize size = sizeHint();
int minimumHeight = qMax(d->descriptionOffset() + d->bottomMargin(),
- iconSize().height() + d->topMargin());
+ icon().actualSize(iconSize()).height() + d->topMargin());
size.setHeight(minimumHeight);
return size;
}
@@ -328,7 +335,8 @@ int QCommandLinkButton::heightForWidth(int width) const
int heightWithoutDescription = d->descriptionOffset() + d->bottomMargin();
// find the width available for the description area
return qMax(heightWithoutDescription + d->descriptionHeight(width),
- iconSize().height() + d->topMargin() + d->bottomMargin());
+ icon().actualSize(iconSize()).height() + d->topMargin() +
+ d->bottomMargin());
}
/*! \reimp */
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index aa4ffce..e8e80b7 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -768,7 +768,7 @@ QAction *QMenuBarPrivate::getNextAction(const int _start, const int increment) c
const int start = (_start == -1 && increment == -1) ? actions.count() : _start;
const int end = increment == -1 ? 0 : actions.count() - 1;
- for (int i = start; start != end;) {
+ for (int i = start; i != end;) {
i += increment;
QAction *current = actions.at(i);
if (!actionRects.at(i).isNull() && (allowActiveAndDisabled || current->isEnabled()))
diff --git a/src/multimedia/audio/qaudio_mac.cpp b/src/multimedia/audio/qaudio_mac.cpp
index 14fee8b..4e17b52 100644
--- a/src/multimedia/audio/qaudio_mac.cpp
+++ b/src/multimedia/audio/qaudio_mac.cpp
@@ -68,11 +68,11 @@ QAudioFormat toQAudioFormat(AudioStreamBasicDescription const& sf)
audioFormat.setChannels(sf.mChannelsPerFrame);
audioFormat.setSampleSize(sf.mBitsPerChannel);
audioFormat.setCodec(QString::fromLatin1("audio/pcm"));
- audioFormat.setByteOrder(sf.mFormatFlags & kLinearPCMFormatFlagIsBigEndian != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian);
+ audioFormat.setByteOrder((sf.mFormatFlags & kAudioFormatFlagIsBigEndian) != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian);
QAudioFormat::SampleType type = QAudioFormat::UnSignedInt;
- if ((sf.mFormatFlags & kLinearPCMFormatFlagIsSignedInteger) != 0)
+ if ((sf.mFormatFlags & kAudioFormatFlagIsSignedInteger) != 0)
type = QAudioFormat::SignedInt;
- else if ((sf.mFormatFlags & kLinearPCMFormatFlagIsFloat) != 0)
+ else if ((sf.mFormatFlags & kAudioFormatFlagIsFloat) != 0)
type = QAudioFormat::Float;
audioFormat.setSampleType(type);
@@ -99,6 +99,9 @@ AudioStreamBasicDescription toAudioStreamBasicDescription(QAudioFormat const& au
case QAudioFormat::Unknown: default: break;
}
+ if (audioFormat.byteOrder() == QAudioFormat::BigEndian)
+ sf.mFormatFlags |= kAudioFormatFlagIsBigEndian;
+
return sf;
}
diff --git a/src/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/audio/qaudioinput_mac_p.cpp
index b99fe11..5897e75 100644
--- a/src/multimedia/audio/qaudioinput_mac_p.cpp
+++ b/src/multimedia/audio/qaudioinput_mac_p.cpp
@@ -210,6 +210,11 @@ public:
return true;
}
+ bool empty() const
+ {
+ return position == totalPackets;
+ }
+
private:
UInt32 totalPackets;
UInt32 position;
@@ -275,36 +280,32 @@ public:
if (m_audioConverter != 0) {
QAudioPacketFeeder feeder(m_inputBufferList);
- bool wecan = true;
int copied = 0;
-
const int available = m_buffer->free();
- while (err == noErr && wecan) {
+ while (err == noErr && !feeder.empty()) {
QAudioRingBuffer::Region region = m_buffer->acquireWriteRegion(available);
- if (region.second > 0) {
- AudioBufferList output;
- output.mNumberBuffers = 1;
- output.mBuffers[0].mNumberChannels = 1;
- output.mBuffers[0].mDataByteSize = region.second;
- output.mBuffers[0].mData = region.first;
-
- UInt32 packetSize = region.second / m_outputFormat.mBytesPerPacket;
- err = AudioConverterFillComplexBuffer(m_audioConverter,
- converterCallback,
- &feeder,
- &packetSize,
- &output,
- 0);
-
- region.second = output.mBuffers[0].mDataByteSize;
- copied += region.second;
+ if (region.second == 0)
+ break;
+
+ AudioBufferList output;
+ output.mNumberBuffers = 1;
+ output.mBuffers[0].mNumberChannels = 1;
+ output.mBuffers[0].mDataByteSize = region.second;
+ output.mBuffers[0].mData = region.first;
+
+ UInt32 packetSize = region.second / m_outputFormat.mBytesPerPacket;
+ err = AudioConverterFillComplexBuffer(m_audioConverter,
+ converterCallback,
+ &feeder,
+ &packetSize,
+ &output,
+ 0);
+ region.second = output.mBuffers[0].mDataByteSize;
+ copied += region.second;
- m_buffer->releaseWriteRegion(region);
- }
- else
- wecan = false;
+ m_buffer->releaseWriteRegion(region);
}
framesRendered += copied / m_outputFormat.mBytesPerFrame;
diff --git a/src/multimedia/audio/qaudiooutput_mac_p.cpp b/src/multimedia/audio/qaudiooutput_mac_p.cpp
index 9689101..cc52d90 100644
--- a/src/multimedia/audio/qaudiooutput_mac_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_mac_p.cpp
@@ -358,17 +358,7 @@ bool QAudioOutputPrivate::open()
// Set stream format
streamFormat = toAudioStreamBasicDescription(audioFormat);
- UInt32 size = sizeof(deviceFormat);
- if (AudioUnitGetProperty(audioUnit,
- kAudioUnitProperty_StreamFormat,
- kAudioUnitScope_Input,
- 0,
- &deviceFormat,
- &size) != noErr) {
- qWarning() << "QAudioOutput: Unable to retrieve device format";
- return false;
- }
-
+ UInt32 size = sizeof(streamFormat);
if (AudioUnitSetProperty(audioUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input,
@@ -392,8 +382,7 @@ bool QAudioOutputPrivate::open()
return false;
}
- periodSizeBytes = (numberOfFrames * streamFormat.mSampleRate / deviceFormat.mSampleRate) *
- streamFormat.mBytesPerFrame;
+ periodSizeBytes = numberOfFrames * streamFormat.mBytesPerFrame;
if (internalBufferSize < periodSizeBytes * 2)
internalBufferSize = periodSizeBytes * 2;
else
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index 90751f4..3112dd6 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -210,12 +210,23 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
#ifdef Q_ADDRCONFIG
hints.ai_flags = Q_ADDRCONFIG;
#endif
+#ifdef Q_OS_SYMBIAN
+# ifdef QHOSTINFO_DEBUG
+ qDebug() << "Setting flags: 'hints.ai_flags &= AI_V4MAPPED | AI_ALL'";
+# endif
+#endif
int result = getaddrinfo(aceHostname.constData(), 0, &hints, &res);
# ifdef Q_ADDRCONFIG
if (result == EAI_BADFLAGS) {
// if the lookup failed with AI_ADDRCONFIG set, try again without it
hints.ai_flags = 0;
+#ifdef Q_OS_SYMBIAN
+# ifdef QHOSTINFO_DEBUG
+ qDebug() << "Setting flags: 'hints.ai_flags &= AI_V4MAPPED | AI_ALL'";
+# endif
+ hints.ai_flags &= AI_V4MAPPED | AI_ALL;
+#endif
result = getaddrinfo(aceHostname.constData(), 0, &hints, &res);
}
# endif
@@ -224,6 +235,9 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
addrinfo *node = res;
QList<QHostAddress> addresses;
while (node) {
+#ifdef QHOSTINFO_DEBUG
+ qDebug() << "getaddrinfo node: flags:" << node->ai_flags << "family:" << node->ai_family << "ai_socktype:" << node->ai_socktype << "ai_protocol:" << node->ai_protocol << "ai_addrlen:" << node->ai_addrlen;
+#endif
if (node->ai_family == AF_INET) {
QHostAddress addr;
addr.setAddress(ntohl(((sockaddr_in *) node->ai_addr)->sin_addr.s_addr));
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index a8c602a..f85fa84 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -1556,7 +1556,7 @@ QList<QSslError> QSslSocket::sslErrors() const
*/
bool QSslSocket::supportsSsl()
{
- return QSslSocketPrivate::ensureInitialized();
+ return QSslSocketPrivate::supportsSsl();
}
/*!
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 36a0cc7..fa26fe8 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -72,6 +72,9 @@
QT_BEGIN_NAMESPACE
+bool QSslSocketPrivate::s_libraryLoaded = false;
+bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
+
// Useful defines
#define SSL_ERRORSTR() QString::fromLocal8Bit(q_ERR_error_string(q_ERR_get_error(), NULL))
@@ -398,19 +401,24 @@ void QSslSocketPrivate::deinitialize()
/*!
\internal
- Declared static in QSslSocketPrivate, makes sure the SSL libraries have
- been initialized.
+ Does the minimum amount of initialization to determine whether SSL
+ is supported or not.
*/
-bool QSslSocketPrivate::ensureInitialized()
+
+bool QSslSocketPrivate::supportsSsl()
+{
+ return ensureLibraryLoaded();
+}
+
+bool QSslSocketPrivate::ensureLibraryLoaded()
{
if (!q_resolveOpenSslSymbols())
return false;
// Check if the library itself needs to be initialized.
QMutexLocker locker(openssl_locks()->initLock());
- static int q_initialized = false;
- if (!q_initialized) {
- q_initialized = true;
+ if (!s_libraryLoaded) {
+ s_libraryLoaded = true;
// Initialize OpenSSL.
q_CRYPTO_set_id_callback(id_function);
@@ -447,10 +455,33 @@ bool QSslSocketPrivate::ensureInitialized()
if (!attempts)
return false;
}
-
- resetDefaultCiphers();
- setDefaultCaCertificates(systemCaCertificates());
}
+ return true;
+}
+
+void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
+{
+ if (s_loadedCiphersAndCerts)
+ return;
+ s_loadedCiphersAndCerts = true;
+
+ resetDefaultCiphers();
+ setDefaultCaCertificates(systemCaCertificates());
+}
+
+/*!
+ \internal
+
+ Declared static in QSslSocketPrivate, makes sure the SSL libraries have
+ been initialized.
+*/
+
+void QSslSocketPrivate::ensureInitialized()
+{
+ if (!supportsSsl())
+ return;
+
+ ensureCiphersAndCertsLoaded();
//load symbols needed to receive certificates from system store
#if defined(Q_OS_MAC)
@@ -481,7 +512,6 @@ bool QSslSocketPrivate::ensureInitialized()
qWarning("could not load crypt32 library"); // should never happen
}
#endif
- return true;
}
/*!
@@ -574,17 +604,17 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
}
}
#elif defined(Q_OS_AIX)
- systemCerts.append(QSslCertificate::fromPath("/var/ssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard));
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/var/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard));
#elif defined(Q_OS_SOLARIS)
- systemCerts.append(QSslCertificate::fromPath("/usr/local/ssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard));
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/local/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard));
#elif defined(Q_OS_HPUX)
- systemCerts.append(QSslCertificate::fromPath("/opt/openssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard));
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/opt/openssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard));
#elif defined(Q_OS_LINUX)
- systemCerts.append(QSslCertificate::fromPath("/etc/ssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard)); // (K)ubuntu, OpenSUSE, Mandriva, ...
- systemCerts.append(QSslCertificate::fromPath("/etc/pki/tls/certs/ca-bundle.crt", QSsl::Pem)); // Fedora
- systemCerts.append(QSslCertificate::fromPath("/usr/lib/ssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard)); // Gentoo, Mandrake
- systemCerts.append(QSslCertificate::fromPath("/usr/share/ssl/*.pem", QSsl::Pem, QRegExp::Wildcard)); // Centos, Redhat, SuSE
- systemCerts.append(QSslCertificate::fromPath("/usr/local/ssl/*.pem", QSsl::Pem, QRegExp::Wildcard)); // Normal OpenSSL Tarball
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/etc/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // (K)ubuntu, OpenSUSE, Mandriva, ...
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/etc/pki/tls/certs/ca-bundle.crt"), QSsl::Pem)); // Fedora
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/lib/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // Gentoo, Mandrake
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/share/ssl/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // Centos, Redhat, SuSE
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/local/ssl/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // Normal OpenSSL Tarball
#endif
return systemCerts;
}
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 42ae98f..09775bc 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
typedef OSStatus (*PtrSecTrustSettingsCopyCertificates)(int, CFArrayRef*);
typedef OSStatus (*PtrSecTrustCopyAnchorCertificates)(CFArrayRef*);
#elif defined(Q_OS_WIN)
-#include <Wincrypt.h>
+#include <wincrypt.h>
#ifndef HCRYPTPROV_LEGACY
#define HCRYPTPROV_LEGACY HCRYPTPROV
#endif
@@ -108,7 +108,8 @@ public:
// that was used for connecting to.
QString verificationPeerName;
- static bool ensureInitialized();
+ static bool supportsSsl();
+ static void ensureInitialized();
static void deinitialize();
static QList<QSslCipher> defaultCiphers();
static QList<QSslCipher> supportedCiphers();
@@ -154,6 +155,13 @@ public:
virtual void disconnectFromHost() = 0;
virtual void disconnected() = 0;
virtual QSslCipher sessionCipher() const = 0;
+
+private:
+ static bool ensureLibraryLoaded();
+ static void ensureCiphersAndCertsLoaded();
+
+ static bool s_libraryLoaded;
+ static bool s_loadedCiphersAndCerts;
};
QT_END_NAMESPACE
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index b4c85ac..e05db96 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1521,6 +1521,32 @@ bool operator==(const QGLFormat& a, const QGLFormat& b)
&& a.d->profile == b.d->profile);
}
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QGLFormat &f)
+{
+ const QGLFormatPrivate * const d = f.d;
+
+ dbg.nospace() << "QGLFormat("
+ << "options " << d->opts
+ << ", plane " << d->pln
+ << ", depthBufferSize " << d->depthSize
+ << ", accumBufferSize " << d->accumSize
+ << ", stencilBufferSize " << d->stencilSize
+ << ", redBufferSize " << d->redSize
+ << ", greenBufferSize " << d->greenSize
+ << ", blueBufferSize " << d->blueSize
+ << ", alphaBufferSize " << d->alphaSize
+ << ", samples " << d->numSamples
+ << ", swapInterval " << d->swapInterval
+ << ", majorVersion " << d->majorVersion
+ << ", minorVersion " << d->minorVersion
+ << ", profile " << d->profile
+ << ')';
+
+ return dbg.space();
+}
+#endif
+
/*!
Returns false if all the options of the two QGLFormat objects
@@ -2220,6 +2246,13 @@ static void convertToGLFormatHelper(QImage &dst, const QImage &img, GLenum textu
}
}
+#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS)
+QGLExtensionFuncs& QGLContextPrivate::extensionFuncs(const QGLContext *)
+{
+ return qt_extensionFuncs;
+}
+#endif
+
QImage QGLContextPrivate::convertToGLFormat(const QImage &image, bool force_premul,
GLenum texture_format)
{
@@ -2331,9 +2364,6 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
&& target == GL_TEXTURE_2D
&& (options & QGLContext::MipmapBindOption))
{
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - generating mipmaps (%d ms)\n", time.elapsed());
-#endif
#if !defined(QT_OPENGL_ES_2)
glHint(GL_GENERATE_MIPMAP_HINT_SGIS, GL_NICEST);
#ifndef QT_OPENGL_ES
@@ -2347,6 +2377,9 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
#endif
glTexParameterf(target, GL_TEXTURE_MIN_FILTER, options & QGLContext::LinearFilteringBindOption
? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_NEAREST);
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ printf(" - generating mipmaps (%d ms)\n", time.elapsed());
+#endif
} else {
glTexParameterf(target, GL_TEXTURE_MIN_FILTER, filtering);
}
@@ -2371,7 +2404,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
if (premul) {
img = img.convertToFormat(target_format = QImage::Format_ARGB32_Premultiplied);
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting ARGB32 -> ARGB32_Premultiplied (%d ms) \n", time.elapsed());
+ printf(" - converted ARGB32 -> ARGB32_Premultiplied (%d ms) \n", time.elapsed());
#endif
}
break;
@@ -2379,7 +2412,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
if (!premul) {
img = img.convertToFormat(target_format = QImage::Format_ARGB32);
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting ARGB32_Premultiplied -> ARGB32 (%d ms)\n", time.elapsed());
+ printf(" - converted ARGB32_Premultiplied -> ARGB32 (%d ms)\n", time.elapsed());
#endif
}
break;
@@ -2396,20 +2429,17 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
? QImage::Format_ARGB32_Premultiplied
: QImage::Format_ARGB32);
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting to 32-bit alpha format (%d ms)\n", time.elapsed());
+ printf(" - converted to 32-bit alpha format (%d ms)\n", time.elapsed());
#endif
} else {
img = img.convertToFormat(QImage::Format_RGB32);
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting to 32-bit (%d ms)\n", time.elapsed());
+ printf(" - converted to 32-bit (%d ms)\n", time.elapsed());
#endif
}
}
if (options & QGLContext::InvertedYBindOption) {
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - flipping bits over y (%d ms)\n", time.elapsed());
-#endif
if (img.isDetached()) {
int ipl = img.bytesPerLine() / 4;
int h = img.height();
@@ -2426,17 +2456,20 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
// data twice. This version should only do it once.
img = img.mirrored();
}
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ printf(" - flipped bits over y (%d ms)\n", time.elapsed());
+#endif
}
if (externalFormat == GL_RGBA) {
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - doing byte swapping (%d ms)\n", time.elapsed());
-#endif
// The only case where we end up with a depth different from
// 32 in the switch above is for the RGB16 case, where we set
// the format to GL_RGB
Q_ASSERT(img.depth() == 32);
qgl_byteSwapImage(img, pixel_type);
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ printf(" - did byte swapping (%d ms)\n", time.elapsed());
+#endif
}
#ifdef QT_OPENGL_ES
// OpenGL/ES requires that the internal and external formats be
@@ -2465,7 +2498,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
#ifdef QGL_BIND_TEXTURE_DEBUG
static int totalUploadTime = 0;
totalUploadTime += time.elapsed();
- printf(" - upload done in (%d ms) time=%d\n", time.elapsed(), totalUploadTime);
+ printf(" - upload done in %d ms, (accumulated: %d ms)\n", time.elapsed(), totalUploadTime);
#endif
@@ -5161,6 +5194,8 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions()
glExtensions |= NVFloatBuffer;
if (extensions.match("GL_ARB_pixel_buffer_object"))
glExtensions |= PixelBufferObject;
+ if (extensions.match("GL_IMG_texture_format_BGRA8888"))
+ glExtensions |= BGRATextureFormat;
#if defined(QT_OPENGL_ES_2)
glExtensions |= FramebufferObject;
glExtensions |= GenerateMipmap;
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index f0b36f7..f85cad5 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -281,6 +281,9 @@ private:
friend Q_OPENGL_EXPORT bool operator==(const QGLFormat&, const QGLFormat&);
friend Q_OPENGL_EXPORT bool operator!=(const QGLFormat&, const QGLFormat&);
+#ifndef QT_NO_DEBUG_STREAM
+ friend Q_OPENGL_EXPORT QDebug operator<<(QDebug, const QGLFormat &);
+#endif
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QGLFormat::OpenGLVersionFlags)
@@ -288,6 +291,10 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QGLFormat::OpenGLVersionFlags)
Q_OPENGL_EXPORT bool operator==(const QGLFormat&, const QGLFormat&);
Q_OPENGL_EXPORT bool operator!=(const QGLFormat&, const QGLFormat&);
+#ifndef QT_NO_DEBUG_STREAM
+Q_OPENGL_EXPORT QDebug operator<<(QDebug, const QGLFormat &);
+#endif
+
class Q_OPENGL_EXPORT QGLContext
{
Q_DECLARE_PRIVATE(QGLContext)
diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp
index 0a19531..58d3b0a 100644
--- a/src/opengl/qgl_egl.cpp
+++ b/src/opengl/qgl_egl.cpp
@@ -138,7 +138,7 @@ void qt_glformat_from_eglconfig(QGLFormat& format, const EGLConfig config)
format.setDepthBufferSize(depthSize);
format.setStencilBufferSize(stencilSize);
format.setSamples(sampleCount);
- format.setPlane(level + 1); // EGL calls level 0 "normal" whereas Qt calls 1 "normal"
+ format.setPlane(level);
format.setDirectRendering(true); // All EGL contexts are direct-rendered
format.setRgba(true); // EGL doesn't support colour index rendering
format.setStereo(false); // EGL doesn't support stereo buffers
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 1727a41..b57972c 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -86,7 +86,7 @@ QT_BEGIN_INCLUDE_NAMESPACE
QT_END_INCLUDE_NAMESPACE
# ifdef old_qDebug
# undef qDebug
-# define qDebug QT_QDEBUG_MACRO
+# define qDebug QT_NO_QDEBUG_MACRO
# undef old_qDebug
# endif
class QMacWindowChangeEvent;
@@ -415,7 +415,7 @@ public:
#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS)
static QGLExtensionFuncs qt_extensionFuncs;
- static inline QGLExtensionFuncs& extensionFuncs(const QGLContext *) { return qt_extensionFuncs; }
+ static QGLExtensionFuncs& extensionFuncs(const QGLContext *);
#endif
static void setCurrentContext(QGLContext *context);
diff --git a/src/opengl/qpixmapdata_gl_p.h b/src/opengl/qpixmapdata_gl_p.h
index c239bcb..736a28e 100644
--- a/src/opengl/qpixmapdata_gl_p.h
+++ b/src/opengl/qpixmapdata_gl_p.h
@@ -96,7 +96,7 @@ private:
};
-class QGLPixmapData : public QPixmapData
+class Q_OPENGL_EXPORT QGLPixmapData : public QPixmapData
{
public:
QGLPixmapData(PixelType type);
diff --git a/src/opengl/qwindowsurface_gl_p.h b/src/opengl/qwindowsurface_gl_p.h
index 8ea714c..624236c 100644
--- a/src/opengl/qwindowsurface_gl_p.h
+++ b/src/opengl/qwindowsurface_gl_p.h
@@ -77,7 +77,7 @@ public:
QGLWindowSurfacePrivate* d;
};
-class QGLWindowSurface : public QObject, public QWindowSurface // , public QPaintDevice
+class Q_OPENGL_EXPORT QGLWindowSurface : public QObject, public QWindowSurface // , public QPaintDevice
{
Q_OBJECT
public:
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp
index a6acce0..e375b4f 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp
@@ -879,9 +879,28 @@ void QNetworkSessionPrivateImpl::close()
lastError = QNetworkSession::OperationNotSupportedError;
emit QNetworkSessionPrivate::error(lastError);
} else if (isOpen) {
- opened = false;
- isOpen = false;
- emit closed();
+ if ((activeConfig.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
+ // We will not wait any disconnect from icd as it might never come
+ Maemo::Icd icd;
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug() << "closing session" << publicConfig.identifier();
+#endif
+ state = QNetworkSession::Closing;
+ emit stateChanged(state);
+
+ opened = false;
+ isOpen = false;
+
+ // we fake a disconnection, session error is not sent
+ updateState(QNetworkSession::Disconnected);
+
+ icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT);
+ startTime = QDateTime();
+ } else {
+ opened = false;
+ isOpen = false;
+ emit closed();
+ }
}
}
@@ -896,33 +915,25 @@ void QNetworkSessionPrivateImpl::stop()
emit QNetworkSessionPrivate::error(lastError);
} else {
if ((activeConfig.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
- if (!m_stopTimer.isActive()) {
- Maemo::Icd icd;
+ Maemo::Icd icd;
#ifdef BEARER_MANAGEMENT_DEBUG
- qDebug() << "stopping session" << publicConfig.identifier();
+ qDebug() << "stopping session" << publicConfig.identifier();
#endif
- state = QNetworkSession::Closing;
- emit stateChanged(state);
-
- opened = false;
- isOpen = false;
+ state = QNetworkSession::Closing;
+ emit stateChanged(state);
- icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT);
- startTime = QDateTime();
+ // we fake a disconnection, a session error is sent also
+ updateState(QNetworkSession::Disconnected);
- /* Note: Session state will change to disconnected
- * as soon as QNetworkConfigurationManager sends
- * corresponding iapStateChanged signal.
- */
+ opened = false;
+ isOpen = false;
- // Make sure that this Session will send closed signal
- // even though ICD connection will not ever get closed
- m_stopTimer.start(ICD_SHORT_CONNECT_TIMEOUT); // 10 seconds wait
- }
+ icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT);
+ startTime = QDateTime();
} else {
opened = false;
isOpen = false;
- emit closed();
+ emit closed();
}
}
}
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index e08d135..f89ed0a 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -53,16 +53,30 @@
QT_BEGIN_NAMESPACE
QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine)
- : CActive(CActive::EPriorityUserInput), engine(engine),
- ipConnectionNotifier(0), iHandleStateNotificationsFromManager(false),
- iFirstSync(true), iStoppedByUser(false), iClosedByUser(false), iDeprecatedConnectionId(0),
- iError(QNetworkSession::UnknownSessionError), iALREnabled(0), iConnectInBackground(false)
+: CActive(CActive::EPriorityUserInput), engine(engine),
+ iDynamicUnSetdefaultif(0), ipConnectionNotifier(0),
+ iHandleStateNotificationsFromManager(false), iFirstSync(true), iStoppedByUser(false),
+ iClosedByUser(false), iError(QNetworkSession::UnknownSessionError), iALREnabled(0),
+ iConnectInBackground(false), isOpening(false)
{
CActiveScheduler::Add(this);
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
iMobility = NULL;
#endif
+ // Try to load "Open C" dll dynamically and
+ // try to attach to unsetdefaultif function dynamically.
+ // This is to avoid build breaks with old OpenC versions.
+ if (iOpenCLibrary.Load(_L("libc")) == KErrNone) {
+ iDynamicUnSetdefaultif = (TOpenCUnSetdefaultifFunction)iOpenCLibrary.Lookup(597);
+ }
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - ";
+ if (iDynamicUnSetdefaultif)
+ qDebug() << "dynamic unsetdefaultif() is present in PIPS library. ";
+ else
+ qDebug() << "dynamic unsetdefaultif() not present in PIPS library. ";
+#endif
TRAP_IGNORE(iConnectionMonitor.ConnectL());
}
@@ -70,6 +84,7 @@ QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine)
QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl()
{
isOpen = false;
+ isOpening = false;
// Cancel Connection Progress Notifications first.
// Note: ConnectionNotifier must be destroyed before Canceling RConnection::Start()
@@ -77,9 +92,6 @@ QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl()
delete ipConnectionNotifier;
ipConnectionNotifier = NULL;
- // Cancel possible RConnection::Start()
- Cancel();
-
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
if (iMobility) {
delete iMobility;
@@ -87,13 +99,19 @@ QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl()
}
#endif
- iConnection.Close();
+ // Cancel possible RConnection::Start()
+ Cancel();
iSocketServ.Close();
// Close global 'Open C' RConnection
+ // Clears also possible unsetdefaultif() flags.
setdefaultif(0);
iConnectionMonitor.Close();
+ iOpenCLibrary.Close();
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - destroyed (and setdefaultif(0))";
+#endif
}
void QNetworkSessionPrivateImpl::configurationStateChanged(TUint32 accessPointId, TUint32 connMonId, QNetworkSession::State newState)
@@ -101,18 +119,12 @@ void QNetworkSessionPrivateImpl::configurationStateChanged(TUint32 accessPointId
if (iHandleStateNotificationsFromManager) {
#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
qDebug() << "QNS this : " << QString::number((uint)this) << " - "
- << "configurationStateChanged from manager for IAP : " << QString::number(accessPointId)
- << "configurationStateChanged connMon ID : " << QString::number(connMonId)
- << " : to a state: " << newState
- << " whereas my current state is: " << state;
-#endif
- if (connMonId == iDeprecatedConnectionId) {
-#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
- qDebug() << "QNS this : " << QString::number((uint)this) << " - "
- << "however status update from manager ignored because it related to already closed connection.";
+ << "configurationStateChanged from manager for IAP : " << QString::number(accessPointId)
+ << "connMon ID : " << QString::number(connMonId) << " : to a state: " << newState
+ << "whereas my current state is: " << state;
+#else
+ Q_UNUSED(connMonId);
#endif
- return;
- }
this->newState(newState, accessPointId);
}
}
@@ -236,6 +248,14 @@ QNetworkInterface QNetworkSessionPrivateImpl::interface(TUint iapId) const
#ifndef QT_NO_NETWORKINTERFACE
QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const
{
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "currentInterface() requested, state: " << state
+ << "publicConfig validity: " << publicConfig.isValid();
+ if (activeInterface.isValid())
+ qDebug() << "interface is: " << activeInterface.humanReadableName();
+#endif
+
if (!publicConfig.isValid() || state != QNetworkSession::Connected) {
return QNetworkInterface();
}
@@ -292,12 +312,14 @@ void QNetworkSessionPrivateImpl::open()
#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
qDebug() << "QNS this : " << QString::number((uint)this) << " - "
<< "open() called, session state is: " << state << " and isOpen is: "
- << isOpen;
+ << isOpen << isOpening;
#endif
- if (isOpen || (state == QNetworkSession::Connecting)) {
+
+ if (isOpen || isOpening)
return;
- }
-
+
+ isOpening = true;
+
// Stop handling IAP state change signals from QNetworkConfigurationManagerPrivate
// => RConnection::ProgressNotification will be used for IAP/SNAP monitoring
iHandleStateNotificationsFromManager = false;
@@ -325,7 +347,6 @@ void QNetworkSessionPrivateImpl::open()
// Clear possible previous states
iStoppedByUser = false;
iClosedByUser = false;
- iDeprecatedConnectionId = 0;
TInt error = iSocketServ.Connect();
if (error != KErrNone) {
@@ -358,44 +379,6 @@ void QNetworkSessionPrivateImpl::open()
}
if (publicConfig.type() == QNetworkConfiguration::InternetAccessPoint) {
- // Search through existing connections.
- // If there is already connection which matches to given IAP
- // try to attach to existing connection.
- TBool connected(EFalse);
- TConnectionInfoBuf connInfo;
- TUint count;
- if (iConnection.EnumerateConnections(count) == KErrNone) {
- for (TUint i=1; i<=count; i++) {
- // Note: GetConnectionInfo expects 1-based index.
- if (iConnection.GetConnectionInfo(i, connInfo) == KErrNone) {
- SymbianNetworkConfigurationPrivate *symbianConfig =
- toSymbianConfig(privateConfiguration(publicConfig));
-
- if (connInfo().iIapId == symbianConfig->numericIdentifier()) {
- if (iConnection.Attach(connInfo, RConnection::EAttachTypeNormal) == KErrNone) {
- activeConfig = publicConfig;
-#ifndef QT_NO_NETWORKINTERFACE
- activeInterface = interface(symbianConfig->numericIdentifier());
-#endif
- connected = ETrue;
- startTime = QDateTime::currentDateTime();
- // Use name of the IAP to open global 'Open C' RConnection
- QByteArray nameAsByteArray = publicConfig.name().toUtf8();
- ifreq ifr;
- memset(&ifr, 0, sizeof(struct ifreq));
- strcpy(ifr.ifr_name, nameAsByteArray.constData());
- error = setdefaultif(&ifr);
- isOpen = true;
- // Make sure that state will be Connected
- newState(QNetworkSession::Connected);
- emit quitPendingWaitsForOpened();
- break;
- }
- }
- }
- }
- }
- if (!connected) {
SymbianNetworkConfigurationPrivate *symbianConfig =
toSymbianConfig(privateConfiguration(publicConfig));
@@ -420,13 +403,20 @@ void QNetworkSessionPrivateImpl::open()
if (!IsActive()) {
SetActive();
}
- newState(QNetworkSession::Connecting);
- }
+ // Avoid flip flop of states if the configuration is already
+ // active. IsOpen/opened() will indicate when ready.
+ if (state != QNetworkSession::Connected) {
+ newState(QNetworkSession::Connecting);
+ }
} else if (publicConfig.type() == QNetworkConfiguration::ServiceNetwork) {
SymbianNetworkConfigurationPrivate *symbianConfig =
toSymbianConfig(privateConfiguration(publicConfig));
#ifdef OCC_FUNCTIONALITY_AVAILABLE
+ // On Symbian^3 if service network is not reachable, it triggers a UI (aka EasyWLAN) where
+ // user can create new IAPs. To detect this, we need to store the number of IAPs
+ // there was before connection was started.
+ iKnownConfigsBeforeConnectionStart = engine->accessPointConfigurationIdentifiers();
TConnPrefList snapPref;
TExtendedConnPref prefs;
prefs.SetSnapId(symbianConfig->numericIdentifier());
@@ -441,7 +431,11 @@ void QNetworkSessionPrivateImpl::open()
if (!IsActive()) {
SetActive();
}
- newState(QNetworkSession::Connecting);
+ // Avoid flip flop of states if the configuration is already
+ // active. IsOpen/opened() will indicate when ready.
+ if (state != QNetworkSession::Connected) {
+ newState(QNetworkSession::Connecting);
+ }
} else if (publicConfig.type() == QNetworkConfiguration::UserChoice) {
iKnownConfigsBeforeConnectionStart = engine->accessPointConfigurationIdentifiers();
iConnection.Start(iStatus);
@@ -453,6 +447,7 @@ void QNetworkSessionPrivateImpl::open()
if (error != KErrNone) {
isOpen = false;
+ isOpening = false;
iError = QNetworkSession::UnknownSessionError;
emit QNetworkSessionPrivate::error(iError);
if (ipConnectionNotifier) {
@@ -496,19 +491,19 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
<< "close() called, session state is: " << state << " and isOpen is : "
<< isOpen;
#endif
- if (!isOpen) {
+
+ if (!isOpen && state != QNetworkSession::Connecting) {
return;
}
// Mark this session as closed-by-user so that we are able to report
// distinguish between stop() and close() state transitions
// when reporting.
iClosedByUser = true;
-
isOpen = false;
- activeConfig = QNetworkConfiguration();
+ isOpening = false;
+
serviceConfig = QNetworkConfiguration();
- Cancel();
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
if (iMobility) {
delete iMobility;
@@ -522,17 +517,33 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
iHandleStateNotificationsFromManager = true;
}
- iConnection.Close();
+ Cancel(); // closes iConnection
iSocketServ.Close();
- // Close global 'Open C' RConnection
- setdefaultif(0);
+ // Close global 'Open C' RConnection. If OpenC supports,
+ // close the defaultif for good to avoid difficult timing
+ // and bouncing issues of network going immediately back up
+ // because of e.g. select() thread etc.
+ if (iDynamicUnSetdefaultif) {
+ iDynamicUnSetdefaultif();
+ } else {
+ setdefaultif(0);
+ }
- if (publicConfig.type() == QNetworkConfiguration::UserChoice) {
+ // If UserChoice, go down immediately. If some other configuration,
+ // go down immediately if there is no reports expected from the platform;
+ // in practice Connection Monitor is aware of connections only after
+ // KFinishedSelection event, and hence reports only after that event, but
+ // that does not seem to be trusted on all Symbian versions --> safest
+ // to go down.
+ if (publicConfig.type() == QNetworkConfiguration::UserChoice || state == QNetworkSession::Connecting) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "going disconnected right away, since either UserChoice or Connecting";
+#endif
newState(QNetworkSession::Closing);
newState(QNetworkSession::Disconnected);
}
-
if (allowSignals) {
emit closed();
}
@@ -593,6 +604,7 @@ void QNetworkSessionPrivateImpl::stop()
#endif
// Since we are open, use RConnection to stop the interface
isOpen = false;
+ isOpening = false;
iStoppedByUser = true;
newState(QNetworkSession::Closing);
if (ipConnectionNotifier) {
@@ -602,6 +614,7 @@ void QNetworkSessionPrivateImpl::stop()
}
iConnection.Stop(RConnection::EStopAuthoritative);
isOpen = true;
+ isOpening = false;
close(false);
emit closed();
}
@@ -611,8 +624,13 @@ void QNetworkSessionPrivateImpl::migrate()
{
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
if (iMobility) {
- // Close global 'Open C' RConnection
- setdefaultif(0);
+ // Close global 'Open C' RConnection. If openC supports, use the 'heavy'
+ // version to block all subsequent requests.
+ if (iDynamicUnSetdefaultif) {
+ iDynamicUnSetdefaultif();
+ } else {
+ setdefaultif(0);
+ }
// Start migrating to new IAP
iMobility->MigrateToPreferredCarrier();
}
@@ -694,8 +712,17 @@ void QNetworkSessionPrivateImpl::PreferredCarrierAvailable(TAccessPointInfo aOld
SymbianNetworkConfigurationPrivate *symbianConfig =
toSymbianConfig(privateConfiguration(configs[i]));
- if (symbianConfig->numericIdentifier() == aNewAPInfo.AccessPoint())
- emit preferredConfigurationChanged(configs[i], aIsSeamless);
+ if (symbianConfig->numericIdentifier() == aNewAPInfo.AccessPoint()) {
+ // Any slot connected to the signal might throw an std::exception,
+ // which must not propagate into Symbian code (this function is a callback
+ // from platform). We could convert exception to a symbian Leave, but since the
+ // prototype of this function bans this (no trailing 'L'), we just catch
+ // and drop.
+ QT_TRY {
+ emit preferredConfigurationChanged(configs[i], aIsSeamless);
+ }
+ QT_CATCH (std::exception&) {}
+ }
}
} else {
migrate();
@@ -705,7 +732,10 @@ void QNetworkSessionPrivateImpl::PreferredCarrierAvailable(TAccessPointInfo aOld
void QNetworkSessionPrivateImpl::NewCarrierActive(TAccessPointInfo /*aNewAPInfo*/, TBool /*aIsSeamless*/)
{
if (iALREnabled > 0) {
- emit newConfigurationActivated();
+ QT_TRY {
+ emit newConfigurationActivated();
+ }
+ QT_CATCH (std::exception&) {}
} else {
accept();
}
@@ -715,10 +745,11 @@ void QNetworkSessionPrivateImpl::Error(TInt /*aError*/)
{
#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
qDebug() << "QNS this : " << QString::number((uint)this) << " - "
- << "roaming Error() occured";
+ << "roaming Error() occured, isOpen is: " << isOpen;
#endif
if (isOpen) {
isOpen = false;
+ isOpening = false;
activeConfig = QNetworkConfiguration();
serviceConfig = QNetworkConfiguration();
iError = QNetworkSession::RoamingError;
@@ -727,18 +758,24 @@ void QNetworkSessionPrivateImpl::Error(TInt /*aError*/)
if (ipConnectionNotifier) {
ipConnectionNotifier->StopNotifications();
}
- syncStateWithInterface();
- // In some cases IAP is still in Connected state when
- // syncStateWithInterface(); is called
- // => Following call makes sure that Session state
- // changes immediately to Disconnected.
- newState(QNetworkSession::Disconnected);
- emit closed();
+ QT_TRY {
+ syncStateWithInterface();
+ // In some cases IAP is still in Connected state when
+ // syncStateWithInterface(); is called
+ // => Following call makes sure that Session state
+ // changes immediately to Disconnected.
+ newState(QNetworkSession::Disconnected);
+ emit closed();
+ }
+ QT_CATCH (std::exception&) {}
} else if (iStoppedByUser) {
// If the user of this session has called the stop() and
// configuration is based on internet SNAP, this needs to be
// done here because platform might roam.
- newState(QNetworkSession::Disconnected);
+ QT_TRY {
+ newState(QNetworkSession::Disconnected);
+ }
+ QT_CATCH (std::exception&) {}
}
}
#endif
@@ -870,7 +907,7 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
_LIT(KSetting, "IAP\\Id");
iConnection.GetIntSetting(KSetting, iapId);
}
-
+
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
if (publicConfig.type() == QNetworkConfiguration::ServiceNetwork) {
// Try to search IAP from the used SNAP using IAP Id
@@ -892,8 +929,8 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
// <=> Note: It's possible that in this case reported IAP is
// clone of the one of the IAPs of the used SNAP
// => If mappingName matches, clone has been found
- QNetworkConfiguration pt = QNetworkConfigurationManager()
- .configurationFromIdentifier(QString::number(qHash(iapId)));
+ QNetworkConfiguration pt = QNetworkConfigurationManager().configurationFromIdentifier(
+ QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(iapId)));
SymbianNetworkConfigurationPrivate *symbianConfig =
toSymbianConfig(privateConfiguration(pt));
@@ -907,20 +944,58 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
}
}
} else {
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+ // On Symbian^3 (only, not earlier or Symbian^4) if the SNAP was not reachable, it triggers
+ // user choice type of activity (EasyWLAN). As a result, a new IAP may be created, and
+ // hence if was not found yet. Therefore update configurations and see if there is something new.
+ // 1. Update knowledge from the databases.
+ engine->requestUpdate();
+ // 2. Check if new configuration was created during connection creation
+ QList<QString> knownConfigs = engine->accessPointConfigurationIdentifiers();
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "opened configuration was not known beforehand, looking for new.";
+#endif
+ if (knownConfigs.count() > iKnownConfigsBeforeConnectionStart.count()) {
+ // Configuration count increased => new configuration was created
+ // => Search new, created configuration
+ QString newIapId;
+ for (int i=0; i < iKnownConfigsBeforeConnectionStart.count(); i++) {
+ if (knownConfigs[i] != iKnownConfigsBeforeConnectionStart[i]) {
+ newIapId = knownConfigs[i];
+ break;
+ }
+ }
+ if (newIapId.isEmpty()) {
+ newIapId = knownConfigs[knownConfigs.count()-1];
+ }
+ pt = QNetworkConfigurationManager().configurationFromIdentifier(newIapId);
+ if (pt.isValid()) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "new configuration was found, name, IAP id: " << pt.name() << pt.identifier();
+#endif
+ return pt;
+ }
+ }
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "configuration was not found, returning invalid.";
+#endif
+#endif // OCC_FUNCTIONALITY_AVAILABLE
// Given IAP Id was not found from known IAPs array
return QNetworkConfiguration();
}
-
// Matching IAP was not found from used SNAP
// => IAP from another SNAP is returned
// (Note: Returned IAP matches to given IAP Id)
return pt;
}
#endif
-
if (publicConfig.type() == QNetworkConfiguration::UserChoice) {
if (engine) {
- QNetworkConfiguration pt = QNetworkConfigurationManager().configurationFromIdentifier(QString::number(qHash(iapId)));
+ QNetworkConfiguration pt = QNetworkConfigurationManager().configurationFromIdentifier(
+ QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(iapId)));
// Try to found User Selected IAP from known IAPs (accessPointConfigurations)
if (pt.isValid()) {
return pt;
@@ -957,6 +1032,10 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
void QNetworkSessionPrivateImpl::RunL()
{
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "RConnection::RunL with status code: " << iStatus.Int();
+#endif
TInt statusCode = iStatus.Int();
switch (statusCode) {
@@ -977,13 +1056,14 @@ void QNetworkSessionPrivateImpl::RunL()
if (error != KErrNone) {
isOpen = false;
+ isOpening = false;
iError = QNetworkSession::UnknownSessionError;
- emit QNetworkSessionPrivate::error(iError);
+ QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError));
Cancel();
if (ipConnectionNotifier) {
ipConnectionNotifier->StopNotifications();
}
- syncStateWithInterface();
+ QT_TRYCATCH_LEAVING(syncStateWithInterface());
return;
}
@@ -995,6 +1075,7 @@ void QNetworkSessionPrivateImpl::RunL()
#endif
isOpen = true;
+ isOpening = false;
activeConfig = newActiveConfig;
SymbianNetworkConfigurationPrivate *symbianConfig =
@@ -1010,26 +1091,30 @@ void QNetworkSessionPrivateImpl::RunL()
startTime = QDateTime::currentDateTime();
- newState(QNetworkSession::Connected);
- emit quitPendingWaitsForOpened();
+ QT_TRYCATCH_LEAVING({
+ newState(QNetworkSession::Connected);
+ emit quitPendingWaitsForOpened();
+ });
}
break;
case KErrNotFound: // Connection failed
isOpen = false;
+ isOpening = false;
activeConfig = QNetworkConfiguration();
serviceConfig = QNetworkConfiguration();
iError = QNetworkSession::InvalidConfigurationError;
- emit QNetworkSessionPrivate::error(iError);
+ QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError));
Cancel();
if (ipConnectionNotifier) {
ipConnectionNotifier->StopNotifications();
}
- syncStateWithInterface();
+ QT_TRYCATCH_LEAVING(syncStateWithInterface());
break;
case KErrCancel: // Connection attempt cancelled
case KErrAlreadyExists: // Connection already exists
default:
isOpen = false;
+ isOpening = false;
activeConfig = QNetworkConfiguration();
serviceConfig = QNetworkConfiguration();
if (publicConfig.state() == QNetworkConfiguration::Undefined ||
@@ -1038,12 +1123,12 @@ void QNetworkSessionPrivateImpl::RunL()
} else {
iError = QNetworkSession::UnknownSessionError;
}
- emit QNetworkSessionPrivate::error(iError);
+ QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError));
Cancel();
if (ipConnectionNotifier) {
ipConnectionNotifier->StopNotifications();
}
- syncStateWithInterface();
+ QT_TRYCATCH_LEAVING(syncStateWithInterface());
break;
}
}
@@ -1110,6 +1195,12 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
return false;
}
+ // Make sure that some lagging 'connecting' state-changes do not overwrite
+ // if we are already connected (may righfully still happen with roaming though).
+ if (state == QNetworkSession::Connected && newState == QNetworkSession::Connecting) {
+ return false;
+ }
+
bool emitSessionClosed = false;
// If we abruptly go down and user hasn't closed the session, we've been aborted.
@@ -1123,6 +1214,7 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
// application or session stops connection or when network drops
// unexpectedly).
isOpen = false;
+ isOpening = false;
activeConfig = QNetworkConfiguration();
serviceConfig = QNetworkConfiguration();
iError = QNetworkSession::SessionAbortedError;
@@ -1187,7 +1279,7 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
QNetworkConfiguration config = bestConfigFromSNAP(publicConfig);
if ((config.state() == QNetworkConfiguration::Defined) ||
(config.state() == QNetworkConfiguration::Discovered)) {
-
+ activeConfig = QNetworkConfiguration();
state = newState;
#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "===> EMIT State changed E to: " << state;
@@ -1208,24 +1300,31 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
}
}
}
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+ // If the retVal is not true here, it means that the status update may apply to an IAP outside of
+ // SNAP (session is based on SNAP but follows IAP outside of it), which may occur on Symbian^3 EasyWlan.
+ if (retVal == false && activeConfig.isValid() &&
+ toSymbianConfig(privateConfiguration(activeConfig))->numericIdentifier() == accessPointId) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "===> EMIT State changed G to: " << state;
+#endif
+ if (newState == QNetworkSession::Disconnected) {
+ activeConfig = QNetworkConfiguration();
+ }
+ state = newState;
+ emit stateChanged(state);
+ retVal = true;
+ }
+#endif
}
}
-
if (emitSessionClosed) {
emit closed();
}
if (state == QNetworkSession::Disconnected) {
- // The connection has gone down, and processing of status updates must be
- // stopped. Depending on platform, there may come 'connecting/connected' states
- // considerably later (almost a second). Connection id is an increasing
- // number, so this does not affect next _real_ 'conneting/connected' states.
-
- SymbianNetworkConfigurationPrivate *symbianConfig =
- toSymbianConfig(privateConfiguration(publicConfig));
-
- iDeprecatedConnectionId = symbianConfig->connectionIdentifier();
+ // Just in case clear activeConfiguration.
+ activeConfig = QNetworkConfiguration();
}
-
return retVal;
}
@@ -1250,7 +1349,6 @@ void QNetworkSessionPrivateImpl::handleSymbianConnectionStatusChange(TInt aConne
case KFinishedSelection:
if (aError == KErrNone)
{
- // The user successfully selected an IAP to be used
break;
}
else
@@ -1364,7 +1462,7 @@ void ConnectionProgressNotifier::DoCancel()
void ConnectionProgressNotifier::RunL()
{
if (iStatus == KErrNone) {
- iOwner.handleSymbianConnectionStatusChange(iProgress().iStage, iProgress().iError);
+ QT_TRYCATCH_LEAVING(iOwner.handleSymbianConnectionStatusChange(iProgress().iStage, iProgress().iError));
SetActive();
iConnection.ProgressNotification(iProgress, iStatus);
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h
index b045ff1..0754ace 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.h
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.h
@@ -73,6 +73,8 @@ QT_BEGIN_NAMESPACE
class ConnectionProgressNotifier;
class SymbianEngine;
+typedef void (*TOpenCUnSetdefaultifFunction)();
+
class QNetworkSessionPrivateImpl : public QNetworkSessionPrivate, public CActive
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
, public MMobilityProtocolResp
@@ -153,6 +155,9 @@ private: // data
QDateTime startTime;
+ RLibrary iOpenCLibrary;
+ TOpenCUnSetdefaultifFunction iDynamicUnSetdefaultif;
+
mutable RSocketServ iSocketServ;
mutable RConnection iConnection;
mutable RConnectionMonitor iConnectionMonitor;
@@ -162,7 +167,6 @@ private: // data
bool iFirstSync;
bool iStoppedByUser;
bool iClosedByUser;
- TUint32 iDeprecatedConnectionId;
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
CActiveCommsMobilityApiExt* iMobility;
@@ -178,6 +182,8 @@ private: // data
TUint32 iOldRoamingIap;
TUint32 iNewRoamingIap;
+ bool isOpening;
+
friend class ConnectionProgressNotifier;
};
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index ab1ba28..ca444c1 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -46,7 +46,6 @@
#include <cdbcols.h>
#include <d32dbms.h>
#include <nifvar.h>
-#include <QEventLoop>
#include <QTimer>
#include <QTime> // For randgen seeding
#include <QtCore> // For randgen seeding
@@ -73,9 +72,6 @@
QT_BEGIN_NAMESPACE
-#ifdef SNAP_FUNCTIONALITY_AVAILABLE
- static const int KValueThatWillBeAddedToSNAPId = 1000;
-#endif
static const int KUserChoiceIAPId = 0;
SymbianNetworkConfigurationPrivate::SymbianNetworkConfigurationPrivate()
@@ -114,8 +110,8 @@ QString SymbianNetworkConfigurationPrivate::bearerName() const
}
SymbianEngine::SymbianEngine(QObject *parent)
-: QBearerEngine(parent), CActive(CActive::EPriorityIdle), iFirstUpdate(true), iInitOk(true),
- iIgnoringUpdates(false)
+: QBearerEngine(parent), CActive(CActive::EPriorityHigh), iFirstUpdate(true), iInitOk(true),
+ iUpdatePending(false)
{
}
@@ -135,6 +131,9 @@ void SymbianEngine::initialize()
}
TRAP_IGNORE(iConnectionMonitor.ConnectL());
+#ifdef SNAP_FUNCTIONALITY_AVAILABLE
+ TRAP_IGNORE(iConnectionMonitor.SetUintAttribute(EBearerIdAll, 0, KBearerGroupThreshold, 1));
+#endif
TRAP_IGNORE(iConnectionMonitor.NotifyEventL(*this));
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
@@ -190,6 +189,28 @@ SymbianEngine::~SymbianEngine()
delete cleanup;
}
+void SymbianEngine::delayedConfigurationUpdate()
+{
+ QMutexLocker locker(&mutex);
+
+ if (iUpdatePending) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug("QNCM delayed configuration update (ECommit or ERecover occurred).");
+#endif
+ TRAPD(error, updateConfigurationsL());
+ if (error == KErrNone) {
+ updateStatesToSnaps();
+ }
+ iUpdatePending = false;
+ // Start monitoring again.
+ if (!IsActive()) {
+ SetActive();
+ // Start waiting for new notification
+ ipCommsDB->RequestNotification(iStatus);
+ }
+ }
+}
+
bool SymbianEngine::hasIdentifier(const QString &id)
{
QMutexLocker locker(&mutex);
@@ -261,7 +282,7 @@ void SymbianEngine::updateConfigurationsL()
RCmConnectionMethod connectionMethod = iCmManager.ConnectionMethodL(connectionMethods[i]);
CleanupClosePushL(connectionMethod);
TUint32 iapId = connectionMethod.GetIntAttributeL(CMManager::ECmIapId);
- QString ident = QString::number(qHash(iapId));
+ QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(iapId));
if (accessPointConfigurations.contains(ident)) {
knownConfigs.removeOne(ident);
} else {
@@ -272,7 +293,11 @@ void SymbianEngine::updateConfigurationsL()
accessPointConfigurations.insert(ptr->id, ptr);
mutex.unlock();
- emit configurationAdded(ptr);
+ // Emit configuration added. Connected slots may throw execptions
+ // which propagate here --> must be converted to leaves (standard
+ // std::exception would cause any TRAP trapping this function to terminate
+ // program).
+ QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
mutex.lock();
}
}
@@ -288,15 +313,15 @@ void SymbianEngine::updateConfigurationsL()
RCmDestination destination;
destination = iCmManager.DestinationL(destinations[i]);
CleanupClosePushL(destination);
- QString ident = QString::number(qHash(destination.Id()+KValueThatWillBeAddedToSNAPId)); //TODO: Check if it's ok to add 1000 SNAP Id to prevent SNAP ids overlapping IAP ids
+ QString ident = QT_BEARERMGMT_CONFIGURATION_SNAP_PREFIX +
+ QString::number(qHash(destination.Id()));
if (snapConfigurations.contains(ident)) {
knownSnapConfigs.removeOne(ident);
} else {
SymbianNetworkConfigurationPrivate *cpPriv = new SymbianNetworkConfigurationPrivate;
- CleanupStack::PushL(cpPriv);
HBufC *pName = destination.NameLC();
- cpPriv->name = QString::fromUtf16(pName->Ptr(),pName->Length());
+ QT_TRYCATCH_LEAVING(cpPriv->name = QString::fromUtf16(pName->Ptr(),pName->Length()));
CleanupStack::PopAndDestroy(pName);
pName = NULL;
@@ -313,10 +338,8 @@ void SymbianEngine::updateConfigurationsL()
snapConfigurations.insert(ident, ptr);
mutex.unlock();
- emit configurationAdded(ptr);
+ QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
mutex.lock();
-
- CleanupStack::Pop(cpPriv);
}
QNetworkConfigurationPrivatePointer privSNAP = snapConfigurations.value(ident);
@@ -325,7 +348,7 @@ void SymbianEngine::updateConfigurationsL()
CleanupClosePushL(connectionMethod);
TUint32 iapId = connectionMethod.GetIntAttributeL(CMManager::ECmIapId);
- QString iface = QString::number(qHash(iapId));
+ QString iface = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(iapId));
// Check that IAP can be found from accessPointConfigurations list
QNetworkConfigurationPrivatePointer priv = accessPointConfigurations.value(iface);
if (!priv) {
@@ -336,7 +359,7 @@ void SymbianEngine::updateConfigurationsL()
accessPointConfigurations.insert(ptr->id, ptr);
mutex.unlock();
- emit configurationAdded(ptr);
+ QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
mutex.lock();
QMutexLocker configLocker(&privSNAP->mutex);
@@ -380,7 +403,7 @@ void SymbianEngine::updateConfigurationsL()
TInt retVal = pDbTView->GotoFirstRecord();
while (retVal == KErrNone) {
pDbTView->ReadUintL(TPtrC(COMMDB_ID), apId);
- QString ident = QString::number(qHash(apId));
+ QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
if (accessPointConfigurations.contains(ident)) {
knownConfigs.removeOne(ident);
} else {
@@ -390,7 +413,7 @@ void SymbianEngine::updateConfigurationsL()
accessPointConfigurations.insert(ident, ptr);
mutex.unlock();
- emit configurationAdded(ptr);
+ QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
mutex.lock();
} else {
delete cpPriv;
@@ -400,7 +423,7 @@ void SymbianEngine::updateConfigurationsL()
}
CleanupStack::PopAndDestroy(pDbTView);
#endif
- updateActiveAccessPoints();
+ QT_TRYCATCH_LEAVING(updateActiveAccessPoints());
foreach (const QString &oldIface, knownConfigs) {
//remove non existing IAP
@@ -408,6 +431,7 @@ void SymbianEngine::updateConfigurationsL()
mutex.unlock();
emit configurationRemoved(ptr);
+ QT_TRYCATCH_LEAVING(emit configurationRemoved(ptr));
mutex.lock();
// Remove non existing IAP from SNAPs
@@ -431,6 +455,7 @@ void SymbianEngine::updateConfigurationsL()
mutex.unlock();
emit configurationRemoved(ptr);
+ QT_TRYCATCH_LEAVING(emit configurationRemoved(ptr));
mutex.lock();
}
@@ -445,14 +470,12 @@ SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL(
RCmConnectionMethod& connectionMethod)
{
SymbianNetworkConfigurationPrivate *cpPriv = new SymbianNetworkConfigurationPrivate;
- CleanupStack::PushL(cpPriv);
-
TUint32 iapId = connectionMethod.GetIntAttributeL(CMManager::ECmIapId);
- QString ident = QString::number(qHash(iapId));
+ QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(iapId));
HBufC *pName = connectionMethod.GetStringAttributeL(CMManager::ECmName);
CleanupStack::PushL(pName);
- cpPriv->name = QString::fromUtf16(pName->Ptr(),pName->Length());
+ QT_TRYCATCH_LEAVING(cpPriv->name = QString::fromUtf16(pName->Ptr(),pName->Length()));
CleanupStack::PopAndDestroy(pName);
pName = NULL;
@@ -500,7 +523,7 @@ SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL(
if (error == KErrNone && pName) {
CleanupStack::PushL(pName);
- cpPriv->mappingName = QString::fromUtf16(pName->Ptr(),pName->Length());
+ QT_TRYCATCH_LEAVING(cpPriv->mappingName = QString::fromUtf16(pName->Ptr(),pName->Length()));
CleanupStack::PopAndDestroy(pName);
pName = NULL;
}
@@ -518,8 +541,6 @@ SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL(
cpPriv->type = QNetworkConfiguration::InternetAccessPoint;
cpPriv->purpose = QNetworkConfiguration::UnknownPurpose;
cpPriv->roamingSupported = false;
-
- CleanupStack::Pop(cpPriv);
return cpPriv;
}
#else
@@ -550,9 +571,9 @@ void SymbianEngine::readNetworkConfigurationValuesFromCommsDbL(
User::Leave(KErrNotFound);
}
- QString ident = QString::number(qHash(aApId));
+ QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(aApId));
- apNetworkConfiguration->name = QString::fromUtf16(name.Ptr(),name.Length());
+ QT_TRYCATCH_LEAVING(apNetworkConfiguration->name = QString::fromUtf16(name.Ptr(),name.Length()));
apNetworkConfiguration->isValid = true;
apNetworkConfiguration->id = ident;
apNetworkConfiguration->numericId = aApId;
@@ -617,10 +638,12 @@ QNetworkConfigurationPrivatePointer SymbianEngine::defaultConfigurationL()
TCmDefConnValue defaultConnectionValue;
iCmManager.ReadDefConnL(defaultConnectionValue);
if (defaultConnectionValue.iType == ECmDefConnDestination) {
- QString iface = QString::number(qHash(defaultConnectionValue.iId+KValueThatWillBeAddedToSNAPId));
+ QString iface = QT_BEARERMGMT_CONFIGURATION_SNAP_PREFIX +
+ QString::number(qHash(defaultConnectionValue.iId));
ptr = snapConfigurations.value(iface);
} else if (defaultConnectionValue.iType == ECmDefConnConnectionMethod) {
- QString iface = QString::number(qHash(defaultConnectionValue.iId));
+ QString iface = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX +
+ QString::number(qHash(defaultConnectionValue.iId));
ptr = accessPointConfigurations.value(iface);
}
#endif
@@ -658,8 +681,14 @@ void SymbianEngine::updateActiveAccessPoints()
iConnectionMonitor.GetConnectionInfo(i, connectionId, subConnectionCount);
iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
User::WaitForRequest(status);
- QString ident = QString::number(qHash(apId));
+ QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+ if (!ptr) {
+ // If IAP was not found, check if the update was about EasyWLAN
+ ptr = configurationFromEasyWlan(apId, connectionId);
+ }
+#endif
if (ptr) {
iConnectionMonitor.GetIntAttribute(connectionId, subConnectionCount, KConnectionStatus, connectionStatus, status);
User::WaitForRequest(status);
@@ -690,7 +719,7 @@ void SymbianEngine::updateActiveAccessPoints()
if (iOnline != online) {
iOnline = online;
mutex.unlock();
- emit this->onlineStateChanged(iOnline);
+ emit this->onlineStateChanged(online);
mutex.lock();
}
}
@@ -715,7 +744,8 @@ void SymbianEngine::accessPointScanningReady(TBool scanSuccessful, TConnMonIapIn
// Set state of returned IAPs to Discovered
// if state is not already Active
for(TUint i=0; i<iapInfo.iCount; i++) {
- QString ident = QString::number(qHash(iapInfo.iIap[i].iIapId));
+ QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX +
+ QString::number(qHash(iapInfo.iIap[i].iIapId));
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
if (ptr) {
unavailableConfigs.removeOne(ident);
@@ -783,6 +813,59 @@ void SymbianEngine::updateStatesToSnaps()
}
}
+#ifdef SNAP_FUNCTIONALITY_AVAILABLE
+void SymbianEngine::updateMobileBearerToConfigs(TConnMonBearerInfo bearerInfo)
+{
+ QHash<QString, QNetworkConfigurationPrivatePointer>::const_iterator i =
+ accessPointConfigurations.constBegin();
+ while (i != accessPointConfigurations.constEnd()) {
+ QNetworkConfigurationPrivatePointer ptr = i.value();
+
+ QMutexLocker locker(&ptr->mutex);
+
+ SymbianNetworkConfigurationPrivate *p = toSymbianConfig(ptr);
+
+ if (p->bearer >= SymbianNetworkConfigurationPrivate::Bearer2G &&
+ p->bearer <= SymbianNetworkConfigurationPrivate::BearerHSPA) {
+ switch (bearerInfo) {
+ case EBearerInfoCSD:
+ p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+ break;
+ case EBearerInfoWCDMA:
+ p->bearer = SymbianNetworkConfigurationPrivate::BearerWCDMA;
+ break;
+ case EBearerInfoCDMA2000:
+ p->bearer = SymbianNetworkConfigurationPrivate::BearerCDMA2000;
+ break;
+ case EBearerInfoGPRS:
+ p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+ break;
+ case EBearerInfoHSCSD:
+ p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+ break;
+ case EBearerInfoEdgeGPRS:
+ p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+ break;
+ case EBearerInfoWcdmaCSD:
+ p->bearer = SymbianNetworkConfigurationPrivate::BearerWCDMA;
+ break;
+ case EBearerInfoHSDPA:
+ p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA;
+ break;
+ case EBearerInfoHSUPA:
+ p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA;
+ break;
+ case EBearerInfoHSxPA:
+ p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA;
+ break;
+ }
+ }
+
+ ++i;
+ }
+}
+#endif
+
bool SymbianEngine::changeConfigurationStateTo(QNetworkConfigurationPrivatePointer ptr,
QNetworkConfiguration::StateFlags newState)
{
@@ -873,55 +956,30 @@ void SymbianEngine::RunL()
{
QMutexLocker locker(&mutex);
- if (iIgnoringUpdates) {
-#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
- qDebug("QNCM CommsDB event handling postponed (postpone-timer running because IAPs/SNAPs were updated very recently).");
-#endif
- return;
- }
-
- RDbNotifier::TEvent event = STATIC_CAST(RDbNotifier::TEvent, iStatus.Int());
-
- switch (event) {
- case RDbNotifier::EUnlock: /** All read locks have been removed. */
- case RDbNotifier::ECommit: /** A transaction has been committed. */
- case RDbNotifier::ERollback: /** A transaction has been rolled back */
- case RDbNotifier::ERecover: /** The database has been recovered */
+ if (iStatus != KErrCancel) {
+ // By default, start relistening notifications. Stop only if interesting event occured.
+ iWaitingCommsDatabaseNotifications = true;
+ RDbNotifier::TEvent event = STATIC_CAST(RDbNotifier::TEvent, iStatus.Int());
+ switch (event) {
+ case RDbNotifier::ECommit: /** A transaction has been committed. */
+ case RDbNotifier::ERecover: /** The database has been recovered */
#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
- qDebug("QNCM CommsDB event (of type RDbNotifier::TEvent) received: %d", iStatus.Int());
+ qDebug("QNCM CommsDB event (of type RDbNotifier::TEvent) received: %d", iStatus.Int());
#endif
- iIgnoringUpdates = true;
- // Other events than ECommit get lower priority. In practice with those events,
- // we delay_before_updating methods, whereas
- // with ECommit we _update_before_delaying the reaction to next event.
- // Few important notes: 1) listening to only ECommit does not seem to be adequate,
- // but updates will be missed. Hence other events are reacted upon too.
- // 2) RDbNotifier records the most significant event, and that will be returned once
- // we issue new RequestNotification, and hence updates will not be missed even
- // when we are 'not reacting to them' for few seconds.
- if (event == RDbNotifier::ECommit) {
- TRAPD(error, updateConfigurationsL());
- if (error == KErrNone) {
- updateStatesToSnaps();
- }
- locker.unlock();
- waitRandomTime();
- locker.relock();
- } else {
- locker.unlock();
- waitRandomTime();
- locker.relock();
- TRAPD(error, updateConfigurationsL());
- if (error == KErrNone) {
- updateStatesToSnaps();
+ // Mark that there is update pending. No need to ask more events,
+ // as we know we will be updating anyway when the timer expires.
+ if (!iUpdatePending) {
+ iUpdatePending = true;
+ iWaitingCommsDatabaseNotifications = false;
+ // Update after random time, so that many processes won't
+ // start updating simultaneously
+ updateConfigurationsAfterRandomTime();
}
+ break;
+ default:
+ // Do nothing
+ break;
}
- iIgnoringUpdates = false; // Wait time done, allow updating again
- iWaitingCommsDatabaseNotifications = true;
- break;
- default:
- // Do nothing
- break;
}
if (iWaitingCommsDatabaseNotifications) {
@@ -945,6 +1003,20 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
QMutexLocker locker(&mutex);
switch (aEvent.EventType()) {
+#ifdef SNAP_FUNCTIONALITY_AVAILABLE
+ case EConnMonBearerInfoChange:
+ {
+ CConnMonBearerInfoChange* realEvent;
+ realEvent = (CConnMonBearerInfoChange*) &aEvent;
+ TUint connectionId = realEvent->ConnectionId();
+ if (connectionId == EBearerIdAll) {
+ //Network level event
+ TConnMonBearerInfo bearerInfo = (TConnMonBearerInfo)realEvent->BearerInfo();
+ updateMobileBearerToConfigs(bearerInfo);
+ }
+ break;
+ }
+#endif
case EConnMonConnectionStatusChange:
{
CConnMonConnectionStatusChange* realEvent;
@@ -960,14 +1032,23 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
TRequestStatus status;
iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
User::WaitForRequest(status);
- QString ident = QString::number(qHash(apId));
+
+ QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+ if (!ptr) {
+ // Check if status was regarding EasyWLAN
+ ptr = configurationFromEasyWlan(apId, connectionId);
+ }
+#endif
if (ptr) {
ptr->mutex.lock();
toSymbianConfig(ptr)->connectionId = connectionId;
ptr->mutex.unlock();
- emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
- connectionId, QNetworkSession::Connecting);
+ QT_TRYCATCH_LEAVING(
+ emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
+ connectionId, QNetworkSession::Connecting)
+ );
}
} else if (connectionStatus == KLinkLayerOpen) {
// Connection has been successfully opened
@@ -977,31 +1058,41 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
TRequestStatus status;
iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
User::WaitForRequest(status);
- QString ident = QString::number(qHash(apId));
+ QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+ if (!ptr) {
+ // Check for EasyWLAN
+ ptr = configurationFromEasyWlan(apId, connectionId);
+ }
+#endif
if (ptr) {
ptr->mutex.lock();
toSymbianConfig(ptr)->connectionId = connectionId;
ptr->mutex.unlock();
// Configuration is Active
- if (changeConfigurationStateTo(ptr, QNetworkConfiguration::Active)) {
- updateStatesToSnaps();
- }
- emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
- connectionId, QNetworkSession::Connected);
+ QT_TRYCATCH_LEAVING(
+ if (changeConfigurationStateTo(ptr, QNetworkConfiguration::Active)) {
+ updateStatesToSnaps();
+ }
+ emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
+ connectionId, QNetworkSession::Connected);
- if (!iOnline) {
- iOnline = true;
- emit this->onlineStateChanged(iOnline);
- }
+ if (!iOnline) {
+ iOnline = true;
+ emit this->onlineStateChanged(iOnline);
+ }
+ );
}
} else if (connectionStatus == KConfigDaemonStartingDeregistration) {
TUint connectionId = realEvent->ConnectionId();
QNetworkConfigurationPrivatePointer ptr = dataByConnectionId(connectionId);
if (ptr) {
- emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
- connectionId, QNetworkSession::Closing);
+ QT_TRYCATCH_LEAVING(
+ emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
+ connectionId, QNetworkSession::Closing)
+ );
}
} else if (connectionStatus == KLinkLayerClosed ||
connectionStatus == KConnectionClosed) {
@@ -1011,12 +1102,13 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
QNetworkConfigurationPrivatePointer ptr = dataByConnectionId(connectionId);
if (ptr) {
// Configuration is either Defined or Discovered
- if (changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Discovered)) {
- updateStatesToSnaps();
- }
-
- emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
- connectionId, QNetworkSession::Disconnected);
+ QT_TRYCATCH_LEAVING(
+ if (changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Discovered)) {
+ updateStatesToSnaps();
+ }
+ emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
+ connectionId, QNetworkSession::Disconnected);
+ );
}
bool online = false;
@@ -1030,7 +1122,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
}
if (iOnline != online) {
iOnline = online;
- emit this->onlineStateChanged(iOnline);
+ QT_TRYCATCH_LEAVING(emit this->onlineStateChanged(iOnline));
}
}
}
@@ -1043,12 +1135,13 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
TConnMonIapInfo iaps = realEvent->IapAvailability();
QList<QString> unDiscoveredConfigs = accessPointConfigurations.keys();
for ( TUint i = 0; i < iaps.Count(); i++ ) {
- QString ident = QString::number(qHash(iaps.iIap[i].iIapId));
+ QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX +
+ QString::number(qHash(iaps.iIap[i].iIapId));
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
if (ptr) {
// Configuration is either Discovered or Active
- changeConfigurationStateAtMinTo(ptr, QNetworkConfiguration::Discovered);
+ QT_TRYCATCH_LEAVING(changeConfigurationStateAtMinTo(ptr, QNetworkConfiguration::Discovered));
unDiscoveredConfigs.removeOne(ident);
}
}
@@ -1056,7 +1149,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(iface);
if (ptr) {
// Configuration is Defined
- changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Defined);
+ QT_TRYCATCH_LEAVING(changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Defined));
}
}
}
@@ -1073,8 +1166,14 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
TRequestStatus status;
iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
User::WaitForRequest(status);
- QString ident = QString::number(qHash(apId));
+ QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+ if (!ptr) {
+ // If IAP was not found, check if the update was about EasyWLAN
+ ptr = configurationFromEasyWlan(apId, connectionId);
+ }
+#endif
if (ptr) {
QMutexLocker configLocker(&ptr->mutex);
#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
@@ -1090,6 +1189,43 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
}
}
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+// Tries to derive configuration from EasyWLAN.
+// First checks if the interface brought up was EasyWLAN, then derives the real SSID,
+// and looks up configuration based on that one.
+QNetworkConfigurationPrivatePointer SymbianEngine::configurationFromEasyWlan(TUint32 apId, TUint connectionId)
+{
+ if (apId == iCmManager.EasyWlanIdL()) {
+ TRequestStatus status;
+ TBuf<50> easyWlanNetworkName;
+ iConnectionMonitor.GetStringAttribute( connectionId, 0, KNetworkName,
+ easyWlanNetworkName, status );
+ User::WaitForRequest(status);
+ if (status.Int() == KErrNone) {
+ QString realSSID = QString::fromUtf16(easyWlanNetworkName.Ptr(), easyWlanNetworkName.Length());
+
+ // Browser through all items and check their name for match
+ QHash<QString, QExplicitlySharedDataPointer<QNetworkConfigurationPrivate> >::const_iterator i =
+ accessPointConfigurations.constBegin();
+ while (i != accessPointConfigurations.constEnd()) {
+ QNetworkConfigurationPrivatePointer ptr = i.value();
+
+ QMutexLocker configLocker(&ptr->mutex);
+
+ if (ptr->name == realSSID) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNCM EasyWlan uses real SSID: " << realSSID;
+#endif
+ return ptr;
+ }
+ ++i;
+ }
+ }
+ }
+ return QNetworkConfigurationPrivatePointer();
+}
+#endif
+
// Sessions may use this function to report configuration state changes,
// because on some Symbian platforms (especially Symbian^3) all state changes are not
// reported by the RConnectionMonitor, in particular in relation to stop() call,
@@ -1107,7 +1243,8 @@ void SymbianEngine::configurationStateChangeReport(TUint32 accessPointId, QNetwo
switch (newState) {
case QNetworkSession::Disconnected:
{
- QString ident = QString::number(qHash(accessPointId));
+ QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX +
+ QString::number(qHash(accessPointId));
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
if (ptr) {
// Configuration is either Defined or Discovered
@@ -1129,15 +1266,13 @@ void SymbianEngine::configurationStateChangeReport(TUint32 accessPointId, QNetwo
}
// Waits for 2..6 seconds.
-void SymbianEngine::waitRandomTime()
+void SymbianEngine::updateConfigurationsAfterRandomTime()
{
- int iTimeToWait = qMax(2000, (qAbs(qrand()) % 7) * 1000);
+ int iTimeToWait = qMax(1000, (qAbs(qrand()) % 68) * 100);
#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
qDebug("QNCM waiting random time: %d ms", iTimeToWait);
#endif
- QEventLoop loop;
- QTimer::singleShot(iTimeToWait, &loop, SLOT(quit()));
- loop.exec();
+ QTimer::singleShot(iTimeToWait, this, SLOT(delayedConfigurationUpdate()));
}
QNetworkConfigurationPrivatePointer SymbianEngine::dataByConnectionId(TUint aConnectionId)
@@ -1158,7 +1293,7 @@ QNetworkConfigurationPrivatePointer SymbianEngine::dataByConnectionId(TUint aCon
AccessPointsAvailabilityScanner::AccessPointsAvailabilityScanner(SymbianEngine& owner,
RConnectionMonitor& connectionMonitor)
- : CActive(CActive::EPriorityStandard), iOwner(owner), iConnectionMonitor(connectionMonitor)
+ : CActive(CActive::EPriorityHigh), iOwner(owner), iConnectionMonitor(connectionMonitor)
{
CActiveScheduler::Add(this);
}
@@ -1198,9 +1333,9 @@ void AccessPointsAvailabilityScanner::RunL()
if (iStatus.Int() != KErrNone) {
iIapBuf().iCount = 0;
- iOwner.accessPointScanningReady(false,iIapBuf());
+ QT_TRYCATCH_LEAVING(iOwner.accessPointScanningReady(false,iIapBuf()));
} else {
- iOwner.accessPointScanningReady(true,iIapBuf());
+ QT_TRYCATCH_LEAVING(iOwner.accessPointScanningReady(true,iIapBuf()));
}
}
diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h
index 18fd249..cfddc29 100644
--- a/src/plugins/bearer/symbian/symbianengine.h
+++ b/src/plugins/bearer/symbian/symbianengine.h
@@ -55,6 +55,9 @@
// Uncomment and compile QtBearer to gain detailed state tracing
// #define QT_BEARERMGMT_SYMBIAN_DEBUG
+#define QT_BEARERMGMT_CONFIGURATION_SNAP_PREFIX QLatin1String("S_")
+#define QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX QLatin1String("I_")
+
class CCommsDatabase;
class QEventLoop;
@@ -159,6 +162,7 @@ Q_SIGNALS:
public Q_SLOTS:
void updateConfigurations();
+ void delayedConfigurationUpdate();
private:
void updateStatesToSnaps();
@@ -169,6 +173,7 @@ private:
bool changeConfigurationStateAtMaxTo(QNetworkConfigurationPrivatePointer ptr,
QNetworkConfiguration::StateFlags newState);
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
+ void updateMobileBearerToConfigs(TConnMonBearerInfo bearerInfo);
SymbianNetworkConfigurationPrivate *configFromConnectionMethodL(RCmConnectionMethod& connectionMethod);
#else
bool readNetworkConfigurationValuesFromCommsDb(
@@ -183,7 +188,7 @@ private:
void accessPointScanningReady(TBool scanSuccessful, TConnMonIapInfo iapInfo);
void startCommsDatabaseNotifications();
void stopCommsDatabaseNotifications();
- void waitRandomTime();
+ void updateConfigurationsAfterRandomTime();
QNetworkConfigurationPrivatePointer defaultConfigurationL();
TBool GetS60PlatformVersion(TUint& aMajor, TUint& aMinor) const;
@@ -201,6 +206,9 @@ private:
// For QNetworkSessionPrivate to indicate about state changes
void configurationStateChangeReport(TUint32 accessPointId,
QNetworkSession::State newState);
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+ QNetworkConfigurationPrivatePointer configurationFromEasyWlan(TUint32 apId, TUint connectionId);
+#endif
private: // Data
bool iFirstUpdate;
@@ -211,7 +219,7 @@ private: // Data
TBool iOnline;
TBool iInitOk;
TBool iUpdateGoingOn;
- TBool iIgnoringUpdates;
+ TBool iUpdatePending;
AccessPointsAvailabilityScanner* ipAccessPointsAvailabilityScanner;
diff --git a/src/plugins/codecs/cn/qgb18030codec.cpp b/src/plugins/codecs/cn/qgb18030codec.cpp
index 3f2eec7..e10c8b1 100644
--- a/src/plugins/codecs/cn/qgb18030codec.cpp
+++ b/src/plugins/codecs/cn/qgb18030codec.cpp
@@ -319,7 +319,7 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *
{
uchar buf[2];
int nbuf = 0;
- QChar replacement = QChar::ReplacementCharacter;
+ ushort replacement = QChar::ReplacementCharacter;
if (state) {
if (state->flags & ConvertInvalidToNull)
replacement = QChar::Null;
@@ -330,6 +330,9 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *
int invalid = 0;
QString result;
+ result.resize(len);
+ int unicodeLen = 0;
+ ushort *const resultData = reinterpret_cast<ushort*>(result.data());
//qDebug("QGbkDecoder::toUnicode(const char* chars = \"%s\", int len = %d)", chars, len);
for (int i=0; i<len; i++) {
@@ -338,14 +341,16 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *
case 0:
if (ch < 0x80) {
// ASCII
- result += QLatin1Char(ch);
+ resultData[unicodeLen] = ch;
+ ++unicodeLen;
} else if (Is1stByte(ch)) {
// GBK 1st byte?
buf[0] = ch;
nbuf = 1;
} else {
// Invalid
- result += replacement;
+ resultData[unicodeLen] = replacement;
+ ++unicodeLen;
++invalid;
}
break;
@@ -356,21 +361,25 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *
int clen = 2;
uint u = qt_Gb18030ToUnicode(buf, clen);
if (clen == 2) {
- result += qValidChar(u);
+ resultData[unicodeLen] = qValidChar(static_cast<ushort>(u));
+ ++unicodeLen;
} else {
- result += replacement;
+ resultData[unicodeLen] = replacement;
+ ++unicodeLen;
++invalid;
}
nbuf = 0;
} else {
// Error
- result += replacement;
+ resultData[unicodeLen] = replacement;
+ ++unicodeLen;
++invalid;
nbuf = 0;
}
break;
}
}
+ result.resize(unicodeLen);
if (state) {
state->remainingChars = nbuf;
diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro
index 85415b2..7a6fdf8 100644
--- a/src/plugins/phonon/mmf/mmf.pro
+++ b/src/plugins/phonon/mmf/mmf.pro
@@ -1,129 +1,127 @@
# MMF Phonon backend
-
-QT += phonon
-TARGET = phonon_mmf
-PHONON_MMF_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/mmf
-
-# Uncomment the following line in order to use the CDrmPlayerUtility client
-# API for audio playback, rather than CMdaAudioPlayerUtility.
-#CONFIG += phonon_mmf_audio_drm
-
-phonon_mmf_audio_drm {
- LIBS += -lDrmAudioPlayUtility
- DEFINES += QT_PHONON_MMF_AUDIO_DRM
-} else {
- LIBS += -lmediaclientaudio
-}
-
-# This is necessary because both epoc32/include and Phonon contain videoplayer.h.
-# By making /epoc32/include the first SYSTEMINCLUDE, we ensure that
-# '#include <videoplayer.h>' picks up the Symbian header, as intended.
-PREPEND_INCLUDEPATH = /epoc32/include
-
-PREPEND_INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty
-
-INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
-
-HEADERS += \
- $$PHONON_MMF_DIR/abstractaudioeffect.h \
- $$PHONON_MMF_DIR/abstractmediaplayer.h \
- $$PHONON_MMF_DIR/abstractplayer.h \
- $$PHONON_MMF_DIR/abstractvideooutput.h \
- $$PHONON_MMF_DIR/abstractvideoplayer.h \
- $$PHONON_MMF_DIR/audioequalizer.h \
- $$PHONON_MMF_DIR/audiooutput.h \
- $$PHONON_MMF_DIR/audioplayer.h \
- $$PHONON_MMF_DIR/backend.h \
- $$PHONON_MMF_DIR/bassboost.h \
- $$PHONON_MMF_DIR/defs.h \
- $$PHONON_MMF_DIR/dummyplayer.h \
- $$PHONON_MMF_DIR/effectfactory.h \
- $$PHONON_MMF_DIR/effectparameter.h \
- $$PHONON_MMF_DIR/environmentalreverb.h \
- $$PHONON_MMF_DIR/loudness.h \
- $$PHONON_MMF_DIR/mediaobject.h \
- $$PHONON_MMF_DIR/mmf_medianode.h \
- $$PHONON_MMF_DIR/stereowidening.h \
- $$PHONON_MMF_DIR/objectdump.h \
- $$PHONON_MMF_DIR/objectdump_symbian.h \
- $$PHONON_MMF_DIR/objecttree.h \
- $$PHONON_MMF_DIR/utils.h \
- $$PHONON_MMF_DIR/videowidget.h
-
-SOURCES += \
- $$PHONON_MMF_DIR/abstractaudioeffect.cpp \
- $$PHONON_MMF_DIR/abstractmediaplayer.cpp \
- $$PHONON_MMF_DIR/abstractplayer.cpp \
- $$PHONON_MMF_DIR/audioequalizer.cpp \
- $$PHONON_MMF_DIR/audiooutput.cpp \
- $$PHONON_MMF_DIR/audioplayer.cpp \
- $$PHONON_MMF_DIR/abstractvideooutput.cpp \
- $$PHONON_MMF_DIR/abstractvideoplayer.cpp \
- $$PHONON_MMF_DIR/backend.cpp \
- $$PHONON_MMF_DIR/bassboost.cpp \
- $$PHONON_MMF_DIR/dummyplayer.cpp \
- $$PHONON_MMF_DIR/effectfactory.cpp \
- $$PHONON_MMF_DIR/effectparameter.cpp \
- $$PHONON_MMF_DIR/environmentalreverb.cpp \
- $$PHONON_MMF_DIR/loudness.cpp \
- $$PHONON_MMF_DIR/mediaobject.cpp \
- $$PHONON_MMF_DIR/mmf_medianode.cpp \
- $$PHONON_MMF_DIR/stereowidening.cpp \
- $$PHONON_MMF_DIR/objectdump.cpp \
- $$PHONON_MMF_DIR/objectdump_symbian.cpp \
- $$PHONON_MMF_DIR/objecttree.cpp \
- $$PHONON_MMF_DIR/utils.cpp \
- $$PHONON_MMF_DIR/videowidget.cpp
-
-# Test for whether the build environment supports video rendering to graphics
-# surfaces.
symbian {
- exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) {
- HEADERS += \
- $$PHONON_MMF_DIR/videooutput_surface.h \
- $$PHONON_MMF_DIR/videoplayer_surface.h
- SOURCES += \
- $$PHONON_MMF_DIR/videooutput_surface.cpp \
- $$PHONON_MMF_DIR/videoplayer_surface.cpp
- DEFINES += PHONON_MMF_VIDEO_SURFACES
- } else {
- HEADERS += \
- $$PHONON_MMF_DIR/ancestormovemonitor.h \
- $$PHONON_MMF_DIR/videooutput_dsa.h \
- $$PHONON_MMF_DIR/videoplayer_dsa.h
- SOURCES += \
- $$PHONON_MMF_DIR/ancestormovemonitor.cpp \
- $$PHONON_MMF_DIR/videooutput_dsa.cpp \
- $$PHONON_MMF_DIR/videoplayer_dsa.cpp \
- }
+ QT += phonon
+ TARGET = phonon_mmf
+ PHONON_MMF_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/mmf
+
+ # Uncomment the following line in order to use the CDrmPlayerUtility client
+ # API for audio playback, rather than CMdaAudioPlayerUtility.
+ #CONFIG += phonon_mmf_audio_drm
+
+ phonon_mmf_audio_drm {
+ LIBS += -lDrmAudioPlayUtility
+ DEFINES += QT_PHONON_MMF_AUDIO_DRM
+ } else {
+ LIBS += -lmediaclientaudio
+ }
+
+ # This is necessary because both epoc32/include and Phonon contain videoplayer.h.
+ # By making /epoc32/include the first SYSTEMINCLUDE, we ensure that
+ # '#include <videoplayer.h>' picks up the Symbian header, as intended.
+ PREPEND_INCLUDEPATH = /epoc32/include
+
+ PREPEND_INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty
+
+ INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+
+ HEADERS += \
+ $$PHONON_MMF_DIR/abstractaudioeffect.h \
+ $$PHONON_MMF_DIR/abstractmediaplayer.h \
+ $$PHONON_MMF_DIR/abstractplayer.h \
+ $$PHONON_MMF_DIR/abstractvideooutput.h \
+ $$PHONON_MMF_DIR/abstractvideoplayer.h \
+ $$PHONON_MMF_DIR/audioequalizer.h \
+ $$PHONON_MMF_DIR/audiooutput.h \
+ $$PHONON_MMF_DIR/audioplayer.h \
+ $$PHONON_MMF_DIR/backend.h \
+ $$PHONON_MMF_DIR/bassboost.h \
+ $$PHONON_MMF_DIR/defs.h \
+ $$PHONON_MMF_DIR/dummyplayer.h \
+ $$PHONON_MMF_DIR/effectfactory.h \
+ $$PHONON_MMF_DIR/effectparameter.h \
+ $$PHONON_MMF_DIR/environmentalreverb.h \
+ $$PHONON_MMF_DIR/loudness.h \
+ $$PHONON_MMF_DIR/mediaobject.h \
+ $$PHONON_MMF_DIR/mmf_medianode.h \
+ $$PHONON_MMF_DIR/stereowidening.h \
+ $$PHONON_MMF_DIR/objectdump.h \
+ $$PHONON_MMF_DIR/objectdump_symbian.h \
+ $$PHONON_MMF_DIR/objecttree.h \
+ $$PHONON_MMF_DIR/utils.h \
+ $$PHONON_MMF_DIR/videowidget.h
+
+ SOURCES += \
+ $$PHONON_MMF_DIR/abstractaudioeffect.cpp \
+ $$PHONON_MMF_DIR/abstractmediaplayer.cpp \
+ $$PHONON_MMF_DIR/abstractplayer.cpp \
+ $$PHONON_MMF_DIR/audioequalizer.cpp \
+ $$PHONON_MMF_DIR/audiooutput.cpp \
+ $$PHONON_MMF_DIR/audioplayer.cpp \
+ $$PHONON_MMF_DIR/abstractvideooutput.cpp \
+ $$PHONON_MMF_DIR/abstractvideoplayer.cpp \
+ $$PHONON_MMF_DIR/backend.cpp \
+ $$PHONON_MMF_DIR/bassboost.cpp \
+ $$PHONON_MMF_DIR/dummyplayer.cpp \
+ $$PHONON_MMF_DIR/effectfactory.cpp \
+ $$PHONON_MMF_DIR/effectparameter.cpp \
+ $$PHONON_MMF_DIR/environmentalreverb.cpp \
+ $$PHONON_MMF_DIR/loudness.cpp \
+ $$PHONON_MMF_DIR/mediaobject.cpp \
+ $$PHONON_MMF_DIR/mmf_medianode.cpp \
+ $$PHONON_MMF_DIR/stereowidening.cpp \
+ $$PHONON_MMF_DIR/objectdump.cpp \
+ $$PHONON_MMF_DIR/objectdump_symbian.cpp \
+ $$PHONON_MMF_DIR/objecttree.cpp \
+ $$PHONON_MMF_DIR/utils.cpp \
+ $$PHONON_MMF_DIR/videowidget.cpp
+
+ # Test for whether the build environment supports video rendering to graphics
+ # surfaces.
+ symbian:exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) {
+ HEADERS += \
+ $$PHONON_MMF_DIR/videooutput_surface.h \
+ $$PHONON_MMF_DIR/videoplayer_surface.h
+ SOURCES += \
+ $$PHONON_MMF_DIR/videooutput_surface.cpp \
+ $$PHONON_MMF_DIR/videoplayer_surface.cpp
+ DEFINES += PHONON_MMF_VIDEO_SURFACES
+ } else {
+ HEADERS += \
+ $$PHONON_MMF_DIR/ancestormovemonitor.h \
+ $$PHONON_MMF_DIR/videooutput_dsa.h \
+ $$PHONON_MMF_DIR/videoplayer_dsa.h
+ SOURCES += \
+ $$PHONON_MMF_DIR/ancestormovemonitor.cpp \
+ $$PHONON_MMF_DIR/videooutput_dsa.cpp \
+ $$PHONON_MMF_DIR/videoplayer_dsa.cpp \
+ }
+
+ LIBS += -lcone
+ LIBS += -lws32
+
+ # This is only needed for debug builds, but is always linked against.
+ LIBS += -lhal
+
+ TARGET.CAPABILITY = all -tcb
+
+ LIBS += -lmediaclientvideo # For CVideoPlayerUtility
+ LIBS += -lcone # For CCoeEnv
+ LIBS += -lws32 # For RWindow
+ LIBS += -lefsrv # For file server
+ LIBS += -lapgrfx -lapmime # For recognizer
+ LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry
+ LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream
+
+ # These are for effects.
+ LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect
+
+ # This is needed for having the .qtplugin file properly created on Symbian.
+ QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend
+
+ target.path = $$[QT_INSTALL_PLUGINS]/phonon_backend
+ INSTALLS += target
+
+ include(../../qpluginbase.pri)
+
+ TARGET.UID3=0x2001E629
}
-
-LIBS += -lcone
-LIBS += -lws32
-
-# This is only needed for debug builds, but is always linked against.
-LIBS += -lhal
-
-TARGET.CAPABILITY = all -tcb
-
-LIBS += -lmediaclientvideo # For CVideoPlayerUtility
-LIBS += -lcone # For CCoeEnv
-LIBS += -lws32 # For RWindow
-LIBS += -lefsrv # For file server
-LIBS += -lapgrfx -lapmime # For recognizer
-LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry
-LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream
-
-# These are for effects.
-LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect
-
-# This is needed for having the .qtplugin file properly created on Symbian.
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend
-
-target.path = $$[QT_INSTALL_PLUGINS]/phonon_backend
-INSTALLS += target
-
-include(../../qpluginbase.pri)
-
-TARGET.UID3=0x2001E629
-
diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def
index 45caeb0..101c6a8 100644
--- a/src/s60installs/bwins/QtCoreu.def
+++ b/src/s60installs/bwins/QtCoreu.def
@@ -4480,4 +4480,6 @@ EXPORTS
?trUtf8@QEventDispatcherSymbian@@SA?AVQString@@PBD0H@Z @ 4479 NONAME ; class QString QEventDispatcherSymbian::trUtf8(char const *, char const *, int)
?staticMetaObject@QEventDispatcherSymbian@@2UQMetaObject@@B @ 4480 NONAME ; struct QMetaObject const QEventDispatcherSymbian::staticMetaObject
?textDirection@QLocale@@QBE?AW4LayoutDirection@Qt@@XZ @ 4481 NONAME ; enum Qt::LayoutDirection QLocale::textDirection(void) const
+ ?peek@QIODevicePrivate@@UAE_JPAD_J@Z @ 4482 NONAME ; long long QIODevicePrivate::peek(char *, long long)
+ ?peek@QIODevicePrivate@@UAE?AVQByteArray@@_J@Z @ 4483 NONAME ; class QByteArray QIODevicePrivate::peek(long long)
diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index 0aac72b..ddc8cf4 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -4097,4 +4097,8 @@ EXPORTS
?setHeader@QDeclarativeGridView@@QAEXPAVQDeclarativeComponent@@@Z @ 4096 NONAME ; void QDeclarativeGridView::setHeader(class QDeclarativeComponent *)
?header@QDeclarativeGridView@@QBEPAVQDeclarativeComponent@@XZ @ 4097 NONAME ; class QDeclarativeComponent * QDeclarativeGridView::header(void) const
?footerChanged@QDeclarativeGridView@@IAEXXZ @ 4098 NONAME ; void QDeclarativeGridView::footerChanged(void)
+ ?registerAutoParentFunction@QDeclarativePrivate@@YAHP6A?AW4AutoParentResult@1@PAVQObject@@0@Z@Z @ 4099 NONAME ; int QDeclarativePrivate::registerAutoParentFunction(enum QDeclarativePrivate::AutoParentResult (*)(class QObject *, class QObject *))
+ ?parentFunctions@QDeclarativeMetaType@@SA?AV?$QList@P6A?AW4AutoParentResult@QDeclarativePrivate@@PAVQObject@@0@Z@@XZ @ 4100 NONAME ; class QList<enum QDeclarativePrivate::AutoParentResult (*)(class QObject *, class QObject *)> QDeclarativeMetaType::parentFunctions(void)
+ ?inputMethodEvent@QDeclarativeTextInput@@MAEXPAVQInputMethodEvent@@@Z @ 4101 NONAME ; void QDeclarativeTextInput::inputMethodEvent(class QInputMethodEvent *)
+ ?doUpdate@QDeclarativeBorderImage@@AAEXXZ @ 4102 NONAME ; void QDeclarativeBorderImage::doUpdate(void)
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index d439927..6e20131 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -12820,4 +12820,8 @@ EXPORTS
?textOption@QStaticText@@QBE?AVQTextOption@@XZ @ 12819 NONAME ; class QTextOption QStaticText::textOption(void) const
?isRightToLeft@QTextEngine@@QBE_NXZ @ 12820 NONAME ; bool QTextEngine::isRightToLeft(void) const
?textDirection@QTextBlock@@QBE?AW4LayoutDirection@Qt@@XZ @ 12821 NONAME ; enum Qt::LayoutDirection QTextBlock::textDirection(void) const
+ ?convertInPlace@QImageData@@QAE_NW4Format@QImage@@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 12822 NONAME ; bool QImageData::convertInPlace(enum QImage::Format, class QFlags<enum Qt::ImageConversionFlag>)
+ ?createPixmapForImage@QRasterPixmapData@@IAEXAAVQImage@@V?$QFlags@W4ImageConversionFlag@Qt@@@@_N@Z @ 12823 NONAME ; void QRasterPixmapData::createPixmapForImage(class QImage &, class QFlags<enum Qt::ImageConversionFlag>, bool)
+ ??0Tab@QTextOption@@QAE@MW4TabType@1@VQChar@@@Z @ 12824 NONAME ; QTextOption::Tab::Tab(float, enum QTextOption::TabType, class QChar)
+ ?fromData@QRasterPixmapData@@UAE_NPBEIPBDV?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 12825 NONAME ; bool QRasterPixmapData::fromData(unsigned char const *, unsigned int, char const *, class QFlags<enum Qt::ImageConversionFlag>)
diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def
index 48cad39..7b9e777 100644
--- a/src/s60installs/eabi/QtCoreu.def
+++ b/src/s60installs/eabi/QtCoreu.def
@@ -3707,4 +3707,6 @@ EXPORTS
_ZrsR11QDataStreamR12QEasingCurve @ 3706 NONAME
_ZNK7QLocale13textDirectionEv @ 3707 NONAME
_ZNK7QString13isRightToLeftEv @ 3708 NONAME
+ _ZN16QIODevicePrivate4peekEPcx @ 3709 NONAME
+ _ZN16QIODevicePrivate4peekEx @ 3710 NONAME
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index f997454..96e74a6 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -3681,4 +3681,9 @@ EXPORTS
_ZNK17QDeclarativeState7isNamedEv @ 3680 NONAME
_ZNK20QDeclarativeGridView6footerEv @ 3681 NONAME
_ZNK20QDeclarativeGridView6headerEv @ 3682 NONAME
+ _ZN19QDeclarativePrivate26registerAutoParentFunctionEPFNS_16AutoParentResultEP7QObjectS2_E @ 3683 NONAME
+ _ZN20QDeclarativeMetaType15parentFunctionsEv @ 3684 NONAME
+ _ZN21QDeclarativeTextInput16inputMethodEventEP17QInputMethodEvent @ 3685 NONAME
+ _ZN23QDeclarativeBorderImage8doUpdateEv @ 3686 NONAME
+ _ZThn8_N21QDeclarativeTextInput16inputMethodEventEP17QInputMethodEvent @ 3687 NONAME
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index b59ddee..45be23e 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12017,4 +12017,12 @@ EXPORTS
_ZNK11QStaticText10textOptionEv @ 12016 NONAME
_ZNK11QTextEngine13isRightToLeftEv @ 12017 NONAME
_ZNK14QWidgetPrivate22childAtRecursiveHelperERK6QPointbb @ 12018 NONAME
+ _ZN10QImageData14convertInPlaceEN6QImage6FormatE6QFlagsIN2Qt19ImageConversionFlagEE @ 12019 NONAME
+ _ZN17QRasterPixmapData20createPixmapForImageER6QImage6QFlagsIN2Qt19ImageConversionFlagEEb @ 12020 NONAME
+ _ZN17QRasterPixmapData8fromDataEPKhjPKc6QFlagsIN2Qt19ImageConversionFlagEE @ 12021 NONAME
+ _ZN15QGraphicsSystem16createPixmapDataEP11QPixmapData @ 12022 NONAME
+ _ZN17QRasterPixmapData4copyEPK11QPixmapDataRK5QRect @ 12023 NONAME
+ _ZNK11QPixmapData7toImageERK5QRect @ 12024 NONAME
+ _ZNK17QRasterPixmapData7toImageERK5QRect @ 12025 NONAME
+ _ZTV15QGraphicsSystem @ 12026 NONAME
diff --git a/src/s60installs/eabi/QtScriptu.def b/src/s60installs/eabi/QtScriptu.def
index 3269d97..288b3ab 100644
--- a/src/s60installs/eabi/QtScriptu.def
+++ b/src/s60installs/eabi/QtScriptu.def
@@ -439,4 +439,6 @@ EXPORTS
_ZN23QScriptDeclarativeClass7compareEPNS_6ObjectES1_ @ 438 NONAME
_ZN25QScriptEngineAgentPrivate11atStatementERKN5QTJSC17DebuggerCallFrameEii @ 439 NONAME
_ZN25QScriptEngineAgentPrivate18didReachBreakpointERKN5QTJSC17DebuggerCallFrameEii @ 440 NONAME
+ _ZN23QScriptDeclarativeClass20newStaticScopeObjectEP13QScriptEngine @ 441 NONAME
+ _ZN23QScriptDeclarativeClass20newStaticScopeObjectEP13QScriptEngineiPK7QStringPK12QScriptValuePK6QFlagsINS5_12PropertyFlagEE @ 442 NONAME
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index a093e4c..4addb84 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -175,13 +175,6 @@ symbian: {
particlesImport.path = c:$$QT_IMPORTS_BASE_DIR/Qt/labs/particles
DEPLOYMENT += folderlistmodelImport gesturesImport particlesImport
-
- contains(QT_CONFIG, webkit): {
- webkitImport.sources = $$QT_BUILD_TREE/imports/QtWebKit/qmlwebkitplugin$${QT_LIBINFIX}.dll
- webkitImport.sources += $$QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/declarative/qmldir
- webkitImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
- DEPLOYMENT += webkitImport
- }
}
graphicssystems_plugins.path = c:$$QT_PLUGINS_BASE_DIR/graphicssystems
diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro
index 1ba105d..9ea3080 100644
--- a/src/s60main/s60main.pro
+++ b/src/s60main/s60main.pro
@@ -25,6 +25,10 @@ symbian {
# Workaround for abld toolchain problem to make ARMV6 qtmain.lib link with GCCE apps
symbian-abld: QMAKE_CXXFLAGS.ARMCC += --dllimport_runtime
+
+ # Having MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA will cause s60main.lib be unlinkable
+ # against GCCE apps, so remove it
+ MMP_RULES -= $$MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA
} else {
error("$$_FILE_ is intended only for Symbian!")
}
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index e2999c1..7bccffe 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -64,6 +64,7 @@
#include "bridge/qscriptqobject_p.h"
#include "bridge/qscriptglobalobject_p.h"
#include "bridge/qscriptactivationobject_p.h"
+#include "bridge/qscriptstaticscopeobject_p.h"
#ifndef QT_NO_QOBJECT
#include <QtCore/qcoreapplication.h>
@@ -437,6 +438,53 @@ qsreal ToNumber(const QString &value)
#endif
+static const qsreal MsPerSecond = 1000.0;
+
+static inline int MsFromTime(qsreal t)
+{
+ int r = int(::fmod(t, MsPerSecond));
+ return (r >= 0) ? r : r + int(MsPerSecond);
+}
+
+/*!
+ \internal
+ Converts a JS date value (milliseconds) to a QDateTime (local time).
+*/
+QDateTime MsToDateTime(JSC::ExecState *exec, qsreal t)
+{
+ if (qIsNaN(t))
+ return QDateTime();
+ JSC::GregorianDateTime tm;
+ JSC::msToGregorianDateTime(exec, t, /*output UTC=*/true, tm);
+ int ms = MsFromTime(t);
+ QDateTime convertedUTC = QDateTime(QDate(tm.year + 1900, tm.month + 1, tm.monthDay),
+ QTime(tm.hour, tm.minute, tm.second, ms), Qt::UTC);
+ return convertedUTC.toLocalTime();
+}
+
+/*!
+ \internal
+ Converts a QDateTime to a JS date value (milliseconds).
+*/
+qsreal DateTimeToMs(JSC::ExecState *exec, const QDateTime &dt)
+{
+ if (!dt.isValid())
+ return qSNaN();
+ QDateTime utc = dt.toUTC();
+ QDate date = utc.date();
+ QTime time = utc.time();
+ JSC::GregorianDateTime tm;
+ tm.year = date.year() - 1900;
+ tm.month = date.month() - 1;
+ tm.monthDay = date.day();
+ tm.weekDay = date.dayOfWeek();
+ tm.yearDay = date.dayOfYear();
+ tm.hour = time.hour();
+ tm.minute = time.minute();
+ tm.second = time.second();
+ return JSC::gregorianDateTimeToMS(exec, tm, time.msec(), /*inputIsUTC=*/true);
+}
+
void GlobalClientData::mark(JSC::MarkStack& markStack)
{
engine->mark(markStack);
@@ -905,6 +953,7 @@ QScriptEnginePrivate::QScriptEnginePrivate()
JSC::ExecState* exec = globalObject->globalExec();
scriptObjectStructure = QScriptObject::createStructure(globalObject->objectPrototype());
+ staticScopeObjectStructure = QScriptStaticScopeObject::createStructure(JSC::jsNull());
qobjectPrototype = new (exec) QScript::QObjectPrototype(exec, QScript::QObjectPrototype::createStructure(globalObject->objectPrototype()), globalObject->prototypeFunctionStructure());
qobjectWrapperObjectStructure = QScriptObject::createStructure(qobjectPrototype);
@@ -1770,15 +1819,7 @@ void QScriptEnginePrivate::setProperty(JSC::ExecState *exec, JSC::JSValue object
} else if (flags != QScriptValue::KeepExistingFlags) {
if (thisObject->hasOwnProperty(exec, id))
thisObject->deleteProperty(exec, id); // ### hmmm - can't we just update the attributes?
- unsigned attribs = 0;
- if (flags & QScriptValue::ReadOnly)
- attribs |= JSC::ReadOnly;
- if (flags & QScriptValue::SkipInEnumeration)
- attribs |= JSC::DontEnum;
- if (flags & QScriptValue::Undeletable)
- attribs |= JSC::DontDelete;
- attribs |= flags & QScriptValue::UserRange;
- thisObject->putWithAttributes(exec, id, value, attribs);
+ thisObject->putWithAttributes(exec, id, value, propertyFlagsToJSCAttributes(flags));
} else {
JSC::PutPropertySlot slot;
thisObject->put(exec, id, value, slot);
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index 56366e2..c71465d 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -50,7 +50,6 @@
#include "bridge/qscriptobject_p.h"
#include "bridge/qscriptqobject_p.h"
#include "bridge/qscriptvariant_p.h"
-#include "utils/qscriptdate_p.h"
#include "DateConstructor.h"
#include "DateInstance.h"
@@ -119,6 +118,9 @@ namespace QScript
inline QString ToString(qsreal);
#endif
+ QDateTime MsToDateTime(JSC::ExecState *, qsreal);
+ qsreal DateTimeToMs(JSC::ExecState *, const QDateTime &);
+
//some conversion helper functions
inline QScriptEnginePrivate *scriptEngineFromExec(const JSC::ExecState *exec);
bool isFunction(JSC::JSValue value);
@@ -205,6 +207,7 @@ public:
inline QScriptValue scriptValueFromJSCValue(JSC::JSValue value);
inline JSC::JSValue scriptValueToJSCValue(const QScriptValue &value);
+ static inline unsigned propertyFlagsToJSCAttributes(const QScriptValue::PropertyFlags &flags);
static inline JSC::JSValue jscValueFromVariant(JSC::ExecState*, const QVariant &value);
static QVariant jscValueToVariant(JSC::ExecState*, JSC::JSValue value, int targetType);
@@ -346,6 +349,7 @@ public:
JSC::ExecState *currentFrame;
WTF::RefPtr<JSC::Structure> scriptObjectStructure;
+ WTF::RefPtr<JSC::Structure> staticScopeObjectStructure;
QScript::QObjectPrototype *qobjectPrototype;
WTF::RefPtr<JSC::Structure> qobjectWrapperObjectStructure;
@@ -639,6 +643,19 @@ inline JSC::JSValue QScriptEnginePrivate::scriptValueToJSCValue(const QScriptVal
return vv->jscValue;
}
+inline unsigned QScriptEnginePrivate::propertyFlagsToJSCAttributes(const QScriptValue::PropertyFlags &flags)
+{
+ unsigned attribs = 0;
+ if (flags & QScriptValue::ReadOnly)
+ attribs |= JSC::ReadOnly;
+ if (flags & QScriptValue::SkipInEnumeration)
+ attribs |= JSC::DontEnum;
+ if (flags & QScriptValue::Undeletable)
+ attribs |= JSC::DontDelete;
+ attribs |= flags & QScriptValue::UserRange;
+ return attribs;
+}
+
inline QScriptValuePrivate::~QScriptValuePrivate()
{
if (engine)
@@ -846,7 +863,7 @@ inline JSC::JSValue QScriptEnginePrivate::newDate(JSC::ExecState *exec, qsreal v
inline JSC::JSValue QScriptEnginePrivate::newDate(JSC::ExecState *exec, const QDateTime &value)
{
- return newDate(exec, QScript::FromDateTime(value));
+ return newDate(exec, QScript::DateTimeToMs(exec, value));
}
inline JSC::JSValue QScriptEnginePrivate::newObject()
@@ -979,12 +996,12 @@ inline JSC::UString QScriptEnginePrivate::toString(JSC::ExecState *exec, JSC::JS
return str;
}
-inline QDateTime QScriptEnginePrivate::toDateTime(JSC::ExecState *, JSC::JSValue value)
+inline QDateTime QScriptEnginePrivate::toDateTime(JSC::ExecState *exec, JSC::JSValue value)
{
if (!isDate(value))
return QDateTime();
qsreal t = static_cast<JSC::DateInstance*>(JSC::asObject(value))->internalNumber();
- return QScript::ToDateTime(t, Qt::LocalTime);
+ return QScript::MsToDateTime(exec, t);
}
inline QObject *QScriptEnginePrivate::toQObject(JSC::ExecState *exec, JSC::JSValue value)
diff --git a/src/script/bridge/bridge.pri b/src/script/bridge/bridge.pri
index 09e2dfb..ab0a322 100644
--- a/src/script/bridge/bridge.pri
+++ b/src/script/bridge/bridge.pri
@@ -6,6 +6,7 @@ SOURCES += \
$$PWD/qscriptqobject.cpp \
$$PWD/qscriptglobalobject.cpp \
$$PWD/qscriptactivationobject.cpp \
+ $$PWD/qscriptstaticscopeobject.cpp \
$$PWD/qscriptdeclarativeobject.cpp \
$$PWD/qscriptdeclarativeclass.cpp
@@ -17,5 +18,6 @@ HEADERS += \
$$PWD/qscriptqobject_p.h \
$$PWD/qscriptglobalobject_p.h \
$$PWD/qscriptactivationobject_p.h \
+ $$PWD/qscriptstaticscopeobject_p.h \
$$PWD/qscriptdeclarativeobject_p.h \
$$PWD/qscriptdeclarativeclass_p.h
diff --git a/src/script/bridge/qscriptdeclarativeclass.cpp b/src/script/bridge/qscriptdeclarativeclass.cpp
index 1093448..8080b9f 100644
--- a/src/script/bridge/qscriptdeclarativeclass.cpp
+++ b/src/script/bridge/qscriptdeclarativeclass.cpp
@@ -24,6 +24,7 @@
#include "qscriptdeclarativeclass_p.h"
#include "qscriptdeclarativeobject_p.h"
#include "qscriptobject_p.h"
+#include "qscriptstaticscopeobject_p.h"
#include <QtScript/qscriptstring.h>
#include <QtScript/qscriptengine.h>
#include <QtScript/qscriptengineagent.h>
@@ -549,4 +550,39 @@ QScriptContext *QScriptDeclarativeClass::context() const
return d_ptr->context;
}
+/*!
+ Creates a scope object with a fixed set of undeletable properties.
+*/
+QScriptValue QScriptDeclarativeClass::newStaticScopeObject(
+ QScriptEngine *engine, int propertyCount, const QString *names,
+ const QScriptValue *values, const QScriptValue::PropertyFlags *flags)
+{
+ QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
+ QScript::APIShim shim(eng_p);
+ JSC::ExecState *exec = eng_p->currentFrame;
+ QScriptStaticScopeObject::PropertyInfo *props = new QScriptStaticScopeObject::PropertyInfo[propertyCount];
+ for (int i = 0; i < propertyCount; ++i) {
+ unsigned attribs = QScriptEnginePrivate::propertyFlagsToJSCAttributes(flags[i]);
+ Q_ASSERT_X(attribs & JSC::DontDelete, Q_FUNC_INFO, "All properties must be undeletable");
+ JSC::Identifier id = JSC::Identifier(exec, names[i]);
+ JSC::JSValue jsval = eng_p->scriptValueToJSCValue(values[i]);
+ props[i] = QScriptStaticScopeObject::PropertyInfo(id, jsval, attribs);
+ }
+ QScriptValue result = eng_p->scriptValueFromJSCValue(new (exec)QScriptStaticScopeObject(eng_p->staticScopeObjectStructure,
+ propertyCount, props));
+ delete[] props;
+ return result;
+}
+
+/*!
+ Creates a static scope object that's initially empty, but to which new
+ properties can be added.
+*/
+QScriptValue QScriptDeclarativeClass::newStaticScopeObject(QScriptEngine *engine)
+{
+ QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
+ QScript::APIShim shim(eng_p);
+ return eng_p->scriptValueFromJSCValue(new (eng_p->currentFrame)QScriptStaticScopeObject(eng_p->staticScopeObjectStructure));
+}
+
QT_END_NAMESPACE
diff --git a/src/script/bridge/qscriptdeclarativeclass_p.h b/src/script/bridge/qscriptdeclarativeclass_p.h
index 714a67c..420b133 100644
--- a/src/script/bridge/qscriptdeclarativeclass_p.h
+++ b/src/script/bridge/qscriptdeclarativeclass_p.h
@@ -92,6 +92,11 @@ public:
static QScriptValue scopeChainValue(QScriptContext *, int index);
static QScriptContext *pushCleanContext(QScriptEngine *);
+ static QScriptValue newStaticScopeObject(
+ QScriptEngine *, int propertyCount, const QString *names,
+ const QScriptValue *values, const QScriptValue::PropertyFlags *flags);
+ static QScriptValue newStaticScopeObject(QScriptEngine *);
+
class Q_SCRIPT_EXPORT PersistentIdentifier
{
public:
diff --git a/src/script/bridge/qscriptstaticscopeobject.cpp b/src/script/bridge/qscriptstaticscopeobject.cpp
new file mode 100644
index 0000000..44548a4
--- /dev/null
+++ b/src/script/bridge/qscriptstaticscopeobject.cpp
@@ -0,0 +1,157 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL-ONLY$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "config.h"
+#include "qscriptstaticscopeobject_p.h"
+
+namespace JSC
+{
+ ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScriptStaticScopeObject));
+}
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QScriptStaticScopeObject
+ \internal
+
+ Represents a static scope object.
+
+ This class allows the VM to determine at JS script compile time whether
+ the object has a given property or not. If the object has the property,
+ a fast, index-based read/write operation will be used. If the object
+ doesn't have the property, the compiler knows it can safely skip this
+ object when dynamically resolving the property. Either way, this can
+ greatly improve performance.
+
+ \sa QScriptContext::pushScope()
+*/
+
+const JSC::ClassInfo QScriptStaticScopeObject::info = { "QScriptStaticScopeObject", 0, 0, 0 };
+
+/*!
+ Creates a static scope object with a fixed set of undeletable properties.
+
+ It's not possible to add new properties to the object after construction.
+*/
+QScriptStaticScopeObject::QScriptStaticScopeObject(WTF::NonNullPassRefPtr<JSC::Structure> structure,
+ int propertyCount, const PropertyInfo* props)
+ : JSC::JSVariableObject(structure, new Data(/*canGrow=*/false))
+{
+ int index = growRegisterArray(propertyCount);
+ for (int i = 0; i < propertyCount; ++i, --index) {
+ const PropertyInfo& prop = props[i];
+ JSC::SymbolTableEntry entry(index, prop.attributes);
+ symbolTable().add(prop.identifier.ustring().rep(), entry);
+ registerAt(index) = prop.value;
+ }
+}
+
+/*!
+ Creates an empty static scope object.
+
+ Properties can be added to the object after construction, either by
+ calling QScriptValue::setProperty(), or by pushing the object on the
+ scope chain; variable declarations ("var" statements) and function
+ declarations in JavaScript will create properties on the scope object.
+
+ Note that once the scope object has been used in a closure and the
+ resulting function has been compiled, it's no longer safe to add
+ properties to the scope object (because the VM will bypass this
+ object the next time the function is executed).
+*/
+QScriptStaticScopeObject::QScriptStaticScopeObject(WTF::NonNullPassRefPtr<JSC::Structure> structure)
+ : JSC::JSVariableObject(structure, new Data(/*canGrow=*/true))
+{
+}
+
+QScriptStaticScopeObject::~QScriptStaticScopeObject()
+{
+ delete d;
+}
+
+bool QScriptStaticScopeObject::getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot& slot)
+{
+ return symbolTableGet(propertyName, slot);
+}
+
+bool QScriptStaticScopeObject::getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor& descriptor)
+{
+ return symbolTableGet(propertyName, descriptor);
+}
+
+void QScriptStaticScopeObject::putWithAttributes(JSC::ExecState* exec, const JSC::Identifier &propertyName, JSC::JSValue value, unsigned attributes)
+{
+ if (symbolTablePutWithAttributes(propertyName, value, attributes))
+ return;
+ Q_ASSERT(d_ptr()->canGrow);
+ addSymbolTableProperty(propertyName, value, attributes);
+}
+
+void QScriptStaticScopeObject::put(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::JSValue value, JSC::PutPropertySlot&)
+{
+ if (symbolTablePut(propertyName, value))
+ return;
+ Q_ASSERT(d_ptr()->canGrow);
+ addSymbolTableProperty(propertyName, value, /*attributes=*/0);
+}
+
+bool QScriptStaticScopeObject::deleteProperty(JSC::ExecState*, const JSC::Identifier&)
+{
+ return false;
+}
+
+void QScriptStaticScopeObject::markChildren(JSC::MarkStack& markStack)
+{
+ JSC::Register* registerArray = d_ptr()->registerArray.get();
+ if (!registerArray)
+ return;
+ markStack.appendValues(reinterpret_cast<JSC::JSValue*>(registerArray), d_ptr()->registerArraySize);
+}
+
+void QScriptStaticScopeObject::addSymbolTableProperty(const JSC::Identifier& name, JSC::JSValue value, unsigned attributes)
+{
+ int index = growRegisterArray(1);
+ JSC::SymbolTableEntry newEntry(index, attributes | JSC::DontDelete);
+ symbolTable().add(name.ustring().rep(), newEntry);
+ registerAt(index) = value;
+}
+
+/*!
+ Grows the register array by \a count elements, and returns the offset of
+ the newly added elements (note that the register file grows downwards,
+ starting at index -1).
+*/
+int QScriptStaticScopeObject::growRegisterArray(int count)
+{
+ size_t oldSize = d_ptr()->registerArraySize;
+ size_t newSize = oldSize + count;
+ JSC::Register* registerArray = new JSC::Register[newSize];
+ if (d_ptr()->registerArray)
+ memcpy(registerArray + count, d_ptr()->registerArray.get(), oldSize * sizeof(JSC::Register));
+ setRegisters(registerArray + newSize, registerArray);
+ d_ptr()->registerArraySize = newSize;
+ return -oldSize - 1;
+}
+
+QT_END_NAMESPACE
diff --git a/src/script/bridge/qscriptstaticscopeobject_p.h b/src/script/bridge/qscriptstaticscopeobject_p.h
new file mode 100644
index 0000000..0a0e7ef
--- /dev/null
+++ b/src/script/bridge/qscriptstaticscopeobject_p.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL-ONLY$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSCRIPTSTATICSCOPEOBJECT_P_H
+#define QSCRIPTSTATICSCOPEOBJECT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qobjectdefs.h>
+
+#include "JSVariableObject.h"
+
+QT_BEGIN_NAMESPACE
+
+class QScriptStaticScopeObject : public JSC::JSVariableObject {
+public:
+ struct PropertyInfo {
+ PropertyInfo(const JSC::Identifier& i, JSC::JSValue v, unsigned a)
+ : identifier(i), value(v), attributes(a)
+ { }
+ PropertyInfo() {}
+
+ JSC::Identifier identifier;
+ JSC::JSValue value;
+ unsigned attributes;
+ };
+
+ QScriptStaticScopeObject(WTF::NonNullPassRefPtr<JSC::Structure> structure,
+ int propertyCount, const PropertyInfo*);
+ QScriptStaticScopeObject(WTF::NonNullPassRefPtr<JSC::Structure> structure);
+ virtual ~QScriptStaticScopeObject();
+
+ virtual bool isDynamicScope() const { return false; }
+
+ virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
+ virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
+
+ virtual void putWithAttributes(JSC::ExecState *exec, const JSC::Identifier &propertyName, JSC::JSValue value, unsigned attributes);
+ virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue value, JSC::PutPropertySlot&);
+
+ virtual bool deleteProperty(JSC::ExecState*, const JSC::Identifier& propertyName);
+
+ virtual void markChildren(JSC::MarkStack&);
+
+ virtual const JSC::ClassInfo* classInfo() const { return &info; }
+ static const JSC::ClassInfo info;
+
+ static WTF::PassRefPtr<JSC::Structure> createStructure(JSC::JSValue proto) {
+ return JSC::Structure::create(proto, JSC::TypeInfo(JSC::ObjectType, StructureFlags));
+ }
+
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::NeedsThisConversion | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames | JSC::JSVariableObject::StructureFlags;
+
+ struct Data : public JSVariableObjectData {
+ Data(bool canGrow_)
+ : JSVariableObjectData(&symbolTable, /*registers=*/0),
+ canGrow(canGrow_), registerArraySize(0)
+ { }
+ bool canGrow;
+ int registerArraySize;
+ JSC::SymbolTable symbolTable;
+ };
+
+ Data* d_ptr() const { return static_cast<Data*>(JSVariableObject::d); }
+
+private:
+ void addSymbolTableProperty(const JSC::Identifier&, JSC::JSValue, unsigned attributes);
+ int growRegisterArray(int);
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/script/script.pri b/src/script/script.pri
index 2ee1a82..9cd71d3 100644
--- a/src/script/script.pri
+++ b/src/script/script.pri
@@ -1,4 +1,3 @@
include($$PWD/api/api.pri)
include($$PWD/bridge/bridge.pri)
include($$PWD/parser/parser.pri)
-include($$PWD/utils/utils.pri)
diff --git a/src/script/utils/qscriptdate.cpp b/src/script/utils/qscriptdate.cpp
deleted file mode 100644
index 5980256..0000000
--- a/src/script/utils/qscriptdate.cpp
+++ /dev/null
@@ -1,365 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtScript module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL-ONLY$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qscriptdate_p.h"
-
-#include <QtCore/qnumeric.h>
-#include <QtCore/qstringlist.h>
-
-#include <math.h>
-
-#ifndef Q_WS_WIN
-# include <time.h>
-# include <sys/time.h>
-#else
-# include <windows.h>
-#endif
-
-QT_BEGIN_NAMESPACE
-
-namespace QScript {
-
-qsreal ToInteger(qsreal n);
-
-static const qsreal HoursPerDay = 24.0;
-static const qsreal MinutesPerHour = 60.0;
-static const qsreal SecondsPerMinute = 60.0;
-static const qsreal msPerSecond = 1000.0;
-static const qsreal msPerMinute = 60000.0;
-static const qsreal msPerHour = 3600000.0;
-static const qsreal msPerDay = 86400000.0;
-
-static qsreal LocalTZA = 0.0; // initialized at startup
-
-static inline qsreal TimeWithinDay(qsreal t)
-{
- qsreal r = ::fmod(t, msPerDay);
- return (r >= 0) ? r : r + msPerDay;
-}
-
-static inline int HourFromTime(qsreal t)
-{
- int r = int(::fmod(::floor(t / msPerHour), HoursPerDay));
- return (r >= 0) ? r : r + int(HoursPerDay);
-}
-
-static inline int MinFromTime(qsreal t)
-{
- int r = int(::fmod(::floor(t / msPerMinute), MinutesPerHour));
- return (r >= 0) ? r : r + int(MinutesPerHour);
-}
-
-static inline int SecFromTime(qsreal t)
-{
- int r = int(::fmod(::floor(t / msPerSecond), SecondsPerMinute));
- return (r >= 0) ? r : r + int(SecondsPerMinute);
-}
-
-static inline int msFromTime(qsreal t)
-{
- int r = int(::fmod(t, msPerSecond));
- return (r >= 0) ? r : r + int(msPerSecond);
-}
-
-static inline qsreal Day(qsreal t)
-{
- return ::floor(t / msPerDay);
-}
-
-static inline qsreal DaysInYear(qsreal y)
-{
- if (::fmod(y, 4))
- return 365;
-
- else if (::fmod(y, 100))
- return 366;
-
- else if (::fmod(y, 400))
- return 365;
-
- return 366;
-}
-
-static inline qsreal DayFromYear(qsreal y)
-{
- return 365 * (y - 1970)
- + ::floor((y - 1969) / 4)
- - ::floor((y - 1901) / 100)
- + ::floor((y - 1601) / 400);
-}
-
-static inline qsreal TimeFromYear(qsreal y)
-{
- return msPerDay * DayFromYear(y);
-}
-
-static inline qsreal YearFromTime(qsreal t)
-{
- int y = 1970;
- y += (int) ::floor(t / (msPerDay * 365.2425));
-
- qsreal t2 = TimeFromYear(y);
- return (t2 > t) ? y - 1 : ((t2 + msPerDay * DaysInYear(y)) <= t) ? y + 1 : y;
-}
-
-static inline bool InLeapYear(qsreal t)
-{
- qsreal x = DaysInYear(YearFromTime(t));
- if (x == 365)
- return 0;
-
- Q_ASSERT (x == 366);
- return 1;
-}
-
-static inline qsreal DayWithinYear(qsreal t)
-{
- return Day(t) - DayFromYear(YearFromTime(t));
-}
-
-static inline qsreal MonthFromTime(qsreal t)
-{
- qsreal d = DayWithinYear(t);
- qsreal l = InLeapYear(t);
-
- if (d < 31.0)
- return 0;
-
- else if (d < 59.0 + l)
- return 1;
-
- else if (d < 90.0 + l)
- return 2;
-
- else if (d < 120.0 + l)
- return 3;
-
- else if (d < 151.0 + l)
- return 4;
-
- else if (d < 181.0 + l)
- return 5;
-
- else if (d < 212.0 + l)
- return 6;
-
- else if (d < 243.0 + l)
- return 7;
-
- else if (d < 273.0 + l)
- return 8;
-
- else if (d < 304.0 + l)
- return 9;
-
- else if (d < 334.0 + l)
- return 10;
-
- else if (d < 365.0 + l)
- return 11;
-
- return qSNaN(); // ### assert?
-}
-
-static inline qsreal DateFromTime(qsreal t)
-{
- int m = (int) ToInteger(MonthFromTime(t));
- qsreal d = DayWithinYear(t);
- qsreal l = InLeapYear(t);
-
- switch (m) {
- case 0: return d + 1.0;
- case 1: return d - 30.0;
- case 2: return d - 58.0 - l;
- case 3: return d - 89.0 - l;
- case 4: return d - 119.0 - l;
- case 5: return d - 150.0 - l;
- case 6: return d - 180.0 - l;
- case 7: return d - 211.0 - l;
- case 8: return d - 242.0 - l;
- case 9: return d - 272.0 - l;
- case 10: return d - 303.0 - l;
- case 11: return d - 333.0 - l;
- }
-
- return qSNaN(); // ### assert
-}
-
-static inline qsreal WeekDay(qsreal t)
-{
- qsreal r = ::fmod (Day(t) + 4.0, 7.0);
- return (r >= 0) ? r : r + 7.0;
-}
-
-
-static inline qsreal MakeTime(qsreal hour, qsreal min, qsreal sec, qsreal ms)
-{
- return ((hour * MinutesPerHour + min) * SecondsPerMinute + sec) * msPerSecond + ms;
-}
-
-static inline qsreal DayFromMonth(qsreal month, qsreal leap)
-{
- switch ((int) month) {
- case 0: return 0;
- case 1: return 31.0;
- case 2: return 59.0 + leap;
- case 3: return 90.0 + leap;
- case 4: return 120.0 + leap;
- case 5: return 151.0 + leap;
- case 6: return 181.0 + leap;
- case 7: return 212.0 + leap;
- case 8: return 243.0 + leap;
- case 9: return 273.0 + leap;
- case 10: return 304.0 + leap;
- case 11: return 334.0 + leap;
- }
-
- return qSNaN(); // ### assert?
-}
-
-static qsreal MakeDay(qsreal year, qsreal month, qsreal day)
-{
- year += ::floor(month / 12.0);
-
- month = ::fmod(month, 12.0);
- if (month < 0)
- month += 12.0;
-
- qsreal t = TimeFromYear(year);
- qsreal leap = InLeapYear(t);
-
- day += ::floor(t / msPerDay);
- day += DayFromMonth(month, leap);
-
- return day - 1;
-}
-
-static inline qsreal MakeDate(qsreal day, qsreal time)
-{
- return day * msPerDay + time;
-}
-
-static inline qsreal DaylightSavingTA(double t)
-{
-#ifndef Q_WS_WIN
- long int tt = (long int)(t / msPerSecond);
- struct tm *tmtm = localtime((const time_t*)&tt);
- if (! tmtm)
- return 0;
- return (tmtm->tm_isdst > 0) ? msPerHour : 0;
-#else
- Q_UNUSED(t);
- /// ### implement me
- return 0;
-#endif
-}
-
-static inline qsreal LocalTime(qsreal t)
-{
- return t + LocalTZA + DaylightSavingTA(t);
-}
-
-static inline qsreal UTC(qsreal t)
-{
- return t - LocalTZA - DaylightSavingTA(t - LocalTZA);
-}
-
-static inline qsreal TimeClip(qsreal t)
-{
- if (! qIsFinite(t) || fabs(t) > 8.64e15)
- return qSNaN();
- return ToInteger(t);
-}
-
-static qsreal getLocalTZA()
-{
-#ifndef Q_WS_WIN
- struct tm* t;
- time_t curr;
- time(&curr);
- t = localtime(&curr);
- time_t locl = mktime(t);
- t = gmtime(&curr);
- time_t globl = mktime(t);
- return double(locl - globl) * 1000.0;
-#else
- TIME_ZONE_INFORMATION tzInfo;
- GetTimeZoneInformation(&tzInfo);
- return -tzInfo.Bias * 60.0 * 1000.0;
-#endif
-}
-
-/*!
- \internal
-
- Converts the QDateTime \a dt to an ECMA Date value (in UTC form).
-*/
-qsreal FromDateTime(const QDateTime &dt)
-{
- if (!dt.isValid())
- return qSNaN();
- if (!LocalTZA) // ### move
- LocalTZA = getLocalTZA();
- QDate date = dt.date();
- QTime taim = dt.time();
- int year = date.year();
- int month = date.month() - 1;
- int day = date.day();
- int hours = taim.hour();
- int mins = taim.minute();
- int secs = taim.second();
- int ms = taim.msec();
- double t = MakeDate(MakeDay(year, month, day),
- MakeTime(hours, mins, secs, ms));
- if (dt.timeSpec() == Qt::LocalTime)
- t = UTC(t);
- return TimeClip(t);
-}
-
-/*!
- \internal
-
- Converts the ECMA Date value \tt (in UTC form) to QDateTime
- according to \a spec.
-*/
-QDateTime ToDateTime(qsreal t, Qt::TimeSpec spec)
-{
- if (qIsNaN(t))
- return QDateTime();
- if (!LocalTZA) // ### move
- LocalTZA = getLocalTZA();
- if (spec == Qt::LocalTime)
- t = LocalTime(t);
- int year = int(YearFromTime(t));
- int month = int(MonthFromTime(t) + 1);
- int day = int(DateFromTime(t));
- int hours = HourFromTime(t);
- int mins = MinFromTime(t);
- int secs = SecFromTime(t);
- int ms = msFromTime(t);
- return QDateTime(QDate(year, month, day), QTime(hours, mins, secs, ms), spec);
-}
-
-} // namespace QScript
-
-QT_END_NAMESPACE
diff --git a/src/script/utils/qscriptdate_p.h b/src/script/utils/qscriptdate_p.h
deleted file mode 100644
index b9c9fd4..0000000
--- a/src/script/utils/qscriptdate_p.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtScript module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL-ONLY$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QSCRIPTDATE_P_H
-#define QSCRIPTDATE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qdatetime.h>
-
-QT_BEGIN_NAMESPACE
-
-typedef double qsreal;
-
-namespace QScript
-{
- qsreal FromDateTime(const QDateTime &dt);
- QDateTime ToDateTime(qsreal t, Qt::TimeSpec spec);
-}
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/script/utils/utils.pri b/src/script/utils/utils.pri
deleted file mode 100644
index d8302d5..0000000
--- a/src/script/utils/utils.pri
+++ /dev/null
@@ -1,5 +0,0 @@
-SOURCES += \
- $$PWD/qscriptdate.cpp
-
-HEADERS += \
- $$PWD/qscriptdate_p.h
diff --git a/tests/auto/checkxmlfiles/checkxmlfiles.pro b/tests/auto/checkxmlfiles/checkxmlfiles.pro
index d53c11c..319ba9b 100644
--- a/tests/auto/checkxmlfiles/checkxmlfiles.pro
+++ b/tests/auto/checkxmlfiles/checkxmlfiles.pro
@@ -6,7 +6,7 @@ QT -= gui
include (../xmlpatterns.pri)
-wince*|symbian*: {
+wince*|symbian: {
QT += network
addFiles.sources = \
$$QT_SOURCE_TREE/examples/sql/masterdetail/albumdetails.xml \
diff --git a/tests/auto/corelib.pro b/tests/auto/corelib.pro
index 259be4c..531fed2 100644
--- a/tests/auto/corelib.pro
+++ b/tests/auto/corelib.pro
@@ -101,3 +101,10 @@ SUBDIRS=\
selftests \
utf8 \
+symbian:SUBDIRS -= \
+ qtconcurrentfilter \
+ qtconcurrentiteratekernel \
+ qtconcurrentmap \
+ qtconcurrentrun \
+ qtconcurrentthreadengine \
+
diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro
index a8fd2b4..cfaa3fa 100644
--- a/tests/auto/gui.pro
+++ b/tests/auto/gui.pro
@@ -220,3 +220,11 @@ win32:SUBDIRS -= qtextpiecetable
qstylesheetstyle \
qtextpiecetable \
+symbian:SUBDIRS -= \
+ qhelpcontentmodel \
+ qhelpenginecore \
+ qhelpgenerator \
+ qhelpindexmodel \
+ qhelpprojectdata \
+ qsystemtrayicon \
+
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
index 195c0e6..d4ebe49 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
@@ -2,3 +2,6 @@
.*/lupdate/testdata/good/parsecpp2/main.cpp:55: Excess closing brace .*
.*/lupdate/testdata/good/parsecpp2/main.cpp:61: Excess closing brace .*
.*/lupdate/testdata/good/parsecpp2/main.cpp:65: Excess closing brace .*
+.*/lupdate/testdata/good/parsecpp2/main.cpp:120: //% cannot be used with tr\(\) / QT_TR_NOOP\(\)\. Ignoring
+.*/lupdate/testdata/good/parsecpp2/main.cpp:123: //% cannot be used with translate\(\) / QT_TRANSLATE_NOOP\(\)\. Ignoring
+.*/lupdate/testdata/good/parsecpp2/main.cpp:126: Discarding unconsumed meta data
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
index feb885c..06e6fe0 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
@@ -112,3 +112,16 @@ void ToBeUsed::caller()
{
tr("NameSpace::ToBeUsed");
}
+
+
+
+// QTBUG-11818
+//% "Foo"
+QObject::tr("Hello World");
+QObject::tr("Hello World");
+//% "Bar"
+QApplication::translate("QObject", "Hello World");
+QApplication::translate("QObject", "Hello World");
+//% "Baz"
+clear = me;
+QObject::tr("Hello World");
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result
index 6f48e27..806f56f 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result
@@ -10,6 +10,18 @@
</message>
</context>
<context>
+ <name>QObject</name>
+ <message>
+ <location filename="main.cpp" line="120"/>
+ <location filename="main.cpp" line="121"/>
+ <location filename="main.cpp" line="123"/>
+ <location filename="main.cpp" line="124"/>
+ <location filename="main.cpp" line="127"/>
+ <source>Hello World</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>TopLevel</name>
<message>
<location filename="main.cpp" line="82"/>
diff --git a/tests/auto/mediaobject/mediaobject.pro b/tests/auto/mediaobject/mediaobject.pro
index bef2fe9..e887df4 100755
--- a/tests/auto/mediaobject/mediaobject.pro
+++ b/tests/auto/mediaobject/mediaobject.pro
@@ -14,7 +14,7 @@ wince*{
DEFINES += tst_MediaObject=tst_MediaObject_waveout
}
-symbian*:{
+symbian:{
addFiles.sources = media/test.sdp
addFiles.path = media
DEPLOYMENT += addFiles
diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp
index a56d842..19f3677 100644
--- a/tests/auto/moc/tst_moc.cpp
+++ b/tests/auto/moc/tst_moc.cpp
@@ -1322,6 +1322,25 @@ public slots:
void foo(struct const_ *) {};
};
+
+template<typename T1, typename T2>
+class TestTemplate2
+{
+};
+
+class QTBUG11647_constInTemplateParameter : public QObject
+{ Q_OBJECT
+public slots:
+ void testSlot(TestTemplate2<const int, const short*>) {}
+ void testSlot2(TestTemplate2<int, short const * const >) {}
+ void testSlot3(TestTemplate2<TestTemplate2 < const int, const short* > const *,
+ TestTemplate2< TestTemplate2 < void, int > , unsigned char *> > ) {}
+
+signals:
+ void testSignal(TestTemplate2<const int, const short*>);
+};
+
+
QTEST_APPLESS_MAIN(tst_Moc)
#include "tst_moc.moc"
diff --git a/tests/auto/networkselftest/networkselftest.pro b/tests/auto/networkselftest/networkselftest.pro
index b0d537a..d7cb7f3 100644
--- a/tests/auto/networkselftest/networkselftest.pro
+++ b/tests/auto/networkselftest/networkselftest.pro
@@ -8,7 +8,7 @@ wince*: {
addFiles.path = .
DEPLOYMENT = addFiles
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian* {
+} else:symbian {
addFiles.sources = rfc3252.txt
addFiles.path = .
DEPLOYMENT = addFiles
diff --git a/tests/auto/patternistexamples/patternistexamples.pro b/tests/auto/patternistexamples/patternistexamples.pro
index c528c93..f83e0aa 100644
--- a/tests/auto/patternistexamples/patternistexamples.pro
+++ b/tests/auto/patternistexamples/patternistexamples.pro
@@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_patternistexamples.cpp
CONFIG += qtestlib
-wince*|symbian*: {
+wince*|symbian: {
snippets.sources = $$QT_SOURCE_TREE/doc/src/snippets/patternist/*
snippets.path = patternist
widgetRen.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/widgetRenderer/*
diff --git a/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro b/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro
index e8b1ce9..3193764 100644
--- a/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro
+++ b/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro
@@ -3,11 +3,12 @@
######################################################################
TEMPLATE = app
-!symbian*: {
+!symbian: {
DEPENDPATH += .
INCLUDEPATH += .
}
-wince*|symbian*:TARGET = ../desktopsettingsaware
+wince*:TARGET = ../desktopsettingsaware
+symbian:TARGET = desktopsettingsaware
# Input
SOURCES += main.cpp
diff --git a/tests/auto/qapplication/test/test.pro b/tests/auto/qapplication/test/test.pro
index e68af26..30eb751 100644
--- a/tests/auto/qapplication/test/test.pro
+++ b/tests/auto/qapplication/test/test.pro
@@ -11,7 +11,7 @@ wince* {
DEPLOYMENT = additional deploy someTest
}
-symbian*: {
+symbian: {
additional.sources = ../desktopsettingsaware/desktopsettingsaware.exe
additional.path = desktopsettingsaware
someTest.sources = test.pro
diff --git a/tests/auto/qaudiooutput/qaudiooutput.pro b/tests/auto/qaudiooutput/qaudiooutput.pro
index a6286ec..e1734e0 100644
--- a/tests/auto/qaudiooutput/qaudiooutput.pro
+++ b/tests/auto/qaudiooutput/qaudiooutput.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qaudiooutput.cpp
QT = core multimedia
-wince*|symbian*: {
+wince*|symbian: {
deploy.sources += 4.wav
DEPLOYMENT = deploy
!symbian {
diff --git a/tests/auto/qbearertestcommon.h b/tests/auto/qbearertestcommon.h
index c9df249..138c444 100644
--- a/tests/auto/qbearertestcommon.h
+++ b/tests/auto/qbearertestcommon.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/qchar/qchar.pro b/tests/auto/qchar/qchar.pro
index a534d14..3813e4e 100644
--- a/tests/auto/qchar/qchar.pro
+++ b/tests/auto/qchar/qchar.pro
@@ -3,12 +3,12 @@ SOURCES += tst_qchar.cpp
QT = core
-wince*|symbian*: {
+wince*|symbian: {
deploy.sources += NormalizationTest.txt
DEPLOYMENT = deploy
}
-symbian*: {
+symbian: {
DEFINES += SRCDIR=""
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/qclipboard/test/test.pro b/tests/auto/qclipboard/test/test.pro
index 62a38af..0f8cad1 100644
--- a/tests/auto/qclipboard/test/test.pro
+++ b/tests/auto/qclipboard/test/test.pro
@@ -10,13 +10,13 @@ win32 {
}
}
-wince*|symbian*: {
+wince*|symbian: {
copier.sources = ../copier/copier.exe
copier.path = copier
paster.sources = ../paster/paster.exe
paster.path = paster
- symbian*: {
+ symbian: {
load(data_caging_paths)
rsc.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/copier.rsc
rsc.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/paster.rsc
diff --git a/tests/auto/qcryptographichash/qcryptographichash.pro b/tests/auto/qcryptographichash/qcryptographichash.pro
index aa9a7c4..7e1a866 100644
--- a/tests/auto/qcryptographichash/qcryptographichash.pro
+++ b/tests/auto/qcryptographichash/qcryptographichash.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qcryptographichash.cpp
QT = core
-symbian*: {
+symbian: {
TARGET.EPOCSTACKSIZE =0x5000
-TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
}
diff --git a/tests/auto/qdiriterator/qdiriterator.pro b/tests/auto/qdiriterator/qdiriterator.pro
index ece886c..d60b52d 100644
--- a/tests/auto/qdiriterator/qdiriterator.pro
+++ b/tests/auto/qdiriterator/qdiriterator.pro
@@ -3,7 +3,7 @@ SOURCES += tst_qdiriterator.cpp
RESOURCES += qdiriterator.qrc
QT = core
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = entrylist recursiveDirs foo
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qdom/qdom.pro b/tests/auto/qdom/qdom.pro
index 61914b5..5434ada 100644
--- a/tests/auto/qdom/qdom.pro
+++ b/tests/auto/qdom/qdom.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qdom.cpp
QT = core xml
QT -= gui
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = testdata doubleNamespaces.xml umlaut.xml
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qfile/qfile.pro b/tests/auto/qfile/qfile.pro
index 33fd2fd..0383e30 100644
--- a/tests/auto/qfile/qfile.pro
+++ b/tests/auto/qfile/qfile.pro
@@ -5,5 +5,5 @@ wince*:{
SUBDIRS = test stdinprocess
}
-!symbian*:SUBDIRS += largefile
+!symbian:SUBDIRS += largefile
diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro
index 2038514..ef5ed22 100644
--- a/tests/auto/qfileinfo/qfileinfo.pro
+++ b/tests/auto/qfileinfo/qfileinfo.pro
@@ -6,7 +6,7 @@ QT = core
RESOURCES += qfileinfo.qrc
-wince*:|symbian*: {
+wince*:|symbian: {
deploy.sources += qfileinfo.qrc tst_qfileinfo.cpp
res.sources = resources\\file1 resources\\file1.ext1 resources\\file1.ext1.ext2
res.path = resources
diff --git a/tests/auto/qftp/qftp.pro b/tests/auto/qftp/qftp.pro
index 33d479a..9618962 100644
--- a/tests/auto/qftp/qftp.pro
+++ b/tests/auto/qftp/qftp.pro
@@ -9,7 +9,7 @@ wince*: {
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian* {
+} else:symbian {
addFiles.sources = rfc3252.txt
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index fe68c8e..31a6845 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -442,6 +442,7 @@ private slots:
void updateMicroFocus();
void textItem_shortcuts();
void scroll();
+ void stopClickFocusPropagation();
// task specific tests below me
void task141694_textItemEnsureVisible();
@@ -10268,6 +10269,59 @@ void tst_QGraphicsItem::scroll()
QCOMPARE(item2->lastExposedRect, expectedItem2Expose);
}
+void tst_QGraphicsItem::stopClickFocusPropagation()
+{
+ class MyItem : public QGraphicsRectItem
+ {
+ public:
+ MyItem() : QGraphicsRectItem(0, 0, 100, 100) {}
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+ {
+ painter->fillRect(boundingRect(), hasFocus() ? QBrush(Qt::red) : brush());
+ }
+ };
+
+ QGraphicsScene scene(-50, -50, 400, 400);
+ scene.setStickyFocus(true);
+
+ QGraphicsRectItem *noFocusOnTop = new MyItem;
+ noFocusOnTop->setBrush(Qt::yellow);
+ noFocusOnTop->setFlag(QGraphicsItem::ItemStopsClickFocusPropagation);
+
+ QGraphicsRectItem *focusableUnder = new MyItem;
+ focusableUnder->setBrush(Qt::blue);
+ focusableUnder->setFlag(QGraphicsItem::ItemIsFocusable);
+ focusableUnder->setPos(50, 50);
+
+ QGraphicsRectItem *itemWithFocus = new MyItem;
+ itemWithFocus->setBrush(Qt::black);
+ itemWithFocus->setFlag(QGraphicsItem::ItemIsFocusable);
+ itemWithFocus->setPos(250, 10);
+
+ scene.addItem(noFocusOnTop);
+ scene.addItem(focusableUnder);
+ scene.addItem(itemWithFocus);
+ focusableUnder->stackBefore(noFocusOnTop);
+ itemWithFocus->setFocus();
+
+ QGraphicsView view(&scene);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+
+ QApplication::setActiveWindow(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ QVERIFY(itemWithFocus->hasFocus());
+
+ QPointF mousePressPoint = noFocusOnTop->mapToScene(QPointF());
+ mousePressPoint.rx() += 60;
+ mousePressPoint.ry() += 60;
+ const QList<QGraphicsItem *> itemsAtMousePressPosition = scene.items(mousePressPoint);
+ QVERIFY(itemsAtMousePressPosition.contains(focusableUnder));
+
+ sendMousePress(&scene, mousePressPoint);
+ QVERIFY(itemWithFocus->hasFocus());
+}
+
void tst_QGraphicsItem::QTBUG_5418_textItemSetDefaultColor()
{
struct Item : public QGraphicsTextItem
diff --git a/tests/auto/qgraphicsscene/qgraphicsscene.pro b/tests/auto/qgraphicsscene/qgraphicsscene.pro
index 401c9eb..cc6f585 100644
--- a/tests/auto/qgraphicsscene/qgraphicsscene.pro
+++ b/tests/auto/qgraphicsscene/qgraphicsscene.pro
@@ -6,7 +6,7 @@ win32:!wince*: LIBS += -lUser32
!wince*:!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
DEFINES += QT_NO_CAST_TO_ASCII
-wince*|symbian*: {
+wince*|symbian: {
rootFiles.sources = Ash_European.jpg graphicsScene_selection.data
rootFiles.path = .
renderFiles.sources = testData\\render\\*
@@ -17,4 +17,4 @@ wince*:{
DEFINES += SRCDIR=\\\".\\\"
}
-symbian:TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+symbian:TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # Min 1Mb, max 16Mb
diff --git a/tests/auto/qhash/qhash.pro b/tests/auto/qhash/qhash.pro
index 6fedb82..86b98a2 100644
--- a/tests/auto/qhash/qhash.pro
+++ b/tests/auto/qhash/qhash.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qhash.cpp
QT = core
-symbian*: {
+symbian: {
TARGET.EPOCSTACKSIZE =0x5000
-TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
}
diff --git a/tests/auto/qhttp/qhttp.pro b/tests/auto/qhttp/qhttp.pro
index 23a73c4..c0be518 100644
--- a/tests/auto/qhttp/qhttp.pro
+++ b/tests/auto/qhttp/qhttp.pro
@@ -13,7 +13,7 @@ wince*: {
addFiles.path = .
DEPLOYMENT = addFiles webFiles cgi
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian* {
+} else:symbian {
webFiles.sources = webserver/*
webFiles.path = webserver
cgi.sources = webserver/cgi-bin/*
diff --git a/tests/auto/qicoimageformat/qicoimageformat.pro b/tests/auto/qicoimageformat/qicoimageformat.pro
index b9c8622..cabab3f 100644
--- a/tests/auto/qicoimageformat/qicoimageformat.pro
+++ b/tests/auto/qicoimageformat/qicoimageformat.pro
@@ -12,7 +12,7 @@ wince*: {
}
addPlugins.path = imageformats
DEPLOYMENT += addFiles addPlugins
-} else:symbian* {
+} else:symbian {
addFiles.sources = icons
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qimage/qimage.pro b/tests/auto/qimage/qimage.pro
index 3e0bd69..6469211 100644
--- a/tests/auto/qimage/qimage.pro
+++ b/tests/auto/qimage/qimage.pro
@@ -6,7 +6,7 @@ wince*: {
addImages.path = images
DEPLOYMENT += addImages
DEFINES += SRCDIR=\\\".\\\"
-} else:symbian* {
+} else:symbian {
TARGET.EPOCHEAPSIZE = 0x200000 0x800000
addImages.sources = images/*
addImages.path = images
diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro
index 402e94b..f8fc7fa 100644
--- a/tests/auto/qimagereader/qimagereader.pro
+++ b/tests/auto/qimagereader/qimagereader.pro
@@ -27,7 +27,7 @@ wince*: {
DEFINES += SRCDIR=\\\".\\\"
}
-symbian*: {
+symbian: {
images.sources = images
images.path = .
diff --git a/tests/auto/qimagewriter/qimagewriter.pro b/tests/auto/qimagewriter/qimagewriter.pro
index 2171c3e..f25472f 100644
--- a/tests/auto/qimagewriter/qimagewriter.pro
+++ b/tests/auto/qimagewriter/qimagewriter.pro
@@ -10,7 +10,7 @@ wince*: {
addFiles.path = images
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\".\\\"
-} else:symbian* {
+} else:symbian {
addFiles.sources = images\\*.*
addFiles.path = images
DEPLOYMENT += addFiles
diff --git a/tests/auto/qitemmodel/qitemmodel.pro b/tests/auto/qitemmodel/qitemmodel.pro
index 2d0bdea..92709fe 100644
--- a/tests/auto/qitemmodel/qitemmodel.pro
+++ b/tests/auto/qitemmodel/qitemmodel.pro
@@ -15,7 +15,7 @@ QT += sql
#}
symbian {
- TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+ TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
diff --git a/tests/auto/qlayout/qlayout.pro b/tests/auto/qlayout/qlayout.pro
index 0dfe1e9..c99f1d9 100644
--- a/tests/auto/qlayout/qlayout.pro
+++ b/tests/auto/qlayout/qlayout.pro
@@ -6,7 +6,7 @@ load(qttest_p4)
SOURCES += tst_qlayout.cpp
contains(QT_CONFIG, qt3support): QT += qt3support
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = baseline
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qlibrary/tst/tst.pro b/tests/auto/qlibrary/tst/tst.pro
index e15d7ed..4c647c0 100644
--- a/tests/auto/qlibrary/tst/tst.pro
+++ b/tests/auto/qlibrary/tst/tst.pro
@@ -16,7 +16,7 @@ wince*: {
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
-}else:symbian* {
+}else:symbian {
binDep.sources = \
mylib.dll \
system.trolltech.test.mylib.dll
diff --git a/tests/auto/qline/qline.pro b/tests/auto/qline/qline.pro
index 1a3d7f2..4651fd3 100644
--- a/tests/auto/qline/qline.pro
+++ b/tests/auto/qline/qline.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
QT -= gui
SOURCES += tst_qline.cpp
-unix:!mac:!symbian*:!vxworks:LIBS+=-lm
+unix:!mac:!symbian:!vxworks:LIBS+=-lm
diff --git a/tests/auto/qlocalsocket/qlocalsocket.pro b/tests/auto/qlocalsocket/qlocalsocket.pro
index 287e946..3911a64 100644
--- a/tests/auto/qlocalsocket/qlocalsocket.pro
+++ b/tests/auto/qlocalsocket/qlocalsocket.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
SUBDIRS = lackey test
-!wince*:!symbian*: SUBDIRS += example
+!wince*:!symbian: SUBDIRS += example
symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qmenubar/qmenubar.pro b/tests/auto/qmenubar/qmenubar.pro
index a0a6420..adce164 100644
--- a/tests/auto/qmenubar/qmenubar.pro
+++ b/tests/auto/qmenubar/qmenubar.pro
@@ -2,5 +2,5 @@ load(qttest_p4)
HEADERS +=
SOURCES += tst_qmenubar.cpp
-contains(QT_CONFIG, qt3support):!symbian*:QT += qt3support
+contains(QT_CONFIG, qt3support):!symbian:QT += qt3support
diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp
index 4cb63a1..cc9fb0c 100644
--- a/tests/auto/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/qmenubar/tst_qmenubar.cpp
@@ -168,6 +168,7 @@ private slots:
void task256322_highlight();
void menubarSizeHint();
void taskQTBUG4965_escapeEaten();
+ void taskQTBUG11823_crashwithInvisibleActions();
#if defined(QT3_SUPPORT)
void indexBasedInsertion_data();
@@ -1690,6 +1691,34 @@ void tst_QMenuBar::taskQTBUG4965_escapeEaten()
QTRY_VERIFY(!menubar.isVisible());
}
+void tst_QMenuBar::taskQTBUG11823_crashwithInvisibleActions()
+{
+ QMenuBar menubar;
+ menubar.setNativeMenuBar(false); //we can't check the geometry of native menubars
+
+ QAction * m = menubar.addAction( "&m" );
+ QAction * a = menubar.addAction( "&a" );
+
+ menubar.show();
+ QApplication::setActiveWindow(&menubar);
+ QTest::qWaitForWindowShown(&menubar);
+ menubar.setActiveAction(m);
+ QCOMPARE(menubar.activeAction(), m);
+ QTest::keyClick(0, Qt::Key_Right);
+ QCOMPARE(menubar.activeAction(), a);
+ QTest::keyClick(0, Qt::Key_Right);
+ QCOMPARE(menubar.activeAction(), m);
+ a->setVisible(false);
+
+ menubar.setActiveAction(m);
+ QCOMPARE(menubar.activeAction(), m); //the active action shouldn't have changed
+
+ //it used to crash here because the action is invisible
+ QTest::keyClick(0, Qt::Key_Right);
+ QCOMPARE(menubar.activeAction(), m); //the active action shouldn't have changed
+}
+
+
#if defined(QT3_SUPPORT)
void tst_QMenuBar::indexBasedInsertion_data()
{
diff --git a/tests/auto/qmetaobject/tst_qmetaobject.cpp b/tests/auto/qmetaobject/tst_qmetaobject.cpp
index b6d4558..62416b1 100644
--- a/tests/auto/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp
@@ -740,6 +740,8 @@ void tst_QMetaObject::normalizedType_data()
QTest::newRow("template5") << "QList< ::Foo::Bar>" << "QList< ::Foo::Bar>";
QTest::newRow("template6") << "QList<::Foo::Bar>" << "QList<::Foo::Bar>";
QTest::newRow("template7") << "QList<QList<int> >" << "QList<QList<int> >";
+ QTest::newRow("template8") << "QMap<const int, const short*>" << "QMap<const int,const short*>";
+ QTest::newRow("template9") << "QPair<const QPair<int, int const *> , QPair<QHash<int, const char*> > >" << "QPair<const QPair<int,const int*>,QPair<QHash<int,const char*> > >";
QTest::newRow("value1") << "const QString &" << "QString";
QTest::newRow("value2") << "QString const &" << "QString";
QTest::newRow("constInName1") << "constconst" << "constconst";
diff --git a/tests/auto/qmovie/qmovie.pro b/tests/auto/qmovie/qmovie.pro
index a8ec478..510a70e 100644
--- a/tests/auto/qmovie/qmovie.pro
+++ b/tests/auto/qmovie/qmovie.pro
@@ -13,7 +13,7 @@ wince*: {
}
-symbian*: {
+symbian: {
addFiles.sources = animations\\*
addFiles.path = animations
DEPLOYMENT += addFiles
diff --git a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
index e4f2486..24f6e52 100644
--- a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
+++ b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
@@ -75,17 +75,20 @@ private slots:
void robustnessBombing();
+ void sessionClosing_data();
+ void sessionClosing();
+
void outOfProcessSession();
void invalidSession();
void repeatedOpenClose_data();
void repeatedOpenClose();
-
- void roamingErrorCodes();
-
+
void sessionStop_data();
void sessionStop();
+ void roamingErrorCodes();
+
void sessionProperties_data();
void sessionProperties();
@@ -131,6 +134,7 @@ void tst_QNetworkSession::initTestCase()
// If you wish to skip tests, set value as false. This is often very convinient because tests are so lengthy.
// Better way still would be to make this readable from a file.
testsToRun["robustnessBombing"] = true;
+ testsToRun["sessionClosing"] = true;
testsToRun["outOfProcessSession"] = true;
testsToRun["invalidSession"] = true;
testsToRun["repeatedOpenClose"] = true;
@@ -265,6 +269,53 @@ void tst_QNetworkSession::robustnessBombing()
testSession.reject();
}
+void tst_QNetworkSession::sessionClosing_data() {
+ QTest::addColumn<QString>("bearerType");
+ QTest::addColumn<QNetworkConfiguration::Type>("configurationType");
+
+ QTest::newRow("WLAN_IAP") << "WLAN" << QNetworkConfiguration::InternetAccessPoint;
+ QTest::newRow("Cellular_IAP") << "cellular" << QNetworkConfiguration::InternetAccessPoint;
+ QTest::newRow("SNAP") << "bearer_type_not_relevant_with_SNAPs" << QNetworkConfiguration::ServiceNetwork;
+}
+
+// Testcase for closing the session at unexpected times
+void tst_QNetworkSession::sessionClosing()
+{
+ if (!testsToRun["sessionClosing"]) {
+ QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
+ }
+ QFETCH(QString, bearerType);
+ QFETCH(QNetworkConfiguration::Type, configurationType);
+
+ // Update configurations so that WLANs are discovered too.
+ updateConfigurations();
+
+ // First check that opening once succeeds and determine if test is doable
+ QNetworkConfiguration config = suitableConfiguration(bearerType, configurationType);
+ if (!config.isValid()) {
+ QSKIP("No suitable configurations, skipping this round of repeated open-close test.", SkipSingle);
+ }
+ qDebug() << "Using following configuration to bomb with close(): " << config.name();
+ QNetworkSession session(config);
+ if (!openSession(&session) ||
+ !closeSession(&session)) {
+ QSKIP("Unable to open/close session, skipping this round of close() bombing.", SkipSingle);
+ }
+
+ qDebug() << "Closing without issuing open()";
+ session.close();
+
+ for (int i = 0; i < 25; i++) {
+ qDebug() << "Opening and then waiting: " << i * 100 << " ms before closing.";
+ session.open();
+ QTest::qWait(i*100);
+ session.close();
+ // Sooner or later session must end in Disconnected state,
+ // no matter what the phase was.
+ QTRY_VERIFY(session.state() == QNetworkSession::Disconnected);
+ QTest::qWait(200); // Give platform a breathe, otherwise we'll be catching other errors
+ }
+}
void tst_QNetworkSession::invalidSession()
{
@@ -629,7 +680,7 @@ void tst_QNetworkSession::sessionStop()
QVERIFY(openSession(&innocentSession));
qDebug("Waiting for %d ms after open to make sure all platform indications are propagated", configWaitdelayInMs);
QTest::qWait(configWaitdelayInMs);
- qDebug("----------4.2 Calling closedSession.stop()");
+ qDebug("----------4.2 Calling closedSession.stop()");
closedSession.stop();
qDebug("Waiting for %d ms to get all configurationChange signals from platform..", configWaitdelayInMs);
QTest::qWait(configWaitdelayInMs); // Wait to get all relevant configurationChange() signals
@@ -1037,21 +1088,28 @@ void tst_QNetworkSession::sessionOpenCloseStop()
if (configuration.type() == QNetworkConfiguration::ServiceNetwork) {
bool roamedSuccessfully = false;
- QCOMPARE(stateChangedSpy2.count(), 4);
+ QNetworkSession::State state;
+ if (stateChangedSpy2.count() == 4) {
+ state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
+ QVERIFY(state == QNetworkSession::Connecting);
- QNetworkSession::State state =
- qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
- QVERIFY(state == QNetworkSession::Connecting);
+ state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
+ QVERIFY(state == QNetworkSession::Connected);
- state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
- QVERIFY(state == QNetworkSession::Connected);
+ state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(2).at(0));
+ QVERIFY(state == QNetworkSession::Closing);
- state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(2).at(0));
- QVERIFY(state == QNetworkSession::Closing);
+ state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(3).at(0));
+ QVERIFY(state == QNetworkSession::Disconnected);
+ } else if (stateChangedSpy2.count() == 2) {
+ state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
+ QVERIFY(state == QNetworkSession::Closing);
- state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(3).at(0));
- QVERIFY(state == QNetworkSession::Disconnected);
-
+ state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
+ QVERIFY(state == QNetworkSession::Disconnected);
+ } else {
+ QFAIL("Unexpected amount of state changes when roaming.");
+ }
QTRY_VERIFY(session.state() == QNetworkSession::Roaming ||
session.state() == QNetworkSession::Connected ||
@@ -1060,30 +1118,44 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QTRY_VERIFY(stateChangedSpy.count() > 0);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(stateChangedSpy.count() - 1).at(0));
+ for (int i = 0; i < stateChangedSpy.count(); i++) {
+ QNetworkSession::State state_temp =
+ qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(i).at(0));
+ // Extra debug because a fragile point in testcase because statuses vary.
+ qDebug() << "------- Statechange spy at: " << i << " is " << state_temp;
+ }
+
if (state == QNetworkSession::Roaming) {
QTRY_VERIFY(session.state() == QNetworkSession::Connected);
QTRY_VERIFY(session2.state() == QNetworkSession::Connected);
roamedSuccessfully = true;
+ } else if (state == QNetworkSession::Closing) {
+ QTRY_VERIFY(session2.state() == QNetworkSession::Disconnected);
+ QTRY_VERIFY(session.state() == QNetworkSession::Connected);
+ roamedSuccessfully = true;
} else if (state == QNetworkSession::Disconnected) {
QTRY_VERIFY(!errorSpy.isEmpty());
QTRY_VERIFY(session2.state() == QNetworkSession::Disconnected);
} else if (state == QNetworkSession::Connected) {
QTRY_VERIFY(errorSpy.isEmpty());
+
if (stateChangedSpy.count() > 1) {
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(stateChangedSpy.count() - 2).at(0));
QVERIFY(state == QNetworkSession::Roaming);
}
roamedSuccessfully = true;
- }
+ }
if (roamedSuccessfully) {
+ // Verify that you can open session based on the disconnected configuration
QString configId = session.sessionProperty("ActiveConfiguration").toString();
- QNetworkConfiguration config = manager.configurationFromIdentifier(configId);
+ QNetworkConfiguration config = manager.configurationFromIdentifier(configId);
QNetworkSession session3(config);
QSignalSpy errorSpy3(&session3, SIGNAL(error(QNetworkSession::SessionError)));
QSignalSpy sessionOpenedSpy3(&session3, SIGNAL(opened()));
session3.open();
- session3.waitForOpened();
+ session3.waitForOpened();
+ QTest::qWait(1000); // Wait awhile to get all signals from platform
if (session.isOpen())
QVERIFY(!sessionOpenedSpy3.isEmpty() || !errorSpy3.isEmpty());
session.stop();
@@ -1102,9 +1174,18 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QVERIFY(state == QNetworkSession::Closing);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
QVERIFY(state == QNetworkSession::Disconnected);
- } else { // Assume .count() == 1
- QCOMPARE(stateChangedSpy2.count(), 1);
- QNetworkSession::State state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
+ } else {
+ QVERIFY(stateChangedSpy2.count() >= 1);
+
+ for (int i = 0; i < stateChangedSpy2.count(); i++) {
+ QNetworkSession::State state_temp =
+ qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(i).at(0));
+ // Extra debug because a fragile point in testcase.
+ qDebug() << "+++++ Statechange spy at: " << i << " is " << state_temp;
+ }
+
+ QNetworkSession::State state =
+ qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(stateChangedSpy2.count() - 1).at(0));
// Symbian version dependant.
QVERIFY(state == QNetworkSession::Disconnected);
}
diff --git a/tests/auto/qpainter/qpainter.pro b/tests/auto/qpainter/qpainter.pro
index c8446d1..69dc98d 100644
--- a/tests/auto/qpainter/qpainter.pro
+++ b/tests/auto/qpainter/qpainter.pro
@@ -1,7 +1,7 @@
load(qttest_p4)
contains(QT_CONFIG, qt3support): QT += qt3support
SOURCES += tst_qpainter.cpp
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = drawEllipse drawLine_rop_bitmap drawPixmap_rop drawPixmap_rop_bitmap task217400.png
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 701dc2e..27ee6e7 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -2648,12 +2648,16 @@ void tst_QPainter::setOpacity()
p.drawImage(imageRect, src, imageRect);
p.end();
- QImage expected(imageSize, destFormat);
- p.begin(&expected);
- p.fillRect(imageRect, QColor(127, 127, 127));
- p.end();
-
- QCOMPARE(dest, expected);
+ QImage actual = dest.convertToFormat(QImage::Format_RGB32);
+
+ for (int y = 0; y < actual.height(); ++y) {
+ QRgb *p = (QRgb *)actual.scanLine(y);
+ for (int x = 0; x < actual.width(); ++x) {
+ QVERIFY(qAbs(qRed(p[x]) - 127) <= 0xf);
+ QVERIFY(qAbs(qGreen(p[x]) - 127) <= 0xf);
+ QVERIFY(qAbs(qBlue(p[x]) - 127) <= 0xf);
+ }
+ }
}
void tst_QPainter::drawhelper_blend_untransformed_data()
diff --git a/tests/auto/qpathclipper/qpathclipper.pro b/tests/auto/qpathclipper/qpathclipper.pro
index 930a6f2..590fba0 100644
--- a/tests/auto/qpathclipper/qpathclipper.pro
+++ b/tests/auto/qpathclipper/qpathclipper.pro
@@ -5,6 +5,6 @@ SOURCES += tst_qpathclipper.cpp paths.cpp
requires(contains(QT_CONFIG,private_tests))
-unix:!mac:!symbian*:LIBS+=-lm
+unix:!mac:!symbian:LIBS+=-lm
diff --git a/tests/auto/qpixmap/loadFromData/designer_indexed8_with_alpha_animated.gif b/tests/auto/qpixmap/loadFromData/designer_indexed8_with_alpha_animated.gif
new file mode 100644
index 0000000..f813c05
--- /dev/null
+++ b/tests/auto/qpixmap/loadFromData/designer_indexed8_with_alpha_animated.gif
Binary files differ
diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro
index a3577bd..c3ee192 100644
--- a/tests/auto/qpixmap/qpixmap.pro
+++ b/tests/auto/qpixmap/qpixmap.pro
@@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_qpixmap.cpp
contains(QT_CONFIG, qt3support): QT += qt3support
-wince*|symbian*: {
+wince*|symbian: {
task31722_0.sources = convertFromImage/task31722_0/*.png
task31722_0.path = convertFromImage/task31722_0
@@ -18,7 +18,7 @@ wince*|symbian*: {
wince*: {
DEFINES += SRCDIR=\\\".\\\"
-} else:symbian* {
+} else:symbian {
DEPLOYMENT_PLUGIN += qmng
LIBS += -lfbscli.dll -lbitgdi.dll -lgdi.dll
contains(QT_CONFIG, openvg) {
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 179f068..f22edf6 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -44,6 +44,7 @@
#include <qpixmap.h>
#include <qbitmap.h>
#include <qimage.h>
+#include <qimagereader.h>
#include <qmatrix.h>
#include <qdesktopwidget.h>
#include <qpaintengine.h>
@@ -175,6 +176,11 @@ private slots:
void loadFromDataImage_data();
void loadFromDataImage();
+ void fromImageReader_data();
+ void fromImageReader();
+
+ void fromImageReaderAnimatedGif();
+
void preserveDepth();
void splash_crash();
@@ -1577,6 +1583,61 @@ void tst_QPixmap::loadFromDataImage()
QVERIFY(pixmapsAreEqual(&pixmapWithCopy, &directLoadingPixmap));
}
+void tst_QPixmap::fromImageReader_data()
+{
+ QTest::addColumn<QString>("imagePath");
+#ifdef Q_OS_SYMBIAN
+ const QString prefix = QLatin1String(SRCDIR) + "loadFromData";
+#else
+ const QString prefix = QLatin1String(SRCDIR) + "/loadFromData";
+#endif
+ QTest::newRow("designer_argb32.png") << prefix + "/designer_argb32.png";
+ QTest::newRow("designer_indexed8_no_alpha.png") << prefix + "/designer_indexed8_no_alpha.png";
+ QTest::newRow("designer_indexed8_with_alpha.png") << prefix + "/designer_indexed8_with_alpha.png";
+ QTest::newRow("designer_rgb32.png") << prefix + "/designer_rgb32.png";
+ QTest::newRow("designer_indexed8_no_alpha.gif") << prefix + "/designer_indexed8_no_alpha.gif";
+ QTest::newRow("designer_indexed8_with_alpha.gif") << prefix + "/designer_indexed8_with_alpha.gif";
+ QTest::newRow("designer_rgb32.jpg") << prefix + "/designer_rgb32.jpg";
+}
+
+void tst_QPixmap::fromImageReader()
+{
+ QFETCH(QString, imagePath);
+
+ QImage imageRef(imagePath);
+ QPixmap pixmapWithCopy = QPixmap::fromImage(imageRef);
+
+ QImageReader imageReader(imagePath);
+
+ QPixmap directLoadingPixmap = QPixmap::fromImageReader(&imageReader);
+
+ QVERIFY(pixmapsAreEqual(&pixmapWithCopy, &directLoadingPixmap));
+}
+
+void tst_QPixmap::fromImageReaderAnimatedGif()
+{
+#ifdef Q_OS_SYMBIAN
+ const QString prefix = QLatin1String(SRCDIR) + "loadFromData";
+#else
+ const QString prefix = QLatin1String(SRCDIR) + "/loadFromData";
+#endif
+ const QString path = prefix + QString::fromLatin1("/designer_indexed8_with_alpha_animated.gif");
+
+ QImageReader referenceReader(path);
+ QImageReader pixmapReader(path);
+
+ Q_ASSERT(referenceReader.canRead());
+ Q_ASSERT(referenceReader.imageCount() > 1);
+
+ for (int i = 0; i < referenceReader.imageCount(); ++i) {
+ QImage refImage = referenceReader.read();
+ QPixmap refPixmap = QPixmap::fromImage(refImage);
+
+ QPixmap directLoadingPixmap = QPixmap::fromImageReader(&pixmapReader);
+ QVERIFY(pixmapsAreEqual(&refPixmap, &directLoadingPixmap));
+ }
+}
+
void tst_QPixmap::task_246446()
{
// This crashed without the bugfix in 246446
diff --git a/tests/auto/qprocess/testDetached/testDetached.pro b/tests/auto/qprocess/testDetached/testDetached.pro
index 319cfa6..80a616b 100644
--- a/tests/auto/qprocess/testDetached/testDetached.pro
+++ b/tests/auto/qprocess/testDetached/testDetached.pro
@@ -5,6 +5,6 @@ CONFIG -= app_bundle
INSTALLS =
DESTDIR = ./
-symbian*: {
+symbian: {
TARGET.EPOCSTACKSIZE =0x14000
}
diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro
index 3e47b52..17e36af 100644
--- a/tests/auto/qresourceengine/qresourceengine.pro
+++ b/tests/auto/qresourceengine/qresourceengine.pro
@@ -20,7 +20,7 @@ QMAKE_EXTRA_TARGETS = runtime_resource
PRE_TARGETDEPS += $${runtime_resource.target}
QT = core
-wince*|symbian*:{
+wince*|symbian:{
deploy.sources += runtime_resource.rcc parentdir.txt
test.sources = testqrc/*
test.path = testqrc
diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro
index 7d0f5d0..fc35f66 100644
--- a/tests/auto/qscriptengine/qscriptengine.pro
+++ b/tests/auto/qscriptengine/qscriptengine.pro
@@ -9,7 +9,7 @@ wince* {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = script
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index 5e59950..6885adf 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -51,6 +51,8 @@
#include <QtCore/qnumeric.h>
#include <stdlib.h>
+#include <QtScript/private/qscriptdeclarativeclass_p.h>
+
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QObjectList)
Q_DECLARE_METATYPE(QScriptProgram)
@@ -169,6 +171,8 @@ private slots:
void qRegExpInport_data();
void qRegExpInport();
void reentrency();
+ void newFixedStaticScopeObject();
+ void newGrowingStaticScopeObject();
};
tst_QScriptEngine::tst_QScriptEngine()
@@ -4955,5 +4959,243 @@ void tst_QScriptEngine::reentrency()
QCOMPARE(eng.evaluate("foo() + hello").toInt32(), 5+6+9);
}
+void tst_QScriptEngine::newFixedStaticScopeObject()
+{
+ QScriptEngine eng;
+ static const int propertyCount = 4;
+ QString names[] = { "foo", "bar", "baz", "Math" };
+ QScriptValue values[] = { 123, "ciao", true, false };
+ QScriptValue::PropertyFlags flags[] = { QScriptValue::Undeletable,
+ QScriptValue::ReadOnly | QScriptValue::Undeletable,
+ QScriptValue::SkipInEnumeration | QScriptValue::Undeletable,
+ QScriptValue::Undeletable };
+ QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(&eng, propertyCount, names, values, flags);
+
+ // Query property.
+ for (int i = 0; i < propertyCount; ++i) {
+ for (int x = 0; x < 2; ++x) {
+ if (x) {
+ // Properties can't be deleted.
+ scope.setProperty(names[i], QScriptValue());
+ }
+ QVERIFY(scope.property(names[i]).equals(values[i]));
+ QCOMPARE(scope.propertyFlags(names[i]), flags[i]);
+ }
+ }
+
+ // Property that doesn't exist.
+ QVERIFY(!scope.property("noSuchProperty").isValid());
+ QCOMPARE(scope.propertyFlags("noSuchProperty"), QScriptValue::PropertyFlags());
+
+ // Write to writable property.
+ {
+ QScriptValue oldValue = scope.property("foo");
+ QVERIFY(oldValue.isNumber());
+ QScriptValue newValue = oldValue.toNumber() * 2;
+ scope.setProperty("foo", newValue);
+ QVERIFY(scope.property("foo").equals(newValue));
+ scope.setProperty("foo", oldValue);
+ QVERIFY(scope.property("foo").equals(oldValue));
+ }
+
+ // Write to read-only property.
+ scope.setProperty("bar", 456);
+ QVERIFY(scope.property("bar").equals("ciao"));
+
+ // Iterate.
+ {
+ QScriptValueIterator it(scope);
+ QSet<QString> iteratedNames;
+ while (it.hasNext()) {
+ it.next();
+ iteratedNames.insert(it.name());
+ }
+ for (int i = 0; i < propertyCount; ++i)
+ QVERIFY(iteratedNames.contains(names[i]));
+ }
+
+ // Push it on the scope chain of a new context.
+ QScriptContext *ctx = eng.pushContext();
+ ctx->pushScope(scope);
+ QCOMPARE(ctx->scopeChain().size(), 3); // Global Object, native activation, custom scope
+ QVERIFY(ctx->activationObject().equals(scope));
+
+ // Read property from JS.
+ for (int i = 0; i < propertyCount; ++i) {
+ for (int x = 0; x < 2; ++x) {
+ if (x) {
+ // Property can't be deleted from JS.
+ QScriptValue ret = eng.evaluate(QString::fromLatin1("delete %0").arg(names[i]));
+ QVERIFY(ret.equals(false));
+ }
+ QVERIFY(eng.evaluate(names[i]).equals(values[i]));
+ }
+ }
+
+ // Property that doesn't exist.
+ QVERIFY(eng.evaluate("noSuchProperty").equals("ReferenceError: Can't find variable: noSuchProperty"));
+
+ // Write property from JS.
+ {
+ QScriptValue oldValue = eng.evaluate("foo");
+ QVERIFY(oldValue.isNumber());
+ QScriptValue newValue = oldValue.toNumber() * 2;
+ QVERIFY(eng.evaluate("foo = foo * 2; foo").equals(newValue));
+ scope.setProperty("foo", oldValue);
+ QVERIFY(eng.evaluate("foo").equals(oldValue));
+ }
+
+ // Write to read-only property.
+ QVERIFY(eng.evaluate("bar = 456; bar").equals("ciao"));
+
+ // Create a closure and return properties from there.
+ {
+ QScriptValue props = eng.evaluate("(function() { var baz = 'shadow'; return [foo, bar, baz, Math, Array]; })()");
+ QVERIFY(props.isArray());
+ // "foo" and "bar" come from scope object.
+ QVERIFY(props.property(0).equals(scope.property("foo")));
+ QVERIFY(props.property(1).equals(scope.property("bar")));
+ // "baz" shadows property in scope object.
+ QVERIFY(props.property(2).equals("shadow"));
+ // "Math" comes from scope object, and shadows Global Object's "Math".
+ QVERIFY(props.property(3).equals(scope.property("Math")));
+ QVERIFY(!props.property(3).equals(eng.globalObject().property("Math")));
+ // "Array" comes from Global Object.
+ QVERIFY(props.property(4).equals(eng.globalObject().property("Array")));
+ }
+
+ // As with normal JS, assigning to an undefined variable will create
+ // the property on the Global Object, not the inner scope.
+ QVERIFY(!eng.globalObject().property("newProperty").isValid());
+ QVERIFY(eng.evaluate("(function() { newProperty = 789; })()").isUndefined());
+ QVERIFY(!scope.property("newProperty").isValid());
+ QVERIFY(eng.globalObject().property("newProperty").isNumber());
+
+ // Nested static scope.
+ {
+ static const int propertyCount2 = 2;
+ QString names2[] = { "foo", "hum" };
+ QScriptValue values2[] = { 321, "hello" };
+ QScriptValue::PropertyFlags flags2[] = { QScriptValue::Undeletable,
+ QScriptValue::ReadOnly | QScriptValue::Undeletable };
+ QScriptValue scope2 = QScriptDeclarativeClass::newStaticScopeObject(&eng, propertyCount2, names2, values2, flags2);
+ ctx->pushScope(scope2);
+
+ // "foo" shadows scope.foo.
+ QVERIFY(eng.evaluate("foo").equals(scope2.property("foo")));
+ QVERIFY(!eng.evaluate("foo").equals(scope.property("foo")));
+ // "hum" comes from scope2.
+ QVERIFY(eng.evaluate("hum").equals(scope2.property("hum")));
+ // "Array" comes from Global Object.
+ QVERIFY(eng.evaluate("Array").equals(eng.globalObject().property("Array")));
+
+ ctx->popScope();
+ }
+
+ QScriptValue fun = eng.evaluate("(function() { return foo; })");
+ QVERIFY(fun.isFunction());
+ eng.popContext();
+ // Function's scope chain persists after popContext().
+ QVERIFY(fun.call().equals(scope.property("foo")));
+}
+
+void tst_QScriptEngine::newGrowingStaticScopeObject()
+{
+ QScriptEngine eng;
+ QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(&eng);
+
+ // Initially empty.
+ QVERIFY(!QScriptValueIterator(scope).hasNext());
+ QVERIFY(!scope.property("foo").isValid());
+
+ // Add a static property.
+ scope.setProperty("foo", 123);
+ QVERIFY(scope.property("foo").equals(123));
+ QCOMPARE(scope.propertyFlags("foo"), QScriptValue::Undeletable);
+
+ // Modify existing property.
+ scope.setProperty("foo", 456);
+ QVERIFY(scope.property("foo").equals(456));
+
+ // Add a read-only property.
+ scope.setProperty("bar", "ciao", QScriptValue::ReadOnly);
+ QVERIFY(scope.property("bar").equals("ciao"));
+ QCOMPARE(scope.propertyFlags("bar"), QScriptValue::ReadOnly | QScriptValue::Undeletable);
+
+ // Attempt to modify read-only property.
+ scope.setProperty("bar", "hello");
+ QVERIFY(scope.property("bar").equals("ciao"));
+
+ // Properties can't be deleted.
+ scope.setProperty("foo", QScriptValue());
+ QVERIFY(scope.property("foo").equals(456));
+ scope.setProperty("bar", QScriptValue());
+ QVERIFY(scope.property("bar").equals("ciao"));
+
+ // Iterate.
+ {
+ QScriptValueIterator it(scope);
+ QSet<QString> iteratedNames;
+ while (it.hasNext()) {
+ it.next();
+ iteratedNames.insert(it.name());
+ }
+ QCOMPARE(iteratedNames.size(), 2);
+ QVERIFY(iteratedNames.contains("foo"));
+ QVERIFY(iteratedNames.contains("bar"));
+ }
+
+ // Push it on the scope chain of a new context.
+ QScriptContext *ctx = eng.pushContext();
+ ctx->pushScope(scope);
+ QCOMPARE(ctx->scopeChain().size(), 3); // Global Object, native activation, custom scope
+ QVERIFY(ctx->activationObject().equals(scope));
+
+ // Read property from JS.
+ QVERIFY(eng.evaluate("foo").equals(scope.property("foo")));
+ QVERIFY(eng.evaluate("bar").equals(scope.property("bar")));
+
+ // Write property from JS.
+ {
+ QScriptValue oldValue = eng.evaluate("foo");
+ QVERIFY(oldValue.isNumber());
+ QScriptValue newValue = oldValue.toNumber() * 2;
+ QVERIFY(eng.evaluate("foo = foo * 2; foo").equals(newValue));
+ scope.setProperty("foo", oldValue);
+ QVERIFY(eng.evaluate("foo").equals(oldValue));
+ }
+
+ // Write to read-only property.
+ QVERIFY(eng.evaluate("bar = 456; bar").equals("ciao"));
+
+ // Shadow property.
+ QVERIFY(eng.evaluate("Math").equals(eng.globalObject().property("Math")));
+ scope.setProperty("Math", "fake Math");
+ QVERIFY(eng.evaluate("Math").equals(scope.property("Math")));
+
+ // Variable declarations will create properties on the scope.
+ eng.evaluate("var baz = 456");
+ QVERIFY(scope.property("baz").equals(456));
+
+ // Function declarations will create properties on the scope.
+ eng.evaluate("function fun() { return baz; }");
+ QVERIFY(scope.property("fun").isFunction());
+ QVERIFY(scope.property("fun").call().equals(scope.property("baz")));
+
+ // Demonstrate the limitation of a growable static scope: Once a function that
+ // uses the scope has been compiled, it won't pick up properties that are added
+ // to the scope later.
+ {
+ QScriptValue fun = eng.evaluate("(function() { return futureProperty; })");
+ QVERIFY(fun.isFunction());
+ QCOMPARE(fun.call().toString(), QString::fromLatin1("ReferenceError: Can't find variable: futureProperty"));
+ scope.setProperty("futureProperty", "added after the function was compiled");
+ // If scope were dynamic, this would return the new property.
+ QCOMPARE(fun.call().toString(), QString::fromLatin1("ReferenceError: Can't find variable: futureProperty"));
+ }
+
+ eng.popContext();
+}
+
QTEST_MAIN(tst_QScriptEngine)
#include "tst_qscriptengine.moc"
diff --git a/tests/auto/qsemaphore/tst_qsemaphore.cpp b/tests/auto/qsemaphore/tst_qsemaphore.cpp
index ace33dc..7cede30 100644
--- a/tests/auto/qsemaphore/tst_qsemaphore.cpp
+++ b/tests/auto/qsemaphore/tst_qsemaphore.cpp
@@ -63,6 +63,7 @@ private slots:
void tryAcquire();
void tryAcquireWithTimeout_data();
void tryAcquireWithTimeout();
+ void tryAcquireWithTimeoutStarvation();
void release();
void available();
void producerConsumer();
@@ -232,8 +233,8 @@ void tst_QSemaphore::tryAcquireWithTimeout_data()
{
QTest::addColumn<int>("timeout");
- QTest::newRow("") << 1000;
- QTest::newRow("") << 10000;
+ QTest::newRow("1s") << 1000;
+ QTest::newRow("10s") << 10000;
}
void tst_QSemaphore::tryAcquireWithTimeout()
@@ -316,6 +317,50 @@ void tst_QSemaphore::tryAcquireWithTimeout()
QCOMPARE(semaphore.available(), 0);
}
+void tst_QSemaphore::tryAcquireWithTimeoutStarvation()
+{
+ class Thread : public QThread
+ {
+ public:
+ QSemaphore startup;
+ QSemaphore *semaphore;
+ int amountToConsume, timeout;
+
+ void run()
+ {
+ startup.release();
+ forever {
+ if (!semaphore->tryAcquire(amountToConsume, timeout))
+ break;
+ semaphore->release(amountToConsume);
+ }
+ }
+ };
+
+ QSemaphore semaphore;
+ semaphore.release(1);
+
+ Thread consumer;
+ consumer.semaphore = &semaphore;
+ consumer.amountToConsume = 1;
+ consumer.timeout = 1000;
+
+ // start the thread and wait for it to start consuming
+ consumer.start();
+ consumer.startup.acquire();
+
+ // try to consume more than the thread we started is, and provide a longer
+ // timeout... we should timeout, not wait indefinitely
+ QVERIFY(!semaphore.tryAcquire(consumer.amountToConsume * 2, consumer.timeout * 2));
+
+ // the consumer should still be running
+ QVERIFY(consumer.isRunning() && !consumer.isFinished());
+
+ // acquire, and wait for smallConsumer to timeout
+ semaphore.acquire();
+ QVERIFY(consumer.wait());
+}
+
void tst_QSemaphore::release()
{ DEPENDS_ON("acquire"); }
diff --git a/tests/auto/qset/qset.pro b/tests/auto/qset/qset.pro
index 05ad07d..b45a015 100644
--- a/tests/auto/qset/qset.pro
+++ b/tests/auto/qset/qset.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qset.cpp
QT = core
-symbian*: {
+symbian: {
TARGET.EPOCSTACKSIZE =0x5000
-TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
}
diff --git a/tests/auto/qsound/qsound.pro b/tests/auto/qsound/qsound.pro
index 383a085..bb1981c 100644
--- a/tests/auto/qsound/qsound.pro
+++ b/tests/auto/qsound/qsound.pro
@@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_qsound.cpp
-wince*|symbian*: {
+wince*|symbian: {
deploy.sources += 4.wav
DEPLOYMENT = deploy
!symbian:DEFINES += SRCDIR=\\\"\\\"
diff --git a/tests/auto/qsplitter/qsplitter.pro b/tests/auto/qsplitter/qsplitter.pro
index 5ec2b9d..b11e408 100644
--- a/tests/auto/qsplitter/qsplitter.pro
+++ b/tests/auto/qsplitter/qsplitter.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qsplitter.cpp
contains(QT_CONFIG, qt3support): QT += qt3support
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = extradata.txt setSizes3.dat
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qstyle/qstyle.pro b/tests/auto/qstyle/qstyle.pro
index 1ffe369..11f5943 100644
--- a/tests/auto/qstyle/qstyle.pro
+++ b/tests/auto/qstyle/qstyle.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
TARGET.EPOCHEAPSIZE = 0x200000 0x800000
SOURCES += tst_qstyle.cpp
-wince*|symbian*: {
+wince*|symbian: {
!symbian:DEFINES += SRCDIR=\\\".\\\"
addPixmap.sources = task_25863.png
addPixmap.path = .
diff --git a/tests/auto/qtcpsocket/qtcpsocket.pro b/tests/auto/qtcpsocket/qtcpsocket.pro
index 370a695..8b1f664 100644
--- a/tests/auto/qtcpsocket/qtcpsocket.pro
+++ b/tests/auto/qtcpsocket/qtcpsocket.pro
@@ -2,7 +2,7 @@ TEMPLATE = subdirs
!wince*: SUBDIRS = test stressTest
-wince*|symbian*|vxworks* : SUBDIRS = test
+wince*|symbian|vxworks* : SUBDIRS = test
requires(contains(QT_CONFIG,private_tests))
diff --git a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
index cba5a74..aa1fbb5 100644
--- a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
+++ b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
@@ -4,7 +4,7 @@ HEADERS +=
SOURCES += tst_qtextboundaryfinder.cpp
!symbian:*:DEFINES += SRCDIR=\\\"$$PWD\\\"
-wince*|symbian*:{
+wince*|symbian:{
addFiles.sources = data
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qtextbrowser/qtextbrowser.pro b/tests/auto/qtextbrowser/qtextbrowser.pro
index e159a3c..88061a9 100644
--- a/tests/auto/qtextbrowser/qtextbrowser.pro
+++ b/tests/auto/qtextbrowser/qtextbrowser.pro
@@ -1,11 +1,11 @@
load(qttest_p4)
SOURCES += tst_qtextbrowser.cpp
-!symbian*:DEFINES += SRCDIR=\\\"$$PWD\\\"
+!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
contains(QT_CONFIG, qt3support): QT += qt3support
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = *.html
addFiles.path = .
addDir.sources = subdir/*
diff --git a/tests/auto/qtextedit/qtextedit.pro b/tests/auto/qtextedit/qtextedit.pro
index 3efabad..43813da 100644
--- a/tests/auto/qtextedit/qtextedit.pro
+++ b/tests/auto/qtextedit/qtextedit.pro
@@ -5,7 +5,7 @@ INCLUDEPATH += ../
HEADERS +=
SOURCES += tst_qtextedit.cpp
-wince*|symbian*: {
+wince*|symbian: {
addImages.sources = fullWidthSelection/*
addImages.path = fullWidthSelection
DEPLOYMENT += addImages
diff --git a/tests/auto/qthread/qthread.pro b/tests/auto/qthread/qthread.pro
index 4ea8fe5..0b042ab 100644
--- a/tests/auto/qthread/qthread.pro
+++ b/tests/auto/qthread/qthread.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
SOURCES += tst_qthread.cpp
QT = core
-symbian*:LIBS += -llibpthread
+symbian:LIBS += -llibpthread
diff --git a/tests/auto/qthreadstorage/qthreadstorage.pro b/tests/auto/qthreadstorage/qthreadstorage.pro
index 376ba65..3071098 100644
--- a/tests/auto/qthreadstorage/qthreadstorage.pro
+++ b/tests/auto/qthreadstorage/qthreadstorage.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
SOURCES += tst_qthreadstorage.cpp
QT = core
-symbian*:LIBS += -llibpthread
+symbian:LIBS += -llibpthread
diff --git a/tests/auto/qtipc/qsharedmemory/test/test.pro b/tests/auto/qtipc/qsharedmemory/test/test.pro
index 4ff5486..68a5362 100644
--- a/tests/auto/qtipc/qsharedmemory/test/test.pro
+++ b/tests/auto/qtipc/qsharedmemory/test/test.pro
@@ -24,7 +24,7 @@ addFiles.sources = $$OUT_PWD/../../lackey/lackey.exe ../../lackey/scripts
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\".\\\"
-}else:symbian*{
+}else:symbian{
requires(contains(QT_CONFIG,script))
QT += gui script
addFiles.sources = ../../lackey/scripts
diff --git a/tests/auto/qtransform/qtransform.pro b/tests/auto/qtransform/qtransform.pro
index 298feb2..92bef8c 100644
--- a/tests/auto/qtransform/qtransform.pro
+++ b/tests/auto/qtransform/qtransform.pro
@@ -2,6 +2,6 @@ load(qttest_p4)
HEADERS +=
SOURCES += tst_qtransform.cpp
-unix:!mac:!symbian*:LIBS+=-lm
+unix:!mac:!symbian:LIBS+=-lm
diff --git a/tests/auto/qtranslator/qtranslator.pro b/tests/auto/qtranslator/qtranslator.pro
index 2b08b4a..5b742f7 100644
--- a/tests/auto/qtranslator/qtranslator.pro
+++ b/tests/auto/qtranslator/qtranslator.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qtranslator.cpp
RESOURCES += qtranslator.qrc
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = hellotr_la.qm msgfmt_from_po.qm
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qtwidgets/qtwidgets.pro b/tests/auto/qtwidgets/qtwidgets.pro
index b762acb..9c33cd1 100644
--- a/tests/auto/qtwidgets/qtwidgets.pro
+++ b/tests/auto/qtwidgets/qtwidgets.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-symbian*:TARGET.EPOCHEAPSIZE=0x200000 0xa00000
+symbian:TARGET.EPOCHEAPSIZE=0x200000 0xa00000
SOURCES += tst_qtwidgets.cpp mainwindow.cpp
HEADERS += mainwindow.h
diff --git a/tests/auto/qudpsocket/test/test.pro b/tests/auto/qudpsocket/test/test.pro
index 44d3d30..9c0d009 100644
--- a/tests/auto/qudpsocket/test/test.pro
+++ b/tests/auto/qudpsocket/test/test.pro
@@ -14,7 +14,7 @@ win32 {
DESTDIR = ../
}
-wince*|symbian*: {
+wince*|symbian: {
addApp.sources = ../clientserver/clientserver.exe
addApp.path = clientserver
DEPLOYMENT += addApp
diff --git a/tests/auto/qwmatrix/qwmatrix.pro b/tests/auto/qwmatrix/qwmatrix.pro
index 58ea706..bab298b 100644
--- a/tests/auto/qwmatrix/qwmatrix.pro
+++ b/tests/auto/qwmatrix/qwmatrix.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
SOURCES += tst_qwmatrix.cpp
-unix:!mac:!symbian*:LIBS+=-lm
+unix:!mac:!symbian:LIBS+=-lm
diff --git a/tests/auto/qxml/qxml.pro b/tests/auto/qxml/qxml.pro
index 304fc54..5fb7fe2 100644
--- a/tests/auto/qxml/qxml.pro
+++ b/tests/auto/qxml/qxml.pro
@@ -3,7 +3,7 @@ load(qttest_p4)
SOURCES += tst_qxml.cpp
QT = core xml
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = 0x010D.xml
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qxmlformatter/qxmlformatter.pro b/tests/auto/qxmlformatter/qxmlformatter.pro
index 4c00d73..339fa55 100644
--- a/tests/auto/qxmlformatter/qxmlformatter.pro
+++ b/tests/auto/qxmlformatter/qxmlformatter.pro
@@ -3,7 +3,7 @@ SOURCES += tst_qxmlformatter.cpp
include (../xmlpatterns.pri)
-wince*|symbian*:{
+wince*|symbian:{
addFiles.sources = baselines input
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qxmlquery/qxmlquery.pro b/tests/auto/qxmlquery/qxmlquery.pro
index cfab564..ae73488 100644
--- a/tests/auto/qxmlquery/qxmlquery.pro
+++ b/tests/auto/qxmlquery/qxmlquery.pro
@@ -18,7 +18,7 @@ wince* {
include (../xmlpatterns.pri)
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = pushBaselines input.xml
addFiles.path = .
diff --git a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
index bfdec58..c107470 100644
--- a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
+++ b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
@@ -12,7 +12,7 @@ QT += network xml
QT -= gui
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = encodings parser xmldocs
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qxmlstream/qxmlstream.pro b/tests/auto/qxmlstream/qxmlstream.pro
index f82a7b3..8f076be 100644
--- a/tests/auto/qxmlstream/qxmlstream.pro
+++ b/tests/auto/qxmlstream/qxmlstream.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qxmlstream.cpp
QT = core xml network
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = data XML-Test-Suite
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/benchmarks/opengl/main.cpp b/tests/benchmarks/opengl/main.cpp
index beb4d43..c042fce 100644
--- a/tests/benchmarks/opengl/main.cpp
+++ b/tests/benchmarks/opengl/main.cpp
@@ -75,6 +75,10 @@ private slots:
void gradients_data();
void gradients();
+ void textureUpload_data();
+ void textureUpload();
+
+
private:
QGLPixelBuffer *pb;
};
@@ -374,6 +378,53 @@ void OpenGLBench::gradients()
}
}
+void OpenGLBench::textureUpload_data()
+{
+ QTest::addColumn<int>("size");
+ QTest::addColumn<int>("flags");
+ QTest::addColumn<int>("format");
+
+ int sizes[] = { 8, 10, 16, 20, 32, 50, 64, 100, 128, 200, 256, 500, 512, 1000, 1024, 2000, 2048, -1 };
+ int flags[] = { QGLContext::InternalBindOption,
+ QGLContext::DefaultBindOption,
+ -1 };
+ int formats[] = { GL_RGB, GL_RGBA, -1 };
+
+ for (int s = 0; sizes[s] != -1; ++s) {
+ for (int f = 0; flags[f] != -1; ++f) {
+ for (int a = 0; formats[a] != -1; ++a) {
+ QByteArray name;
+ name.append("size=").append(QByteArray::number(sizes[s]));
+ name.append(", flags=").append(f == 0 ? "internal" : "default");
+ name.append(", format=").append(a == 0 ? "RGB" : "RGBA");
+ QTest::newRow(name.constData()) << sizes[s] << flags[f] << formats[a];
+ }
+ }
+ }
+}
+
+void OpenGLBench::textureUpload()
+{
+ QFETCH(int, size);
+ QFETCH(int, flags);
+ QFETCH(int, format);
+
+ QPixmap pixmap(size, size);
+
+ if (format == GL_RGB)
+ pixmap.fill(Qt::red);
+ else
+ pixmap.fill(Qt::transparent);
+
+ pb->makeCurrent();
+ QGLContext *context = const_cast<QGLContext *>(QGLContext::currentContext());
+ QTime time;
+
+ time.start();
+ context->bindTexture(pixmap, GL_TEXTURE_2D, format, (QGLContext::BindOptions) flags);
+ QTest::setBenchmarkResult(time.elapsed(), QTest::WalltimeMilliseconds);
+}
+
QTEST_MAIN(OpenGLBench)
#include "main.moc"
diff --git a/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp b/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp
index 35e2f28..4610046 100644
--- a/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp
@@ -42,6 +42,8 @@
#include <qtest.h>
#include <QtScript>
+#include <QtScript/private/qscriptdeclarativeclass_p.h>
+
//TESTED_FILES=
class tst_QScriptEngine : public QObject
@@ -74,6 +76,8 @@ private slots:
void nativeCall();
void translation_data();
void translation();
+ void readScopeProperty_data();
+ void readScopeProperty();
};
tst_QScriptEngine::tst_QScriptEngine()
@@ -288,5 +292,53 @@ void tst_QScriptEngine::translation()
}
}
+void tst_QScriptEngine::readScopeProperty_data()
+{
+ QTest::addColumn<bool>("staticScope");
+ QTest::addColumn<bool>("nestedScope");
+ QTest::newRow("single dynamic scope") << false << false;
+ QTest::newRow("single static scope") << true << false;
+ QTest::newRow("double dynamic scope") << false << true;
+ QTest::newRow("double static scope") << true << true;
+}
+
+void tst_QScriptEngine::readScopeProperty()
+{
+ QFETCH(bool, staticScope);
+ QFETCH(bool, nestedScope);
+
+ QScriptEngine engine;
+ QScriptContext *ctx = engine.pushContext();
+
+ QScriptValue scope;
+ if (staticScope)
+ scope = QScriptDeclarativeClass::newStaticScopeObject(&engine);
+ else
+ scope = engine.newObject();
+ scope.setProperty("foo", 123);
+ ctx->pushScope(scope);
+
+ if (nestedScope) {
+ QScriptValue scope2;
+ if (staticScope)
+ scope2 = QScriptDeclarativeClass::newStaticScopeObject(&engine);
+ else
+ scope2 = engine.newObject();
+ scope2.setProperty("bar", 456); // ensure a miss in inner scope
+ ctx->pushScope(scope2);
+ }
+
+ QScriptValue fun = engine.evaluate("(function() {\n"
+ " for (var i = 0; i < 10000; ++i) {\n"
+ " foo; foo; foo; foo; foo; foo; foo; foo;\n"
+ " }\n"
+ "})");
+ engine.popContext();
+ QVERIFY(fun.isFunction());
+ QBENCHMARK {
+ fun.call();
+ }
+}
+
QTEST_MAIN(tst_QScriptEngine)
#include "tst_qscriptengine.moc"
diff --git a/tests/manual/bearerex/bearerex.cpp b/tests/manual/bearerex/bearerex.cpp
index bf60dd1..6f280db 100644
--- a/tests/manual/bearerex/bearerex.cpp
+++ b/tests/manual/bearerex/bearerex.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,6 +40,7 @@
****************************************************************************/
#include "bearerex.h"
+#include "datatransferer.h"
#include <QtNetwork>
@@ -261,8 +262,8 @@ SessionTab::SessionTab(QNetworkConfiguration* apNetworkConfiguration,
QListWidget* eventListWidget,
int index,
BearerEx * parent)
- : QWidget(parent), m_http(0), m_eventListWidget(eventListWidget),
- m_index(index), m_httpRequestOngoing(false), m_alrEnabled (false)
+ : QWidget(parent), m_dataTransferer(0), m_eventListWidget(eventListWidget),
+ m_index(index), m_alrEnabled (false)
{
setupUi(this);
@@ -300,41 +301,46 @@ SessionTab::SessionTab(QNetworkConfiguration* apNetworkConfiguration,
SessionTab::~SessionTab()
{
- // Need to be nulled, because modal dialogs may return after destruction of this object and
- // use already released resources.
- delete m_NetworkSession;
- m_NetworkSession = NULL;
- delete m_http;
- m_http = NULL;
+ delete m_NetworkSession; m_NetworkSession = 0;
+ delete m_dataTransferer; m_dataTransferer = 0;
}
-void SessionTab::on_createQHttpButton_clicked()
+void SessionTab::on_createQNetworkAccessManagerButton_clicked()
{
- if (m_httpRequestOngoing) {
- return;
+ if (m_dataTransferer) {
+ disconnect(m_dataTransferer, 0, 0, 0);
+ delete m_dataTransferer;
+ m_dataTransferer = 0;
}
-
- if (m_http) {
- disconnect(m_http, 0, 0, 0);
- delete m_http;
+ // Create new object according to current selection
+ QString type(comboBox->currentText());
+ if (type == "QNAM") {
+ m_dataTransferer = new DataTransfererQNam(this);
+ } else if (type == "QTcpSocket") {
+ m_dataTransferer = new DataTransfererQTcp(this);
+ } else if (type == "QHttp") {
+ m_dataTransferer = new DataTransfererQHttp(this);
+ } else {
+ qDebug("BearerEx Warning, unknown data transfer object requested, not creating anything.");
+ return;
}
- m_http = new QHttp(this);
- createQHttpButton->setText("Recreate QHttp");
- connect(m_http, SIGNAL(done(bool)), this, SLOT(done(bool)));
+ createQNetworkAccessManagerButton->setText("Recreate");
+ connect(m_dataTransferer, SIGNAL(finished(quint32, qint64, QString)), this, SLOT(finished(quint32, qint64, QString)));
}
void SessionTab::on_sendRequestButton_clicked()
{
- if (m_http) {
- QString urlstring("http://www.google.com");
- QUrl url(urlstring);
- m_http->setHost(url.host(), QHttp::ConnectionModeHttp, url.port() == -1 ? 0 : url.port());
- m_http->get(urlstring);
- m_httpRequestOngoing = true;
+ if (m_dataTransferer) {
+ if (!m_dataTransferer->transferData()) {
+ QMessageBox msgBox;
+ msgBox.setStandardButtons(QMessageBox::Close);
+ msgBox.setText("Data transfer not started. \nVery likely data transfer ongoing.");
+ msgBox.exec();
+ }
} else {
QMessageBox msgBox;
msgBox.setStandardButtons(QMessageBox::Close);
- msgBox.setText("QHttp not created.\nCreate QHttp First.");
+ msgBox.setText("Data object not created.\nCreate data object first.");
msgBox.exec();
}
}
@@ -419,7 +425,7 @@ void SessionTab::opened()
listItem->setText(QString("S")+QString::number(m_index)+QString(" - ")+QString("Opened"));
m_eventListWidget->addItem(listItem);
- QVariant identifier = m_NetworkSession->property("ActiveConfiguration");
+ QVariant identifier = m_NetworkSession->sessionProperty("ActiveConfiguration");
if (!identifier.isNull()) {
QString configId = identifier.toString();
QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId);
@@ -429,7 +435,7 @@ void SessionTab::opened()
}
if (m_NetworkSession->configuration().type() == QNetworkConfiguration::UserChoice) {
- QVariant identifier = m_NetworkSession->property("UserChoiceConfiguration");
+ QVariant identifier = m_NetworkSession->sessionProperty("UserChoiceConfiguration");
if (!identifier.isNull()) {
QString configId = identifier.toString();
QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId);
@@ -480,6 +486,18 @@ QString SessionTab::stateString(QNetworkSession::State state)
return stateString;
}
+void SessionTab::on_dataObjectChanged(const QString &newObjectType)
+{
+ qDebug() << "BearerEx SessionTab dataObjectChanged to: " << newObjectType;
+ if (m_dataTransferer) {
+ disconnect(m_dataTransferer, 0, 0, 0);
+ delete m_dataTransferer; m_dataTransferer = 0;
+ qDebug() << "BearerEx SessionTab, previous data object deleted.";
+ }
+ createQNetworkAccessManagerButton->setText("Create");
+}
+
+
void SessionTab::stateChanged(QNetworkSession::State state)
{
newState(state);
@@ -491,7 +509,7 @@ void SessionTab::stateChanged(QNetworkSession::State state)
void SessionTab::newState(QNetworkSession::State state)
{
- QVariant identifier = m_NetworkSession->property("ActiveConfiguration");
+ QVariant identifier = m_NetworkSession->sessionProperty("ActiveConfiguration");
if (state == QNetworkSession::Connected && !identifier.isNull()) {
QString configId = identifier.toString();
QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId);
@@ -542,18 +560,15 @@ void SessionTab::error(QNetworkSession::SessionError error)
msgBox.exec();
}
-void SessionTab::done(bool error)
+void SessionTab::finished(quint32 errorCode, qint64 dataReceived, QString errorType)
{
- m_httpRequestOngoing = false;
-
QMessageBox msgBox;
msgBox.setStandardButtons(QMessageBox::Close);
- if (error) {
- msgBox.setText("HTTP request failed.");
- } else {
- QString result(m_http->readAll());
- msgBox.setText(QString("HTTP request finished successfully.\nReceived ")+QString::number(result.length())+QString(" bytes."));
- }
+ msgBox.setText(QString("Data transfer completed. \nError code: ") +
+ QString::number(int(errorCode)) +
+ "\nError type: " + errorType +
+ "\nBytes received: " +
+ QString::number(dataReceived));
msgBox.exec();
// Check if the networksession still exists - it may have gone after returning from
// the modal dialog (in the case that app has been closed, and deleting QHttp will
diff --git a/tests/manual/bearerex/bearerex.h b/tests/manual/bearerex/bearerex.h
index 6bcb3e5..b81d486 100644
--- a/tests/manual/bearerex/bearerex.h
+++ b/tests/manual/bearerex/bearerex.h
@@ -55,13 +55,16 @@
#endif
#include "qnetworkconfigmanager.h"
#include "qnetworksession.h"
+#include "datatransferer.h"
#include "xqlistwidget.h"
QT_BEGIN_NAMESPACE
-class QHttp;
+class QNetworkAccessManager;
+class QNetworkReply;
QT_END_NAMESPACE
class SessionTab;
+class DataTransferer;
QT_USE_NAMESPACE
@@ -113,14 +116,15 @@ public:
QString stateString(QNetworkSession::State state);
private Q_SLOTS:
- void on_createQHttpButton_clicked();
+ void on_createQNetworkAccessManagerButton_clicked();
void on_sendRequestButton_clicked();
void on_openSessionButton_clicked();
void on_closeSessionButton_clicked();
void on_stopConnectionButton_clicked();
void on_deleteSessionButton_clicked();
+ void on_dataObjectChanged(const QString& newObjectType);
void on_alrButton_clicked();
- void done(bool error);
+ void finished(quint32 errorCode, qint64 dataReceived, QString errorType);
void newConfigurationActivated();
void preferredConfigurationChanged(const QNetworkConfiguration& config, bool isSeamless);
@@ -131,13 +135,14 @@ private Q_SLOTS:
void error(QNetworkSession::SessionError error);
private: //data
- QHttp* m_http;
+ // QNetworkAccessManager* m_networkAccessManager;
+ DataTransferer* m_dataTransferer;
QNetworkSession* m_NetworkSession;
QNetworkConfigurationManager* m_ConfigManager;
QListWidget* m_eventListWidget;
QNetworkConfiguration m_config;
int m_index;
- bool m_httpRequestOngoing;
+ bool m_dataTransferOngoing;
bool m_alrEnabled;
};
diff --git a/tests/manual/bearerex/bearerex.pro b/tests/manual/bearerex/bearerex.pro
index 7b21183..df39c85 100644
--- a/tests/manual/bearerex/bearerex.pro
+++ b/tests/manual/bearerex/bearerex.pro
@@ -17,10 +17,12 @@ maemo5|maemo6 {
# Example headers and sources
HEADERS += bearerex.h \
- xqlistwidget.h
+ xqlistwidget.h \
+ datatransferer.h
SOURCES += bearerex.cpp \
main.cpp \
- xqlistwidget.cpp
+ xqlistwidget.cpp \
+ datatransferer.cpp
symbian:TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData
diff --git a/tests/manual/bearerex/datatransferer.cpp b/tests/manual/bearerex/datatransferer.cpp
new file mode 100644
index 0000000..c3c13a8
--- /dev/null
+++ b/tests/manual/bearerex/datatransferer.cpp
@@ -0,0 +1,220 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDebug>
+#include <QUrl>
+#include <QByteArray>
+#include <QDataStream>
+#include "datatransferer.h"
+
+DataTransferer::DataTransferer(QObject *parent) :
+ QObject(parent), m_dataTransferOngoing(false)
+{
+}
+
+bool DataTransferer::dataTransferOngoing()
+{
+ return m_dataTransferOngoing;
+}
+
+
+
+// -------- Based on QTcp
+
+DataTransfererQTcp::DataTransfererQTcp(QObject* parent)
+: DataTransferer(parent)
+{
+ qDebug("BearerEx DataTransferer QTcp created.");
+
+ connect(&m_qsocket, SIGNAL(readyRead()), this, SLOT(readyRead()));
+ connect(&m_qsocket, SIGNAL(connected()), this, SLOT(connected()));
+ connect(&m_qsocket, SIGNAL(error(QAbstractSocket::SocketError)),
+ this, SLOT(error(QAbstractSocket::SocketError)));
+}
+
+DataTransfererQTcp::~DataTransfererQTcp()
+{
+ qDebug("BearerEx DataTransferer QTcp destroyed.");
+ m_qsocket.abort();
+}
+
+bool DataTransfererQTcp::transferData()
+{
+ if (m_dataTransferOngoing) {
+ return false;
+ }
+ qDebug("BearerEx datatransfer for QTcp requested.");
+ // Connect to host
+ QUrl url("http://www.google.com.au");
+ m_qsocket.connectToHost(url.host(), url.port(80));
+
+ // m_qsocket.connectToHost("http://www.google.com", 80);
+ // Wait for connected() signal.
+ m_dataTransferOngoing = true;
+ return true;
+}
+
+void DataTransfererQTcp::connected()
+{
+ qDebug("BearerEx DataTransfererQtcp connected, requesting data.");
+ // Establish HTTP request
+ //QByteArray request("GET / HTTP/1.1 \nHost: www.google.com\n\n");
+ QByteArray request("GET / HTTP/1.1\n\n");
+
+ // QByteArray request("GET /index.html HTTP/1.1 \n Host: www.google.com \n\n");
+ qint64 dataWritten = m_qsocket.write(request);
+ m_qsocket.flush();
+
+ qDebug() << "BearerEx DataTransferQTcp wrote " << dataWritten << " bytes";
+ // Start waiting for readyRead() of error()
+}
+
+void DataTransfererQTcp::readyRead()
+{
+ qDebug() << "BearerEx DataTransfererQTcp readyRead() with ";
+ qint64 bytesAvailable = m_qsocket.bytesAvailable();
+ qDebug() << bytesAvailable << " bytes available.";
+
+ // QDataStream in(&m_qsocket);
+ QByteArray array = m_qsocket.readAll();
+ QString data = QString::fromAscii(array);
+
+ // in >> data;
+
+ qDebug() << "BearerEx DataTransferQTcp data received: " << data;
+ m_dataTransferOngoing = false;
+ // m_qsocket.error() returns uninitialized value in case no error has occured,
+ // so emit '0'
+ emit finished(0, bytesAvailable, "QAbstractSocket::SocketError");
+}
+
+void DataTransfererQTcp::error(QAbstractSocket::SocketError socketError)
+{
+ qDebug("BearerEx DataTransfererQTcp error(), aborting socket.");
+ m_qsocket.abort();
+ m_dataTransferOngoing = false;
+ emit finished(socketError, 0, "QAbstractSocket::SocketError");
+}
+
+// -------- Based on QHttp
+
+DataTransfererQHttp::DataTransfererQHttp(QObject* parent)
+: DataTransferer(parent)
+{
+ connect(&m_qhttp, SIGNAL(done(bool)), this, SLOT(done(bool)));
+ qDebug("BearerEx DataTransferer QHttp created.");
+}
+
+DataTransfererQHttp::~DataTransfererQHttp()
+{
+ qDebug("BearerEx DataTransferer QHttp destroyed.");
+}
+
+bool DataTransfererQHttp::transferData()
+{
+ qDebug("BearerEx datatransfer for QHttp requested.");
+ if (m_dataTransferOngoing) {
+ return false;
+ }
+ QString urlstring("http://www.google.com");
+ QUrl url(urlstring);
+ m_qhttp.setHost(url.host(), QHttp::ConnectionModeHttp, url.port() == -1 ? 0 : url.port());
+ m_qhttp.get(urlstring);
+ m_dataTransferOngoing = true;
+ return true;
+}
+
+void DataTransfererQHttp::done(bool /*error*/ )
+{
+ qDebug("BearerEx DatatransfererQHttp reply was finished (error code is type QHttp::Error).");
+ qint64 dataReceived = 0;
+ quint32 errorCode = m_qhttp.error();
+ if (m_qhttp.error() == QHttp::NoError) {
+ QString result(m_qhttp.readAll());
+ dataReceived = result.length();
+ }
+ m_dataTransferOngoing = false;
+ emit finished(errorCode, dataReceived, "QHttp::Error");
+}
+
+// -------- Based on QNetworkAccessManager
+
+DataTransfererQNam::DataTransfererQNam(QObject* parent)
+: DataTransferer(parent)
+{
+ connect(&m_qnam, SIGNAL(finished(QNetworkReply*)),
+ this, SLOT(replyFinished(QNetworkReply*)));
+ qDebug("BearerEx DataTransferer QNam created.");
+}
+
+DataTransfererQNam::~DataTransfererQNam()
+{
+ qDebug("BearerEx DataTransferer QNam destroyed.");
+}
+
+bool DataTransfererQNam::transferData()
+{
+ qDebug("BearerEx datatransfer for QNam requested.");
+ if (m_dataTransferOngoing) {
+ return false;
+ }
+ m_qnam.get(QNetworkRequest(QUrl("http://www.google.com")));
+ m_dataTransferOngoing = true;
+ return true;
+}
+
+void DataTransfererQNam::replyFinished(QNetworkReply *reply)
+{
+ qDebug("BearerEx DatatransfererQNam reply was finished (error code is type QNetworkReply::NetworkError).");
+ qint64 dataReceived = 0;
+ quint32 errorCode = (quint32)reply->error();
+
+ if (reply->error() == QNetworkReply::NoError) {
+ QString result(reply->readAll());
+ dataReceived = result.length();
+ }
+ m_dataTransferOngoing = false;
+ emit finished(errorCode, dataReceived, "QNetworkReply::NetworkError");
+ reply->deleteLater();
+}
+
+
+
diff --git a/tests/manual/bearerex/datatransferer.h b/tests/manual/bearerex/datatransferer.h
new file mode 100644
index 0000000..f2159b7
--- /dev/null
+++ b/tests/manual/bearerex/datatransferer.h
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DATATRANSFERER_H
+#define DATATRANSFERER_H
+
+#include <QObject>
+#include <QString>
+#include <QNetworkReply>
+#include <QNetworkAccessManager>
+#include <QTcpSocket>
+#include <QHttp>
+#include <QDebug>
+
+// Interface-class for data transferring object
+
+class DataTransferer : public QObject
+{
+ Q_OBJECT
+public:
+ explicit DataTransferer(QObject *parent = 0);
+ virtual ~DataTransferer() {
+ if (m_dataTransferOngoing) {
+ qDebug("BearerEx Warning: dataobjects transfer was ongoing when destroyed.");
+ }
+ }
+ virtual bool transferData() = 0;
+ bool dataTransferOngoing();
+
+signals:
+ void finished(quint32 errorCode, qint64 dataReceived, QString errorType);
+
+public slots:
+
+protected:
+ bool m_dataTransferOngoing;
+};
+
+
+// Specializations/concrete classes
+
+class DataTransfererQTcp : public DataTransferer
+{
+ Q_OBJECT
+public:
+ DataTransfererQTcp(QObject* parent = 0);
+ ~DataTransfererQTcp();
+
+ virtual bool transferData();
+
+public slots:
+ void readyRead();
+ void error(QAbstractSocket::SocketError socketError);
+ void connected();
+
+private:
+ QTcpSocket m_qsocket;
+};
+
+class DataTransfererQNam : public DataTransferer
+{
+ Q_OBJECT
+public:
+ DataTransfererQNam(QObject* parent = 0);
+ ~DataTransfererQNam();
+
+ virtual bool transferData();
+
+public slots:
+ void replyFinished(QNetworkReply* reply);
+
+private:
+ QNetworkAccessManager m_qnam;
+};
+
+class DataTransfererQHttp : public DataTransferer
+{
+ Q_OBJECT
+public:
+ DataTransfererQHttp(QObject* parent = 0);
+ ~DataTransfererQHttp();
+
+ virtual bool transferData();
+
+public slots:
+ void done(bool error);
+
+private:
+ QHttp m_qhttp;
+};
+
+#endif // DATATRANSFERER_H
diff --git a/tests/manual/bearerex/main.cpp b/tests/manual/bearerex/main.cpp
index 20b167e..704321a 100644
--- a/tests/manual/bearerex/main.cpp
+++ b/tests/manual/bearerex/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/bearerex/sessiondialog.ui b/tests/manual/bearerex/sessiondialog.ui
index fcf2136..c50af70 100644
--- a/tests/manual/bearerex/sessiondialog.ui
+++ b/tests/manual/bearerex/sessiondialog.ui
@@ -1,78 +1,87 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>SessionTab</class>
- <widget class="QWidget" name="SessionTab" >
- <layout class="QVBoxLayout" name="verticalLayout" >
+ <widget class="QWidget" name="SessionTab">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>192</width>
+ <height>262</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
<item>
- <layout class="QFormLayout" name="formLayout" >
- <item row="0" column="0" >
- <widget class="QLabel" name="snapLabel" >
- <property name="text" >
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="snapLabel">
+ <property name="text">
<string>SNAP</string>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="snapLineEdit" >
- <property name="readOnly" >
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="snapLineEdit">
+ <property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QLabel" name="iapLabel" >
- <property name="text" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="iapLabel">
+ <property name="text">
<string>IAP</string>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <widget class="QLineEdit" name="iapLineEdit" >
- <property name="enabled" >
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="iapLineEdit">
+ <property name="enabled">
<bool>true</bool>
</property>
- <property name="readOnly" >
+ <property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
- <item row="2" column="0" >
- <widget class="QLabel" name="bearerLabel" >
- <property name="text" >
+ <item row="2" column="0">
+ <widget class="QLabel" name="bearerLabel">
+ <property name="text">
<string>Bearer</string>
</property>
</widget>
</item>
- <item row="2" column="1" >
- <widget class="QLineEdit" name="bearerLineEdit" >
- <property name="readOnly" >
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="bearerLineEdit">
+ <property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
- <item row="3" column="0" >
- <widget class="QLabel" name="sentRecDataLabel" >
- <property name="text" >
+ <item row="3" column="0">
+ <widget class="QLabel" name="sentRecDataLabel">
+ <property name="text">
<string>Sent/Rec.</string>
</property>
</widget>
</item>
- <item row="3" column="1" >
- <widget class="QLineEdit" name="sentRecDataLineEdit" >
- <property name="readOnly" >
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="sentRecDataLineEdit">
+ <property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
- <item row="4" column="0" >
- <widget class="QLabel" name="stateLabel" >
- <property name="text" >
+ <item row="4" column="0">
+ <widget class="QLabel" name="stateLabel">
+ <property name="text">
<string>State</string>
</property>
</widget>
</item>
- <item row="4" column="1" >
- <widget class="QLineEdit" name="stateLineEdit" >
- <property name="readOnly" >
+ <item row="4" column="1">
+ <widget class="QLineEdit" name="stateLineEdit">
+ <property name="readOnly">
<bool>true</bool>
</property>
</widget>
@@ -80,52 +89,71 @@
</layout>
</item>
<item>
- <layout class="QGridLayout" name="gridLayout" >
- <item row="0" column="0" >
- <widget class="QPushButton" name="openSessionButton" >
- <property name="text" >
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QPushButton" name="openSessionButton">
+ <property name="text">
<string>Open Session</string>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QPushButton" name="closeSessionButton" >
- <property name="text" >
+ <item row="0" column="1">
+ <widget class="QPushButton" name="closeSessionButton">
+ <property name="text">
<string>Close Session</string>
</property>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QPushButton" name="stopConnectionButton" >
- <property name="text" >
+ <item row="1" column="0">
+ <widget class="QPushButton" name="stopConnectionButton">
+ <property name="text">
<string>Stop Conn.</string>
</property>
</widget>
</item>
- <item row="2" column="0" >
- <widget class="QPushButton" name="createQHttpButton" >
- <property name="text" >
- <string>Create QHttp</string>
+ <item row="1" column="1">
+ <widget class="QPushButton" name="alrButton">
+ <property name="text">
+ <string>Enable ALR</string>
</property>
</widget>
</item>
- <item row="2" column="1" >
- <widget class="QPushButton" name="sendRequestButton" >
- <property name="text" >
+ <item row="3" column="0">
+ <widget class="QPushButton" name="sendRequestButton">
+ <property name="text">
<string>Send Test Req.</string>
</property>
</widget>
</item>
- <item row="3" column="0" >
- <widget class="QPushButton" name="alrButton" >
- <property name="text" >
- <string>Enable ALR</string>
+ <item row="2" column="1">
+ <widget class="QPushButton" name="createQNetworkAccessManagerButton">
+ <property name="text">
+ <string>Create</string>
</property>
</widget>
</item>
- <item row="3" column="1" >
- <widget class="QPushButton" name="deleteSessionButton" >
- <property name="text" >
+ <item row="2" column="0">
+ <widget class="QComboBox" name="comboBox">
+ <item>
+ <property name="text">
+ <string>QNAM</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>QTcpSocket</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>QHttp</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QPushButton" name="deleteSessionButton">
+ <property name="text">
<string>Delete Session</string>
</property>
</widget>
@@ -135,5 +163,25 @@
</layout>
</widget>
<resources/>
- <connections/>
+ <connections>
+ <connection>
+ <sender>comboBox</sender>
+ <signal>currentIndexChanged(QString)</signal>
+ <receiver>SessionTab</receiver>
+ <slot>on_dataObjectChanged(QString)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>40</x>
+ <y>211</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>10</x>
+ <y>258</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+ <slots>
+ <slot>on_dataObjectChanged(QString)</slot>
+ </slots>
</ui>
diff --git a/tests/manual/bearerex/xqlistwidget.cpp b/tests/manual/bearerex/xqlistwidget.cpp
index 8104779..e4b12f2 100644
--- a/tests/manual/bearerex/xqlistwidget.cpp
+++ b/tests/manual/bearerex/xqlistwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/bearerex/xqlistwidget.h b/tests/manual/bearerex/xqlistwidget.h
index 0649c2b..7c12138 100644
--- a/tests/manual/bearerex/xqlistwidget.h
+++ b/tests/manual/bearerex/xqlistwidget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtabletevent/regular_widgets/main.cpp b/tests/manual/qtabletevent/regular_widgets/main.cpp
new file mode 100644
index 0000000..a39e094
--- /dev/null
+++ b/tests/manual/qtabletevent/regular_widgets/main.cpp
@@ -0,0 +1,150 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QDebug>
+#include <QMouseEvent>
+#include <QTabletEvent>
+#include <QWidget>
+
+class EventReportWidget : public QWidget
+{
+public:
+ EventReportWidget();
+protected:
+ void mouseDoubleClickEvent(QMouseEvent *event) { outputMouseEvent(event); }
+ void mouseMoveEvent(QMouseEvent *event) { outputMouseEvent(event); }
+ void mousePressEvent(QMouseEvent *event) { outputMouseEvent(event); }
+ void mouseReleaseEvent(QMouseEvent *event) { outputMouseEvent(event); }
+
+ void tabletEvent(QTabletEvent *);
+
+private:
+ void outputMouseEvent(QMouseEvent *event);
+
+ bool m_lastIsMouseMove;
+ bool m_lastIsTabletMove;
+};
+
+EventReportWidget::EventReportWidget()
+ : m_lastIsMouseMove(false)
+ , m_lastIsTabletMove(false)
+{ }
+
+void EventReportWidget::tabletEvent(QTabletEvent *event)
+{
+ QWidget::tabletEvent(event);
+
+ QString type;
+ switch (event->type()) {
+ case QEvent::TabletEnterProximity:
+ m_lastIsTabletMove = false;
+ type = QString::fromLatin1("TabletEnterProximity");
+ break;
+ case QEvent::TabletLeaveProximity:
+ m_lastIsTabletMove = false;
+ type = QString::fromLatin1("TabletLeaveProximity");
+ break;
+ case QEvent::TabletMove:
+ if (m_lastIsTabletMove)
+ return;
+
+ m_lastIsTabletMove = true;
+ type = QString::fromLatin1("TabletMove");
+ break;
+ case QEvent::TabletPress:
+ m_lastIsTabletMove = false;
+ type = QString::fromLatin1("TabletPress");
+ break;
+ case QEvent::TabletRelease:
+ m_lastIsTabletMove = false;
+ type = QString::fromLatin1("TabletRelease");
+ break;
+ default:
+ Q_ASSERT(false);
+ break;
+ }
+
+ qDebug() << "Tablet event, type = " << type
+ << " position = " << event->pos()
+ << " global position = " << event->globalPos();
+}
+
+void EventReportWidget::outputMouseEvent(QMouseEvent *event)
+{
+ QString type;
+ switch (event->type()) {
+ case QEvent::MouseButtonDblClick:
+ m_lastIsMouseMove = false;
+ type = QString::fromLatin1("MouseButtonDblClick");
+ break;
+ case QEvent::MouseButtonPress:
+ m_lastIsMouseMove = false;
+ type = QString::fromLatin1("MouseButtonPress");
+ break;
+ case QEvent::MouseButtonRelease:
+ m_lastIsMouseMove = false;
+ type = QString::fromLatin1("MouseButtonRelease");
+ break;
+ case QEvent::MouseMove:
+ if (m_lastIsMouseMove)
+ return; // only show one move to keep things readable
+
+ m_lastIsMouseMove = true;
+ type = QString::fromLatin1("MouseMove");
+ break;
+ default:
+ Q_ASSERT(false);
+ break;
+ }
+
+ qDebug() << "Mouse event, type = " << type
+ << " position = " << event->pos()
+ << " global position = " << event->globalPos();
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ EventReportWidget widget;
+ widget.show();
+ return app.exec();
+}
diff --git a/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro b/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro
new file mode 100644
index 0000000..9f0da76
--- /dev/null
+++ b/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro
@@ -0,0 +1,3 @@
+TEMPLATE = app
+
+SOURCES += main.cpp
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index b3e7e84..609bd3d 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -1761,7 +1761,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
if (!tor)
goto case_default;
if (!sourcetext.isEmpty())
- yyMsg() << "//%% cannot be used with tr() / QT_TR_NOOP(). Ignoring\n";
+ yyMsg() << "//% cannot be used with tr() / QT_TR_NOOP(). Ignoring\n";
utf8 = (yyTok == Tok_trUtf8);
line = yyLineNo;
yyTok = getToken();
@@ -1858,6 +1858,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
gotctx:
recordMessage(line, context, text, comment, extracomment, msgid, extra, utf8, plural);
}
+ sourcetext.clear(); // Will have warned about that already
extracomment.clear();
msgid.clear();
extra.clear();
@@ -1867,7 +1868,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
if (!tor)
goto case_default;
if (!sourcetext.isEmpty())
- yyMsg() << "//%% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring\n";
+ yyMsg() << "//% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring\n";
utf8 = (yyTok == Tok_translateUtf8);
line = yyLineNo;
yyTok = getToken();
@@ -1913,6 +1914,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
}
recordMessage(line, context, text, comment, extracomment, msgid, extra, utf8, plural);
}
+ sourcetext.clear(); // Will have warned about that already
extracomment.clear();
msgid.clear();
extra.clear();
@@ -2079,9 +2081,13 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
case Tok_Semicolon:
prospectiveContext.clear();
prefix.clear();
- extracomment.clear();
- msgid.clear();
- extra.clear();
+ if (!sourcetext.isEmpty() || !extracomment.isEmpty() || !msgid.isEmpty() || !extra.isEmpty()) {
+ yyMsg() << "Discarding unconsumed meta data\n";
+ sourcetext.clear();
+ extracomment.clear();
+ msgid.clear();
+ extra.clear();
+ }
yyTokColonSeen = false;
yyTok = getToken();
break;
diff --git a/tools/qdoc3/codechunk.h b/tools/qdoc3/codechunk.h
index e78873c..a0c554e 100644
--- a/tools/qdoc3/codechunk.h
+++ b/tools/qdoc3/codechunk.h
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
/*
The CodeChunk class represents a tiny piece of C++ code.
- The class provides convertion between a list of lexemes and a string. It adds
+ The class provides conversion between a list of lexemes and a string. It adds
spaces at the right place for consistent style. The tiny pieces of code it
represents are data types, enum values, and default parameter values.
diff --git a/tools/qdoc3/codemarker.cpp b/tools/qdoc3/codemarker.cpp
index 818a91f..33ceaf5 100644
--- a/tools/qdoc3/codemarker.cpp
+++ b/tools/qdoc3/codemarker.cpp
@@ -257,6 +257,7 @@ QString CodeMarker::typified(const QString &string)
QString CodeMarker::taggedNode(const Node* node)
{
QString tag;
+ QString name = node->name();
switch (node->type()) {
case Node::Namespace:
@@ -277,11 +278,20 @@ QString CodeMarker::taggedNode(const Node* node)
case Node::Property:
tag = QLatin1String("@property");
break;
+#ifdef QDOC_QML
+ case Node::Fake:
+ if (node->subType() == Node::QmlClass) {
+ if (node->name().startsWith(QLatin1String("QML:")))
+ name = name.mid(4); // remove the "QML:" prefix
+ }
+ tag = QLatin1String("@property");
+ break;
+#endif
default:
tag = QLatin1String("@unknown");
break;
}
- return QLatin1Char('<') + tag + QLatin1Char('>') + protect(node->name())
+ return QLatin1Char('<') + tag + QLatin1Char('>') + protect(name)
+ QLatin1String("</") + tag + QLatin1Char('>');
}
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index 13678af..e4870e3 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -728,7 +728,10 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc,
if (n)
classNode = static_cast<const ClassNode*>(n);
}
- return new QmlClassNode(tre->root(), names[0], classNode);
+ if (names[0].startsWith("Q"))
+ return new QmlClassNode(tre->root(), QLatin1String("QML:")+names[0], classNode);
+ else
+ return new QmlClassNode(tre->root(), names[0], classNode);
}
else if (command == COMMAND_QMLBASICTYPE) {
#if 0
@@ -752,6 +755,8 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc,
QString type;
QmlClassNode* qmlClass = 0;
if (splitQmlMethodArg(doc,arg,type,element)) {
+ if (element.startsWith(QLatin1String("Q")))
+ element = QLatin1String("QML:") + element;
Node* n = tre->findNode(QStringList(element),Node::Fake);
if (n && n->subType() == Node::QmlClass) {
qmlClass = static_cast<QmlClassNode*>(n);
@@ -1850,16 +1855,40 @@ bool CppCodeParser::matchProperty(InnerNode *parent)
else if (key == "WRITE") {
tre->addPropertyFunction(property, value, PropertyNode::Setter);
property->setWritable(true);
- } else if (key == "STORED")
+ }
+ else if (key == "STORED")
property->setStored(value.toLower() == "true");
- else if (key == "DESIGNABLE")
- property->setDesignable(value.toLower() == "true");
+ else if (key == "DESIGNABLE") {
+ QString v = value.toLower();
+ if (v == "true")
+ property->setDesignable(true);
+ else if (v == "false")
+ property->setDesignable(false);
+ else {
+ property->setDesignable(false);
+ property->setRuntimeDesFunc(value);
+ }
+ }
else if (key == "RESET")
tre->addPropertyFunction(property, value, PropertyNode::Resetter);
else if (key == "NOTIFY") {
tre->addPropertyFunction(property, value, PropertyNode::Notifier);
}
-
+ else if (key == "SCRIPTABLE") {
+ QString v = value.toLower();
+ if (v == "true")
+ property->setScriptable(true);
+ else if (v == "false")
+ property->setScriptable(false);
+ else {
+ property->setScriptable(false);
+ property->setRuntimeScrFunc(value);
+ }
+ }
+ else if (key == "COSTANT")
+ property->setConstant();
+ else if (key == "FINAL")
+ property->setFinal();
}
match(Tok_RightParen);
return true;
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index be734ac..d7a9c9e 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -1,3 +1,4 @@
+
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
@@ -1465,7 +1466,6 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
writeFunctions((*s),cn,marker);
}
else if ((*s).name == "Member Type Documentation") {
- writeNestedClasses((*s),cn,marker);
writeEnumerations((*s),cn,marker);
writeTypedefs((*s),cn,marker);
}
@@ -1475,6 +1475,9 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
else if ((*s).name == "Property Documentation") {
writeProperties((*s),cn,marker);
}
+ else if ((*s).name == "Macro Documentation") {
+ writeMacros((*s),cn,marker);
+ }
++s;
}
writer.writeEndElement(); // </cxxClass>
@@ -4573,7 +4576,8 @@ void DitaXmlGenerator::writeLocation(const Node* n)
s2 = CXXTYPEDEFDECLARATIONFILE;
s3 = CXXTYPEDEFDECLARATIONFILELINE;
}
- else if (n->type() == Node::Property) {
+ else if ((n->type() == Node::Property) ||
+ (n->type() == Node::Variable)) {
s1 = CXXVARIABLEAPIITEMLOCATION;
s2 = CXXVARIABLEDECLARATIONFILE;
s3 = CXXVARIABLEDECLARATIONFILELINE;
@@ -4716,6 +4720,8 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marke
writer.writeStartElement(CXXFUNCTIONPARAMETER);
writer.writeStartElement(CXXFUNCTIONPARAMETERDECLAREDTYPE);
writer.writeCharacters((*p).leftType());
+ if (!(*p).rightType().isEmpty())
+ writer.writeCharacters((*p).rightType());
writer.writeEndElement(); // <cxxFunctionParameterDeclaredType>
writer.writeStartElement(CXXFUNCTIONPARAMETERDECLARATIONNAME);
writer.writeCharacters((*p).name());
@@ -4732,12 +4738,6 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marke
}
}
-void DitaXmlGenerator::writeNestedClasses(const Section& s,
- const ClassNode* cn,
- CodeMarker* marker)
-{
-}
-
void DitaXmlGenerator::writeEnumerations(const Section& s,
const ClassNode* cn,
CodeMarker* marker)
@@ -4888,12 +4888,6 @@ void DitaXmlGenerator::writeTypedefs(const Section& s,
}
}
-void DitaXmlGenerator::writeDataMembers(const Section& s,
- const ClassNode* cn,
- CodeMarker* marker)
-{
-}
-
void DitaXmlGenerator::writeProperties(const Section& s,
const ClassNode* cn,
CodeMarker* marker)
@@ -4914,9 +4908,9 @@ void DitaXmlGenerator::writeProperties(const Section& s,
writer.writeAttribute("value",pn->accessString());
writer.writeEndElement(); // <cxxVariableAccessSpecifier>
- if (!pn->dataType().isEmpty()) {
+ if (!pn->qualifiedDataType().isEmpty()) {
writer.writeStartElement(CXXVARIABLEDECLAREDTYPE);
- writer.writeCharacters(pn->dataType());
+ writer.writeCharacters(pn->qualifiedDataType());
writer.writeEndElement(); // <cxxVariableDeclaredType>
}
QString fq = fullQualification(pn);
@@ -4925,11 +4919,49 @@ void DitaXmlGenerator::writeProperties(const Section& s,
writer.writeCharacters(fq);
writer.writeEndElement(); // <cxxVariableScopedName>
}
+
+ writer.writeStartElement(CXXVARIABLEPROTOTYPE);
+ writer.writeCharacters("Q_PROPERTY(");
+ writer.writeCharacters(pn->qualifiedDataType());
+ writer.writeCharacters(" ");
+ writer.writeCharacters(pn->name());
+ writePropParams("READ",pn->getters());
+ writePropParams("WRITE",pn->setters());
+ writePropParams("RESET",pn->resetters());
+ writePropParams("NOTIFY",pn->notifiers());
+ if (pn->isDesignable() != pn->designableDefault()) {
+ writer.writeCharacters(" DESIGNABLE ");
+ if (!pn->runtimeDesignabilityFunction().isEmpty())
+ writer.writeCharacters(pn->runtimeDesignabilityFunction());
+ else
+ writer.writeCharacters(pn->isDesignable() ? "true" : "false");
+ }
+ if (pn->isScriptable() != pn->scriptableDefault()) {
+ writer.writeCharacters(" SCRIPTABLE ");
+ if (!pn->runtimeScriptabilityFunction().isEmpty())
+ writer.writeCharacters(pn->runtimeScriptabilityFunction());
+ else
+ writer.writeCharacters(pn->isScriptable() ? "true" : "false");
+ }
+ if (pn->isWritable() != pn->writableDefault()) {
+ writer.writeCharacters(" STORED ");
+ writer.writeCharacters(pn->isStored() ? "true" : "false");
+ }
+ if (pn->isUser() != pn->userDefault()) {
+ writer.writeCharacters(" USER ");
+ writer.writeCharacters(pn->isUser() ? "true" : "false");
+ }
+ if (pn->isConstant())
+ writer.writeCharacters(" CONSTANT");
+ if (pn->isFinal())
+ writer.writeCharacters(" FINAL");
+ writer.writeCharacters(")");
+ writer.writeEndElement(); // <cxxVariablePrototype>
+
writer.writeStartElement(CXXVARIABLENAMELOOKUP);
writer.writeCharacters(pn->parent()->name() + "::" + pn->name());
writer.writeEndElement(); // <cxxVariableNameLookup>
-
if (pn->overriddenFrom() != 0) {
PropertyNode* opn = (PropertyNode*)pn->overriddenFrom();
writer.writeStartElement(CXXVARIABLEREIMPLEMENTED);
@@ -4954,4 +4986,169 @@ void DitaXmlGenerator::writeProperties(const Section& s,
}
}
+void DitaXmlGenerator::writeDataMembers(const Section& s,
+ const ClassNode* cn,
+ CodeMarker* marker)
+{
+ NodeList::ConstIterator m = s.members.begin();
+ while (m != s.members.end()) {
+ if ((*m)->type() == Node::Variable) {
+ const VariableNode* vn = static_cast<const VariableNode*>(*m);
+ writer.writeStartElement(CXXVARIABLE);
+ writer.writeAttribute("id",vn->guid());
+ writer.writeStartElement(APINAME);
+ writer.writeCharacters(vn->name());
+ writer.writeEndElement(); // </apiName>
+ generateBrief(vn,marker);
+ writer.writeStartElement(CXXVARIABLEDETAIL);
+ writer.writeStartElement(CXXVARIABLEDEFINITION);
+ writer.writeStartElement(CXXVARIABLEACCESSSPECIFIER);
+ writer.writeAttribute("value",vn->accessString());
+ writer.writeEndElement(); // <cxxVariableAccessSpecifier>
+
+ if (vn->isStatic()) {
+ writer.writeStartElement(CXXVARIABLESTORAGECLASSSPECIFIERSTATIC);
+ writer.writeAttribute("name","static");
+ writer.writeAttribute("value","static");
+ writer.writeEndElement(); // <cxxVariableStorageClassSpecifierStatic>
+ }
+
+ writer.writeStartElement(CXXVARIABLEDECLAREDTYPE);
+ writer.writeCharacters(vn->leftType());
+ if (!vn->rightType().isEmpty())
+ writer.writeCharacters(vn->rightType());
+ writer.writeEndElement(); // <cxxVariableDeclaredType>
+
+ QString fq = fullQualification(vn);
+ if (!fq.isEmpty()) {
+ writer.writeStartElement(CXXVARIABLESCOPEDNAME);
+ writer.writeCharacters(fq);
+ writer.writeEndElement(); // <cxxVariableScopedName>
+ }
+
+ writer.writeStartElement(CXXVARIABLEPROTOTYPE);
+ writer.writeCharacters(vn->leftType() + " ");
+ //writer.writeCharacters(vn->parent()->name() + "::" + vn->name());
+ writer.writeCharacters(vn->name());
+ if (!vn->rightType().isEmpty())
+ writer.writeCharacters(vn->rightType());
+ writer.writeEndElement(); // <cxxVariablePrototype>
+
+ writer.writeStartElement(CXXVARIABLENAMELOOKUP);
+ writer.writeCharacters(vn->parent()->name() + "::" + vn->name());
+ writer.writeEndElement(); // <cxxVariableNameLookup>
+
+ writeLocation(vn);
+ writer.writeEndElement(); // <cxxVariableDefinition>
+ writer.writeStartElement(APIDESC);
+
+ if (!vn->doc().isEmpty()) {
+ generateBody(vn, marker);
+ }
+
+ writer.writeEndElement(); // </apiDesc>
+ writer.writeEndElement(); // </cxxVariableDetail>
+ writer.writeEndElement(); // </cxxVariable>
+ }
+ ++m;
+ }
+}
+
+void DitaXmlGenerator::writeMacros(const Section& s,
+ const ClassNode* cn,
+ CodeMarker* marker)
+{
+ NodeList::ConstIterator m = s.members.begin();
+ while (m != s.members.end()) {
+ if ((*m)->type() == Node::Function) {
+ const FunctionNode* fn = static_cast<const FunctionNode*>(*m);
+ if (fn->isMacro()) {
+ writer.writeStartElement(CXXDEFINE);
+ writer.writeAttribute("id",fn->guid());
+ writer.writeStartElement(APINAME);
+ writer.writeCharacters(fn->name());
+ writer.writeEndElement(); // </apiName>
+ generateBrief(fn,marker);
+ writer.writeStartElement(CXXDEFINEDETAIL);
+ writer.writeStartElement(CXXDEFINEDEFINITION);
+ writer.writeStartElement(CXXDEFINEACCESSSPECIFIER);
+ writer.writeAttribute("value",fn->accessString());
+ writer.writeEndElement(); // <cxxDefineAccessSpecifier>
+
+ writer.writeStartElement(CXXDEFINEPROTOTYPE);
+ writer.writeCharacters("#define ");
+ writer.writeCharacters(fn->name());
+ if (fn->metaness() == FunctionNode::MacroWithParams) {
+ QStringList params = fn->parameterNames();
+ if (!params.isEmpty()) {
+ writer.writeCharacters("(");
+ for (int i = 0; i < params.size(); ++i) {
+ if (params[i].isEmpty())
+ writer.writeCharacters("...");
+ else
+ writer.writeCharacters(params[i]);
+ if ((i+1) < params.size())
+ writer.writeCharacters(", ");
+ }
+ writer.writeCharacters(")");
+ }
+ }
+ writer.writeEndElement(); // <cxxDefinePrototype>
+
+ writer.writeStartElement(CXXDEFINENAMELOOKUP);
+ writer.writeCharacters(fn->name());
+ writer.writeEndElement(); // <cxxDefineNameLookup>
+
+ if (fn->reimplementedFrom() != 0) {
+ FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom();
+ writer.writeStartElement(CXXDEFINEREIMPLEMENTED);
+ writer.writeAttribute("href",rfn->ditaXmlHref());
+ writer.writeCharacters(marker->plainFullName(rfn));
+ writer.writeEndElement(); // </cxxDefineReimplemented>
+ }
+
+ if (fn->metaness() == FunctionNode::MacroWithParams) {
+ QStringList params = fn->parameterNames();
+ if (!params.isEmpty()) {
+ writer.writeStartElement(CXXDEFINEPARAMETERS);
+ for (int i = 0; i < params.size(); ++i) {
+ writer.writeStartElement(CXXDEFINEPARAMETER);
+ writer.writeStartElement(CXXDEFINEPARAMETERDECLARATIONNAME);
+ writer.writeCharacters(params[i]);
+ writer.writeEndElement(); // <cxxDefineParameterDeclarationName>
+ writer.writeEndElement(); // <cxxDefineParameter>
+ }
+ writer.writeEndElement(); // <cxxDefineParameters>
+ }
+ }
+
+ writeLocation(fn);
+ writer.writeEndElement(); // <cxxDefineDefinition>
+ writer.writeStartElement(APIDESC);
+
+ if (!fn->doc().isEmpty()) {
+ generateBody(fn, marker);
+ }
+
+ writer.writeEndElement(); // </apiDesc>
+ writer.writeEndElement(); // </cxxDefineDetail>
+ writer.writeEndElement(); // </cxxDefine>
+ }
+ }
+ ++m;
+ }
+}
+
+void DitaXmlGenerator::writePropParams(const QString& tag, const NodeList& nlist)
+{
+ NodeList::const_iterator n = nlist.begin();
+ while (n != nlist.end()) {
+ writer.writeCharacters(" ");
+ writer.writeCharacters(tag);
+ writer.writeCharacters(" ");
+ writer.writeCharacters((*n)->name());
+ ++n;
+ }
+}
+
QT_END_NAMESPACE
diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h
index 8c7e439..446f735 100644
--- a/tools/qdoc3/ditaxmlgenerator.h
+++ b/tools/qdoc3/ditaxmlgenerator.h
@@ -118,9 +118,6 @@ class DitaXmlGenerator : public PageGenerator
const ClassNode* cn,
CodeMarker* marker);
void writeParameters(const FunctionNode* fn, CodeMarker* marker);
- void writeNestedClasses(const Section& s,
- const ClassNode* cn,
- CodeMarker* marker);
void writeEnumerations(const Section& s,
const ClassNode* cn,
CodeMarker* marker);
@@ -133,6 +130,10 @@ class DitaXmlGenerator : public PageGenerator
void writeProperties(const Section& s,
const ClassNode* cn,
CodeMarker* marker);
+ void writeMacros(const Section& s,
+ const ClassNode* cn,
+ CodeMarker* marker);
+ void writePropParams(const QString& tag, const NodeList& nlist);
private:
enum SubTitleSize { SmallSubTitle, LargeSubTitle };
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 339c390..b93db4f 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1891,6 +1891,16 @@ void HtmlGenerator::generateFooter(const Node *node)
else
{
out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+ out() << " <!-- <script type=\"text/javascript\">\n";
+ out() << " var _gaq = _gaq || [];\n";
+ out() << " _gaq.push(['_setAccount', 'UA-4457116-5']);\n";
+ out() << " _gaq.push(['_trackPageview']);\n";
+ out() << " (function() {\n";
+ out() << " var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n";
+ out() << " ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n";
+ out() << " var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n";
+ out() << " })();\n";
+ out() << " </script> -->\n";
out() << "</body>\n";
}
out() << "</html>\n";
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index 26957ac..b077074 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -923,6 +923,14 @@ FakeNode::FakeNode(InnerNode *parent, const QString& name, SubType subtype)
}
/*!
+ Returns the fake node's title. This is used for the page title.
+*/
+QString FakeNode::title() const
+{
+ return tle;
+}
+
+/*!
Returns the fake node's full title, which is usually
just title(), but for some SubType values is different
from title()
@@ -1287,21 +1295,39 @@ void FunctionNode::debug() const
/*!
\class PropertyNode
+
+ This class describes one instance of using the Q_PROPERTY macro.
*/
/*!
+ The constructor sets the \a parent and the \a name, but
+ everything else is set to default values.
*/
PropertyNode::PropertyNode(InnerNode *parent, const QString& name)
: LeafNode(Property, parent, name),
sto(Trool_Default),
des(Trool_Default),
+ scr(Trool_Default),
+ wri(Trool_Default),
+ usr(Trool_Default),
+ cst(false),
+ fnl(false),
overrides(0)
{
+ // nothing.
}
/*!
+ Sets this property's \e {overridden from} property to
+ \a baseProperty, which indicates that this property
+ overrides \a baseProperty. To begin with, all the values
+ in this property are set to the corresponding values in
+ \a baseProperty.
+
+ We probably should ensure that the constant and final
+ attributes are not being overridden improperly.
*/
-void PropertyNode::setOverriddenFrom(const PropertyNode *baseProperty)
+void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty)
{
for (int i = 0; i < NumFunctionRoles; ++i) {
if (funcs[i].isEmpty())
@@ -1311,6 +1337,12 @@ void PropertyNode::setOverriddenFrom(const PropertyNode *baseProperty)
sto = baseProperty->sto;
if (des == Trool_Default)
des = baseProperty->des;
+ if (scr == Trool_Default)
+ scr = baseProperty->scr;
+ if (wri == Trool_Default)
+ wri = baseProperty->wri;
+ if (usr == Trool_Default)
+ usr = baseProperty->usr;
overrides = baseProperty;
}
@@ -1336,7 +1368,9 @@ QString PropertyNode::qualifiedDataType() const
}
}
-/*!
+/*! Converts the \a boolean value to an enum representation
+ of the boolean type, which includes an enum value for the
+ \e {default value} of the item, i.e. true, false, or default.
*/
PropertyNode::Trool PropertyNode::toTrool(bool boolean)
{
@@ -1344,6 +1378,15 @@ PropertyNode::Trool PropertyNode::toTrool(bool boolean)
}
/*!
+ Converts the enum \a troolean back to a boolean value.
+ If \a troolean is neither the true enum value nor the
+ false enum value, the boolean value returned is
+ \a defaultValue.
+
+ Note that runtimeDesignabilityFunction() should be called
+ first. If that function returns the name of a function, it
+ means the function must be called at runtime to determine
+ whether the property is Designable.
*/
bool PropertyNode::fromTrool(Trool troolean, bool defaultValue)
{
@@ -1392,7 +1435,10 @@ QmlClassNode::QmlClassNode(InnerNode *parent,
const ClassNode* cn)
: FakeNode(parent, name, QmlClass), cnode(cn)
{
- setTitle((qmlOnly ? "" : "QML ") + name + " Element");
+ if (name.startsWith(QLatin1String("QML:")))
+ setTitle((qmlOnly ? QLatin1String("") : QLatin1String("QML ")) + name.mid(4) + QLatin1String(" Element"));
+ else
+ setTitle((qmlOnly ? QLatin1String("") : QLatin1String("QML ")) + name + QLatin1String(" Element"));
}
/*!
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index 37f2f26..e9f2d74 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -153,7 +153,7 @@ class Node
void setStatus(Status status) { sta = status; }
void setThreadSafeness(ThreadSafeness safeness) { saf = safeness; }
void setSince(const QString &since) { sinc = since; }
- void setRelates(InnerNode *pseudoParent);
+ void setRelates(InnerNode* pseudoParent);
void setModuleName(const QString &module) { mod = module; }
void setLink(LinkType linkType, const QString &link, const QString &desc);
void setUrl(const QString &url);
@@ -167,8 +167,8 @@ class Node
virtual bool isQmlNode() const { return false; }
Type type() const { return typ; }
virtual SubType subType() const { return NoSubType; }
- InnerNode *parent() const { return par; }
- InnerNode *relates() const { return rel; }
+ InnerNode* parent() const { return par; }
+ InnerNode* relates() const { return rel; }
const QString& name() const { return nam; }
QMap<LinkType, QPair<QString,QString> > links() const { return linkMap; }
QString moduleName() const;
@@ -195,7 +195,7 @@ class Node
QString ditaXmlHref();
protected:
- Node(Type type, InnerNode *parent, const QString& name);
+ Node(Type type, InnerNode* parent, const QString& name);
private:
@@ -212,8 +212,8 @@ class Node
PageType pageTyp : 4;
Status sta : 3;
#endif
- InnerNode *par;
- InnerNode *rel;
+ InnerNode* par;
+ InnerNode* rel;
QString nam;
Location loc;
Doc d;
@@ -228,35 +228,35 @@ class Node
class FunctionNode;
class EnumNode;
-typedef QList<Node *> NodeList;
+typedef QList<Node*> NodeList;
class InnerNode : public Node
{
public:
virtual ~InnerNode();
- Node *findNode(const QString& name);
- Node *findNode(const QString& name, Type type);
- FunctionNode *findFunctionNode(const QString& name);
- FunctionNode *findFunctionNode(const FunctionNode *clone);
+ Node* findNode(const QString& name);
+ Node* findNode(const QString& name, Type type);
+ FunctionNode* findFunctionNode(const QString& name);
+ FunctionNode* findFunctionNode(const FunctionNode* clone);
void addInclude(const QString &include);
void setIncludes(const QStringList &includes);
- void setOverload(const FunctionNode *func, bool overlode);
+ void setOverload(const FunctionNode* func, bool overlode);
void normalizeOverloads();
void makeUndocumentedChildrenInternal();
void deleteChildren();
void removeFromRelated();
virtual bool isInnerNode() const;
- const Node *findNode(const QString& name) const;
- const Node *findNode(const QString& name, Type type) const;
- const FunctionNode *findFunctionNode(const QString& name) const;
- const FunctionNode *findFunctionNode(const FunctionNode *clone) const;
- const EnumNode *findEnumNodeForValue(const QString &enumValue) const;
+ const Node* findNode(const QString& name) const;
+ const Node* findNode(const QString& name, Type type) const;
+ const FunctionNode* findFunctionNode(const QString& name) const;
+ const FunctionNode* findFunctionNode(const FunctionNode* clone) const;
+ const EnumNode* findEnumNodeForValue(const QString &enumValue) const;
const NodeList & childNodes() const { return children; }
const NodeList & relatedNodes() const { return related; }
int count() const { return children.size(); }
- int overloadNumber(const FunctionNode *func) const;
+ int overloadNumber(const FunctionNode* func) const;
int numOverloads(const QString& funcName) const;
NodeList overloads(const QString &funcName) const;
const QStringList& includes() const { return inc; }
@@ -269,23 +269,23 @@ class InnerNode : public Node
virtual void setAbstract(bool ) { }
protected:
- InnerNode(Type type, InnerNode *parent, const QString& name);
+ InnerNode(Type type, InnerNode* parent, const QString& name);
private:
friend class Node;
- static bool isSameSignature(const FunctionNode *f1, const FunctionNode *f2);
- void addChild(Node *child);
- void removeChild(Node *child);
- void removeRelated(Node *pseudoChild);
+ static bool isSameSignature(const FunctionNode* f1, const FunctionNode* f2);
+ void addChild(Node* child);
+ void removeChild(Node* child);
+ void removeRelated(Node* pseudoChild);
QStringList pageKeywds;
QStringList inc;
NodeList children;
NodeList enumChildren;
NodeList related;
- QMap<QString, Node *> childMap;
- QMap<QString, Node *> primaryFunctionMap;
+ QMap<QString, Node*> childMap;
+ QMap<QString, Node*> primaryFunctionMap;
QMap<QString, NodeList> secondaryFunctionMap;
};
@@ -304,7 +304,7 @@ class LeafNode : public Node
class NamespaceNode : public InnerNode
{
public:
- NamespaceNode(InnerNode *parent, const QString& name);
+ NamespaceNode(InnerNode* parent, const QString& name);
virtual ~NamespaceNode() { }
};
@@ -329,11 +329,11 @@ struct RelatedClass
class ClassNode : public InnerNode
{
public:
- ClassNode(InnerNode *parent, const QString& name);
+ ClassNode(InnerNode* parent, const QString& name);
virtual ~ClassNode() { }
void addBaseClass(Access access,
- ClassNode *node,
+ ClassNode* node,
const QString &dataTypeWithTemplateArgs = "");
void fixBaseClasses();
@@ -363,17 +363,17 @@ class FakeNode : public InnerNode
{
public:
- FakeNode(InnerNode *parent, const QString& name, SubType subType);
+ FakeNode(InnerNode* parent, const QString& name, SubType subType);
virtual ~FakeNode() { }
void setTitle(const QString &title) { tle = title; }
void setSubTitle(const QString &subTitle) { stle = subTitle; }
- void addGroupMember(Node *node) { gr.append(node); }
+ void addGroupMember(Node* node) { gr.append(node); }
SubType subType() const { return sub; }
- QString title() const { return tle; }
- QString fullTitle() const;
- QString subTitle() const;
+ virtual QString title() const;
+ virtual QString fullTitle() const;
+ virtual QString subTitle() const;
const NodeList &groupMembers() const { return gr; }
virtual QString nameForLists() const { return title(); }
@@ -388,7 +388,7 @@ class FakeNode : public InnerNode
class QmlClassNode : public FakeNode
{
public:
- QmlClassNode(InnerNode *parent,
+ QmlClassNode(InnerNode* parent,
const QString& name,
const ClassNode* cn);
virtual ~QmlClassNode();
@@ -411,7 +411,7 @@ class QmlClassNode : public FakeNode
class QmlBasicTypeNode : public FakeNode
{
public:
- QmlBasicTypeNode(InnerNode *parent,
+ QmlBasicTypeNode(InnerNode* parent,
const QString& name);
virtual ~QmlBasicTypeNode() { }
virtual bool isQmlNode() const { return true; }
@@ -498,41 +498,41 @@ class TypedefNode;
class EnumNode : public LeafNode
{
public:
- EnumNode(InnerNode *parent, const QString& name);
+ EnumNode(InnerNode* parent, const QString& name);
virtual ~EnumNode() { }
void addItem(const EnumItem& item);
- void setFlagsType(TypedefNode *typedeff);
+ void setFlagsType(TypedefNode* typedeff);
bool hasItem(const QString &name) const { return names.contains(name); }
const QList<EnumItem>& items() const { return itms; }
Access itemAccess(const QString& name) const;
- const TypedefNode *flagsType() const { return ft; }
+ const TypedefNode* flagsType() const { return ft; }
QString itemValue(const QString &name) const;
private:
QList<EnumItem> itms;
QSet<QString> names;
- const TypedefNode *ft;
+ const TypedefNode* ft;
};
class TypedefNode : public LeafNode
{
public:
- TypedefNode(InnerNode *parent, const QString& name);
+ TypedefNode(InnerNode* parent, const QString& name);
virtual ~TypedefNode() { }
- const EnumNode *associatedEnum() const { return ae; }
+ const EnumNode* associatedEnum() const { return ae; }
private:
- void setAssociatedEnum(const EnumNode *enume);
+ void setAssociatedEnum(const EnumNode* enume);
friend class EnumNode;
- const EnumNode *ae;
+ const EnumNode* ae;
};
-inline void EnumNode::setFlagsType(TypedefNode *typedeff)
+inline void EnumNode::setFlagsType(TypedefNode* typedeff)
{
ft = typedeff;
typedeff->setAssociatedEnum(this);
@@ -584,8 +584,8 @@ class FunctionNode : public LeafNode
Native };
enum Virtualness { NonVirtual, ImpureVirtual, PureVirtual };
- FunctionNode(InnerNode *parent, const QString &name);
- FunctionNode(Type type, InnerNode *parent, const QString &name, bool attached);
+ FunctionNode(InnerNode* parent, const QString &name);
+ FunctionNode(Type type, InnerNode* parent, const QString &name, bool attached);
virtual ~FunctionNode() { }
void setReturnType(const QString& returnType) { rt = returnType; }
@@ -598,8 +598,8 @@ class FunctionNode : public LeafNode
void setReimp(bool r);
void addParameter(const Parameter& parameter);
inline void setParameters(const QList<Parameter>& parameters);
- void borrowParameterNames(const FunctionNode *source);
- void setReimplementedFrom(FunctionNode *from);
+ void borrowParameterNames(const FunctionNode* source);
+ void setReimplementedFrom(FunctionNode* from);
const QString& returnType() const { return rt; }
Metaness metaness() const { return met; }
@@ -616,9 +616,9 @@ class FunctionNode : public LeafNode
int numOverloads() const;
const QList<Parameter>& parameters() const { return params; }
QStringList parameterNames() const;
- const FunctionNode *reimplementedFrom() const { return rf; }
- const QList<FunctionNode *> &reimplementedBy() const { return rb; }
- const PropertyNode *associatedProperty() const { return ap; }
+ const FunctionNode* reimplementedFrom() const { return rf; }
+ const QList<FunctionNode*> &reimplementedBy() const { return rb; }
+ const PropertyNode* associatedProperty() const { return ap; }
const QStringList& parentPath() const { return pp; }
QStringList reconstructParams(bool values = false) const;
@@ -632,7 +632,7 @@ class FunctionNode : public LeafNode
void debug() const;
private:
- void setAssociatedProperty(PropertyNode *property);
+ void setAssociatedProperty(PropertyNode* property);
friend class InnerNode;
friend class PropertyNode;
@@ -652,9 +652,9 @@ class FunctionNode : public LeafNode
bool reimp: 1;
bool att: 1;
QList<Parameter> params;
- const FunctionNode *rf;
- const PropertyNode *ap;
- QList<FunctionNode *> rb;
+ const FunctionNode* rf;
+ const PropertyNode* ap;
+ QList<FunctionNode*> rb;
};
class PropertyNode : public LeafNode
@@ -663,16 +663,22 @@ class PropertyNode : public LeafNode
enum FunctionRole { Getter, Setter, Resetter, Notifier };
enum { NumFunctionRoles = Notifier + 1 };
- PropertyNode(InnerNode *parent, const QString& name);
+ PropertyNode(InnerNode* parent, const QString& name);
virtual ~PropertyNode() { }
void setDataType(const QString& dataType) { dt = dataType; }
- void addFunction(FunctionNode *function, FunctionRole role);
- void addSignal(FunctionNode *function, FunctionRole role);
+ void addFunction(FunctionNode* function, FunctionRole role);
+ void addSignal(FunctionNode* function, FunctionRole role);
void setStored(bool stored) { sto = toTrool(stored); }
void setDesignable(bool designable) { des = toTrool(designable); }
+ void setScriptable(bool scriptable) { scr = toTrool(scriptable); }
void setWritable(bool writable) { wri = toTrool(writable); }
- void setOverriddenFrom(const PropertyNode *baseProperty);
+ void setUser(bool user) { usr = toTrool(user); }
+ void setOverriddenFrom(const PropertyNode* baseProperty);
+ void setRuntimeDesFunc(const QString& rdf) { runtimeDesFunc = rdf; }
+ void setRuntimeScrFunc(const QString& scrf) { runtimeScrFunc = scrf; }
+ void setConstant() { cst = true; }
+ void setFinal() { fnl = true; }
const QString &dataType() const { return dt; }
QString qualifiedDataType() const;
@@ -684,8 +690,20 @@ class PropertyNode : public LeafNode
NodeList notifiers() const { return functions(Notifier); }
bool isStored() const { return fromTrool(sto, storedDefault()); }
bool isDesignable() const { return fromTrool(des, designableDefault()); }
+ bool isScriptable() const { return fromTrool(scr, scriptableDefault()); }
+ const QString& runtimeDesignabilityFunction() const { return runtimeDesFunc; }
+ const QString& runtimeScriptabilityFunction() const { return runtimeScrFunc; }
bool isWritable() const { return fromTrool(wri, writableDefault()); }
- const PropertyNode *overriddenFrom() const { return overrides; }
+ bool isUser() const { return fromTrool(usr, userDefault()); }
+ bool isConstant() const { return cst; }
+ bool isFinal() const { return fnl; }
+ const PropertyNode* overriddenFrom() const { return overrides; }
+
+ bool storedDefault() const { return true; }
+ bool userDefault() const { return false; }
+ bool designableDefault() const { return !setters().isEmpty(); }
+ bool scriptableDefault() const { return true; }
+ bool writableDefault() const { return !setters().isEmpty(); }
private:
enum Trool { Trool_True, Trool_False, Trool_Default };
@@ -693,16 +711,18 @@ class PropertyNode : public LeafNode
static Trool toTrool(bool boolean);
static bool fromTrool(Trool troolean, bool defaultValue);
- bool storedDefault() const { return true; }
- bool designableDefault() const { return !setters().isEmpty(); }
- bool writableDefault() const { return !setters().isEmpty(); }
-
QString dt;
+ QString runtimeDesFunc;
+ QString runtimeScrFunc;
NodeList funcs[NumFunctionRoles];
Trool sto;
Trool des;
+ Trool scr;
Trool wri;
- const PropertyNode *overrides;
+ Trool usr;
+ bool cst;
+ bool fnl;
+ const PropertyNode* overrides;
};
inline void FunctionNode::setParameters(const QList<Parameter> &parameters)
@@ -710,13 +730,13 @@ inline void FunctionNode::setParameters(const QList<Parameter> &parameters)
params = parameters;
}
-inline void PropertyNode::addFunction(FunctionNode *function, FunctionRole role)
+inline void PropertyNode::addFunction(FunctionNode* function, FunctionRole role)
{
funcs[(int)role].append(function);
function->setAssociatedProperty(this);
}
-inline void PropertyNode::addSignal(FunctionNode *function, FunctionRole role)
+inline void PropertyNode::addSignal(FunctionNode* function, FunctionRole role)
{
funcs[(int)role].append(function);
}
@@ -732,7 +752,7 @@ inline NodeList PropertyNode::functions() const
class VariableNode : public LeafNode
{
public:
- VariableNode(InnerNode *parent, const QString &name);
+ VariableNode(InnerNode* parent, const QString &name);
virtual ~VariableNode() { }
void setLeftType(const QString &leftType) { lt = leftType; }
@@ -750,15 +770,16 @@ class VariableNode : public LeafNode
bool sta;
};
-inline VariableNode::VariableNode(InnerNode *parent, const QString &name)
+inline VariableNode::VariableNode(InnerNode* parent, const QString &name)
: LeafNode(Variable, parent, name), sta(false)
{
+ // nothing.
}
class TargetNode : public LeafNode
{
public:
- TargetNode(InnerNode *parent, const QString& name);
+ TargetNode(InnerNode* parent, const QString& name);
virtual ~TargetNode() { }
virtual bool isInnerNode() const;
diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp
index cd364ef..a187c2e 100644
--- a/tools/qdoc3/pagegenerator.cpp
+++ b/tools/qdoc3/pagegenerator.cpp
@@ -209,7 +209,8 @@ QString PageGenerator::fileBase(const Node *node) const
*/
if ((p->subType() == Node::QmlClass) ||
(p->subType() == Node::QmlBasicType)) {
- base.prepend("qml-");
+ if (!base.startsWith(QLatin1String("QML:")))
+ base.prepend("qml-");
}
#endif
if (!pp || pp->name().isEmpty() || pp->type() == Node::Fake)
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index 09cbc45..140b81f 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -22,43 +22,43 @@ qhp.Qt.indexTitle = Qt Reference Documentation
# Files not referenced in any qdoc file (last four are needed by qtdemo)
# See also extraimages.HTML
qhp.Qt.extraFiles = index.html \
- images/bg_l.png \
- images/bg_l_blank.png \
- images/bg_r.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_gt.png \
- images/bullet_dn.png \
- images/bullet_sq.png \
- images/bullet_up.png \
- images/feedbackground.png \
- images/horBar.png \
- images/page.png \
- images/page_bg.png \
- images/sprites-combined.png \
- images/arrow-down.png \
- images/spinner.gif \
- images/stylesheet-coffee-plastique.png \
- images/taskmenuextension-example.png \
- images/coloreditorfactoryimage.png \
- images/dynamiclayouts-example.png \
- scripts/functions.js \
- scripts/jquery.js \
- scripts/shBrushCpp.js \
- scripts/shCore.js \
- scripts/shLegacy.js \
- scripts/narrow.js \
- scripts/superfish.js \
- style/shCore.css \
- style/shThemeDefault.css \
- style/narrow.css \
- style/superfish.css \
- style/superfish_skin.css \
- style/OfflineStyle.css \
- style/style_ie6.css \
- style/style_ie7.css \
- style/style_ie8.css \
- style/style.css
+ images/bg_l.png \
+ images/bg_l_blank.png \
+ images/bg_r.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
+ images/bullet_dn.png \
+ images/bullet_sq.png \
+ images/bullet_up.png \
+ images/feedbackground.png \
+ images/horBar.png \
+ images/page.png \
+ images/page_bg.png \
+ images/sprites-combined.png \
+ images/arrow-down.png \
+ images/spinner.gif \
+ images/stylesheet-coffee-plastique.png \
+ images/taskmenuextension-example.png \
+ images/coloreditorfactoryimage.png \
+ images/dynamiclayouts-example.png \
+ scripts/functions.js \
+ scripts/jquery.js \
+ scripts/shBrushCpp.js \
+ scripts/shCore.js \
+ scripts/shLegacy.js \
+ scripts/narrow.js \
+ scripts/superfish.js \
+ style/shCore.css \
+ style/shThemeDefault.css \
+ style/narrow.css \
+ style/superfish.css \
+ style/superfish_skin.css \
+ style/OfflineStyle.css \
+ style/style_ie6.css \
+ style/style_ie7.css \
+ style/style_ie8.css \
+ style/style.css
@@ -141,7 +141,7 @@ exampledirs = $QT_SOURCE_TREE/doc/src \
imagedirs = $QT_SOURCE_TREE/doc/src/images \
$QT_SOURCE_TREE/examples \
$QT_SOURCE_TREE/doc/src/declarative/pics \
- $QT_SOURCE_TREE/doc/src/template/images
+ $QT_SOURCE_TREE/doc/src/template/images
outputdir = $QT_BUILD_TREE/doc/html
tagfile = $QT_BUILD_TREE/doc/html/qt.tags
base = file:$QT_BUILD_TREE/doc/html
diff --git a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf
index e517b33..7701cae 100644
--- a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf
@@ -30,33 +30,43 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0
# Files not referenced in any qdoc file (last four are needed by qtdemo)
# See also extraimages.HTML
qhp.Qt.extraFiles = index.html \
- images/bg_l.png \
- images/bg_l_blank.png \
- images/bg_r.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_gt.png \
- images/bullet_dn.png \
- images/bullet_sq.png \
- images/bullet_up.png \
- images/feedbackground.png \
- images/horBar.png \
- images/page.png \
- images/page_bg.png \
- images/sprites-combined.png \
- images/arrow-down.png \
- images/spinner.gif \
- images/stylesheet-coffee-plastique.png \
- images/taskmenuextension-example.png \
- images/coloreditorfactoryimage.png \
- images/dynamiclayouts-example.png \
- scripts/functions.js \
- scripts/jquery.js \
- style/OfflineStyle.css \
- style/style_ie6.css \
- style/style_ie7.css \
- style/style_ie8.css \
- style/style.css
+ images/bg_l.png \
+ images/bg_l_blank.png \
+ images/bg_r.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
+ images/bullet_dn.png \
+ images/bullet_sq.png \
+ images/bullet_up.png \
+ images/feedbackground.png \
+ images/horBar.png \
+ images/page.png \
+ images/page_bg.png \
+ images/sprites-combined.png \
+ images/arrow-down.png \
+ images/spinner.gif \
+ images/stylesheet-coffee-plastique.png \
+ images/taskmenuextension-example.png \
+ images/coloreditorfactoryimage.png \
+ images/dynamiclayouts-example.png \
+ scripts/functions.js \
+ scripts/jquery.js \
+ scripts/shBrushCpp.js \
+ scripts/shCore.js \
+ scripts/shLegacy.js \
+ scripts/narrow.js \
+ scripts/superfish.js \
+ style/shCore.css \
+ style/shThemeDefault.css \
+ style/narrow.css \
+ style/superfish.css \
+ style/superfish_skin.css \
+ style/OfflineStyle.css \
+ style/style_ie6.css \
+ style/style_ie7.css \
+ style/style_ie8.css \
+ style/style.css
language = Cpp
@@ -102,7 +112,8 @@ exampledirs = $QT_SOURCE_TREE/doc/src \
imagedirs = $QT_SOURCE_TREE/doc/src/ja_JP/images \
$QT_SOURCE_TREE/doc/src/images \
$QT_SOURCE_TREE/examples \
- $QT_SOURCE_TREE/doc/src/template/images
+ $QT_SOURCE_TREE/doc/src/declarative/pics \
+ $QT_SOURCE_TREE/doc/src/template/images
outputdir = $QT_BUILD_TREE/doc/html_ja_JP
tagfile = $QT_BUILD_TREE/doc/html_ja_JP/qt.tags
base = file:$QT_BUILD_TREE/doc/html_ja_JP
diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
index 909a2d4..be459d8 100644
--- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
@@ -52,6 +52,17 @@ qhp.Qt.extraFiles = index.html \
images/dynamiclayouts-example.png \
scripts/functions.js \
scripts/jquery.js \
+ scripts/shBrushCpp.js \
+ scripts/shCore.js \
+ scripts/shLegacy.js \
+ scripts/narrow.js \
+ scripts/superfish.js \
+ style/shCore.css \
+ style/shThemeDefault.css \
+ style/narrow.css \
+ style/superfish.css \
+ style/superfish_skin.css \
+ style/OfflineStyle.css \
style/style_ie6.css \
style/style_ie7.css \
style/style_ie8.css \
@@ -99,7 +110,8 @@ exampledirs = $QT_SOURCE_TREE/doc/src \
$QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs
imagedirs = $QT_SOURCE_TREE/doc/src/images \
$QT_SOURCE_TREE/examples \
- $QT_SOURCE_TREE/doc/src/template/images
+ $QT_SOURCE_TREE/doc/src/declarative/pics \
+ $QT_SOURCE_TREE/doc/src/template/images
outputdir = $QT_BUILD_TREE/doc/html_zh_CN
tagfile = $QT_BUILD_TREE/doc/html_zh_CN/qt.tags
base = file:$QT_BUILD_TREE/doc/html_zh_CN
diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index 8708f1b..b82e337 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -11,7 +11,7 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \
" <a href=\"index.html\" class=\"qtref\"><span>Qt Reference Documentation</span></a>\n" \
" <div id=\"narrowsearch\"><form onsubmit=\"return false;\" action=\"\" id=\"qtdocsearch\">\n" \
" <fieldset>\n" \
- " <input type=\"text\" value=\"\" id=\"pageType\" name=\"searchstring\">\n" \
+ " <input type=\"text\" value=\"\" id=\"pageType2\" name=\"searchstring\">\n" \
" </fieldset>\n" \
" </form></div>\n" \
" <div id=\"nav-topright\">\n" \
@@ -160,7 +160,9 @@ HTML.footer = " <!-- /div -->\n" \
" <div id=\"feedbackBox\">\n" \
" <div id=\"feedcloseX\" class=\"feedclose t_button\">X</div>\n" \
" <form id=\"feedform\" action=\"http://doc.qt.nokia.com/docFeedbck/feedback.php\" method=\"get\">\n" \
- " <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\">Please submit your feedback...</textarea></p>\n" \
+ " <p>Thank you for giving your feedback. <div class=\"note\">Make sure it is related the page. For more general bugs and \n" \
+ " requests, please use the <a href=\"http://bugreports.qt.nokia.com/secure/Dashboard.jspa\">Qt Bug Tracker</a></div></p>\n" \
+ " <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\"></textarea></p>\n" \
" <p><input id=\"feedsubmit\" class=\"feedclose\" type=\"submit\" name=\"feedback\" /></p>\n" \
" </form>\n" \
" </div>\n" \
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index 31bbf54..d31de4d 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -1952,9 +1952,13 @@ QString Tree::fullDocumentLocation(const Node *node) const
else if (node->type() == Node::Fake) {
#ifdef QDOC_QML
if ((node->subType() == Node::QmlClass) ||
- (node->subType() == Node::QmlBasicType))
- return "qml-" + node->fileBase() + ".html";
- else
+ (node->subType() == Node::QmlBasicType)) {
+ QString fb = node->fileBase();
+ if (fb.startsWith(QLatin1String("QML:")))
+ return node->fileBase() + ".html";
+ else
+ return "qml-" + node->fileBase() + ".html";
+ } else
#endif
parentName = node->fileBase() + ".html";
}