summaryrefslogtreecommitdiffstats
path: root/src/H5Rpkg.h
Commit message (Expand)AuthorAgeFilesLines
* Update copyright headers (#2184)Larry Knox2022-11-011-1/+0
* Develop clang 13 format (#1933)Allen Byrne2022-07-261-3/+3
* Assume C99 fixed sized ints exist, use them (#470)Sean McBride2021-11-081-1/+1
* Fixed many -Wreserved-id-macro warnings by fixing header guard spelling (#361)Sean McBride2021-02-231-3/+3
* Update license url (#332)Larry Knox2021-02-171-1/+1
* Clang-format of source filesAllen Byrne2020-09-301-47/+52
* Clean up private / package / static namespace issues (function naming, whichQuincey Koziol2020-08-061-4/+0
* Squashed commit of the token_refactoring branch:Dana Robinson2020-01-161-14/+14
* H5R: set app ref when incrementing ref_count on location held by referenceJerome Soumagne2020-01-101-2/+2
* Remove H5VL_NATIVE_FILE_GET_FILE_ID and add H5VL_OBJECT_GET_FILEJerome Soumagne2019-11-271-1/+1
* Fix encode and decode of tokens in H5VLnativeJerome Soumagne2019-10-111-5/+5
* Add new H5R API that abstracts object, region and attribute reference typesJerome Soumagne2019-10-081-5/+75
* VOL FEATUREDana Robinson2018-10-101-1/+1
* Normalization with vol_integration (misc internal and datatype)Dana Robinson2018-09-201-8/+4
* Normalize with vol_integration.Dana Robinson2018-05-291-0/+5
* Add API context interface and use it throughout the library.Quincey Koziol2018-03-151-0/+9
* Split internal H5R functionality into H5Rint.c.Dana Robinson2017-11-081-13/+1
* Merge pull request #426 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:hdf5_1_10 to hdf5...Larry Knox2017-04-251-6/+4
* [svn-r27768] Description:Quincey Koziol2015-09-141-3/+1
* [svn-r24998] Description:Quincey Koziol2014-04-091-0/+1
* [svn-r21117] Issue 2763 - I added a new parameter of object access property l...Raymond Lu2011-07-181-0/+2
* [svn-r14148] Description:Quincey Koziol2007-09-141-0/+63
e18b7da2ec6c177b'>demos/embedded/anomaly/src/ControlStrip.cpp83
-rw-r--r--demos/embedded/anomaly/src/ControlStrip.h54
-rw-r--r--demos/embedded/anomaly/src/HomeView.cpp58
-rw-r--r--demos/embedded/anomaly/src/HomeView.h56
-rw-r--r--demos/embedded/anomaly/src/Main.cpp59
-rw-r--r--demos/embedded/anomaly/src/TitleBar.cpp106
-rw-r--r--demos/embedded/anomaly/src/TitleBar.h52
-rw-r--r--demos/embedded/anomaly/src/ZoomStrip.cpp64
-rw-r--r--demos/embedded/anomaly/src/ZoomStrip.h52
-rw-r--r--demos/embedded/anomaly/src/anomaly.qrc9
-rw-r--r--demos/embedded/anomaly/src/flickcharm.cpp309
-rw-r--r--demos/embedded/anomaly/src/flickcharm.h49
-rw-r--r--demos/embedded/anomaly/src/images/edit-find.pngbin0 -> 1636 bytes-rw-r--r--demos/embedded/anomaly/src/images/go-next.pngbin0 -> 1219 bytes-rw-r--r--demos/embedded/anomaly/src/images/go-previous.pngbin0 -> 1200 bytes-rw-r--r--demos/embedded/anomaly/src/images/list-add.pngbin0 -> 601 bytes-rw-r--r--demos/embedded/anomaly/src/images/list-remove.pngbin0 -> 317 bytes-rw-r--r--demos/embedded/desktopservices/contenttab.cpp154
-rw-r--r--demos/embedded/desktopservices/contenttab.h101
-rw-r--r--demos/embedded/desktopservices/data/Explosion.wavbin0 -> 18427 bytes-rw-r--r--demos/embedded/desktopservices/data/designer.pngbin0 -> 4205 bytes-rw-r--r--demos/embedded/desktopservices/data/monkey_on_64x64.pngbin0 -> 3479 bytes-rw-r--r--demos/embedded/desktopservices/data/sax.mp3bin0 -> 417844 bytes-rw-r--r--demos/embedded/desktopservices/desktopservices.pro23
-rw-r--r--demos/embedded/desktopservices/desktopservices.qrc8
-rw-r--r--demos/embedded/desktopservices/desktopwidget.cpp90
-rw-r--r--demos/embedded/desktopservices/desktopwidget.h73
-rw-r--r--demos/embedded/desktopservices/linktab.cpp88
-rw-r--r--demos/embedded/desktopservices/linktab.h86
-rw-r--r--demos/embedded/desktopservices/main.cpp56
-rw-r--r--demos/embedded/desktopservices/resources/browser.pngbin0 -> 2739 bytes-rw-r--r--demos/embedded/desktopservices/resources/heart.svg55
-rw-r--r--demos/embedded/desktopservices/resources/message.pngbin0 -> 2234 bytes-rw-r--r--demos/embedded/desktopservices/resources/music.pngbin0 -> 2322 bytes-rw-r--r--demos/embedded/desktopservices/resources/photo.pngbin0 -> 2430 bytes-rw-r--r--demos/embedded/embedded.pro9
-rw-r--r--demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro7
-rw-r--r--demos/embedded/fluidlauncher/config_s60/config.xml21
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.cpp126
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.h4
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.pro92
-rw-r--r--demos/embedded/fluidlauncher/pictureflow.cpp24
-rw-r--r--demos/embedded/fluidlauncher/screenshots/anomaly_s60.pngbin0 -> 47478 bytes-rw-r--r--demos/embedded/fluidlauncher/screenshots/context2d_s60.pngbin0 -> 49182 bytes-rw-r--r--demos/embedded/fluidlauncher/screenshots/desktopservices_s60.pngbin0 -> 38216 bytes-rw-r--r--demos/embedded/fluidlauncher/screenshots/drilldown_s60.pngbin0 -> 60089 bytes-rw-r--r--demos/embedded/fluidlauncher/screenshots/embeddedsvgviewer_s60.pngbin0 -> 42764 bytes-rw-r--r--demos/embedded/fluidlauncher/screenshots/fridgemagnets_s60.pngbin0 -> 45318 bytes-rw-r--r--demos/embedded/fluidlauncher/screenshots/ftp_s60.pngbin0 -> 38370 bytes-rw-r--r--demos/embedded/fluidlauncher/screenshots/saxbookmarks_s60.pngbin0 -> 56905 bytes-rw-r--r--demos/embedded/fluidlauncher/screenshots/softkeys_s60.pngbin0 -> 40149 bytes-rw-r--r--demos/embedded/fluidlauncher/screenshots/styledemo_s60.pngbin0 -> 63062 bytes-rw-r--r--demos/embedded/fluidlauncher/screenshots/wiggly_s60.pngbin0 -> 7950 bytes-rw-r--r--demos/embedded/styledemo/files/application.qss2
-rw-r--r--demos/embedded/styledemo/files/blue.qss3
-rw-r--r--demos/embedded/styledemo/files/khaki.qss3
-rw-r--r--demos/embedded/styledemo/files/transparent.qss1
-rw-r--r--demos/embedded/styledemo/styledemo.pro4
-rw-r--r--demos/embedded/styledemo/stylewidget.ui64
-rw-r--r--demos/embeddeddialogs/embeddeddialogs.pro2
-rw-r--r--demos/gradients/gradients.pro2
-rw-r--r--demos/interview/interview.pro2
-rw-r--r--demos/macmainwindow/macmainwindow.pro2
-rw-r--r--demos/mainwindow/mainwindow.pro2
-rw-r--r--demos/mediaplayer/mediaplayer.pro2
-rw-r--r--demos/pathstroke/pathstroke.pro3
-rw-r--r--demos/qtdemo/qtdemo.pro2
-rw-r--r--demos/shared/shared.pri3
-rw-r--r--demos/shared/shared.pro3
-rw-r--r--demos/spreadsheet/spreadsheet.pro2
-rw-r--r--demos/sqlbrowser/sqlbrowser.pro2
-rw-r--r--demos/textedit/textedit.cpp6
-rw-r--r--demos/textedit/textedit.pro2
-rw-r--r--demos/undo/undo.pro2
-rw-r--r--dist/changes-4.4.4-temple65
-rw-r--r--dist/changes-4.5.0-garden241
-rw-r--r--dist/changes-4.5.2-tower436
-rw-r--r--doc/src/appicon.qdoc15
-rw-r--r--doc/src/emb-install.qdoc4
-rw-r--r--doc/src/examples.qdoc1
-rw-r--r--doc/src/examples/htmlinfo.qdoc89
-rw-r--r--doc/src/exceptionsafety.qdoc144
-rw-r--r--doc/src/installation.qdoc177
-rw-r--r--doc/src/platform-notes.qdoc13
-rw-r--r--doc/src/plugins-howto.qdoc14
-rw-r--r--doc/src/qmake-manual.qdoc436
-rw-r--r--doc/src/qnamespace.qdoc38
-rw-r--r--doc/src/s60-introduction.qdoc117
-rw-r--r--doc/src/snippets/code/doc_src_appicon.qdoc4
-rw-r--r--doc/src/snippets/code/doc_src_installation.qdoc38
-rw-r--r--doc/src/snippets/code/doc_src_qmake-manual.qdoc119
-rw-r--r--doc/src/snippets/code/doc_src_s60-introduction.qdoc16
-rw-r--r--doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp82
-rw-r--r--doc/src/symbian-exceptionsafety.qdoc183
-rw-r--r--doc/src/topics.qdoc15
-rw-r--r--examples/activeqt/activeqt.pro2
-rw-r--r--examples/activeqt/comapp/comapp.pro2
-rw-r--r--examples/activeqt/hierarchy/hierarchy.pro2
-rw-r--r--examples/activeqt/menus/menus.pro2
-rw-r--r--examples/activeqt/multiple/multiple.pro2
-rw-r--r--examples/activeqt/opengl/opengl.pro2
-rw-r--r--examples/activeqt/qutlook/qutlook.pro2
-rw-r--r--examples/activeqt/simple/simple.pro2
-rw-r--r--examples/activeqt/webbrowser/webbrowser.pro2
-rw-r--r--examples/activeqt/wrapper/wrapper.pro2
-rw-r--r--examples/assistant/assistant.pro2
-rw-r--r--examples/assistant/simpletextviewer/simpletextviewer.pro2
-rw-r--r--examples/dbus/complexpingpong/complexping.pro2
-rw-r--r--examples/dbus/complexpingpong/complexpong.pro2
-rw-r--r--examples/dbus/dbus-chat/dbus-chat.pro2
-rw-r--r--examples/dbus/dbus.pro2
-rw-r--r--examples/dbus/listnames/listnames.pro2
-rw-r--r--examples/dbus/pingpong/ping.pro2
-rw-r--r--examples/dbus/pingpong/pong.pro2
-rw-r--r--examples/dbus/remotecontrolledcar/car/car.pro2
-rw-r--r--examples/dbus/remotecontrolledcar/controller/controller.pro2
-rw-r--r--examples/dbus/remotecontrolledcar/remotecontrolledcar.pro2
-rw-r--r--examples/designer/calculatorbuilder/calculatorbuilder.pro2
-rw-r--r--examples/designer/calculatorform/calculatorform.pro2
-rw-r--r--examples/designer/containerextension/containerextension.pro2
-rw-r--r--examples/designer/customwidgetplugin/customwidgetplugin.pro2
-rw-r--r--examples/designer/designer.pro2
-rw-r--r--examples/designer/taskmenuextension/taskmenuextension.pro2
-rw-r--r--examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro2
-rw-r--r--examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro2
-rw-r--r--examples/desktop/desktop.pro4
-rw-r--r--examples/desktop/screenshot/screenshot.pro2
-rw-r--r--examples/desktop/systray/systray.pro2
-rw-r--r--examples/dialogs/classwizard/classwizard.pro2
-rw-r--r--examples/dialogs/configdialog/configdialog.pro2
-rw-r--r--examples/dialogs/dialogs.pro4
-rw-r--r--examples/dialogs/extension/extension.pro2
-rw-r--r--examples/dialogs/findfiles/findfiles.pro2
-rw-r--r--examples/dialogs/licensewizard/licensewizard.pro2
-rw-r--r--examples/dialogs/sipdialog/sipdialog.pro2
-rw-r--r--examples/dialogs/standarddialogs/standarddialogs.pro2
-rw-r--r--examples/dialogs/tabdialog/tabdialog.pro2
-rw-r--r--examples/dialogs/trivialwizard/trivialwizard.pro2
-rw-r--r--examples/draganddrop/delayedencoding/delayedencoding.pro2
-rw-r--r--examples/draganddrop/draganddrop.pro2
-rw-r--r--examples/draganddrop/draggableicons/draggableicons.pro4
-rw-r--r--examples/draganddrop/draggabletext/draggabletext.pro4
-rw-r--r--examples/draganddrop/dropsite/dropsite.pro2
-rw-r--r--examples/draganddrop/fridgemagnets/dragwidget.cpp3
-rw-r--r--examples/draganddrop/fridgemagnets/fridgemagnets.pro3
-rw-r--r--examples/draganddrop/fridgemagnets/main.cpp9
-rw-r--r--examples/draganddrop/puzzle/puzzle.pro8
-rw-r--r--examples/examplebase.pri1
-rw-r--r--examples/examples.pro16
-rw-r--r--examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro4
-rw-r--r--examples/graphicsview/collidingmice/collidingmice.pro4
-rw-r--r--examples/graphicsview/diagramscene/diagramscene.pro2
-rw-r--r--examples/graphicsview/dragdroprobot/dragdroprobot.pro2
-rw-r--r--examples/graphicsview/elasticnodes/elasticnodes.pro6
-rw-r--r--examples/graphicsview/graphicsview.pro12
-rw-r--r--examples/graphicsview/padnavigator/main.cpp2
-rw-r--r--examples/graphicsview/padnavigator/padnavigator.pro5
-rw-r--r--examples/graphicsview/portedasteroids/portedasteroids.pro2
-rw-r--r--examples/graphicsview/portedcanvas/portedcanvas.pro2
-rw-r--r--examples/help/contextsensitivehelp/contextsensitivehelp.pro2
-rw-r--r--examples/help/help.pro2
-rw-r--r--examples/help/remotecontrol/remotecontrol.pro2
-rw-r--r--examples/help/simpletextviewer/simpletextviewer.pro2
-rw-r--r--examples/ipc/ipc.pro2
-rw-r--r--examples/ipc/localfortuneclient/localfortuneclient.pro2
-rw-r--r--examples/ipc/localfortuneserver/localfortuneserver.pro2
-rw-r--r--examples/ipc/sharedmemory/sharedmemory.pro2
-rw-r--r--examples/itemviews/addressbook/addressbook.pro4
-rw-r--r--examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro2
-rw-r--r--examples/itemviews/chart/chart.pro8
-rw-r--r--examples/itemviews/coloreditorfactory/coloreditorfactory.pro2
-rw-r--r--examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro2
-rw-r--r--examples/itemviews/dirview/dirview.pro2
-rw-r--r--examples/itemviews/editabletreemodel/editabletreemodel.pro2
-rw-r--r--examples/itemviews/itemviews.pro6
-rw-r--r--examples/itemviews/pixelator/pixelator.pro2
-rw-r--r--examples/itemviews/puzzle/puzzle.pro2
-rw-r--r--examples/itemviews/simpledommodel/simpledommodel.pro2
-rw-r--r--examples/itemviews/simpletreemodel/simpletreemodel.pro2
-rw-r--r--examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro2
-rw-r--r--examples/itemviews/spinboxdelegate/spinboxdelegate.pro2
-rw-r--r--examples/itemviews/stardelegate/stardelegate.pro2
-rw-r--r--examples/layouts/basiclayouts/basiclayouts.pro2
-rw-r--r--examples/layouts/borderlayout/borderlayout.pro2
-rw-r--r--examples/layouts/dynamiclayouts/dynamiclayouts.pro2
-rw-r--r--examples/layouts/flowlayout/flowlayout.pro2
-rw-r--r--examples/layouts/layouts.pro2
-rw-r--r--examples/linguist/arrowpad/arrowpad.pro2
-rw-r--r--examples/linguist/hellotr/hellotr.pro2
-rw-r--r--examples/linguist/linguist.pro2
-rw-r--r--examples/linguist/trollprint/trollprint.pro2
-rw-r--r--examples/mainwindows/application/application.pro2
-rw-r--r--examples/mainwindows/application/mainwindow.cpp8
-rw-r--r--examples/mainwindows/dockwidgets/dockwidgets.pro2
-rw-r--r--examples/mainwindows/mainwindows.pro6
-rw-r--r--examples/mainwindows/mdi/mdi.pro2
-rw-r--r--examples/mainwindows/menus/menus.pro4
-rw-r--r--examples/mainwindows/recentfiles/recentfiles.pro2
-rw-r--r--examples/mainwindows/sdi/sdi.pro2
-rw-r--r--examples/network/blockingfortuneclient/blockingfortuneclient.pro2
-rw-r--r--examples/network/broadcastreceiver/broadcastreceiver.pro2
-rw-r--r--examples/network/broadcastsender/broadcastsender.pro2
-rw-r--r--examples/network/download/download.pro2
-rw-r--r--examples/network/downloadmanager/downloadmanager.pro2
-rw-r--r--examples/network/fortuneclient/fortuneclient.pro2
-rw-r--r--examples/network/fortuneserver/fortuneserver.pro2
-rw-r--r--examples/network/ftp/ftp.pro10
-rw-r--r--examples/network/ftp/ftpwindow.cpp30
-rw-r--r--examples/network/ftp/ftpwindow.h4
-rw-r--r--examples/network/ftp/main.cpp19
-rw-r--r--examples/network/ftp/sym_iap_util.h131
-rw-r--r--examples/network/http/http.pro2
-rw-r--r--examples/network/loopback/loopback.pro2
-rw-r--r--examples/network/network-chat/network-chat.pro2
-rw-r--r--examples/network/network.pro12
-rw-r--r--examples/network/securesocketclient/securesocketclient.pro4
-rw-r--r--examples/network/securesocketclient/sslclient.cpp2
-rw-r--r--examples/network/threadedfortuneserver/threadedfortuneserver.pro2
-rw-r--r--examples/network/torrent/torrent.pro2
-rw-r--r--examples/opengl/2dpainting/2dpainting.pro2
-rw-r--r--examples/opengl/framebufferobject/bubbles.svg13
-rw-r--r--examples/opengl/framebufferobject/framebufferobject.pro2
-rw-r--r--examples/opengl/framebufferobject2/framebufferobject2.pro2
-rw-r--r--examples/opengl/grabber/grabber.pro2
-rw-r--r--examples/opengl/hellogl/glwidget.cpp52
-rw-r--r--examples/opengl/hellogl/hellogl.pro2
-rw-r--r--examples/opengl/opengl.pro2
-rw-r--r--examples/opengl/overpainting/overpainting.pro2
-rw-r--r--examples/opengl/pbuffers/pbuffers.pro2
-rw-r--r--examples/opengl/pbuffers2/bubbles.svg13
-rw-r--r--examples/opengl/pbuffers2/pbuffers2.pro2
-rw-r--r--examples/opengl/samplebuffers/glwidget.cpp36
-rw-r--r--examples/opengl/samplebuffers/samplebuffers.pro2
-rw-r--r--examples/opengl/textures/textures.pro2
-rw-r--r--examples/painting/basicdrawing/basicdrawing.pro4
-rw-r--r--examples/painting/concentriccircles/concentriccircles.pro4
-rw-r--r--examples/painting/fontsampler/fontsampler.pro2
-rw-r--r--examples/painting/imagecomposition/imagecomposition.pro3
-rw-r--r--examples/painting/painterpaths/painterpaths.pro6
-rw-r--r--examples/painting/painting.pro4
-rw-r--r--examples/painting/svggenerator/svggenerator.pro2
-rw-r--r--examples/painting/svgviewer/files/bubbles.svg13
-rw-r--r--examples/painting/svgviewer/svgviewer.pro9
-rw-r--r--examples/painting/transformations/transformations.pro4
-rw-r--r--examples/phonon/capabilities/capabilities.pro5
-rw-r--r--examples/phonon/musicplayer/musicplayer.pro1
-rw-r--r--examples/phonon/phonon.pro2
-rw-r--r--examples/qtconcurrent/imagescaling/imagescaling.pro2
-rw-r--r--examples/qtconcurrent/map/map.pro2
-rw-r--r--examples/qtconcurrent/progressdialog/progressdialog.pro2
-rw-r--r--examples/qtconcurrent/qtconcurrent.pro2
-rw-r--r--examples/qtconcurrent/runfunction/runfunction.pro2
-rw-r--r--examples/qtconcurrent/wordcount/wordcount.pro2
-rw-r--r--examples/qtestlib/qtestlib.pro2
-rw-r--r--examples/qtestlib/tutorial1/tutorial1.pro4
-rw-r--r--examples/qtestlib/tutorial2/tutorial2.pro4
-rw-r--r--examples/qtestlib/tutorial3/tutorial3.pro4
-rw-r--r--examples/qtestlib/tutorial4/tutorial4.pro4
-rw-r--r--examples/qtestlib/tutorial5/tutorial5.pro4
-rw-r--r--examples/qws/ahigl/ahigl.pro2
-rw-r--r--examples/qws/dbscreen/dbscreen.pro2
-rw-r--r--examples/qws/framebuffer/framebuffer.pro2
-rw-r--r--examples/qws/mousecalibration/mousecalibration.pro2
-rw-r--r--examples/qws/qws.pro2
-rw-r--r--examples/qws/svgalib/svgalib.pro2
-rw-r--r--examples/richtext/calendar/calendar.pro2
-rw-r--r--examples/richtext/orderform/orderform.pro2
-rw-r--r--examples/richtext/richtext.pro2
-rw-r--r--examples/richtext/syntaxhighlighter/syntaxhighlighter.pro2
-rw-r--r--examples/script/calculator/calculator.pro2
-rw-r--r--examples/script/context2d/context2d.pro9
-rw-r--r--examples/script/context2d/main.cpp3
-rw-r--r--examples/script/context2d/qcontext2dcanvas.cpp5
-rw-r--r--examples/script/customclass/customclass.pro2
-rw-r--r--examples/script/defaultprototypes/defaultprototypes.pro2
-rw-r--r--examples/script/helloscript/helloscript.pro2
-rw-r--r--examples/script/marshal/marshal.pro2
-rw-r--r--examples/script/qscript/qscript.pro2
-rw-r--r--examples/script/qsdbg/qsdbg.pro2
-rw-r--r--examples/script/script.pro4
-rw-r--r--examples/sql/cachedtable/cachedtable.pro2
-rw-r--r--examples/sql/drilldown/drilldown.pro4
-rw-r--r--examples/sql/drilldown/informationwindow.cpp2
-rw-r--r--examples/sql/drilldown/main.cpp4
-rw-r--r--examples/sql/drilldown/view.cpp19
-rw-r--r--examples/sql/masterdetail/masterdetail.pro2
-rw-r--r--examples/sql/querymodel/querymodel.pro2
-rw-r--r--examples/sql/relationaltablemodel/relationaltablemodel.pro2
-rw-r--r--examples/sql/sql.pro16
-rw-r--r--examples/sql/tablemodel/tablemodel.pro2
-rw-r--r--examples/threads/mandelbrot/mandelbrot.pro4
-rw-r--r--examples/threads/semaphores/semaphores.pro2
-rw-r--r--examples/threads/threads.pro2
-rw-r--r--examples/threads/waitconditions/waitconditions.pro6
-rw-r--r--examples/tools/codecs/codecs.pro2
-rw-r--r--examples/tools/completer/completer.pro2
-rw-r--r--examples/tools/customcompleter/customcompleter.pro2
-rw-r--r--examples/tools/echoplugin/echoplugin.pro2
-rw-r--r--examples/tools/echoplugin/echowindow/echowindow.pro2
-rw-r--r--examples/tools/echoplugin/plugin/plugin.pro4
-rw-r--r--examples/tools/i18n/i18n.pro2
-rw-r--r--examples/tools/plugandpaint/plugandpaint.pro8
-rw-r--r--examples/tools/plugandpaintplugins/basictools/basictools.pro2
-rw-r--r--examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro4
-rw-r--r--examples/tools/plugandpaintplugins/plugandpaintplugins.pro2
-rw-r--r--examples/tools/regexp/regexp.pro2
-rw-r--r--examples/tools/settingseditor/settingseditor.pro2
-rw-r--r--examples/tools/styleplugin/plugin/plugin.pro4
-rw-r--r--examples/tools/styleplugin/styleplugin.pro2
-rw-r--r--examples/tools/styleplugin/stylewindow/stylewindow.pro2
-rw-r--r--examples/tools/tools.pro2
-rw-r--r--examples/tools/treemodelcompleter/treemodelcompleter.pro2
-rw-r--r--examples/tools/undoframework/undoframework.pro2
-rw-r--r--examples/tutorials/addressbook/addressbook.pro2
-rw-r--r--examples/tutorials/addressbook/part1/part1.pro2
-rw-r--r--examples/tutorials/addressbook/part2/part2.pro2
-rw-r--r--examples/tutorials/addressbook/part3/part3.pro2
-rw-r--r--examples/tutorials/addressbook/part4/part4.pro2
-rw-r--r--examples/tutorials/addressbook/part5/part5.pro2
-rw-r--r--examples/tutorials/addressbook/part6/part6.pro2
-rw-r--r--examples/tutorials/addressbook/part7/part7.pro2
-rw-r--r--examples/tutorials/tutorials.pro2
-rw-r--r--examples/uitools/multipleinheritance/multipleinheritance.pro2
-rw-r--r--examples/uitools/textfinder/textfinder.pro2
-rw-r--r--examples/uitools/uitools.pro4
-rw-r--r--examples/webkit/fancybrowser/fancybrowser.pro4
-rw-r--r--examples/webkit/formextractor/formextractor.pro6
-rw-r--r--examples/webkit/googlechat/googlechat.pro4
-rw-r--r--examples/webkit/previewer/previewer.pro6
-rw-r--r--examples/webkit/webkit.pro2
-rw-r--r--examples/widgets/analogclock/analogclock.pro4
-rw-r--r--examples/widgets/calculator/calculator.pro4
-rw-r--r--examples/widgets/calendarwidget/calendarwidget.pro4
-rw-r--r--examples/widgets/charactermap/charactermap.pro2
-rw-r--r--examples/widgets/digitalclock/digitalclock.pro2
-rw-r--r--examples/widgets/groupbox/groupbox.pro2
-rw-r--r--examples/widgets/icons/icons.pro2
-rw-r--r--examples/widgets/imageviewer/imageviewer.pro2
-rw-r--r--examples/widgets/lineedits/lineedits.pro4
-rw-r--r--examples/widgets/movie/movie.pro2
-rw-r--r--examples/widgets/scribble/scribble.pro2
-rw-r--r--examples/widgets/shapedclock/shapedclock.pro4
-rw-r--r--examples/widgets/sliders/sliders.pro2
-rw-r--r--examples/widgets/softkeys/main.cpp51
-rw-r--r--examples/widgets/softkeys/softkeys.cpp161
-rw-r--r--examples/widgets/softkeys/softkeys.h86
-rw-r--r--examples/widgets/softkeys/softkeys.pro14
-rw-r--r--examples/widgets/spinboxes/spinboxes.pro2
-rw-r--r--examples/widgets/styles/styles.pro2
-rw-r--r--examples/widgets/stylesheet/stylesheet.pro2
-rw-r--r--examples/widgets/tablet/tablet.pro2
-rw-r--r--examples/widgets/tetrix/tetrix.pro4
-rw-r--r--examples/widgets/tooltips/tooltips.pro2
-rw-r--r--examples/widgets/validators/validators.pro2
-rw-r--r--examples/widgets/widgets.pro12
-rw-r--r--examples/widgets/wiggly/dialog.cpp11
-rw-r--r--examples/widgets/wiggly/dialog.h2
-rw-r--r--examples/widgets/wiggly/main.cpp14
-rw-r--r--examples/widgets/wiggly/wiggly.pro4
-rw-r--r--examples/widgets/windowflags/windowflags.pro2
-rw-r--r--examples/xml/dombookmarks/dombookmarks.pro2
-rw-r--r--examples/xml/htmlinfo/apache_org.html281
-rw-r--r--examples/xml/htmlinfo/htmlinfo.pro18
-rw-r--r--examples/xml/htmlinfo/main.cpp119
-rw-r--r--examples/xml/htmlinfo/nokia_com.html215
-rw-r--r--examples/xml/htmlinfo/simpleexample.html11
-rw-r--r--examples/xml/htmlinfo/trolltech_com.html955
-rw-r--r--examples/xml/htmlinfo/w3c_org.html507
-rw-r--r--examples/xml/htmlinfo/youtube_com.html1585
-rw-r--r--examples/xml/rsslisting/rsslisting.pro2
-rw-r--r--examples/xml/saxbookmarks/main.cpp4
-rw-r--r--examples/xml/saxbookmarks/mainwindow.cpp3
-rw-r--r--examples/xml/saxbookmarks/saxbookmarks.pro9
-rw-r--r--examples/xml/streambookmarks/streambookmarks.pro2
-rw-r--r--examples/xml/xml.pro5
-rw-r--r--examples/xml/xmlstreamlint/xmlstreamlint.pro2
-rw-r--r--examples/xmlpatterns/filetree/filetree.pro2
-rw-r--r--examples/xmlpatterns/recipes/recipes.pro2
-rw-r--r--examples/xmlpatterns/xmlpatterns.pro2
-rw-r--r--examples/xmlpatterns/xquery/globalVariables/globalVariables.pro2
-rw-r--r--examples/xmlpatterns/xquery/xquery.pro2
-rw-r--r--mkspecs/common/symbian/fixed_stdlib.h64
-rw-r--r--mkspecs/common/symbian/qplatformdefs.h166
-rw-r--r--mkspecs/common/symbian/stl-off/new5
-rw-r--r--mkspecs/common/symbian/symbian.conf139
-rw-r--r--mkspecs/features/debug_and_release.prf2
-rw-r--r--mkspecs/features/qt.prf8
-rw-r--r--mkspecs/features/qttest_p4.prf8
-rw-r--r--mkspecs/features/symbian/application_icon.prf39
-rw-r--r--mkspecs/features/symbian/data_caging_paths.prf80
-rw-r--r--mkspecs/features/symbian/default_post.prf31
-rw-r--r--mkspecs/features/symbian/default_pre.prf2
-rw-r--r--mkspecs/features/symbian/epocallowdlldata.prf1
-rw-r--r--mkspecs/features/symbian/moc.prf16
-rw-r--r--mkspecs/features/symbian/platform_paths.prf480
-rw-r--r--mkspecs/features/symbian/qt.prf15
-rw-r--r--mkspecs/features/symbian/stl.prf37
-rw-r--r--mkspecs/features/symbian/stl_off.prf2
-rw-r--r--mkspecs/symbian-abld/qmake.conf9
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm39
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm35
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qmake_post_link.flm34
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qt.xml37
-rw-r--r--mkspecs/symbian-sbsv2/qmake.conf9
-rw-r--r--mkspecs/win32-mwc/qmake.conf110
-rw-r--r--mkspecs/win32-mwc/qplatformdefs.h164
-rw-r--r--projects.pro21
-rw-r--r--qmake/Makefile.unix33
-rw-r--r--qmake/Makefile.win3237
-rw-r--r--qmake/Makefile.win32-g++30
-rw-r--r--qmake/Makefile.win32-g++-sh30
-rw-r--r--qmake/Makefile.win32-mwc469
-rw-r--r--qmake/generators/makefile.cpp177
-rw-r--r--qmake/generators/makefile.h8
-rw-r--r--qmake/generators/metamakefile.cpp315
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.cpp240
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.h69
-rw-r--r--qmake/generators/symbian/symmake.cpp1648
-rw-r--r--qmake/generators/symbian/symmake.h154
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp474
-rw-r--r--qmake/generators/symbian/symmake_abld.h69
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp447
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.h72
-rw-r--r--qmake/generators/win32/msvc_dsp.cpp15
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp21
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp15
-rw-r--r--qmake/project.cpp326
-rw-r--r--qmake/project.h7
-rw-r--r--qmake/qmake.pri28
-rw-r--r--qmake/qmake.pro3
-rw-r--r--qmake/qpopen.cpp143
-rw-r--r--qmake/qpopen.h73
-rw-r--r--selfsigned.cer19
-rw-r--r--selfsigned.key12
-rw-r--r--src/3rdparty/freetype/src/gzip/zconf.h7
-rw-r--r--src/3rdparty/freetype/src/gzip/zlib.h7
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-global.h6
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp8
-rw-r--r--src/3rdparty/libjpeg/jinclude.h5
-rw-r--r--src/3rdparty/libmng/libmng_types.h7
-rw-r--r--src/3rdparty/libpng/pngconf.h9
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_config.h2
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_unix.c7
-rw-r--r--src/3rdparty/libtiff/libtiff/tiffio.h5
-rw-r--r--src/3rdparty/phonon/phonon/abstractmediastream.cpp1
-rw-r--r--src/3rdparty/phonon/phonon/abstractmediastream.h2
-rw-r--r--src/3rdparty/phonon/phonon/abstractmediastream_p.h2
-rw-r--r--src/3rdparty/zlib/zutil.h7
-rw-r--r--src/corelib/arch/arch.pri5
-rw-r--r--src/corelib/arch/generic/qatomic_generic_unix.cpp5
-rw-r--r--src/corelib/arch/qatomic_arch.h2
-rw-r--r--src/corelib/arch/qatomic_arm.h32
-rw-r--r--src/corelib/arch/qatomic_symbian.h56
-rw-r--r--src/corelib/arch/qatomic_windows.h9
-rw-r--r--src/corelib/arch/symbian/arch.pri5
-rw-r--r--src/corelib/arch/symbian/qatomic_symbian.cpp79
-rw-r--r--src/corelib/codecs/qisciicodec.cpp1
-rw-r--r--src/corelib/codecs/qtextcodec.cpp21
-rw-r--r--src/corelib/concurrent/qtconcurrentiteratekernel.cpp6
-rw-r--r--src/corelib/concurrent/qtconcurrentiteratekernel.h23
-rw-r--r--src/corelib/concurrent/qtconcurrentthreadengine.h1
-rw-r--r--src/corelib/concurrent/qthreadpool.cpp6
-rw-r--r--src/corelib/corelib.pro8
-rw-r--r--src/corelib/global/qglobal.cpp418
-rw-r--r--src/corelib/global/qglobal.h194
-rw-r--r--src/corelib/global/qlibraryinfo.cpp28
-rw-r--r--src/corelib/global/qnamespace.h30
-rw-r--r--src/corelib/io/io.pri8
-rw-r--r--src/corelib/io/qabstractfileengine.cpp3
-rw-r--r--src/corelib/io/qabstractfileengine.h4
-rw-r--r--src/corelib/io/qdebug.h7
-rw-r--r--src/corelib/io/qdir.cpp26
-rw-r--r--src/corelib/io/qdir.h3
-rw-r--r--src/corelib/io/qfile.cpp13
-rw-r--r--src/corelib/io/qfileinfo.cpp2
-rw-r--r--src/corelib/io/qfileinfo.h3
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp4
-rw-r--r--src/corelib/io/qfilesystemwatcher_symbian.cpp282
-rw-r--r--src/corelib/io/qfilesystemwatcher_symbian_p.h131
-rw-r--r--src/corelib/io/qfsfileengine.h3
-rw-r--r--src/corelib/io/qfsfileengine_iterator_unix.cpp12
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp290
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp4
-rw-r--r--src/corelib/io/qiodevice.cpp15
-rw-r--r--src/corelib/io/qiodevice.h3
-rw-r--r--src/corelib/io/qprocess.cpp38
-rw-r--r--src/corelib/io/qprocess.h7
-rw-r--r--src/corelib/io/qprocess_p.h7
-rw-r--r--src/corelib/io/qprocess_symbian.cpp1035
-rw-r--r--src/corelib/io/qresource.cpp1
-rw-r--r--src/corelib/io/qresource.h2
-rw-r--r--src/corelib/io/qsettings.cpp68
-rw-r--r--src/corelib/io/qsettings.h2
-rw-r--r--src/corelib/io/qsettings_p.h2
-rw-r--r--src/corelib/io/qtemporaryfile.cpp4
-rw-r--r--src/corelib/io/qtextstream.cpp3
-rw-r--r--src/corelib/io/qtextstream.h3
-rw-r--r--src/corelib/kernel/kernel.pri20
-rw-r--r--src/corelib/kernel/qcore_symbian_p.cpp178
-rw-r--r--src/corelib/kernel/qcore_symbian_p.h143
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp197
-rw-r--r--src/corelib/kernel/qcoreapplication.h4
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h2
-rw-r--r--src/corelib/kernel/qcoreevent.cpp2
-rw-r--r--src/corelib/kernel/qcoreevent.h2
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp992
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian_p.h311
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp21
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix_p.h1
-rw-r--r--src/corelib/kernel/qobject.cpp48
-rw-r--r--src/corelib/kernel/qobject.h3
-rw-r--r--src/corelib/kernel/qsharedmemory.cpp17
-rw-r--r--src/corelib/kernel/qsharedmemory_p.h9
-rw-r--r--src/corelib/kernel/qsharedmemory_symbian.cpp178
-rw-r--r--src/corelib/kernel/qsharedmemory_unix.cpp5
-rw-r--r--src/corelib/kernel/qsystemsemaphore.cpp16
-rw-r--r--src/corelib/kernel/qsystemsemaphore.h3
-rw-r--r--src/corelib/kernel/qsystemsemaphore_p.h13
-rw-r--r--src/corelib/kernel/qsystemsemaphore_symbian.cpp126
-rw-r--r--src/corelib/kernel/qvariant.cpp27
-rw-r--r--src/corelib/plugin/qlibrary.cpp99
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp27
-rw-r--r--src/corelib/plugin/qpluginloader.cpp56
-rw-r--r--src/corelib/plugin/quuid.cpp2
-rw-r--r--src/corelib/thread/qthread.cpp111
-rw-r--r--src/corelib/thread/qthread.h9
-rw-r--r--src/corelib/thread/qthread_p.h37
-rw-r--r--src/corelib/thread/qthread_unix.cpp106
-rw-r--r--src/corelib/thread/qthread_win.cpp9
-rw-r--r--src/corelib/thread/qthreadstorage.cpp14
-rw-r--r--src/corelib/tools/qalgorithms.h2
-rw-r--r--src/corelib/tools/qbitarray.cpp2
-rw-r--r--src/corelib/tools/qbytearray.cpp55
-rw-r--r--src/corelib/tools/qbytearray.h20
-rw-r--r--src/corelib/tools/qcryptographichash.cpp4
-rw-r--r--src/corelib/tools/qdatetime.cpp14
-rw-r--r--src/corelib/tools/qdatetime.h3
-rw-r--r--src/corelib/tools/qharfbuzz.cpp1
-rw-r--r--src/corelib/tools/qhash.cpp78
-rw-r--r--src/corelib/tools/qhash.h47
-rw-r--r--src/corelib/tools/qlinkedlist.h44
-rw-r--r--src/corelib/tools/qlist.h108
-rw-r--r--src/corelib/tools/qlistdata.cpp22
-rw-r--r--src/corelib/tools/qlocale.cpp16
-rw-r--r--src/corelib/tools/qlocale_symbian.cpp879
-rw-r--r--src/corelib/tools/qmap.cpp35
-rw-r--r--src/corelib/tools/qmap.h43
-rw-r--r--src/corelib/tools/qpodlist_p.h192
-rw-r--r--src/corelib/tools/qregexp.cpp25
-rw-r--r--src/corelib/tools/qringbuffer_p.h3
-rw-r--r--src/corelib/tools/qscopedpointer.cpp192
-rw-r--r--src/corelib/tools/qscopedpointer.h199
-rw-r--r--src/corelib/tools/qshareddata.cpp2
-rw-r--r--src/corelib/tools/qsharedpointer.cpp9
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h22
-rw-r--r--src/corelib/tools/qstring.cpp138
-rw-r--r--src/corelib/tools/qtextboundaryfinder.cpp12
-rw-r--r--src/corelib/tools/qvarlengtharray.h80
-rw-r--r--src/corelib/tools/qvector.cpp1
-rw-r--r--src/corelib/tools/qvector.h100
-rw-r--r--src/corelib/tools/tools.pri9
-rw-r--r--src/corelib/xml/qxmlstream.cpp5
-rw-r--r--src/corelib/xml/qxmlstream.h5
-rw-r--r--src/dbus/qdbusabstractadaptor.cpp2
-rw-r--r--src/dbus/qdbuscontext.h2
-rw-r--r--src/gui/dialogs/dialogs.pri7
-rw-r--r--src/gui/dialogs/qdialog.cpp38
-rw-r--r--src/gui/dialogs/qfiledialog.cpp71
-rw-r--r--src/gui/dialogs/qfiledialog_embedded.ui (renamed from src/gui/dialogs/qfiledialog_wince.ui)0
-rw-r--r--src/gui/dialogs/qfiledialog_p.h57
-rw-r--r--src/gui/dialogs/qfileinfogatherer.cpp30
-rw-r--r--src/gui/dialogs/qfilesystemmodel.cpp37
-rw-r--r--src/gui/dialogs/qfscompleter_p.h82
-rw-r--r--src/gui/dialogs/qmessagebox.cpp2
-rw-r--r--src/gui/dialogs/qpagesetupdialog_win.cpp2
-rw-r--r--src/gui/dialogs/qprintdialog_unix.cpp4
-rw-r--r--src/gui/dialogs/qprintpreviewdialog.cpp13
-rw-r--r--src/gui/dialogs/qprintpreviewdialog.h2
-rw-r--r--src/gui/embedded/qsoundqss_qws.cpp36
-rw-r--r--src/gui/embedded/qwindowsystem_qws.cpp44
-rw-r--r--src/gui/embedded/qwscursor_qws.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp133
-rw-r--r--src/gui/graphicsview/qgraphicsitem.h3
-rw-r--r--src/gui/graphicsview/qgraphicslayoutitem.cpp1
-rw-r--r--src/gui/graphicsview/qgraphicslayoutitem.h3
-rw-r--r--src/gui/graphicsview/qgraphicsproxywidget.h2
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp10
-rw-r--r--src/gui/graphicsview/qgraphicssceneevent.cpp1
-rw-r--r--src/gui/graphicsview/qgraphicssceneevent.h3
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp17
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicswidget.h2
-rw-r--r--src/gui/gui.pro6
-rw-r--r--src/gui/image/image.pri3
-rw-r--r--src/gui/image/qimage.cpp17
-rw-r--r--src/gui/image/qimageiohandler.cpp1
-rw-r--r--src/gui/image/qimageiohandler.h3
-rw-r--r--src/gui/image/qpicture.cpp29
-rw-r--r--src/gui/image/qpicture.h4
-rw-r--r--src/gui/image/qpicture_p.h4
-rw-r--r--src/gui/image/qpixmap.cpp7
-rw-r--r--src/gui/image/qpixmap.h10
-rw-r--r--src/gui/image/qpixmap_s60.cpp233
-rw-r--r--src/gui/image/qpixmapcache.cpp11
-rw-r--r--src/gui/image/qpixmapdatafactory.cpp4
-rw-r--r--src/gui/inputmethod/inputmethod.pri5
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h148
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp725
-rw-r--r--src/gui/inputmethod/qinputcontext.cpp50
-rw-r--r--src/gui/inputmethod/qinputcontext.h8
-rw-r--r--src/gui/inputmethod/qinputcontextfactory.cpp23
-rw-r--r--src/gui/inputmethod/qwininputcontext_win.cpp7
-rw-r--r--src/gui/inputmethod/qximinputcontext_x11.cpp2
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp8
-rw-r--r--src/gui/itemviews/qabstractitemview_p.h2
-rw-r--r--src/gui/itemviews/qcolumnview_p.h2
-rw-r--r--src/gui/itemviews/qdirmodel.cpp17
-rw-r--r--src/gui/itemviews/qfileiconprovider.cpp1
-rw-r--r--src/gui/itemviews/qfileiconprovider.h5
-rw-r--r--src/gui/itemviews/qheaderview.cpp2
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp2
-rw-r--r--src/gui/itemviews/qstandarditemmodel.cpp6
-rw-r--r--src/gui/itemviews/qstandarditemmodel.h2
-rw-r--r--src/gui/itemviews/qstyleditemdelegate.cpp2
-rw-r--r--src/gui/itemviews/qtreewidget.cpp2
-rw-r--r--src/gui/itemviews/qtreewidgetitemiterator.cpp3
-rw-r--r--src/gui/itemviews/qtreewidgetitemiterator.h3
-rw-r--r--src/gui/kernel/kernel.pri21
-rw-r--r--src/gui/kernel/qaction.cpp29
-rw-r--r--src/gui/kernel/qaction.h9
-rw-r--r--src/gui/kernel/qaction_p.h1
-rw-r--r--src/gui/kernel/qapplication.cpp118
-rw-r--r--src/gui/kernel/qapplication.h20
-rw-r--r--src/gui/kernel/qapplication_p.h13
-rw-r--r--src/gui/kernel/qapplication_qws.cpp27
-rw-r--r--src/gui/kernel/qapplication_s60.cpp1184
-rw-r--r--src/gui/kernel/qclipboard_s60.cpp277
-rw-r--r--src/gui/kernel/qcursor.cpp3
-rw-r--r--src/gui/kernel/qcursor_qws.cpp6
-rw-r--r--src/gui/kernel/qcursor_s60.cpp60
-rw-r--r--src/gui/kernel/qdesktopwidget_s60.cpp202
-rw-r--r--src/gui/kernel/qdnd_s60.cpp395
-rw-r--r--src/gui/kernel/qevent.cpp11
-rw-r--r--src/gui/kernel/qevent.h5
-rw-r--r--src/gui/kernel/qeventdispatcher_s60.cpp130
-rw-r--r--src/gui/kernel/qeventdispatcher_s60_p.h96
-rw-r--r--src/gui/kernel/qkeymapper_p.h8
-rw-r--r--src/gui/kernel/qkeymapper_s60.cpp247
-rw-r--r--src/gui/kernel/qlayout.cpp14
-rw-r--r--src/gui/kernel/qshortcutmap.cpp5
-rw-r--r--src/gui/kernel/qshortcutmap_p.h3
-rw-r--r--src/gui/kernel/qsound.cpp3
-rw-r--r--src/gui/kernel/qsound_s60.cpp206
-rw-r--r--src/gui/kernel/qt_s60_p.h285
-rw-r--r--src/gui/kernel/qwidget.cpp235
-rw-r--r--src/gui/kernel/qwidget.h13
-rw-r--r--src/gui/kernel/qwidget_mac.mm2
-rw-r--r--src/gui/kernel/qwidget_p.h24
-rw-r--r--src/gui/kernel/qwidget_qws.cpp3
-rw-r--r--src/gui/kernel/qwidget_s60.cpp1094
-rw-r--r--src/gui/kernel/qwindowdefs.h5
-rw-r--r--src/gui/painting/painting.pri27
-rw-r--r--src/gui/painting/qblendfunctions_armv6_rvct.s223
-rw-r--r--src/gui/painting/qbrush.cpp113
-rw-r--r--src/gui/painting/qbrush.h6
-rw-r--r--src/gui/painting/qcolormap_s60.cpp108
-rw-r--r--src/gui/painting/qdrawhelper.cpp284
-rw-r--r--src/gui/painting/qdrawhelper_armv6_p.h81
-rw-r--r--src/gui/painting/qdrawhelper_armv6_rvct.inc496
-rw-r--r--src/gui/painting/qdrawhelper_armv6_rvct.s178
-rw-r--r--src/gui/painting/qdrawhelper_p.h95
-rw-r--r--src/gui/painting/qgraphicssystem.cpp4
-rw-r--r--src/gui/painting/qgraphicssystemfactory.cpp2
-rw-r--r--src/gui/painting/qgrayraster.c5
-rw-r--r--src/gui/painting/qpaintdevice_s60.cpp72
-rw-r--r--src/gui/painting/qpaintengine.cpp1
-rw-r--r--src/gui/painting/qpaintengine.h3
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp187
-rw-r--r--src/gui/painting/qpainter.cpp61
-rw-r--r--src/gui/painting/qpainter.h5
-rw-r--r--src/gui/painting/qpainterpath.cpp39
-rw-r--r--src/gui/painting/qpainterpath.h9
-rw-r--r--src/gui/painting/qpathclipper_p.h7
-rw-r--r--src/gui/painting/qprinter.cpp1
-rw-r--r--src/gui/painting/qprinter.h5
-rw-r--r--src/gui/painting/qprinterinfo.h3
-rw-r--r--src/gui/painting/qprinterinfo_mac.cpp32
-rw-r--r--src/gui/painting/qprinterinfo_unix.cpp33
-rw-r--r--src/gui/painting/qprinterinfo_win.cpp30
-rw-r--r--src/gui/painting/qrasterizer.cpp7
-rw-r--r--src/gui/painting/qregion.cpp160
-rw-r--r--src/gui/painting/qregion.h4
-rw-r--r--src/gui/painting/qregion_s60.cpp52
-rw-r--r--src/gui/painting/qtessellator.cpp3
-rw-r--r--src/gui/painting/qwindowsurface_raster.cpp2
-rw-r--r--src/gui/painting/qwindowsurface_raster_p.h2
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp234
-rw-r--r--src/gui/painting/qwindowsurface_s60_p.h95
-rw-r--r--src/gui/styles/qs60style.cpp2897
-rw-r--r--src/gui/styles/qs60style.h113
-rw-r--r--src/gui/styles/qs60style_p.h501
-rw-r--r--src/gui/styles/qs60style_s60.cpp1372
-rw-r--r--src/gui/styles/qs60style_simulated.cpp449
-rw-r--r--src/gui/styles/qstyle_s60_simulated.qrc6
-rw-r--r--src/gui/styles/qstylefactory.cpp12
-rw-r--r--src/gui/styles/qstylesheetstyle_default.cpp7
-rw-r--r--src/gui/styles/styles.pri16
-rw-r--r--src/gui/text/qabstractfontengine_p.h2
-rw-r--r--src/gui/text/qcssparser.cpp5
-rw-r--r--src/gui/text/qfont.cpp73
-rw-r--r--src/gui/text/qfont.h3
-rw-r--r--src/gui/text/qfont_s60.cpp94
-rw-r--r--src/gui/text/qfontdatabase.cpp222
-rw-r--r--src/gui/text/qfontdatabase.h3
-rw-r--r--src/gui/text/qfontdatabase_qws.cpp190
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp414
-rw-r--r--src/gui/text/qfontengine.cpp36
-rw-r--r--src/gui/text/qfontengine_ft.cpp84
-rw-r--r--src/gui/text/qfontengine_ft_p.h3
-rw-r--r--src/gui/text/qfontengine_p.h17
-rw-r--r--src/gui/text/qfontengine_qpf.cpp31
-rw-r--r--src/gui/text/qfontengine_qpf_p.h1
-rw-r--r--src/gui/text/qfontengine_s60.cpp326
-rw-r--r--src/gui/text/qfontengine_s60_p.h146
-rw-r--r--src/gui/text/qfontmetrics.cpp8
-rw-r--r--src/gui/text/qfragmentmap_p.h8
-rw-r--r--src/gui/text/qtextcontrol.cpp34
-rw-r--r--src/gui/text/qtextengine.cpp10
-rw-r--r--src/gui/text/qtextlayout.cpp2
-rw-r--r--src/gui/text/qtextoption.cpp10
-rw-r--r--src/gui/text/qtexttable.cpp15
-rw-r--r--src/gui/text/qzip.cpp10
-rw-r--r--src/gui/text/text.pri33
-rw-r--r--src/gui/util/qcompleter.cpp15
-rw-r--r--src/gui/util/qdesktopservices.cpp7
-rw-r--r--src/gui/util/qdesktopservices_s60.cpp394
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp23
-rw-r--r--src/gui/widgets/qabstractscrollarea_p.h2
-rw-r--r--src/gui/widgets/qabstractslider.cpp3
-rw-r--r--src/gui/widgets/qabstractspinbox.cpp13
-rw-r--r--src/gui/widgets/qabstractspinbox.h2
-rw-r--r--src/gui/widgets/qactiontokeyeventmapper.cpp103
-rw-r--r--src/gui/widgets/qactiontokeyeventmapper_p.h81
-rw-r--r--src/gui/widgets/qcombobox.cpp11
-rw-r--r--src/gui/widgets/qdatetimeedit.cpp1
-rw-r--r--src/gui/widgets/qlineedit.cpp72
-rw-r--r--src/gui/widgets/qlineedit_p.h4
-rw-r--r--src/gui/widgets/qmacnativewidget_mac.h2
-rw-r--r--src/gui/widgets/qmainwindow.cpp16
-rw-r--r--src/gui/widgets/qmenu.cpp39
-rw-r--r--src/gui/widgets/qmenu.h9
-rw-r--r--src/gui/widgets/qmenu_p.h42
-rw-r--r--src/gui/widgets/qmenu_symbian.cpp419
-rw-r--r--src/gui/widgets/qmenubar.cpp38
-rw-r--r--src/gui/widgets/qmenubar_p.h45
-rw-r--r--src/gui/widgets/qmenudata.h2
-rw-r--r--src/gui/widgets/qplaintextedit.cpp20
-rw-r--r--src/gui/widgets/qplaintextedit_p.h6
-rw-r--r--src/gui/widgets/qprintpreviewwidget.cpp13
-rw-r--r--src/gui/widgets/qprintpreviewwidget.h2
-rw-r--r--src/gui/widgets/qspinbox.cpp9
-rw-r--r--src/gui/widgets/qtextedit.cpp17
-rw-r--r--src/gui/widgets/qtextedit_p.h1
-rw-r--r--src/gui/widgets/widgets.pri12
-rw-r--r--src/network/access/qftp.cpp12
-rw-r--r--src/network/access/qhttp.cpp1
-rw-r--r--src/network/access/qhttp.h3
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp6
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h4
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp12
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp2
-rw-r--r--src/network/access/qnetworkcookie.cpp37
-rw-r--r--src/network/access/qnetworkcookie.h4
-rw-r--r--src/network/access/qnetworkdiskcache.cpp42
-rw-r--r--src/network/access/qnetworkrequest.cpp15
-rw-r--r--src/network/access/qnetworkrequest.h4
-rw-r--r--src/network/kernel/kernel.pri3
-rw-r--r--src/network/kernel/qhostaddress.cpp5
-rw-r--r--src/network/kernel/qhostaddress.h3
-rw-r--r--src/network/kernel/qhostinfo.cpp20
-rw-r--r--src/network/kernel/qhostinfo.h3
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp3
-rw-r--r--src/network/kernel/qnetworkinterface.cpp10
-rw-r--r--src/network/kernel/qnetworkinterface.h3
-rw-r--r--src/network/kernel/qnetworkinterface_symbian.cpp203
-rw-r--r--src/network/kernel/qnetworkinterface_win.cpp11
-rw-r--r--src/network/network.pro14
-rw-r--r--src/network/socket/qabstractsocket.cpp3
-rw-r--r--src/network/socket/qlocalserver.cpp4
-rw-r--r--src/network/socket/qlocalserver_unix.cpp18
-rw-r--r--src/network/socket/qlocalsocket_unix.cpp23
-rw-r--r--src/network/socket/qnativesocketengine.cpp11
-rw-r--r--src/network/socket/qnativesocketengine_p.h147
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp163
-rw-r--r--src/network/socket/qsocks5socketengine.cpp8
-rw-r--r--src/network/socket/qtcpserver.cpp7
-rw-r--r--src/network/socket/qudpsocket.cpp20
-rw-r--r--src/network/socket/socket.pri2
-rw-r--r--src/network/ssl/qsslcertificate.cpp13
-rw-r--r--src/network/ssl/qsslcertificate.h2
-rw-r--r--src/network/ssl/qsslcipher.cpp5
-rw-r--r--src/network/ssl/qsslcipher.h3
-rw-r--r--src/network/ssl/qsslerror.cpp22
-rw-r--r--src/network/ssl/qsslerror.h10
-rw-r--r--src/network/ssl/qsslkey.cpp17
-rw-r--r--src/network/ssl/qsslkey.h3
-rw-r--r--src/network/ssl/qsslsocket_openssl_p.h4
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp145
-rw-r--r--src/network/ssl/ssl.pri8
-rw-r--r--src/opengl/qgl.cpp5
-rw-r--r--src/opengl/qgl.h3
-rw-r--r--src/opengl/qglframebufferobject.cpp1
-rw-r--r--src/opengl/qglframebufferobject.h2
-rw-r--r--src/opengl/qglpaintdevice_qws.cpp2
-rw-r--r--src/opengl/qglpaintdevice_qws_p.h3
-rw-r--r--src/opengl/qglpixelbuffer.cpp1
-rw-r--r--src/opengl/qglpixelbuffer.h2
-rw-r--r--src/opengl/qpaintengine_opengl.cpp2
-rw-r--r--src/phonon/phonon.pro14
-rw-r--r--src/plugins/codecs/cn/cn.pro2
-rw-r--r--src/plugins/codecs/jp/jp.pro2
-rw-r--r--src/plugins/codecs/kr/kr.pro2
-rw-r--r--src/plugins/codecs/tw/tw.pro2
-rw-r--r--src/plugins/iconengines/svgiconengine/svgiconengine.pro2
-rw-r--r--src/plugins/imageformats/gif/gif.pro2
-rw-r--r--src/plugins/imageformats/ico/ico.pro2
-rw-r--r--src/plugins/imageformats/jpeg/jpeg.pro2
-rw-r--r--src/plugins/imageformats/mng/mng.pro2
-rw-r--r--src/plugins/imageformats/mng/qmnghandler.cpp2
-rw-r--r--src/plugins/imageformats/mng/qmnghandler.h3
-rw-r--r--src/plugins/imageformats/svg/svg.pro2
-rw-r--r--src/plugins/imageformats/tiff/tiff.pro5
-rw-r--r--src/plugins/plugins.pro1
-rw-r--r--src/plugins/qpluginbase.pri5
-rw-r--r--src/plugins/s60/3_1/3_1.pro8
-rw-r--r--src/plugins/s60/3_2/3_2.pro15
-rw-r--r--src/plugins/s60/5_0/5_0.pro15
-rw-r--r--src/plugins/s60/bwins/qts60pluginu.def7
-rw-r--r--src/plugins/s60/eabi/qts60pluginu.def7
-rw-r--r--src/plugins/s60/s60.pro3
-rw-r--r--src/plugins/s60/s60pluginbase.pri15
-rw-r--r--src/plugins/s60/src/qdesktopservices_3_1.cpp50
-rw-r--r--src/plugins/s60/src/qdesktopservices_3_2.cpp69
-rw-r--r--src/plugins/s60/src/qlocale_3_1.cpp62
-rw-r--r--src/plugins/s60/src/qlocale_3_2.cpp64
-rw-r--r--src/plugins/sqldrivers/sqldrivers.pro4
-rw-r--r--src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zipbin0 -> 3155605 bytes-rw-r--r--src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro6
-rw-r--r--src/qbase.pri8
-rw-r--r--src/qt3support/itemviews/q3table.cpp1
-rw-r--r--src/qt3support/other/q3accel.cpp2
-rw-r--r--src/qt3support/painting/q3painter.h2
-rw-r--r--src/s60installs/qt.iby95
-rw-r--r--src/s60installs/qt_libs.pro75
-rw-r--r--src/s60installs/qtdemoapps.iby15
-rw-r--r--src/s60installs/qtvggraphicssystem.iby9
-rw-r--r--src/s60main/qts60main.cpp63
-rw-r--r--src/s60main/qts60main_mcrt0.cpp115
-rw-r--r--src/s60main/qts60mainapplication.cpp92
-rw-r--r--src/s60main/qts60mainapplication.h94
-rw-r--r--src/s60main/qts60mainappui.cpp208
-rw-r--r--src/s60main/qts60mainappui.h136
-rw-r--r--src/s60main/qts60maindocument.cpp118
-rw-r--r--src/s60main/qts60maindocument.h123
-rw-r--r--src/s60main/s60main.pro55
-rw-r--r--src/s60main/s60main.rss86
-rw-r--r--src/script/qscriptable.cpp2
-rw-r--r--src/script/qscriptable.h4
-rw-r--r--src/script/qscriptclass.cpp2
-rw-r--r--src/script/qscriptclass.h3
-rw-r--r--src/script/qscriptclasspropertyiterator.cpp2
-rw-r--r--src/script/qscriptclasspropertyiterator.h3
-rw-r--r--src/script/qscriptcontext.cpp2
-rw-r--r--src/script/qscriptcontext.h3
-rw-r--r--src/script/qscriptcontextinfo.cpp23
-rw-r--r--src/script/qscriptcontextinfo.h3
-rw-r--r--src/script/qscriptengine.cpp20
-rw-r--r--src/script/qscriptengine.h5
-rw-r--r--src/script/qscriptengine_p.cpp2
-rw-r--r--src/script/qscriptengineagent.cpp2
-rw-r--r--src/script/qscriptengineagent.h3
-rw-r--r--src/script/qscriptstring.cpp48
-rw-r--r--src/script/qscriptstring.h5
-rw-r--r--src/script/qscriptvalue.cpp76
-rw-r--r--src/script/qscriptvalue.h8
-rw-r--r--src/script/qscriptvalue_p.h2
-rw-r--r--src/script/qscriptvalueimplfwd_p.h21
-rw-r--r--src/script/qscriptvalueiterator.cpp18
-rw-r--r--src/script/qscriptvalueiterator.h4
-rw-r--r--src/script/script.pro2
-rw-r--r--src/scripttools/debugging/qscriptbreakpointdata.cpp5
-rw-r--r--src/scripttools/debugging/qscriptbreakpointdata_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerbackend.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerbackend_p.h2
-rw-r--r--src/scripttools/debugging/qscriptdebuggercommand.cpp5
-rw-r--r--src/scripttools/debugging/qscriptdebuggercommand_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h3
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsole.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsole_p.h3
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp14
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerevent.cpp5
-rw-r--r--src/scripttools/debugging/qscriptdebuggerevent_p.h3
-rw-r--r--src/scripttools/debugging/qscriptdebuggerfrontend.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerfrontend_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerjob.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerjob_p.h3
-rw-r--r--src/scripttools/debugging/qscriptdebuggerresponse.cpp5
-rw-r--r--src/scripttools/debugging/qscriptdebuggerresponse_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggervalue.cpp16
-rw-r--r--src/scripttools/debugging/qscriptdebuggervalue_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggervalueproperty.cpp14
-rw-r--r--src/scripttools/debugging/qscriptdebuggervalueproperty_p.h3
-rw-r--r--src/scripttools/debugging/qscriptscriptdata.cpp20
-rw-r--r--src/scripttools/debugging/qscriptscriptdata_p.h4
-rw-r--r--src/scripttools/debugging/qscriptstdmessagehandler.cpp1
-rw-r--r--src/scripttools/debugging/qscriptstdmessagehandler_p.h4
-rw-r--r--src/scripttools/debugging/qscriptvalueproperty.cpp14
-rw-r--r--src/scripttools/debugging/qscriptvalueproperty_p.h3
-rw-r--r--src/scripttools/scripttools.pro2
-rw-r--r--src/sql/kernel/qsqlfield.cpp11
-rw-r--r--src/sql/kernel/qsqlfield.h6
-rw-r--r--src/sql/kernel/qsqlresult.cpp4
-rw-r--r--src/sql/sql.pro8
-rw-r--r--src/src.pro17
-rw-r--r--src/svg/qgraphicssvgitem.h6
-rw-r--r--src/svg/qsvggenerator.cpp1
-rw-r--r--src/svg/qsvggenerator.h3
-rw-r--r--src/svg/svg.pro2
-rw-r--r--src/testlib/3rdparty/cycle_p.h19
-rw-r--r--src/testlib/qbenchmark.cpp1
-rw-r--r--src/testlib/qplaintestlogger.cpp10
-rw-r--r--src/testlib/qtest.h7
-rw-r--r--src/testlib/qtest_global.h5
-rw-r--r--src/testlib/qtestcase.cpp22
-rw-r--r--src/testlib/qtestcase.h65
-rw-r--r--src/testlib/testlib.pro2
-rw-r--r--src/tools/bootstrap/bootstrap.pri2
-rw-r--r--src/tools/moc/preprocessor.cpp7
-rw-r--r--src/xml/dom/qdom.cpp88
-rw-r--r--src/xml/sax/qxml.cpp85
-rw-r--r--src/xml/sax/qxml.h5
-rw-r--r--src/xml/xml.pro2
-rw-r--r--src/xmlpatterns/api/qabstractxmlnodemodel.cpp1
-rw-r--r--src/xmlpatterns/api/qabstractxmlnodemodel.h3
-rw-r--r--src/xmlpatterns/api/qabstractxmlreceiver.cpp1
-rw-r--r--src/xmlpatterns/api/qabstractxmlreceiver.h3
-rw-r--r--src/xmlpatterns/api/qxmlresultitems.cpp1
-rw-r--r--src/xmlpatterns/api/qxmlresultitems.h3
-rw-r--r--src/xmlpatterns/data/qabstractfloatcasters.cpp10
-rw-r--r--src/xmlpatterns/data/qschemanumeric.cpp3
-rw-r--r--src/xmlpatterns/functions/qcomparingaggregator.cpp7
-rw-r--r--src/xmlpatterns/functions/qsequencefns_p.h15
-rw-r--r--tests/arthur/common/paintcommands.cpp7
-rw-r--r--tests/arthur/common/paintcommands.h2
-rw-r--r--tests/arthur/common/qengines.cpp8
-rw-r--r--tests/arthur/common/qengines.h3
-rw-r--r--tests/arthur/lance/lance.pro8
-rw-r--r--tests/arthur/lance/main.cpp7
-rw-r--r--tests/auto/JoinResults.py66
-rw-r--r--tests/auto/_Categories/Qt3Support.txt51
-rw-r--r--tests/auto/_Categories/QtCore.txt108
-rw-r--r--tests/auto/_Categories/QtDBus.txt15
-rw-r--r--tests/auto/_Categories/QtGui.txt192
-rw-r--r--tests/auto/_Categories/QtHelp.txt5
-rw-r--r--tests/auto/_Categories/QtNetwork.txt31
-rw-r--r--tests/auto/_Categories/QtOpenGl.txt1
-rw-r--r--tests/auto/_Categories/QtScript.txt13
-rw-r--r--tests/auto/_Categories/QtSql.txt12
-rw-r--r--tests/auto/_Categories/QtSvg.txt3
-rw-r--r--tests/auto/_Categories/QtTest.txt1
-rw-r--r--tests/auto/_Categories/QtWebkit.txt2
-rw-r--r--tests/auto/_Categories/QtXml.txt5
-rw-r--r--tests/auto/_Categories/QtXmlPatterns.txt27
-rw-r--r--tests/auto/_Categories/all_categories.txt16
-rw-r--r--tests/auto/_Categories/phonon.txt2
-rw-r--r--tests/auto/_Categories/qmake.txt0
-rw-r--r--tests/auto/_networkselftest/_networkselftest.pro2
-rw-r--r--tests/auto/_networkselftest/tst_networkselftest.cpp30
-rw-r--r--tests/auto/auto.pro2
-rw-r--r--tests/auto/autobuildruncategory.bat11
-rw-r--r--tests/auto/autobuildrunsingle.bat71
-rw-r--r--tests/auto/autobuildtests.bat19
-rw-r--r--tests/auto/autobuildtestsmain.bat38
-rw-r--r--tests/auto/checkxmlfiles/checkxmlfiles.pro2
-rw-r--r--tests/auto/collections/collections.pro4
-rw-r--r--tests/auto/collections/tst_collections.cpp6
-rw-r--r--tests/auto/compilecategory.bat4
-rw-r--r--tests/auto/compilerwarnings/compilerwarnings.pro1
-rw-r--r--tests/auto/compilesingle.bat28
-rw-r--r--tests/auto/exceptionsafety/exceptionsafety.pro2
-rw-r--r--tests/auto/exceptionsafety/tst_exceptionsafety.cpp637
-rw-r--r--tests/auto/exceptionsafety_objects/3rdparty/memcheck.h319
-rw-r--r--tests/auto/exceptionsafety_objects/3rdparty/valgrind.h3924
-rw-r--r--tests/auto/exceptionsafety_objects/exceptionsafety_objects.pro3
-rw-r--r--tests/auto/exceptionsafety_objects/oomsimulator.h198
-rw-r--r--tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp232
-rw-r--r--tests/auto/headers/headers.pro2
-rw-r--r--tests/auto/languagechange/tst_languagechange.cpp20
-rw-r--r--tests/auto/network-settings.h277
-rw-r--r--tests/auto/patternistexamplefiletree/patternistexamplefiletree.pro1
-rw-r--r--tests/auto/patternistexamples/patternistexamples.pro2
-rw-r--r--tests/auto/patternistheaders/patternistheaders.pro1
-rw-r--r--tests/auto/q3urloperator/copy.res/.gitattributes1
-rw-r--r--tests/auto/q_func_info/q_func_info.pro2
-rw-r--r--tests/auto/q_func_info/tst_q_func_info.cpp2
-rw-r--r--tests/auto/qabstractitemmodel/qabstractitemmodel.pro5
-rw-r--r--tests/auto/qabstractitemview/tst_qabstractitemview.cpp13
-rw-r--r--tests/auto/qabstractmessagehandler/qabstractmessagehandler.pro1
-rw-r--r--tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro2
-rw-r--r--tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp12
-rw-r--r--tests/auto/qabstracturiresolver/qabstracturiresolver.pro1
-rw-r--r--tests/auto/qabstractxmlforwarditerator/qabstractxmlforwarditerator.pro1
-rw-r--r--tests/auto/qabstractxmlreceiver/qabstractxmlreceiver.pro1
-rw-r--r--tests/auto/qaction/tst_qaction.cpp2
-rw-r--r--tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro9
-rw-r--r--tests/auto/qapplication/test/test.pro8
-rw-r--r--tests/auto/qapplication/tst_qapplication.cpp56
-rw-r--r--tests/auto/qatomicint/qatomicint.pro3
-rw-r--r--tests/auto/qatomicpointer/qatomicpointer.pro2
-rw-r--r--tests/auto/qautoptr/qautoptr.pro2
-rw-r--r--tests/auto/qbitarray/qbitarray.pro4
-rw-r--r--tests/auto/qbitarray/tst_qbitarray.cpp28
-rw-r--r--tests/auto/qbuffer/qbuffer.pro4
-rw-r--r--tests/auto/qbytearray/.gitattributes1
-rw-r--r--tests/auto/qbytearray/qbytearray.pro7
-rw-r--r--tests/auto/qbytearray/tst_qbytearray.cpp20
-rw-r--r--tests/auto/qcache/qcache.pro4
-rw-r--r--tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp2
-rw-r--r--tests/auto/qchar/qchar.pro2
-rw-r--r--tests/auto/qclipboard/test/test.pro2
-rw-r--r--tests/auto/qclipboard/tst_qclipboard.cpp6
-rw-r--r--tests/auto/qcolumnview/tst_qcolumnview.cpp2
-rw-r--r--tests/auto/qcombobox/qcombobox.pro2
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp19
-rw-r--r--tests/auto/qcompleter/tst_qcompleter.cpp39
-rw-r--r--tests/auto/qcoreapplication/qcoreapplication.pro3
-rw-r--r--tests/auto/qcryptographichash/qcryptographichash.pro6
-rw-r--r--tests/auto/qcssparser/qcssparser.pro7
-rw-r--r--tests/auto/qcssparser/tst_cssparser.cpp4
-rw-r--r--tests/auto/qdatastream/qdatastream.pro11
-rw-r--r--tests/auto/qdatastream/tst_qdatastream.cpp39
-rw-r--r--tests/auto/qdate/qdate.pro4
-rw-r--r--tests/auto/qdatetime/tst_qdatetime.cpp14
-rw-r--r--tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp25
-rw-r--r--tests/auto/qdebug/qdebug.pro4
-rw-r--r--tests/auto/qdesktopservices/qdesktopservices.pro25
-rw-r--r--tests/auto/qdesktopservices/tst_qdesktopservices.cpp203
-rw-r--r--tests/auto/qdir/qdir.pro9
-rw-r--r--tests/auto/qdir/tst_qdir.cpp116
-rw-r--r--tests/auto/qdiriterator/qdiriterator.pro2
-rw-r--r--tests/auto/qdiriterator/tst_qdiriterator.cpp7
-rw-r--r--tests/auto/qdirmodel/qdirmodel.pro11
-rw-r--r--tests/auto/qdirmodel/tst_qdirmodel.cpp28
-rw-r--r--tests/auto/qdom/qdom.pro4
-rw-r--r--tests/auto/qevent/qevent.pro3
-rw-r--r--tests/auto/qeventloop/tst_qeventloop.cpp373
-rw-r--r--tests/auto/qexplicitlyshareddatapointer/qexplicitlyshareddatapointer.pro2
-rw-r--r--tests/auto/qfile/test/test.pro42
-rw-r--r--tests/auto/qfile/tst_qfile.cpp66
-rw-r--r--tests/auto/qfiledialog/qfiledialog.pro7
-rw-r--r--tests/auto/qfiledialog/tst_qfiledialog.cpp27
-rw-r--r--tests/auto/qfileinfo/qfileinfo.pro3
-rw-r--r--tests/auto/qfileinfo/tst_qfileinfo.cpp50
-rw-r--r--tests/auto/qfilesystemmodel/qfilesystemmodel.pro9
-rw-r--r--tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp47
-rw-r--r--tests/auto/qfilesystemwatcher/qfilesystemwatcher.pro2
-rw-r--r--tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp5
-rw-r--r--tests/auto/qflags/qflags.pro3
-rw-r--r--tests/auto/qfontdatabase/qfontdatabase.pro4
-rw-r--r--tests/auto/qfontdatabase/tst_qfontdatabase.cpp10
-rw-r--r--tests/auto/qftp/.gitattributes2
-rw-r--r--tests/auto/qftp/qftp.pro5
-rw-r--r--tests/auto/qftp/tst_qftp.cpp34
-rw-r--r--tests/auto/qgetputenv/qgetputenv.pro4
-rw-r--r--tests/auto/qglobal/qglobal.pro3
-rw-r--r--tests/auto/qglobal/tst_qglobal.cpp62
-rw-r--r--tests/auto/qgraphicsscene/qgraphicsscene.pro9
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp10
-rw-r--r--tests/auto/qgraphicsview/qgraphicsview.pro2
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp4
-rw-r--r--tests/auto/qgroupbox/tst_qgroupbox.cpp84
-rw-r--r--tests/auto/qhash/qhash.pro7
-rw-r--r--tests/auto/qhash/tst_qhash.cpp8
-rw-r--r--tests/auto/qhostinfo/tst_qhostinfo.cpp21
-rw-r--r--tests/auto/qhttp/qhttp.pro8
-rw-r--r--tests/auto/qhttp/tst_qhttp.cpp279
-rw-r--r--tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp28
-rw-r--r--tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp35
-rw-r--r--tests/auto/qicoimageformat/qicoimageformat.pro7
-rw-r--r--tests/auto/qicoimageformat/tst_qticoimageformat.cpp6
-rw-r--r--tests/auto/qicon/qicon.pro7
-rw-r--r--tests/auto/qicon/tst_qicon.cpp7
-rw-r--r--tests/auto/qimage/qimage.pro7
-rw-r--r--tests/auto/qimage/tst_qimage.cpp20
-rw-r--r--tests/auto/qimagereader/qimagereader.pro10
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp4
-rw-r--r--tests/auto/qimagewriter/qimagewriter.pro8
-rw-r--r--tests/auto/qimagewriter/tst_qimagewriter.cpp13
-rw-r--r--tests/auto/qinputcontext/qinputcontext.pro2
-rw-r--r--tests/auto/qinputcontext/tst_qinputcontext.cpp216
-rw-r--r--tests/auto/qiodevice/qiodevice.pro5
-rw-r--r--tests/auto/qiodevice/tst_qiodevice.cpp9
-rw-r--r--tests/auto/qitemdelegate/tst_qitemdelegate.cpp7
-rw-r--r--tests/auto/qitemmodel/qitemmodel.pro2
-rw-r--r--tests/auto/qitemview/tst_qitemview.cpp9
-rw-r--r--tests/auto/qkeyevent/tst_qkeyevent.cpp59
-rw-r--r--tests/auto/qkeysequence/tst_qkeysequence.cpp2
-rw-r--r--tests/auto/qlabel/qlabel.pro7
-rw-r--r--tests/auto/qlabel/tst_qlabel.cpp3
-rw-r--r--tests/auto/qlayout/qlayout.pro2
-rw-r--r--tests/auto/qlibrary/lib/lib.pro3
-rw-r--r--tests/auto/qlibrary/lib/mylib.c4
-rw-r--r--tests/auto/qlibrary/lib2/lib2.pro20
-rw-r--r--tests/auto/qlibrary/lib2/mylib.c4
-rw-r--r--tests/auto/qlibrary/qlibrary.pro14
-rw-r--r--tests/auto/qlibrary/tst/tst.pro12
-rw-r--r--tests/auto/qlibrary/tst_qlibrary.cpp69
-rw-r--r--tests/auto/qline/qline.pro6
-rw-r--r--tests/auto/qlineedit/tst_qlineedit.cpp6
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp2
-rw-r--r--tests/auto/qlocale/test/test.pro8
-rw-r--r--tests/auto/qlocale/tst_qlocale.cpp87
-rw-r--r--tests/auto/qlocalsocket/lackey/lackey.pro2
-rw-r--r--tests/auto/qlocalsocket/lackey/main.cpp2
-rw-r--r--tests/auto/qlocalsocket/qlocalsocket.pro2
-rw-r--r--tests/auto/qlocalsocket/test/test.pro20
-rw-r--r--tests/auto/qlocalsocket/tst_qlocalsocket.cpp94
-rw-r--r--tests/auto/qmainwindow/qmainwindow.pro3
-rw-r--r--tests/auto/qmap/qmap.pro4
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp9
-rw-r--r--tests/auto/qmenubar/qmenubar.pro2
-rw-r--r--tests/auto/qmenubar/tst_qmenubar.cpp4
-rw-r--r--tests/auto/qmetatype/qmetatype.pro3
-rw-r--r--tests/auto/qmouseevent/tst_qmouseevent.cpp6
-rw-r--r--tests/auto/qmovie/qmovie.pro10
-rw-r--r--tests/auto/qmultiscreen/qmultiscreen.pro4
-rw-r--r--tests/auto/qmutex/qmutex.pro2
-rw-r--r--tests/auto/qmutexlocker/qmutexlocker.pro2
-rw-r--r--tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp29
-rw-r--r--tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp7
-rw-r--r--tests/auto/qnetworkreply/.gitattributes5
-rw-r--r--tests/auto/qnetworkreply/echo/echo.pro2
-rw-r--r--tests/auto/qnetworkreply/test/test.pro16
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp102
-rw-r--r--tests/auto/qnumeric/qnumeric.pro3
-rw-r--r--tests/auto/qobject/tst_qobject.cpp15
-rw-r--r--tests/auto/qobject/tst_qobject.pro6
-rw-r--r--tests/auto/qobjectrace/qobjectrace.pro3
-rw-r--r--tests/auto/qpainter/qpainter.pro9
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp13
-rw-r--r--tests/auto/qpathclipper/qpathclipper.pro2
-rw-r--r--tests/auto/qpen/tst_qpen.cpp12
-rw-r--r--tests/auto/qpixmap/qpixmap.pro8
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp118
-rw-r--r--tests/auto/qplaintextedit/tst_qplaintextedit.cpp29
-rw-r--r--tests/auto/qplugin/debugplugin/debugplugin.pro4
-rw-r--r--tests/auto/qplugin/qplugin.pro1
-rw-r--r--tests/auto/qplugin/releaseplugin/releaseplugin.pro4
-rw-r--r--tests/auto/qplugin/tst_qplugin.pro8
-rw-r--r--tests/auto/qpluginloader/lib/lib.pro3
-rw-r--r--tests/auto/qpluginloader/qpluginloader.pro3
-rw-r--r--tests/auto/qpluginloader/theplugin/theplugin.pro4
-rw-r--r--tests/auto/qpluginloader/tst/tst.pro10
-rw-r--r--tests/auto/qpluginloader/tst_qpluginloader.cpp65
-rw-r--r--tests/auto/qpoint/qpoint.pro5
-rw-r--r--tests/auto/qpointarray/qpointarray.pro2
-rw-r--r--tests/auto/qprocess/qprocess.pro9
-rw-r--r--tests/auto/qprocess/test/test.pro21
-rw-r--r--tests/auto/qprocess/testDetached/testDetached.pro3
-rw-r--r--tests/auto/qprocess/testProcessOutput/main.cpp18
-rw-r--r--tests/auto/qprocess/testProcessSpacesArgs/main.cpp12
-rw-r--r--tests/auto/qprocess/tst_qprocess.cpp275
-rw-r--r--tests/auto/qqueue/qqueue.pro3
-rw-r--r--tests/auto/qrand/qrand.pro2
-rw-r--r--tests/auto/qreadlocker/qreadlocker.pro2
-rw-r--r--tests/auto/qreadwritelock/qreadwritelock.pro2
-rw-r--r--tests/auto/qrect/qrect.pro2
-rw-r--r--tests/auto/qrect/tst_qrect.cpp320
-rw-r--r--tests/auto/qregexp/qregexp.pro3
-rw-r--r--tests/auto/qregexp/tst_qregexp.cpp4
-rw-r--r--tests/auto/qregion/tst_qregion.cpp4
-rw-r--r--tests/auto/qresourceengine/qresourceengine.pro12
-rw-r--r--tests/auto/qresourceengine/tst_resourceengine.cpp4
-rw-r--r--tests/auto/qscopedpointer/.gitignore1
-rw-r--r--tests/auto/qscopedpointer/qscopedpointer.pro3
-rw-r--r--tests/auto/qscopedpointer/tst_qscopedpointer.cpp282
-rw-r--r--tests/auto/qscriptengine/qscriptengine.pro5
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp6
-rw-r--r--tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro4
-rw-r--r--tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp2
-rw-r--r--tests/auto/qscriptqobject/qscriptqobject.pro4
-rw-r--r--tests/auto/qscriptqobject/tst_qscriptqobject.cpp6
-rw-r--r--tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro4
-rw-r--r--tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp5
-rw-r--r--tests/auto/qset/qset.pro7
-rw-r--r--tests/auto/qsettings/.gitattributes5
-rw-r--r--tests/auto/qsettings/tst_qsettings.cpp24
-rw-r--r--tests/auto/qsharedmemory/lackey/scripts/producer.js8
-rw-r--r--tests/auto/qsharedmemory/src/qsystemlock_p.h1
-rw-r--r--tests/auto/qsharedmemory/src/qsystemlock_unix.cpp24
-rw-r--r--tests/auto/qsharedmemory/test/test.pro10
-rw-r--r--tests/auto/qsharedmemory/tst_qsharedmemory.cpp32
-rw-r--r--tests/auto/qsharedpointer/externaltests.cpp4
-rw-r--r--tests/auto/qsharedpointer/externaltests.pri3
-rw-r--r--tests/auto/qsharedpointer/qsharedpointer.pro2
-rw-r--r--tests/auto/qsharedpointer/tst_qsharedpointer.cpp4
-rw-r--r--tests/auto/qsidebar/qsidebar.pro2
-rw-r--r--tests/auto/qsignalspy/qsignalspy.pro3
-rw-r--r--tests/auto/qsize/qsize.pro4
-rw-r--r--tests/auto/qsizef/qsizef.pro3
-rw-r--r--tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp92
-rw-r--r--tests/auto/qsocks5socketengine/qsocks5socketengine.pro2
-rw-r--r--tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp54
-rw-r--r--tests/auto/qsound/qsound.pro2
-rw-r--r--tests/auto/qsplitter/qsplitter.pro2
-rw-r--r--tests/auto/qsql/qsql.pro8
-rw-r--r--tests/auto/qsqldatabase/qsqldatabase.pro11
-rw-r--r--tests/auto/qsqlerror/qsqlerror.pro8
-rw-r--r--tests/auto/qsqlfield/qsqlfield.pro8
-rw-r--r--tests/auto/qsqlquery/qsqlquery.pro8
-rw-r--r--tests/auto/qsqlquerymodel/qsqlquerymodel.pro8
-rw-r--r--tests/auto/qsqlrecord/qsqlrecord.pro10
-rw-r--r--tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro8
-rw-r--r--tests/auto/qsqltablemodel/qsqltablemodel.pro8
-rw-r--r--tests/auto/qsqlthread/qsqlthread.pro8
-rw-r--r--tests/auto/qsslcertificate/qsslcertificate.pro11
-rw-r--r--tests/auto/qsslcertificate/tst_qsslcertificate.cpp6
-rw-r--r--tests/auto/qsslcipher/qsslcipher.pro2
-rw-r--r--tests/auto/qsslerror/qsslerror.pro2
-rw-r--r--tests/auto/qsslkey/qsslkey.pro9
-rw-r--r--tests/auto/qsslkey/tst_qsslkey.cpp8
-rw-r--r--tests/auto/qsslsocket/certs/aspiriniks.ca.crt22
-rw-r--r--tests/auto/qsslsocket/qsslsocket.pro26
-rw-r--r--tests/auto/qsslsocket/tst_qsslsocket.cpp88
-rw-r--r--tests/auto/qstandarditem/tst_qstandarditem.cpp4
-rw-r--r--tests/auto/qstandarditemmodel/tst_qstandarditemmodel.cpp4
-rw-r--r--tests/auto/qstl/qstl.pro4
-rw-r--r--tests/auto/qstring/qstring.pro5
-rw-r--r--tests/auto/qstring/tst_qstring.cpp312
-rw-r--r--tests/auto/qstringlist/qstringlist.pro4
-rw-r--r--tests/auto/qstringlistmodel/tst_qstringlistmodel.cpp1
-rw-r--r--tests/auto/qstyle/qstyle.pro7
-rw-r--r--tests/auto/qstyle/tst_qstyle.cpp114
-rw-r--r--tests/auto/qstylesheetstyle/qstylesheetstyle.pro12
-rw-r--r--tests/auto/qsvggenerator/qsvggenerator.pro7
-rw-r--r--tests/auto/qsvggenerator/tst_qsvggenerator.cpp4
-rw-r--r--tests/auto/qsvgrenderer/qsvgrenderer.pro2
-rw-r--r--tests/auto/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp2
-rw-r--r--tests/auto/qsysinfo/qsysinfo.pro1
-rw-r--r--tests/auto/qsystemsemaphore/test/test.pro11
-rw-r--r--tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp14
-rw-r--r--tests/auto/qtabbar/tst_qtabbar.cpp2
-rw-r--r--tests/auto/qtableview/qtableview.pro2
-rw-r--r--tests/auto/qtablewidget/qtablewidget.pro12
-rw-r--r--tests/auto/qtconcurrentfilter/tst_qtconcurrentfilter.cpp2
-rw-r--r--tests/auto/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp2
-rw-r--r--tests/auto/qtcpserver/crashingServer/main.cpp8
-rw-r--r--tests/auto/qtcpserver/test/test.pro6
-rw-r--r--tests/auto/qtcpserver/tst_qtcpserver.cpp40
-rw-r--r--tests/auto/qtcpsocket/qtcpsocket.pro2
-rw-r--r--tests/auto/qtcpsocket/test/test.pro4
-rw-r--r--tests/auto/qtcpsocket/tst_qtcpsocket.cpp93
-rw-r--r--tests/auto/qtemporaryfile/qtemporaryfile.pro9
-rw-r--r--tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp8
-rw-r--r--tests/auto/qtextblock/tst_qtextblock.cpp2
-rw-r--r--tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro5
-rw-r--r--tests/auto/qtextboundaryfinder/tst_qtextboundaryfinder.cpp3
-rw-r--r--tests/auto/qtextbrowser/qtextbrowser.pro4
-rw-r--r--tests/auto/qtextbrowser/tst_qtextbrowser.cpp13
-rw-r--r--tests/auto/qtextcodec/test/test.pro2
-rw-r--r--tests/auto/qtextcodec/tst_qtextcodec.cpp5
-rw-r--r--tests/auto/qtextedit/qtextedit.pro9
-rw-r--r--tests/auto/qtextedit/tst_qtextedit.cpp33
-rw-r--r--tests/auto/qtextlayout/qtextlayout.pro3
-rw-r--r--tests/auto/qtextodfwriter/qtextodfwriter.pro4
-rw-r--r--tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp4
-rw-r--r--tests/auto/qtextstream/test/test.pro11
-rw-r--r--tests/auto/qtextstream/tst_qtextstream.cpp26
-rw-r--r--tests/auto/qthread/qthread.pro3
-rw-r--r--tests/auto/qthread/tst_qthread.cpp2
-rw-r--r--tests/auto/qthreadstorage/qthreadstorage.pro3
-rw-r--r--tests/auto/qtime/qtime.pro3
-rw-r--r--tests/auto/qtimeline/qtimeline.pro3
-rw-r--r--tests/auto/qtimer/qtimer.pro3
-rw-r--r--tests/auto/qtimer/tst_qtimer.cpp89
-rw-r--r--tests/auto/qtransform/qtransform.pro2
-rw-r--r--tests/auto/qtransformedscreen/qtransformedscreen.pro1
-rw-r--r--tests/auto/qtranslator/qtranslator.pro2
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp12
-rw-r--r--tests/auto/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp10
-rw-r--r--tests/auto/qtwidgets/qtwidgets.pro1
-rw-r--r--tests/auto/qtwidgets/tst_qtwidgets.cpp13
-rw-r--r--tests/auto/qudpsocket/test/test.pro2
-rw-r--r--tests/auto/qudpsocket/tst_qudpsocket.cpp103
-rw-r--r--tests/auto/qudpsocket/udpServer/udpServer.pro1
-rw-r--r--tests/auto/qurl/qurl.pro5
-rw-r--r--tests/auto/quuid/quuid.pro3
-rw-r--r--tests/auto/qvariant/qvariant.pro1
-rw-r--r--tests/auto/qvariant/tst_qvariant.cpp26
-rw-r--r--tests/auto/qvarlengtharray/qvarlengtharray.pro3
-rw-r--r--tests/auto/qvector/qvector.pro4
-rw-r--r--tests/auto/qwaitcondition/tst_qwaitcondition.cpp133
-rw-r--r--tests/auto/qwidget/qwidget.pro6
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp92
-rw-r--r--tests/auto/qwindowsurface/tst_qwindowsurface.cpp2
-rw-r--r--tests/auto/qwineventnotifier/qwineventnotifier.pro3
-rw-r--r--tests/auto/qwizard/qwizard.pro1
-rw-r--r--tests/auto/qwmatrix/qwmatrix.pro2
-rw-r--r--tests/auto/qwritelocker/qwritelocker.pro2
-rw-r--r--tests/auto/qwsembedwidget/qwsembedwidget.pro4
-rw-r--r--tests/auto/qwsinputmethod/qwsinputmethod.pro4
-rw-r--r--tests/auto/qwswindowsystem/qwswindowsystem.pro4
-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/qxmlquery/tst_qxmlquery.cpp1
-rw-r--r--tests/auto/qxmlsimplereader/qxmlsimplereader.pro4
-rw-r--r--tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp8
-rw-r--r--tests/auto/qxmlstream/qxmlstream.pro2
-rw-r--r--tests/auto/qzip/qzip.pro4
-rw-r--r--tests/auto/qzip/tst_qzip.cpp4
-rw-r--r--tests/auto/symbian/orientationchange/orientationchange.pro7
-rw-r--r--tests/auto/symbian/orientationchange/tst_orientationchange.cpp165
-rw-r--r--tests/auto/symbian/qmainexceptions/qmainexceptions.pro5
-rw-r--r--tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp318
-rw-r--r--tests/auto/symbian/qsymbiantests.pro2
-rw-r--r--tests/auto/xmlpatterns/tst_xmlpatterns.cpp2
-rw-r--r--tests/benchmarks/qfile/main.cpp5
-rw-r--r--tests/benchmarks/qgraphicsview/benchapps/scrolltest/main.cpp2
-rwxr-xr-xtests/benchmarks/qiodevice/main.cpp2
-rwxr-xr-xtests/benchmarks/qiodevice/qiodevice.pro1
-rw-r--r--tools/configure/configure.pro5
-rw-r--r--tools/configure/configureapp.cpp206
-rw-r--r--tools/designer/src/components/formeditor/brushmanagerproxy.cpp4
-rw-r--r--tools/designer/src/components/formeditor/brushmanagerproxy.h2
-rw-r--r--tools/designer/src/components/formeditor/qtbrushmanager.cpp5
-rw-r--r--tools/designer/src/components/formeditor/qtbrushmanager.h2
-rw-r--r--tools/designer/src/lib/shared/iconselector.cpp5
-rw-r--r--tools/designer/src/lib/shared/iconselector_p.h4
-rw-r--r--tools/designer/src/lib/shared/qtresourceeditordialog.cpp5
-rw-r--r--tools/designer/src/lib/shared/qtresourceeditordialog_p.h3
-rw-r--r--tools/designer/src/lib/shared/qtresourcemodel.cpp2
-rw-r--r--tools/designer/src/lib/shared/qtresourcemodel_p.h5
-rw-r--r--tools/designer/src/lib/shared/qtresourceview.cpp4
-rw-r--r--tools/designer/src/lib/shared/qtresourceview_p.h4
-rw-r--r--tools/designer/src/lib/uilib/abstractformbuilder.cpp189
-rw-r--r--tools/designer/src/uitools/quiloader.cpp1
-rw-r--r--tools/designer/src/uitools/quiloader.h3
-rw-r--r--tools/shared/qtgradienteditor/qtcolorbutton.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtcolorbutton.h2
-rw-r--r--tools/shared/qtgradienteditor/qtcolorline.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtcolorline.h2
-rw-r--r--tools/shared/qtgradienteditor/qtgradientdialog.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtgradientdialog.h2
-rw-r--r--tools/shared/qtgradienteditor/qtgradienteditor.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtgradienteditor.h2
-rw-r--r--tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtgradientstopscontroller.h2
-rw-r--r--tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp7
-rw-r--r--tools/shared/qtgradienteditor/qtgradientstopsmodel.h4
-rw-r--r--tools/shared/qtgradienteditor/qtgradientstopswidget.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtgradientstopswidget.h2
-rw-r--r--tools/shared/qtgradienteditor/qtgradientwidget.cpp4
-rw-r--r--tools/shared/qtgradienteditor/qtgradientwidget.h2
-rw-r--r--tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp4
-rw-r--r--tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.h2
-rw-r--r--tools/shared/qtpropertybrowser/qteditorfactory.cpp54
-rw-r--r--tools/shared/qtpropertybrowser/qteditorfactory.h30
-rw-r--r--tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp4
-rw-r--r--tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.h2
-rw-r--r--tools/shared/qtpropertybrowser/qtpropertybrowser.cpp14
-rw-r--r--tools/shared/qtpropertybrowser/qtpropertybrowser.h8
-rw-r--r--tools/shared/qtpropertybrowser/qtpropertymanager.cpp128
-rw-r--r--tools/shared/qtpropertybrowser/qtpropertymanager.h44
-rw-r--r--tools/shared/qtpropertybrowser/qttreepropertybrowser.cpp4
-rw-r--r--tools/shared/qtpropertybrowser/qttreepropertybrowser.h2
-rw-r--r--tools/shared/qtpropertybrowser/qtvariantproperty.cpp12
-rw-r--r--tools/shared/qtpropertybrowser/qtvariantproperty.h6
-rw-r--r--tools/shared/qttoolbardialog/qttoolbardialog.cpp14
-rw-r--r--tools/shared/qttoolbardialog/qttoolbardialog.h4
-rw-r--r--util/s60pixelmetrics/bld.inf45
-rw-r--r--util/s60pixelmetrics/pixel_metrics.cpp1223
-rw-r--r--util/s60pixelmetrics/pixel_metrics.h216
-rw-r--r--util/s60pixelmetrics/pm_mapper.hrh73
-rw-r--r--util/s60pixelmetrics/pm_mapper.mmp91
-rw-r--r--util/s60pixelmetrics/pm_mapper.pkg32
-rw-r--r--util/s60pixelmetrics/pm_mapper.rss162
-rw-r--r--util/s60pixelmetrics/pm_mapper_reg.rss57
-rw-r--r--util/s60pixelmetrics/pm_mapperapp.cpp1044
-rw-r--r--util/s60pixelmetrics/pm_mapperapp.h198
-rw-r--r--util/s60pixelmetrics/pm_mapperview.cpp375
-rw-r--r--util/s60pixelmetrics/pm_mapperview.h228
-rw-r--r--util/s60theme/README31
-rw-r--r--util/s60theme/main.cpp78
-rw-r--r--util/s60theme/s60theme.pro12
-rw-r--r--util/s60theme/s60themeconvert.cpp301
-rw-r--r--util/s60theme/s60themeconvert.h54
1431 files changed, 60282 insertions, 4719 deletions
diff --git a/.gitignore b/.gitignore
index 0de9563..4c2ba32 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,6 +37,8 @@ tags
.DS_Store
*.debug
Makefile*
+!qmake/Makefile.win32*
+!qmake/Makefile.unix
*.prl
*.app
*.pro.user
@@ -64,6 +66,7 @@ bin/qhelpconverter*
bin/qhelpgenerator*
bin/qtconfig*
bin/xmlpatterns*
+bin/cetest*
bin/collectiongenerator
bin/helpconverter
bin/helpgenerator
@@ -169,6 +172,31 @@ doc/qch
doc-build
.rcc
.pch
+
+# Symbian build system generated files
+# ---------------------
+
+ABLD.BAT
+bld.inf
+*.mmp
+*.mk
+*.rss
+*.loc
+!s60main.rss
+*.pkg
+plugin_commonU.def
+*.qtplugin
+*.sis
+*.sisx
+
+# Generated by abldfast.bat from devtools.
+.abldsteps.*
+
+# Carbide project files
+# ---------------------
+.project
+.cproject
+
src/corelib/lib
src/network/lib
src/xml/lib/
diff --git a/bin/createpackage.bat b/bin/createpackage.bat
new file mode 100644
index 0000000..116d52b
--- /dev/null
+++ b/bin/createpackage.bat
@@ -0,0 +1,106 @@
+@echo off
+
+set installsigned_old=%installsigned%
+set pkgfile_old=%pkgfile%
+set basename_old=%basename%
+set signsis1_old=%signsis1%
+set signsis2_old=%signsis2%
+set signsis3_old=%signsis3%
+set unsigned_sis_name_old=%unsigned_sis_name%
+set signed_sis_name_old=%signed_sis_name%
+set scriptpath_old=%scriptpath%
+set certificate_old=%certificate%
+
+rem Help text
+if "%1"=="" (
+ echo Convenience script for creating signed packages you can install on your phone.
+ echo Usage: createpackage.bat [-i] myexample_armv5_udeb.pkg [certificate key [passphrase]]
+ echo.
+ echo If no certificate and key files are provided, either a RnD certificate or
+ echo a self-signed certificate from Qt installation root directory is used.
+ echo.
+ echo To install the package right away using PC suite, use -i argument.
+ goto done
+)
+
+if "%1"=="-i" (
+ set installsigned=true
+ set pkgfile=%2
+ set basename=%~n2
+ set signsis1=%3
+ set signsis2=%4
+ set signsis3=%5
+) else (
+ set installsigned=false
+ set pkgfile=%1
+ set basename=%~n1
+ set signsis1=%2
+ set signsis2=%3
+ set signsis3=%4
+)
+
+set unsigned_sis_name=%basename%_unsigned.sis
+set signed_sis_name=%basename%.sis
+
+rem Get absolute path to this script
+set scriptpath=%~dp0
+
+rem Check the .pkg actually exists.
+if not exist %pkgfile% (
+ echo Error: Package description file '%pkgfile%' does not exist.
+ goto done
+)
+
+rem Remove any existing .sis packages
+if exist %signed_sis_name% del %signed_sis_name%
+if exist %unsigned_sis_name% del %unsigned_sis_name%
+
+rem Create .sis package
+makesis %pkgfile% %unsigned_sis_name%
+
+rem If no certificate is given, check default options
+if x%signsis1% == x (
+ rem If RnD certificate is not found, sign with self signed certificate
+ if not exist %scriptpath%..\rd.cer (
+ set certificate=Self signed
+ signsis %unsigned_sis_name% %signed_sis_name% %scriptpath%..\selfsigned.cer %scriptpath%..\selfsigned.key
+ goto install
+ )
+
+ rem Sign with RnD certificate
+ set certificate=RnD
+ signsis %unsigned_sis_name% %signed_sis_name% %scriptpath%..\rd.cer %scriptpath%..\rd-key.pem
+) else (
+ if x%signsis2% == x (
+ echo Custom certificate key file parameter missing.
+ goto cleanup
+ )
+
+ set certificate=%signsis1%
+ signsis %unsigned_sis_name% %signed_sis_name% %signsis1% %signsis2% %signsis3%
+)
+
+:install
+if exist %signed_sis_name% (
+ echo Successfully created %signed_sis_name% using certificate %certificate%
+ if "%installsigned%" == "true" (
+ echo Installing %signed_sis_name%...
+ call %signed_sis_name%
+ )
+)
+
+:cleanup
+if exist %unsigned_sis_name% del %unsigned_sis_name%
+
+:done
+
+set installsigned=%installsigned_old%
+set pkgfile=%pkgfile_old%
+set basename=%basename_old%
+set signsis1=%signsis1_old%
+set signsis2=%signsis2_old%
+set signsis3=%signsis3_old%
+set unsigned_sis_name=%unsigned_sis_name_old%
+set signed_sis_name=%signed_sis_name_old%
+set scriptpath=%scriptpath_old%
+set certificate=%certificate_old%
diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl
new file mode 100644
index 0000000..4c4e67a
--- /dev/null
+++ b/bin/patch_capabilities.pl
@@ -0,0 +1,107 @@
+#######################################################################
+#
+# A script for setting binary capabilities based on .pkg file contents.
+#
+# Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+# Contact: Qt Software Information (qt-info@nokia.com)
+#
+#######################################################################
+
+my @capabilitiesToSet = ("LocalServices", "NetworkServices", "ReadUserData", "UserEnvironment", "WriteUserData");
+
+# If arguments were given to the script,
+if (@ARGV)
+{
+ # Parse the first given script argument as a ".pkg" file name.
+ my $pkgFileName = shift(@ARGV);
+
+ # If the specified ".pkg" file exists (and can be read),
+ if (($pkgFileName =~ m|\.pkg$|i) && -r($pkgFileName))
+ {
+ # If there are more arguments given, parse them as capabilities.
+ if (@ARGV)
+ {
+ @capabilitiesToSet = ();
+ while (@ARGV)
+ {
+ push (@capabilitiesToSet, pop(@ARGV));
+ }
+ }
+
+ # Start with no binaries listed.
+ my @binaries = ();
+
+ my $tempPkgFileName = $pkgFileName."_@@TEMP@@";
+ unlink($tempPkgFileName);
+ open (NEW_PKG, ">>".$tempPkgFileName);
+ open (PKG, "<".$pkgFileName);
+
+ # Parse each line.
+ while (<PKG>)
+ {
+ my $line = $_;
+ my $newLine = $line;
+ if ( $line =~ m/^\#.*\(0x[0-9|a-f|A-F]*\).*$/)
+ {
+ $newLine =~ s/\(0x./\(0xE/;
+ }
+ print NEW_PKG $newLine;
+
+ chomp ($line);
+
+ # If the line specifies a file, parse the source and destination locations.
+ if ($line =~ m|\"([^\"]+)\"\s*\-\s*\"([^\"]+)\"|)
+ {
+ my $sourcePath = $1;
+ my $destinationPath = $2;
+
+ # If the given file is a binary, check the target and binary type (+ the actual filename) from its path.
+ if ($sourcePath =~ m:/epoc32/release/([^/]+)/(udeb|urel)/(\w+(\.dll|\.exe)):i)
+ {
+ push (@binaries, $sourcePath);
+ }
+ }
+ }
+
+ close (PKG);
+ close (NEW_PKG);
+
+ unlink($pkgFileName);
+ rename($tempPkgFileName, $pkgFileName);
+
+ print ("\n");
+
+ my $baseCommandToExecute = "elftran -vid 0x0 -capability \"";
+ if (@capabilitiesToSet)
+ {
+ $baseCommandToExecute .= join(" ", @capabilitiesToSet);
+ }
+ $baseCommandToExecute .= "\" ";
+
+ # Actually set the capabilities of the listed binaries.
+ foreach my $binaryPath(@binaries)
+ {
+ # Create the command line for setting the capabilities.
+ my $commandToExecute = $baseCommandToExecute;
+ $commandToExecute .= $binaryPath;
+
+ # Actually execute the elftran command to set the capabilities.
+ system ($commandToExecute." > NUL");
+ print ("Executed ".$commandToExecute."\n");
+
+ ## Create another command line to check that the set capabilities are correct.
+ #$commandToExecute = "elftran -dump s ".$binaryPath;
+ }
+
+ print ("\n");
+ }
+}
+else
+{
+ print("This script can be used to set capabilities of all binaries\n");
+ print("specified for deployment in a .pkg file.\n");
+ print("If no capabilities are given, the binaries will be given the\n");
+ print("capabilities supported by self-signed certificates.\n");
+ print("\nUsage: patch_capabilities.pl pkg_filename [capability list]\n");
+ print("\nE.g. patch_capabilities.pl myapp_armv5_urel.pkg \"All -TCB\"\n");
+} \ No newline at end of file
diff --git a/config.tests/unix/openssl/openssl.pri b/config.tests/unix/openssl/openssl.pri
index bc95479..c8703c2 100644
--- a/config.tests/unix/openssl/openssl.pri
+++ b/config.tests/unix/openssl/openssl.pri
@@ -7,3 +7,11 @@
exists($$pp):INCLUDEPATH *= $$p
}
}
+
+symbian{
+ TRY_INCLUDEPATHS = $${EPOCROOT}epoc32 $${EPOCROOT}epoc32/include $${EPOCROOT}epoc32/include/stdapis $${EPOCROOT}epoc32/include/stdapis/sys $$OS_LAYER_LIBC_SYSTEMINCLUDE $$QMAKE_INCDIR $$INCLUDEPATH
+ for(p, TRY_INCLUDEPATHS) {
+ pp = $$join(p, "", "", "/openssl")
+ exists($$pp):INCLUDEPATH *= $$pp
+ }
+}
diff --git a/configure.exe b/configure.exe
index cfad2dd..c90e029 100644..100755
--- a/configure.exe
+++ b/configure.exe
Binary files differ
diff --git a/demos/affine/affine.pro b/demos/affine/affine.pro
index b928753..4973496 100644
--- a/demos/affine/affine.pro
+++ b/demos/affine/affine.pro
@@ -18,6 +18,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html *.jpg
sources.path = $$[QT_INSTALL_DEMOS]/affine
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
wince*: {
DEPLOYMENT_PLUGIN += qjpeg
}
diff --git a/demos/arthurplugin/arthurplugin.pro b/demos/arthurplugin/arthurplugin.pro
index e9eb1f3..d4827a1 100644
--- a/demos/arthurplugin/arthurplugin.pro
+++ b/demos/arthurplugin/arthurplugin.pro
@@ -44,6 +44,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.jpg *.png
sources.path = $$[QT_INSTALL_DEMOS]/arthurplugin
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
win32-msvc* {
QMAKE_CFLAGS += /Zm500
QMAKE_CXXFLAGS += /Zm500
diff --git a/demos/books/books.pro b/demos/books/books.pro
index a2cd33f..94b049a 100644
--- a/demos/books/books.pro
+++ b/demos/books/books.pro
@@ -13,6 +13,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro images
sources.path = $$[QT_INSTALL_DEMOS]/books
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
wince*: {
CONFIG(debug, debug|release):sqlPlugins.sources = $$QT_BUILD_TREE/plugins/sqldrivers/*d4.dll
CONFIG(release, debug|release):sqlPlugins.sources = $$QT_BUILD_TREE/plugins/sqldrivers/*[^d]4.dll
diff --git a/demos/browser/browser.pro b/demos/browser/browser.pro
index 13e8a1d..ca00062 100644
--- a/demos/browser/browser.pro
+++ b/demos/browser/browser.pro
@@ -3,7 +3,7 @@ TARGET = browser
QT += webkit network
CONFIG += qt warn_on
-contains(QT_BUILD_PARTS, tools): CONFIG += uitools
+contains(QT_BUILD_PARTS, tools):!symbian: CONFIG += uitools
else: DEFINES += QT_NO_UITOOLS
FORMS += \
@@ -89,3 +89,7 @@ target.path = $$[QT_INSTALL_DEMOS]/browser
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.plist *.icns *.ico *.rc *.pro *.html *.doc images htmls data
sources.path = $$[QT_INSTALL_DEMOS]/browser
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF70
diff --git a/demos/browser/browsermainwindow.cpp b/demos/browser/browsermainwindow.cpp
index f1dcaef..37b8ddc 100644
--- a/demos/browser/browsermainwindow.cpp
+++ b/demos/browser/browsermainwindow.cpp
@@ -575,7 +575,7 @@ QUrl BrowserMainWindow::guessUrlFromString(const QString &string)
int dotIndex = urlStr.indexOf(QLatin1Char('.'));
if (dotIndex != -1) {
QString prefix = urlStr.left(dotIndex).toLower();
- QByteArray schema = (prefix == QLatin1String("ftp")) ? prefix.toLatin1() : "http";
+ QByteArray schema = (prefix == QLatin1String("ftp")) ? prefix.toLatin1() : QByteArray("http");
QUrl url =
QUrl::fromEncoded(schema + "://" + urlStr.toUtf8(), QUrl::TolerantMode);
if (url.isValid())
diff --git a/demos/browser/searchlineedit.cpp b/demos/browser/searchlineedit.cpp
index 8f668e0..aa00475 100644
--- a/demos/browser/searchlineedit.cpp
+++ b/demos/browser/searchlineedit.cpp
@@ -50,7 +50,9 @@
ClearButton::ClearButton(QWidget *parent)
: QAbstractButton(parent)
{
+#ifndef QT_NO_CURSOR
setCursor(Qt::ArrowCursor);
+#endif // QT_NO_CURSOR
setToolTip(tr("Clear"));
setVisible(false);
setFocusPolicy(Qt::NoFocus);
@@ -103,7 +105,9 @@ SearchButton::SearchButton(QWidget *parent)
m_menu(0)
{
setObjectName(QLatin1String("SearchButton"));
+#ifndef QT_NO_CURSOR
setCursor(Qt::ArrowCursor);
+#endif //QT_NO_CURSOR
setFocusPolicy(Qt::NoFocus);
}
diff --git a/demos/browser/webview.cpp b/demos/browser/webview.cpp
index 6c4d857..63505f9 100644
--- a/demos/browser/webview.cpp
+++ b/demos/browser/webview.cpp
@@ -54,7 +54,9 @@
#include <QtWebKit/QWebHitTestResult>
+#ifndef QT_NO_UITOOLS
#include <QtUiTools/QUiLoader>
+#endif //QT_NO_UITOOLS
#include <QtCore/QDebug>
#include <QtCore/QBuffer>
diff --git a/demos/chip/chip.pro b/demos/chip/chip.pro
index 53fa23b..2c44e56 100644
--- a/demos/chip/chip.pro
+++ b/demos/chip/chip.pro
@@ -17,3 +17,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.png *.pro *.html *.doc images
sources.path = $$[QT_INSTALL_DEMOS]/chip
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/demos/composition/composition.pro b/demos/composition/composition.pro
index d5c4a60..90562eb 100644
--- a/demos/composition/composition.pro
+++ b/demos/composition/composition.pro
@@ -17,6 +17,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.png *.jpg *.pro *.html
sources.path = $$[QT_INSTALL_DEMOS]/composition
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
win32-msvc* {
QMAKE_CXXFLAGS += /Zm500
QMAKE_CFLAGS += /Zm500
diff --git a/demos/deform/deform.pro b/demos/deform/deform.pro
index db8484d..31ba2e9 100644
--- a/demos/deform/deform.pro
+++ b/demos/deform/deform.pro
@@ -17,3 +17,7 @@ target.path = $$[QT_INSTALL_DEMOS]/deform
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html
sources.path = $$[QT_INSTALL_DEMOS]/deform
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian:TARGET.UID3 = 0xA000A63D
diff --git a/demos/deform/pathdeform.cpp b/demos/deform/pathdeform.cpp
index 2e1d89a..4026241 100644
--- a/demos/deform/pathdeform.cpp
+++ b/demos/deform/pathdeform.cpp
@@ -53,6 +53,10 @@
#include <QDesktopWidget>
#include <qmath.h>
+#if defined(Q_OS_SYMBIAN)
+// TODO: Remove all FONT_OUTLINE_TWEAK related code as soon as the S60FontEngine can deliver outlines
+#define FONT_OUTLINE_TWEAK
+#endif
PathDeformControls::PathDeformControls(QWidget *parent, PathDeformRenderer* renderer, bool smallScreen)
: QWidget(parent)
@@ -241,6 +245,14 @@ void PathDeformControls::layoutForSmallScreen()
QRect screen_size = QApplication::desktop()->screenGeometry();
radiusSlider->setValue(qMin(screen_size.width(), screen_size.height())/5);
+
+#ifdef FONT_OUTLINE_TWEAK
+ radiusSlider->setValue(qMin(screen_size.width(), screen_size.height())/7);
+ fontSizeLabel->setText("Qt Logo Size:");
+ m_renderer->setText("A"); // Any Letter would be fine
+ fontSizeSlider->setValue(100);
+#endif
+
m_renderer->setText(tr("Qt"));
}
diff --git a/demos/demobase.pri b/demos/demobase.pri
new file mode 100644
index 0000000..c0bba64
--- /dev/null
+++ b/demos/demobase.pri
@@ -0,0 +1 @@
+symbian:RSS_RULES = "group_name=\"QtDemos\";" \ No newline at end of file
diff --git a/demos/demos.pro b/demos/demos.pro
index 6084550..3856591 100644
--- a/demos/demos.pro
+++ b/demos/demos.pro
@@ -1,26 +1,31 @@
TEMPLATE = subdirs
SUBDIRS = \
- demos_shared \
- demos_deform \
- demos_gradients \
- demos_pathstroke \
- demos_affine \
- demos_composition \
- demos_books \
- demos_interview \
- demos_mainwindow \
- demos_spreadsheet \
- demos_textedit \
- demos_chip \
- demos_embeddeddialogs \
- demos_undo
+ demos_shared \
+ demos_deform \
+ demos_gradients \
+ demos_pathstroke \
+ demos_affine \
+ demos_composition \
+ demos_books \
+ demos_interview \
+ demos_mainwindow \
+ demos_spreadsheet \
+ demos_textedit \
+ demos_chip \
+ demos_embeddeddialogs \
+ demos_undo
+
+symbian: SUBDIRS = \
+ demos_shared \
+ demos_deform \
+ demos_pathstroke
contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles1cl):!contains(QT_CONFIG, opengles2):{
SUBDIRS += demos_boxes
}
mac*: SUBDIRS += demos_macmainwindow
-wince*|embedded: SUBDIRS += embedded
+wince*|symbian|embedded: SUBDIRS += embedded
!contains(QT_EDITION, Console):!cross_compile:!embedded:!wince*:SUBDIRS += demos_arthurplugin
@@ -38,6 +43,8 @@ sources.files = README *.pro
sources.path = $$[QT_INSTALL_DEMOS]
INSTALLS += sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
demos_chip.subdir = chip
demos_embeddeddialogs.subdir = embeddeddialogs
demos_shared.subdir = shared
diff --git a/demos/embedded/anomaly/README.TXT b/demos/embedded/anomaly/README.TXT
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/demos/embedded/anomaly/README.TXT
diff --git a/demos/embedded/anomaly/anomaly.pro b/demos/embedded/anomaly/anomaly.pro
new file mode 100644
index 0000000..cf9277e
--- /dev/null
+++ b/demos/embedded/anomaly/anomaly.pro
@@ -0,0 +1,32 @@
+QT += network \
+ webkit
+HEADERS += src/BrowserWindow.h \
+ src/BrowserView.h \
+ src/TitleBar.h \
+ src/HomeView.h \
+ src/AddressBar.h \
+ src/BookmarksView.h \
+ src/flickcharm.h \
+ src/ZoomStrip.h \
+ src/ControlStrip.h
+SOURCES += src/Main.cpp \
+ src/BrowserWindow.cpp \
+ src/BrowserView.cpp \
+ src/TitleBar.cpp \
+ src/HomeView.cpp \
+ src/AddressBar.cpp \
+ src/BookmarksView.cpp \
+ src/flickcharm.cpp \
+ src/ZoomStrip.cpp \
+ src/ControlStrip.cpp
+RESOURCES += src/anomaly.qrc
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian {
+ HEADERS += $$QT_SOURCE_TREE/examples/network/ftp/sym_iap_util.h
+ LIBS += -lesock -lconnmon
+ TARGET.CAPABILITY = NetworkServices
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ TARGET.UID3 = 0xA000CF71
+}
diff --git a/demos/embedded/anomaly/src/AddressBar.cpp b/demos/embedded/anomaly/src/AddressBar.cpp
new file mode 100644
index 0000000..64734c8
--- /dev/null
+++ b/demos/embedded/anomaly/src/AddressBar.cpp
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "AddressBar.h"
+
+#include <QtCore>
+#include <QtGui>
+
+class LineEdit: public QLineEdit
+{
+public:
+ LineEdit(QWidget *parent = 0): QLineEdit(parent) {}
+
+ void paintEvent(QPaintEvent *event) {
+ QLineEdit::paintEvent(event);
+ if (text().isEmpty()) {
+ QPainter p(this);
+ int flags = Qt::AlignLeft | Qt::AlignVCenter;
+ p.setPen(palette().color(QPalette::Disabled, QPalette::Text));
+ p.drawText(rect().adjusted(10, 0, 0, 0), flags, "Enter address or search terms");
+ p.end();
+ }
+ }
+};
+
+AddressBar::AddressBar(QWidget *parent)
+ : QWidget(parent)
+{
+ m_lineEdit = new LineEdit(parent);
+ connect(m_lineEdit, SIGNAL(returnPressed()), SLOT(processAddress()));
+ m_toolButton = new QToolButton(parent);
+ m_toolButton->setText("Go");
+ connect(m_toolButton, SIGNAL(clicked()), SLOT(processAddress()));
+}
+
+QSize AddressBar::sizeHint() const
+{
+ return m_lineEdit->sizeHint();
+}
+
+void AddressBar::processAddress()
+{
+ if (!m_lineEdit->text().isEmpty())
+ emit addressEntered(m_lineEdit->text());
+}
+
+void AddressBar::resizeEvent(QResizeEvent *event)
+{
+ int x, y, w, h;
+
+ m_toolButton->adjustSize();
+ x = width() - m_toolButton->width();
+ y = 0;
+ w = m_toolButton->width();
+ h = height() - 1;
+ m_toolButton->setGeometry(x, y, w, h);
+ m_toolButton->show();
+
+ x = 0;
+ y = 0;
+ w = width() - m_toolButton->width();
+ h = height() - 1;
+ m_lineEdit->setGeometry(x, y, w, h);
+ m_lineEdit->show();
+}
+
+void AddressBar::focusInEvent(QFocusEvent *event)
+{
+ m_lineEdit->setFocus();
+ QWidget::focusInEvent(event);
+}
diff --git a/demos/embedded/anomaly/src/AddressBar.h b/demos/embedded/anomaly/src/AddressBar.h
new file mode 100644
index 0000000..632ae1f
--- /dev/null
+++ b/demos/embedded/anomaly/src/AddressBar.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef ADDRESSBAR_H
+#define ADDRESSBAR_H
+
+#include <QWidget>
+
+class QLineEdit;
+class QToolButton;
+
+class AddressBar : public QWidget
+{
+ Q_OBJECT
+
+public:
+ AddressBar(QWidget *parent = 0);
+ QSize sizeHint() const;
+
+protected:
+ void resizeEvent(QResizeEvent *event);
+ void focusInEvent(QFocusEvent *event);
+
+signals:
+ void addressEntered(const QString &address);
+
+private slots:
+ void processAddress();
+
+private:
+ QLineEdit *m_lineEdit;
+ QToolButton *m_toolButton;
+};
+
+#endif // ADDRESSBAR_H
diff --git a/demos/embedded/anomaly/src/BookmarksView.cpp b/demos/embedded/anomaly/src/BookmarksView.cpp
new file mode 100644
index 0000000..f705383
--- /dev/null
+++ b/demos/embedded/anomaly/src/BookmarksView.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "BookmarksView.h"
+
+#include <QtGui>
+
+BookmarksView::BookmarksView(QWidget *parent)
+ : QWidget(parent)
+{
+ QListWidget *m_iconView = new QListWidget(this);
+ connect(m_iconView, SIGNAL(itemActivated(QListWidgetItem*)), SLOT(activate(QListWidgetItem*)));
+
+ QVBoxLayout *layout = new QVBoxLayout(this);
+ setLayout(layout);
+ layout->addWidget(m_iconView);
+
+ m_iconView->addItem("www.google.com");
+ m_iconView->addItem("doc.trolltech.com/4.5");
+ m_iconView->addItem("news.bbc.co.uk/text_only.stm");
+ m_iconView->addItem("mobile.wikipedia.org");
+ m_iconView->addItem("www.qtsoftware.com");
+ m_iconView->addItem("en.wikipedia.org");
+
+ setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+}
+
+void BookmarksView::activate(QListWidgetItem *item)
+{
+ QUrl url = item->text().prepend("http://");
+ emit urlSelected(url);
+}
diff --git a/demos/embedded/anomaly/src/BookmarksView.h b/demos/embedded/anomaly/src/BookmarksView.h
new file mode 100644
index 0000000..95abdd7
--- /dev/null
+++ b/demos/embedded/anomaly/src/BookmarksView.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef BOOKMARKSVIEW_H
+#define BOOKMARKSVIEW_H
+
+#include <QWidget>
+
+class QListWidgetItem;
+class QUrl;
+
+class BookmarksView : public QWidget
+{
+ Q_OBJECT
+
+public:
+ BookmarksView(QWidget *parent = 0);
+
+signals:
+ void urlSelected(const QUrl &url);
+
+private slots:
+ void activate(QListWidgetItem *item);
+};
+
+#endif // BOOKMARKSVIEW_H
diff --git a/demos/embedded/anomaly/src/BrowserView.cpp b/demos/embedded/anomaly/src/BrowserView.cpp
new file mode 100644
index 0000000..e81d834
--- /dev/null
+++ b/demos/embedded/anomaly/src/BrowserView.cpp
@@ -0,0 +1,153 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "BrowserView.h"
+
+#include <QtGui>
+#include <QtNetwork>
+#include <QtWebKit>
+
+#include "ControlStrip.h"
+#include "TitleBar.h"
+#include "flickcharm.h"
+#include "ZoomStrip.h"
+
+BrowserView::BrowserView(QWidget *parent)
+ : QWidget(parent)
+ , m_titleBar(0)
+ , m_webView(0)
+ , m_progress(0)
+ , m_currentZoom(100)
+{
+ m_titleBar = new TitleBar(this);
+ m_webView = new QWebView(this);
+ m_zoomStrip = new ZoomStrip(this);
+ m_controlStrip = new ControlStrip(this);
+
+ m_zoomLevels << 30 << 50 << 67 << 80 << 90;
+ m_zoomLevels << 100;
+ m_zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300;
+
+ QTimer::singleShot(0, this, SLOT(initialize()));
+}
+
+void BrowserView::initialize()
+{
+ connect(m_zoomStrip, SIGNAL(zoomInClicked()), SLOT(zoomIn()));
+ connect(m_zoomStrip, SIGNAL(zoomOutClicked()), SLOT(zoomOut()));
+
+ connect(m_controlStrip, SIGNAL(menuClicked()), SIGNAL(menuButtonClicked()));
+ connect(m_controlStrip, SIGNAL(backClicked()), m_webView, SLOT(back()));
+ connect(m_controlStrip, SIGNAL(forwardClicked()), m_webView, SLOT(forward()));
+
+ QPalette pal = m_webView->palette();
+ pal.setBrush(QPalette::Base, Qt::white);
+ m_webView->setPalette(pal);
+
+ FlickCharm *flickCharm = new FlickCharm(this);
+ flickCharm->activateOn(m_webView);
+
+ m_webView->setZoomFactor(static_cast<qreal>(m_currentZoom)/100.0);
+ connect(m_webView, SIGNAL(loadStarted()), SLOT(start()));
+ connect(m_webView, SIGNAL(loadProgress(int)), SLOT(setProgress(int)));
+ connect(m_webView, SIGNAL(loadFinished(bool)), SLOT(finish(bool)));
+ connect(m_webView, SIGNAL(urlChanged(QUrl)), SLOT(updateTitleBar()));
+
+ m_webView->load(QUrl("http://news.bbc.co.uk/text_only.stm"));
+ m_webView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ m_webView->setFocus();
+}
+
+void BrowserView::start()
+{
+ m_progress = 0;
+ updateTitleBar();
+ //m_titleBar->setText(m_webView->url().toString());
+}
+
+void BrowserView::setProgress(int percent)
+{
+ m_progress = percent;
+ updateTitleBar();
+ //m_titleBar->setText(QString("Loading %1%").arg(percent));
+}
+
+void BrowserView::updateTitleBar()
+{
+ QUrl url = m_webView->url();
+ m_titleBar->setHost(url.host());
+ m_titleBar->setTitle(m_webView->title());
+ m_titleBar->setProgress(m_progress);
+}
+
+void BrowserView::finish(bool ok)
+{
+ m_progress = 0;
+ updateTitleBar();
+
+ // TODO: handle error
+ if (!ok) {
+ //m_titleBar->setText("Loading failed.");
+ }
+}
+
+void BrowserView::zoomIn()
+{
+ int i = m_zoomLevels.indexOf(m_currentZoom);
+ Q_ASSERT(i >= 0);
+ if (i < m_zoomLevels.count() - 1)
+ m_currentZoom = m_zoomLevels[i + 1];
+
+ m_webView->setZoomFactor(static_cast<qreal>(m_currentZoom)/100.0);
+}
+
+void BrowserView::zoomOut()
+{
+ int i = m_zoomLevels.indexOf(m_currentZoom);
+ Q_ASSERT(i >= 0);
+ if (i > 0)
+ m_currentZoom = m_zoomLevels[i - 1];
+
+ m_webView->setZoomFactor(static_cast<qreal>(m_currentZoom)/100.0);
+}
+
+void BrowserView::resizeEvent(QResizeEvent *event)
+{
+ QWidget::resizeEvent(event);
+
+ int h1 = m_titleBar->sizeHint().height();
+ int h2 = m_controlStrip->sizeHint().height();
+
+ m_titleBar->setGeometry(0, 0, width(), h1);
+ m_controlStrip->setGeometry(0, height() - h2, width(), h2);
+ m_webView->setGeometry(0, h1, width(), height() - h1);
+
+ int zw = m_zoomStrip->sizeHint().width();
+ int zh = m_zoomStrip->sizeHint().height();
+ m_zoomStrip->move(width() - zw, (height() - zh) / 2);
+}
+
+void BrowserView::navigate(const QUrl &url)
+{
+ m_webView->load(url);
+}
diff --git a/demos/embedded/anomaly/src/BrowserView.h b/demos/embedded/anomaly/src/BrowserView.h
new file mode 100644
index 0000000..36d3291
--- /dev/null
+++ b/demos/embedded/anomaly/src/BrowserView.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef BROWSERVIEW_H
+#define BROWSERVIEW_H
+
+#include <QWidget>
+#include <QVector>
+
+class QUrl;
+class QWebView;
+class TitleBar;
+class ControlStrip;
+class ZoomStrip;
+
+class BrowserView : public QWidget
+{
+ Q_OBJECT
+
+public:
+ BrowserView(QWidget *parent = 0);
+
+public slots:
+ void navigate(const QUrl &url);
+ void zoomIn();
+ void zoomOut();
+
+private slots:
+ void initialize();
+ void start();
+ void setProgress(int percent);
+ void finish(bool);
+ void updateTitleBar();
+
+signals:
+ void menuButtonClicked();
+
+protected:
+ void resizeEvent(QResizeEvent *event);
+
+private:
+ TitleBar *m_titleBar;
+ QWebView *m_webView;
+ ZoomStrip *m_zoomStrip;
+ ControlStrip *m_controlStrip;
+ int m_progress;
+ int m_currentZoom;
+ QVector<int> m_zoomLevels;
+};
+
+#endif // BROWSERVIEW_H
diff --git a/demos/embedded/anomaly/src/BrowserWindow.cpp b/demos/embedded/anomaly/src/BrowserWindow.cpp
new file mode 100644
index 0000000..fd2f833
--- /dev/null
+++ b/demos/embedded/anomaly/src/BrowserWindow.cpp
@@ -0,0 +1,169 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "BrowserWindow.h"
+
+#include <QtCore>
+#include <QtGui>
+
+#include "BrowserView.h"
+#include "HomeView.h"
+
+BrowserWindow::BrowserWindow()
+ : QWidget()
+ , m_homeView(0)
+ , m_browserView(0)
+{
+ m_timeLine = new QTimeLine(300, this);
+ m_timeLine->setCurveShape(QTimeLine::EaseInOutCurve);
+ QTimer::singleShot(0, this, SLOT(initialize()));
+}
+
+void BrowserWindow::initialize()
+{
+ m_homeView = new HomeView(this);
+ m_browserView = new BrowserView(this);
+
+ m_homeView->hide();
+ m_homeView->resize(size());
+ m_homeView->move(0, 0);
+
+ m_browserView->hide();
+ m_browserView->resize(size());
+ m_browserView->move(0, 0);
+
+ connect(m_homeView, SIGNAL(addressEntered(QString)), SLOT(gotoAddress(QString)));
+ connect(m_homeView, SIGNAL(urlActivated(QUrl)), SLOT(navigate(QUrl)));
+
+ connect(m_browserView, SIGNAL(menuButtonClicked()), SLOT(showHomeView()));
+
+ m_homeView->setVisible(false);
+ m_browserView->setVisible(false);
+ slide(0);
+
+ connect(m_timeLine, SIGNAL(frameChanged(int)), SLOT(slide(int)));
+}
+
+
+// from Demo Browser
+QUrl guessUrlFromString(const QString &string)
+{
+ QString urlStr = string.trimmed();
+ QRegExp test(QLatin1String("^[a-zA-Z]+\\:.*"));
+
+ // Check if it looks like a qualified URL. Try parsing it and see.
+ bool hasSchema = test.exactMatch(urlStr);
+ if (hasSchema) {
+ QUrl url = QUrl::fromEncoded(urlStr.toUtf8(), QUrl::TolerantMode);
+ if (url.isValid())
+ return url;
+ }
+
+ // Might be a file.
+ if (QFile::exists(urlStr)) {
+ QFileInfo info(urlStr);
+ return QUrl::fromLocalFile(info.absoluteFilePath());
+ }
+
+ // Might be a shorturl - try to detect the schema.
+ if (!hasSchema) {
+ int dotIndex = urlStr.indexOf(QLatin1Char('.'));
+ if (dotIndex != -1) {
+ QString prefix = urlStr.left(dotIndex).toLower();
+ QString schema = (prefix == QString("ftp")) ? prefix.toLatin1() : QString("http");
+ QString location = schema + "://" + urlStr;
+ QUrl url = QUrl::fromEncoded(location.toUtf8(), QUrl::TolerantMode);
+ if (url.isValid())
+ return url;
+ }
+ }
+
+ // Fall back to QUrl's own tolerant parser.
+ QUrl url = QUrl::fromEncoded(string.toUtf8(), QUrl::TolerantMode);
+
+ // finally for cases where the user just types in a hostname add http
+ if (url.scheme().isEmpty())
+ url = QUrl::fromEncoded("http://" + string.toUtf8(), QUrl::TolerantMode);
+ return url;
+}
+
+void BrowserWindow::gotoAddress(const QString &address)
+{
+ m_browserView->navigate(guessUrlFromString(address));
+ showBrowserView();
+}
+
+void BrowserWindow::navigate(const QUrl &url)
+{
+ m_browserView->navigate(url);
+ showBrowserView();
+}
+
+void BrowserWindow::slide(int pos)
+{
+ m_browserView->move(pos, 0);
+ m_homeView->move(pos - width(), 0);
+ m_browserView->show();
+ m_homeView->show();
+}
+
+void BrowserWindow::showHomeView()
+{
+ if (m_timeLine->state() != QTimeLine::NotRunning)
+ return;
+
+ m_timeLine->setFrameRange(0, width());
+ m_timeLine->start();
+ m_homeView->setFocus();
+}
+
+void BrowserWindow::showBrowserView()
+{
+ if (m_timeLine->state() != QTimeLine::NotRunning)
+ return;
+
+ m_timeLine->setFrameRange(width(), 0);
+ m_timeLine->start();
+ m_browserView->setFocus();
+}
+
+void BrowserWindow::keyReleaseEvent(QKeyEvent *event)
+{
+ QWidget::keyReleaseEvent(event);
+
+ if (event->key() == Qt::Key_F3) {
+ if (m_homeView->isVisible())
+ showBrowserView();
+ else
+ showHomeView();
+ }
+}
+
+void BrowserWindow::resizeEvent(QResizeEvent *event)
+{
+ if (m_homeView)
+ m_homeView->resize(size());
+
+ if (m_browserView)
+ m_browserView->resize(size());
+}
diff --git a/demos/embedded/anomaly/src/BrowserWindow.h b/demos/embedded/anomaly/src/BrowserWindow.h
new file mode 100644
index 0000000..50a6508
--- /dev/null
+++ b/demos/embedded/anomaly/src/BrowserWindow.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef BROWSERWINDOW_H
+#define BROWSERWINDOW_H
+
+#include <QWidget>
+class QTimeLine;
+class QUrl;
+
+class BrowserView;
+class HomeView;
+
+class BrowserWindow : public QWidget
+{
+ Q_OBJECT
+
+public:
+ BrowserWindow();
+
+private slots:
+ void initialize();
+ void navigate(const QUrl &url);
+ void gotoAddress(const QString &address);
+
+public slots:
+ void showBrowserView();
+ void showHomeView();
+ void slide(int);
+
+protected:
+ void keyReleaseEvent(QKeyEvent *event);
+ void resizeEvent(QResizeEvent *event);
+
+private:
+ HomeView *m_homeView;
+ BrowserView *m_browserView;
+ QTimeLine *m_timeLine;
+};
+
+#endif // BROWSERWINDOW_H
diff --git a/demos/embedded/anomaly/src/ControlStrip.cpp b/demos/embedded/anomaly/src/ControlStrip.cpp
new file mode 100644
index 0000000..72bc485
--- /dev/null
+++ b/demos/embedded/anomaly/src/ControlStrip.cpp
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "ControlStrip.h"
+
+#include <QtCore>
+#include <QtGui>
+
+ControlStrip::ControlStrip(QWidget *parent)
+ : QWidget(parent)
+{
+ menuPixmap.load(":/images/edit-find.png");
+ backPixmap.load(":/images/go-previous.png");
+ forwardPixmap.load(":/images/go-next.png");
+}
+
+QSize ControlStrip::sizeHint() const
+{
+ return minimumSizeHint();
+}
+
+QSize ControlStrip::minimumSizeHint() const
+{
+ return QSize(320, 48);
+}
+
+void ControlStrip::mousePressEvent(QMouseEvent *event)
+{
+ int h = height();
+ int x = event->pos().x();
+
+ if (x < h) {
+ emit menuClicked();
+ event->accept();
+ return;
+ }
+
+ if (x > width() - h) {
+ emit forwardClicked();
+ event->accept();
+ return;
+ }
+
+ if ((x < width() - 2 * h) && (x > width() - 3 * h)) {
+ emit backClicked();
+ event->accept();
+ return;
+ }
+}
+
+void ControlStrip::paintEvent(QPaintEvent *event)
+{
+ int h = height();
+ int s = (h - menuPixmap.height()) / 2;
+
+ QPainter p(this);
+ p.fillRect(event->rect(), QColor(32, 32, 32, 192));
+ p.setCompositionMode(QPainter::CompositionMode_SourceOver);
+ p.drawPixmap(s, s, menuPixmap);
+ p.drawPixmap(width() - 3 * h + s, s, backPixmap);
+ p.drawPixmap(width() - h + s, s, forwardPixmap);
+ p.end();
+}
diff --git a/demos/embedded/anomaly/src/ControlStrip.h b/demos/embedded/anomaly/src/ControlStrip.h
new file mode 100644
index 0000000..99fc58d
--- /dev/null
+++ b/demos/embedded/anomaly/src/ControlStrip.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef CONTROLSTRIP_H
+#define CONTROLSTRIP_H
+
+#include <QWidget>
+
+class ControlStrip : public QWidget
+{
+ Q_OBJECT
+
+public:
+ ControlStrip(QWidget *parent = 0);
+
+ QSize sizeHint() const;
+ QSize minimumSizeHint() const;
+
+signals:
+ void menuClicked();
+ void backClicked();
+ void forwardClicked();
+
+protected:
+ void paintEvent(QPaintEvent *event);
+ void mousePressEvent(QMouseEvent *event);
+
+private:
+ QPixmap menuPixmap;
+ QPixmap backPixmap;
+ QPixmap forwardPixmap;
+};
+
+#endif // CONTROLSTRIP_H
diff --git a/demos/embedded/anomaly/src/HomeView.cpp b/demos/embedded/anomaly/src/HomeView.cpp
new file mode 100644
index 0000000..0f59d54
--- /dev/null
+++ b/demos/embedded/anomaly/src/HomeView.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "HomeView.h"
+
+#include <QtCore>
+#include <QtGui>
+
+#include "AddressBar.h"
+#include "BookmarksView.h"
+
+HomeView::HomeView(QWidget *parent)
+ : QWidget(parent)
+ , m_addressBar(0)
+{
+ m_addressBar = new AddressBar(parent);
+ connect(m_addressBar, SIGNAL(addressEntered(QString)), SLOT(gotoAddress(QString)));
+
+ m_bookmarks = new BookmarksView(parent);
+ connect(m_bookmarks, SIGNAL(urlSelected(QUrl)), SIGNAL(urlActivated(QUrl)));
+
+ QVBoxLayout *layout = new QVBoxLayout(this);
+ layout->setMargin(4);
+ layout->setSpacing(4);
+ layout->addWidget(m_addressBar);
+ layout->addWidget(m_bookmarks);
+}
+
+void HomeView::gotoAddress(const QString &address)
+{
+ emit addressEntered(address);
+}
+
+void HomeView::focusInEvent(QFocusEvent *event)
+{
+ m_addressBar->setFocus();
+ QWidget::focusInEvent(event);
+}
diff --git a/demos/embedded/anomaly/src/HomeView.h b/demos/embedded/anomaly/src/HomeView.h
new file mode 100644
index 0000000..b54f07e
--- /dev/null
+++ b/demos/embedded/anomaly/src/HomeView.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef HOMEVIEW_H
+#define HOMEVIEW_H
+
+#include <QWidget>
+
+class QUrl;
+
+class AddressBar;
+class BookmarksView;
+
+class HomeView : public QWidget
+{
+ Q_OBJECT
+
+public:
+ HomeView(QWidget *parent);
+
+signals:
+ void urlActivated(const QUrl &url);
+ void addressEntered(const QString &address);
+
+private slots:
+ void gotoAddress(const QString &address);
+
+protected:
+ void focusInEvent(QFocusEvent *event);
+
+private:
+ AddressBar *m_addressBar;
+ BookmarksView *m_bookmarks;
+};
+
+#endif // HOMEVIEW_H
diff --git a/demos/embedded/anomaly/src/Main.cpp b/demos/embedded/anomaly/src/Main.cpp
new file mode 100644
index 0000000..2be6143
--- /dev/null
+++ b/demos/embedded/anomaly/src/Main.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include <QtCore>
+#include <QtGui>
+#include <QtWebKit>
+
+#include "BrowserWindow.h"
+
+#if defined (Q_OS_SYMBIAN)
+#include "sym_iap_util.h"
+#endif
+
+int main(int argc, char *argv[])
+{
+#if !defined(Q_WS_S60)
+ QApplication::setGraphicsSystem("raster");
+#endif
+
+ QApplication app(argc, argv);
+
+ app.setApplicationName("Anomaly");
+ app.setApplicationVersion("0.0.0");
+
+ BrowserWindow window;
+#ifdef Q_OS_SYMBIAN
+ window.showFullScreen();
+ QWebSettings::globalSettings()->setObjectCacheCapacities(128*1024, 1024*1024, 1024*1024);
+ QWebSettings::globalSettings()->setMaximumPagesInCache(3);
+ qt_SetDefaultIap();
+#else
+ window.resize(360, 640);
+ window.show();
+ app.setStyle("windows");
+#endif
+
+ return app.exec();
+}
+
diff --git a/demos/embedded/anomaly/src/TitleBar.cpp b/demos/embedded/anomaly/src/TitleBar.cpp
new file mode 100644
index 0000000..ff7837c
--- /dev/null
+++ b/demos/embedded/anomaly/src/TitleBar.cpp
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "TitleBar.h"
+
+#include <QtCore>
+#include <QtGui>
+
+TitleBar::TitleBar(QWidget *parent)
+ : QWidget(parent)
+ , m_progress(0)
+{
+ setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
+}
+
+void TitleBar::setHost(const QString &host)
+{
+ m_host = host;
+ update();
+}
+
+void TitleBar::setTitle(const QString &title)
+{
+ m_title = title;
+ update();
+}
+
+void TitleBar::setProgress(int percent)
+{
+ m_progress = percent;
+ update();
+}
+
+QSize TitleBar::sizeHint() const
+{
+ return minimumSizeHint();
+}
+
+QSize TitleBar::minimumSizeHint() const
+{
+ QFontMetrics fm = fontMetrics();
+ return QSize(100, fm.height());
+}
+
+void TitleBar::paintEvent(QPaintEvent *event)
+{
+ QString title = m_host;
+ if (!m_title.isEmpty())
+ title.append(": ").append(m_title);
+
+ QPalette pal = palette();
+ QPainter p(this);
+ p.fillRect(event->rect(), pal.color(QPalette::Highlight));
+
+ if (m_progress > 0) {
+
+ QRect box = rect();
+ box.setLeft(16);
+ box.setWidth(width() - box.left() - 110);
+
+ p.setPen(pal.color(QPalette::HighlightedText));
+ p.setOpacity(0.8);
+ p.drawText(box, Qt::AlignLeft + Qt::AlignVCenter, title);
+
+ int x = width() - 100 - 5;
+ int y = 1;
+ int h = height() - 4;
+
+ p.setOpacity(1.0);
+ p.setBrush(Qt::NoBrush);
+ p.setPen(pal.color(QPalette::HighlightedText));
+ p.drawRect(x, y, 100, h);
+ p.setPen(Qt::NoPen);
+ p.setBrush(pal.color(QPalette::HighlightedText));
+ p.drawRect(x, y, m_progress, h);
+ } else {
+
+ QRect box = rect();
+ box.setLeft(16);
+ box.setWidth(width() - box.left() - 5);
+ p.setPen(pal.color(QPalette::HighlightedText));
+ p.drawText(box, Qt::AlignLeft + Qt::AlignVCenter, title);
+ }
+
+ p.end();
+}
diff --git a/demos/embedded/anomaly/src/TitleBar.h b/demos/embedded/anomaly/src/TitleBar.h
new file mode 100644
index 0000000..10ef2a8
--- /dev/null
+++ b/demos/embedded/anomaly/src/TitleBar.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef TITLEBAR_H
+#define TITLEBAR_H
+
+#include <QWidget>
+
+class TitleBar : public QWidget
+{
+ Q_OBJECT
+
+public:
+ TitleBar(QWidget *parent = 0);
+
+ void setHost(const QString &host);
+ void setTitle(const QString &title);
+ void setProgress(int percent);
+
+ QSize sizeHint() const;
+ QSize minimumSizeHint() const;
+
+protected:
+ void paintEvent(QPaintEvent *event);
+
+private:
+ QString m_host;
+ QString m_title;
+ int m_progress;
+};
+
+#endif // TITLEBAR_H
diff --git a/demos/embedded/anomaly/src/ZoomStrip.cpp b/demos/embedded/anomaly/src/ZoomStrip.cpp
new file mode 100644
index 0000000..80bfdea
--- /dev/null
+++ b/demos/embedded/anomaly/src/ZoomStrip.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "ZoomStrip.h"
+
+#include <QtCore>
+#include <QtGui>
+
+ZoomStrip::ZoomStrip(QWidget *parent)
+ : QWidget(parent)
+{
+ zoomInPixmap.load(":/images/list-add.png");
+ zoomOutPixmap.load(":/images/list-remove.png");
+}
+
+QSize ZoomStrip::sizeHint() const
+{
+ return minimumSizeHint();
+}
+
+QSize ZoomStrip::minimumSizeHint() const
+{
+ return QSize(48, 96);
+}
+
+void ZoomStrip::mousePressEvent(QMouseEvent *event)
+{
+ if (event->pos().y() < height() / 2)
+ emit zoomInClicked();
+ else
+ emit zoomOutClicked();
+}
+
+void ZoomStrip::paintEvent(QPaintEvent *event)
+{
+ int w = width();
+ int s = (w - zoomInPixmap.width()) / 2;
+
+ QPainter p(this);
+ p.fillRect(event->rect(), QColor(128, 128, 128, 128));
+ p.drawPixmap(s, s, zoomInPixmap);
+ p.drawPixmap(s, s + w, zoomOutPixmap);
+ p.end();
+}
diff --git a/demos/embedded/anomaly/src/ZoomStrip.h b/demos/embedded/anomaly/src/ZoomStrip.h
new file mode 100644
index 0000000..fdf0328
--- /dev/null
+++ b/demos/embedded/anomaly/src/ZoomStrip.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Anomaly project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef ZOOMSTRIP_H
+#define ZOOMSTRIP_H
+
+#include <QWidget>
+
+class ZoomStrip : public QWidget
+{
+ Q_OBJECT
+
+public:
+ ZoomStrip(QWidget *parent = 0);
+
+ QSize sizeHint() const;
+ QSize minimumSizeHint() const;
+
+signals:
+ void zoomInClicked();
+ void zoomOutClicked();
+
+protected:
+ void paintEvent(QPaintEvent *event);
+ void mousePressEvent(QMouseEvent *event);
+
+private:
+ QPixmap zoomInPixmap;
+ QPixmap zoomOutPixmap;
+};
+
+#endif // ZOOMSTRIP_H
diff --git a/demos/embedded/anomaly/src/anomaly.qrc b/demos/embedded/anomaly/src/anomaly.qrc
new file mode 100644
index 0000000..601a34e
--- /dev/null
+++ b/demos/embedded/anomaly/src/anomaly.qrc
@@ -0,0 +1,9 @@
+<RCC>
+ <qresource prefix="/" >
+ <file>images/go-next.png</file>
+ <file>images/go-previous.png</file>
+ <file>images/edit-find.png</file>
+ <file>images/list-add.png</file>
+ <file>images/list-remove.png</file>
+ </qresource>
+</RCC>
diff --git a/demos/embedded/anomaly/src/flickcharm.cpp b/demos/embedded/anomaly/src/flickcharm.cpp
new file mode 100644
index 0000000..620ef88
--- /dev/null
+++ b/demos/embedded/anomaly/src/flickcharm.cpp
@@ -0,0 +1,309 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Graphics Dojo project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "flickcharm.h"
+
+#include <QAbstractScrollArea>
+#include <QApplication>
+#include <QBasicTimer>
+#include <QEvent>
+#include <QHash>
+#include <QList>
+#include <QMouseEvent>
+#include <QScrollBar>
+#include <QWebFrame>
+#include <QWebView>
+
+#include <QDebug>
+
+struct FlickData {
+ typedef enum { Steady, Pressed, ManualScroll, AutoScroll, Stop } State;
+ State state;
+ QWidget *widget;
+ QPoint pressPos;
+ QPoint offset;
+ QPoint dragPos;
+ QPoint speed;
+ QList<QEvent*> ignored;
+};
+
+class FlickCharmPrivate
+{
+public:
+ QHash<QWidget*, FlickData*> flickData;
+ QBasicTimer ticker;
+};
+
+FlickCharm::FlickCharm(QObject *parent): QObject(parent)
+{
+ d = new FlickCharmPrivate;
+}
+
+FlickCharm::~FlickCharm()
+{
+ delete d;
+}
+
+void FlickCharm::activateOn(QWidget *widget)
+{
+ QAbstractScrollArea *scrollArea = dynamic_cast<QAbstractScrollArea*>(widget);
+ if (scrollArea) {
+ scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+
+ QWidget *viewport = scrollArea->viewport();
+
+ viewport->installEventFilter(this);
+ scrollArea->installEventFilter(this);
+
+ d->flickData.remove(viewport);
+ d->flickData[viewport] = new FlickData;
+ d->flickData[viewport]->widget = widget;
+ d->flickData[viewport]->state = FlickData::Steady;
+
+ return;
+ }
+
+ QWebView *webView = dynamic_cast<QWebView*>(widget);
+ if (webView) {
+ QWebFrame *frame = webView->page()->mainFrame();
+ frame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
+ frame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
+
+ webView->installEventFilter(this);
+
+ d->flickData.remove(webView);
+ d->flickData[webView] = new FlickData;
+ d->flickData[webView]->widget = webView;
+ d->flickData[webView]->state = FlickData::Steady;
+
+ return;
+ }
+
+ qWarning() << "FlickCharm only works on QAbstractScrollArea (and derived classes)";
+ qWarning() << "or QWebView (and derived classes)";
+}
+
+void FlickCharm::deactivateFrom(QWidget *widget)
+{
+ QAbstractScrollArea *scrollArea = dynamic_cast<QAbstractScrollArea*>(widget);
+ if (scrollArea) {
+ QWidget *viewport = scrollArea->viewport();
+
+ viewport->removeEventFilter(this);
+ scrollArea->removeEventFilter(this);
+
+ delete d->flickData[viewport];
+ d->flickData.remove(viewport);
+
+ return;
+ }
+
+ QWebView *webView = dynamic_cast<QWebView*>(widget);
+ if (webView) {
+ webView->removeEventFilter(this);
+
+ delete d->flickData[webView];
+ d->flickData.remove(webView);
+
+ return;
+ }
+}
+
+static QPoint scrollOffset(QWidget *widget)
+{
+ int x = 0, y = 0;
+
+ QAbstractScrollArea *scrollArea = dynamic_cast<QAbstractScrollArea*>(widget);
+ if (scrollArea) {
+ x = scrollArea->horizontalScrollBar()->value();
+ y = scrollArea->verticalScrollBar()->value();
+ }
+
+ QWebView *webView = dynamic_cast<QWebView*>(widget);
+ if (webView) {
+ QWebFrame *frame = webView->page()->mainFrame();
+ x = frame->evaluateJavaScript("window.scrollX").toInt();
+ y = frame->evaluateJavaScript("window.scrollY").toInt();
+ }
+
+ return QPoint(x, y);
+}
+
+static void setScrollOffset(QWidget *widget, const QPoint &p)
+{
+ QAbstractScrollArea *scrollArea = dynamic_cast<QAbstractScrollArea*>(widget);
+ if (scrollArea) {
+ scrollArea->horizontalScrollBar()->setValue(p.x());
+ scrollArea->verticalScrollBar()->setValue(p.y());
+ }
+
+ QWebView *webView = dynamic_cast<QWebView*>(widget);
+ QWebFrame *frame = webView ? webView->page()->mainFrame() : 0;
+ if (frame)
+ frame->evaluateJavaScript(QString("window.scrollTo(%1,%2);").arg(p.x()).arg(p.y()));
+}
+
+static QPoint deaccelerate(const QPoint &speed, int a = 1, int max = 64)
+{
+ int x = qBound(-max, speed.x(), max);
+ int y = qBound(-max, speed.y(), max);
+ x = (x == 0) ? x : (x > 0) ? qMax(0, x - a) : qMin(0, x + a);
+ y = (y == 0) ? y : (y > 0) ? qMax(0, y - a) : qMin(0, y + a);
+ return QPoint(x, y);
+}
+
+bool FlickCharm::eventFilter(QObject *object, QEvent *event)
+{
+ if (!object->isWidgetType())
+ return false;
+
+ QEvent::Type type = event->type();
+ if (type != QEvent::MouseButtonPress &&
+ type != QEvent::MouseButtonRelease &&
+ type != QEvent::MouseMove)
+ return false;
+
+ QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(event);
+ if (!mouseEvent || mouseEvent->modifiers() != Qt::NoModifier)
+ return false;
+
+ QWidget *viewport = dynamic_cast<QWidget*>(object);
+ FlickData *data = d->flickData.value(viewport);
+ if (!viewport || !data || data->ignored.removeAll(event))
+ return false;
+
+ bool consumed = false;
+ switch (data->state) {
+
+ case FlickData::Steady:
+ if (mouseEvent->type() == QEvent::MouseButtonPress)
+ if (mouseEvent->buttons() == Qt::LeftButton) {
+ consumed = true;
+ data->state = FlickData::Pressed;
+ data->pressPos = mouseEvent->pos();
+ data->offset = scrollOffset(data->widget);
+ }
+ break;
+
+ case FlickData::Pressed:
+ if (mouseEvent->type() == QEvent::MouseButtonRelease) {
+ consumed = true;
+ data->state = FlickData::Steady;
+
+ QMouseEvent *event1 = new QMouseEvent(QEvent::MouseButtonPress,
+ data->pressPos, Qt::LeftButton,
+ Qt::LeftButton, Qt::NoModifier);
+ QMouseEvent *event2 = new QMouseEvent(*mouseEvent);
+
+ data->ignored << event1;
+ data->ignored << event2;
+ QApplication::postEvent(object, event1);
+ QApplication::postEvent(object, event2);
+ }
+ if (mouseEvent->type() == QEvent::MouseMove) {
+ consumed = true;
+ data->state = FlickData::ManualScroll;
+ data->dragPos = QCursor::pos();
+ if (!d->ticker.isActive())
+ d->ticker.start(20, this);
+ }
+ break;
+
+ case FlickData::ManualScroll:
+ if (mouseEvent->type() == QEvent::MouseMove) {
+ consumed = true;
+ QPoint delta = mouseEvent->pos() - data->pressPos;
+ setScrollOffset(data->widget, data->offset - delta);
+ }
+ if (mouseEvent->type() == QEvent::MouseButtonRelease) {
+ consumed = true;
+ data->state = FlickData::AutoScroll;
+ }
+ break;
+
+ case FlickData::AutoScroll:
+ if (mouseEvent->type() == QEvent::MouseButtonPress) {
+ consumed = true;
+ data->state = FlickData::Stop;
+ data->speed = QPoint(0, 0);
+ data->pressPos = mouseEvent->pos();
+ data->offset = scrollOffset(data->widget);
+ }
+ if (mouseEvent->type() == QEvent::MouseButtonRelease) {
+ consumed = true;
+ data->state = FlickData::Steady;
+ data->speed = QPoint(0, 0);
+ }
+ break;
+
+ case FlickData::Stop:
+ if (mouseEvent->type() == QEvent::MouseButtonRelease) {
+ consumed = true;
+ data->state = FlickData::Steady;
+ }
+ if (mouseEvent->type() == QEvent::MouseMove) {
+ consumed = true;
+ data->state = FlickData::ManualScroll;
+ data->dragPos = QCursor::pos();
+ if (!d->ticker.isActive())
+ d->ticker.start(20, this);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return consumed;
+}
+
+void FlickCharm::timerEvent(QTimerEvent *event)
+{
+ int count = 0;
+ QHashIterator<QWidget*, FlickData*> item(d->flickData);
+ while (item.hasNext()) {
+ item.next();
+ FlickData *data = item.value();
+
+ if (data->state == FlickData::ManualScroll) {
+ count++;
+ data->speed = QCursor::pos() - data->dragPos;
+ data->dragPos = QCursor::pos();
+ }
+
+ if (data->state == FlickData::AutoScroll) {
+ count++;
+ data->speed = deaccelerate(data->speed);
+ QPoint p = scrollOffset(data->widget);
+ setScrollOffset(data->widget, p - data->speed);
+ if (data->speed == QPoint(0, 0))
+ data->state = FlickData::Steady;
+ }
+ }
+
+ if (!count)
+ d->ticker.stop();
+
+ QObject::timerEvent(event);
+}
diff --git a/demos/embedded/anomaly/src/flickcharm.h b/demos/embedded/anomaly/src/flickcharm.h
new file mode 100644
index 0000000..3b3831f
--- /dev/null
+++ b/demos/embedded/anomaly/src/flickcharm.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Graphics Dojo project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef FLICKCHARM_H
+#define FLICKCHARM_H
+
+#include <QObject>
+
+class FlickCharmPrivate;
+class QWidget;
+
+class FlickCharm: public QObject
+{
+ Q_OBJECT
+public:
+ FlickCharm(QObject *parent = 0);
+ ~FlickCharm();
+ void activateOn(QWidget *widget);
+ void deactivateFrom(QWidget *widget);
+ bool eventFilter(QObject *object, QEvent *event);
+
+protected:
+ void timerEvent(QTimerEvent *event);
+
+private:
+ FlickCharmPrivate *d;
+};
+
+#endif // FLICKCHARM_H
diff --git a/demos/embedded/anomaly/src/images/edit-find.png b/demos/embedded/anomaly/src/images/edit-find.png
new file mode 100644
index 0000000..5594785
--- /dev/null
+++ b/demos/embedded/anomaly/src/images/edit-find.png
Binary files differ
diff --git a/demos/embedded/anomaly/src/images/go-next.png b/demos/embedded/anomaly/src/images/go-next.png
new file mode 100644
index 0000000..a68e2db
--- /dev/null
+++ b/demos/embedded/anomaly/src/images/go-next.png
Binary files differ
diff --git a/demos/embedded/anomaly/src/images/go-previous.png b/demos/embedded/anomaly/src/images/go-previous.png
new file mode 100644
index 0000000..c37bc04
--- /dev/null
+++ b/demos/embedded/anomaly/src/images/go-previous.png
Binary files differ
diff --git a/demos/embedded/anomaly/src/images/list-add.png b/demos/embedded/anomaly/src/images/list-add.png
new file mode 100644
index 0000000..2acdd8f
--- /dev/null
+++ b/demos/embedded/anomaly/src/images/list-add.png
Binary files differ
diff --git a/demos/embedded/anomaly/src/images/list-remove.png b/demos/embedded/anomaly/src/images/list-remove.png
new file mode 100644
index 0000000..c5524f7
--- /dev/null
+++ b/demos/embedded/anomaly/src/images/list-remove.png
Binary files differ
diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp
new file mode 100644
index 0000000..bdc5e03
--- /dev/null
+++ b/demos/embedded/desktopservices/contenttab.cpp
@@ -0,0 +1,154 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// EXTERNAL INCLUDES
+#include <QKeyEvent>
+#include <QMessageBox>
+#include <QListWidget>
+#include <QVBoxLayout>
+#include <QFileInfoList>
+#include <QListWidgetItem>
+
+// INTERNAL INCLUDES
+
+// CLASS HEADER
+#include "contenttab.h"
+
+
+// CONSTRUCTORS & DESTRUCTORS
+ContentTab::ContentTab(QWidget *parent) :
+ QListWidget(parent)
+{
+ setDragEnabled(false);
+ setIconSize(QSize(45, 45));
+}
+
+ContentTab::~ContentTab()
+{
+}
+
+// NEW PUBLIC METHODS
+void ContentTab::init(const QDesktopServices::StandardLocation &location,
+ const QString &filter,
+ const QString &icon)
+{
+ setContentDir(location);
+ QStringList filterList;
+ filterList = filter.split(";");
+ m_ContentDir.setNameFilters(filterList);
+ setIcon(icon);
+
+ connect(this, SIGNAL(itemClicked(QListWidgetItem *)),
+ this, SLOT(openItem(QListWidgetItem *)));
+
+ populateListWidget();
+}
+
+// NEW PROTECTED METHODS
+void ContentTab::setContentDir(const QDesktopServices::StandardLocation &location)
+{
+ m_ContentDir.setPath(QDesktopServices::storageLocation(location));
+}
+
+void ContentTab::setIcon(const QString &icon)
+{
+ m_Icon = QIcon(icon);
+}
+
+void ContentTab::populateListWidget()
+{
+ QFileInfoList fileList = m_ContentDir.entryInfoList(QDir::Files, QDir::Time);
+ foreach(QFileInfo item, fileList) {
+ new QListWidgetItem(m_Icon, itemName(item), this);
+ }
+}
+
+QString ContentTab::itemName(const QFileInfo &item)
+{
+ return QString(item.baseName() + "." + item.completeSuffix());
+}
+
+QUrl ContentTab::itemUrl(QListWidgetItem *item)
+{
+ return QUrl("file:///" + m_ContentDir.absolutePath() + "/" + item->text());
+}
+
+void ContentTab::keyPressEvent(QKeyEvent *event)
+{
+ switch(event->key()) {
+ case Qt::Key_Up:
+ if(currentRow() == 0) {
+ setCurrentRow(count()-1);
+ } else {
+ setCurrentRow(currentRow()-1);
+ }
+ break;
+ case Qt::Key_Down:
+ if(currentRow() == (count()-1)) {
+ setCurrentRow(0);
+ } else {
+ setCurrentRow(currentRow()+1);
+ }
+ break;
+ case Qt::Key_Select:
+ openItem(currentItem());
+ default:
+ QListWidget::keyPressEvent(event);
+ break;
+ }
+}
+
+void ContentTab::handleErrorInOpen(QListWidgetItem *item)
+{
+ Q_UNUSED(item);
+ QMessageBox::warning( this, tr("Operation Failed"), tr("Unkown error!"), QMessageBox::Close);
+}
+
+// NEW SLOTS
+void ContentTab::openItem(QListWidgetItem *item)
+{
+ bool ret = QDesktopServices::openUrl(itemUrl(item));
+ if(!ret)
+ handleErrorInOpen(item);
+}
+
+
+// End of File
diff --git a/demos/embedded/desktopservices/contenttab.h b/demos/embedded/desktopservices/contenttab.h
new file mode 100644
index 0000000..8d37209
--- /dev/null
+++ b/demos/embedded/desktopservices/contenttab.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CONTENTTAB_H_
+#define CONTENTTAB_H_
+
+// EXTERNAL INCLUDES
+#include <QDir>
+#include <QUrl>
+#include <QIcon>
+#include <QFileInfo>
+#include <QListWidget>
+#include <QDesktopServices>
+
+// INTERNAL INCLUDES
+
+// FORWARD DECLARATIONS
+QT_BEGIN_NAMESPACE
+class QListWidgetItem;
+QT_END_NAMESPACE
+
+// CLASS DECLARATION
+
+/**
+* ContentTab class.
+*
+* This class implements general purpose tab for media files.
+*/
+class ContentTab : public QListWidget
+{
+ Q_OBJECT
+
+public: // Constructors & Destructors
+ ContentTab(QWidget *parent);
+ virtual ~ContentTab();
+
+public: // New Methods
+ virtual void init(const QDesktopServices::StandardLocation &location,
+ const QString &filter,
+ const QString &icon);
+
+protected: // New Methods
+ virtual void setContentDir(const QDesktopServices::StandardLocation &location);
+ virtual void setIcon(const QString &icon);
+ virtual void populateListWidget();
+ virtual QString itemName(const QFileInfo &item);
+ virtual QUrl itemUrl(QListWidgetItem *item);
+ virtual void handleErrorInOpen(QListWidgetItem *item);
+protected:
+ void keyPressEvent(QKeyEvent *event);
+
+public slots: // New Slots
+ virtual void openItem(QListWidgetItem *item);
+
+protected: // Owned variables
+ QDir m_ContentDir;
+ QIcon m_Icon;
+};
+
+
+#endif // CONTENTTAB_H_
+
+// End of File
diff --git a/demos/embedded/desktopservices/data/Explosion.wav b/demos/embedded/desktopservices/data/Explosion.wav
new file mode 100644
index 0000000..7b140b1
--- /dev/null
+++ b/demos/embedded/desktopservices/data/Explosion.wav
Binary files differ
diff --git a/demos/embedded/desktopservices/data/designer.png b/demos/embedded/desktopservices/data/designer.png
new file mode 100644
index 0000000..0988fce
--- /dev/null
+++ b/demos/embedded/desktopservices/data/designer.png
Binary files differ
diff --git a/demos/embedded/desktopservices/data/monkey_on_64x64.png b/demos/embedded/desktopservices/data/monkey_on_64x64.png
new file mode 100644
index 0000000..990f604
--- /dev/null
+++ b/demos/embedded/desktopservices/data/monkey_on_64x64.png
Binary files differ
diff --git a/demos/embedded/desktopservices/data/sax.mp3 b/demos/embedded/desktopservices/data/sax.mp3
new file mode 100644
index 0000000..0a078b1
--- /dev/null
+++ b/demos/embedded/desktopservices/data/sax.mp3
Binary files differ
diff --git a/demos/embedded/desktopservices/desktopservices.pro b/demos/embedded/desktopservices/desktopservices.pro
new file mode 100644
index 0000000..32cb6d9
--- /dev/null
+++ b/demos/embedded/desktopservices/desktopservices.pro
@@ -0,0 +1,23 @@
+TEMPLATE = app
+TARGET =
+INCLUDEPATH += .
+
+HEADERS += desktopwidget.h contenttab.h linktab.h
+SOURCES += desktopwidget.cpp contenttab.cpp linktab.cpp main.cpp
+
+RESOURCES += desktopservices.qrc
+
+music.sources = data/*.mp3 data/*.wav
+music.path = /data/sounds/
+
+image.sources = data/*.png
+image.path = /data/images/
+
+DEPLOYMENT += music image
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian {
+ TARGET.UID3 = 0xA000C611
+ ICON = ./resources/heart.svg
+}
diff --git a/demos/embedded/desktopservices/desktopservices.qrc b/demos/embedded/desktopservices/desktopservices.qrc
new file mode 100644
index 0000000..d36205d
--- /dev/null
+++ b/demos/embedded/desktopservices/desktopservices.qrc
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+ <file>resources/music.png</file>
+ <file>resources/photo.png</file>
+ <file>resources/browser.png</file>
+ <file>resources/message.png</file>
+</qresource>
+</RCC>
diff --git a/demos/embedded/desktopservices/desktopwidget.cpp b/demos/embedded/desktopservices/desktopwidget.cpp
new file mode 100644
index 0000000..3abe591
--- /dev/null
+++ b/demos/embedded/desktopservices/desktopwidget.cpp
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// EXTERNAL INCLUDES
+#include <QTabWidget>
+#include <QVBoxLayout>
+#include <QDesktopServices>
+
+// INTERNAL INCLUDES
+#include "linktab.h"
+#include "contenttab.h"
+
+// CLASS HEADER
+#include "desktopwidget.h"
+
+// CONSTRUCTORS & DESTRUCTORS
+DesktopWidget::DesktopWidget(QWidget *parent) : QWidget(parent)
+
+{
+ QTabWidget *tabWidget = new QTabWidget(this);
+
+ // Images
+ ContentTab* imageTab = new ContentTab(tabWidget);
+ imageTab->init(QDesktopServices::PicturesLocation,
+ "*.png;*.jpg;*.jpeg;*.bmp;*.gif",
+ ":/resources/photo.png");
+ tabWidget->addTab(imageTab, tr("Images"));
+
+ // Music
+ ContentTab* musicTab = new ContentTab(tabWidget);
+ musicTab->init(QDesktopServices::MusicLocation,
+ "*.wav;*.mp3;*.mp4",
+ ":/resources/music.png");
+ tabWidget->addTab(musicTab, tr("Music"));
+
+ // Links
+ LinkTab* othersTab = new LinkTab(tabWidget);;
+ // Given icon file will be overriden by LinkTab
+ othersTab->init(QDesktopServices::PicturesLocation, "", "");
+ tabWidget->addTab(othersTab, tr("Links"));
+
+ // Layout
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(tabWidget);
+ setLayout(layout);
+}
+
+DesktopWidget::~DesktopWidget()
+{
+}
+
+// End of file
diff --git a/demos/embedded/desktopservices/desktopwidget.h b/demos/embedded/desktopservices/desktopwidget.h
new file mode 100644
index 0000000..246ab18
--- /dev/null
+++ b/demos/embedded/desktopservices/desktopwidget.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DESKTOPWIDGET_H_
+#define DESKTOPWIDGET_H_
+
+// EXTERNAL INCLUDES
+#include <QWidget>
+
+// INTERNAL INCLUDES
+
+// FORWARD DECLARATIONS
+QT_BEGIN_NAMESPACE
+class QTabWidget;
+QT_END_NAMESPACE
+
+// CLASS DECLARATION
+/**
+* DesktopWidget class.
+*
+* Implements the main top level widget for QDesktopServices demo app.
+*/
+class DesktopWidget : public QWidget
+{
+ Q_OBJECT
+
+public: // Constructors & Destructors
+ DesktopWidget(QWidget *parent);
+ ~DesktopWidget();
+
+};
+
+#endif // DESKTOPWIDGET_H_
+
+// End of file
diff --git a/demos/embedded/desktopservices/linktab.cpp b/demos/embedded/desktopservices/linktab.cpp
new file mode 100644
index 0000000..32411fe
--- /dev/null
+++ b/demos/embedded/desktopservices/linktab.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// EXTERNAL INCLUDES
+#include <QUrl>
+#include <QMessageBox>
+#include <QListWidgetItem>
+
+// INTERNAL INCLUDES
+
+// CLASS HEADER
+#include "linktab.h"
+
+LinkTab::LinkTab(QWidget *parent) :
+ ContentTab(parent)
+{
+}
+
+LinkTab::~LinkTab()
+{
+}
+
+void LinkTab::populateListWidget()
+{
+ m_WebItem = new QListWidgetItem(QIcon(":/resources/browser.png"), tr("Launch Browser"), this);
+ m_MailToItem = new QListWidgetItem(QIcon(":/resources/message.png"), tr("New e-mail"), this);
+}
+
+QUrl LinkTab::itemUrl(QListWidgetItem *item)
+{
+ if(m_WebItem == item) {
+ return QUrl(tr("http://www.qtsoftware.com"));
+ } else if(m_MailToItem == item) {
+ return QUrl(tr("mailto:qts60-feedback@trolltech.com?subject=QtS60 feedback&body=Hello"));
+ } else {
+ // We should never endup here
+ Q_ASSERT(false);
+ return QUrl();
+ }
+}
+void LinkTab::handleErrorInOpen(QListWidgetItem *item)
+{
+ if(m_MailToItem == item) {
+ QMessageBox::warning( this, tr("Operation Failed"), tr("Please check that you have\ne-mail account defined."), QMessageBox::Close);
+ } else {
+ ContentTab::handleErrorInOpen(item);
+ }
+}
+
+// End of file
diff --git a/demos/embedded/desktopservices/linktab.h b/demos/embedded/desktopservices/linktab.h
new file mode 100644
index 0000000..a9c9868
--- /dev/null
+++ b/demos/embedded/desktopservices/linktab.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LINKTAB_H_
+#define LINKTAB_H_
+
+// EXTERNAL INCLUDES
+
+// INTERNAL INCLUDES
+#include "contenttab.h"
+
+// FORWARD DECLARATIONS
+QT_BEGIN_NAMESPACE
+class QWidget;
+class QListWidgetItem;
+QT_END_NAMESPACE
+
+// CLASS DECLARATION
+
+/**
+* LinkTab class.
+*
+* This class implements tab for opening http and mailto links.
+*/
+class LinkTab : public ContentTab
+{
+ Q_OBJECT
+
+public: // Constructors & Destructors
+ LinkTab(QWidget *parent);
+ ~LinkTab();
+
+protected: // Derived Methods
+ virtual void populateListWidget();
+ virtual QUrl itemUrl(QListWidgetItem *item);
+ virtual void handleErrorInOpen(QListWidgetItem *item);
+
+private: // Used variables
+ QListWidgetItem *m_WebItem;
+ QListWidgetItem *m_MailToItem;
+
+private: // Owned variables
+
+};
+
+#endif // CONTENTTAB_H_
+
+// End of File
diff --git a/demos/embedded/desktopservices/main.cpp b/demos/embedded/desktopservices/main.cpp
new file mode 100644
index 0000000..ebbcf63
--- /dev/null
+++ b/demos/embedded/desktopservices/main.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include "desktopwidget.h"
+
+int main(int argc, char *argv[])
+{
+ Q_INIT_RESOURCE(desktopservices);
+
+ QApplication app(argc, argv);
+ DesktopWidget* myWidget = new DesktopWidget(0);
+ myWidget->showMaximized();
+
+ return app.exec();
+}
+
+// End of file
diff --git a/demos/embedded/desktopservices/resources/browser.png b/demos/embedded/desktopservices/resources/browser.png
new file mode 100644
index 0000000..28561e1
--- /dev/null
+++ b/demos/embedded/desktopservices/resources/browser.png
Binary files differ
diff --git a/demos/embedded/desktopservices/resources/heart.svg b/demos/embedded/desktopservices/resources/heart.svg
new file mode 100644
index 0000000..ba5f050
--- /dev/null
+++ b/demos/embedded/desktopservices/resources/heart.svg
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) --><svg viewBox="100 200 550 500" height="595.27559pt" id="svg1" inkscape:version="0.40+cvs" sodipodi:docbase="C:\Documents and Settings\Jon Phillips\My Documents\projects\clipart-project\submissions" sodipodi:docname="heart-left-highlight.svg" sodipodi:version="0.32" width="595.27559pt" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg">
+<metadata>
+<rdf:RDF xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+<cc:Work rdf:about="">
+<dc:title>Heart Left-Highlight</dc:title>
+<dc:description>This is a normal valentines day heart.</dc:description>
+<dc:subject>
+<rdf:Bag>
+<rdf:li>holiday</rdf:li>
+<rdf:li>valentines</rdf:li>
+<rdf:li></rdf:li>
+<rdf:li>valentine</rdf:li>
+<rdf:li>hash(0x8a091c0)</rdf:li>
+<rdf:li>hash(0x8a0916c)</rdf:li>
+<rdf:li>signs_and_symbols</rdf:li>
+<rdf:li>hash(0x8a091f0)</rdf:li>
+<rdf:li>day</rdf:li>
+</rdf:Bag>
+</dc:subject>
+<dc:publisher>
+<cc:Agent rdf:about="http://www.openclipart.org">
+<dc:title>Jon Phillips</dc:title>
+</cc:Agent>
+</dc:publisher>
+<dc:creator>
+<cc:Agent>
+<dc:title>Jon Phillips</dc:title>
+</cc:Agent>
+</dc:creator>
+<dc:rights>
+<cc:Agent>
+<dc:title>Jon Phillips</dc:title>
+</cc:Agent>
+</dc:rights>
+<dc:date></dc:date>
+<dc:format>image/svg+xml</dc:format>
+<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+<cc:license rdf:resource="http://web.resource.org/cc/PublicDomain"/>
+<dc:language>en</dc:language>
+</cc:Work>
+<cc:License rdf:about="http://web.resource.org/cc/PublicDomain">
+<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/>
+<cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/>
+<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/>
+</cc:License>
+</rdf:RDF>
+</metadata>
+<defs id="defs3"/>
+<sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="549.40674" inkscape:cy="596.00159" inkscape:document-units="px" inkscape:guide-bbox="true" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="615" inkscape:window-width="866" inkscape:window-x="88" inkscape:window-y="116" inkscape:zoom="0.35000000" pagecolor="#ffffff" showguides="true"/>
+<g id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1">
+<path d="M 263.41570,235.14588 C 197.17570,235.14588 143.41575,288.90587 143.41575,355.14588 C 143.41575,489.90139 279.34890,525.23318 371.97820,658.45392 C 459.55244,526.05056 600.54070,485.59932 600.54070,355.14588 C 600.54070,288.90588 546.78080,235.14587 480.54070,235.14588 C 432.49280,235.14588 391.13910,263.51631 371.97820,304.33338 C 352.81740,263.51630 311.46370,235.14587 263.41570,235.14588 z " id="path7" sodipodi:nodetypes="ccccccc" style="fill:#e60000;fill-opacity:1.0000000;stroke:#000000;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/>
+<path d="M 265.00000,253.59375 C 207.04033,253.59375 160.00000,300.63407 160.00000,358.59375 C 160.00000,476.50415 278.91857,507.43251 359.96875,624.00000 C 366.52868,614.08205 220.00000,478.47309 220.00000,378.59375 C 220.00000,320.63407 267.04033,273.59375 325.00000,273.59375 C 325.50453,273.59375 325.99718,273.64912 326.50000,273.65625 C 309.22436,261.07286 288.00557,253.59374 265.00000,253.59375 z " id="path220" sodipodi:nodetypes="ccccccc" style="fill:#e6e6e6;fill-opacity:0.64556962;stroke:none;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/>
+</g>
+</svg>
diff --git a/demos/embedded/desktopservices/resources/message.png b/demos/embedded/desktopservices/resources/message.png
new file mode 100644
index 0000000..e30052b
--- /dev/null
+++ b/demos/embedded/desktopservices/resources/message.png
Binary files differ
diff --git a/demos/embedded/desktopservices/resources/music.png b/demos/embedded/desktopservices/resources/music.png
new file mode 100644
index 0000000..11a57bb
--- /dev/null
+++ b/demos/embedded/desktopservices/resources/music.png
Binary files differ
diff --git a/demos/embedded/desktopservices/resources/photo.png b/demos/embedded/desktopservices/resources/photo.png
new file mode 100644
index 0000000..5ba15c1
--- /dev/null
+++ b/demos/embedded/desktopservices/resources/photo.png
Binary files differ
diff --git a/demos/embedded/embedded.pro b/demos/embedded/embedded.pro
index 7428b9f..25904ef 100644
--- a/demos/embedded/embedded.pro
+++ b/demos/embedded/embedded.pro
@@ -3,7 +3,12 @@ SUBDIRS = styledemo
contains(QT_CONFIG, svg) {
SUBDIRS += embeddedsvgviewer \
- fluidlauncher
+ fluidlauncher \
+ desktopservices
+}
+
+contains(QT_CONFIG, webkit) {
+ SUBDIRS += anomaly
}
# install
@@ -11,3 +16,5 @@ sources.files = README *.pro
sources.path = $$[QT_INSTALL_DEMOS]/embedded
INSTALLS += sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro b/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro
index 505e607..51a04e7 100644
--- a/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro
+++ b/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro
@@ -11,6 +11,11 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html *.svg files
sources.path = $$[QT_INSTALL_DEMOS]/embedded/embeddedsvgviewer
INSTALLS += target sources
-wince*: {
+wince* {
DEPLOYMENT_PLUGIN += qsvg
}
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian:TARGET.UID3 = 0xA000A640
+
diff --git a/demos/embedded/fluidlauncher/config_s60/config.xml b/demos/embedded/fluidlauncher/config_s60/config.xml
new file mode 100644
index 0000000..f6bac67
--- /dev/null
+++ b/demos/embedded/fluidlauncher/config_s60/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<demolauncher>
+ <demos>
+ <example filename="embeddedsvgviewer" name="SVG Viewer" image="screenshots/embeddedsvgviewer_s60.png" args="/data/images/qt/demos/embeddedsvgviewer/shapes.svg"/>
+ <example filename="styledemo" name="Stylesheets" image="screenshots/styledemo_s60.png"/>
+ <example filename="deform" name="Vector Deformation" image="screenshots/deform.png" args="-small-screen"/>
+ <example filename="pathstroke" name="Path Stroking" image="screenshots/pathstroke.png" args="-small-screen"/>
+ <example filename="wiggly" name="Wiggly Text" image="screenshots/wiggly_s60.png" args="-small-screen"/>
+ <example filename="ftp" name="Ftp Client" image="screenshots/ftp_s60.png"/>
+ <example filename="context2d" name="Context2d" image="screenshots/context2d_s60.png"/>
+ <example filename="saxbookmarks" name="SaxBookmarks" image="screenshots/saxbookmarks_s60.png"/>
+ <example filename="desktopservices" name="Desktop Services" image="screenshots/desktopservices_s60.png"/>
+ <example filename="fridgemagnets" name="Fridge Magnets" image="screenshots/fridgemagnets_s60.png" args="-small-screen"/>
+ <example filename="drilldown" name="Drilldown" image="screenshots/drilldown_s60.png"/>
+ <example filename="softkeys" name="Softkeys" image="screenshots/softkeys_s60.png"/>
+ <example filename="anomaly" name="Anomaly Browser" image="screenshots/anomaly_s60.png"/>
+ </demos>
+ <slideshow timeout="60000" interval="10000">
+ <imagedir dir="slides"/>
+ </slideshow>
+</demolauncher>
diff --git a/demos/embedded/fluidlauncher/fluidlauncher.cpp b/demos/embedded/fluidlauncher/fluidlauncher.cpp
index f80e6ca..9a4f2ca 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.cpp
+++ b/demos/embedded/fluidlauncher/fluidlauncher.cpp
@@ -39,12 +39,14 @@
**
****************************************************************************/
-#include <QtXml>
+#include <QXmlStreamReader>
#include "fluidlauncher.h"
#define DEFAULT_INPUT_TIMEOUT 10000
+#define SIZING_FACTOR_HEIGHT 6/10
+#define SIZING_FACTOR_WIDTH 6/10
FluidLauncher::FluidLauncher(QStringList* args)
{
@@ -62,7 +64,11 @@ FluidLauncher::FluidLauncher(QStringList* args)
inputTimer->setSingleShot(true);
inputTimer->setInterval(DEFAULT_INPUT_TIMEOUT);
- pictureFlowWidget->setSlideSize(QSize( (screen_size.width()*2)/5, (screen_size.height()*2)/5 ));
+ const int h = screen_size.height() * SIZING_FACTOR_HEIGHT;
+ const int w = screen_size.width() * SIZING_FACTOR_WIDTH;
+ const int hh = qMin(h, w);
+ const int ww = hh / 3 * 2;
+ pictureFlowWidget->setSlideSize(QSize(ww, hh));
bool success;
int configIndex = args->indexOf("-config");
@@ -100,61 +106,97 @@ bool FluidLauncher::loadConfig(QString configPath)
slideShowWidget->clearImages();
- QDomDocument xmlDoc;
- xmlDoc.setContent(&xmlFile, true);
+ xmlFile.open(QIODevice::ReadOnly);
+ QXmlStreamReader reader(&xmlFile);
+ while (!reader.atEnd()) {
+ reader.readNext();
- QDomElement rootElement = xmlDoc.documentElement();
-
- // Process the demos node:
- QDomNodeList demoNodes = rootElement.firstChildElement("demos").elementsByTagName("example");
- for (int i=0; i<demoNodes.size(); i++) {
- QDomElement element = demoNodes.item(i).toElement();
-
- if (element.hasAttribute("filename")) {
- DemoApplication* newDemo = new DemoApplication(
- element.attribute("filename"),
- element.attribute("name", "Unamed Demo"),
- element.attribute("image"),
- element.attribute("args").split(" "));
- demoList.append(newDemo);
+ if (reader.isStartElement()) {
+ if (reader.name() == "demos")
+ parseDemos(reader);
+ else if(reader.name() == "slideshow")
+ parseSlideshow(reader);
}
}
+ if (reader.hasError()) {
+ qDebug() << QString("Error parsing %1 on line %2 column %3: \n%4")
+ .arg(configPath)
+ .arg(reader.lineNumber())
+ .arg(reader.columnNumber())
+ .arg(reader.errorString());
+ }
- // Process the slideshow node:
- QDomElement slideshowElement = rootElement.firstChildElement("slideshow");
+ // Append an exit Item
+ DemoApplication* exitItem = new DemoApplication(QString(), QLatin1String("Exit Embedded Demo"), QString(), QStringList());
+ demoList.append(exitItem);
- if (slideshowElement.hasAttribute("timeout")) {
- bool valid;
- int timeout = slideshowElement.attribute("timeout").toInt(&valid);
- if (valid)
- inputTimer->setInterval(timeout);
- }
+ return true;
+}
- if (slideshowElement.hasAttribute("interval")) {
- bool valid;
- int interval = slideshowElement.attribute("interval").toInt(&valid);
- if (valid)
- slideShowWidget->setSlideInterval(interval);
+
+void FluidLauncher::parseDemos(QXmlStreamReader& reader)
+{
+ while (!reader.atEnd()) {
+ reader.readNext();
+ if (reader.isStartElement() && reader.name() == "example") {
+ QXmlStreamAttributes attrs = reader.attributes();
+ QStringRef filename = attrs.value("filename");
+ if (!filename.isEmpty()) {
+ QStringRef name = attrs.value("name");
+ QStringRef image = attrs.value("image");
+ QStringRef args = attrs.value("args");
+
+ DemoApplication* newDemo = new DemoApplication(
+ filename.toString(),
+ name.isEmpty() ? "Unamed Demo" : name.toString(),
+ image.toString(),
+ args.toString().split(" "));
+ demoList.append(newDemo);
+ }
+ } else if(reader.isEndElement() && reader.name() == "demos") {
+ return;
+ }
}
+}
- for (QDomNode node=slideshowElement.firstChild(); !node.isNull(); node=node.nextSibling()) {
- QDomElement element = node.toElement();
+void FluidLauncher::parseSlideshow(QXmlStreamReader& reader)
+{
+ QXmlStreamAttributes attrs = reader.attributes();
+
+ QStringRef timeout = attrs.value("timeout");
+ bool valid;
+ if (!timeout.isEmpty()) {
+ int t = timeout.toString().toInt(&valid);
+ if (valid)
+ inputTimer->setInterval(t);
+ }
- if (element.tagName() == "imagedir")
- slideShowWidget->addImageDir(element.attribute("dir"));
- else if (element.tagName() == "image")
- slideShowWidget->addImage(element.attribute("image"));
+ QStringRef interval = attrs.value("interval");
+ if (!interval.isEmpty()) {
+ int i = interval.toString().toInt(&valid);
+ if (valid)
+ slideShowWidget->setSlideInterval(i);
}
- // Append an exit Item
- DemoApplication* exitItem = new DemoApplication(QString(), QLatin1String("Exit Embedded Demo"), QString(), QStringList());
- demoList.append(exitItem);
+ while (!reader.atEnd()) {
+ reader.readNext();
+ if (reader.isStartElement()) {
+ QXmlStreamAttributes attrs = reader.attributes();
+ if (reader.name() == "imagedir") {
+ QStringRef dir = attrs.value("dir");
+ slideShowWidget->addImageDir(dir.toString());
+ } else if(reader.name() == "image") {
+ QStringRef image = attrs.value("image");
+ slideShowWidget->addImage(image.toString());
+ }
+ } else if(reader.isEndElement() && reader.name() == "slideshow") {
+ return;
+ }
+ }
- return true;
}
-
void FluidLauncher::populatePictureFlow()
{
pictureFlowWidget->setSlideCount(demoList.count());
diff --git a/demos/embedded/fluidlauncher/fluidlauncher.h b/demos/embedded/fluidlauncher/fluidlauncher.h
index 3f4c1fe..d064edd 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.h
+++ b/demos/embedded/fluidlauncher/fluidlauncher.h
@@ -44,6 +44,7 @@
#include <QtGui>
#include <QTimer>
+#include <QStringRef>
#include "pictureflow.h"
#include "slideshow.h"
@@ -73,7 +74,8 @@ private:
bool loadConfig(QString configPath);
void populatePictureFlow();
void switchToSlideshow();
-
+ void parseDemos(QXmlStreamReader& reader);
+ void parseSlideshow(QXmlStreamReader& reader);
};
diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro
index 76d12ad..11d8a8c 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.pro
+++ b/demos/embedded/fluidlauncher/fluidlauncher.pro
@@ -2,7 +2,6 @@ TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
-QT += xml
# Input
HEADERS += \
@@ -40,7 +39,8 @@ wince*{
$$QT_BUILD_TREE/demos/pathstroke/$${BUILD_DIR}/pathstroke.exe \
$$QT_BUILD_TREE/examples/graphicsview/elasticnodes/$${BUILD_DIR}/elasticnodes.exe \
$$QT_BUILD_TREE/examples/widgets/wiggly/$${BUILD_DIR}/wiggly.exe \
- $$QT_BUILD_TREE/examples/painting/concentriccircles/$${BUILD_DIR}/concentriccircles.exe
+ $$QT_BUILD_TREE/examples/painting/concentriccircles/$${BUILD_DIR}/concentriccircles.exe \
+ $$QT_BUILD_TREE/examples/draganddrop/$${BUILD_DIR}/fridgemagnets.exe
executables.path = .
@@ -54,3 +54,91 @@ wince*{
DEPLOYMENT_PLUGIN += qgif qjpeg qmng qsvg
}
+
+symbian {
+ load(data_caging_paths)
+
+ TARGET.UID3 = 0xA000A641
+
+ executables.sources = \
+ embeddedsvgviewer.exe \
+ styledemo.exe \
+ deform.exe \
+ pathstroke.exe \
+ wiggly.exe \
+ ftp.exe \
+ context2d.exe \
+ saxbookmarks.exe \
+ desktopservices.exe \
+ fridgemagnets.exe \
+ drilldown.exe \
+ softkeys.exe \
+ anomaly.exe
+
+ executables.path = /sys/bin
+
+ reg_resource.sources = \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/embeddedsvgviewer_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/styledemo_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/deform_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/pathstroke_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/wiggly_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/ftp_reg.rsc\
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/context2d_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/saxbookmarks_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/desktopservices_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/fridgemagnets_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/drilldown_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/softkeys_reg.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/anomaly_reg.rsc
+
+ reg_resource.path = $$REG_RESOURCE_IMPORT_DIR
+
+
+ resource.sources = \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/embeddedsvgviewer.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/styledemo.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/deform.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/pathstroke.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/wiggly.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/ftp.rsc\
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/context2d.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/saxbookmarks.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/desktopservices.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fridgemagnets.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/drilldown.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/softkeys.rsc \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/anomaly.rsc
+
+ resource.path = $$APP_RESOURCE_DIR
+
+ mifs.sources = \
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C611.mif
+ mifs.path = $$APP_RESOURCE_DIR
+
+ files.sources = $$PWD/screenshots $$PWD/slides
+ files.path = .
+
+ config.sources = $$PWD/config_s60/config.xml
+ config.path = .
+
+ viewerimages.sources = $$PWD/../embeddedsvgviewer/shapes.svg
+ viewerimages.path = /data/images/qt/demos/embeddedsvgviewer
+
+ desktopservices_music.sources = \
+ $$PWD/../desktopservices/data/*.mp3 \
+ $$PWD/../desktopservices/data/*.wav
+ desktopservices_music.path = /data/sounds
+
+ desktopservices_images.sources = $$PWD/../desktopservices/data/*.png
+ desktopservices_images.path = /data/images
+
+ saxbookmarks.sources = $$PWD/../../../examples/xml/saxbookmarks/frank.xbel
+ saxbookmarks.sources += $$PWD/../../../examples/xml/saxbookmarks/jennifer.xbel
+ saxbookmarks.path = /data/qt/saxbookmarks
+
+ DEPLOYMENT += config files executables viewerimages saxbookmarks reg_resource resource \
+ mifs desktopservices_music desktopservices_images
+
+ TARGET.EPOCHEAPSIZE = 100000 20000000
+}
diff --git a/demos/embedded/fluidlauncher/pictureflow.cpp b/demos/embedded/fluidlauncher/pictureflow.cpp
index 04bbf05..e2f8284 100644
--- a/demos/embedded/fluidlauncher/pictureflow.cpp
+++ b/demos/embedded/fluidlauncher/pictureflow.cpp
@@ -105,6 +105,14 @@
#include <QDebug>
+static const int captionFontSize =
+#ifdef Q_WS_S60
+ 8;
+#else
+ 14;
+#endif
+
+
// uncomment this to enable bilinear filtering for texture mapping
// gives much better rendering, at the cost of memory space
// #define PICTUREFLOW_BILINEAR_FILTER
@@ -739,14 +747,14 @@ void PictureFlowPrivate::render()
QPainter painter;
painter.begin(&buffer);
- QFont font("Arial", 14);
+ QFont font("Arial", captionFontSize);
font.setBold(true);
painter.setFont(font);
painter.setPen(Qt::white);
//painter.setPen(QColor(255,255,255,127));
if (!captions.isEmpty())
- painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/2),
+ painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/4),
Qt::AlignCenter, captions[centerIndex]);
painter.end();
@@ -789,18 +797,18 @@ void PictureFlowPrivate::render()
QPainter painter;
painter.begin(&buffer);
- QFont font("Arial", 14);
+ QFont font("Arial", captionFontSize);
font.setBold(true);
painter.setFont(font);
int leftTextIndex = (step>0) ? centerIndex : centerIndex-1;
painter.setPen(QColor(255,255,255, (255-fade) ));
- painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/2),
+ painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/4),
Qt::AlignCenter, captions[leftTextIndex]);
painter.setPen(QColor(255,255,255, fade));
- painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/2),
+ painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/4),
Qt::AlignCenter, captions[leftTextIndex+1]);
@@ -1265,6 +1273,12 @@ void PictureFlow::keyPressEvent(QKeyEvent* event)
return;
}
+ if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Select) {
+ emit itemActivated(d->getTarget());
+ event->accept();
+ return;
+ }
+
event->ignore();
}
diff --git a/demos/embedded/fluidlauncher/screenshots/anomaly_s60.png b/demos/embedded/fluidlauncher/screenshots/anomaly_s60.png
new file mode 100644
index 0000000..b9a73fd
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/anomaly_s60.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/context2d_s60.png b/demos/embedded/fluidlauncher/screenshots/context2d_s60.png
new file mode 100644
index 0000000..a53f5b0
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/context2d_s60.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/desktopservices_s60.png b/demos/embedded/fluidlauncher/screenshots/desktopservices_s60.png
new file mode 100644
index 0000000..f4aa1a2
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/desktopservices_s60.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/drilldown_s60.png b/demos/embedded/fluidlauncher/screenshots/drilldown_s60.png
new file mode 100644
index 0000000..50376c1
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/drilldown_s60.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/embeddedsvgviewer_s60.png b/demos/embedded/fluidlauncher/screenshots/embeddedsvgviewer_s60.png
new file mode 100644
index 0000000..11459dc
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/embeddedsvgviewer_s60.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/fridgemagnets_s60.png b/demos/embedded/fluidlauncher/screenshots/fridgemagnets_s60.png
new file mode 100644
index 0000000..56da9dc
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/fridgemagnets_s60.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/ftp_s60.png b/demos/embedded/fluidlauncher/screenshots/ftp_s60.png
new file mode 100644
index 0000000..ea6a321
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/ftp_s60.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/saxbookmarks_s60.png b/demos/embedded/fluidlauncher/screenshots/saxbookmarks_s60.png
new file mode 100644
index 0000000..c451198
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/saxbookmarks_s60.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/softkeys_s60.png b/demos/embedded/fluidlauncher/screenshots/softkeys_s60.png
new file mode 100644
index 0000000..03989fb
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/softkeys_s60.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/styledemo_s60.png b/demos/embedded/fluidlauncher/screenshots/styledemo_s60.png
new file mode 100644
index 0000000..bad9692
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/styledemo_s60.png
Binary files differ
diff --git a/demos/embedded/fluidlauncher/screenshots/wiggly_s60.png b/demos/embedded/fluidlauncher/screenshots/wiggly_s60.png
new file mode 100644
index 0000000..690ab48
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/wiggly_s60.png
Binary files differ
diff --git a/demos/embedded/styledemo/files/application.qss b/demos/embedded/styledemo/files/application.qss
index a632ad1..432fe6b 100644
--- a/demos/embedded/styledemo/files/application.qss
+++ b/demos/embedded/styledemo/files/application.qss
@@ -6,7 +6,7 @@ QWidget#StyleWidget
QLabel, QAbstractButton
{
- font: 18px bold;
+ font: bold;
color: beige;
}
diff --git a/demos/embedded/styledemo/files/blue.qss b/demos/embedded/styledemo/files/blue.qss
index aa87277..ac8671b 100644
--- a/demos/embedded/styledemo/files/blue.qss
+++ b/demos/embedded/styledemo/files/blue.qss
@@ -5,7 +5,7 @@
QLabel, QAbstractButton
{
- font: 10pt bold;
+ font: bold;
color: yellow;
}
@@ -28,7 +28,6 @@ QAbstractButton
border-style: solid;
border-radius: 5;
padding: 3px;
- qproperty-focusPolicy: NoFocus;
}
QAbstractButton:pressed
diff --git a/demos/embedded/styledemo/files/khaki.qss b/demos/embedded/styledemo/files/khaki.qss
index 9c0f77c..b0d4a0f 100644
--- a/demos/embedded/styledemo/files/khaki.qss
+++ b/demos/embedded/styledemo/files/khaki.qss
@@ -16,7 +16,6 @@ QPushButton, QToolButton {
padding: 3px;
/* min-width: 96px; */
/* min-height: 48px; */
- qproperty-focusPolicy: NoFocus
}
QPushButton:hover, QToolButton:hover {
@@ -30,7 +29,7 @@ QPushButton:pressed, QToolButton:pressed {
}
QLabel, QAbstractButton {
- font: italic 11pt "Times New Roman";
+ font: italic "Times New Roman";
}
QFrame, QLabel#title {
diff --git a/demos/embedded/styledemo/files/transparent.qss b/demos/embedded/styledemo/files/transparent.qss
index e3a9912..b38eb36 100644
--- a/demos/embedded/styledemo/files/transparent.qss
+++ b/demos/embedded/styledemo/files/transparent.qss
@@ -6,7 +6,6 @@ QWidget#StyleWidget
QLabel, QAbstractButton
{
- font: 13pt;
color: beige;
}
diff --git a/demos/embedded/styledemo/styledemo.pro b/demos/embedded/styledemo/styledemo.pro
index ee5e4d6..e0ef202 100644
--- a/demos/embedded/styledemo/styledemo.pro
+++ b/demos/embedded/styledemo/styledemo.pro
@@ -10,3 +10,7 @@ target.path = $$[QT_INSTALL_DEMOS]/embedded/styledemo
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.html
sources.path = $$[QT_INSTALL_DEMOS]/embedded/styledemo
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian:TARGET.UID3 = 0xA000A63F
diff --git a/demos/embedded/styledemo/stylewidget.ui b/demos/embedded/styledemo/stylewidget.ui
index 586faea..9c5f253 100644
--- a/demos/embedded/styledemo/stylewidget.ui
+++ b/demos/embedded/styledemo/stylewidget.ui
@@ -5,16 +5,19 @@
<rect>
<x>0</x>
<y>0</y>
- <width>339</width>
- <height>230</height>
+ <width>172</width>
+ <height>220</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
+ <property name="spacing" >
+ <number>4</number>
+ </property>
<property name="margin" >
- <number>3</number>
+ <number>4</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox" >
@@ -27,15 +30,15 @@
<property name="title" >
<string>Styles</string>
</property>
- <layout class="QHBoxLayout" >
- <property name="spacing" >
- <number>3</number>
- </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
<property name="margin" >
- <number>3</number>
+ <number>4</number>
</property>
- <item>
- <widget class="QPushButton" name="noStyle" >
+ <property name="spacing" >
+ <number>4</number>
+ </property>
+ <item row="0" column="0" >
+ <widget class="QPushButton" name="transparentStyle" >
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" >
<horstretch>0</horstretch>
@@ -43,23 +46,23 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
- <string>No-Style</string>
+ <string>Transp.</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
- <bool>true</bool>
+ <bool>false</bool>
</property>
<property name="autoExclusive" >
<bool>true</bool>
</property>
</widget>
</item>
- <item>
+ <item row="2" column="0" >
<widget class="QPushButton" name="blueStyle" >
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" >
@@ -68,7 +71,7 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
<string>Blue</string>
@@ -84,7 +87,7 @@
</property>
</widget>
</item>
- <item>
+ <item row="0" column="1" >
<widget class="QPushButton" name="khakiStyle" >
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" >
@@ -93,7 +96,7 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
<string>Khaki</string>
@@ -109,8 +112,8 @@
</property>
</widget>
</item>
- <item>
- <widget class="QPushButton" name="transparentStyle" >
+ <item row="2" column="1" >
+ <widget class="QPushButton" name="noStyle" >
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" >
<horstretch>0</horstretch>
@@ -118,16 +121,16 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
- <string>Transparent</string>
+ <string>None</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="autoExclusive" >
<bool>true</bool>
@@ -166,7 +169,7 @@
</property>
<layout class="QVBoxLayout" name="frameLayout" >
<property name="margin" >
- <number>3</number>
+ <number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" >
@@ -195,7 +198,7 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::WheelFocus</enum>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@@ -209,6 +212,9 @@
</item>
<item>
<layout class="QGridLayout" name="gridLayout" >
+ <property name="spacing" >
+ <number>4</number>
+ </property>
<item row="0" column="0" >
<widget class="QScrollBar" name="horizontalScrollBar" >
<property name="sizePolicy" >
@@ -237,10 +243,10 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
- <string>Show Scroller</string>
+ <string>Show</string>
</property>
<property name="checkable" >
<bool>true</bool>
@@ -275,10 +281,10 @@
</sizepolicy>
</property>
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
- <string>Enable Scroller</string>
+ <string>Enable</string>
</property>
<property name="checkable" >
<bool>true</bool>
@@ -330,7 +336,7 @@
<item>
<widget class="QPushButton" name="close" >
<property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
+ <enum>Qt::StrongFocus</enum>
</property>
<property name="text" >
<string>Close</string>
diff --git a/demos/embeddeddialogs/embeddeddialogs.pro b/demos/embeddeddialogs/embeddeddialogs.pro
index a38e3e8..d9948a9 100644
--- a/demos/embeddeddialogs/embeddeddialogs.pro
+++ b/demos/embeddeddialogs/embeddeddialogs.pro
@@ -15,3 +15,5 @@ target.path = $$[QT_INSTALL_DEMOS]/embeddeddialogs
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.png *.jpg *.plist *.icns *.ico *.rc *.pro *.html *.doc images
sources.path = $$[QT_INSTALL_DEMOS]/embeddeddialogs
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
diff --git a/demos/gradients/gradients.pro b/demos/gradients/gradients.pro
index 167572b..7789896 100644
--- a/demos/gradients/gradients.pro
+++ b/demos/gradients/gradients.pro
@@ -16,3 +16,5 @@ target.path = $$[QT_INSTALL_DEMOS]/gradients
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html
sources.path = $$[QT_INSTALL_DEMOS]/gradients
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
diff --git a/demos/interview/interview.pro b/demos/interview/interview.pro
index c013755..19b2ca8 100644
--- a/demos/interview/interview.pro
+++ b/demos/interview/interview.pro
@@ -16,3 +16,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES README *.pro images
sources.path = $$[QT_INSTALL_DEMOS]/interview
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/demos/macmainwindow/macmainwindow.pro b/demos/macmainwindow/macmainwindow.pro
index f5165a7..cab3845 100644
--- a/demos/macmainwindow/macmainwindow.pro
+++ b/demos/macmainwindow/macmainwindow.pro
@@ -20,4 +20,6 @@ target.path = $$[QT_INSTALL_DEMOS]/macmainwindow
sources.files = $$SOURCES *.pro *.html
sources.path = $$[QT_INSTALL_DEMOS]/macmainwindow
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
}
diff --git a/demos/mainwindow/mainwindow.pro b/demos/mainwindow/mainwindow.pro
index 9853a55..6e7d784 100644
--- a/demos/mainwindow/mainwindow.pro
+++ b/demos/mainwindow/mainwindow.pro
@@ -14,3 +14,5 @@ sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.png *.jpg *.pro
sources.path = $$[QT_INSTALL_DEMOS]/mainwindow
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/demos/mediaplayer/mediaplayer.pro b/demos/mediaplayer/mediaplayer.pro
index c64abd9..ef07a3f 100644
--- a/demos/mediaplayer/mediaplayer.pro
+++ b/demos/mediaplayer/mediaplayer.pro
@@ -25,4 +25,6 @@ wince*{
DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
}
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+symbian:TARGET.UID3 = 0xA000C613 \ No newline at end of file
diff --git a/demos/pathstroke/pathstroke.pro b/demos/pathstroke/pathstroke.pro
index 50b4de2..ce6ab3d 100644
--- a/demos/pathstroke/pathstroke.pro
+++ b/demos/pathstroke/pathstroke.pro
@@ -18,3 +18,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html
sources.path = $$[QT_INSTALL_DEMOS]/pathstroke
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
+symbian:TARGET.UID3 = 0xA000A63E \ No newline at end of file
diff --git a/demos/qtdemo/qtdemo.pro b/demos/qtdemo/qtdemo.pro
index 163ed17..6d3cf7d 100644
--- a/demos/qtdemo/qtdemo.pro
+++ b/demos/qtdemo/qtdemo.pro
@@ -6,6 +6,8 @@ DESTDIR = $$DEMO_DESTDIR/bin
OBJECTS_DIR = .obj
MOC_DIR = .moc
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
QT += xml network
contains(QT_CONFIG, opengl) {
diff --git a/demos/shared/shared.pri b/demos/shared/shared.pri
index b551595..1541fa7 100644
--- a/demos/shared/shared.pri
+++ b/demos/shared/shared.pri
@@ -16,5 +16,6 @@ contains(CONFIG, debug_and_release_target) {
hpux-acc*:LIBS += $$SHARED_FOLDER/libdemo_shared.a
hpuxi-acc*:LIBS += $$SHARED_FOLDER/libdemo_shared.a
-!hpuxi-acc*:!hpux-acc*:LIBS += -ldemo_shared
+symbian:LIBS += -ldemo_shared.lib
+!hpuxi-acc*:!hpux-acc*:!symbian:LIBS += -ldemo_shared
diff --git a/demos/shared/shared.pro b/demos/shared/shared.pro
index cabce25..a5e0e70 100644
--- a/demos/shared/shared.pro
+++ b/demos/shared/shared.pro
@@ -29,5 +29,8 @@ target.path = $$[QT_INSTALL_DEMOS]/shared
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.pri images
sources.path = $$[QT_INSTALL_DEMOS]/shared
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/demos/demobase.pri)
!cross_compile:INSTALLS += target
+symbian:TARGET.UID3 = 0xA000A63C
diff --git a/demos/spreadsheet/spreadsheet.pro b/demos/spreadsheet/spreadsheet.pro
index 6ed0016..5cf251a 100644
--- a/demos/spreadsheet/spreadsheet.pro
+++ b/demos/spreadsheet/spreadsheet.pro
@@ -31,3 +31,5 @@ sources.files = $$SOURCES $$RESOURCES *.pro images $$HEADERS
sources.path = $$[QT_INSTALL_DEMOS]/spreadsheet
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/demos/sqlbrowser/sqlbrowser.pro b/demos/sqlbrowser/sqlbrowser.pro
index 920e8a0..1334bc1 100644
--- a/demos/sqlbrowser/sqlbrowser.pro
+++ b/demos/sqlbrowser/sqlbrowser.pro
@@ -18,6 +18,8 @@ sources.files = $$SOURCES $$HEADERS $$FORMS *.pro
sources.path = $$[QT_INSTALL_DEMOS]/sqlbrowser
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
wince*: {
DEPLOYMENT_PLUGIN += qsqlite
}
diff --git a/demos/textedit/textedit.cpp b/demos/textedit/textedit.cpp
index 128cd6a..7350a42 100644
--- a/demos/textedit/textedit.cpp
+++ b/demos/textedit/textedit.cpp
@@ -127,7 +127,9 @@ TextEdit::TextEdit(QWidget *parent)
connect(textEdit, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool)));
connect(textEdit, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool)));
+#ifndef QT_NO_CLIPBOARD
connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged()));
+#endif
QString initialFile = ":/example.html";
const QStringList args = QCoreApplication::arguments();
@@ -240,7 +242,9 @@ void TextEdit::setupEditActions()
a->setShortcut(QKeySequence::Paste);
tb->addAction(a);
menu->addAction(a);
+#ifndef QT_NO_CLIPBOARD
actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty());
+#endif
}
void TextEdit::setupTextActions()
@@ -638,7 +642,9 @@ void TextEdit::cursorPositionChanged()
void TextEdit::clipboardDataChanged()
{
+#ifndef QT_NO_CLIPBOARD
actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty());
+#endif
}
void TextEdit::about()
diff --git a/demos/textedit/textedit.pro b/demos/textedit/textedit.pro
index 1ef4256..6f15e70 100644
--- a/demos/textedit/textedit.pro
+++ b/demos/textedit/textedit.pro
@@ -19,3 +19,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html *.doc images
sources.path = $$[QT_INSTALL_DEMOS]/textedit
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/demos/undo/undo.pro b/demos/undo/undo.pro
index e26d07c..bf7017b 100644
--- a/demos/undo/undo.pro
+++ b/demos/undo/undo.pro
@@ -15,3 +15,5 @@ sources.files = $$SOURCES $$HEADERS *.pro icons $$RESOURCES $$FORMS
sources.path = $$[QT_INSTALL_DEMOS]/undo
INSTALLS += target sources
+include($$QT_SOURCE_TREE/demos/demobase.pri)
+
diff --git a/dist/changes-4.4.4-temple b/dist/changes-4.4.4-temple
new file mode 100644
index 0000000..25f1f0b
--- /dev/null
+++ b/dist/changes-4.4.4-temple
@@ -0,0 +1,65 @@
+Qt for S60 4.4.4 Temple introduces new ported modules and few other improvements.
+It guarantees no source or binary compatibility between any other versions.
+
+Some of the changes listed in this file include internal issue tracking
+numbers.
+
+This file only lists changes specific to Qt for S60.
+
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+Qt for S60
+----------
+ * Changes to qmake:
+ * [228860] Fixed bld.inf and .mmp generation when not under Qt src tree,
+ i.e. when the makespec is default.
+ * [231121] Added no_icon CONFIG keyword to suppress showing application
+ icon in the application menu.
+ * [233497] EPOCROOT is no longer required as environment variable as long
+ as a Symbian device can be determined.
+ * [234551] Generated .pkg files no longer include Qt libraries directly,
+ instead they have a dependency to a separate QtLibs package.
+ * [234555] Added support for generic mmp file content in form of
+ MMP_RULES variable. Also, EXPORTUNFROZEN is now defined using this
+ variable instead of being hardcoded.
+ * [234557] Improved user ability to control include order via INCLUDEPATH
+ variable.
+ * [234557] Support for STDDLL, STDEXE and STDLIB Open C target types via
+ stdbinary CONFIG keyword.
+ * [235975] The -r switch is no longer required with qmake to recurse
+ subdirs template.
+ * Fixed: Resources with similar basenames corrupted makefile.
+
+ * [230751] Improved Elastic Nodes application stability.
+ * [230752] Mouse drag events work now.
+ * [234558] Ported QSharedMemory.
+ * [234559] Ported QSystemSemaphore.
+ * [234560] Ported all of QtXml.
+ * [234561] Ported all of QtScript.
+ * [234562] Ported all of QtSvg.
+ * [234869] QFileDialog no longer uses desktop layout in Qt for S60.
+ * QtNetwork now supports SSL.
+ * If current path returned by Open C doesn't exist when queried, it is
+ created.
+ * All supported libs and plugins built under src dir now have proper UIDs.
+ * Fixed GCCE build breaking on atomics.
+ * Improved fonts support:
+ * Anti aliasing
+ * Italic/bold
+ * Higher text layout precision
+ * QPixmapCache size limited to 2MB.
+ * Createpackage script looks for RnD certs in Qt installation root instead
+ of EPOCROOT.
+ * Iconengines plugins included in the default build.
+ * More examples and demos added in the default build to showcase newly
+ ported modules.
+ * QFileSystemWatcher thread stack size increased to avoid crashing when
+ entering directories that need AllFiles capability.
+ * Createpackage will now support signing with custom certificates in
+ addition to default ones.
+ * A perl script patch_capabilities.pl is provided for changing capabilities
+ of all binaries specified in a single .pkg file.
+ \ No newline at end of file
diff --git a/dist/changes-4.5.0-garden b/dist/changes-4.5.0-garden
new file mode 100644
index 0000000..1fae42e
--- /dev/null
+++ b/dist/changes-4.5.0-garden
@@ -0,0 +1,241 @@
+Qt 4.5.0-garden
+---------------
+
+The Qt for S60 "Garden" release is the fourth pre-release from the
+Qt for S60 porting project. "Garden" is based on the Qt 4.5 codebase
+and release focus has been on proper GUI integration.
+
+Up to and including change: b7621555cb1d1c97967dd40d63dd7e85a418407c
+
+Lists just S60 fixes, for general 4.5.0 changes go to:
+
+ http://www.qtsoftware.com/developer/changes/changes-4.5.0
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Task Tracker:
+
+ http://qtsoftware.com/developer/task-tracker
+
+Each of these identifiers can be entered in the task tracker to obtain
+more information about a particular change. Sometimes the task is internal
+and cannot be viewed by the public, a lot of them are non-public for Qt for
+S60 at the moment.
+
+****************************************************************************
+* New features *
+****************************************************************************
+
+New modules
+-----------
+
+- qtmain
+ * Added a small static library called qtmain which is linked in
+ automatically for Qt applications on S60. qtmain includes an
+ implementation of E32Main() that sets up Qt correctly for S60. This
+ means that Qt no longer links to libcrt0.lib but uses qtmain instead.
+ However, if you are not linking against QtGui, you'll still have to
+ link to libcrt0.
+
+New classes
+------------
+
+- QS60Style
+ * Native look for Qt applications on S60 3.1 and later versions. The
+ style picks up the current theme parts, palettes and font settings
+ through the skinserver and uses these when painting in Qt.
+ The layout data for different resolutions is considered.
+
+Ported classes
+--------------
+
+- QDesktopServices
+ * Provides methods for accessing common desktop services: Opening the
+ browser with an url, launching documents with the standard application
+ and getting default system directories.
+
+- QClipboard
+ * Provides access to the window system clipboard.
+
+- QSysInfo
+ * QSysInfo class provides information about the system.
+
+Features
+--------
+
+- Input methods
+ * QInputMethodEvent will now be generated by Qt.
+ To use it, widgets must set the attribute WA_InputMethodEnabled and
+ implement QWidget::inputMethodQuery(...).
+ * Qt will use the underlaying FEP framework from S60.
+ * Multitap and T9 supported.
+ * Virtual keyboard for touch phones is supported.
+ * Most of the Qt widgets already have support for input methods.
+
+- Drag-n-Drop
+ * At the moment works only within same Qt process.
+
+- STL support for QtS60
+ * use -stl switch when configuring Qt.
+
+Optimizations
+-------------
+
+
+****************************************************************************
+* Build issues *
+****************************************************************************
+
+- Fixed compilation on private S60 platforms by adding neccessary include paths.
+- Fix compiler error if --gnu flag is given to RVCT.
+
+
+****************************************************************************
+* Changes to existing classes *
+****************************************************************************
+
+- qapplication_s60.cpp (non-public)
+ * Simplified by introduction of qtmain.
+ * added CCoeControl to be the native representation of QWidget.
+ * Use window group from CEikonEnv instead of creating our own.
+ * No need to create/destroy RWsSession, this is now done by the Avkon
+ application.
+ * Handle pointer events from QSymbianControl.
+ * Stopped using QETWidget for translation, now handled by
+ QSymbianControl.
+ * MouseButtonDblClick mapped to EModifierDoubleClick (after dblclick
+ Symbian will send mouseButtonRelease.
+
+- QApplication
+ * Implemented setDoubleClickInterval(...).
+ * Improved widgetAt().
+ * Added support for resizing widget's when the screen orientation
+ changes from portrait to landscape. For fullscreen and maximized
+ widgets this will ensure that they look correct in the new screen
+ layout.
+
+- qwindowsurface_s60.cpp (non-public)
+ * Stopped creating our own CWindowGc based on the RWindow and get
+ SystemGc from the CCoeControl we are currently painting on instead.
+
+- qeventdispatcher_s60.cpp
+ * Stopped using Active Objects to recieve events, we get them from
+ C*AppUi and CCoeControl instead.
+
+- QWidget
+ * Proper implementation for QDesktopWidget::availableGeometry.
+ * Improved raising and lowering widgets.
+ * Implemented setWindowTitle(...).
+ * Implemented QWidget::setWindowIcon(...) and made it to react to
+ different statuspane layouts.
+ * Improved focus handling (improved setFocus_sys).
+ * Fixed native window scrolling. Only use accelerated scroll if we are
+ scrolling a window owning widget.
+ * Improved setWindowState(...).
+ * Added implementation for createDefaultWindowSurface_sys().
+ * Added implementation for setMask_sys().
+ * Not creating a backing store for the top level widget (saves memory).
+ * winId() now returns a CCoeControl instead of RWindow.
+
+- QMenuBar
+ * Added support for using native S60 menues.
+ * Supported infinite level of menues inside menues.
+ * Supported checkboxes next to menu items).
+
+- QtCore and QtGui
+ * link to CONE and Uikon libraries and stop linking to glib and gthread.
+ * Renamed qt_deployment.pro to qt_libs.pro as it is more consistent.
+
+- Event loop / Event dispatcher
+ * We now integrate with the native loop, allowing CActiveScheduler and
+ QEventLoop to be used interchangably.
+ * Enabled posted events to work from the Symbian active scheduler too.
+ * Enable use of QEventLoop::ExcludeSocketEvents on Symbian.
+ * Improved handling of zero timers.
+
+- QColumnView
+ * Fixed a typo in one instance of QT_NO_QCOLUMNVIEW.
+
+- font rendering
+ * Speed increase
+ * Correctly render RTL text
+ * Proper shaping of complex writing systems
+ * Automatic font linking (aka merging) of different writing systems
+ * Rudimentary fallback glyph outline support
+ * Defaults to Symbians native (usually iType based) font rendering.
+ Alternatively, supports FreeType. Configure with -qt-freetype.
+
+- qcore_symbian_p.h (non-public)
+ * Added helper functions to convert QRect <-> TRect.
+ * Renamed qstringToTPtrC to qt_QString2TPtrC.
+ * Added helper function qt_TDisplayMode2Format.
+ * Added helper function to convert QSize <-> TSize.
+ * Added helper function to convert QString ->HBufC.
+ * Added helper function to convert TDesC -> QString.
+
+- QGraphicsSystem
+ * QRasterPixmapData(...) is specified as default pixmap data for S60.
+
+- QPixmap
+ * Improved grabWindow(...) when it comes to selecting client rect.
+
+- QDirModel
+ * Returns root dir name similary as done in Windows
+
+- QFSFileEngine
+ * copy(...) now uses Symbian native copy implementation which is more efficient
+ and doesn't leave temp files behind
+
+- QLocale
+ * Now has Symbian system locale support.
+
+****************************************************************************
+* Examples and demos *
+****************************************************************************
+
+****************************************************************************
+* Tools *
+****************************************************************************
+
+- qmake
+ * Support for QMAKE_EXTRA_TARGETS and QMAKE_EXTRA_COMPILERS variables.
+ * Support BLD_INF_RULES variable. Adds entries to generated bld.inf file
+ * Added 'make' targets '<build>-<platform>' 'distclean' and 'run'
+ * New platform_paths.prf and data_caging_paths.prf contain several
+ variables and replacement functions for including known paths.
+ * The .pro file qt_libs.pro was moved to src/s60installs.
+ * Support for ICON variable for setting application icon.
+ * Support for RSS_RULES variable, which enables entries to be added to
+ generated application registration files.
+ * When bulding qmake and other bootstrapped tools we now use
+ "-warnings on" instead of "-warnings all".
+ * Improved error message if calls to $$system() fails.
+ * Fixed several issues when qmake is built for platform win32-mwc.
+ * Moved mocing step to the build step so it is not longer required to
+ do "abld build" or "abld makefile" to remoc.
+ * Improved "make clean".
+ * Increased max heap to 8Mb.
+ * Enabled __CC_ARM flag used by some versions of RVCT.
+ * Removed hard coded INCLUDEPATH from qmake - developer can control
+ the whole include path hierachy.
+ * Symbian export mechanism is no longer used for emulator deployment,
+ instead copy commands are generated to wrapper makefile and
+ executed during final phase of building, after post link.
+ * Removed -O1 flag from WINSCW builds.
+ * Added qmake function (size) to ask number of items in QStringList.
+ * Qt demos are now installed to QtDemos folder in S60 emulator.
+ * Qt examples are now installed to QtExamples folder in S60 emulator/HW.
+ * Plugin stubs suffix changed to ".qtplugin".
+ * Paths containing $${EPOCROOT}/epoc32 will now properly generate
+ absolute paths in mmps.
+
+
+-configure
+ * Defaults for FREETYPE and SCRIPTTOOLS set to "no".
+
+****************************************************************************
+* Plugins *
+****************************************************************************
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
diff --git a/dist/changes-4.5.2-tower b/dist/changes-4.5.2-tower
new file mode 100644
index 0000000..eaf493d
--- /dev/null
+++ b/dist/changes-4.5.2-tower
@@ -0,0 +1,436 @@
+Qt 4.5.2-tower
+---------------
+
+The Qt for S60 "Tower" release is the fifth pre-release from the Qt for
+S60 porting project. "Tower" is based on the Qt 4.5 codebase (mostly Qt 4.5.2).
+
+This list of changes lists S60 specific fixes only,
+for general 4.5.x changes go to:
+
+ http://www.qtsoftware.com/developer/changes/changes-4.5.0
+ http://www.qtsoftware.com/developer/changes/changes-4.5.1
+ http://www.qtsoftware.com/developer/changes/changes-4.5.2 (partially in Tower)
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Task Tracker:
+
+ http://qtsoftware.com/developer/task-tracker
+
+Each of these identifiers can be entered in the task tracker to obtain
+more information about a particular change. Sometimes the task is internal
+and cannot be viewed by the public, a lot of them are non-public for Qt for
+S60 at the moment.
+
+****************************************************************************
+* New features *
+****************************************************************************
+
+New modules
+-----------
+
+- Input methods
+ * Added events to support opening and closing the virtual keyboard, called
+ software input panel in Qt.
+ * Added an option to QApplication to choose between single or double click
+ input panel activation.
+ * Added input method hints API to Qt. These can be used to instruct input methods
+ to only allow certain characters or tailor their appearance.
+ * Added Qt::ImAnchorPosition to support querying for selections through input
+ methods.
+ * Added QInputMethodEvent::Selection to support setting the selection through
+ input methods.
+
+- Phonon
+ * The Phonon library is now part of Qt, but it comes without a backend.
+ This means that applications can build and run against the Phonon
+ library, but there is currently no S60 backend plugin providing actual
+ multimedia playback. Possible alternatives such as Helix and MMF are
+ being investigated.
+
+- QtSql
+ * Implemented QtSql module with sqlite3 backend. For now backend is
+ provided only in binary format.
+
+- QtWebkit
+ * Experimental webkit build for S60. Can be enabled by passing -webkit
+ to configure.
+
+New classes
+------------
+
+- QScopedPointer
+ * Smart pointer, which deletes pointer when destroyed.
+
+Ported classes
+--------------
+
+- QColormap
+ * Added basic implementation of QColormap for Symbian.
+
+- QLocalSocket and QLocalServer
+ * Added support for QLocalSocket and QLocalServer on Symbian.
+
+- QSound
+ * Implemented CMdaAudioPlayerUtility based Symbian backend for QSound.
+
+Features
+--------
+
+- QApplication
+ * Implemented QApplication::beep() for Symbian.
+
+- QPixmap
+ * Added supported for converting to/from CFbsBitmap
+
+- QSslSocket
+ * Added support for -openssl option i.e. runtime resolving of OpenSSL
+ symbols.
+
+- QWidget
+ * Basic widgets are now navigatable and usable via keypad on SDK 3
+ FP 1 and FP 2.
+ * Widgets can now be made semi-transparent on systems that support it
+ using Qt::WA_TranslucentBackground.
+
+- Exception safety
+ * Improving the exception safety of Qt, not yet complete.
+ * Added support for translating between Symbian leaves and standard C++
+ exceptions.
+
+Optimizations
+-------------
+
+- qdrawhelper
+ * Optimized drawing operations for RVCT builds, particulary for ARMV6.
+
+- QFont
+ * Use cached DPI for metrics.
+
+- qwidget_s60.cpp
+ * Avoid unnecessary calls to FocusChanged in Symbian.
+
+- qwindowsurface_s60.cpp
+ * Avoid updating raster buffer pointer on window hide
+
+Documentation
+-------------
+
+- exceptionsafety.qdoc
+ * A guide to exception safety in Qt.
+
+- symbian-exceptionsafety.qdoc
+ * A guide to integrating exception safety in Qt with Symbian.
+
+****************************************************************************
+* Code clean-up *
+****************************************************************************
+
+- Cleanup qeventdispatcher_unix.cpp
+ * 247268: All qeventdispatcher_unix.cpp changes were reverted since
+ this file is not anymore used in Symbian OS branch.
+
+- Cleanup QtNetwork workarounds implemented earlier due to Open C bugs.
+ * 247287: Removed getaddrinfo workaround.
+ * 247288: Removed waitForConnected workaround.
+ * 247289: Removed qt_socket_accept workaround.
+ * 247290: Removed qt_socket_connect workaround.
+ * 247290: Removed E32IONREAD workaround.
+ * 247293: Removed nativeHasPendingDatagrams workaround.
+ * 247295: Removed QNativeSocketEnginePrivate::nativeRead EPIPE
+ workaround.
+
+- Other code clean-ups
+ * 247278: Removed unnecessary includes from qbackingstore.cpp.
+ * Fixed Q_OS_SYMBIAN ifdef usage in qfiledialog_p.h.
+ * 247272: Removed qtestnetworkservers.h dependency, used
+ network-settings.h.
+ * Revert "Work around compiler bug on Nokia Metrowerks compiler."
+ * Remove UI highlights being inverted colors based on highlight text
+ colors.
+
+****************************************************************************
+* Build issues *
+****************************************************************************
+
+- Macros
+ * QT_NO_DEBUG now properly defined in release mode.
+
+- QTest
+ * Fixed testlib export macros for RVCT builds.
+
+- Namespaces
+ * Now builds when -qtnamespace option is defined.
+
+****************************************************************************
+* Changes to existing classes *
+****************************************************************************
+
+- QApplication
+ * 252798: Fixed layout when orientation changed via
+ AknAppUi::SetOrientationL.
+ * Generating MouseEvents has gone through several changes.
+ * qt_init() has been changed: auto flush is always enabled for
+ window server sessions on 3.1 SDK for both UDEB and UREL.
+ * Added support for '-graphics-system' command line option
+
+- QCoeFepInputContext (non-public)
+ * Fixes FEP crash when changing the focused Qt widget to NULL.
+ * Fixed a bug where the virtual keyboard could not be opened if there
+ was only one input widget.
+ * Fixed a crash in FEP when exiting application.
+
+- QDebug
+ * Fixed debug printing (incl. qWarning, qFatal) for strings longer
+ than 256 characters.
+ * introduce a breakpoint to get the emulator to stop in the debugger
+ when qFatal is called
+
+- QDesktopServices
+ * Fixed forwardslash/backslash usage as an path separator.
+ * Switched QDesktopServices mail-to URL handling to RSendAs in Symbian,
+ due to the fact that CSendUi requires extensive capabilities to work
+ correctly. Currently e-mail sending with qdesktopservices::openUrl
+ works in Symbian only if e-mail account already exists.
+
+- QDesktopWidget
+ * 253930: Implement proper resize behavior and emit necessary signals.
+
+- QEventDispatcherSymbian (non-public)
+ * Lowered the timeout for reprioritizing the process to 100ms.
+ * Fixed ASSERT panic in Symbian event dispatcher.
+ * 246600: Fix problem in eventdispatcher destructor / AO canceling.
+ * Fixed active scheduler removal when calling QThread::terminate.
+ * Fix to Open C bug: select sometimes returns -1 and errno is
+ ECONNREFUSED.
+ * Fix a crash when using QEventLoop::ExcludeSocketNotifiers flag.
+ * Changed to round robin scheduling for Qt's active objects. Other
+ active objects will still be scheduled like before.
+ * Fixed crash if events are posted before QApplication construction
+
+- QFontDataBase
+ * Now, also fonts from the user's /resources/fonts directories are
+ available.
+
+- QFontEngine
+ * Fix the vertical advance of glyph metrics.
+
+- QFontMetrics
+ * Fixed the boundingRect calculation for text.
+
+- QGraphicsView
+ * Added support for virtual keyboard to the the viewport.
+
+- QGraphicsTextItem
+ * Added support for virtual keyboard.
+
+- QHostInfo
+ * Added support for host lookups with multiple ipv4 addresses.
+
+- QInputContext
+ * Added QInputContext::s60FilterEvent().
+
+- QIoDevice
+ * Fixed compilation error when QIODEVICE_DEBUG is defined.
+
+- QKeyMapper (non-public)
+ * Fixed a broken keymapping where Enter key would be mapped to Tab.
+
+- QLocale
+ * Removed workaround for missing tzname symbol, fixes QLocal timeZone
+ implementation for Symbian.
+
+- QLocalSocket
+ * Connecting to QLocalServer is always done in blocking mode.
+
+- QMenuBar
+ * Native menus are handled properly even when application has multiple
+ QMainWindows.
+ * Fixed a bug causing both native and qt menu to be created.
+ * Fix for disappearing options menu after coming back from dialog.
+
+- QNativeSocketEnginePrivate (non-public)
+ * Socket connect and listen failure is indicated in exception set.
+ (Workaround to Open C bug)
+
+- QNetworkInterface
+ * Fixed R-handle leak in Symbian version of qnetworkinterface_unix.cpp.
+ * Introduced a new qnetworkinterface_symbian.cpp, because there wasn't
+ really anything common to UNIX equivalent.
+
+- QPixmap
+ * Added fromSymbianCFbsBitmap() and toSymbianCFbsBitmap().
+
+- QPlainTextEdit
+ * Added support for virtual keyboard.
+
+- QPluginLoader
+ * QPluginLoader will look for plugin stubs from the same folder on other
+ drives if it can't find them from the indicated drive.
+
+- QS60Style
+ * Added subElementRect implementation for SE_ItemViewItemCheckIndicator.
+ * Added support for E90 layouts.
+ * Added support for QScrollArea, QTextEditor, QGroupBox, QTreeView,
+ QToolBar and QDial styling.
+ * Better support for theme and layout changes.
+ * Better support for themed palettes and themed text colors.
+ * Better support for multiselection in item views.
+ * Better theming for QTable and QPanel.
+ * Better support of highlight graphics and texts for QLists, QTreeViews,
+ QCalendarWidgets and QComboBoxes.
+ * Support polishing fonts. Fonts are no longer changed within the drawing
+ code.
+ * Draw spinbox arrowbuttons side-by-side, instead one on top of the other.
+ * Harmonize widget drawing so that widgets are of similar height.
+ * Support check states for QLists and QPushButtons.
+ * Support flat QPushButtons.
+ * Support busy indicator.
+ * Support QScrollBar pressed state.
+ * Support QPushButton disabled theme graphics.
+ * Separate theme background for QDialogs.
+ * Clarify QToolButton pressed state.
+ * Removed linedrawing of panels and groupboxes.
+ * Fix palette-polution for a style that is activated from an application
+ after S60Style has been in use.
+ * Fix for frame masks with color depth other than EGrey2.
+ * Fix for squeezed QTabBars.
+ * Fix memory leak when color skinning graphics.
+ * Show focus/Editfocus visualization for KeyPad navigation on
+ SDK 3 FP 1 and FP 2.
+ * Fix for overwriting user specified palettes.
+
+- QSelectThread (non-public)
+ * We force monitoring sockets exception status as well, and not
+ just read/write.
+ * Notification related to the particular socket signaled via exception
+ fd_set will be mapped to the appropriate read/write notification.
+
+- QTemporaryFile
+ * Fixed temporary file rename in Symbian OS.
+
+- QTest
+ * Disable keypad navigation for autotests by default
+
+- QTextEdit
+ * Added support for virtual keyboard.
+
+- QThread
+ * Fixed thread termination in Symbian OS.
+
+- QUdpSocket
+ * Updated BindFlag documentation to reflect behaviour on Symbian OS.
+ * Wrote hack for QUdpSocket::writeDatagram return value in Symbian OS.
+
+- QWidget
+ * Added API for setting softkeys.
+ * Fixed background painting. Background can now be overwritten from
+ setting the respective palette role.
+ * Add support for Qt::WA_TranslucentBackground.
+
+- Many classes
+ * Improved exception safety.
+
+****************************************************************************
+* Examples and demos *
+****************************************************************************
+
+- Anomaly browser
+ * Added to demonstrate QtWebkit usage.
+
+- Deform, Pathstroke, and Wiggly
+ * Removed Symbian specific animation timer fixes since more generic
+ fix was made to event dispatcher.
+
+- DesktopServices
+ * Implemented content filters for desktopservices example.
+ * Added error handling to qdesktopservices example when openUrl fails.
+
+- Drilldown
+ * Added to demonstrate QtSql usage in Symbian OS.
+
+- Fluidlauncher
+ * Removed ugly workaround to make emulator deployment work correctly,
+ since the issue has been fixed in qmake.
+ * Included drilldown to demonstrate QtSql usage.
+ * Updated screenshots to S60 style.
+ * Added softkeys example.
+ * Added Anomaly browser to fluidlauncher.
+
+- Ftp
+ * Enabled default IAP setting for FTP example.
+ * IAP dialog will show after FTP UI is on screen.
+ * If active IAP exist that one will be used.
+
+- SecureSocketClient
+ * Fixed build issue caused by lack of cursor.
+
+- Softkeys
+ * New example showing how to use softkeys API in QWidget.
+
+****************************************************************************
+* Tools *
+****************************************************************************
+
+- configure
+ * -cetest is no longer a supported switch for configure.
+ * -stl option is enabled by default for Symbian OS
+ * -openssl option is enabled by default for Symbian OS.
+ * -fpu option enables vfpu type selection for ARM targets.
+
+- qmake
+ * Support for generating Symbian "test" targets: CONFIG += symbian_test.
+ * Support for Symbian Build System, version 2 (aka Raptor) via
+ symbian-sbsv2 mkspec.
+ * PAGED keyword is added to all MMP files by default, except in S60 3.1
+ builds.
+ * Read-only flag is no longer preserved when deploying files into
+ emulator environment.
+ * Changed the timestamp to ISO format in all files generated
+ by qmake for symbian-* mkspecs.
+ * Qt's VERSION variable will now generate VERSION keyword in mmp files.
+ * Made Open C include paths handling bit more robust.
+ * Support both Symbian Foundation header structure in /epoc32/include,
+ as well as old Symbian/S60 structure
+
+- Release package creation
+ * Removed the obsolete script to create release package.
+
+- Createpackage script
+ * Now creates packages with .sis suffix.
+
+- Patch_capabilities script
+ * Will now patch also vendor id in binaries and the UID in the pkg file.
+
+
+****************************************************************************
+* Documentation *
+****************************************************************************
+
+- qmake-manual
+ * 250370: Added documentation for ICON keyword.
+
+****************************************************************************
+* Plugins *
+****************************************************************************
+
+- S60 version specific plugins
+ * Isolated S60 version dependent functionality to S60 version specific
+ plugins (qts60plugin_x_y.dll) to make it possible for single build to
+ run on any supported device, even if with reduced functionality on
+ some.
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+- Qt libs
+ * Qt libs are now built with "All -Tcb" capabilities always. It is now
+ always necessary to run patch_capabilities.pl script if self-signing
+ of Qt libs is desired.
+ * QtCore and QtSql made UNPAGED when installed via SIS file as a
+ workaround for an obscure crash when they are paged.
+ * qt_libs.pro updated to reflect Open C dependencies, as Qt requires
+ 1.5.0 and newer release.
+ * Qt libs are now build with the "STDCPP" mmp flag. On platforms from
+ TB9.2, Qt code will throw std::bad_alloc exceptions on allocation
+ failure.
diff --git a/doc/src/appicon.qdoc b/doc/src/appicon.qdoc
index 4d29337..a0fdbab 100644
--- a/doc/src/appicon.qdoc
+++ b/doc/src/appicon.qdoc
@@ -223,4 +223,19 @@
installed in the appropriate locations for GNOME.
The GNOME developer website is at \l{http://developer.gnome.org/}.
+
+ \section1 Setting the Application Icon on S60 platforms
+
+ In order to set application icon for S60 application you need SVG-T icon.
+ How to create such SVG-T, please refer to
+ \l{http://wiki.forum.nokia.com/index.php/How_to_create_application_icon(SVG)_in_S60_3rd_edition/}
+
+ Once you have icon in correct format and assuming you are using
+ \c qmake to generate your makefiles, you only need to add a single
+ line to your \c .pro project file. For example, if the name of your
+ icon file is \c{myapp.svg}, and your project file is \c{myapp.pro},
+ add this line to \c{myapp.pro}:
+
+ \snippet doc/src/snippets/code/doc_src_appicon.qdoc 5
+
*/
diff --git a/doc/src/emb-install.qdoc b/doc/src/emb-install.qdoc
index 11b3f03..eb75697 100644
--- a/doc/src/emb-install.qdoc
+++ b/doc/src/emb-install.qdoc
@@ -42,10 +42,10 @@
/*!
\page qt-embedded-install.html
- \title Installing Qt for Embedded Linux
+ \title Installing Qt on Embedded Linux
\ingroup qt-embedded-linux
\ingroup installation
- \brief How to install Qt for Embedded Linux.
+ \brief How to install Qt on Embedded Linux.
This document describes how to install \l{Qt for Embedded Linux} in your
development environment:
diff --git a/doc/src/examples.qdoc b/doc/src/examples.qdoc
index c55d29f..10f58f6 100644
--- a/doc/src/examples.qdoc
+++ b/doc/src/examples.qdoc
@@ -401,6 +401,7 @@
\list
\o \l{xml/dombookmarks}{DOM Bookmarks}
+ \o \l{xml/htmlinfo}{HTML Info}
\o \l{xml/saxbookmarks}{SAX Bookmarks}
\o \l{xml/streambookmarks}{QXmlStream Bookmarks}\raisedaster
\o \l{xml/rsslisting}{RSS-Listing}
diff --git a/doc/src/examples/htmlinfo.qdoc b/doc/src/examples/htmlinfo.qdoc
new file mode 100644
index 0000000..af236e1
--- /dev/null
+++ b/doc/src/examples/htmlinfo.qdoc
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example xml/htmlinfo
+ \title XML HTML Info Example
+
+ The XML HTML Info example provides a simple command line utility that
+ scans the current directory for HTML files and prints statistics about
+ them to standard out.
+
+ \note Standard out is redirected on some platforms. On Symbian using Open
+ C \c stdout is by default directed to the console window, but this window
+ may not always be visible. To redirect to a file instead, locate the \c
+ c:\\system\\data\\config.ini file (on either the emulator or the device)
+ and change \c STDOUT to point to \c MEDIA4. This will redirect the console
+ to \c c:\\system\\data\\out.txt.
+
+ The files are parsed using a QXmlStreamReader object. If the file does
+ not contain a well-formed XML document, a description of the error is
+ printed to the standard error console.
+
+ \section1 Basic Operation
+
+ The main function of the example uses QDir to access files in the current
+ directory that match either "*.htm" or "*.html". For each file found,
+ the \c parseHtmlFile() function is called.
+
+ Reading XML is handled by an instance of the QXmlStreamReader class, which
+ operates on the input file object:
+
+ \snippet examples/xml/htmlinfo/main.cpp 0
+
+ The work of parsing and the XML and extracting statistics is done in a
+ while loop, and is driven by input from the reader:
+
+ \snippet examples/xml/htmlinfo/main.cpp 1
+
+ If more input is available, the next token from the input file is read
+ and parsed. The program then looks for the specific element types,
+ "title", "a", and "p", and stores information about them.
+
+ When there is no more input, the loop terminates. If an error occurred,
+ information is written to the standard out file via a stream, and the
+ example exits:
+
+ \snippet examples/xml/htmlinfo/main.cpp 2
+
+ If no error occurred, the example prints some statistics from the data
+ gathered in the loop, and then exits.
+*/
diff --git a/doc/src/exceptionsafety.qdoc b/doc/src/exceptionsafety.qdoc
new file mode 100644
index 0000000..4e3e89e
--- /dev/null
+++ b/doc/src/exceptionsafety.qdoc
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page exceptionsafety.html
+ \title Exception Safety
+ \ingroup architecture
+ \brief A guide to exception safety in Qt.
+
+ \bold {Preliminary warning}: Exception safety is not feature complete!
+ Common cases should work, but classes might still leak or even crash.
+
+ Qt itself will not throw exceptions. Instead, error codes are used.
+ In addition, some classes have user visible error messages, for example
+ \l QIODevice::errorString() or \l QSqlQuery::lastError().
+ This has historical and practical reasons - turning on exceptions
+ can increase the library size by over 20%.
+
+ The following sections describe Qt's behavior if exception support is
+ enabled at compile time.
+
+ \tableofcontents
+
+ \section1 Exception safe modules
+
+ \section2 Containers
+
+ Qt's \l{container classes} are generally exception neutral. They pass any
+ exception that happens within their contained type \c T to the user
+ while keeping their internal state valid.
+
+ Example:
+
+ \code
+ QList<QString> list;
+ ...
+ try {
+ list.append("hello");
+ } catch (...) {
+ }
+ // list is safe to use - the exception did not affect it.
+ \endcode
+
+ Exceptions to that rule are containers for types that can throw during assignment
+ or copy constructions. For those types, functions that modify the container as well as
+ returning a value, are unsafe to use:
+
+ \code
+ MyType s = list.takeAt(2);
+ \endcode
+
+ If an exception occurs during the assignment of \c s, the value at index 2 is already
+ removed from the container, but hasn't been assigned to \c s yet. It is lost
+ without chance of recovery.
+
+ The correct way to write it:
+
+ \code
+ MyType s = list.at(2);
+ list.removeAt(2);
+ \endcode
+
+ If the assignment throws, the container still contains the value, no data loss occured.
+
+ Note that implicitly shared Qt classes will not throw in their assignment
+ operators or copy constructors, so the limitation above does not apply.
+
+ \section1 Out of memory handling
+
+ Most desktop operating systems overcommit memory. This means that \c malloc()
+ or \c{operator new} return a valid pointer, even though there is not enough
+ memory available at allocation time. On such systems, no exception of type
+ \c std::bad_alloc is thrown.
+
+ On all other operating systems, Qt will throw an exception of type std::bad_alloc
+ if any allocation fails. Allocations can fail if the system runs out of memory or
+ doesn't have enough continuous memory to allocate the requested size.
+
+ Exceptions to that rule are documented. As an example, \l QImage::create()
+ returns false if not enough memory exists instead of throwing an exception.
+
+ \section1 Recovering from exceptions
+
+ Currently, the only supported use case for recovering from exceptions thrown
+ within Qt (for example due to out of memory) is to exit the event loop and do
+ some cleanup before exiting the application.
+
+ Typical use case:
+
+ \code
+ QApplication app(argc, argv);
+ ...
+ try {
+ app.exec();
+ } catch (const std::bad_alloc &) {
+ // clean up here, e.g. save the session
+ // and close all config files.
+
+ return 0; // exit the application
+ }
+ \endcode
+
+ After an exception is thrown, the connection to the windowing server
+ might already be closed. It is not safe to call a GUI related function
+ after catching an exception.
+*/
diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc
index 49ab45a..997595d 100644
--- a/doc/src/installation.qdoc
+++ b/doc/src/installation.qdoc
@@ -499,6 +499,146 @@ in the \l{Qt for Windows CE Requirements} document.
We hope you will enjoy using Qt. Good luck!
*/
+/*! \page install-S60-installer.html
+
+\title Installing Qt on S60 using binary package
+\ingroup qts60
+\brief How to install Qt on S60 using the binary package.
+
+\note Qt for S60 has some requirements that are given in more detail
+in the \l{Qt for S60 Requirements} document.
+
+\list 1
+
+ \o Install Qt
+
+ Run \c{qt-s60-%VERSION%.exe} and follow the instructions.
+
+ \note Qt must be installed on the same drive as the S60 SDK you are
+ using, and the install path must not contain any spaces.
+
+ \o Running Qt demos
+
+ We've included a subset of the Qt demos in this package for you
+ to try out. An excellent starting point is the "fluidlauncher"
+ demo. To run the demo on a real device, you first have to install
+ \c{qt_libs.sis} and \c{fluidlauncher.sis} found in the Qt installation
+ directory. Begin by connecting your phone using the USB cable and
+ selecting "PC Suite mode". In Windows Explorer right click on the
+ \c{.sis} files and select "Install with Nokia Application Installer"
+ and follow the instructions.
+
+ To run the demos and examples on the emulator, you need to build them first.
+ Open the "Qt for S60 Command Prompt" from the Start menu and type:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 25
+
+ To run the demos on the emulator simply navigate to the directory of the demo
+ you want to see and run:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 27
+
+ For more information about building and running Qt programs on S60,
+ see \l{S60 - Introduction to using Qt}.
+
+ We hope you will enjoy using Qt.
+
+\endlist
+
+*/
+/*! \page install-S60.html
+
+\title Installing Qt on S60
+\ingroup installation
+\ingroup qts60
+\brief How to install Qt on S60
+
+\note Qt for S60 has some requirements that are given in more detail
+in the \l{Qt for S60 Requirements} document.
+
+\note \bold {This document describes how to install and configure Qt for S60 from scratch.
+If you are using pre-built binaries, follow the instructions
+\l{Installing Qt on S60 using binary package}{here}.}
+
+\list 1
+
+ \o Install Qt
+
+ Uncompress the package into the directory you want Qt installed,
+ e.g. \c{C:\Qt\%VERSION%}.
+
+ \note Qt must be installed on the same drive as the S60 SDK you are
+ using, and the install path must not contain any spaces.
+
+ \o Environment variables
+
+ In order to build and use Qt, the \c PATH environment variable needs
+ to be extended:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 18
+
+ This is done by adding \c{c:\Qt\%VERSION%\bin} to the \c PATH variable.
+
+ On Windows the PATH can be extended by navigating to
+ "Control Panel->System->Advanced->Environment variables".
+
+ In addition, you must configure the environment for use with the S60
+ emulator. This is done by locating the Carbide.c++ submenu on the Start
+ menu, and choosing "Configure environment for WINSCW command line".
+
+ \o Configure Qt
+
+ To configure Qt for S60, do:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 23
+
+ For other options, type \c{configure -help} to get a list of all available
+ options.
+
+ \o Build Qt
+
+ To build Qt for the device, type:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 28
+
+ To build Qt for the emulator, type:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 24
+
+ Congratulations, Qt is now ready to use.
+
+ \o Running Qt demos
+
+ We've included a subset of the Qt demos in this package for you
+ to try out. An excellent starting point is the "fluidlauncher"
+ demo. To run the demo on a real device, you first have to install
+ the Qt libraries on the device:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 29
+
+ \note You will need to supply certificate that allows installation
+ of binaries with "All -Tcb" capability to your device.
+
+ Similarly, install fluidlauncher to the device:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 30
+
+ This will create a self-signed \c fluidlauncher_armv5_urel.sis and
+ install it to your device.
+
+ To run the demos on the emulator simply navigate to the directory of the demo
+ you want to see and run:
+
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 27
+
+ For more information about building and running Qt programs on S60,
+ see \l{S60 - Introduction to using Qt}.
+
+ We hope you will enjoy using Qt.
+
+\endlist
+
+*/
/*!
\page requirements.html
\title General Qt Requirements
@@ -525,6 +665,7 @@ in the \l{Qt for Windows CE Requirements} document.
\list
\o \l{Qt for Embedded Linux Requirements}
\o \l{Qt for Mac OS X Requirements}
+ \o \l{Qt for S60 Requirements}
\o \l{Qt for Windows CE Requirements}
\o \l{Qt for Windows Requirements}
\o \l{Qt for X11 Requirements}
@@ -768,3 +909,39 @@ in the \l{Qt for Windows CE Requirements} document.
enables the use of the Record extension to the X protocol to be used in
applications.
*/
+
+/*!
+ \page requirements-s60.html
+ \title Qt for S60 Requirements
+ \ingroup installation
+ \brief Setting up the S60 environment for Qt.
+ \previouspage General Qt Requirements
+
+ Qt for S60 requires the following software installed on your development PC:
+ \list
+ \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher}
+ \list
+ \o \bold{Note:} It may be necessary to update the Carbide compiler.
+ See \l{http://pepper.troll.no/s60prereleases/patches/}{here} for instructions how to check your
+ compiler version and how to patch it, if needed.
+ \endlist
+ \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/S60SDK/}{S60 Platform SDK 3rd Edition FP1 or higher}
+ \o \l{http://www.forum.nokia.com/main/resources/technologies/openc_cpp/}{Open C/C++ v1.6.0 or higher}.
+ Install this to all S60 SDKs you plan to use Qt with.
+ \o Building Qt libraries requires \l{http://www.arm.com/products/DevTools/RVCT.html}{RVCT} 2.2 [build 616] or later,
+ which is not available free of charge.
+ \endlist
+
+ Running Qt on real device requires the following packages to be installed on your device.
+ The packages can be found in the S60 SDK where you installed Open C/C++:
+ \list
+ \o \c{nokia_plugin\openc\s60opencsis\pips_s60_<version>.sis}
+ \o \c{nokia_plugin\openc\s60opencsis\openc_ssl_s60_<version>.sis}
+ \o \c{nokia_plugin\opencpp\s60opencppsis\stdcpp_s60_<version>.sis}
+ \endlist
+
+ \note Users of \bold{S60 Platform SDK 3rd Edition FP1} also need special updates. The update can be found
+ \l{http://pepper.troll.no/s60prereleases/patches/}{here}.
+
+ \sa {Known Issues in %VERSION%}
+*/
diff --git a/doc/src/platform-notes.qdoc b/doc/src/platform-notes.qdoc
index c8046c4..53db855 100644
--- a/doc/src/platform-notes.qdoc
+++ b/doc/src/platform-notes.qdoc
@@ -512,6 +512,19 @@
*/
/*!
+ \page platform-notes-symbian.html
+ \title Platform Notes - Symbian
+ \contentspage Platform Notes
+
+ This page contains information about the Symbian platforms Qt is currently known
+ to run on. More information about the combinations of platforms and compilers
+ supported by Qt can be found on the \l{Supported Platforms} page.
+
+ For information about mixing exceptions with symbian leaves,
+ see \l{Exception Safety with Symbian}
+*/
+
+/*!
\page platform-notes-embedded-linux.html
\title Platform Notes - Embedded Linux
\contentspage Platform Notes
diff --git a/doc/src/plugins-howto.qdoc b/doc/src/plugins-howto.qdoc
index 2c2b031..95710f6 100644
--- a/doc/src/plugins-howto.qdoc
+++ b/doc/src/plugins-howto.qdoc
@@ -187,6 +187,20 @@
The \l{Style Plugin Example} shows how to implement a plugin
that extends the QStylePlugin base class.
+ \note In Symbian all binaries must be located in the directory \\sys\\bin,
+ so each Qt plugin has a stub with the same basename as the plugin dll
+ and suffix ".qtplugin" to make Qt extension plugins work similarly to
+ other platforms.
+ When trying to locate the plugin, Qt actually looks for the stub
+ instead of the plugin binary. While plugin stub files have the
+ suffix ".qtplugin", they can still be loaded also by specifying a filename
+ with the normal library suffix ".dll" for QPluginLoader, so normally application
+ developer doesn't need to care about the different suffix of the stub.
+ In Symbian the default plugin stubs path is \\resource\\qt\\plugins.
+ Because of the way applications can be installed
+ on ROM or various other drives in Symbian, all available drives are
+ searched for that path when looking for plugins.
+
\section1 The Lower-Level API: Extending Qt Applications
Not only Qt itself but also Qt application can be extended
diff --git a/doc/src/qmake-manual.qdoc b/doc/src/qmake-manual.qdoc
index 9714a44..b07a883 100644
--- a/doc/src/qmake-manual.qdoc
+++ b/doc/src/qmake-manual.qdoc
@@ -883,6 +883,89 @@
This is discussed in more detail in the
\l{Deploying an Application on Windows#Visual Studio 2005 Onwards}
{deployment guide for Windows}.
+
+
+ \section1 S60
+
+ Features specific to this platform include handling of static data,
+ capabilities, stack and heap size, compiler specific options, and unique
+ identifiers for the application or library.
+
+ \section2 Handling of static data
+
+ If the application uses any static data, the build system needs to be
+ informed about it. This is because Symbian tries to save memory if no
+ static data is in use.
+
+ To specify that static data support is desired, add this to the project file:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 129
+
+ The default value is zero.
+
+ \section2 Stack and heap size
+
+ Symbian uses predefined sizes for stacks and heaps. If an
+ application exceeds either limit, it may crash or fail to complete its
+ task. Crashes that seem to have no reason can often be traced back to
+ insufficient stack and/or heap sizes.
+
+ The stack size has a maximum value, whereas the heap size has a
+ minimum and a maximum value, all specified in bytes. The minimum value
+ prevents the application from starting if that amount of memory is not available. The
+ minimum and maximum values are separated by a space. For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 130
+
+ The default values depend on the version of the S60 SDK you're using.
+
+ \section2 Compiler specific options
+
+ General compiler options can as usual be set using \c QMAKE_CFLAGS and \c QMAKE_CXXFLAGS.
+ In order to set specific compiler options, \c QMAKE_CFLAGS.<compiler> and
+ \c QMAKE_CXXFLAGS.<compiler> can be used. \c <compiler> can be either \c CW for the WINSCW
+ architecture (emulator), or \c ARMCC for the ARMv5 architecture (hardware).
+
+ Here is an example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 131
+
+ \section2 Unique identifiers
+
+ Symbian applications may have unique identifiers attached to them.
+ Here is how to define them in a project file:
+
+ There are four types of IDs supported: \c UID2, \c UID3, \c SID, and \c VID. They
+ are specified like this:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 132
+
+ If \c UID2 is not specified, it defaults to the same value as \c UID3.
+ If \c UID3 is not specified, qmake will automatically generate a \c UID3
+ suitable for development and debugging. This value should be manually
+ specified for applications that are to be released. In order to optain
+ an official UID, please contact Nokia. Both \c SID and \c VID default to empty values.
+
+ For more information about unique identifiers and their meaning for
+ Symbian applications, please refer to the
+ \l{http://www.symbian.com/developer/techlib/v9.2docs/doc_source/ToolsAndUtilities/BuildTools/UsingUids.guide.html}{respective S60 SDK documentation}.
+
+ \section2 Capabilities
+
+ Capabilities define extra priviledges for the application, such as the
+ ability to list all files on the file system. Capabilities are defined
+ in the project file like this:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 133
+
+ It is also possible to specify which capabilities \e not to have,
+ by first specifying \c ALL and then list the unwanted capabilities
+ with a minus in front of them, like this:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 134
+
+ For more information about capabilities, please refer to the
+ \l{http://www.symbian.com/developer/techlib/v9.2docs/doc_source/guide/platsecsdk/index.html}{respective S60 SDK documentation}.
*/
/*!
@@ -973,6 +1056,32 @@
\tableofcontents{3}
+ \target BLD_INF_RULES
+ \section1 BLD_INF_RULES
+
+ \e {This is only used on Symbian.}
+
+ Generic \c bld.inf file content can be specified with \c BLD_INF_RULES variables.
+ The section of \c bld.inf file where each rule goes is appended to
+ \c BLD_INF_RULES with a dot.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 146
+
+ This will add the specified statements to the \c prj_exports section of the
+ generated \c bld.inf file.
+
+ It is also possible to add multiple rows in a single block. Each double
+ quoted string will be placed on a new row in the generated \c bld.inf file.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 143
+
+ Any rules you define will be added after automatically generated
+ rules in each section.
+
\target CONFIG
\section1 CONFIG
@@ -1123,6 +1232,20 @@
The build process for bundles is also influenced by
the contents of the \l{#QMAKE_BUNDLE_DATA}{QMAKE_BUNDLE_DATA} variable.
+ These options only have an effect on Symbian:
+
+ \table 95%
+ \header \o Option \o Description
+ \row \o stdbinary \o Builds an Open C binary (i.e. STDDLL, STDEXE, or STDLIB,
+ depending on the target binary type.)
+ \row \o no_icon \o Doesn't generate resources needed for displaying an icon
+ for executable in application menu (app only).
+ \row \o symbian_test \o Places mmp files and extension makefiles under
+ test sections in generated bld.inf instead of their regular sections.
+ Note that this only affects automatically generated bld.inf content;
+ the content added via \c BLD_INF_RULES variable is not affected.
+ \endtable
+
These options have an effect on Linux/Unix platforms:
\table 95%
@@ -1166,7 +1289,7 @@
\target DEPLOYMENT
\section1 DEPLOYMENT
- \e {This is only used on Windows CE.}
+ \e {This is only used on Windows CE and Symbian.}
Specifies which additional files will be deployed. Deployment means the
transfer of files from the development system to the target device or
@@ -1184,7 +1307,8 @@
The default deployment target path for Windows CE is
\c{%CSIDL_PROGRAM_FILES%\target}, which usually gets expanded to
- \c{\Program Files\target}.
+ \c{\Program Files\target}. For Symbian, the default target is the application
+ private directory on the drive it is installed to.
It is also possible to specify multiple \c sources to be deployed on
target \c paths. In addition, different variables can be used for
@@ -1194,24 +1318,63 @@
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 29
- \note All linked Qt libraries will be deployed to the path specified
- by \c{myFiles.path}.
+ \note In Windows CE all linked Qt libraries will be deployed to the path
+ specified by \c{myFiles.path}. In Symbian all libraries and executables
+ will always be deployed to the \\sys\\bin of the installation drive.
+
+ Since the Symbian build system automatically moves binaries to certain
+ directories under the epoc32 directory, custom plugins, executables or
+ dynamically loadable libraries need special handling. When deploying
+ extra executables or dynamically loadable libraries, the target path
+ must specify \\sys\\bin. For plugins, the target path must specify the
+ location where the plugin stub will be deployed to (see the
+ \l{How to Create Qt Plugins} document for more information about plugins).
+ If the binary cannot be found from the indicated source path,
+ the directory Symbian build process moves the executables to is
+ searched, e.g. \\epoc32\\release\\armv5\\urel.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 128
+ In Symbian, dependencies to other packages can also be created using
+ this variable. The strings defined as dependencies are not parsed by
+ qmake, so they should be in a format understood by Symbian package
+ generation tools. Please consult Symbian documentation for correct syntax.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 140
+
+ In Symbian, the \c default_deployment item specifies
+ default platform dependencies. It can be overwritten if a more
+ restrictive set is needed - e.g. if a specific
+ device is required to run the application.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 141
+
\target DEPLOYMENT_PLUGIN
\section1 DEPLOYMENT_PLUGIN
- \e {This is only used on Windows CE.}
+ \e {This is only used on Windows CE and Symbian.}
This variable specifies the Qt plugins that will be deployed. All plugins
available in Qt can be explicitly deployed to the device. See
\l{Static Plugins}{Static Plugins} for a complete list.
- \note No plugins will be deployed automatically. If the application
- depends on plugins, these plugins have to be specified manually.
+ \note In Windows CE, No plugins will be deployed automatically.
+ If the application depends on plugins, these plugins have to be specified
+ manually.
+
+ \note In Symbian, all plugins supported by this variable will be deployed
+ by default with Qt libraries, so generally using this variable is not
+ needed.
For example:
- \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 128
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 142
This will upload the jpeg imageformat plugin to the plugins directory
on the Windows CE device.
@@ -1311,7 +1474,14 @@
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 34
See also \l{#SOURCES}{SOURCES}.
-
+
+ \target ICON
+ \section1 ICON
+
+ This variable is used only in MAC and S60 to set the application icon.
+ Please see \l{Setting the Application Icon}{the application icon documentation}
+ for more information.
+
\target INCLUDEPATH
\section1 INCLUDEPATH
@@ -1367,9 +1537,9 @@
This variable contains a list of libraries to be linked into the project.
You can use the Unix \c -l (library) and -L (library path) flags and qmake
- will do the correct thing with these libraries on Windows (namely this
- means passing the full path of the library to the linker). The only
- limitation to this is the library must exist, for qmake to find which
+ will do the correct thing with these libraries on Windows and Symbian
+ (namely this means passing the full path of the library to the linker). The
+ only limitation to this is the library must exist, for qmake to find which
directory a \c -l lib lives in.
For example:
@@ -1383,6 +1553,14 @@
explicitly specify the library to be used by including the \c{.lib}
file name suffix.
+ \bold{Note:} On S60, the build system makes a distinction between shared and
+ static libraries. In most cases, qmake will figure out which library you
+ are refering to, but in some cases you may have to specify it explicitly to
+ get the expected behavior. This typically happens if you are building a
+ library and using it in the same project. To specify that the library is
+ either shared or static, add a ".dll" or ".lib" suffix, respectively, to the
+ library name.
+
By default, the list of libraries stored in \c LIBS is reduced to a list of
unique names before it is used. To change this behavior, add the
\c no_lflags_merge option to the \c CONFIG variable:
@@ -1418,6 +1596,37 @@
when generating a Makefile. The value of this variable is typically
handled internally by \c qmake and rarely needs to be modified.
+ \target MMP_RULES
+ \section1 MMP_RULES
+
+ \e {This is only used on Symbian.}
+
+ Generic MMP file content can be specified with this variable.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 137
+
+ This will add the specified statement to the end of the generated MMP file.
+
+ It is also possible to add multiple rows in a single block. Each double
+ quoted string will be placed on a new row in the generated MMP file.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 138
+
+ If you need to include a hash (\c{#}) character inside the
+ \c MMP_RULES statement, it can be done with the variable
+ \c LITERAL_HASH as follows:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 139
+
+ \note You should not use this variable to add MMP statements that are
+ explicitly supported by their own variables, such as
+ \c TARGET.EPOCSTACKSIZE.
+ Doing so could result in duplicate statements in the MMP file.
+
\target MOC_DIR
\section1 MOC_DIR
@@ -1710,6 +1919,14 @@
the \c QMAKE_CXXFLAGS_DEBUG and \c QMAKE_CXXFLAGS_RELEASE variables,
respectively.
+ \bold{Note:} On S60, this variable can be used to pass architecture specific
+ options to each compiler in the Symbian build system. For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 131
+
+ For more information, see
+ \l{qmake Platform Notes#Compiler specific options}{qmake Platform Notes}.
+
\target QMAKE_CXXFLAGS_DEBUG
\section1 QMAKE_CXXFLAGS_DEBUG
@@ -2432,6 +2649,49 @@
This variable contains the name of the resource file for the application.
The value of this variable is typically handled by \c qmake or
\l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+
+ \target RSS_RULES
+ \section1 RSS_RULES
+
+ \e {This is only used on Symbian.}
+
+ Generic RSS file content can be specified with this variable. The syntax is
+ similar to \c MMP_RULES and \c BLD_INF_RULES.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 144
+
+ This will add the specified statement to the end of the generated
+ registration resource file. As an impact of this statement, the application
+ will not be visible in application shell.
+
+ It is also possible to add multiple rows in a single block. Each double
+ quoted string will be placed on a new row in the registration resource file.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 145
+
+ This example will install the application to MyFolder in S60 application
+ shell. In addition it will make the application to be launched in background.
+
+ For detailed list of possible RSS statements, please refer to Symbian OS help.
+
+ \note You should not use \c RSS_RULES variable to set the following RSS statements:
+
+ app_file
+ localisable_resource_file
+ localisable_resource_id
+
+ These statements are internally handled by qmake.
+
+ \target S60_VERSION
+ \section1 S60_VERSION
+
+ \e {This is only used on Symbian.}
+
+ Contains the version number of the underlying S60 SDK; e.g. "5.0".
\target SIGNATURE_FILE
\section1 SIGNATURE_FILE
@@ -2496,6 +2756,78 @@
The project file above would produce an executable named \c myapp on
unix and 'myapp.exe' on windows.
+ \target TARGET.CAPABILITY
+ \section1 TARGET.CAPABILITY
+
+ \e {This is only used on Symbian.}
+
+ Specifies which platform capabilities the application should have. For more
+ information, please refer to the S60 SDK documentation.
+
+ \target TARGET.EPOCALLOWDLLDATA
+ \section1 TARGET.EPOCALLOWDLLDATA
+
+ \e {This is only used on Symbian.}
+
+ Specifies whether static data should be allowed in the application. Symbian
+ disallows this by default in order to save memory. To use it, set this to 1.
+
+ \target TARGET.EPOCHEAPSIZE
+ \section1 TARGET.EPOCHEAPSIZE
+
+ \e {This is only used on Symbian.}
+
+ Specifies the minimum and maximum heap size of the application. The program
+ will refuse to run if the minimum size is not available when it starts. For
+ example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 135
+
+ \target TARGET.EPOCSTACKSIZE
+ \section1 TARGET.EPOCSTACKSIZE
+
+ \e {This is only used on Symbian.}
+
+ Specifies the maximum stack size of the application. For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 136
+
+ \target TARGET.SID
+ \section1 TARGET.SID
+
+ \e {This is only used on Symbian.}
+
+ Specifies which secure identifier to use for the target application or
+ library. For more information, see the S60 SDK documentation.
+
+ \target TARGET.UID2
+ \section1 TARGET.UID2
+
+ \e {This is only used on Symbian.}
+
+ Specifies which unique identifier 2 to use for the target application or
+ library. If this variable is not specified, it defaults to the same value
+ as TARGET.UID3. For more information, see the S60 SDK documentation.
+
+ \target TARGET.UID3
+ \section1 TARGET.UID3
+
+ \e {This is only used on Symbian.}
+
+ Specifies which unique identifier 3 to use for the target application or
+ library. If this variable is not specified, a UID3 suitable for development
+ and debugging will be generated automatically. However, applications being
+ released should always define this variable. For more information, see the
+ S60 SDK documentation.
+
+ \target TARGET.VID
+ \section1 TARGET.VID
+
+ \e {This is only used on Symbian.}
+
+ Specifies which vendor identifier to use for the target application or
+ library. For more information, see the S60 SDK documentation.
+
\section1 TARGET_EXT
This variable specifies the target's extension. The value of this variable
@@ -3311,22 +3643,70 @@
\table
\header
- \o Member
- \o Description
- \row
- \o combine
- \o Indicates that all of the input files are combined into a single output file.
- \row
- \o target_predeps
- \o Indicates that the output should be added to the list of PRE_TARGETDEPS.
- \row
- \o explicit_dependencies
- \o The dependencies for the output only get generated from the depends member and from
- nowhere else.
- \row
- \o no_link
- \o Indicates that the output should not be added to the list of objects to be linked in
- \endtable
+ \o Member
+ \o Description
+ \row
+ \o commands
+ \o The commands used for for generating the output from the input.
+ \row
+ \o CONFIG
+ \o Specific configuration options for the custom compiler. See the CONFIG table for details.
+ \row
+ \o depend_command
+ \o Specifies a command used to generate the list of dependencies for the output.
+ \row
+ \o dependency_type
+ \o Specifies the type of file the output is, if it is a known type (such as TYPE_C,
+ TYPE_UI, TYPE_QRC) then it is handled as one of those type of files.
+ \row
+ \o depends
+ \o Specifies the dependencies of the output file.
+ \row
+ \o input
+ \o The variable that contains the files that should be processed with the custom compiler.
+ \row
+ \o name
+ \o A description of what the custom compiler is doing. This is only used in some backends.
+ \row
+ \o output
+ \o The filename that is created from the custom compiler.
+ \row
+ \o output_function
+ \o Specifies a custom qmake function that is used to specify the filename to be created.
+ \row
+ \o variables
+ \o Indicates that the variables specified here are replaced with $(QMAKE_COMP_VARNAME) when refered to
+ in the pro file as $(VARNAME).
+ \row
+ \o variable_out
+ \o The variable that the files created from the output should be added to.
+ \endtable
+
+ List of members specific to the CONFIG option:
+
+ \table
+ \header
+ \o Member
+ \o Description
+ \row
+ \o combine
+ \o Indicates that all of the input files are combined into a single output file.
+ \row
+ \o target_predeps
+ \o Indicates that the output should be added to the list of PRE_TARGETDEPS.
+ \row
+ \o explicit_dependencies
+ \o The dependencies for the output only get generated from the depends member and from
+ nowhere else.
+ \row
+ \o no_link
+ \o Indicates that the output should not be added to the list of objects to be linked in.
+ \endtable
+
+ \note Symbian specific: Generating objects to be linked in is not supported in Symbian,
+ so either the \c CONFIG option \c no_link or variable \c variable_out
+ should always be defined for extra compilers.
+
*/
/*!
diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc
index f1c7330..8bbe000 100644
--- a/doc/src/qnamespace.qdoc
+++ b/doc/src/qnamespace.qdoc
@@ -2403,15 +2403,47 @@
*/
/*!
+ \enum Qt::InputMethodHint
+
+ \value ImhNone No hints.
+ \value ImhHiddenText Characters should be hidden, as is typically used when entering passwords.
+ This is automatically set when setting QLineEdit::echoMode to \c Password.
+ \value ImhDigitsOnly Only digit input is allowed.
+ \value ImhFormattedNumbersOnly Only number input (including integers and real numbers) is allowed.
+ \value ImhUppercaseOnly Only upper case letter input is allowed.
+ \value ImhLowercaseOnly Only lower case letter input is allowed.
+ \value ImhNoAutoUppercase The input method should not try to automatically switch to upper case
+ at the beginning of a sentence.
+ \value ImhPreferNumbers Numbers are preferred (but not required). This can include only digits,
+ phone numbers, or all numbers, depending on which one of the
+ \c ImhDigitsOnly, \c ImhDialableCharactersOnly and
+ \c ImhFormattedNumbersOnly flags is given.
+ \value ImhPreferUppercase Upper case letters are preferred (but not required).
+ \value ImhPreferLowercase Lower case letters are preferred (but not required).
+ \value ImhNoPredictiveText Do not use predictive text (i.e. dictionary lookup) while typing.
+ \value ImhDialableCharactersOnly Only characters suitable for phone dialling are allowed.
+
+ \value ImhExclusiveInputMask A mask to test for the presence of any flags ending with \c Only.
+
+ \note If several flags ending with \c Only are ORed together, the resulting character set will
+ consist of the union of the specified sets. For instance specifying \c ImhNumbersOnly and
+ \c ImhUppercaseOnly would yield a set consisting of numbers and uppercase letters.
+
+ \note If several flags of the \c Prefer type are ORed together, the result is undefined.
+
+ \sa QWidget::inputMethodHints
+*/
+
+/*!
\enum Qt::InputMethodQuery
\value ImMicroFocus The rectangle covering the area of the input cursor in widget coordinates.
\value ImFont The currently used font for text input.
- \value ImCursorPosition The logical position of the cursor within the text surrounding the input area (see ImSurroundingText).
- If any text is selected, the position returned will be at the logical end of the
- selection, even if the real cursor is located at the logical start.
+ \value ImCursorPosition The logical position of the cursor within the text surrounding the input area (see \c ImSurroundingText).
\value ImSurroundingText The plain text around the input area, for example the current paragraph.
\value ImCurrentSelection The currently selected text.
+ \value ImMaximumTextLength The maximum number of characters that the widget can hold. If there is no limit, QVariant() is returned.
+ \value ImAnchorPosition The position of the selection anchor. This may be less or greater than \c ImCursorPosition, depending on which side of selection the cursor is. If there is no selection, it returns the same as \c ImCursorPosition.
*/
/*!
diff --git a/doc/src/s60-introduction.qdoc b/doc/src/s60-introduction.qdoc
new file mode 100644
index 0000000..537b37d
--- /dev/null
+++ b/doc/src/s60-introduction.qdoc
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page s60-with-qt-introduction.html
+
+ \title S60 - Introduction to using Qt
+ \brief An introduction to Qt for S60 developers.
+ \ingroup howto
+ \ingroup qts60
+
+ \tableofcontents
+
+ \section1 Required tools
+
+ See \l{Qt for S60 Requirements} to see what tools are required to use Qt for S60.
+
+ \section1 Installing Qt and running demos
+
+ Follow the instructions found in \l{Installing Qt on S60 using binary package} to learn how
+ to install Qt using binary package and how to build and run Qt demos.
+
+ Follow the instructions found in \l{Installing Qt on S60} to learn how to install Qt using
+ using source package and how to build and run the Qt demos.
+
+ \section1 Building your own applications
+
+ If you are new to Qt development, have a look at \l{How to Learn Qt}.
+ In general, the difference between developing a
+ Qt application on S60 compared to any of the other platforms supported
+ by Qt is not that big.
+
+ Once you have crated a \c .pro file for your project, generate the
+ Carbide specific \c Bld.inf and \c .mmp files this way:
+
+ \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 0
+
+ For more information on how to use qmake have a look at the \l
+ {qmake Tutorial}.
+
+ Now you can build the Qt on S60 application with standard build
+ tools. By default, running \c make will produce binaries for the
+ emulator. However, S60 comes with several alternative build targets,
+ as shown in the table below:
+
+ \table
+ \row \o \c debug-winscw \o Build debug binaries for the emulator (default).
+ It is currently not possible to build release
+ binaries for the emulator.
+ \row \o \c debug-gcce \o Build debug binaries for hardware using GCCE.
+ \row \o \c release-gcce \o Build release binaries for hardware using GCCE.
+ \row \o \c debug-armv5 \o Build debug binaries for hardware using RVCT.
+ \row \o \c release-armv5 \o Build release binaries for hardware using RVCT.
+ \row \o \c run \o Run the emulator binaries from the build directory.
+ \endtable
+
+ The following lines perform a debug build for the emulator
+ and deploy all the needed files:
+
+ \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 1
+
+ To work on your project in Carbide, simply import the \c .pro file
+ by right clicking on the project explorer and executing "Import...".
+
+ \section1 Installing your own applications
+
+ To install your own applications on hardware, Qt comes with a tool called
+ \c createpackage. When used on the \c .pkg files created by qmake, it
+ will produce a signed \c .sis file that can be installed to the device. For
+ example:
+
+ \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 2
+
+ If you want to install the program immediately, make sure that the device
+ is connected to the computer in "PC Suite" mode, and run \c createpackage
+ with the \c -i switch, like this:
+
+ \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 3
+*/
diff --git a/doc/src/snippets/code/doc_src_appicon.qdoc b/doc/src/snippets/code/doc_src_appicon.qdoc
index c8883fe..c763a68 100644
--- a/doc/src/snippets/code/doc_src_appicon.qdoc
+++ b/doc/src/snippets/code/doc_src_appicon.qdoc
@@ -21,3 +21,7 @@ kde-config --path icon
//! [4]
gnome-config --datadir
//! [4]
+
+//! [5]
+ICON = myapp.svg
+//! [5]
diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc
index e35dad9..489016d 100644
--- a/doc/src/snippets/code/doc_src_installation.qdoc
+++ b/doc/src/snippets/code/doc_src_installation.qdoc
@@ -125,3 +125,41 @@ setcepaths wincewm50pocket-msvc2005
//! [22]
nmake
//! [22]
+
+
+//! [23]
+cd \Qt\%VERSION%
+configure -platform win32-mwc -xplatform symbian-abld
+//! [23]
+
+
+//! [24]
+make debug-winscw
+//! [24]
+
+//! [25]
+cd examples
+qmake
+make
+cd ..\demos
+qmake
+make
+//! [25]
+
+//! [27]
+make run
+//! [27]
+
+//! [28]
+make release-armv5
+//! [28]
+
+//! [29]
+cd src\s60installs
+createpackage -i qt_libs_armv5_urel.pkg <certificate file> <certificate key file>
+//! [29]
+
+//! [30]
+cd embedded\fluidlauncher
+createpackage -i fluidlauncher_armv5_urel.pkg
+//! [30]
diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
index edb66bc..b93e151 100644
--- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc
+++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
@@ -809,5 +809,122 @@ CONFIG(debug, debug|release) {
//! [127]
//! [128]
-DEPLOYMENT_PLUGIN += qjpeg
+customplugin.sources = customimageplugin.dll
+customplugin.sources += c:\myplugins\othercustomimageplugin.dll
+customplugin.path = imageformats
+dynamiclibrary.sources = mylib.dll helper.exe
+dynamiclibrary.path = \sys\bin
+globalplugin.sources = someglobalimageplugin.dll
+globalplugin.path = \resource\qt\plugins\imageformats
+DEPLOYMENT += customplugin dynamiclibrary globalplugin
//! [128]
+
+//! [129]
+TARGET.EPOCALLOWDLLDATA = 1
+//! [129]
+
+//! [130]
+TARGET.EPOCHEAPSIZE = 10000 10000000
+TARGET.EPOCSTACKSIZE = 0x8000
+//! [130]
+
+//! [131]
+QMAKE_CXXFLAGS.CW += -O2
+QMAKE_CXXFLAGS.ARMCC += -O0
+//! [131]
+
+//! [132]
+TARGET.UID2 = 0x00000001
+TARGET.UID3 = 0x00000002
+TARGET.SID = 0x00000003
+TARGET.VID = 0x00000004
+//! [132]
+
+//! [133]
+TARGET.CAPABILITY += AllFiles
+//! [133]
+
+//! [134]
+TARGET.CAPABILITY = ALL -TCB
+//! [134]
+
+//! [135]
+TARGET.EPOCHEAPSIZE = 10000 10000000
+//! [135]
+
+//! [136]
+TARGET.EPOCSTACKSIZE = 0x8000
+//! [136]
+
+//! [137]
+MMP_RULES += "DEFFILE hello.def"
+//! [137]
+
+//! [138]
+myBlock = \
+"START RESOURCE foo.rss" \
+"TARGET bar" \
+"TARGETPATH private\10001234" \
+"HEADER" \
+"LANG 01" \
+"UID 0x10002345 0x10003456" \
+"END"
+
+MMP_RULES += myBlock
+//! [138]
+
+//! [139]
+myIfdefBlock = \
+"$${LITERAL_HASH}ifdef WINSCW" \
+"DEFFILE hello_winscw.def" \
+"$${LITERAL_HASH}endif"
+
+MMP_RULES += myIfdefBlock
+//! [139]
+
+//! [140]
+somelib.sources = somelib.dll
+somelib.path = \sys\bin
+somelib.depends = "(0x12345678), 2, 2, 0, {\"Some Package\"}" \
+ "(0x87654321), 1, *, * ~ 2, 2, 0, {\"Some Other Package\"}"
+justdep.depends = "(0xAAAABBBB), 0, 2, 0, {\"My Framework\"}"
+DEPLOYMENT += somelib justdep
+//! [140]
+
+//! [141]
+default_deployment.depends = "[0x11223344],0,0,0,{\"SomeSpecificDeviceID\"}"
+//! [141]
+
+//! [142]
+DEPLOYMENT_PLUGIN += qjpeg
+//! [142]
+
+//! [143]
+myextension = \
+ "start extension myextension" \
+ "$${LITERAL_HASH}if defined(WINSCW)" \
+ "option MYOPTION foo" \
+ "$${LITERAL_HASH}endif" \
+ "option MYOPTION bar" \
+ "end"
+BLD_INF_RULES.prj_extensions += myextension
+//! [143]
+
+//! [144]
+RSS_RULES += "hidden = KAppIsHidden;"
+//! [144]
+
+//! [145]
+myrssrules = \
+ "hidden = KAppIsHidden;" \
+ "launch = KAppLaunchInBackground;" \
+RSS_RULES += myrssrules
+//! [145]
+
+//! [146]
+BLD_INF_RULES.prj_exports += \
+ "$${LITERAL_HASH}include <platform_paths.hrh>" \
+ "rom/my.iby APP_LAYER_PUBLIC_EXPORT_PATH(my.iby)" \
+ "inc/myheader.h mycomp/myheader.h" \
+ ":zip my_api.zip my_api"
+//! [146]
diff --git a/doc/src/snippets/code/doc_src_s60-introduction.qdoc b/doc/src/snippets/code/doc_src_s60-introduction.qdoc
new file mode 100644
index 0000000..ff1d159
--- /dev/null
+++ b/doc/src/snippets/code/doc_src_s60-introduction.qdoc
@@ -0,0 +1,16 @@
+//! [0]
+ qmake
+//! [0]
+
+
+//! [1]
+ make debug-winscw
+//! [1]
+
+//! [2]
+ createpackage wiggly_gcce_udeb.pkg
+//! [2]
+
+//! [3]
+ createpackage -i wiggly_gcce_udeb.pkg
+//! [3]
diff --git a/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp b/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp
new file mode 100644
index 0000000..7de42b7
--- /dev/null
+++ b/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp
@@ -0,0 +1,82 @@
+//! [0]
+void myFunction(bool useSubClass)
+{
+ MyClass *p = useSubClass ? new MyClass() : new MySubClass;
+ QIODevice *device = handsOverOwnership();
+
+ if (m_value > 3) {
+ delete p;
+ delete device;
+ return;
+ }
+
+ try {
+ process(device);
+ }
+ catch (...) {
+ delete p;
+ delete device;
+ throw;
+ }
+
+ delete p;
+ delete device;
+}
+//! [0]
+
+//! [1]
+void myFunction(bool useSubClass)
+{
+ QScopedPointer<MyClass> p(useSubClass ? new MyClass() : new MySubClass);
+ QScopedPointer<QIODevice> device(handsOverOwnership());
+
+ if (m_value > 3)
+ return;
+
+ process(device);
+}
+//! [1]
+
+//! [2]
+ const QWidget *const p = new QWidget();
+ // is equivalent to:
+ const QScopedPointer<const QWidget> p(new QWidget());
+
+ QWidget *const p = new QWidget();
+ // is equivalent to:
+ const QScopedPointer<QWidget> p(new QWidget());
+
+ QWidget *const p = new QWidget();
+ // is equivalent to:
+ const QScopedPointer<QWidget> p(new QWidget());
+
+ const QWidget *p = new QWidget();
+ // is equivalent to:
+ QScopedPointer<const QWidget> p(new QWidget());
+
+//! [2]
+
+//! [3]
+if (scopedPointer) {
+ ...
+}
+//! [3]
+
+//! [4]
+class MyPrivateClass; // forward declare MyPrivateClass
+
+class MyClass
+{
+private:
+ QScopedPointer<MyPrivateClass> privatePtr; // QScopedPointer to forward declared class
+
+public:
+ MyClass(); // OK
+ inline ~MyClass() {} // VIOLATION - Destructor must not be inline
+
+private:
+ Q_DISABLE_COPY(MyClass) // OK - copy constructor and assignment operators
+ // are now disabled, so the compiler won't implicitely
+ // generate them.
+};
+//! [4]
diff --git a/doc/src/symbian-exceptionsafety.qdoc b/doc/src/symbian-exceptionsafety.qdoc
new file mode 100644
index 0000000..e42ecd1
--- /dev/null
+++ b/doc/src/symbian-exceptionsafety.qdoc
@@ -0,0 +1,183 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the documentation 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page symbianexceptionsafety.html
+ \title Exception Safety with Symbian
+ \ingroup qts60
+ \brief A guide to integrating exception safety in Qt with Symbian.
+
+ The following sections describe how Qt code can interoperate with Symbian's
+ exception safety system.
+
+ \tableofcontents
+
+ \section1 What the problem is
+
+ Qt and Symbian have different exception systems. Qt works with standard C++
+ exceptions, whereas Symbian has its TRAP/Leave/CleanupStack system. So, what would
+ happen if
+ you mix the two systems? It could go wrong in a number of ways.
+
+ Cleanup ordering would be different between the two. When Symbian code
+ leaves, the cleanup stack is cleaned up before anything else happens. After
+ that, the objects on the call stack would be cleaned up as with a normal
+ exception. So if there are any dependencies between stack based and cleanup stack
+ owned objects, there could be problems due to this ordering.
+
+ Symbian's \c XLeaveException, which is used when Symbian implements leaves as
+ exceptions, is not derived from \c std::exception, so would not be caught in
+ Qt catch statements designed to catch \c std::exception.
+
+ Qt's and standard C++'s \c std::exception derived exceptions result in program
+ termination if they fall back to a Symbian TRAP.
+
+ These problems can be solved with barrier macros and helper functions that
+ will translate between the two exception systems. Use them, in Qt code,
+ whenever calling into or being called from Symbian code.
+
+ \section1 Qt calls to Symbian
+
+ When calling Symbian leaving functions from Qt code, we want to translate
+ Symbian leaves to standard C++ exceptions. The following help is provided:
+
+ \list
+ \o \l qt_translateSymbianErrorToException() takes a Symbian
+ error code and throws an appropriate exception to represent it.
+ This will do nothing if the error code is not in fact an error. The
+ function is equivalent to Symbian's \c User::LeaveIfError.
+ \o \l QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION() takes a Symbian leaving
+ code fragment f and runs it under a trap harness converting any resulting
+ error into an exception.
+ \o \c TRAP and \c TRAPD from the Symbian libraries can be used to convert
+ leaves to error codes.
+ \endlist
+
+ \code
+ HBufC* buf=0;
+ // this will throw a std::bad_alloc because we've asked for too much memory
+ QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(buf = HBufC::NewL(100000000));
+
+ _LIT(KStr,"abc");
+ TInt pos = KStr().Locate('c');
+ // pos is a good value, >= 0, so no exception is thrown
+ qt_translateSymbianErrorToException(pos);
+
+ pos = KStr().Locate('d');
+ // pos == KErrNotFound, so this throws an exception
+ qt_translateSymbianErrorToException(pos);
+ \endcode
+
+ \section1 Qt called from Symbian
+
+ When Qt code is called from Symbian, we want to translate standard C++
+ exceptions to Symbian leaves or error codes. The following help is
+ provided:
+
+ \list
+ \o \l qt_translateExceptionToSymbianError() -
+ this takes a standard exception and gives an appropriate Symbian
+ error code. If no mapping is known for the exception type,
+ \c KErrGeneral is returned.
+ \o \l qt_translateExceptionToSymbianErrorL() -
+ this takes a standard exception and generates an appropriate Symbian
+ leave.
+ \o \l QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR() - this macro
+ takes the standard C++ code fragment \c f, catches any std::exceptions
+ thrown from it, and sets err to the corresponding Symbian error code.
+ err is set to \c KErrNone otherwise.
+ \o \l QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE() - this macro takes the
+ standard C++ code fragment \c f, catches any std::exceptions thrown from
+ it, and throws a corresponding Symbian leave.
+ \endlist
+
+ \code
+ TInt DoTickL() // called from an active object RunL, ie Symbian leaves expected
+ {
+ // without the translation to Symbian Leave, we get a USER:0 panic
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE({
+ int* x = new int[100000000]; // compiled as Qt code, will throw std::bad_alloc
+ delete [] x;
+ });
+ return 0;
+ }
+ \endcode
+
+ \section1 Common sense things
+
+ Try to minimise the interleaving of Symbian and Qt code, every switch
+ requires a barrier. Grouping the code styles in different blocks will
+ minimise the problems. For instance, examine the following code.
+
+ \code
+ 1. TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this);
+ 2. QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath();
+ 3. filepath = QDir::toNativeSeparators(filepath);
+ 4. m_playUtility->OpenFileL(qt_QString2TPtrC(filepath)));
+ \endcode
+
+ Line 1 starts a Symbian leave handling block, which is good because it
+ also uses a Symbian leave generating function.
+
+ Line 2 creates a \l QString, uses \l QFileInfo and various member functions.
+ These could all throw exceptions, which is not good inside a \c TRAP block.
+
+ Line 3 is unclear as to whether it might throw an exception, but since
+ it's dealing with strings it probably does, again bad.
+
+ Line 4 is tricky, it calls a leaving function which is ok within a \c TRAP,
+ but it also uses a helper function to convert string types. In this case
+ the helper function may cause an unwelcome exception.
+
+ We could rewrite this with nested exception translations, but it's much
+ easier to refactor it.
+
+ \code
+ QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath();
+ filepath = QDir::toNativeSeparators(filepath);
+ TPtrC filepathPtr(qt_QString2TPtrC(filepath));
+ TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this);
+ m_playUtility->OpenFileL(filepathPtr));
+ \endcode
+
+ Now the exception generating functions are separated from the leaving
+ functions.
+*/
diff --git a/doc/src/topics.qdoc b/doc/src/topics.qdoc
index 6ef3a89..7a351f9 100644
--- a/doc/src/topics.qdoc
+++ b/doc/src/topics.qdoc
@@ -300,3 +300,18 @@ including ARM, Intel x86, MIPS and SH-4.
\endlist
\endtable
*/
+
+/*!
+\group qts60
+\title Qt for S60
+\ingroup topics
+\ingroup qt-embedded
+\brief Documents related to Qt for S60
+
+Qt for S60 is a C++ framework for GUI and application development
+for embedded devices running Symbian.
+
+\list
+ \o \l {Exception Safety with Symbian}
+\endlist
+*/
diff --git a/examples/activeqt/activeqt.pro b/examples/activeqt/activeqt.pro
index 262e1a1..1cd05f6 100644
--- a/examples/activeqt/activeqt.pro
+++ b/examples/activeqt/activeqt.pro
@@ -18,3 +18,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS activeqt.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/comapp/comapp.pro b/examples/activeqt/comapp/comapp.pro
index 84ce072..29aebae 100644
--- a/examples/activeqt/comapp/comapp.pro
+++ b/examples/activeqt/comapp/comapp.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/comapp
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS comapp.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/comapp
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/hierarchy/hierarchy.pro b/examples/activeqt/hierarchy/hierarchy.pro
index abe5f1b..d0ebbcd 100644
--- a/examples/activeqt/hierarchy/hierarchy.pro
+++ b/examples/activeqt/hierarchy/hierarchy.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/hierarchy
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hierarchy.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/hierarchy
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/menus/menus.pro b/examples/activeqt/menus/menus.pro
index c962b6b..8963bad 100644
--- a/examples/activeqt/menus/menus.pro
+++ b/examples/activeqt/menus/menus.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/menus
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS menus.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/menus
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/multiple/multiple.pro b/examples/activeqt/multiple/multiple.pro
index 7b86950..97acc9a 100644
--- a/examples/activeqt/multiple/multiple.pro
+++ b/examples/activeqt/multiple/multiple.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/multiple
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS multiple.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/multiple
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/opengl/opengl.pro b/examples/activeqt/opengl/opengl.pro
index 8eb81be..4979dc0 100644
--- a/examples/activeqt/opengl/opengl.pro
+++ b/examples/activeqt/opengl/opengl.pro
@@ -17,3 +17,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/opengl
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS opengl.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/opengl
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/qutlook/qutlook.pro b/examples/activeqt/qutlook/qutlook.pro
index c1154e0..0387735 100644
--- a/examples/activeqt/qutlook/qutlook.pro
+++ b/examples/activeqt/qutlook/qutlook.pro
@@ -21,3 +21,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/qutlook
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qutlook.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/qutlook
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/simple/simple.pro b/examples/activeqt/simple/simple.pro
index d0f2019..4d8480e 100644
--- a/examples/activeqt/simple/simple.pro
+++ b/examples/activeqt/simple/simple.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/simple
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS simple.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/simple
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/webbrowser/webbrowser.pro b/examples/activeqt/webbrowser/webbrowser.pro
index 992d871..d6566cb6 100644
--- a/examples/activeqt/webbrowser/webbrowser.pro
+++ b/examples/activeqt/webbrowser/webbrowser.pro
@@ -15,3 +15,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/webbrowser
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS webbrowser.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/webbrowser
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/activeqt/wrapper/wrapper.pro b/examples/activeqt/wrapper/wrapper.pro
index 4eb6baf..e109dba 100644
--- a/examples/activeqt/wrapper/wrapper.pro
+++ b/examples/activeqt/wrapper/wrapper.pro
@@ -13,3 +13,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/wrapper
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS wrapper.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/wrapper
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/assistant/assistant.pro b/examples/assistant/assistant.pro
index 1477178..b724bcb 100644
--- a/examples/assistant/assistant.pro
+++ b/examples/assistant/assistant.pro
@@ -6,3 +6,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/assistant
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS assistant.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/assistant
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/assistant/simpletextviewer/simpletextviewer.pro b/examples/assistant/simpletextviewer/simpletextviewer.pro
index 4b66edb..4bbdaf1 100644
--- a/examples/assistant/simpletextviewer/simpletextviewer.pro
+++ b/examples/assistant/simpletextviewer/simpletextviewer.pro
@@ -14,3 +14,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES documentation *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/assistant/simpletextviewer
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/dbus/complexpingpong/complexping.pro b/examples/dbus/complexpingpong/complexping.pro
index 4b37b03..7c46533 100644
--- a/examples/dbus/complexpingpong/complexping.pro
+++ b/examples/dbus/complexpingpong/complexping.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/complexpingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/complexpingpong
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/complexpingpong/complexpong.pro b/examples/dbus/complexpingpong/complexpong.pro
index e62fb85..b4d4d1a 100644
--- a/examples/dbus/complexpingpong/complexpong.pro
+++ b/examples/dbus/complexpingpong/complexpong.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/complexpingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/complexpingpong
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/dbus-chat/dbus-chat.pro b/examples/dbus/dbus-chat/dbus-chat.pro
index a094048..e04c641 100644
--- a/examples/dbus/dbus-chat/dbus-chat.pro
+++ b/examples/dbus/dbus-chat/dbus-chat.pro
@@ -17,3 +17,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/chat
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.xml
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/chat
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/dbus.pro b/examples/dbus/dbus.pro
index 36bdc1a..e4a4f70 100644
--- a/examples/dbus/dbus.pro
+++ b/examples/dbus/dbus.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus
sources.files = *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/listnames/listnames.pro b/examples/dbus/listnames/listnames.pro
index e2096a7..b8a648e 100644
--- a/examples/dbus/listnames/listnames.pro
+++ b/examples/dbus/listnames/listnames.pro
@@ -15,3 +15,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/listnames
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/dbus/pingpong/ping.pro b/examples/dbus/pingpong/ping.pro
index 5e5f07a..e28060f 100644
--- a/examples/dbus/pingpong/ping.pro
+++ b/examples/dbus/pingpong/ping.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/pingpong/pong.pro b/examples/dbus/pingpong/pong.pro
index f377a71..ed06d22 100644
--- a/examples/dbus/pingpong/pong.pro
+++ b/examples/dbus/pingpong/pong.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/remotecontrolledcar/car/car.pro b/examples/dbus/remotecontrolledcar/car/car.pro
index d4a97fa..600c3f2 100644
--- a/examples/dbus/remotecontrolledcar/car/car.pro
+++ b/examples/dbus/remotecontrolledcar/car/car.pro
@@ -18,3 +18,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/car
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.xml
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/car
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/remotecontrolledcar/controller/controller.pro b/examples/dbus/remotecontrolledcar/controller/controller.pro
index 3015127..b31d418 100644
--- a/examples/dbus/remotecontrolledcar/controller/controller.pro
+++ b/examples/dbus/remotecontrolledcar/controller/controller.pro
@@ -19,3 +19,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/controller
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.xml
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/controller
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro b/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro
index 73bfa37..0df8e1f 100644
--- a/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro
+++ b/examples/dbus/remotecontrolledcar/remotecontrolledcar.pro
@@ -6,3 +6,5 @@ SUBDIRS = car \
sources.files = *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/calculatorbuilder/calculatorbuilder.pro b/examples/designer/calculatorbuilder/calculatorbuilder.pro
index 1d69cc8..e08220a 100644
--- a/examples/designer/calculatorbuilder/calculatorbuilder.pro
+++ b/examples/designer/calculatorbuilder/calculatorbuilder.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/designer/calculatorbuilder
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.ui *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/calculatorbuilder
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/calculatorform/calculatorform.pro b/examples/designer/calculatorform/calculatorform.pro
index 73f4351..5a133a9 100644
--- a/examples/designer/calculatorform/calculatorform.pro
+++ b/examples/designer/calculatorform/calculatorform.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/designer/calculatorform
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/calculatorform
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/containerextension/containerextension.pro b/examples/designer/containerextension/containerextension.pro
index 6a2cb58..9b2b8bc 100644
--- a/examples/designer/containerextension/containerextension.pro
+++ b/examples/designer/containerextension/containerextension.pro
@@ -24,3 +24,5 @@ target.path = $$[QT_INSTALL_PLUGINS]/designer
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/containerextension
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/customwidgetplugin/customwidgetplugin.pro b/examples/designer/customwidgetplugin/customwidgetplugin.pro
index 4feee59..6cc376f 100644
--- a/examples/designer/customwidgetplugin/customwidgetplugin.pro
+++ b/examples/designer/customwidgetplugin/customwidgetplugin.pro
@@ -19,3 +19,5 @@ target.path = $$[QT_INSTALL_PLUGINS]/designer
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/customwidgetplugin
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/designer.pro b/examples/designer/designer.pro
index 0f30421..b7eacc0 100644
--- a/examples/designer/designer.pro
+++ b/examples/designer/designer.pro
@@ -17,3 +17,5 @@ solaris-cc*:SUBDIRS -= calculatorbuilder \
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/taskmenuextension/taskmenuextension.pro b/examples/designer/taskmenuextension/taskmenuextension.pro
index 83dd878..89c0c44 100644
--- a/examples/designer/taskmenuextension/taskmenuextension.pro
+++ b/examples/designer/taskmenuextension/taskmenuextension.pro
@@ -23,3 +23,5 @@ target.path = $$[QT_INSTALL_PLUGINS]/designer
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/taskmenuextension
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro
index 2690921..0123fd1 100644
--- a/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro
+++ b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/designer/worldtimeclockbuilder
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.ui *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/worldtimeclockbuilder
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro
index cd117dc..5eb133f 100644
--- a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro
+++ b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro
@@ -19,3 +19,5 @@ target.path = $$[QT_INSTALL_PLUGINS]/designer
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/worldtimeclockplugin
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/desktop/desktop.pro b/examples/desktop/desktop.pro
index b65f4f2..61108e5 100644
--- a/examples/desktop/desktop.pro
+++ b/examples/desktop/desktop.pro
@@ -2,10 +2,12 @@ TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS = screenshot
-contains(QT_CONFIG, svg): SUBDIRS += systray
+!symbian:contains(QT_CONFIG, svg): SUBDIRS += systray
# install
target.path = $$[QT_INSTALL_EXAMPLES]/desktop
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS desktop.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/desktop
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/desktop/screenshot/screenshot.pro b/examples/desktop/screenshot/screenshot.pro
index 3ecbf8f..b610812 100644
--- a/examples/desktop/screenshot/screenshot.pro
+++ b/examples/desktop/screenshot/screenshot.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/desktop/screenshot
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS screenshot.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/desktop/screenshot
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/desktop/systray/systray.pro b/examples/desktop/systray/systray.pro
index c73a48e..3c08626 100644
--- a/examples/desktop/systray/systray.pro
+++ b/examples/desktop/systray/systray.pro
@@ -10,6 +10,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS systray.pro resources im
sources.path = $$[QT_INSTALL_EXAMPLES]/desktop/systray
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince* {
CONFIG(debug, release|debug) {
addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qsvgd4.dll
diff --git a/examples/dialogs/classwizard/classwizard.pro b/examples/dialogs/classwizard/classwizard.pro
index 15b6029..0515a8a 100644
--- a/examples/dialogs/classwizard/classwizard.pro
+++ b/examples/dialogs/classwizard/classwizard.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/classwizard
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/classwizard
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dialogs/configdialog/configdialog.pro b/examples/dialogs/configdialog/configdialog.pro
index 344a394..5ef3810 100644
--- a/examples/dialogs/configdialog/configdialog.pro
+++ b/examples/dialogs/configdialog/configdialog.pro
@@ -10,5 +10,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/configdialog
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/configdialog
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib
diff --git a/examples/dialogs/dialogs.pro b/examples/dialogs/dialogs.pro
index b9f029a..6d0ed8d 100644
--- a/examples/dialogs/dialogs.pro
+++ b/examples/dialogs/dialogs.pro
@@ -5,7 +5,7 @@ SUBDIRS = classwizard \
tabdialog \
trivialwizard
-!wince*: SUBDIRS += licensewizard \
+!symbian:!wince*: SUBDIRS += licensewizard \
extension \
findfiles
@@ -15,3 +15,5 @@ wince*: SUBDIRS += sipdialog
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dialogs/extension/extension.pro b/examples/dialogs/extension/extension.pro
index 3e56cb9..7f80f9c 100644
--- a/examples/dialogs/extension/extension.pro
+++ b/examples/dialogs/extension/extension.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/extension
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/extension
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dialogs/findfiles/findfiles.pro b/examples/dialogs/findfiles/findfiles.pro
index 99be394..6820c17 100644
--- a/examples/dialogs/findfiles/findfiles.pro
+++ b/examples/dialogs/findfiles/findfiles.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/findfiles
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/findfiles
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dialogs/licensewizard/licensewizard.pro b/examples/dialogs/licensewizard/licensewizard.pro
index fd5e37c..789dae0 100644
--- a/examples/dialogs/licensewizard/licensewizard.pro
+++ b/examples/dialogs/licensewizard/licensewizard.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/licensewizard
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/licensewizard
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/dialogs/sipdialog/sipdialog.pro b/examples/dialogs/sipdialog/sipdialog.pro
index 69667eb..3d5503f 100644
--- a/examples/dialogs/sipdialog/sipdialog.pro
+++ b/examples/dialogs/sipdialog/sipdialog.pro
@@ -7,6 +7,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/sipdialog
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/sipdialog
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib
diff --git a/examples/dialogs/standarddialogs/standarddialogs.pro b/examples/dialogs/standarddialogs/standarddialogs.pro
index 6bfa6bf..9b06e5c 100644
--- a/examples/dialogs/standarddialogs/standarddialogs.pro
+++ b/examples/dialogs/standarddialogs/standarddialogs.pro
@@ -7,5 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/standarddialogs
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/standarddialogs
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib
diff --git a/examples/dialogs/tabdialog/tabdialog.pro b/examples/dialogs/tabdialog/tabdialog.pro
index 3239a72..f3fa95d 100644
--- a/examples/dialogs/tabdialog/tabdialog.pro
+++ b/examples/dialogs/tabdialog/tabdialog.pro
@@ -7,4 +7,6 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/tabdialog
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/tabdialog
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib
diff --git a/examples/dialogs/trivialwizard/trivialwizard.pro b/examples/dialogs/trivialwizard/trivialwizard.pro
index 970e12f..27bb8d9 100644
--- a/examples/dialogs/trivialwizard/trivialwizard.pro
+++ b/examples/dialogs/trivialwizard/trivialwizard.pro
@@ -5,3 +5,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/trivialwizard
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/trivialwizard
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/draganddrop/delayedencoding/delayedencoding.pro b/examples/draganddrop/delayedencoding/delayedencoding.pro
index c7b95b6..7315ac5 100644
--- a/examples/draganddrop/delayedencoding/delayedencoding.pro
+++ b/examples/draganddrop/delayedencoding/delayedencoding.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/delayedencoding
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/delayedencoding
INSTALLS += target sources
+
+symbian:TARGET.UID3 = 0xA000C614 \ No newline at end of file
diff --git a/examples/draganddrop/draganddrop.pro b/examples/draganddrop/draganddrop.pro
index 0cd881a..fa857db 100644
--- a/examples/draganddrop/draganddrop.pro
+++ b/examples/draganddrop/draganddrop.pro
@@ -8,7 +8,7 @@ SUBDIRS = draggableicons \
contains(QT_CONFIG, svg): SUBDIRS += delayedencoding
wince*: SUBDIRS -= dropsite
-
+symbian: SUBDIRS -= dropsite
# install
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop
diff --git a/examples/draganddrop/draggableicons/draggableicons.pro b/examples/draganddrop/draggableicons/draggableicons.pro
index 74cfda9..6d53baa 100644
--- a/examples/draganddrop/draggableicons/draggableicons.pro
+++ b/examples/draganddrop/draggableicons/draggableicons.pro
@@ -8,3 +8,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggableicons
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggableicons
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C615 \ No newline at end of file
diff --git a/examples/draganddrop/draggabletext/draggabletext.pro b/examples/draganddrop/draggabletext/draggabletext.pro
index 07c7c24..15d909d 100644
--- a/examples/draganddrop/draggabletext/draggabletext.pro
+++ b/examples/draganddrop/draggabletext/draggabletext.pro
@@ -10,3 +10,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggabletext
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.txt *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggabletext
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF64 \ No newline at end of file
diff --git a/examples/draganddrop/dropsite/dropsite.pro b/examples/draganddrop/dropsite/dropsite.pro
index 29dd0fd..268e247 100644
--- a/examples/draganddrop/dropsite/dropsite.pro
+++ b/examples/draganddrop/dropsite/dropsite.pro
@@ -10,3 +10,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/dropsite
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/draganddrop/fridgemagnets/dragwidget.cpp b/examples/draganddrop/fridgemagnets/dragwidget.cpp
index 43a9588..2f96a58 100644
--- a/examples/draganddrop/fridgemagnets/dragwidget.cpp
+++ b/examples/draganddrop/fridgemagnets/dragwidget.cpp
@@ -75,9 +75,12 @@ DragWidget::DragWidget(QWidget *parent)
//! [1]
//! [2]
+ #ifndef Q_WS_S60
+ //Fridge magnets is used for demoing Qt on S60 and themed backgrounds look better than white
QPalette newPalette = palette();
newPalette.setColor(QPalette::Window, Qt::white);
setPalette(newPalette);
+ #endif
setMinimumSize(400, qMax(200, y));
setWindowTitle(tr("Fridge Magnets"));
diff --git a/examples/draganddrop/fridgemagnets/fridgemagnets.pro b/examples/draganddrop/fridgemagnets/fridgemagnets.pro
index f1baaef..b452746 100644
--- a/examples/draganddrop/fridgemagnets/fridgemagnets.pro
+++ b/examples/draganddrop/fridgemagnets/fridgemagnets.pro
@@ -10,3 +10,6 @@ target.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/fridgemagnets
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.txt
sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/fridgemagnets
INSTALLS += target sources
+TARGET.UID3 = 0xA000C610
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/draganddrop/fridgemagnets/main.cpp b/examples/draganddrop/fridgemagnets/main.cpp
index c24cdb2..23dfe79 100644
--- a/examples/draganddrop/fridgemagnets/main.cpp
+++ b/examples/draganddrop/fridgemagnets/main.cpp
@@ -45,9 +45,16 @@
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(fridgemagnets);
+ bool smallScreen = false;
+ for (int i=0; i<argc; i++)
+ if (QString(argv[i]) == "-small-screen")
+ smallScreen = true;
QApplication app(argc, argv);
DragWidget window;
- window.show();
+ if (smallScreen)
+ window.showFullScreen();
+ else
+ window.show();
return app.exec();
}
diff --git a/examples/draganddrop/puzzle/puzzle.pro b/examples/draganddrop/puzzle/puzzle.pro
index 26d2350..ecaf706 100644
--- a/examples/draganddrop/puzzle/puzzle.pro
+++ b/examples/draganddrop/puzzle/puzzle.pro
@@ -13,6 +13,14 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.jpg
sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/puzzle
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:{
+ addFile.sources = example.jpg
+ addFile.path = .
+ DEPLOYMENT += addFile
+ TARGET.UID3 = 0xA000CF65
+}
wince*: {
addFile.sources = example.jpg
addFile.path = .
diff --git a/examples/examplebase.pri b/examples/examplebase.pri
new file mode 100644
index 0000000..eff6588
--- /dev/null
+++ b/examples/examplebase.pri
@@ -0,0 +1 @@
+symbian:RSS_RULES ="group_name=\"QtExamples\";" \ No newline at end of file
diff --git a/examples/examples.pro b/examples/examples.pro
index bfcf9b4..56625f6 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -24,10 +24,22 @@ SUBDIRS = \
xml \
script
+symbian: SUBDIRS = \
+ graphicsview \
+ itemviews \
+ network \
+ painting \
+ widgets \
+ draganddrop \
+ mainwindows \
+ script \
+ sql \
+ xml
+
contains(QT_CONFIG, phonon):!static: SUBDIRS += phonon
contains(QT_CONFIG, webkit): SUBDIRS += webkit
embedded:SUBDIRS += qws
-!wince*: {
+!wince*:!symbian: {
!contains(QT_EDITION, Console):contains(QT_BUILD_PARTS, tools):SUBDIRS += designer
contains(QT_BUILD_PARTS, tools):SUBDIRS += assistant qtestlib help
} else {
@@ -43,3 +55,5 @@ contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro
index a166882..956f5c2 100644
--- a/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro
+++ b/examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro
@@ -10,3 +10,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/basicgraphicslayouts
sources.files = $$SOURCES $$HEADERS $$RESOURCES basicgraphicslayouts.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/basicgraphicslayouts
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A645 \ No newline at end of file
diff --git a/examples/graphicsview/collidingmice/collidingmice.pro b/examples/graphicsview/collidingmice/collidingmice.pro
index 77543b5..a434efc 100644
--- a/examples/graphicsview/collidingmice/collidingmice.pro
+++ b/examples/graphicsview/collidingmice/collidingmice.pro
@@ -12,3 +12,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/collidingmice
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS collidingmice.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/collidingmice
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A643 \ No newline at end of file
diff --git a/examples/graphicsview/diagramscene/diagramscene.pro b/examples/graphicsview/diagramscene/diagramscene.pro
index fe261bd..9e90e0d 100644
--- a/examples/graphicsview/diagramscene/diagramscene.pro
+++ b/examples/graphicsview/diagramscene/diagramscene.pro
@@ -18,3 +18,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS diagramscene.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/diagramscene
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/graphicsview/dragdroprobot/dragdroprobot.pro b/examples/graphicsview/dragdroprobot/dragdroprobot.pro
index 769e54a..756a9c8 100644
--- a/examples/graphicsview/dragdroprobot/dragdroprobot.pro
+++ b/examples/graphicsview/dragdroprobot/dragdroprobot.pro
@@ -16,3 +16,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/dragdroprobot
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS dragdroprobot.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/dragdroprobot
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/graphicsview/elasticnodes/elasticnodes.pro b/examples/graphicsview/elasticnodes/elasticnodes.pro
index 77ca706..800eaae 100644
--- a/examples/graphicsview/elasticnodes/elasticnodes.pro
+++ b/examples/graphicsview/elasticnodes/elasticnodes.pro
@@ -9,8 +9,14 @@ SOURCES += \
node.cpp \
graphwidget.cpp
+TARGET.EPOCHEAPSIZE = 0x200000 0xA00000
+
# install
target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/elasticnodes
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS elasticnodes.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/elasticnodes
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A642 \ No newline at end of file
diff --git a/examples/graphicsview/graphicsview.pro b/examples/graphicsview/graphicsview.pro
index 66eb0b4..e955725 100644
--- a/examples/graphicsview/graphicsview.pro
+++ b/examples/graphicsview/graphicsview.pro
@@ -1,18 +1,22 @@
-TEMPLATE = \
- subdirs
+TEMPLATE = subdirs
SUBDIRS = \
elasticnodes \
collidingmice \
+ padnavigator \
+ basicgraphicslayouts
+
+!symbian: SUBDIRS += \
diagramscene \
dragdroprobot \
- padnavigator \
basicgraphicslayouts
contains(QT_CONFIG, qt3support):SUBDIRS += portedcanvas portedasteroids
-contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= dragdroprobot
+contains(DEFINES, QT_NO_CURSOR)|contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= dragdroprobot
# install
target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS graphicsview.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/graphicsview/padnavigator/main.cpp b/examples/graphicsview/padnavigator/main.cpp
index dc5ff0c..a7d00c8 100644
--- a/examples/graphicsview/padnavigator/main.cpp
+++ b/examples/graphicsview/padnavigator/main.cpp
@@ -53,7 +53,7 @@ int main(int argc, char *argv[])
Panel panel(3, 3);
panel.setFocus();
- panel.show();
+ panel.showFullScreen();
return app.exec();
}
diff --git a/examples/graphicsview/padnavigator/padnavigator.pro b/examples/graphicsview/padnavigator/padnavigator.pro
index 0d094c6..7fa8507 100644
--- a/examples/graphicsview/padnavigator/padnavigator.pro
+++ b/examples/graphicsview/padnavigator/padnavigator.pro
@@ -22,3 +22,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/padnavigator
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS padnavigator.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/padnavigator
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+CONFIG += console
+
+symbian:TARGET.UID3 = 0xA000A644 \ No newline at end of file
diff --git a/examples/graphicsview/portedasteroids/portedasteroids.pro b/examples/graphicsview/portedasteroids/portedasteroids.pro
index 1452e91..99dc042 100644
--- a/examples/graphicsview/portedasteroids/portedasteroids.pro
+++ b/examples/graphicsview/portedasteroids/portedasteroids.pro
@@ -17,3 +17,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/portedasteroids
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS portedasteroids.pro bg.png sounds sprites
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/portedasteroids
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/graphicsview/portedcanvas/portedcanvas.pro b/examples/graphicsview/portedcanvas/portedcanvas.pro
index 71e3d84..7c3946b 100644
--- a/examples/graphicsview/portedcanvas/portedcanvas.pro
+++ b/examples/graphicsview/portedcanvas/portedcanvas.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/portedcanvas
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS portedcanvas.pro *.png *.xpm *.doc
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/portedcanvas
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/help/contextsensitivehelp/contextsensitivehelp.pro b/examples/help/contextsensitivehelp/contextsensitivehelp.pro
index 5a8c0b1..03a26fa 100644
--- a/examples/help/contextsensitivehelp/contextsensitivehelp.pro
+++ b/examples/help/contextsensitivehelp/contextsensitivehelp.pro
@@ -16,3 +16,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/help/contextsensitivehelp
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.png *.doc doc
sources.path = $$[QT_INSTALL_EXAMPLES]/help/contextsensitivehelp
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/help/help.pro b/examples/help/help.pro
index 1ce6322..293e511 100644
--- a/examples/help/help.pro
+++ b/examples/help/help.pro
@@ -9,3 +9,5 @@ SUBDIRS += contextsensitivehelp \
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/help
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/help/remotecontrol/remotecontrol.pro b/examples/help/remotecontrol/remotecontrol.pro
index 05fc14c..e97af6d 100644
--- a/examples/help/remotecontrol/remotecontrol.pro
+++ b/examples/help/remotecontrol/remotecontrol.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/help/remotecontrol
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.png *.doc doc
sources.path = $$[QT_INSTALL_EXAMPLES]/help/remotecontrol
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/help/simpletextviewer/simpletextviewer.pro b/examples/help/simpletextviewer/simpletextviewer.pro
index e9e7ea2..a8504e1 100644
--- a/examples/help/simpletextviewer/simpletextviewer.pro
+++ b/examples/help/simpletextviewer/simpletextviewer.pro
@@ -14,3 +14,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES documentation *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/help/simpletextviewer
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/ipc/ipc.pro b/examples/ipc/ipc.pro
index 0698f89..b758fc4 100644
--- a/examples/ipc/ipc.pro
+++ b/examples/ipc/ipc.pro
@@ -6,3 +6,5 @@ SUBDIRS = sharedmemory
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS ipc.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/ipc
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/ipc/localfortuneclient/localfortuneclient.pro b/examples/ipc/localfortuneclient/localfortuneclient.pro
index 906cc8a..a394169 100644
--- a/examples/ipc/localfortuneclient/localfortuneclient.pro
+++ b/examples/ipc/localfortuneclient/localfortuneclient.pro
@@ -9,4 +9,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS localfortuneclient.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/ipc/localfortuneclient
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/ipc/localfortuneserver/localfortuneserver.pro b/examples/ipc/localfortuneserver/localfortuneserver.pro
index fca9a0a..db20791 100644
--- a/examples/ipc/localfortuneserver/localfortuneserver.pro
+++ b/examples/ipc/localfortuneserver/localfortuneserver.pro
@@ -9,4 +9,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS localfortuneserver.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/ipc/localfortuneserver
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/ipc/sharedmemory/sharedmemory.pro b/examples/ipc/sharedmemory/sharedmemory.pro
index 4833090..4dad1d1 100644
--- a/examples/ipc/sharedmemory/sharedmemory.pro
+++ b/examples/ipc/sharedmemory/sharedmemory.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/ipc/sharedmemory
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/ipc/sharedmemory
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/addressbook/addressbook.pro b/examples/itemviews/addressbook/addressbook.pro
index 6f6a72d..a03e3b6 100644
--- a/examples/itemviews/addressbook/addressbook.pro
+++ b/examples/itemviews/addressbook/addressbook.pro
@@ -15,3 +15,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/addressbook
sources.files = $$SOURCES $$HEADERS $$RESOURCES addressbook.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/addressbook
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A646 \ No newline at end of file
diff --git a/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro b/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro
index 7870b39..a2c8751 100644
--- a/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro
+++ b/examples/itemviews/basicsortfiltermodel/basicsortfiltermodel.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/basicsortfiltermodel
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/basicsortfiltermodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/chart/chart.pro b/examples/itemviews/chart/chart.pro
index d202451..3556de0 100644
--- a/examples/itemviews/chart/chart.pro
+++ b/examples/itemviews/chart/chart.pro
@@ -4,10 +4,16 @@ RESOURCES = chart.qrc
SOURCES = main.cpp \
mainwindow.cpp \
pieview.cpp
-unix:!mac:LIBS+= -lm
+unix:!mac:!symbian:LIBS+= -lm
+
+TARGET.EPOCHEAPSIZE = 0x200000 0x800000
# install
target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/chart
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.cht
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/chart
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A647
diff --git a/examples/itemviews/coloreditorfactory/coloreditorfactory.pro b/examples/itemviews/coloreditorfactory/coloreditorfactory.pro
index ebb3b8e..f668e6a 100644
--- a/examples/itemviews/coloreditorfactory/coloreditorfactory.pro
+++ b/examples/itemviews/coloreditorfactory/coloreditorfactory.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/coloreditorfactory
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/coloreditorfactory
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro b/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro
index 5a9b9f9..091cd9d 100644
--- a/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro
+++ b/examples/itemviews/customsortfiltermodel/customsortfiltermodel.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/customsortfiltermodel
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/customsortfiltermodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/dirview/dirview.pro b/examples/itemviews/dirview/dirview.pro
index 5865d3c..77290a8 100644
--- a/examples/itemviews/dirview/dirview.pro
+++ b/examples/itemviews/dirview/dirview.pro
@@ -5,3 +5,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/dirview
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/dirview
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/editabletreemodel/editabletreemodel.pro b/examples/itemviews/editabletreemodel/editabletreemodel.pro
index 2b7b7de..4213cd7 100644
--- a/examples/itemviews/editabletreemodel/editabletreemodel.pro
+++ b/examples/itemviews/editabletreemodel/editabletreemodel.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/editabletreemodel
sources.files = $$FORMS $$HEADERS $$RESOURCES $$SOURCES *.pro *.txt
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/editabletreemodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/itemviews.pro b/examples/itemviews/itemviews.pro
index 6202bbc..adbb900 100644
--- a/examples/itemviews/itemviews.pro
+++ b/examples/itemviews/itemviews.pro
@@ -16,7 +16,13 @@ SUBDIRS = addressbook \
spinboxdelegate \
stardelegate
+symbian: SUBDIRS = \
+ addressbook \
+ chart
+
# install
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/pixelator/pixelator.pro b/examples/itemviews/pixelator/pixelator.pro
index dc05296..8a139d4 100644
--- a/examples/itemviews/pixelator/pixelator.pro
+++ b/examples/itemviews/pixelator/pixelator.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/pixelator
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/pixelator
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/puzzle/puzzle.pro b/examples/itemviews/puzzle/puzzle.pro
index 4f5aaad..de17a69 100644
--- a/examples/itemviews/puzzle/puzzle.pro
+++ b/examples/itemviews/puzzle/puzzle.pro
@@ -13,6 +13,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.jpg
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/puzzle
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince* {
DEPLOYMENT_PLUGIN += qjpeg qgif qtiff
}
diff --git a/examples/itemviews/simpledommodel/simpledommodel.pro b/examples/itemviews/simpledommodel/simpledommodel.pro
index bc9b1ca..cc7b4de 100644
--- a/examples/itemviews/simpledommodel/simpledommodel.pro
+++ b/examples/itemviews/simpledommodel/simpledommodel.pro
@@ -13,3 +13,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simpledommodel
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simpledommodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/simpletreemodel/simpletreemodel.pro b/examples/itemviews/simpletreemodel/simpletreemodel.pro
index 9db74d4..b1dd37a 100644
--- a/examples/itemviews/simpletreemodel/simpletreemodel.pro
+++ b/examples/itemviews/simpletreemodel/simpletreemodel.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simpletreemodel
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.txt
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simpletreemodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro b/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro
index b2940d7..8bbfef9 100644
--- a/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro
+++ b/examples/itemviews/simplewidgetmapper/simplewidgetmapper.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simplewidgetmapper
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/simplewidgetmapper
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/spinboxdelegate/spinboxdelegate.pro b/examples/itemviews/spinboxdelegate/spinboxdelegate.pro
index a202748..31b55d4 100644
--- a/examples/itemviews/spinboxdelegate/spinboxdelegate.pro
+++ b/examples/itemviews/spinboxdelegate/spinboxdelegate.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/spinboxdelegate
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/spinboxdelegate
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/itemviews/stardelegate/stardelegate.pro b/examples/itemviews/stardelegate/stardelegate.pro
index 4e1ef45..a55b55d 100644
--- a/examples/itemviews/stardelegate/stardelegate.pro
+++ b/examples/itemviews/stardelegate/stardelegate.pro
@@ -12,3 +12,5 @@ sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/stardelegate
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/layouts/basiclayouts/basiclayouts.pro b/examples/layouts/basiclayouts/basiclayouts.pro
index 8fa73ff..4ffc8c0 100644
--- a/examples/layouts/basiclayouts/basiclayouts.pro
+++ b/examples/layouts/basiclayouts/basiclayouts.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/layouts/basiclayouts
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/layouts/basiclayouts
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/layouts/borderlayout/borderlayout.pro b/examples/layouts/borderlayout/borderlayout.pro
index e327574..18b5e6c 100644
--- a/examples/layouts/borderlayout/borderlayout.pro
+++ b/examples/layouts/borderlayout/borderlayout.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/layouts/borderlayout
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/layouts/borderlayout
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/layouts/dynamiclayouts/dynamiclayouts.pro b/examples/layouts/dynamiclayouts/dynamiclayouts.pro
index c169dd0..dce1e29 100644
--- a/examples/layouts/dynamiclayouts/dynamiclayouts.pro
+++ b/examples/layouts/dynamiclayouts/dynamiclayouts.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/layouts/dynamiclayouts
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/layouts/dynamiclayouts
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/layouts/flowlayout/flowlayout.pro b/examples/layouts/flowlayout/flowlayout.pro
index 0e97824..ece314f 100644
--- a/examples/layouts/flowlayout/flowlayout.pro
+++ b/examples/layouts/flowlayout/flowlayout.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/layouts/flowlayout
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/layouts/flowlayout
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/layouts/layouts.pro b/examples/layouts/layouts.pro
index 9676f4b..81c15f2 100644
--- a/examples/layouts/layouts.pro
+++ b/examples/layouts/layouts.pro
@@ -8,3 +8,5 @@ SUBDIRS = basiclayouts \
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/layouts
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/linguist/arrowpad/arrowpad.pro b/examples/linguist/arrowpad/arrowpad.pro
index c8a6fb2..7e409a6 100644
--- a/examples/linguist/arrowpad/arrowpad.pro
+++ b/examples/linguist/arrowpad/arrowpad.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/linguist/arrowpad
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/linguist/arrowpad
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/linguist/hellotr/hellotr.pro b/examples/linguist/hellotr/hellotr.pro
index c0065a4..ecd480b 100644
--- a/examples/linguist/hellotr/hellotr.pro
+++ b/examples/linguist/hellotr/hellotr.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/linguist/hellotr
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/linguist/hellotr
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/linguist/linguist.pro b/examples/linguist/linguist.pro
index 921667d..ad3f772 100644
--- a/examples/linguist/linguist.pro
+++ b/examples/linguist/linguist.pro
@@ -7,3 +7,5 @@ SUBDIRS = arrowpad \
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/linguist
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/linguist/trollprint/trollprint.pro b/examples/linguist/trollprint/trollprint.pro
index 9f3aaeb..27cb38e 100644
--- a/examples/linguist/trollprint/trollprint.pro
+++ b/examples/linguist/trollprint/trollprint.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/linguist/trollprint
sources.files = $$SOURCES $$HEADERS $$TRANSLATIONS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/linguist/trollprint
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/mainwindows/application/application.pro b/examples/mainwindows/application/application.pro
index ad1168a..fc022fc 100644
--- a/examples/mainwindows/application/application.pro
+++ b/examples/mainwindows/application/application.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/application
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS application.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/application
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/mainwindows/application/mainwindow.cpp b/examples/mainwindows/application/mainwindow.cpp
index cf36332..6991ab3 100644
--- a/examples/mainwindows/application/mainwindow.cpp
+++ b/examples/mainwindows/application/mainwindow.cpp
@@ -328,9 +328,13 @@ void MainWindow::loadFile(const QString &fileName)
}
QTextStream in(&file);
+#ifndef QT_NO_CURSOR
QApplication::setOverrideCursor(Qt::WaitCursor);
+#endif
textEdit->setPlainText(in.readAll());
+#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
+#endif
setCurrentFile(fileName);
statusBar()->showMessage(tr("File loaded"), 2000);
@@ -351,9 +355,13 @@ bool MainWindow::saveFile(const QString &fileName)
}
QTextStream out(&file);
+#ifndef QT_NO_CURSOR
QApplication::setOverrideCursor(Qt::WaitCursor);
+#endif
out << textEdit->toPlainText();
+#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
+#endif
setCurrentFile(fileName);
statusBar()->showMessage(tr("File saved"), 2000);
diff --git a/examples/mainwindows/dockwidgets/dockwidgets.pro b/examples/mainwindows/dockwidgets/dockwidgets.pro
index afc8aaa..ea8594d 100644
--- a/examples/mainwindows/dockwidgets/dockwidgets.pro
+++ b/examples/mainwindows/dockwidgets/dockwidgets.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/dockwidgets
sources.files = $$SOURCES $$HEADERS $$RESOURCES dockwidgets.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/dockwidgets
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/mainwindows/mainwindows.pro b/examples/mainwindows/mainwindows.pro
index 90ff3a5..e310e3d 100644
--- a/examples/mainwindows/mainwindows.pro
+++ b/examples/mainwindows/mainwindows.pro
@@ -6,8 +6,14 @@ SUBDIRS = application \
recentfiles \
sdi
+symbian: SUBDIRS = \
+ menus
+
+
# install
target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mainwindows.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/mainwindows/mdi/mdi.pro b/examples/mainwindows/mdi/mdi.pro
index 4601f1c..b0db42c 100644
--- a/examples/mainwindows/mdi/mdi.pro
+++ b/examples/mainwindows/mdi/mdi.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/mdi
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mdi.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/mdi
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/mainwindows/menus/menus.pro b/examples/mainwindows/menus/menus.pro
index 7b0a2ec..8cf60bf 100644
--- a/examples/mainwindows/menus/menus.pro
+++ b/examples/mainwindows/menus/menus.pro
@@ -7,3 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/menus
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS menus.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/menus
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF66 \ No newline at end of file
diff --git a/examples/mainwindows/recentfiles/recentfiles.pro b/examples/mainwindows/recentfiles/recentfiles.pro
index 7c62cdf..8f7ddaf 100644
--- a/examples/mainwindows/recentfiles/recentfiles.pro
+++ b/examples/mainwindows/recentfiles/recentfiles.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/recentfiles
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS recentfiles.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/recentfiles
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/mainwindows/sdi/sdi.pro b/examples/mainwindows/sdi/sdi.pro
index 3283334..c033e19 100644
--- a/examples/mainwindows/sdi/sdi.pro
+++ b/examples/mainwindows/sdi/sdi.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/sdi
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS sdi.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/sdi
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/blockingfortuneclient/blockingfortuneclient.pro b/examples/network/blockingfortuneclient/blockingfortuneclient.pro
index fa146fa..96fbc1f 100644
--- a/examples/network/blockingfortuneclient/blockingfortuneclient.pro
+++ b/examples/network/blockingfortuneclient/blockingfortuneclient.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/blockingfortuneclient
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS blockingfortuneclient.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/blockingfortuneclient
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/broadcastreceiver/broadcastreceiver.pro b/examples/network/broadcastreceiver/broadcastreceiver.pro
index ad04e2c..36ad096 100644
--- a/examples/network/broadcastreceiver/broadcastreceiver.pro
+++ b/examples/network/broadcastreceiver/broadcastreceiver.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastreceiver
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastreceiver.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastreceiver
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/broadcastsender/broadcastsender.pro b/examples/network/broadcastsender/broadcastsender.pro
index b300a50..84e6593 100644
--- a/examples/network/broadcastsender/broadcastsender.pro
+++ b/examples/network/broadcastsender/broadcastsender.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastsender
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastsender.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastsender
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/download/download.pro b/examples/network/download/download.pro
index 254c356..f0db340 100644
--- a/examples/network/download/download.pro
+++ b/examples/network/download/download.pro
@@ -17,3 +17,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/download
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/network/download
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/downloadmanager/downloadmanager.pro b/examples/network/downloadmanager/downloadmanager.pro
index 1b979ca..ef7052c 100644
--- a/examples/network/downloadmanager/downloadmanager.pro
+++ b/examples/network/downloadmanager/downloadmanager.pro
@@ -18,3 +18,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/downloadmanager
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/network/downloadmanager
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro
index 1c7b0a8..bb125e8 100644
--- a/examples/network/fortuneclient/fortuneclient.pro
+++ b/examples/network/fortuneclient/fortuneclient.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneclient
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fortuneclient.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneclient
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro
index e98385a..8cf52ee 100644
--- a/examples/network/fortuneserver/fortuneserver.pro
+++ b/examples/network/fortuneserver/fortuneserver.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fortuneserver.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/ftp/ftp.pro b/examples/network/ftp/ftp.pro
index cabc003..c70b812 100644
--- a/examples/network/ftp/ftp.pro
+++ b/examples/network/ftp/ftp.pro
@@ -9,3 +9,13 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/ftp
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS ftp.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/network/ftp
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian {
+ HEADERS += sym_iap_util.h
+ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+ TARGET.CAPABILITY="NetworkServices"
+ TARGET.UID3 = 0xA000A648
+ LIBS+=-lesock -lconnmon # For IAP selection
+} \ No newline at end of file
diff --git a/examples/network/ftp/ftpwindow.cpp b/examples/network/ftp/ftpwindow.cpp
index a05a5dd..a48252a 100644
--- a/examples/network/ftp/ftpwindow.cpp
+++ b/examples/network/ftp/ftpwindow.cpp
@@ -44,6 +44,10 @@
#include "ftpwindow.h"
+#ifdef Q_OS_SYMBIAN
+#include "sym_iap_util.h"
+#endif
+
FtpWindow::FtpWindow(QWidget *parent)
: QDialog(parent), ftp(0)
{
@@ -52,6 +56,10 @@ FtpWindow::FtpWindow(QWidget *parent)
ftpServerLabel->setBuddy(ftpServerLineEdit);
statusLabel = new QLabel(tr("Please enter the name of an FTP server."));
+#ifdef Q_OS_SYMBIAN
+ // Use word wrapping to fit the text on screen
+ statusLabel->setWordWrap( true );
+#endif
fileList = new QTreeWidget;
fileList->setEnabled(false);
@@ -90,16 +98,31 @@ FtpWindow::FtpWindow(QWidget *parent)
QHBoxLayout *topLayout = new QHBoxLayout;
topLayout->addWidget(ftpServerLabel);
topLayout->addWidget(ftpServerLineEdit);
+#ifndef Q_OS_SYMBIAN
topLayout->addWidget(cdToParentButton);
topLayout->addWidget(connectButton);
+#else
+ // Make app better lookin on small screen
+ QHBoxLayout *topLayout2 = new QHBoxLayout;
+ topLayout2->addWidget(cdToParentButton);
+ topLayout2->addWidget(connectButton);
+#endif
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(topLayout);
+#ifdef Q_OS_SYMBIAN
+ // Make app better lookin on small screen
+ mainLayout->addLayout(topLayout2);
+#endif
mainLayout->addWidget(fileList);
mainLayout->addWidget(statusLabel);
mainLayout->addWidget(buttonBox);
setLayout(mainLayout);
+#ifdef Q_OS_SYMBIAN
+ bDefaultIapSet = false;
+#endif
+
setWindowTitle(tr("FTP"));
}
@@ -111,6 +134,12 @@ QSize FtpWindow::sizeHint() const
//![0]
void FtpWindow::connectOrDisconnect()
{
+#ifdef Q_OS_SYMBIAN
+ if(!bDefaultIapSet) {
+ qt_SetDefaultIap();
+ bDefaultIapSet = true;
+ }
+#endif
if (ftp) {
ftp->abort();
ftp->deleteLater();
@@ -124,6 +153,7 @@ void FtpWindow::connectOrDisconnect()
#ifndef QT_NO_CURSOR
setCursor(Qt::ArrowCursor);
#endif
+ statusLabel->setText(tr("Please enter the name of an FTP server."));
return;
}
diff --git a/examples/network/ftp/ftpwindow.h b/examples/network/ftp/ftpwindow.h
index a3045fa..70c1210 100644
--- a/examples/network/ftp/ftpwindow.h
+++ b/examples/network/ftp/ftpwindow.h
@@ -98,6 +98,10 @@ private:
QString currentPath;
QFtp *ftp;
QFile *file;
+
+#ifdef Q_OS_SYMBIAN
+ bool bDefaultIapSet;
+#endif
//![1]
};
diff --git a/examples/network/ftp/main.cpp b/examples/network/ftp/main.cpp
index b9ffd33..5c24788 100644
--- a/examples/network/ftp/main.cpp
+++ b/examples/network/ftp/main.cpp
@@ -40,15 +40,28 @@
****************************************************************************/
#include <QApplication>
-
#include "ftpwindow.h"
+#ifdef Q_OS_SYMBIAN
+#include <QDir>
+#include <QDesktopWidget>
+#endif
+
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(ftp);
-
- QApplication app(argc, argv);
+#ifdef Q_OS_SYMBIAN
+ // Change current directory from default private to c:\data
+ // in order that user can access the downloaded content
+ QDir::setCurrent( "c:\\data" );
+#endif
+ QApplication app(argc, argv);
FtpWindow ftpWin;
+#ifdef Q_OS_SYMBIAN
+ // Make application better looking and more usable on small screen
+ ftpWin.showMaximized();
+#else
ftpWin.show();
+#endif
return ftpWin.exec();
}
diff --git a/examples/network/ftp/sym_iap_util.h b/examples/network/ftp/sym_iap_util.h
new file mode 100644
index 0000000..14df5af
--- /dev/null
+++ b/examples/network/ftp/sym_iap_util.h
@@ -0,0 +1,131 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QSYM_IAP_UTIL_H
+#define QSYM_IAP_UTIL_H
+
+#include <es_sock.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <rconnmon.h>
+
+QString qt_TDesC2QStringL(const TDesC& aDescriptor)
+{
+#ifdef QT_NO_UNICODE
+ return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length());
+#else
+ return QString::fromUtf16(aDescriptor.Ptr(), aDescriptor.Length());
+#endif
+}
+
+static void qt_SetDefaultIapL()
+{
+ TUint count;
+ TRequestStatus status;
+ TUint ids[15];
+
+ RSocketServ serv;
+ CleanupClosePushL(serv);
+
+ RConnection conn;
+ CleanupClosePushL(conn);
+
+ RConnectionMonitor monitor;
+ CleanupClosePushL(monitor);
+
+ monitor.ConnectL();
+ monitor.GetConnectionCount(count, status);
+ User::WaitForRequest(status);
+ if(status.Int() != KErrNone) {
+ User::Leave(status.Int());
+ }
+
+ TUint numSubConnections;
+
+ if(count > 0) {
+ for (TInt i = 1; i <= count; i++) {
+ User::LeaveIfError(monitor.GetConnectionInfo(i, ids[i-1], numSubConnections));
+ }
+ /*
+ * get IAP value for first active connection
+ */
+ TBuf< 50 > iapName;
+ monitor.GetStringAttribute(ids[0], 0, KIAPName, iapName, status);
+ User::WaitForRequest(status);
+ if (status.Int() != KErrNone) {
+ User::Leave(status.Int());
+ } else {
+ QString strIapName = qt_TDesC2QStringL(iapName);
+ struct ifreq ifReq;
+ strcpy(ifReq.ifr_name, strIapName.toLatin1().data());
+ User::LeaveIfError(setdefaultif(&ifReq));
+ }
+ } else {
+ /*
+ * no active connections yet
+ * use IAP dialog to select one
+ */
+ User::LeaveIfError(serv.Connect());
+ User::LeaveIfError(conn.Open(serv));
+ User::LeaveIfError(conn.Start());
+
+ _LIT(KIapNameSetting, "IAP\\Name");
+ TBuf8<50> iap8Name;
+ User::LeaveIfError(conn.GetDesSetting(TPtrC(KIapNameSetting), iap8Name));
+ iap8Name.ZeroTerminate();
+
+ conn.Stop();
+
+ struct ifreq ifReq;
+ strcpy(ifReq.ifr_name, (char*)iap8Name.Ptr());
+ User::LeaveIfError(setdefaultif(&ifReq));
+ }
+ CleanupStack::PopAndDestroy(&monitor);
+ CleanupStack::PopAndDestroy(&conn);
+ CleanupStack::PopAndDestroy(&serv);
+}
+
+static int qt_SetDefaultIap()
+{
+ TRAPD(err, qt_SetDefaultIapL());
+ return err;
+}
+
+#endif // QSYM_IAP_UTIL_H
diff --git a/examples/network/http/http.pro b/examples/network/http/http.pro
index 7f58d9f..99aa717 100644
--- a/examples/network/http/http.pro
+++ b/examples/network/http/http.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/http
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS http.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/http
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/loopback/loopback.pro b/examples/network/loopback/loopback.pro
index 88b7a8b..0a09e34 100644
--- a/examples/network/loopback/loopback.pro
+++ b/examples/network/loopback/loopback.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/loopback
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS loopback.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/loopback
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro
index 5d5efea..6967228 100644
--- a/examples/network/network-chat/network-chat.pro
+++ b/examples/network/network-chat/network-chat.pro
@@ -17,3 +17,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/network-chat
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS network-chat.pro *.chat
sources.path = $$[QT_INSTALL_EXAMPLES]/network/network-chat
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/network.pro b/examples/network/network.pro
index 8c45745..9e48e9a 100644
--- a/examples/network/network.pro
+++ b/examples/network/network.pro
@@ -1,10 +1,10 @@
TEMPLATE = subdirs
SUBDIRS = blockingfortuneclient \
- broadcastreceiver \
+ broadcastreceiver \
broadcastsender \
network-chat \
- download \
- downloadmanager \
+ download \
+ downloadmanager \
fortuneclient \
fortuneserver \
ftp \
@@ -12,7 +12,9 @@ SUBDIRS = blockingfortuneclient \
loopback \
threadedfortuneserver \
googlesuggest \
- torrent
+ torrent
+
+symbian: SUBDIRS = ftp
contains(QT_CONFIG, openssl):SUBDIRS += securesocketclient
@@ -20,3 +22,5 @@ contains(QT_CONFIG, openssl):SUBDIRS += securesocketclient
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS network.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/network
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/securesocketclient/securesocketclient.pro b/examples/network/securesocketclient/securesocketclient.pro
index 4d70a71..2e9141d 100644
--- a/examples/network/securesocketclient/securesocketclient.pro
+++ b/examples/network/securesocketclient/securesocketclient.pro
@@ -14,3 +14,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/securesocketclient
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.png *.jpg images
sources.path = $$[QT_INSTALL_EXAMPLES]/network/securesocketclient
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF67 \ No newline at end of file
diff --git a/examples/network/securesocketclient/sslclient.cpp b/examples/network/securesocketclient/sslclient.cpp
index bf8443d..b2f3dd4 100644
--- a/examples/network/securesocketclient/sslclient.cpp
+++ b/examples/network/securesocketclient/sslclient.cpp
@@ -145,7 +145,9 @@ void SslClient::socketEncrypted()
if (!padLock) {
padLock = new QToolButton;
padLock->setIcon(QIcon(":/encrypted.png"));
+#ifndef QT_NO_CURSOR
padLock->setCursor(Qt::ArrowCursor);
+#endif
padLock->setToolTip(tr("Display encryption details."));
int extent = form->hostNameEdit->height() - 2;
diff --git a/examples/network/threadedfortuneserver/threadedfortuneserver.pro b/examples/network/threadedfortuneserver/threadedfortuneserver.pro
index 0867dac..94543bf 100644
--- a/examples/network/threadedfortuneserver/threadedfortuneserver.pro
+++ b/examples/network/threadedfortuneserver/threadedfortuneserver.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/threadedfortuneserver
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS threadedfortuneserver.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/network/threadedfortuneserver
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/network/torrent/torrent.pro b/examples/network/torrent/torrent.pro
index 10b2672..bfd5767 100644
--- a/examples/network/torrent/torrent.pro
+++ b/examples/network/torrent/torrent.pro
@@ -35,3 +35,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES torrent.pro *.torrent
sources.files += icons forms 3rdparty
sources.path = $$[QT_INSTALL_EXAMPLES]/network/torrent
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/2dpainting/2dpainting.pro b/examples/opengl/2dpainting/2dpainting.pro
index c45b764..01df1da 100644
--- a/examples/opengl/2dpainting/2dpainting.pro
+++ b/examples/opengl/2dpainting/2dpainting.pro
@@ -15,3 +15,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/2dpainting
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS 2dpainting.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/2dpainting
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/framebufferobject/bubbles.svg b/examples/opengl/framebufferobject/bubbles.svg
index 65867da..3d7971d 100644
--- a/examples/opengl/framebufferobject/bubbles.svg
+++ b/examples/opengl/framebufferobject/bubbles.svg
@@ -78,10 +78,6 @@
<!-- Define a shadow for each sphere. -->
<circle id="shadow" fill="url(#shadowGrad)" cx="0" cy="0" r="100" />
<g id="bubble">
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
<circle cx="0" cy="0" r="100" />
</g>
</defs>
@@ -180,15 +176,6 @@
</g>
</g>
<g transform="translate(200,0)" >
- <g transform="translate(200,490) scale(2.0,1.0) rotate(45)" >
- <rect fill="#a6ce39" x="-69" y="-69" width="138" height="138" />
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
- <animateTransform attributeName="transform" type="rotate" values="0; 360"
- begin="0s" dur="10s" fill="freeze" repeatCount="indefinite" />
- </g>
<g transform="translate(200,375)">
<use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
<circle fill="url(#blueSphere)" cx="0" cy="0" r="100" />
diff --git a/examples/opengl/framebufferobject/framebufferobject.pro b/examples/opengl/framebufferobject/framebufferobject.pro
index 4bc667c..a5927ec 100644
--- a/examples/opengl/framebufferobject/framebufferobject.pro
+++ b/examples/opengl/framebufferobject/framebufferobject.pro
@@ -20,3 +20,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.png *.svg
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/framebufferobject
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/opengl/framebufferobject2/framebufferobject2.pro b/examples/opengl/framebufferobject2/framebufferobject2.pro
index 9f1644c..076f98c 100644
--- a/examples/opengl/framebufferobject2/framebufferobject2.pro
+++ b/examples/opengl/framebufferobject2/framebufferobject2.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/framebufferobject2
sources.files = $$SOURCES $$HEADERS $$RESOURCES framebufferobject2.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/framebufferobject2
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/grabber/grabber.pro b/examples/opengl/grabber/grabber.pro
index 15eaf02..23a0c4a 100644
--- a/examples/opengl/grabber/grabber.pro
+++ b/examples/opengl/grabber/grabber.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/grabber
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS grabber.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/grabber
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/hellogl/glwidget.cpp b/examples/opengl/hellogl/glwidget.cpp
index d81e7e6..fbca829 100644
--- a/examples/opengl/hellogl/glwidget.cpp
+++ b/examples/opengl/hellogl/glwidget.cpp
@@ -183,46 +183,30 @@ GLuint GLWidget::makeObject()
glBegin(GL_QUADS);
- GLdouble x1 = +0.06;
- GLdouble y1 = -0.14;
- GLdouble x2 = +0.14;
- GLdouble y2 = -0.06;
- GLdouble x3 = +0.08;
- GLdouble y3 = +0.00;
- GLdouble x4 = +0.30;
- GLdouble y4 = +0.22;
-
- quad(x1, y1, x2, y2, y2, x2, y1, x1);
- quad(x3, y3, x4, y4, y4, x4, y3, x3);
-
- extrude(x1, y1, x2, y2);
- extrude(x2, y2, y2, x2);
- extrude(y2, x2, y1, x1);
- extrude(y1, x1, x1, y1);
- extrude(x3, y3, x4, y4);
- extrude(x4, y4, y4, x4);
- extrude(y4, x4, y3, x3);
-
const double Pi = 3.14159265358979323846;
const int NumSectors = 200;
- for (int i = 0; i < NumSectors; ++i) {
- double angle1 = (i * 2 * Pi) / NumSectors;
- GLdouble x5 = 0.30 * sin(angle1);
- GLdouble y5 = 0.30 * cos(angle1);
- GLdouble x6 = 0.20 * sin(angle1);
- GLdouble y6 = 0.20 * cos(angle1);
+ for (int j = 0; j < 2; ++j) {
+ double r = 0.1 + (j * 0.2);
+
+ for (int i = 0; i < NumSectors; ++i) {
+ double angle1 = (i * 2 * Pi) / NumSectors;
+ GLdouble x5 = (r + 0.1) * sin(angle1);
+ GLdouble y5 = (r + 0.1) * cos(angle1);
+ GLdouble x6 = r * sin(angle1);
+ GLdouble y6 = r * cos(angle1);
- double angle2 = ((i + 1) * 2 * Pi) / NumSectors;
- GLdouble x7 = 0.20 * sin(angle2);
- GLdouble y7 = 0.20 * cos(angle2);
- GLdouble x8 = 0.30 * sin(angle2);
- GLdouble y8 = 0.30 * cos(angle2);
+ double angle2 = ((i + 1) * 2 * Pi) / NumSectors;
+ GLdouble x7 = r * sin(angle2);
+ GLdouble y7 = r * cos(angle2);
+ GLdouble x8 = (r + 0.1) * sin(angle2);
+ GLdouble y8 = (r + 0.1) * cos(angle2);
- quad(x5, y5, x6, y6, x7, y7, x8, y8);
+ quad(x5, y5, x6, y6, x7, y7, x8, y8);
- extrude(x6, y6, x7, y7);
- extrude(x8, y8, x5, y5);
+ extrude(x6, y6, x7, y7);
+ extrude(x8, y8, x5, y5);
+ }
}
glEnd();
diff --git a/examples/opengl/hellogl/hellogl.pro b/examples/opengl/hellogl/hellogl.pro
index ce9c8e8..77034cc 100644
--- a/examples/opengl/hellogl/hellogl.pro
+++ b/examples/opengl/hellogl/hellogl.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/opengl.pro b/examples/opengl/opengl.pro
index a4c2a22..7b76d86 100644
--- a/examples/opengl/opengl.pro
+++ b/examples/opengl/opengl.pro
@@ -27,3 +27,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS opengl.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/overpainting/overpainting.pro b/examples/opengl/overpainting/overpainting.pro
index b8e79eb..3603260 100644
--- a/examples/opengl/overpainting/overpainting.pro
+++ b/examples/opengl/overpainting/overpainting.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/overpainting
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS overpainting.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/overpainting
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/pbuffers/pbuffers.pro b/examples/opengl/pbuffers/pbuffers.pro
index c1060e2..72f20f8 100644
--- a/examples/opengl/pbuffers/pbuffers.pro
+++ b/examples/opengl/pbuffers/pbuffers.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers
sources.files = $$SOURCES $$HEADERS $$RESOURCES pbuffers.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/pbuffers2/bubbles.svg b/examples/opengl/pbuffers2/bubbles.svg
index 65867da..3d7971d 100644
--- a/examples/opengl/pbuffers2/bubbles.svg
+++ b/examples/opengl/pbuffers2/bubbles.svg
@@ -78,10 +78,6 @@
<!-- Define a shadow for each sphere. -->
<circle id="shadow" fill="url(#shadowGrad)" cx="0" cy="0" r="100" />
<g id="bubble">
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
<circle cx="0" cy="0" r="100" />
</g>
</defs>
@@ -180,15 +176,6 @@
</g>
</g>
<g transform="translate(200,0)" >
- <g transform="translate(200,490) scale(2.0,1.0) rotate(45)" >
- <rect fill="#a6ce39" x="-69" y="-69" width="138" height="138" />
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
- <animateTransform attributeName="transform" type="rotate" values="0; 360"
- begin="0s" dur="10s" fill="freeze" repeatCount="indefinite" />
- </g>
<g transform="translate(200,375)">
<use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
<circle fill="url(#blueSphere)" cx="0" cy="0" r="100" />
diff --git a/examples/opengl/pbuffers2/pbuffers2.pro b/examples/opengl/pbuffers2/pbuffers2.pro
index cbd0cb5..7f12483 100644
--- a/examples/opengl/pbuffers2/pbuffers2.pro
+++ b/examples/opengl/pbuffers2/pbuffers2.pro
@@ -19,3 +19,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers2
sources.files = $$SOURCES $$HEADERS $$RESOURCES pbuffers2.pro *.png *.svg
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers2
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/samplebuffers/glwidget.cpp b/examples/opengl/samplebuffers/glwidget.cpp
index 381ff95..0bc17aa 100644
--- a/examples/opengl/samplebuffers/glwidget.cpp
+++ b/examples/opengl/samplebuffers/glwidget.cpp
@@ -109,44 +109,28 @@ void GLWidget::makeObject()
QColor trolltechGreen(QColor::fromCmykF(0.40, 0.0, 1.0, 0.0));
const double Pi = 3.14159265358979323846;
const int NumSectors = 15;
- GLdouble x1 = +0.06;
- GLdouble y1 = -0.14;
- GLdouble x2 = +0.14;
- GLdouble y2 = -0.06;
- GLdouble x3 = +0.08;
- GLdouble y3 = +0.00;
- GLdouble x4 = +0.30;
- GLdouble y4 = +0.22;
list = glGenLists(1);
glNewList(list, GL_COMPILE);
{
for (int i = 0; i < NumSectors; ++i) {
double angle1 = (i * 2 * Pi) / NumSectors;
- GLdouble x5 = 0.30 * sin(angle1);
- GLdouble y5 = 0.30 * cos(angle1);
- GLdouble x6 = 0.20 * sin(angle1);
- GLdouble y6 = 0.20 * cos(angle1);
+ GLdouble x1 = 0.30 * sin(angle1);
+ GLdouble y1 = 0.30 * cos(angle1);
+ GLdouble x2 = 0.20 * sin(angle1);
+ GLdouble y2 = 0.20 * cos(angle1);
double angle2 = ((i + 1) * 2 * Pi) / NumSectors;
- GLdouble x7 = 0.20 * sin(angle2);
- GLdouble y7 = 0.20 * cos(angle2);
- GLdouble x8 = 0.30 * sin(angle2);
- GLdouble y8 = 0.30 * cos(angle2);
+ GLdouble x3 = 0.20 * sin(angle2);
+ GLdouble y3 = 0.20 * cos(angle2);
+ GLdouble x4 = 0.30 * sin(angle2);
+ GLdouble y4 = 0.30 * cos(angle2);
qglColor(trolltechGreen);
- quad(GL_QUADS, x5, y5, x6, y6, x7, y7, x8, y8);
+ quad(GL_QUADS, x1, y1, x2, y2, x3, y3, x4, y4);
qglColor(Qt::black);
- quad(GL_LINE_LOOP, x5, y5, x6, y6, x7, y7, x8, y8);
+ quad(GL_LINE_LOOP, x1, y1, x2, y2, x3, y3, x4, y4);
}
-
- qglColor(trolltechGreen);
- quad(GL_QUADS, x1, y1, x2, y2, y2, x2, y1, x1);
- quad(GL_QUADS, x3, y3, x4, y4, y4, x4, y3, x3);
-
- qglColor(Qt::black);
- quad(GL_LINE_LOOP, x1, y1, x2, y2, y2, x2, y1, x1);
- quad(GL_LINE_LOOP, x3, y3, x4, y4, y4, x4, y3, x3);
}
glEndList();
}
diff --git a/examples/opengl/samplebuffers/samplebuffers.pro b/examples/opengl/samplebuffers/samplebuffers.pro
index 9eb5f58..de09a71 100644
--- a/examples/opengl/samplebuffers/samplebuffers.pro
+++ b/examples/opengl/samplebuffers/samplebuffers.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/samplebuffers
sources.files = $$SOURCES $$HEADERS samplebuffers.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/samplebuffers
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/opengl/textures/textures.pro b/examples/opengl/textures/textures.pro
index cd98a68..086c9ac 100644
--- a/examples/opengl/textures/textures.pro
+++ b/examples/opengl/textures/textures.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/textures
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS textures.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/textures
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/painting/basicdrawing/basicdrawing.pro b/examples/painting/basicdrawing/basicdrawing.pro
index 4011260..df845d9 100644
--- a/examples/painting/basicdrawing/basicdrawing.pro
+++ b/examples/painting/basicdrawing/basicdrawing.pro
@@ -10,3 +10,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting/basicdrawing
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS basicdrawing.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/basicdrawing
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A649 \ No newline at end of file
diff --git a/examples/painting/concentriccircles/concentriccircles.pro b/examples/painting/concentriccircles/concentriccircles.pro
index 093ea1c..bf8398f 100644
--- a/examples/painting/concentriccircles/concentriccircles.pro
+++ b/examples/painting/concentriccircles/concentriccircles.pro
@@ -9,3 +9,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting/concentriccircles
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS concentriccircles.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/concentriccircles
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A64A \ No newline at end of file
diff --git a/examples/painting/fontsampler/fontsampler.pro b/examples/painting/fontsampler/fontsampler.pro
index 8b63752..bc7e0a2 100644
--- a/examples/painting/fontsampler/fontsampler.pro
+++ b/examples/painting/fontsampler/fontsampler.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting/fontsampler
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fontsampler.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/fontsampler
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/painting/imagecomposition/imagecomposition.pro b/examples/painting/imagecomposition/imagecomposition.pro
index 935a1d4..66fcf6a 100644
--- a/examples/painting/imagecomposition/imagecomposition.pro
+++ b/examples/painting/imagecomposition/imagecomposition.pro
@@ -9,3 +9,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES images *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/imagecomposition
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A64B \ No newline at end of file
diff --git a/examples/painting/painterpaths/painterpaths.pro b/examples/painting/painterpaths/painterpaths.pro
index 76c9e82..6c9ba95 100644
--- a/examples/painting/painterpaths/painterpaths.pro
+++ b/examples/painting/painterpaths/painterpaths.pro
@@ -3,10 +3,14 @@ HEADERS = renderarea.h \
SOURCES = main.cpp \
renderarea.cpp \
window.cpp
-unix:!mac:LIBS += -lm
+unix:!mac:!symbian:LIBS += -lm
# install
target.path = $$[QT_INSTALL_EXAMPLES]/painting/painterpaths
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS painterpaths.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/painterpaths
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A64C \ No newline at end of file
diff --git a/examples/painting/painting.pro b/examples/painting/painting.pro
index 6d00720..59ca54e 100644
--- a/examples/painting/painting.pro
+++ b/examples/painting/painting.pro
@@ -5,7 +5,7 @@ SUBDIRS = basicdrawing \
painterpaths \
transformations
-!wince*: SUBDIRS += fontsampler
+!wince*:!symbian: SUBDIRS += fontsampler
contains(QT_CONFIG, svg): SUBDIRS += svggenerator svgviewer
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS painting.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/painting
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/painting/svggenerator/svggenerator.pro b/examples/painting/svggenerator/svggenerator.pro
index 4d08ba4..1134619 100644
--- a/examples/painting/svggenerator/svggenerator.pro
+++ b/examples/painting/svggenerator/svggenerator.pro
@@ -13,3 +13,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting/svggenerator
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS svggenerator.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/svggenerator
INSTALLS += target sources
+
+symbian:TARGET.UID3 = 0xA000CF68 \ No newline at end of file
diff --git a/examples/painting/svgviewer/files/bubbles.svg b/examples/painting/svgviewer/files/bubbles.svg
index 65867da..3d7971d 100644
--- a/examples/painting/svgviewer/files/bubbles.svg
+++ b/examples/painting/svgviewer/files/bubbles.svg
@@ -78,10 +78,6 @@
<!-- Define a shadow for each sphere. -->
<circle id="shadow" fill="url(#shadowGrad)" cx="0" cy="0" r="100" />
<g id="bubble">
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
<circle cx="0" cy="0" r="100" />
</g>
</defs>
@@ -180,15 +176,6 @@
</g>
</g>
<g transform="translate(200,0)" >
- <g transform="translate(200,490) scale(2.0,1.0) rotate(45)" >
- <rect fill="#a6ce39" x="-69" y="-69" width="138" height="138" />
- <circle fill="black" cx="0" cy="0" r="50" />
- <circle fill="#a6ce39" cx="0" cy="0" r="33" />
- <path fill="black" d="M 37,50 L 50,37 L 12,-1 L 22,-11 L 10,-24 L -24,10
- L -11,22 L -1,12 Z" />
- <animateTransform attributeName="transform" type="rotate" values="0; 360"
- begin="0s" dur="10s" fill="freeze" repeatCount="indefinite" />
- </g>
<g transform="translate(200,375)">
<use xlink:href="#shadow" transform="translate(25,55) scale(1.0,0.5)" />
<circle fill="url(#blueSphere)" cx="0" cy="0" r="100" />
diff --git a/examples/painting/svgviewer/svgviewer.pro b/examples/painting/svgviewer/svgviewer.pro
index b29e218..523dcf6 100644
--- a/examples/painting/svgviewer/svgviewer.pro
+++ b/examples/painting/svgviewer/svgviewer.pro
@@ -16,8 +16,17 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES svgviewer.pro files
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/svgviewer
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: {
addFiles.sources = files\*.svg
addFiles.path = \My Documents
DEPLOYMENT += addFiles
}
+
+symbian: {
+ TARGET.UID3 = 0xA000A64E
+ addFiles.sources = files\*.svg
+ addFiles.path = .
+ DEPLOYMENT += addFiles
+}
diff --git a/examples/painting/transformations/transformations.pro b/examples/painting/transformations/transformations.pro
index a8ff610..6e4fe4f 100644
--- a/examples/painting/transformations/transformations.pro
+++ b/examples/painting/transformations/transformations.pro
@@ -9,3 +9,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting/transformations
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS transformations.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/painting/transformations
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A64D \ No newline at end of file
diff --git a/examples/phonon/capabilities/capabilities.pro b/examples/phonon/capabilities/capabilities.pro
index 52b6b1b..7f1ca76 100644
--- a/examples/phonon/capabilities/capabilities.pro
+++ b/examples/phonon/capabilities/capabilities.pro
@@ -10,7 +10,4 @@ sources.files = $$SOURCES $$HEADERS capabilities.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/phonon/capabilities
INSTALLS += target sources
-wince*{
-DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
-}
-
+symbian:TARGET.UID3 = 0xA000CF69 \ No newline at end of file
diff --git a/examples/phonon/musicplayer/musicplayer.pro b/examples/phonon/musicplayer/musicplayer.pro
index 0a93dc2..e17d29c 100644
--- a/examples/phonon/musicplayer/musicplayer.pro
+++ b/examples/phonon/musicplayer/musicplayer.pro
@@ -14,3 +14,4 @@ wince*{
DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout
}
+symbian:TARGET.UID3 = 0xA000CF6A \ No newline at end of file
diff --git a/examples/phonon/phonon.pro b/examples/phonon/phonon.pro
index 0dea766..7bb5822 100644
--- a/examples/phonon/phonon.pro
+++ b/examples/phonon/phonon.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/phonon
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS phonon.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/phonon
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtconcurrent/imagescaling/imagescaling.pro b/examples/qtconcurrent/imagescaling/imagescaling.pro
index 0a25efb..180571c 100644
--- a/examples/qtconcurrent/imagescaling/imagescaling.pro
+++ b/examples/qtconcurrent/imagescaling/imagescaling.pro
@@ -12,4 +12,6 @@ sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/imagescaling
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: DEPLOYMENT_PLUGIN += qgif qjpeg qtiff
diff --git a/examples/qtconcurrent/map/map.pro b/examples/qtconcurrent/map/map.pro
index f20267b..cc80704 100644
--- a/examples/qtconcurrent/map/map.pro
+++ b/examples/qtconcurrent/map/map.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/map
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/map
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtconcurrent/progressdialog/progressdialog.pro b/examples/qtconcurrent/progressdialog/progressdialog.pro
index 12ba0bf..aa6a118 100644
--- a/examples/qtconcurrent/progressdialog/progressdialog.pro
+++ b/examples/qtconcurrent/progressdialog/progressdialog.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/progressdialog
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/progressdialog
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtconcurrent/qtconcurrent.pro b/examples/qtconcurrent/qtconcurrent.pro
index 5d73533..a30c0bd 100644
--- a/examples/qtconcurrent/qtconcurrent.pro
+++ b/examples/qtconcurrent/qtconcurrent.pro
@@ -13,3 +13,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qtconcurrent.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtconcurrent/runfunction/runfunction.pro b/examples/qtconcurrent/runfunction/runfunction.pro
index 9034476..58a1375 100644
--- a/examples/qtconcurrent/runfunction/runfunction.pro
+++ b/examples/qtconcurrent/runfunction/runfunction.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/runfunction
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/runfunction
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtconcurrent/wordcount/wordcount.pro b/examples/qtconcurrent/wordcount/wordcount.pro
index fba95ee..581e6c7 100644
--- a/examples/qtconcurrent/wordcount/wordcount.pro
+++ b/examples/qtconcurrent/wordcount/wordcount.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/wordcount
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/wordcount
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtestlib/qtestlib.pro b/examples/qtestlib/qtestlib.pro
index 8addbcb..70115e2 100644
--- a/examples/qtestlib/qtestlib.pro
+++ b/examples/qtestlib/qtestlib.pro
@@ -6,3 +6,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qtestlib.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/qtestlib
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qtestlib/tutorial1/tutorial1.pro b/examples/qtestlib/tutorial1/tutorial1.pro
index baa15b2..5191a3d 100644
--- a/examples/qtestlib/tutorial1/tutorial1.pro
+++ b/examples/qtestlib/tutorial1/tutorial1.pro
@@ -6,3 +6,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial1
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial1
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C60B \ No newline at end of file
diff --git a/examples/qtestlib/tutorial2/tutorial2.pro b/examples/qtestlib/tutorial2/tutorial2.pro
index 44211d8..ae66cac 100644
--- a/examples/qtestlib/tutorial2/tutorial2.pro
+++ b/examples/qtestlib/tutorial2/tutorial2.pro
@@ -6,3 +6,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial2
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial2
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C60C \ No newline at end of file
diff --git a/examples/qtestlib/tutorial3/tutorial3.pro b/examples/qtestlib/tutorial3/tutorial3.pro
index b494ba8..9fdda2a 100644
--- a/examples/qtestlib/tutorial3/tutorial3.pro
+++ b/examples/qtestlib/tutorial3/tutorial3.pro
@@ -6,3 +6,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial3
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial3
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C60D \ No newline at end of file
diff --git a/examples/qtestlib/tutorial4/tutorial4.pro b/examples/qtestlib/tutorial4/tutorial4.pro
index 0777d48..4cb7bf8 100644
--- a/examples/qtestlib/tutorial4/tutorial4.pro
+++ b/examples/qtestlib/tutorial4/tutorial4.pro
@@ -6,3 +6,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial4
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial4
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C60E \ No newline at end of file
diff --git a/examples/qtestlib/tutorial5/tutorial5.pro b/examples/qtestlib/tutorial5/tutorial5.pro
index 0310916..f988904 100644
--- a/examples/qtestlib/tutorial5/tutorial5.pro
+++ b/examples/qtestlib/tutorial5/tutorial5.pro
@@ -6,3 +6,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial5
sources.files = $$SOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial5
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C60F \ No newline at end of file
diff --git a/examples/qws/ahigl/ahigl.pro b/examples/qws/ahigl/ahigl.pro
index 1ee8e6e..c831335 100644
--- a/examples/qws/ahigl/ahigl.pro
+++ b/examples/qws/ahigl/ahigl.pro
@@ -7,6 +7,8 @@ TARGET = qahiglscreen
target.path = $$[QT_INSTALL_PLUGINS]/gfxdrivers
INSTALLS += target
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
HEADERS = qwindowsurface_ahigl_p.h \
qscreenahigl_qws.h
diff --git a/examples/qws/dbscreen/dbscreen.pro b/examples/qws/dbscreen/dbscreen.pro
index 172a02a..86152ab 100644
--- a/examples/qws/dbscreen/dbscreen.pro
+++ b/examples/qws/dbscreen/dbscreen.pro
@@ -5,6 +5,8 @@ TARGET = dbscreen
target.path += $$[QT_INSTALL_PLUGINS]/gfxdrivers
INSTALLS += target
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
HEADERS = dbscreen.h
SOURCES = dbscreendriverplugin.cpp \
dbscreen.cpp
diff --git a/examples/qws/framebuffer/framebuffer.pro b/examples/qws/framebuffer/framebuffer.pro
index f9fe850..0379908 100644
--- a/examples/qws/framebuffer/framebuffer.pro
+++ b/examples/qws/framebuffer/framebuffer.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qws/framebuffer
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS framebuffer.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qws/framebuffer
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qws/mousecalibration/mousecalibration.pro b/examples/qws/mousecalibration/mousecalibration.pro
index bd31853..6f60b6d 100644
--- a/examples/qws/mousecalibration/mousecalibration.pro
+++ b/examples/qws/mousecalibration/mousecalibration.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qws/mousecalibration
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qws/mousecalibration
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qws/qws.pro b/examples/qws/qws.pro
index fb3c3c7..e9f310f 100644
--- a/examples/qws/qws.pro
+++ b/examples/qws/qws.pro
@@ -5,3 +5,5 @@ SUBDIRS = framebuffer mousecalibration simpledecoration
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qws
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/qws/svgalib/svgalib.pro b/examples/qws/svgalib/svgalib.pro
index 8a47c1d..3ab5a19 100644
--- a/examples/qws/svgalib/svgalib.pro
+++ b/examples/qws/svgalib/svgalib.pro
@@ -7,6 +7,8 @@ TARGET = svgalibscreen
target.path = $$[QT_INSTALL_PLUGINS]/gfxdrivers
INSTALLS += target
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
HEADERS = svgalibscreen.h \
svgalibpaintengine.h \
svgalibsurface.h \
diff --git a/examples/richtext/calendar/calendar.pro b/examples/richtext/calendar/calendar.pro
index bf032f5..fb85d96 100644
--- a/examples/richtext/calendar/calendar.pro
+++ b/examples/richtext/calendar/calendar.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/richtext/calendar
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS calendar.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/calendar
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/richtext/orderform/orderform.pro b/examples/richtext/orderform/orderform.pro
index 63739b0..3875ea0 100644
--- a/examples/richtext/orderform/orderform.pro
+++ b/examples/richtext/orderform/orderform.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/richtext/orderform
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS orderform.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/orderform
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/richtext/richtext.pro b/examples/richtext/richtext.pro
index ef8f094..d48602e 100644
--- a/examples/richtext/richtext.pro
+++ b/examples/richtext/richtext.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/richtext
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS richtext.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/richtext
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro
index b861970..4b90aa3 100644
--- a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro
+++ b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro
@@ -10,6 +10,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS syntaxhighlighter.pro ex
sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/syntaxhighlighter
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: {
addFiles.sources = main.cpp mainwindow.cpp
addFiles.path = .
diff --git a/examples/script/calculator/calculator.pro b/examples/script/calculator/calculator.pro
index 226d5f4..734078c 100644
--- a/examples/script/calculator/calculator.pro
+++ b/examples/script/calculator/calculator.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/calculator
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.js *.ui
sources.path = $$[QT_INSTALL_EXAMPLES]/script/calculator
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/script/context2d/context2d.pro b/examples/script/context2d/context2d.pro
index 30ec9a7..be14272 100644
--- a/examples/script/context2d/context2d.pro
+++ b/examples/script/context2d/context2d.pro
@@ -21,3 +21,12 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/context2d
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS context2d.pro scripts
sources.path = $$[QT_INSTALL_EXAMPLES]/script/context2d
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+symbian:{
+ TARGET.UID3 = 0xA000C608
+ TARGET.EPOCHEAPSIZE = 0x200000 0xA00000
+ contextScripts.path = .
+ contextScripts.sources = scripts
+ DEPLOYMENT += contextScripts
+} \ No newline at end of file
diff --git a/examples/script/context2d/main.cpp b/examples/script/context2d/main.cpp
index 78c9df9..08744d3 100644
--- a/examples/script/context2d/main.cpp
+++ b/examples/script/context2d/main.cpp
@@ -48,6 +48,7 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
Window win;
- win.show();
+ //win.show();
+ win.showFullScreen();
return app.exec();
}
diff --git a/examples/script/context2d/qcontext2dcanvas.cpp b/examples/script/context2d/qcontext2dcanvas.cpp
index 30bb3eb..c6772ce 100644
--- a/examples/script/context2d/qcontext2dcanvas.cpp
+++ b/examples/script/context2d/qcontext2dcanvas.cpp
@@ -85,6 +85,11 @@ void QContext2DCanvas::contentsChanged(const QImage &image)
void QContext2DCanvas::paintEvent(QPaintEvent *e)
{
QPainter p(this);
+#ifdef Q_WS_S60
+// Draw white rect first since in with some themes the js-file content will produce black-on-black.
+ QBrush whiteBgBrush(Qt::white);
+ p.fillRect(e->rect(), whiteBgBrush);
+#endif
p.setClipRect(e->rect());
p.drawImage(0, 0, m_image);
}
diff --git a/examples/script/customclass/customclass.pro b/examples/script/customclass/customclass.pro
index ba7f69d..bb263d2 100644
--- a/examples/script/customclass/customclass.pro
+++ b/examples/script/customclass/customclass.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/customclass
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.pri
sources.path = $$[QT_INSTALL_EXAMPLES]/script/customclass
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/script/defaultprototypes/defaultprototypes.pro b/examples/script/defaultprototypes/defaultprototypes.pro
index b9a6765..21328e6 100644
--- a/examples/script/defaultprototypes/defaultprototypes.pro
+++ b/examples/script/defaultprototypes/defaultprototypes.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/defaultprototypes
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.js defaultprototypes.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/script/defaultprototypes
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/script/helloscript/helloscript.pro b/examples/script/helloscript/helloscript.pro
index d94a318..5b04f84 100644
--- a/examples/script/helloscript/helloscript.pro
+++ b/examples/script/helloscript/helloscript.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/helloscript
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS helloscript.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/script/helloscript
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/script/marshal/marshal.pro b/examples/script/marshal/marshal.pro
index 46b33b9..69fc578 100644
--- a/examples/script/marshal/marshal.pro
+++ b/examples/script/marshal/marshal.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/marshal
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS marshal.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/script/marshal
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/script/qscript/qscript.pro b/examples/script/qscript/qscript.pro
index 759eedf..3c03545 100644
--- a/examples/script/qscript/qscript.pro
+++ b/examples/script/qscript/qscript.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/qscript
sources.files = $$RESOURCES $$FORMS main.cpp qscript.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/script/qscript
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/script/qsdbg/qsdbg.pro b/examples/script/qsdbg/qsdbg.pro
index c199123..77b55a2 100644
--- a/examples/script/qsdbg/qsdbg.pro
+++ b/examples/script/qsdbg/qsdbg.pro
@@ -16,4 +16,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qsdbg.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/script/qsdbg
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/script/script.pro b/examples/script/script.pro
index ae3542e..c5a37ef 100644
--- a/examples/script/script.pro
+++ b/examples/script/script.pro
@@ -4,8 +4,12 @@ SUBDIRS = helloscript context2d defaultprototypes customclass
!wince*:SUBDIRS += qscript marshal
!wince*:!cross_compile:SUBDIRS += calculator qstetrix
+symbian: SUBDIRS = context2d
+
# install
target.path = $$[QT_INSTALL_EXAMPLES]/script
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS script.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/script
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/cachedtable/cachedtable.pro b/examples/sql/cachedtable/cachedtable.pro
index a14aa42..89e97ae 100644
--- a/examples/sql/cachedtable/cachedtable.pro
+++ b/examples/sql/cachedtable/cachedtable.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/cachedtable
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS cachedtable.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/cachedtable
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/drilldown/drilldown.pro b/examples/sql/drilldown/drilldown.pro
index e15a4ad..7907bd2 100644
--- a/examples/sql/drilldown/drilldown.pro
+++ b/examples/sql/drilldown/drilldown.pro
@@ -14,3 +14,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/drilldown
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS drilldown.pro *.png *.jpg images
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/drilldown
INSTALLS += target sources
+
+symbian:TARGET.UID3 = 0xA000C612
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/drilldown/informationwindow.cpp b/examples/sql/drilldown/informationwindow.cpp
index 6573ae1..ea66b0b 100644
--- a/examples/sql/drilldown/informationwindow.cpp
+++ b/examples/sql/drilldown/informationwindow.cpp
@@ -101,7 +101,9 @@ InformationWindow::InformationWindow(int id, QSqlRelationalTableModel *offices,
setWindowFlags(Qt::Window);
enableButtons(false);
setWindowTitle(tr("Office: %1").arg(locationText->text()));
+#ifndef Q_OS_SYMBIAN
resize(320, sizeHint().height());
+#endif
}
//! [4]
diff --git a/examples/sql/drilldown/main.cpp b/examples/sql/drilldown/main.cpp
index ee5a4d5..c340f5e 100644
--- a/examples/sql/drilldown/main.cpp
+++ b/examples/sql/drilldown/main.cpp
@@ -54,6 +54,10 @@ int main(int argc, char *argv[])
return 1;
View view("offices", "images");
+#ifndef Q_OS_SYMBIAN
view.show();
+#else
+ view.showFullScreen();
+#endif
return app.exec();
}
diff --git a/examples/sql/drilldown/view.cpp b/examples/sql/drilldown/view.cpp
index 763d094..778767b 100644
--- a/examples/sql/drilldown/view.cpp
+++ b/examples/sql/drilldown/view.cpp
@@ -62,10 +62,15 @@ View::View(const QString &offices, const QString &images, QWidget *parent)
QGraphicsPixmapItem *logo = scene->addPixmap(QPixmap(":/logo.png"));
logo->setPos(30, 515);
-
+
+#ifndef Q_OS_SYMBIAN
setMinimumSize(470, 620);
- setMaximumSize(470, 620);
- setWindowTitle(tr("Offices World Wide"));
+ setMaximumSize(470, 620);
+#else
+ setDragMode(QGraphicsView::ScrollHandDrag);
+#endif
+
+ setWindowTitle(tr("Offices World Wide"));
}
//! [1]
@@ -126,7 +131,11 @@ void View::showInformation(ImageItem *image)
window->raise();
window->activateWindow();
} else if (window && !window->isVisible()) {
+#ifndef Q_OS_SYMBIAN
window->show();
+#else
+ window->showFullScreen();
+#endif
} else {
InformationWindow *window;
window = new InformationWindow(id, officeTable, this);
@@ -134,8 +143,12 @@ void View::showInformation(ImageItem *image)
connect(window, SIGNAL(imageChanged(int, QString)),
this, SLOT(updateImage(int, QString)));
+#ifndef Q_OS_SYMBIAN
window->move(pos() + QPoint(20, 40));
window->show();
+#else
+ window->showFullScreen();
+#endif
informationWindows.append(window);
}
}
diff --git a/examples/sql/masterdetail/masterdetail.pro b/examples/sql/masterdetail/masterdetail.pro
index 205c544..2363e54 100644
--- a/examples/sql/masterdetail/masterdetail.pro
+++ b/examples/sql/masterdetail/masterdetail.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/masterdetail
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS masterdetail.pro *.xml images
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/masterdetail
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/querymodel/querymodel.pro b/examples/sql/querymodel/querymodel.pro
index e0e0813..f20898c 100644
--- a/examples/sql/querymodel/querymodel.pro
+++ b/examples/sql/querymodel/querymodel.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/querymodel
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS querymodel.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/querymodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/relationaltablemodel/relationaltablemodel.pro b/examples/sql/relationaltablemodel/relationaltablemodel.pro
index 38f1e21..e57729e 100644
--- a/examples/sql/relationaltablemodel/relationaltablemodel.pro
+++ b/examples/sql/relationaltablemodel/relationaltablemodel.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/relationaltablemodel
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS relationaltablemodel.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/relationaltablemodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/sql.pro b/examples/sql/sql.pro
index 6d0d402..7bdff69 100644
--- a/examples/sql/sql.pro
+++ b/examples/sql/sql.pro
@@ -1,12 +1,18 @@
TEMPLATE = subdirs
-SUBDIRS = cachedtable \
- drilldown \
- relationaltablemodel \
- sqlwidgetmapper
-!wince*: SUBDIRS += querymodel tablemodel masterdetail
+SUBDIRS = drilldown
+!symbian: SUBDIRS += cachedtable \
+ relationaltablemodel \
+ sqlwidgetmapper
+
+!wince*:!symbian: SUBDIRS += \
+ querymodel \
+ tablemodel \
+ masterdetail
# install
sources.files = connection.h sql.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/sql
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/sql/tablemodel/tablemodel.pro b/examples/sql/tablemodel/tablemodel.pro
index 4d099d0..7adf40c 100644
--- a/examples/sql/tablemodel/tablemodel.pro
+++ b/examples/sql/tablemodel/tablemodel.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/tablemodel
sources.files = $$SOURCES *.h $$RESOURCES $$FORMS tablemodel.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/tablemodel
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/threads/mandelbrot/mandelbrot.pro b/examples/threads/mandelbrot/mandelbrot.pro
index 437f449..8f552a8 100644
--- a/examples/threads/mandelbrot/mandelbrot.pro
+++ b/examples/threads/mandelbrot/mandelbrot.pro
@@ -4,10 +4,12 @@ SOURCES = main.cpp \
mandelbrotwidget.cpp \
renderthread.cpp
-unix:!mac:LIBS += -lm
+unix:!mac:!symbian:LIBS += -lm
# install
target.path = $$[QT_INSTALL_EXAMPLES]/threads/mandelbrot
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mandelbrot.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/threads/mandelbrot
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/threads/semaphores/semaphores.pro b/examples/threads/semaphores/semaphores.pro
index 2e468b7..5331383 100644
--- a/examples/threads/semaphores/semaphores.pro
+++ b/examples/threads/semaphores/semaphores.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/threads/semaphores
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS semaphores.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/threads/semaphores
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/threads/threads.pro b/examples/threads/threads.pro
index a2ccfa7..a0e69c8 100644
--- a/examples/threads/threads.pro
+++ b/examples/threads/threads.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/threads
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS threads.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/threads
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/threads/waitconditions/waitconditions.pro b/examples/threads/waitconditions/waitconditions.pro
index 8c34cec..49fe318 100644
--- a/examples/threads/waitconditions/waitconditions.pro
+++ b/examples/threads/waitconditions/waitconditions.pro
@@ -10,11 +10,13 @@ INCLUDEPATH += .
# Input
SOURCES += waitconditions.cpp
CONFIG += qt warn_on create_prl link_prl console
-OBJECTS_DIR=.obj/debug-shared
-MOC_DIR=.moc/debug-shared
+OBJECTS_DIR=obj/debug-shared
+MOC_DIR=moc/debug-shared
# install
target.path = $$[QT_INSTALL_EXAMPLES]/threads/waitconditions
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS waitconditions.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/threads/waitconditions
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/codecs/codecs.pro b/examples/tools/codecs/codecs.pro
index 6ae225a..7cc0ae8 100644
--- a/examples/tools/codecs/codecs.pro
+++ b/examples/tools/codecs/codecs.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/codecs
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS encodedfiles codecs.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/codecs
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/completer/completer.pro b/examples/tools/completer/completer.pro
index 4ac5084..4f31454 100644
--- a/examples/tools/completer/completer.pro
+++ b/examples/tools/completer/completer.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/completer
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS completer.pro resources
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/completer
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/customcompleter/customcompleter.pro b/examples/tools/customcompleter/customcompleter.pro
index ebaa831..8a11cf1 100644
--- a/examples/tools/customcompleter/customcompleter.pro
+++ b/examples/tools/customcompleter/customcompleter.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS customcompleter.pro resources
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/customcompleter
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/echoplugin/echoplugin.pro b/examples/tools/echoplugin/echoplugin.pro
index 998f25c..6146b49 100644
--- a/examples/tools/echoplugin/echoplugin.pro
+++ b/examples/tools/echoplugin/echoplugin.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS echoplugin.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/echoplugin/echowindow/echowindow.pro b/examples/tools/echoplugin/echowindow/echowindow.pro
index fb1cea9..142438b 100644
--- a/examples/tools/echoplugin/echowindow/echowindow.pro
+++ b/examples/tools/echoplugin/echowindow/echowindow.pro
@@ -16,3 +16,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS echowindow.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin/echowindow
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/echoplugin/plugin/plugin.pro b/examples/tools/echoplugin/plugin/plugin.pro
index 5c0c5af..d943425 100644
--- a/examples/tools/echoplugin/plugin/plugin.pro
+++ b/examples/tools/echoplugin/plugin/plugin.pro
@@ -13,3 +13,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin/plugin
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS plugin.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/echoplugin/plugin
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.EPOCALLOWDLLDATA = 1
diff --git a/examples/tools/i18n/i18n.pro b/examples/tools/i18n/i18n.pro
index 0ef9a0b..a065611 100644
--- a/examples/tools/i18n/i18n.pro
+++ b/examples/tools/i18n/i18n.pro
@@ -24,3 +24,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/i18n
sources.files = $$SOURCES $$HEADERS $$RESOURCES translations i18n.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/i18n
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/plugandpaint/plugandpaint.pro b/examples/tools/plugandpaint/plugandpaint.pro
index 15bc21e..fef1b86 100644
--- a/examples/tools/plugandpaint/plugandpaint.pro
+++ b/examples/tools/plugandpaint/plugandpaint.pro
@@ -7,7 +7,11 @@ SOURCES = main.cpp \
mainwindow.cpp \
paintarea.cpp \
plugindialog.cpp
-LIBS = -L$${QT_BUILD_TREE}/examples/tools/plugandpaint/plugins -lpnp_basictools
+symbian {
+ LIBS = -lpnp_basictools.lib
+} else {
+ LIBS = -L$${QT_BUILD_TREE}/examples/tools/plugandpaint/plugins -lpnp_basictools
+}
if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
mac:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)_debug
@@ -20,3 +24,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaint
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS plugandpaint.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaint
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/plugandpaintplugins/basictools/basictools.pro b/examples/tools/plugandpaintplugins/basictools/basictools.pro
index f015fdc..f9cd4a6 100644
--- a/examples/tools/plugandpaintplugins/basictools/basictools.pro
+++ b/examples/tools/plugandpaintplugins/basictools/basictools.pro
@@ -13,3 +13,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaint/plugins
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS basictools.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaintplugins/basictools
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro
index 3cf2b66..7fbb6d1 100644
--- a/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro
+++ b/examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro
@@ -13,3 +13,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaint/plugins
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS extrafilters.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaintplugins/extrafilters
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.EPOCALLOWDLLDATA = 1
diff --git a/examples/tools/plugandpaintplugins/plugandpaintplugins.pro b/examples/tools/plugandpaintplugins/plugandpaintplugins.pro
index 89e8b7e..ccc042c 100644
--- a/examples/tools/plugandpaintplugins/plugandpaintplugins.pro
+++ b/examples/tools/plugandpaintplugins/plugandpaintplugins.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaintplugins
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS plugandpaintplugins.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/plugandpaintplugins
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/regexp/regexp.pro b/examples/tools/regexp/regexp.pro
index 15ca9a4..bbb3fd3 100644
--- a/examples/tools/regexp/regexp.pro
+++ b/examples/tools/regexp/regexp.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/regexp
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS regexp.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/regexp
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/settingseditor/settingseditor.pro b/examples/tools/settingseditor/settingseditor.pro
index 321c2bb..c6838bc 100644
--- a/examples/tools/settingseditor/settingseditor.pro
+++ b/examples/tools/settingseditor/settingseditor.pro
@@ -13,3 +13,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/settingseditor
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS settingseditor.pro inifiles
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/settingseditor
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/styleplugin/plugin/plugin.pro b/examples/tools/styleplugin/plugin/plugin.pro
index 1e84e3c..2a36d51 100644
--- a/examples/tools/styleplugin/plugin/plugin.pro
+++ b/examples/tools/styleplugin/plugin/plugin.pro
@@ -19,3 +19,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin/styles
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS plugin.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin/plugin
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.EPOCALLOWDLLDATA = 1
diff --git a/examples/tools/styleplugin/styleplugin.pro b/examples/tools/styleplugin/styleplugin.pro
index bf4fa5c..74f77b5 100644
--- a/examples/tools/styleplugin/styleplugin.pro
+++ b/examples/tools/styleplugin/styleplugin.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS styleplugin.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/styleplugin/stylewindow/stylewindow.pro b/examples/tools/styleplugin/stylewindow/stylewindow.pro
index 7c5266d..df68168 100644
--- a/examples/tools/styleplugin/stylewindow/stylewindow.pro
+++ b/examples/tools/styleplugin/stylewindow/stylewindow.pro
@@ -15,3 +15,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS stylewindow.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/styleplugin/stylewindow
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/tools.pro b/examples/tools/tools.pro
index c694dd8..b1509dc 100644
--- a/examples/tools/tools.pro
+++ b/examples/tools/tools.pro
@@ -21,3 +21,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tools.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/tools
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/treemodelcompleter/treemodelcompleter.pro b/examples/tools/treemodelcompleter/treemodelcompleter.pro
index 8631e2b..ef5c0cb 100644
--- a/examples/tools/treemodelcompleter/treemodelcompleter.pro
+++ b/examples/tools/treemodelcompleter/treemodelcompleter.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/treemodelcompleter
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS treemodelcompleter.pro resources
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/treemodelcompleter
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tools/undoframework/undoframework.pro b/examples/tools/undoframework/undoframework.pro
index 42010f5..f797eb5 100644
--- a/examples/tools/undoframework/undoframework.pro
+++ b/examples/tools/undoframework/undoframework.pro
@@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tools/undoframework
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS undoframework.pro README images
sources.path = $$[QT_INSTALL_EXAMPLES]/tools/undoframework
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/addressbook.pro b/examples/tutorials/addressbook/addressbook.pro
index 4607c25..8e98593 100644
--- a/examples/tutorials/addressbook/addressbook.pro
+++ b/examples/tutorials/addressbook/addressbook.pro
@@ -6,3 +6,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS addressbook.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part1/part1.pro b/examples/tutorials/addressbook/part1/part1.pro
index bb181dd..505f814 100644
--- a/examples/tutorials/addressbook/part1/part1.pro
+++ b/examples/tutorials/addressbook/part1/part1.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part1
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part1.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part1
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part2/part2.pro b/examples/tutorials/addressbook/part2/part2.pro
index 01ce344..fdc0079 100644
--- a/examples/tutorials/addressbook/part2/part2.pro
+++ b/examples/tutorials/addressbook/part2/part2.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part2
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part2.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part2
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part3/part3.pro b/examples/tutorials/addressbook/part3/part3.pro
index 128c038..6e33cb8 100644
--- a/examples/tutorials/addressbook/part3/part3.pro
+++ b/examples/tutorials/addressbook/part3/part3.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part3
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part3.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part3
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part4/part4.pro b/examples/tutorials/addressbook/part4/part4.pro
index 23ce3e6..0cfb546 100644
--- a/examples/tutorials/addressbook/part4/part4.pro
+++ b/examples/tutorials/addressbook/part4/part4.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part4
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part4.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part4
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part5/part5.pro b/examples/tutorials/addressbook/part5/part5.pro
index 95123d0..92e3d51 100644
--- a/examples/tutorials/addressbook/part5/part5.pro
+++ b/examples/tutorials/addressbook/part5/part5.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part5
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part5.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part5
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part6/part6.pro b/examples/tutorials/addressbook/part6/part6.pro
index dc895613..1b57b16 100644
--- a/examples/tutorials/addressbook/part6/part6.pro
+++ b/examples/tutorials/addressbook/part6/part6.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part6
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part6.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part6
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/addressbook/part7/part7.pro b/examples/tutorials/addressbook/part7/part7.pro
index a726d91..fc47fae 100644
--- a/examples/tutorials/addressbook/part7/part7.pro
+++ b/examples/tutorials/addressbook/part7/part7.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part7
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS part7.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/addressbook/part7
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/tutorials/tutorials.pro b/examples/tutorials/tutorials.pro
index 8b3f41f..427dc03 100644
--- a/examples/tutorials/tutorials.pro
+++ b/examples/tutorials/tutorials.pro
@@ -6,3 +6,5 @@ SUBDIRS = \
sources.files = README *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials
INSTALLS += sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/uitools/multipleinheritance/multipleinheritance.pro b/examples/uitools/multipleinheritance/multipleinheritance.pro
index 92dda2e..5340ac5 100644
--- a/examples/uitools/multipleinheritance/multipleinheritance.pro
+++ b/examples/uitools/multipleinheritance/multipleinheritance.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/uitools/multipleinheritance
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/uitools/multipleinheritance
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/uitools/textfinder/textfinder.pro b/examples/uitools/textfinder/textfinder.pro
index 9d2a96d..f4f14e1 100644
--- a/examples/uitools/textfinder/textfinder.pro
+++ b/examples/uitools/textfinder/textfinder.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/uitools/textfinder
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro forms
sources.path = $$[QT_INSTALL_EXAMPLES]/uitools/textfinder
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/uitools/uitools.pro b/examples/uitools/uitools.pro
index ddec822..78c15fa 100644
--- a/examples/uitools/uitools.pro
+++ b/examples/uitools/uitools.pro
@@ -1,10 +1,12 @@
TEMPLATE = subdirs
SUBDIRS = multipleinheritance
-!wince*:contains(QT_BUILD_PARTS, tools): SUBDIRS += textfinder
+!wince*:!symbian:contains(QT_BUILD_PARTS, tools): SUBDIRS += textfinder
# install
target.path = $$[QT_INSTALL_EXAMPLES]/uitools
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS uitools.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/uitools
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/webkit/fancybrowser/fancybrowser.pro b/examples/webkit/fancybrowser/fancybrowser.pro
index 3de3036..e496241 100644
--- a/examples/webkit/fancybrowser/fancybrowser.pro
+++ b/examples/webkit/fancybrowser/fancybrowser.pro
@@ -1,4 +1,4 @@
-QT += webkit
+QT += webkit network
HEADERS = mainwindow.h
SOURCES = main.cpp \
mainwindow.cpp
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/webkit/fancybrowser
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/fancybrowser
INSTALLS += target sources
+
+symbian:TARGET.UID3 = 0xA000CF6C
diff --git a/examples/webkit/formextractor/formextractor.pro b/examples/webkit/formextractor/formextractor.pro
index d2cb240..33e2267 100644
--- a/examples/webkit/formextractor/formextractor.pro
+++ b/examples/webkit/formextractor/formextractor.pro
@@ -1,4 +1,4 @@
-QT += webkit
+QT += webkit network
TARGET = formExtractor
TEMPLATE = app
SOURCES += main.cpp \
@@ -14,3 +14,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/webkit/formextractor
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro form.html images
sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/formextractor
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF6D
diff --git a/examples/webkit/googlechat/googlechat.pro b/examples/webkit/googlechat/googlechat.pro
index 14b7085..8e4f9a6 100644
--- a/examples/webkit/googlechat/googlechat.pro
+++ b/examples/webkit/googlechat/googlechat.pro
@@ -1,4 +1,4 @@
-QT += webkit
+QT += webkit network
HEADERS = googlechat.h
SOURCES = main.cpp \
googlechat.cpp
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/webkit/googlechat
sources.files = $$SOURCES $$HEADERS $$FORMS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/googlechat
INSTALLS += target sources
+
+symbian:TARGET.UID3 = 0xA000CF6E
diff --git a/examples/webkit/previewer/previewer.pro b/examples/webkit/previewer/previewer.pro
index 75ab6fb..cc7fb73 100644
--- a/examples/webkit/previewer/previewer.pro
+++ b/examples/webkit/previewer/previewer.pro
@@ -1,4 +1,4 @@
-QT += webkit
+QT += webkit network
HEADERS = previewer.h \
mainwindow.h
SOURCES = main.cpp \
@@ -11,3 +11,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/webkit/previewer
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/previewer
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF6F
diff --git a/examples/webkit/webkit.pro b/examples/webkit/webkit.pro
index 225816a..5c954c2 100644
--- a/examples/webkit/webkit.pro
+++ b/examples/webkit/webkit.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/webkit
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS webkit.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/webkit
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/analogclock/analogclock.pro b/examples/widgets/analogclock/analogclock.pro
index 62a1806..9865a11 100644
--- a/examples/widgets/analogclock/analogclock.pro
+++ b/examples/widgets/analogclock/analogclock.pro
@@ -7,3 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/analogclock
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS analogclock.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/analogclock
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000A64F \ No newline at end of file
diff --git a/examples/widgets/calculator/calculator.pro b/examples/widgets/calculator/calculator.pro
index a9a50d6..178f43e 100644
--- a/examples/widgets/calculator/calculator.pro
+++ b/examples/widgets/calculator/calculator.pro
@@ -9,3 +9,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/calculator
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS calculator.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/calculator
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C602 \ No newline at end of file
diff --git a/examples/widgets/calendarwidget/calendarwidget.pro b/examples/widgets/calendarwidget/calendarwidget.pro
index 9326989..63c154b 100644
--- a/examples/widgets/calendarwidget/calendarwidget.pro
+++ b/examples/widgets/calendarwidget/calendarwidget.pro
@@ -7,3 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/calendarwidget
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS calendarwidget.pro resources
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/calendarwidget
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C603 \ No newline at end of file
diff --git a/examples/widgets/charactermap/charactermap.pro b/examples/widgets/charactermap/charactermap.pro
index fe0733d..9763287 100644
--- a/examples/widgets/charactermap/charactermap.pro
+++ b/examples/widgets/charactermap/charactermap.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/charactermap
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS charactermap.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/charactermap
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/digitalclock/digitalclock.pro b/examples/widgets/digitalclock/digitalclock.pro
index b87b4a0..b7c8e09 100644
--- a/examples/widgets/digitalclock/digitalclock.pro
+++ b/examples/widgets/digitalclock/digitalclock.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/digitalclock
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS digitalclock.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/digitalclock
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/groupbox/groupbox.pro b/examples/widgets/groupbox/groupbox.pro
index 7175f66..8d09f5f 100644
--- a/examples/widgets/groupbox/groupbox.pro
+++ b/examples/widgets/groupbox/groupbox.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/groupbox
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS groupbox.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/groupbox
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/icons/icons.pro b/examples/widgets/icons/icons.pro
index 3b432d9..ea9c848 100644
--- a/examples/widgets/icons/icons.pro
+++ b/examples/widgets/icons/icons.pro
@@ -14,6 +14,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS icons.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/icons
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: {
imageFiles.sources = images/*
wincewm*: {
diff --git a/examples/widgets/imageviewer/imageviewer.pro b/examples/widgets/imageviewer/imageviewer.pro
index 31c9d47..597d95b 100644
--- a/examples/widgets/imageviewer/imageviewer.pro
+++ b/examples/widgets/imageviewer/imageviewer.pro
@@ -8,6 +8,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS imageviewer.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/imageviewer
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: {
DEPLOYMENT_PLUGIN += qjpeg qmng qgif
}
diff --git a/examples/widgets/lineedits/lineedits.pro b/examples/widgets/lineedits/lineedits.pro
index e963024..5347148 100644
--- a/examples/widgets/lineedits/lineedits.pro
+++ b/examples/widgets/lineedits/lineedits.pro
@@ -7,3 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/lineedits
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS lineedits.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/lineedits
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C604 \ No newline at end of file
diff --git a/examples/widgets/movie/movie.pro b/examples/widgets/movie/movie.pro
index 6aa5780..fe011d2 100644
--- a/examples/widgets/movie/movie.pro
+++ b/examples/widgets/movie/movie.pro
@@ -8,6 +8,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES movie.pro animation.mng
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/movie
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: {
addFiles.sources += *.mng
addFiles.path = .
diff --git a/examples/widgets/scribble/scribble.pro b/examples/widgets/scribble/scribble.pro
index 21f24cc..a9190f7 100644
--- a/examples/widgets/scribble/scribble.pro
+++ b/examples/widgets/scribble/scribble.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/scribble
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS scribble.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/scribble
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/shapedclock/shapedclock.pro b/examples/widgets/shapedclock/shapedclock.pro
index 6ef5dd0..c4d48f6 100644
--- a/examples/widgets/shapedclock/shapedclock.pro
+++ b/examples/widgets/shapedclock/shapedclock.pro
@@ -7,3 +7,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/shapedclock
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS shapedclock.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/shapedclock
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C605 \ No newline at end of file
diff --git a/examples/widgets/sliders/sliders.pro b/examples/widgets/sliders/sliders.pro
index b845554..742fc27 100644
--- a/examples/widgets/sliders/sliders.pro
+++ b/examples/widgets/sliders/sliders.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/sliders
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS sliders.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/sliders
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/softkeys/main.cpp b/examples/widgets/softkeys/main.cpp
new file mode 100644
index 0000000..a544b28
--- /dev/null
+++ b/examples/widgets/softkeys/main.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+#include "softkeys.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ MainWindow mw;
+ mw.showMaximized();
+ return app.exec();
+}
diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp
new file mode 100644
index 0000000..110f2e6
--- /dev/null
+++ b/examples/widgets/softkeys/softkeys.cpp
@@ -0,0 +1,161 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "softkeys.h"
+
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent)
+{
+ central = new QWidget(this);
+ central->setContextMenuPolicy(Qt::NoContextMenu); // explicitly forbid usage of context menu so actions item is not shown menu
+ setCentralWidget(central);
+
+ // Create text editor and set softkeys to it
+ textEditor= new QTextEdit(tr("Navigate in UI to see context sensitive softkeys in action"), this);
+ QAction* menu = new QAction(tr("Menu"), this);
+ menu->setSoftKeyRole(QAction::MenuSoftKey);
+ QAction* clear = new QAction(tr("Clear"), this);
+ clear->setSoftKeyRole(QAction::CancelSoftKey);
+
+ QList<QAction*> textEditorSoftKeys;
+ textEditorSoftKeys.append(menu);
+ textEditorSoftKeys.append(clear);
+ textEditor->setSoftKeys(textEditorSoftKeys);
+
+ infoLabel = new QLabel(tr(""), this);
+ infoLabel->setContextMenuPolicy(Qt::NoContextMenu);
+
+ toggleButton = new QPushButton(tr("Custom softkeys"), this);
+ toggleButton->setContextMenuPolicy(Qt::NoContextMenu);
+ toggleButton->setCheckable(true);
+
+ pushButton = new QPushButton(tr("Open File Dialog"), this);
+ pushButton->setContextMenuPolicy(Qt::NoContextMenu);
+
+ QComboBox* comboBox = new QComboBox(this);
+ comboBox->setContextMenuPolicy(Qt::NoContextMenu);
+ comboBox->insertItems(0, QStringList()
+ << QApplication::translate("MainWindow", "Selection1", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "Selection2", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("MainWindow", "Selection3", 0, QApplication::UnicodeUTF8)
+ );
+
+ layout = new QVBoxLayout;
+ layout->addWidget(textEditor);
+ layout->addWidget(infoLabel);
+ layout->addWidget(toggleButton);
+ layout->addWidget(pushButton);
+ layout->addWidget(comboBox);
+ central->setLayout(layout);
+
+ fileMenu = menuBar()->addMenu(tr("&File"));
+ exit = new QAction(tr("&Exit"), this);
+ fileMenu->addAction(exit);
+
+ connect(clear, SIGNAL(triggered()), this, SLOT(clearTextEditor()));
+ connect(pushButton, SIGNAL(clicked()), this, SLOT(openDialog()));
+ connect(exit, SIGNAL(triggered()), this, SLOT(exitApplication()));
+ connect(toggleButton, SIGNAL(clicked()), this, SLOT(setCustomSoftKeys()));
+ pushButton->setFocus();
+}
+
+MainWindow::~MainWindow()
+{
+}
+
+void MainWindow::clearTextEditor()
+{
+ textEditor->setText(tr(""));
+}
+
+void MainWindow::openDialog()
+{
+ QFileDialog::getOpenFileName(this);
+}
+
+void MainWindow::addSoftKeys()
+{
+ ok = new QAction(tr("Ok"), this);
+ ok->setSoftKeyRole(QAction::OkSoftKey);
+ connect(ok, SIGNAL(triggered()), this, SLOT(okPressed()));
+
+ cancel = new QAction(tr("Cancel"), this);
+ cancel->setSoftKeyRole(QAction::CancelSoftKey);
+ connect(cancel, SIGNAL(triggered()), this, SLOT(cancelPressed()));
+
+ QList<QAction*> softkeys;
+ softkeys.append(ok);
+ softkeys.append(cancel);
+ QWidget* focusWidget = QApplication::focusWidget();
+ if (focusWidget)
+ focusWidget->setSoftKeys(softkeys);
+}
+
+void MainWindow::setCustomSoftKeys()
+{
+ if (toggleButton->isChecked()) {
+ infoLabel->setText(tr("Custom softkeys set"));
+ addSoftKeys();
+ }
+ else {
+ infoLabel->setText(tr("Custom softkeys removed"));
+ QWidget* focusWidget = QApplication::focusWidget();
+ if (focusWidget)
+ focusWidget->setSoftKey(0);
+ }
+}
+
+void MainWindow::exitApplication()
+{
+ qApp->exit();
+}
+
+void MainWindow::okPressed()
+{
+ infoLabel->setText(tr("OK pressed"));
+}
+
+void MainWindow::cancelPressed()
+{
+ infoLabel->setText(tr("Cancel pressed"));
+}
+
+
diff --git a/examples/widgets/softkeys/softkeys.h b/examples/widgets/softkeys/softkeys.h
new file mode 100644
index 0000000..da56eae
--- /dev/null
+++ b/examples/widgets/softkeys/softkeys.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the examples 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SOFTKEYS_H
+#define SOFTKEYS_H
+
+#include <QtGui>
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+public:
+
+private slots:
+ void clearTextEditor();
+ void openDialog();
+ void addSoftKeys();
+ void exitApplication();
+ void okPressed();
+ void cancelPressed();
+ void setCustomSoftKeys();
+public:
+ MainWindow(QWidget *parent = 0);
+ ~MainWindow();
+private:
+ QVBoxLayout *layout;
+ QWidget *central;
+ QTextEdit* textEditor;
+ QLabel *infoLabel;
+ QPushButton* toggleButton;
+ QPushButton* pushButton;
+ QMenu* fileMenu;
+ QAction* addSoftKeysAct;
+ QAction* exit;
+ QAction* ok;
+ QAction* cancel;
+};
+
+//! [0]
+class SoftKey : public QWidget
+{
+ Q_OBJECT
+public:
+ SoftKey(QWidget *parent = 0);
+};
+//! [0]
+
+#endif
diff --git a/examples/widgets/softkeys/softkeys.pro b/examples/widgets/softkeys/softkeys.pro
new file mode 100644
index 0000000..9a0feea
--- /dev/null
+++ b/examples/widgets/softkeys/softkeys.pro
@@ -0,0 +1,14 @@
+HEADERS = softkeys.h
+SOURCES += \
+ main.cpp \
+ softkeys.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/widgets/softkeys
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS softkeys.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/softkeys
+INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000CF6B
diff --git a/examples/widgets/spinboxes/spinboxes.pro b/examples/widgets/spinboxes/spinboxes.pro
index 4edb79a..b859ab7 100644
--- a/examples/widgets/spinboxes/spinboxes.pro
+++ b/examples/widgets/spinboxes/spinboxes.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/spinboxes
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS spinboxes.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/spinboxes
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/styles/styles.pro b/examples/widgets/styles/styles.pro
index 4c6c682..8918d21 100644
--- a/examples/widgets/styles/styles.pro
+++ b/examples/widgets/styles/styles.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/styles
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS styles.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/styles
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/stylesheet/stylesheet.pro b/examples/widgets/stylesheet/stylesheet.pro
index 9a64c00..71dfc6d 100644
--- a/examples/widgets/stylesheet/stylesheet.pro
+++ b/examples/widgets/stylesheet/stylesheet.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/stylesheet
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro images layouts qss
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/stylesheet
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/tablet/tablet.pro b/examples/widgets/tablet/tablet.pro
index 27d8d2c..ee25888 100644
--- a/examples/widgets/tablet/tablet.pro
+++ b/examples/widgets/tablet/tablet.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tablet
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tablet.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/tablet
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/tetrix/tetrix.pro b/examples/widgets/tetrix/tetrix.pro
index 59392fa..2223b86 100644
--- a/examples/widgets/tetrix/tetrix.pro
+++ b/examples/widgets/tetrix/tetrix.pro
@@ -11,3 +11,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tetrix
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tetrix.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/tetrix
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C606 \ No newline at end of file
diff --git a/examples/widgets/tooltips/tooltips.pro b/examples/widgets/tooltips/tooltips.pro
index 9f0bf41..0eca4c8 100644
--- a/examples/widgets/tooltips/tooltips.pro
+++ b/examples/widgets/tooltips/tooltips.pro
@@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tooltips
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tooltips.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/tooltips
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/validators/validators.pro b/examples/widgets/validators/validators.pro
index 8e7884d..d7f9dde 100644
--- a/examples/widgets/validators/validators.pro
+++ b/examples/widgets/validators/validators.pro
@@ -19,3 +19,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/validators
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/validators
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro
index 0af83c7..399a3ac 100644
--- a/examples/widgets/widgets.pro
+++ b/examples/widgets/widgets.pro
@@ -22,6 +22,16 @@ SUBDIRS = analogclock \
wiggly \
windowflags
+symbian: SUBDIRS = \
+ analogclock \
+ calculator \
+ calendarwidget \
+ lineedits \
+ shapedclock \
+ tetrix \
+ wiggly \
+ softkeys
+
contains(styles, motif): SUBDIRS += styles
# install
@@ -29,3 +39,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS widgets.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/widgets/wiggly/dialog.cpp b/examples/widgets/wiggly/dialog.cpp
index 2f4191d..4df6aac 100644
--- a/examples/widgets/wiggly/dialog.cpp
+++ b/examples/widgets/wiggly/dialog.cpp
@@ -45,7 +45,7 @@
#include "wigglywidget.h"
//! [0]
-Dialog::Dialog(QWidget *parent)
+Dialog::Dialog(QWidget *parent, bool smallScreen)
: QDialog(parent)
{
WigglyWidget *wigglyWidget = new WigglyWidget;
@@ -58,9 +58,12 @@ Dialog::Dialog(QWidget *parent)
connect(lineEdit, SIGNAL(textChanged(QString)),
wigglyWidget, SLOT(setText(QString)));
-
- lineEdit->setText(tr("Hello world!"));
-
+ if (!smallScreen){
+ lineEdit->setText(tr("Hello world!"));
+ }
+ else{
+ lineEdit->setText(tr("Hello!"));
+ }
setWindowTitle(tr("Wiggly"));
resize(360, 145);
}
diff --git a/examples/widgets/wiggly/dialog.h b/examples/widgets/wiggly/dialog.h
index 9c209e1..70ab11f 100644
--- a/examples/widgets/wiggly/dialog.h
+++ b/examples/widgets/wiggly/dialog.h
@@ -50,7 +50,7 @@ class Dialog : public QDialog
Q_OBJECT
public:
- Dialog(QWidget *parent = 0);
+ Dialog(QWidget *parent = 0, bool smallScreen = false);
};
//! [0]
diff --git a/examples/widgets/wiggly/main.cpp b/examples/widgets/wiggly/main.cpp
index 872dce6..ef6ec4d 100644
--- a/examples/widgets/wiggly/main.cpp
+++ b/examples/widgets/wiggly/main.cpp
@@ -46,8 +46,16 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
-
- Dialog dialog;
- dialog.show();
+ bool smallScreen = false;
+ for (int i=0; i<argc; i++)
+ if (QString(argv[i]) == "-small-screen")
+ smallScreen = true;
+ Dialog dialog(0,smallScreen);
+ if (!smallScreen){
+ dialog.show();
+ }
+ else{
+ dialog.showFullScreen();
+ }
return app.exec();
}
diff --git a/examples/widgets/wiggly/wiggly.pro b/examples/widgets/wiggly/wiggly.pro
index 5288dd3..4240765 100644
--- a/examples/widgets/wiggly/wiggly.pro
+++ b/examples/widgets/wiggly/wiggly.pro
@@ -9,3 +9,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/wiggly
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS wiggly.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/wiggly
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C607 \ No newline at end of file
diff --git a/examples/widgets/windowflags/windowflags.pro b/examples/widgets/windowflags/windowflags.pro
index fa8a567..007c10a 100644
--- a/examples/widgets/windowflags/windowflags.pro
+++ b/examples/widgets/windowflags/windowflags.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/windowflags
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS windowflags.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/windowflags
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro
index e55754f..f38321f 100644
--- a/examples/xml/dombookmarks/dombookmarks.pro
+++ b/examples/xml/dombookmarks/dombookmarks.pro
@@ -11,6 +11,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS dombookmarks.pro *.xbel
sources.path = $$[QT_INSTALL_EXAMPLES]/xml/dombookmarks
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: {
addFiles.sources = frank.xbel jennifer.xbel
addFiles.path = \My Documents
diff --git a/examples/xml/htmlinfo/apache_org.html b/examples/xml/htmlinfo/apache_org.html
new file mode 100644
index 0000000..9e5e4d3
--- /dev/null
+++ b/examples/xml/htmlinfo/apache_org.html
@@ -0,0 +1,281 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <!--
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ This file is generated from XML source: DO NOT EDIT!
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ -->
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <link rel="stylesheet" href="./style/compressed.css" type="text/css" media="screen, projection"/>
+ <link rel="stylesheet" href="./style/style.css" type="text/css" media="screen, projection"/>
+ <!--[if IE]><link rel="stylesheet" href="./style/ie.css" type="text/css" media="screen, projection"/><![endif]-->
+<link rel="alternate" title="announce@apache.org Archives" type="application/atom+xml" href="http://mail-archives.apache.org/mod_mbox/www-announce/?format=atom" />
+ <meta name="author" content="The Apache Software Foundation" /><meta name="email" content="apache.AT.apache.DOT.org" />
+ <title>Welcome! - The Apache Software Foundation</title>
+ </head>
+ <body>
+ <div class="navigation">
+ <ul>
+ <li><a href="./foundation" title="About the Foundation">Foundation</a></li>
+ <li><a href="http://projects.apache.org" title="Apache Projects">Projects</a></li>
+ <li><a href="http://people.apache.org" title="Apache People">People</a></li>
+ <li><a href="./foundation/getinvolved.html" title="Get involved in Apache">Get Involved</a></li>
+ <li><a href="./foundation/sponsorship.html" title="Support the mission of Apache">Support Apache</a></li>
+ <li class="dlink"><a href="./dyn/closer.cgi" title="Download Apache projects">Download</a></li>
+ </ul>
+ </div>
+ <div class="container">
+ <hr class="space col"/>
+ <div class="block">
+ <div class="column span-24">
+ <div id="header">
+ <h1>The Apache Software Foundation<br />
+ <span class="alt"><small>Meritocracy in Action.</small></span></h1><p class="blurb">The Apache Software Foundation provides support for the Apache community of open-source software projects. The <a href="http://projects.apache.org/">Apache projects</a> are characterized by a collaborative, consensus based development process, an open and pragmatic software license, and a desire to create high quality software that leads the way in its field.</p><p class="highlight">We consider ourselves not simply a group of projects sharing a server, but rather a <em>community of developers and users</em>.</p>
+ </div>
+ </div>
+ </div>
+ <hr/>
+ <div class="block">
+ <div class="column span-15 first append-1">
+ <h3>
+ Latest News
+ </h3>
+ </div>
+ <div class="column span-8 las search">
+ <form action="http://www.google.com/search" method="get">
+ <input value="*.apache.org" name="sitesearch" type="hidden"/>
+ <input size="10" name="q" id="query" type="text"/>
+ <input name="Search" value="Go" type="submit"/>
+ </form>
+ </div>
+ </div>
+ <div class="block content">
+ <div class="column span-15 colborder">
+
+<div class="section-content">
+<p><em>If you would like to keep up with news and announcements from the
+foundation and all its projects, you can subscribe to the
+<a href="foundation/mailinglists.html#foundation-announce">Apache
+Announcements List</a></em>.</p>
+
+<h4 id="apachecon-eu">
+ Free Video Streams from ApacheCon Europe 2008
+</h4>
+<div class="section-content">
+<a href="http://www.eu.apachecon.com/"><img src="images/eu_2008_logo.jpg" alt="ApacheCon Europe 2008" title="ApacheCon Europe 2008" border="0" align="right" /></a>
+<p>
+ApacheCon Europe 2008 held in Amsterdam was a great success, and attracted higher
+than ever attendance figures, with about 500 registered attendees. This
+figure represents an increase of more than 40% over the previous year,
+demonstrating the rapidly growing interest in Apache and Open Source software
+amongst European businesses.
+
+If you have not been able to attend ApacheCon Europe, you can still watch
+<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm">videos of all keynotes and select talks online</a>. Keynote sessions
+and the opening plenary are available <b>free of charge</b>:</p>
+<ul>
+<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/jjagielski/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">State of the Feather</a>
+ by Jim Jagielski, Chairman of the Apache Software Foundation</li>
+<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/cschmidt/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">Using Audio Technology and Open Content to Reduce Global Illiteracy, Poverty and Disease</a>
+ by Cliff Schmidt, Executive Director of Literacy Bridge</li>
+<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/rghosh/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">Apache and Steam Engines: the Magic of Collaborative Innovation</a>
+ by Rishab Aiyer Ghosh, Open Source Initiative Board Member</li>
+<li><a href="http://streaming.linux-magazin.de/events/apacheconfree/archive/rfielding/frames-java.htm" onclick="window.open(this.href, '_blank', 'width=1024, height=768'); return false;">Apache 3.0 (a Tall Tale)</a>
+ by Roy Fielding, Co-founder of The Apache Software Foundation,
+ and Vice President, Apache HTTP Server</li>
+</ul>
+<p>The talks of the following select ApacheCon Europe tracks are
+available for just 49 Euro:
+<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm#wednesday">System Administration</a>,
+<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm#thursday">Web Security</a>,
+<a href="http://streaming.linux-magazin.de/en/archive_apachecon08eu.htm#friday">Web Services and Web 2.0</a>.
+</p>
+<hr />
+</div>
+
+<h4 id="apachecon-us">
+ ApacheCon US 2008 in New Orleans!
+</h4>
+<div class="section-content">
+<p>
+ ApacheCon US 2008 will be held 3 November through 7 November in
+ New Orleans, Louisiana.
+ The Call for Papers has already closed and the program and further
+ information will be made available soon on the ApacheCon US 2008
+ Web site <a href="http://www.us.apachecon.com/us2008/"><strong>www.us.apachecon.com</strong></a>.
+ If you would like to receive information about ApacheCon US 2008, please
+ <a href="mailto:announce-subscribe@apachecon.com">subscribe to
+ the ApacheCon announcement mailing list</a>.
+ </p>
+<hr />
+</div>
+
+<h4 id="sun_jck_letter">
+ Notice regarding open letter to Sun Microsystems
+</h4>
+<div class="section-content">
+<p>
+ The Apache Software Foundation has written an <a href="jcp/sunopenletter.html">open letter</a>
+ to Sun Microsystems regarding our inabillity to acquire an acceptable license for the test kit
+ for Java SE needed by <a href="http://harmony.apache.org">Apache Harmony</a>. For futher information
+ please see the <a href="jcp/sunopenletterfaq.html">FAQ</a> and direct all questions to Apache's VP
+ for JCP issues, geirm at apache dot org, or our regular press inquiry address, press at apache dot org.
+ </p>
+</div>
+</div>
+ </div>
+ <div class="column span-8 last">
+ <div class="block">
+ <div class="nav column span-11">
+ <div>
+ <div class="menuheader"><a
+href="http://projects.apache.org/">Apache Projects</a></div>
+ <ul>
+ <li><a href="http://httpd.apache.org/" title="Apache Web Server (httpd)">HTTP Server</a></li>
+ <li><a href="http://activemq.apache.org/" title="Distributed Messaging System">ActiveMQ</a></li>
+ <li><a href="http://ant.apache.org/" title="Java-based build tool">Ant</a></li>
+ <li><a href="http://apr.apache.org/" title="Apache Portable Runtime libraries">APR</a></li>
+ <li><a href="http://archiva.apache.org/" title="Build Artifact Repository Manager">Archiva</a></li>
+ <li><a href="http://beehive.apache.org/" title="Metadata frameworks for enterprise applications">Beehive</a></li>
+ <li><a href="http://cayenne.apache.org/" title="User-friendly Java ORM with Tools">Cayenne</a></li>
+ <li><a href="http://cocoon.apache.org/" title="Web development framework: separation of concerns, component-based">Cocoon</a></li>
+ <li><a href="http://commons.apache.org/" title="Reusable Java components">Commons</a></li>
+ <li><a href="http://continuum.apache.org/" title="Continuous Integration and Build Server">Continuum</a></li>
+ <li><a href="http://cxf.apache.org/" title="Service Framework">CXF</a></li>
+ <li><a href="http://db.apache.org/" title="Database access">DB</a></li>
+ <li><a href="http://directory.apache.org/" title="Apache Directory Server">Directory</a></li>
+ <li><a href="http://excalibur.apache.org/" title="Embeddable software libraries related to component and service management access">Excalibur</a></li>
+ <li><a href="http://felix.apache.org/" title="OSGi Framework and components.">Felix</a></li>
+ <li><a href="http://forrest.apache.org/" title="Aggregated multi-channel documentation, separation of concerns">Forrest</a></li>
+ <li><a href="http://geronimo.apache.org/" title="Java2, Enterprise Edition (J2EE) container">Geronimo</a></li>
+ <li><a href="http://gump.apache.org/" title="Continuous integration of open source projects">Gump</a></li>
+ <li><a href="http://hadoop.apache.org/" title="Distributed computing platform">Hadoop</a></li>
+ <li><a href="http://harmony.apache.org/" title="Open source implementation of Java SE">Harmony</a></li>
+ <li><a href="http://hivemind.apache.org/" title="A services and configuration microkernel">HiveMind</a></li>
+ <li><a href="http://hc.apache.org/" title="Java toolset of low level HTTP components">HttpComponents</a></li>
+ <li><a href="http://ibatis.apache.org/" title="SQL Data Mapper for Java and .NET">iBATIS</a></li>
+ <li><a href="http://incubator.apache.org/" title="Shepherd for new projects">Incubator</a></li>
+ <li><a href="http://jackrabbit.apache.org/" title="Content Repository for Java">Jackrabbit</a></li>
+ <li><a href="http://jakarta.apache.org/" title="Server-side Java">Jakarta</a></li>
+ <li><a href="http://james.apache.org/" title="Java Apache Mail Enterprise Server">James</a></li>
+ <li><a href="http://labs.apache.org/" title="The Innovation Laboratories of the Apache Software Foundation">Labs</a></li>
+ <li><a href="http://lenya.apache.org/" title="Content Management System">Lenya</a></li>
+ <li><a href="http://logging.apache.org/" title="Cross-language logging services">Logging</a></li>
+ <li><a href="http://lucene.apache.org/" title="Search engine library">Lucene</a></li>
+ <li><a href="http://maven.apache.org/" title="Java project management and comprehension tools">Maven</a></li>
+ <li><a href="http://mina.apache.org/" title="Multipurpose Infrastructure for Network Application">Mina</a></li>
+ <li><a href="http://myfaces.apache.org/" title="JavaServer(tm) Faces implementation and components">MyFaces</a></li>
+ <li><a href="http://ode.apache.org/" title="Orchestration Director Engine: Business Process Management (BPM), Process Orchestration and Workflow through service compositioni.">ODE</a></li>
+ <li><a href="http://ofbiz.apache.org/" title="Open for Business: enterprise automation software">OFBiz</a></li>
+ <li><a href="http://openejb.apache.org/" title="OpenEJB: a modular, configurable, and extendable EJB Container System and Server">OpenEJB</a></li>
+ <li><a href="http://openjpa.apache.org/" title="OpenJPA: Object Relational Mapping for Java">OpenJPA</a></li>
+ <li><a href="http://perl.apache.org/" title="Dynamic websites using Perl">Perl</a></li>
+ <li><a href="http://poi.apache.org/" title="Java API for OLE 2 Compound Documents">POI</a></li>
+ <li><a href="http://portals.apache.org/" title="Portal technology">Portals</a></li>
+ <li><a href="http://roller.apache.org/" title="Java blog server">Roller</a></li>
+ <li><a href="http://santuario.apache.org/" title="XML Security in Java and C++">Santuario</a></li>
+ <li><a href="http://servicemix.apache.org/" title="Enterprise Service Bus">ServiceMix</a></li>
+ <li><a href="http://shale.apache.org/" title="Web application framework based on JavaServer(tm) Faces">Shale</a></li>
+ <li><a href="http://spamassassin.apache.org/" title="Mail filter to identify spam">SpamAssassin</a></li>
+ <li><a href="http://stdcxx.apache.org/" title="Apache C++ Standard Library">STDCXX</a></li>
+ <li><a href="http://struts.apache.org/" title="Model 2 framework for building Java web applications">Struts</a></li>
+ <li><a href="http://synapse.apache.org/" title="Enterprise Service Bus and Mediation Framework">Synapse</a></li>
+ <li><a href="http://tapestry.apache.org/" title="Component-based Java Web Application Framework">Tapestry</a></li>
+ <li><a href="http://tcl.apache.org/" title="Dynamic websites using TCL">TCL</a></li>
+ <li><a href="http://tiles.apache.org/" title="A templating framework for web application user interfaces">Tiles</a></li>
+ <li><a href="http://tomcat.apache.org/" title="A Java Servlet and JSP Container">Tomcat</a></li>
+ <li><a href="http://turbine.apache.org/" title="A Java Servlet Web Application Framework and associated component library">
+ Turbine</a></li>
+ <li><a href="http://velocity.apache.org/" title="A Java Templating Engine">Velocity</a></li>
+ <li><a href="http://wicket.apache.org/" title="Component-based Java Web Application Framework.">Wicket</a></li>
+ <li><a href="http://ws.apache.org/">Web Services</a></li>
+ <li><a href="http://xalan.apache.org/" title="XSLT processors in Java and C++">Xalan</a></li>
+ <li><a href="http://xerces.apache.org/" title="XML parsers in Java, C++ and Perl">Xerces</a></li>
+ <li><a href="http://xml.apache.org/" title="XML solutions focused on the web">XML</a></li>
+ <li><a href="http://xmlbeans.apache.org/" title="XML-Java binding tool">XMLBeans</a></li>
+ <li><a href="http://xmlgraphics.apache.org/" title="Conversion from XML to graphical output">XML Graphics</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="nav column prepend-1 span-12 last">
+ <h6><a
+href="/foundation/">Foundation</a></h6>
+ <ul>
+ <li><a href="/foundation/faq.html">FAQ</a></li>
+ <li><a href="/licenses/">Licenses</a></li>
+ <li><a href="/foundation/news.html">News</a></li>
+ <li><a href="/foundation/records/">Public Records</a></li>
+ <li><a href="/foundation/sponsorship.html">Sponsorship</a></li>
+ <li><a href="/foundation/contributing.html">Donations</a></li>
+ <li><a href="/foundation/thanks.html">Thanks</a></li>
+ <li><a href="/foundation/contact.html">Contact</a></li>
+ </ul>
+ <h6>Foundation Projects</h6>
+ <ul>
+ <li><a href="/foundation/conferences.html" title="Meetings of developers and users">Conferences</a></li>
+ <li><a href="/dev/" title="ASF Infrastructure: Operations and howto documents for PMCs and contributors">Infrastructure</a></li>
+ <li><a href="/jcp/" title="Apache and the Java Community Process">JCP</a></li>
+ </ul>
+ <h6>How it works</h6>
+ <ul>
+ <li><a href="/foundation/how-it-works.html">Introduction</a></li>
+ <li><a href="/foundation/how-it-works.html#meritocracy">Meritocracy</a></li>
+ <li><a href="/foundation/how-it-works.html#structure">Structure</a></li>
+ <li><a href="/foundation/how-it-works.html#roles">Roles</a></li>
+ <li><a href="/foundation/how-it-works.html#management">Collaboration</a></li>
+ <li><a href="/foundation/how-it-works.html#infrastructure">Infrastructure</a></li>
+ <li><a href="/foundation/how-it-works.html#incubator">Incubator</a></li>
+ <li><a href="/foundation/how-it-works.html#other">Other entities</a></li>
+ <li><a href="/foundation/glossary.html">Glossary</a></li>
+ <li><a href="/foundation/voting.html">Voting</a></li>
+ </ul>
+ <h6><a
+href="/foundation/getinvolved.html">Get Involved</a></h6>
+ <ul>
+ <li><a href="/foundation/mailinglists.html">Mailing Lists</a></li>
+ <li><a href="/dev/version-control.html">Version Control</a></li>
+ <li><a href="/dev/">Developer Info</a></li>
+ </ul>
+ <h6>Download</h6>
+ <ul>
+ <li><a href="/dyn/closer.cgi">from a mirror</a></li>
+ </ul>
+ <h6>Related Sites</h6>
+ <ul>
+ <li><a href="http://apachecon.com/" title="Official Apache Conference">ApacheCon</a></li>
+ <li><a href="http://apachebookstore.com/" title="Apache Books">Bookstore</a></li>
+ <li><a href="http://feathercast.org/" title="Apache Podcasts">Feathercast</a></li>
+ <li><a href="http://planetapache.org/" title="Apache Community Blogs">PlanetApache</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div class="column span-24 footer">
+ <hr/>
+ <p>Copyright &#169; 2008 The Apache Software Foundation, Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
+ </div>
+ </div>
+ </div>
+</body>
+</html>
+
diff --git a/examples/xml/htmlinfo/htmlinfo.pro b/examples/xml/htmlinfo/htmlinfo.pro
new file mode 100644
index 0000000..d828518
--- /dev/null
+++ b/examples/xml/htmlinfo/htmlinfo.pro
@@ -0,0 +1,18 @@
+SOURCES += main.cpp
+QT -= gui
+
+wince*|symbian:{
+ htmlfiles.sources = *.html
+ htmlfiles.path = .
+ DEPLOYMENT += htmlfiles
+}
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/xml/htmlinfo
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.html htmlinfo.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/xml/htmlinfo
+INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
+symbian:TARGET.UID3 = 0xA000C609
diff --git a/examples/xml/htmlinfo/main.cpp b/examples/xml/htmlinfo/main.cpp
new file mode 100644
index 0000000..72aef81
--- /dev/null
+++ b/examples/xml/htmlinfo/main.cpp
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore>
+
+void parseHtmlFile(QTextStream &out, const QString &fileName) {
+ QFile file(fileName);
+
+ out << "Analysis of HTML file: " << fileName << endl;
+
+ if (!file.open(QIODevice::ReadOnly)) {
+ out << " Couldn't open the file." << endl << endl << endl;
+ return;
+ }
+
+//! [0]
+ QXmlStreamReader reader(&file);
+//! [0]
+
+//! [1]
+ int paragraphCount = 0;
+ QStringList links;
+ QString title;
+ while (!reader.atEnd()) {
+ reader.readNext();
+ if (reader.isStartElement()) {
+ if (reader.name() == "title")
+ title = reader.readElementText();
+ else if(reader.name() == "a")
+ links.append(reader.attributes().value("href").toString());
+ else if(reader.name() == "p")
+ ++paragraphCount;
+ }
+ }
+//! [1]
+
+//! [2]
+ if (reader.hasError()) {
+ out << " The HTML file isn't well-formed: " << reader.errorString()
+ << endl << endl << endl;
+ return;
+ }
+//! [2]
+
+ out << " Title: \"" << title << "\"" << endl
+ << " Number of paragraphs: " << paragraphCount << endl
+ << " Number of links: " << links.size() << endl
+ << " Showing first few links:" << endl;
+
+ while(links.size() > 5)
+ links.removeLast();
+
+ foreach(QString link, links)
+ out << " " << link << endl;
+ out << endl << endl;
+}
+
+int main(int argc, char **argv)
+{
+ // intialize QtCore application
+ QCoreApplication app(argc, argv);
+
+ // get a list of all html files in the current directory
+ QStringList filter;
+ filter << "*.htm";
+ filter << "*.html";
+ QStringList htmlFiles = QDir::current().entryList(filter, QDir::Files);
+
+ QTextStream out(stdout);
+
+ if (htmlFiles.isEmpty()) {
+ out << "No html files available.";
+ return 1;
+ }
+
+ // parse each html file and write the result to file/stream
+ foreach(QString file, htmlFiles)
+ parseHtmlFile(out, file);
+
+ return 0;
+}
diff --git a/examples/xml/htmlinfo/nokia_com.html b/examples/xml/htmlinfo/nokia_com.html
new file mode 100644
index 0000000..46d4c95
--- /dev/null
+++ b/examples/xml/htmlinfo/nokia_com.html
@@ -0,0 +1,215 @@
+
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+<head>
+
+
+ <!--startindex-->
+ <title>Nokia - Nokia on the Web</title>
+
+
+ <meta name="description" content="Nokia is the world's leading mobile phone supplier and a leading supplier of mobile and fixed telecom networks including related customer services."/>
+ <meta name="keywords" content="Nokia,mobile phones,cellular,telecommunications,wireless networks,datacom,GSM,multimedia terminals,handsets,customer services,press releases,financial information,student exchange,open positions,employment opportunities,career opportunities"/>
+ <meta name="modified" content=""/>
+ <meta name="category" content="Landing Page Global Flash"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="siteid" content="101"/>
+
+ <!--stopindex-->
+ <link href="/css/style_46.css" rel="stylesheet" type="text/css">
+
+ <link href="/NOKIA_COM_1/Home/Landing_page_2007/wayfinder.css" rel="stylesheet" type="text/css"/>
+
+<script type="text/javascript">
+ var useHbx = true;
+</script>
+
+
+<!--WEBSIDESTORY CODE HBX1.0 (Universal)-->
+<!--COPYRIGHT 1997-2005 WEBSIDESTORY,INC. ALL RIGHTS RESERVED. U.S.PATENT No. 6,393,479B1. MORE INFO:http://websidestory.com/privacy-->
+<script language="javascript">
+var _hbEC=0,_hbE=new Array;function _hbEvent(a,b){b=_hbE[_hbEC++]=new Object();b._N=a;b._C=0;return b;}
+var hbx=_hbEvent("pv");hbx.vpc="HBX0100u";hbx.gn="ehg-nokiafin.hitbox.com";
+
+//BEGIN EDITABLE SECTION
+//CONFIGURATION VARIABLES
+hbx.acct="DM550514HPNZ";//ACCOUNT NUMBER(S)
+hbx.pn="Home";//PAGE NAME(S)
+hbx.mlc="/Home";//MULTI-LEVEL CONTENT CATEGORY
+hbx.pndef="title";//DEFAULT PAGE NAME
+hbx.ctdef="full";//DEFAULT CONTENT CATEGORY
+
+//OPTIONAL PAGE VARIABLES
+//ACTION SETTINGS
+hbx.fv="";//FORM VALIDATION MINIMUM ELEMENTS OR SUBMIT FUNCTION NAME
+hbx.lt="none";//LINK TRACKING
+hbx.dlf="n";//DOWNLOAD FILTER
+hbx.dft="n";//DOWNLOAD FILE NAMING
+hbx.elf="n";//EXIT LINK FILTER
+
+//SEGMENTS AND FUNNELS
+hbx.seg="";//VISITOR SEGMENTATION
+hbx.fnl="";//FUNNELS
+
+//CAMPAIGNS
+hbx.cmp="";//CAMPAIGN ID
+hbx.cmpn="";//CAMPAIGN ID IN QUERY
+hbx.dcmp="";//DYNAMIC CAMPAIGN ID
+hbx.dcmpn="";//DYNAMIC CAMPAIGN ID IN QUERY
+hbx.dcmpe="";//DYNAMIC CAMPAIGN EXPIRATION
+hbx.dcmpre="";//DYNAMIC CAMPAIGN RESPONSE EXPIRATION
+hbx.hra="";//RESPONSE ATTRIBUTE
+hbx.hqsr="";//RESPONSE ATTRIBUTE IN REFERRAL QUERY
+hbx.hqsp="";//RESPONSE ATTRIBUTE IN QUERY
+hbx.hlt="";//LEAD TRACKING
+hbx.hla="";//LEAD ATTRIBUTE
+hbx.gp="";//CAMPAIGN GOAL
+hbx.gpn="";//CAMPAIGN GOAL IN QUERY
+hbx.hcn="";//CONVERSION ATTRIBUTE
+hbx.hcv="";//CONVERSION VALUE
+hbx.cp="null";//LEGACY CAMPAIGN
+hbx.cpd="";//CAMPAIGN DOMAIN
+
+//CUSTOM VARIABLES
+hbx.ci="";//CUSTOMER ID
+hbx.hc1="";//CUSTOM 1
+hbx.hc2="";//CUSTOM 2
+hbx.hc3="";//CUSTOM 3
+hbx.hc4="";//CUSTOM 4
+hbx.hrf="";//CUSTOM REFERRER
+hbx.pec="";//ERROR CODES
+
+
+var cookieName = 'MyNokia';
+var nameEQ = cookieName + "=";
+var ca = document.cookie.split(';');
+for(var i=0;i < ca.length;i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if (c.indexOf(nameEQ) == 0) {
+ hbx.ci = c.substring(nameEQ.length,c.length);
+ }
+}
+
+//INSERT CUSTOM EVENTS
+hbx.acct="DM550514HPNZ";
+hbx.mlc="/Home";
+hbx.pn="Home";
+hbx.lt="auto";
+
+
+//END EDITABLE SECTION
+
+//REQUIRED SECTION. CHANGE "YOURSERVER" TO VALID LOCATION ON YOUR WEB SERVER (HTTPS IF FROM SECURE SERVER)
+</script><script language="javascript1.1" defer src="/Hitbox/hbx_5.js"></script>
+<script language="javascript">if(navigator.appName!='Netscape'&&parseInt(navigator.appVersion)==4)document.write("<\!"+"--")</script><noscript>
+<img src="http://ehg-nokiafin.hitbox.com/HG?hc=we88&cd=1&hv=6&ce=u&hb=DM550514HPNZ&n=Home&vcon=/Home&seg=&cmp=&gp=&fnl=&pec=&dcmp=&ra=&gn=&cv=&ld=&la=&c1=&c2=&c3=&c4=&vpc=090101rn" border="0" width="1" height="1">
+</noscript><!--//-->
+
+<!--END WEBSIDESTORY CODE-->
+
+
+
+
+
+</head>
+<body lang='en'
+ style="margin: 0 0 0 0;" bgcolor="#FFFFFF" link="#0033cc" text="#000000" alink="#0033cc" vlink="#800080">
+ <div class="pagecontainer">
+
+
+<!-- start page template [Generated JSP Servlet: class=jsp_servlet._templates._page.__template6layout] -->
+
+
+
+
+
+
+
+
+
+
+ <!--startindex-->
+
+
+
+<!-- Begin template '/templates/content/plain.jsp' -->
+
+<div id="wayfinderContainer">
+ <div id="branding">
+ <img src="/NOKIA_COM_1/Home/Landing_page_2007/noflash_img/nokia_connecting_people.png" alt="Nokia - Connecting people" />
+
+ </div>
+
+ <div id="flashcontent">
+
+ <!-- main page noflash content -->
+ <div id="mainContentGlobal">
+ <div id="mainHdr"><h1>Welcome to Nokia</h1></div>
+ <div id="selectContainer">
+ <h2>Where would you like to go?</h2>
+ <div id="selectLinks">
+ <ul class="mainpage">
+ <li><a href="/A4176248">Africa</a></li>
+ <li><a href="/A4138125">Asia Pacific</a></li>
+ <li><a href="/A4138121">Europe</a></li>
+ <li><a href="/A4138127">Latin America</a></li>
+ <li><a href="/A4176245">Middle East</a></li>
+ <li><a href="/A4138126">North America</a></li>
+ </ul>
+ </div>
+ </div>
+ <!-- <a id="banner" href="http://www.nokia.com/seasonsgreetings/">Seasons Greetings</a> -->
+ </div>
+ <div id="navi">
+ <ul>
+ <li><a href="http://www.nokiaforbusiness.com/">Nokia for Business</a></li>
+ <li><a href="http://www.nokia.com/aboutnokia">About Nokia</a></li>
+ <li><a href="http://www.nokia.com/developers">Developers</a></li>
+ <li><a href="http://www.nokia.com/press">Press</a></li>
+ <li class="lastitem"><a href="http://www.nokia.com/investors">Investors</a></li>
+ <!-- <li class="lastitem"><a href="http://www.nokia.com/environment">Environment</a></li> -->
+ </ul>
+ </div>
+ <!-- noflash content ends -->
+
+ </div>
+
+ <div id="footer">
+ <ul>
+ <li><a href="http://www.nokia.com/siteterms">Site Terms</a></li>
+ <li class="lastitem"><a href="http://www.nokia.com/privacypolicy">Privacy Policy</a></li>
+ <span>Copyright &copy; 2008 Nokia. All rights reserved</span>
+ </ul>
+ <br /><br />
+ </div>
+</div>
+
+<script type="text/javascript" src="/NOKIA_COM_1/javascript/flash_detection_main.js"></script> <!-- for redirection to mobile site -->
+<script type="text/javascript" src="/EUROPE_NOKIA_COM_3/flash/swfobject.js"></script>
+<script type="text/javascript" src="/NOKIA_COM_1/javascript/cookies.js"></script>
+<script type="text/javascript" >
+ // <![CDATA[
+ var so = new SWFObject("/NOKIA_COM_1/Home/Landing_page_2007/wayfinder_assets.swf", "wayfinder", "736", "560", "7");
+ so.addParam("allowscriptaccess", "always");
+ so.addParam("base", "/NOKIA_COM_1/Home/Landing_page_2007/");
+ so.write("flashcontent");
+ // ]]>
+</script>
+
+<!-- End template '/templates/content/plain.jsp' -->
+ <!--stopindex-->
+
+
+
+
+
+ </div>
+</body>
+
+
+ </html>
+
diff --git a/examples/xml/htmlinfo/simpleexample.html b/examples/xml/htmlinfo/simpleexample.html
new file mode 100644
index 0000000..87ccf36
--- /dev/null
+++ b/examples/xml/htmlinfo/simpleexample.html
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html>
+ <head>
+ <title>Qt is cute! Frans is too!</title>
+ </head>
+ <body>
+ <p>A paragraph.</p>
+ <p>A second paragraph. Check out our <a href="http://labs.trolltech.com/">developer blogs</a></p>
+ <p>And the last paragraph. Or our <a href="http://doc.trolltech.com/">online documentation</a>.</p>
+ </body>
+</html>
diff --git a/examples/xml/htmlinfo/trolltech_com.html b/examples/xml/htmlinfo/trolltech_com.html
new file mode 100644
index 0000000..180eb74
--- /dev/null
+++ b/examples/xml/htmlinfo/trolltech_com.html
@@ -0,0 +1,955 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
+ lang="en">
+
+ <head>
+ <meta http-equiv="Content-Type"
+ content="text/html;charset=utf-8" />
+
+ <title>
+ Code Less. Create More. Deploy Everywhere.
+ &mdash;
+ Trolltech
+ </title>
+
+
+ <!-- ADD ON UPDATE -->
+
+ <meta name="author" content="Trolltech" />
+ <meta name="description"
+ content="Trolltech creates application development platforms for desktop and mobile device innovation." />
+ <meta name="keywords" content="" />
+
+<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"><!-- &nbsp;--></script>
+<script type="text/javascript">
+ <!-- Urchin script
+ _uacct = "UA-4457116-1";
+ urchinTracker();
+ -->
+ </script>
+
+ <base href="http://trolltech.com/homepage" />
+
+
+
+ <meta name="generator" content="Plone - http://plone.org" />
+
+
+ <!-- Plone ECMAScripts -->
+
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/ploneScripts2804.js">
+ </script>
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/ploneScripts0445.js">
+ </script>
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/ploneScripts5940.js">
+ </script>
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/linkpopper.js">
+ </script>
+
+
+
+ <script type="text/javascript"
+ src="http://trolltech.com/portal_javascripts/TTSkin/ploneScripts7743.js">
+ </script>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <style type="text/css"><!-- @import url(http://trolltech.com/portal_css/TTSkin/ploneStyles1145.css); --></style>
+
+
+
+
+
+
+
+
+ <style type="text/css"
+ media="screen"><!-- @import url(http://trolltech.com/portal_css/TTSkin/ploneStyles8707.css); --></style>
+
+
+
+
+
+
+
+
+
+
+ <!-- Internet Explorer CSS Fixes -->
+ <!--[if IE]>
+ <style type="text/css" media="all">@import url(http://trolltech.com/IEFixes.css);</style>
+ <![endif]-->
+
+ <link rel="shortcut icon" type="image/x-icon"
+ href="http://trolltech.com/favicon.ico" />
+
+ <link rel="home" href="http://trolltech.com"
+ title="Front page" />
+ <link rel="search"
+ href="http://trolltech.com/search_form"
+ title="Search this site" />
+ <link rel="author"
+ href="http://trolltech.com/author/admin"
+ title="Author information" />
+ <link rel="contents" href="http://trolltech.com/sitemap"
+ title="Site Map" />
+
+
+
+
+
+
+
+
+
+ <!-- Disable IE6 image toolbar -->
+ <meta http-equiv="imagetoolbar" content="no" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </head>
+
+ <body class="section-homepage" dir="ltr">
+ <div id="visual-portal-wrapper">
+ <div id="portal-top">
+
+ <div id="portal-header">
+ <a class="hiddenStructure" accesskey="2"
+ href="http://trolltech.com/#documentContent">Skip to content.</a>
+
+ <a class="hiddenStructure" accesskey="6"
+ href="http://trolltech.com/#portlet-navigation-tree">Skip to navigation</a>
+
+ <div class="middlesex">
+ <ul id="portal-siteactions">
+
+ <li id="siteaction-sitemap"><a
+ href="http://trolltech.com/sitemap" accesskey="3"
+ title="Site Map">Site Map</a></li>
+ <li id="siteaction-accessibility"><a
+ href="http://trolltech.com/accessibility-info"
+ accesskey="0" title="Accessibility">Accessibility</a></li>
+ <li id="siteaction-contact"><a
+ href="http://trolltech.com/contact" accesskey="9"
+ title="Contact">Contact</a></li>
+
+</ul>
+
+ <div id="portal-searchbox">
+ <form name="searchform"
+ action="http://trolltech.com/search"
+ style="white-space:nowrap"
+ onsubmit="return liveSearchSubmit()">
+
+ <label for="searchGadget" class="hiddenStructure">Search Site</label>
+
+ <div class="LSBox">
+ <input id="searchGadget" name="SearchableText"
+ type="text" size="15" title="Search Site"
+ accesskey="4" class="visibility:visible" />
+
+ <input class="searchButton" type="submit"
+ value="Search" />
+
+ <div class="LSResult" id="LSResult" style=""><div class="LSShadow" id="LSShadow"></div></div>
+ </div>
+ </form>
+
+ <div id="portal-advanced-search" class="hiddenStructure">
+ <a href="http://trolltech.com/search_form"
+ accesskey="5">
+ Advanced Search&hellip;
+ </a>
+ </div>
+
+</div>
+
+ <div id="country-flags">
+ <a href="/lang/cn/"><img class="flag"
+ border="0" width="30" height="20" src="chineseflag.png" /></a>
+ <a href="/lang/japanese/"><img
+ class="flag" border="0" width="30" height="20"
+ src="japaneseflag.png" /></a>
+ </div>
+ <h1 id="portal-logo">
+ <a href="http://trolltech.com" accesskey="1">Trolltech</a>
+</h1>
+
+ <div id="portal-skinswitcher">
+
+</div>
+ </div>
+
+
+ <h5 class="hiddenStructure">Sections</h5>
+ <div id="portal-globalnav">
+ <div class="middlesex">
+ <ul>
+ <li id="portaltab-index_html"
+ class="selected indextab"><a
+ href="http://trolltech.com">Home</a></li>
+
+ <li id="portaltab-products"
+ class="plain"><a
+ href="http://trolltech.com/products" title="">Products and Services</a></li>
+
+
+ <li id="portaltab-solutions"
+ class="plain"><a
+ href="http://trolltech.com/solutions" title="">Solutions</a></li>
+
+
+ <li id="portaltab-developer"
+ class="plain"><a
+ href="http://trolltech.com/developer" title="">Developer Resources</a></li>
+
+
+ <li id="portaltab-company" class="plain"><a
+ href="http://trolltech.com/company" title="">Company</a></li>
+
+
+ <li id="portaltab-downloads"
+ class="plain"><a
+ href="http://trolltech.com/downloads" title="">Downloads</a></li>
+
+
+
+
+ </ul>
+ </div>
+ </div>
+
+ </div>
+ <div id="portal-personaltools-wrapper">
+
+<h5 class="hiddenStructure">Personal tools</h5>
+
+
+</div>
+
+ <div class="middlesex">
+ <div id="portal-breadcrumbs">
+
+ <span id="breadcrumbs-you-are-here">You
+are here:</span>
+ <a href="http://trolltech.com">Home</a>
+
+
+</div>
+ </div>
+ </div>
+
+ <div class="visualClear"><!-- --></div>
+
+
+ <table id="portal-columns">
+ <tbody>
+ <tr>
+
+
+
+
+
+ <td id="portal-column-content">
+
+
+ <div id="content" class="">
+
+
+
+ <div class="documentContent" id="region-content">
+
+ <a name="documentContent"></a>
+
+
+
+
+
+
+
+
+
+
+
+ <!-- <table id="frontpagetable" cellpadding="0" cellspacing="0" tal:attributes="width pagew"> --> <!-- tal:on-error="string:replace with error template" Fetch image width here -->
+ <table id="frontpagetable" cellpadding="0"
+ cellspacing="0" width="712">
+ <tr>
+ <td colspan="2">
+
+ <h2>Trolltech provides cross-platform software solutions for:</h2>
+ <table id="fpSolutions" class="solutions" cellpadding="0" cellspacing="6" width="100%">
+ <tbody>
+ <tr>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/managing-development">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Software Development Managers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/industrial-embedded-development">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Embedded Developers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+
+ </tr>
+ <tr>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/ce-mobile-vendors">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Consumer Electronics Vendors</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/mobile-application-development">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Mobile Application Developers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+
+ </tr>
+ <tr>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/application-development">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Cross-Platform Developers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+ <td>
+ <!-- GRANTHAM STYLE -->
+ <a class="roundedButton"
+ title=""
+ href="http://trolltech.com/solutions/solutions-opensource">
+ <span class="buttonTop"><span class="roundedButtonTL"><span class="roundedButtonTR"></span></span></span>
+ <span class="buttonLeft">
+ <span class="buttonRight"><span
+ class="buttonArrow">Open Source Developers</span></span>
+ </span>
+ <span class="buttonBottom"><span class="roundedButtonBL"><span class="roundedButtonBR"></span></span></span>
+ </a>
+ <!-- OLD STYLE
+ <div class="roundedBlock"
+ tal:attributes="title python:solution.Description();
+ class python:test(repeat['solution'].odd(), 'roundedBlock odd', 'roundedBlock')">
+ <span class="portletTopLeft"></span>
+ <span class="portletTopRight"></span>
+ <div class="innerRoundedBlock">
+ <a href="#"
+ tal:attributes="href python:solution.absolute_url()">
+ <span class="arrow"></span>
+ <strong tal:content="python:solution.Title()">
+ Title
+ </strong>
+ </a>
+ </div>
+ <span class="portletBottomLeft"></span>
+ <span class="portletBottomRight"></span>
+ </div>
+ -->
+ </td>
+
+ </tr>
+ </tbody>
+ </table>
+
+ </td>
+ </tr>
+
+ <!-- BANNER -->
+
+ <tr class="minspacerow">
+ <td colspan="2">
+
+ <div id="flashcontent">
+
+
+ <!-- In case of no imagemap -->
+ <a
+ href="http://trolltech.com/products/qt/learnmore/whitepapers">
+ <img border="0"
+ src="http://trolltech.com/include/features/frontpage/whitepaper-feature/mainsplash"
+ alt="Code Less. Create More. Deploy Everywhere."
+ height="100" width="700" />
+ </a>
+
+
+ </div>
+
+
+
+ </td>
+ </tr>
+
+ <!-- Product Feature rows -->
+ <tr id="productfeatures" class="minspacerow">
+ <td style="width:350px;">
+ <div class="viewlet productviewlet">
+<p class="discreet"><a title="Downloads" href="downloads/index"><img class="image-right" src="images/frontpage/qt_download_90.png" alt="Download Qt Button: Grey BG" /></a></p>
+<h2>Qt</h2>
+<p>Qt is a cross-platform application framework.&nbsp; It includes:</p>
+<ul><li>An <a title="C++ Class Library" href="products/qt/features/library/index">intuitive class library</a></li><li>Integrated <a title="Development Tools" href="products/qt/features/tools/index">development tools</a></li><li>Support for <a title="C++ and Java Support" href="products/qt/features/language-support/index">C++ and Java development</a></li><li><a title="Cross-Platform Development" href="products/qt/features/platforms/index">Desktop and embedded</a> development support</li></ul>
+<p>&nbsp;</p>
+<p><strong><a title="Qt Cross-Platform Application Framework" href="products/qt/index"><span class="button">Learn More</span></a></strong> <strong><a title="How to order" href="products/qt/orderform"><span class="button">Buy Now</span></a></strong></p>
+<p>&nbsp;</p>
+<p>&nbsp;</p>
+<p>&nbsp;</p>
+</div>
+ </td>
+ <td style="width:350px;">
+ <div class="viewlet productviewlet">
+<p><a title="Qtopia" href="products/qtopia"><img class="image-right" src="images/frontpage/qtopia_learn_more_90.png" alt="Qtopia Learn More button 90px" /></a></p>
+<h2>Qtopia</h2>
+<p><a title="The Qtopia application platform for embedded Linux" href="products/qtopia/index">Qtopia</a> is an application platform and UI for Linux-based <a title="Qtopia Phone Edition" href="products/qtopia/qtopia-product-family/qtopia-phone-edition">mobile</a>, <a title="Qtopia Platform" href="products/qtopia/qtopia-product-family/qtopia-platform">consumer electronics</a> and <a title="Qtopia Platform" href="products/qtopia/qtopia-product-family/qtopia-platform">embedded devices</a>. Qtopia offers:</p>
+<ul><li>Rich <a href="products/qt/features/tools/index">toolkit</a> and intuitive API</li><li>Fully customizable user interface</li><li>Highly efficient development framework</li></ul>
+<p>&nbsp;</p>
+<p><strong><a title="Customer Devices" href="company/customers/customer-devices"><span class="button">Customer Devices</span></a></strong>&nbsp;<strong><a title="Purchasing Qtopia" href="products/qtopia/orderinfo"><span class="button">Buy Now</span></a></strong></p>
+</div>
+ </td>
+ </tr>
+ </table>
+
+
+
+
+
+
+
+
+
+
+
+
+ </div>
+
+ </div>
+
+
+ </td>
+
+
+
+
+ <!-- News/events -->
+ <td id="frontpage-column-two">
+
+ <div class="viewlet">
+ <h3>Quick Links</h3>
+
+
+ <!-- Smart folders -->
+
+ <!-- Links -->
+
+ <p class="smallerExtendedLink">
+ <a href="http://trolltech.com/company/careers"
+ title="Quick Links">Careers at Trolltech</a>
+ </p>
+
+
+ <p class="smallerExtendedLink">
+ <a href="http://trolltech.com/products/qt/learnmore/whitepapers"
+ title="Quick Links">Whitepapers</a>
+ </p>
+
+
+ <p class="smallerExtendedLink">
+ <a href="http://trolltech.com/products/qt/learnmore/webinars-videos"
+ title="Quick Links">Webinars and Videos</a>
+ </p>
+
+ </div>
+
+
+ <div class="viewlet">
+ <h3>Nokia Acquisition</h3>
+
+ <div class="viewletBody">
+<p class="smallerExtendedLink"><a title="Nokia Acquires Trolltech" href="../../../28012008/28012008">Learn more about Nokia's acquisition of Trolltech<br /></a></p>
+</div>
+ <!-- Smart folders -->
+
+ <!-- Links -->
+
+
+
+ </div>
+
+
+ <div class="viewlet">
+ <h3>News</h3>
+
+
+ <!-- Smart folders -->
+
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/announcements/press.2008-06-03.1419977468">Trolltech Releases Qt Jambi 4.3.5</a>
+ <!-- Dates for press release -->
+
+
+ (Jun&nbsp;03)
+ <!--(<tal:date tal:content="item_pressmonth"/>&nbsp;<tal:date tal:content="item_pressday"/>)-->
+
+
+ <!-- Dates for events -->
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/announcements/press.2008-05-28.9662742780">Trolltech releases Qt 4.3.5</a>
+ <!-- Dates for press release -->
+
+
+ (May&nbsp;28)
+ <!--(<tal:date tal:content="item_pressmonth"/>&nbsp;<tal:date tal:content="item_pressday"/>)-->
+
+
+ <!-- Dates for events -->
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/announcements/press.2008-05-14.1108908046">Award From Qt Developers Recognizes Best Open Source Development Tools</a>
+ <!-- Dates for press release -->
+
+
+ (May&nbsp;14)
+ <!--(<tal:date tal:content="item_pressmonth"/>&nbsp;<tal:date tal:content="item_pressday"/>)-->
+
+
+ <!-- Dates for events -->
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/announcements/press.2008-05-08.1819339587">Trolltech Delivered Revenues of NOK 55.6 Million</a>
+ <!-- Dates for press release -->
+
+
+ (May&nbsp;08)
+ <!--(<tal:date tal:content="item_pressmonth"/>&nbsp;<tal:date tal:content="item_pressday"/>)-->
+
+
+ <!-- Dates for events -->
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+
+ <!-- Links -->
+
+
+
+ </div>
+
+
+ <div class="viewlet">
+ <h3>Events</h3>
+
+ <div class="viewletBody">
+<p>&nbsp;</p>
+</div>
+ <!-- Smart folders -->
+
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/events/allevents/event.2008-05-15.0963129132">Qt Open Enrollment Training Class</a>
+ <!-- Dates for press release -->
+
+ <!-- Dates for events -->
+
+
+ (Jun&nbsp;09&nbsp;-&nbsp;Jun&nbsp;13)
+
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/events/allevents/event.2008-02-22.1032431617">Israel Qt User Group</a>
+ <!-- Dates for press release -->
+
+ <!-- Dates for events -->
+
+
+ (Jun&nbsp;16)
+
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+ <p class="smallerFont">
+ <span>
+ <a href="http://trolltech.com/company/newsroom/events/allevents/event.2008-05-19.5707721007">Webinar: Building Tomorrow’s Virtual Driver Control Center</a>
+ <!-- Dates for press release -->
+
+ <!-- Dates for events -->
+
+
+ (Jun&nbsp;24)
+
+
+ <!-- Dates for training -->
+
+ </span>
+ </p>
+
+ <!-- Links -->
+
+ <p class="smallerExtendedLink">
+ <a href="http://trolltech.com/company/newsroom/events"
+ title="Events">More events</a>
+ </p>
+
+
+
+ </div>
+
+ </td>
+
+
+ </tr>
+ </tbody>
+ </table>
+
+
+ <div class="visualClear"><!-- --></div>
+
+
+ <hr class="netscape4" />
+
+
+
+ <div id="portal-footer">
+
+
+<p id="bottom-navigation">
+ Trolltech&reg; - Code Less. Create More. Deploy Everywhere.
+
+ <br />
+
+ <a href="http://trolltech.com/company/contact-us/locations"
+ title="Trolltech ASA">
+ Trolltech ASA
+ </a>
+ <a href="http://trolltech.com/company/contact-us/locations"
+ title="Address: Sandakerveien 116, Oslo">
+ Sandakerveien 116, Oslo
+ </a>
+ <a href="http://trolltech.com/company/contact-us/locations"
+ class="lastNavItem" title="Phone: +47 21 60 48 00">
+ +47 21 60 48 00
+ </a>
+
+ <br />
+
+ <a href="http://trolltech.com/company/contact-us/locations"
+ title="International locations">
+ International locations
+ </a>
+ <a href="/trolltech/privacypolicy" title="Privacy policy">
+ Privacy Policy
+ </a>
+ <a href="/trolltech/copyright" title="Trolltech" class="lastNavItem"><span>2008</span> &copy; Trolltech ASA</a>
+</p>
+
+
+</div>
+
+ <div id="portal-colophon">
+
+
+ <a href="http://plone.org"
+ class="colophonIcon colophonIconPlone"
+ title="This Plone site was built using Plone CMS, the Open Source Content Management System. Click for more information.">
+ Powered by Plone CMS, the Open Source Content Management System
+ </a>
+
+
+
+ <p class="discreet">
+ This site conforms to the following standards:
+ </p>
+
+ <div class="colophonWrapper">
+ <ul>
+ <li>
+ <a href="http://www.section508.gov"
+ class="colophonIcon colophonIcon508"
+ title="This Plone site conforms to the US Government Section 508 Accessibility Guidelines.">
+ Section 508
+ </a>
+ </li>
+ <li>
+ <a href="http://www.w3.org/WAI/WCAG1AA-Conformance"
+ class="colophonIcon colophonIconWAI"
+ title="This Plone site conforms to the W3C-WAI Web Content Accessibility Guidelines.">
+ WCAG
+ </a>
+ </li>
+ <li>
+ <a href="http://validator.w3.org/check/referer"
+ class="colophonIcon colophonIconXHTML"
+ title="This Plone site is valid XHTML.">
+ Valid XHTML
+ </a>
+ </li>
+ <li>
+ <a href="http://jigsaw.w3.org/css-validator/check/referer&amp;warning=no&amp;profile=css3&amp;usermedium=all"
+ class="colophonIcon colophonIconCSS"
+ title="This Plone site was built with valid CSS.">
+ Valid CSS
+ </a>
+ </li>
+ <li>
+ <a href="http://plone.org/browsersupport"
+ class="colophonIcon colophonIconAnyBrowser"
+ title="This Plone site is usable in any web browser.">
+ Usable in any browser
+ </a>
+ </li>
+ </ul>
+ </div>
+
+ </div>
+
+ </div>
+<!-- ProspectXtractor tracker script -->
+<script type="text/javascript"><!--
+function _pxPar()
+{
+var p="";
+p+="&ref="+escape(top.document.referrer);
+p+="&dt="+escape(document.title);
+p+="&sr="+screen.width+"x"+screen.height;
+p+="&sd="+screen.colorDepth;
+p+="&fv="+_pxFV();
+return p;
+}
+function _pxFV()
+{
+var f=0,n=navigator;
+if (n.plugins && n.mimeTypes.length) {
+var x=n.plugins["Shockwave Flash"];
+if(x && x.description) {
+var y=x.description;
+f=y.charAt(y.indexOf('.')-1);
+}
+} else {
+r=false;
+for(var i=15;i>=3&&r!=true;i-=1){
+execScript('on error resume next: r=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
+f=i;
+}
+}
+return f;
+}
+document.write('<img src="http://pxreg.onlineservicesas.com/pxreg/?id=50C9FD2F-61D5-4824-B726-50D6B1F89999'+_pxPar()+'" width="1" heigth="1" />');
+//-->
+</script>
+<noscript>
+<div><img src="http://pxreg.onlineservicesas.com/pxreg/?id=50C9FD2F-61D5-4824-B726-50D6B1F89999" width="1" height="1" alt="" /></div>
+</noscript>
+<!-- END ProspectXtractor tracker script -->
+</body>
+</html>
+
diff --git a/examples/xml/htmlinfo/w3c_org.html b/examples/xml/htmlinfo/w3c_org.html
new file mode 100644
index 0000000..0fcce48
--- /dev/null
+++ b/examples/xml/htmlinfo/w3c_org.html
@@ -0,0 +1,507 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
+<head profile="http://www.w3.org/2000/08/w3c-synd/#"><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="HTML Tidy for Mac OS X (vers 1st March 2004), see www.w3.org" />
+
+<meta name="keywords" content="W3C, World Wide Web, Web, WWW, Consortium, computer, access, accessibility, semantic, worldwide, W3, HTML, XML, standard, language, technology, link, CSS, RDF, XSL, Berners-Lee, Berners, Lee, style sheet, cascading, schema, XHTML, mobile, SVG, PNG, PICS, DOM, SMIL, MathML, markup, Amaya, Jigsaw, free, open source, software" />
+<meta name="description" content="The World Wide Web Consortium (W3C) is an international consortium where Member organizations, a full-time staff, and the public work together to develop Web standards. W3C primarily pursues its mission through the creation of Web standards and guidelines designed to ensure long-term growth for the Web. Over 400 organizations are Members of the Consortium. W3C is jointly run by the MIT Computer Science and Artificial Intelligence Laboratory (MIT CSAIL) in the USA, the European Research Consortium for Informatics and Mathematics (ERCIM) headquartered in France, Keio University in Japan, and has additional Offices worldwide." />
+
+<title>World Wide Web Consortium - Web Standards</title>
+<link rel="meta" href="/Overview-about.rdf" />
+<link rel="stylesheet" type="text/css" href="/StyleSheets/home.css" />
+<link rel="bookmark" href="#technologies" title="Technologies |" />
+<link rel="bookmark" href="#news" title="News |" />
+<link rel="bookmark" href="#search" title="Search |" />
+<link rel="contents" href="#contents" title="Contents |" />
+<link rel="bookmark" href="#Offices" title="Offices |" />
+<link rel="bookmark" href="#systems" title="Systems |" />
+<link rel="bookmark" href="#donors" title="Supporters |" />
+<link rel="bookmark" href="#footnotes" title="Footnotes |" />
+<link rel="alternate" type="application/rss+xml" title="W3C Home Page News RSS Channel" href="http://www.w3.org/2000/08/w3c-synd/home.rss" />
+
+<style type="text/css">
+/**/
+ div.spot-image img {
+ margin-bottom: 20px;
+ }
+/**/
+</style>
+</head>
+
+<body>
+<h1 id="logo"><img alt="The World Wide Web Consortium (W3C)" height="48" width="315" src="/Icons/w3c_main" /></h1>
+
+<h2 id="slogan">Leading the Web to Its Full Potential...</h2>
+
+<div>
+<map name="introLinks" id="introLinks" title="Introductory Links">
+<div class="banner">
+<span class="invisible"><a class="bannerLink" title="Skip introductory links and the mission statement" href="#technologies">Skip to Technologies</a> |</span> <a class="bannerLink" title="W3C Activities" accesskey="A" href="/Consortium/activities">Activities</a> | <a class="bannerLink" title="Technical Reports and Recommendations" accesskey="T" href="/TR/">Technical Reports</a> | <a class="bannerLink" title="Alphabetical Site Index" accesskey="S" href="/Consortium/siteindex">Site Index</a> | <a class="bannerLink" title="Help for new visitors" accesskey="N" href="/Consortium/new-to-w3c">New
+Visitors</a> | <a class="bannerLink" title="About W3C" accesskey="B" href="/Consortium/">About W3C</a> | <a class="bannerLink" title="Join W3C" accesskey="J" href="/Consortium/join">Join W3C</a> |
+<a class="bannerLink" title="Contact W3C" accesskey="C" href="/Consortium/contact">Contact W3C</a>
+</div>
+</map>
+</div>
+
+<p class="small">The World Wide Web Consortium (<acronym title="World Wide Web Consortium">W3C</acronym>) develops interoperable
+technologies (specifications, guidelines, software, and tools) to lead
+the Web to its full potential. W3C is a forum for information,
+commerce, communication, and collective understanding. On this page,
+you'll find <a href="#news">W3C news</a>, links to <a href="#technologies">W3C technologies</a> and ways to <a href="#contents">get involved</a>. New visitors can find help in
+<cite><a href="/Consortium/new-to-w3c">Finding Your Way at
+W3C</a></cite>. We encourage organizations to learn more <a href="/Consortium/">about W3C</a> and <a href="/Consortium/membership">about
+W3C Membership</a>.</p>
+
+<div class="navBlock">
+<h2 class="spot-head">XML10</h2>
+
+<div class="spot">
+<div class="spot-image">
+<a href="/2008/xml10/">
+<img src="/2008/xml10/xml-10.png" width="106" height="48" alt="XML 10" />
+</a>
+</div>
+<p class="spot-block">
+To celebrate
+<a href="/2008/xml10/">ten years of XML</a>,
+W3C invites you to
+<a href="/2008/xml10/card/greeting-form">send a greeting</a>
+and tell us about an XML-related blog or article.
+Many thanks to the FLWOR Foundation for their
+generous sponsorship of XML10.
+</p>
+</div>
+
+<h2 class="spot-head">W3C Supporters</h2>
+<div class="spot">
+<p class="spot-block">Help W3C by making a donation through the
+<a href="/Consortium/sup">W3C Supporters Program</a>.</p>
+</div>
+
+
+
+<h2 class="spot-head">Employment</h2>
+
+<div class="spot">
+<p class="spot-block">Current <a href="/Consortium/Recruitment/">job
+opportunities</a> at W3C: <a href="http://www.ercim.org/jobs/wai_consultant.html">Web Accessibility and Ageing Consultant</a>. Current <a href="/Consortium/Recruitment/Fellows#openings">W3C Fellows Program
+openings</a> are <a href="/2007/01/comm-fellow1">Business and
+Technology Communications Specialist</a>, <a href="/2007/01/comm-fellow2">Web / Graphic Designer</a>, and <a href="/2007/01/SysteamFellowsPosition">Software Engineer</a>.</p>
+</div>
+
+<h2 class="navhead"><a name="technologies" id="technologies">W3C A to
+Z</a></h2>
+
+<ul>
+<li class="invisible"><a class="navlink" title="Skip W3C A-Z" href="#news">Skip to News</a></li>
+
+<li><a href="/WAI/" class="navlink">Accessibility</a></li>
+
+<li><a href="/Amaya/" class="navlink">Amaya</a></li>
+
+<li><a href="/Mobile/CCPP/" class="navlink"><abbr title="Composite Capability/Preference Profiles">CC/PP</abbr></a></li>
+
+<li><a href="/2004/CDF/" class="navlink">Compound Document Formats
+(CDF)</a></li>
+
+<li><a href="/Style/CSS/" class="navlink"><abbr title="Cascading Style Sheets">CSS</abbr></a></li>
+
+<li><a href="http://jigsaw.w3.org/css-validator/" class="navlink"><abbr title="Cascading Style Sheets">CSS</abbr>
+Validator</a></li>
+
+<li><a href="/2002/ws/databinding/" class="navlink">Databinding</a></li>
+
+<li><a href="/DOM/" class="navlink"><acronym title="Document Object Model">DOM</acronym></a></li>
+
+<li><a href="/XML/EXI" class="navlink">Efficient XML
+Interchange</a></li>
+
+<li><a href="/2007/eGov/" class="navlink">eGovernment</a></li>
+
+<li><a href="/2001/sw/grddl-wg/" class="navlink"><acronym title="Gleaning Resource Descriptions from Dialects of Languages">GRDDL</acronym></a></li>
+
+<li><a href="/2001/sw/hcls/" class="navlink">Health Care and Life
+Sciences</a></li>
+
+<li><a href="/html/" class="navlink"><abbr title="HyperText Markup Language">HTML</abbr></a></li>
+
+<li><a href="/People/Raggett/tidy/" class="navlink"><abbr title="HyperText Markup Language">HTML</abbr> Tidy</a></li>
+
+<li><a href="http://validator.w3.org/" class="navlink"><abbr title="HyperText Markup Language">HTML</abbr> Validator</a></li>
+
+<li><a href="/Protocols/" class="navlink"><abbr title="Hypertext Transfer Protocol">HTTP</abbr></a></li>
+
+<li><a href="/2005/Incubator/" class="navlink">Incubator</a></li>
+
+<li><a href="/2002/mmi/ink" class="navlink">InkML</a></li>
+
+<li><a href="/International/" class="navlink">Internationalization</a></li>
+
+<li><a href="/Jigsaw/" class="navlink">Jigsaw</a></li>
+
+<li><a href="/Library/" class="navlink">Libwww</a></li>
+
+<li><a href="/Math/" class="navlink">MathML</a></li>
+
+<li><a href="/Mobile/" class="navlink">Mobile Web Initiative
+(W3C-MWI)</a></li>
+
+<li><a href="/2002/mmi/" class="navlink">Multimodal
+Interaction</a></li>
+
+<li><a href="/2004/OWL/" class="navlink"><acronym title="OWL Web Ontology Language">OWL</acronym></a></li>
+
+<li><a href="/2004/pp/" class="navlink">Patent Policy</a></li>
+
+<li><a href="/PICS/" class="navlink"><acronym title="Platform for Internet Content Selection">PICS</acronym></a></li>
+
+<li><a href="/Graphics/PNG/" class="navlink"><acronym title="Portable Network Graphics">PNG</acronym></a></li>
+
+<li><a href="/2007/powder/" class="navlink"><acronym title="Protocol for Web Description Resources">POWDER</acronym></a></li>
+
+<li><a href="/P3P/" class="navlink">Privacy and <abbr title="Platform for Privacy Preferences">P3P</abbr></a></li>
+
+<li><a href="/RDF/" class="navlink"><abbr title="Resource Description Framework">RDF</abbr></a></li>
+
+<li><a href="/2006/rwc/" class="navlink">Rich Web Clients</a></li>
+
+<li><a href="/2005/rules/" class="navlink">Rules</a></li>
+
+<li><a href="/Security/" class="navlink">Security</a></li>
+
+<li><a href="/2001/sw/" class="navlink">Semantic Web</a></li>
+
+<li><a href="/XML/SML" class="navlink">Service Modeling Language
+(<abbr title="Service Modeling Language">SML</abbr>)</a></li>
+
+<li><a href="/AudioVideo/" class="navlink"><acronym title="Synchronized Multimedia Integration Language">SMIL</acronym></a></li>
+
+<li><a href="/2000/xp/Group/" class="navlink"><acronym title="Soap">SOAP</acronym>/<abbr title="XML Protocol">XMLP</abbr></a></li>
+
+<li><a href="/2002/ws/soapjms/" class="navlink"><acronym title="Soap">SOAP-JMS</acronym></a></li>
+
+<li><a href="/2001/sw/DataAccess/" class="navlink"><acronym title="Simple Protocol and RDF Query Language">SPARQL</acronym></a></li>
+
+<li><a href="/Style/" class="navlink">Style</a></li>
+
+<li><a href="/Graphics/SVG/" class="navlink"><abbr title="Scalable Vector Graphics">SVG</abbr></a></li>
+
+<li><a href="/2001/tag/" class="navlink"><abbr title="Technical Architecture Group">TAG</abbr></a></li>
+
+<li><a href="/AudioVideo/TT/" class="navlink">Timed Text</a></li>
+
+<li><a href="/Addressing/" class="navlink"><abbr title="Uniform Resource Identifiers">URI/URL</abbr></a></li>
+
+<li><a href="/QA/Tools/#validators" class="navlink">Validators</a></li>
+
+<li><a href="/Voice/" class="navlink">Voice</a></li>
+
+<li><a href="/2007/uwa/" class="navlink">Ubiquitous Web
+Applications</a></li>
+
+<li><a href="/WAI/" class="navlink"><acronym title="Web Accessibility Initiative">WAI</acronym></a></li>
+
+<li><a href="/2006/webapi/" class="navlink">Web API</a></li>
+
+<li><a href="/2006/appformats/" class="navlink">Web Application
+Formats</a></li>
+
+<li><a href="/2001/tag/" class="navlink">Web Architecture
+(<acronym title="Technical Architecture Group">TAG</acronym>)</a></li>
+
+<li><a href="/Graphics/WebCGM/WG/" class="navlink"><abbr title="Web Computer Graphics Metafile">WebCGM</abbr></a></li>
+
+<li><a href="/2002/ws/" class="navlink">Web Services</a></li>
+
+<li><a href="/2002/ws/addr/" class="navlink"><abbr title="Web Services">WS</abbr>-Addressing</a></li>
+
+<li><a href="/2002/ws/chor/" class="navlink"><abbr title="Web Services Choreography Description Language">WS-CDL</abbr></a></li>
+
+<li><a href="/2002/ws/desc/" class="navlink"><acronym title="Web Services Description Language">WSDL</acronym></a></li>
+
+<li><a href="/2002/ws/policy/" class="navlink"><abbr title="Web Services">WS</abbr>-Policy</a></li>
+
+<li><a href="/MarkUp/Forms/" class="navlink"><acronym title="Next Generation Web Forms">XForms</acronym></a></li>
+
+<li><a href="/MarkUp/" class="navlink"><abbr title="Extensible HyperText Markup Language">XHTML</abbr></a></li>
+
+<li><a href="/MarkUp/" class="navlink"><abbr title="Extensible HyperText Markup Language">XHTML2</abbr></a></li>
+
+<li><a href="/XML/Linking" class="navlink"><acronym title="XML Link">XLink</acronym></a></li>
+
+<li><a href="/XML/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr></a></li>
+
+<li><a href="/TR/xmlbase/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Base</a></li>
+
+<li><a href="/2001/XKMS/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Key Management</a></li>
+
+<li><a href="/XML/Processing/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Processing</a></li>
+
+<li><a href="/XML/Query" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Query</a></li>
+
+<li><a href="/XML/Schema" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Schema</a></li>
+
+<li><a href="/2008/xmlsec/" class="navlink"><abbr title="Extensible Markup Language">XML</abbr> Signature
+and Encryption</a></li>
+
+<li><a href="/Style/XSL/" class="navlink">XPath</a></li>
+
+<li><a href="/XML/Linking" class="navlink">XPointer</a></li>
+
+<li><a href="/Style/XSL/" class="navlink"><acronym title="Extensible Stylesheet Language">XSL</acronym> and <acronym title="XSL Transformations">XSLT</acronym></a></li>
+</ul>
+
+<p><a href="/Consortium/siteindex" class="navlink">More
+topics...</a></p>
+</div>
+
+<div class="newsBlock">
+<h2 class="newsHeading"><a name="news" id="news">News</a></h2>
+
+<p class="invisible"><a title="Skip News" href="#search">Skip to
+Search</a></p>
+
+<div id="item103" class="item"><h3 class="headline">New eGovernment Activity to Help Improve Government through Better Use of the Web</h3>
+<p><a href="/2007/eGov/"><img class="newsImage" width="300" height="75" src="/2008/06/03-egov" alt="Crowd scene" /></a></p>
+<p><span class="date">2008-06-03:</span> W3C launches today a <a href="/2007/eGov/">new forum</a> for governments, citizens, researchers, and other stakeholders to investigate how best to use Web technology for good governance and citizen participation. "Open Standards, and in particular Semantic Web Standards, can help lower the cost of government, make it easier for independent agencies to work together, and increase flexibility in the face of change," said Tim Berners-Lee, W3C Director. W3C invites participation in the new <a href="/2007/eGov/IG/">eGovernment Interest Group</a>, which is open to the public. The group will identify best practices and guidelines in this area, document where current technology does not adequately address stakeholder needs, and suggest improvements via the standards process. Read the <a href="/2007/eGov/IG/faq">W3C eGovernment FAQ</a> and <a href="/2008/06/egov-pressrelease">press release</a>, and learn more about the <a href="/2007/eGov/">W3C eGovernment Activity</a>.<span class="archive"> (<a title="New eGovernment Activity to Help Improve Government through Better Use of the Web" href="/News/2008#item103" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item105" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Two Group Notes Published About Semantic Web and Life Sciences</h3><p><span class="date">2008-06-05:</span> The <a href="/2001/sw/hcls/">Semantic Web Health Care and Life Sciences Interest Group</a> has published two Group Notes: <a href="/TR/2008/NOTE-hcls-kb-20080604/">A Prototype Knowledge Base for the Life Sciences</a> and <a href="/TR/2008/NOTE-hcls-senselab-20080604/">Experiences with the conversion of SenseLab databases to RDF/OWL</a>. The former describes a prototype of a biomedical knowledge base that integrates 15 distinct data sources using currently available Semantic Web technologies including RDF and OWL. The Note outlines which resources were integrated, how the knowledge base was constructed using free and open source triple store technology, how it can be queried using SPARQL, and what resources and inferences are involved in answering complex queries. While the utility of the knowledge base is illustrated by identifying a set of genes involved in Alzheimer's Disease, the approach described here can be applied to any use case that integrates data from multiple domains. The second document describe the experience of converting SenseLab databases into OWL, an important step towards realizing the benefits of Semantic Web in integrative neuroscience research. Learn more about the <a href="/2001/sw/">Semantic Web Activity</a>.<span class="archive"> (<a title="Two Group Notes Published About Semantic Web and Life Sciences" href="/News/2008#item105" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item104" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Offline Web Applications Published as W3C Note</h3><p><span class="date">2008-06-03:</span> The <a href="/html/wg/">HTML Working Group</a> has published the <a href="/TR/2008/NOTE-offline-webapps-20080530/">Offline Web Applications</a> Group Note. <a href="/TR/html5/">HTML 5</a> contains several features that address the challenge of building Web applications that work while offline. This document highlights these features (SQL, offline application caching APIs as well as online/offline events, status, and the localStorage API) from HTML 5 and provides brief tutorials on how these features might be used to create Web applications that work offline. Learn more about the <a href="/MarkUp/Activity">HTML Activity</a>.<span class="archive"> (<a title="Offline Web Applications Published as W3C Note" href="/News/2008#item104" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item102" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Advisory Committee Elects Advisory Board</h3><p><span class="date">2008-06-02:</span> The W3C Advisory Committee has filled six open seats on the <a href="/2002/ab/">W3C Advisory Board</a>. Created in 1998, the Advisory Board provides guidance to the Team on issues of strategy, management, legal matters, process, and conflict resolution. Beginning 1 July, the nine Advisory Board participants are Jean-François Abramatic (ILOG), Ann Bassetti (The Boeing Company), Jim Bell (HP), Don Deutsch (Oracle), Eduardo Gutentag (Sun Microsystems), Steve Holbrook (IBM), Ken Laskey (MITRE), Ora Lassila (Nokia), and Arun Ranganathan (Mozilla Foundation). Steve Zilles continues as interim Advisory Board Chair. Read more about the <a href="/2002/ab/">Advisory Board</a>.<span class="archive"> (<a title="W3C Advisory Committee Elects Advisory Board" href="/News/2008#item102" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item101" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Talks in June</h3><p><span class="date">2008-06-02:</span> Browse <a href="/Talks/">W3C presentations and events</a> also available as an <abbr title="RDF Site Summary"><a href="/2004/08/TalkFiles/Talks.rss">RSS channel</a></abbr>. <span class="archive"> (<a title="W3C Talks in June" href="/News/2008#item101" rel="details">Permalink</a>) </span></p><ul><li><span class="talkstart">2 June, Västerås, Sweden: </span><span class="talktitle" lang="sv" xml:lang="sv">Framtidssäkra eFörvaltningen<span class="hide noprint">.</span></span><span class="talkdesc">Olle Olsson participates in a panel at <a href="http://www.offentligarummet.se/" lang="sv" xml:lang="sv">Offentliga Rummet 2008</a>. </span></li><li><span class="talkstart">4 June, Sao Paulo, Brazil: </span><span class="talktitle">Towards eGovernment 2.0 through better use of the Web<span class="hide noprint">.</span></span><span class="talkdesc">José Manuel Alonso presents at <a href="http://www.w3c.br/2008/launch/">W3C Brazil Office Public Launch</a>. </span></li><li><span class="talkstart">4 June, Sao Paolo, Brazil: </span><span class="talktitle">W3C - Web Open Standards<span class="hide noprint">.</span></span><span class="talkdesc">Daniel Dardailler presents at <a href="http://www.w3c.br/2008/lancamento/">W3C Brazil Office Launch event </a>. </span></li><li><span class="talkstart">10 June, Buenos Aires, Argentina: </span><span class="talktitle">Web Accessibility: People with Disabilities and Elderly Citizens<span class="hide noprint">.</span></span><span class="talkdesc">Shadi Abou-Zahra presents at <a href="http://www.isoc.org.ar/accesibilidad.html" lang="es" xml:lang="es">Web Sin Barreras</a>. </span></li><li><span class="talkstart">11 June, Nashville, TN, USA: </span><span class="talktitle">Color for the Global Web<span class="hide noprint">.</span></span><span class="talkdesc">Molly E Holzschlag presents at <a href="http://www.voicesthatmatter.com/webdesign2008/index.aspx">Voices That Matter</a>. </span></li><li><span class="talkstart">12 June, Nashville, TN, USA: </span><span class="talktitle">Designing for Today's Browsers<span class="hide noprint">.</span></span><span class="talkdesc">Molly E Holzschlag presents at <a href="http://www.voicesthatmatter.com/webdesign2008/index.aspx">Voices That Matter</a>. </span></li><li><span class="talkstart">17 June, New York, NY, USA: </span><span class="talktitle">Web of Data<span class="hide noprint">.</span></span><span class="talkdesc">Tim Berners-Lee presents at <a href="http://www.linkeddataplanet.com/index.php">LinkedData Planet Conference: exploring the new web of linked data</a>. </span></li><li><span class="talkstart">19 June, Tokyo, Japan: </span><span class="talktitle">Update on W3C/WAI Guidelines including WCAG 2.0<span class="hide noprint">.</span></span><span class="talkdesc">Judy Brewer presents at <a>Open Seminar of Information Accessibility</a>. </span></li><li><span class="talkstart">19 June, Nancy, France: </span><span class="talktitle" lang="fr" xml:lang="fr">États des lieux du Web sémantique<span class="hide noprint">.</span></span><span class="talkdesc">Ivan Herman gives a keynote at <a href="http://ic2008.loria.fr/" lang="fr" xml:lang="fr">19èmes Journées Francophones d'Ingénierie des Connaissances (IC2008)</a>. </span></li><li><span class="talkstart">19 June, Baltimore, Maryland, USA: </span><span class="talktitle">How New Web Accessibility Standards Impact User Experience Design<span class="hide noprint">.</span></span><span class="talkdesc">Shawn Henry presents at <a href="http://www.usabilityprofessionals.org/conference/2008/">Usability Professionals' Association International Conference 2008</a>. </span></li><li><span class="talkstart">26 June, Frankfurt, Germany: </span><span class="talktitle">Mobile Internet - the Way Forward<span class="hide noprint">.</span></span><span class="talkdesc">Steve Bratt participates in a panel at <a href="http://www.amiando.com/ngmn-2008">2nd NGMN Industry Conference 2008</a>. </span></li><li class="noprint showuris">View <a href="http://www.w3.org/2004/08/W3CTalks?date=Recent+and+upcoming&amp;countryListing=yes&amp;submit=Submit">upcoming talks by country</a></li><li class="noprint showuris"><a href="/Talks/">More talks...</a></li></ul></div>
+
+<div id="item100" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Launches Group to Help Bridge the Digital Divide</h3><p><a href="/2008/MW4D/"><img class="newsImage" alt="Phone bikes" src="/2008/05/voiturette-sb.png" /></a><span class="date">2008-05-27:</span> As part of the growing set of W3C initiatives related to social development, W3C invites participation in the new <a href="/2008/MW4D/">Mobile Web for Development (MW4D) interest Group</a>, chartered to explore the potential of mobile technology to help bridge the digital divide. "We need to solve important challenges, such as lack of standards in end-user devices, network constraints, service cost, issues of literacy, and an understanding of the real information needs of rural communities," said Ken Banks, kiwanja.net, who Chairs the group. "To do so requires an multidisciplinary approach, a step we take through the creation of this new group." Read more in the <a href="/2008/05/mw4dig-pressrelease">press release</a>. This launch is part of <a href="/Mobile">W3C's Mobile Web Initiative (MWI)</a>, which aims to identify and resolve challenges and issues of accessing the Web when on the move. This work takes place under the auspices of the <a href="http://cordis.europa.eu/fp7/ict/">European Union's 7th Research Framework Programme (FP7)</a>, part of the <a href="http://digitalworld.ercim.org/">Digital World Forum</a> project.<span class="archive"> (Photo credit: Stéphane Boyera. <a title="W3C Launches Group to Help Bridge the Digital Divide" href="/News/2008#item100" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item99" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Last Call: XHTML Access Module</h3><p><span class="date">2008-05-26:</span> The <a href="/MarkUp/">XHTML 2 Working Group</a> has published the Last Call Working Draft of <a href="/TR/2008/WD-xhtml-access-20080526/">XHTML Access Module</a>. This document is intended to help make XHTML-family markup languages more effective at supporting the needs of the accessibility community. It does so by providing a generic mechanism for defining the relationship between document components and well-known accessibility taxonomies. Comments are welcome through 16 June. Learn more about the <a href="/MarkUp/Activity">HTML Activity</a>. <span class="archive"> (<a title="Last Call: XHTML Access Module" href="/News/2008#item99" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item98" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Invites Implementations of CSS Namespaces Module (Candidate Recommendation)</h3><p><span class="date">2008-05-23:</span> The <a href="/Style/CSS/members">Cascading Style Sheets (CSS) Working Group</a> has published the Candidate Recommendation of <a href="/TR/2008/CR-css3-namespace-20080523/">CSS Namespaces Module</a>. This CSS Namespaces module defines the syntax for using namespaces in CSS. It defines the @namespace rule for declaring the default namespace and binding namespaces to namespace prefixes, and it also defines a syntax that other specifications can adopt for using those prefixes in namespace-qualified names. Learn more about the <a href="/Style/">Style Activity</a>.<span class="archive"> (<a title="W3C Invites Implementations of CSS Namespaces Module (Candidate Recommendation)" href="/News/2008#item98" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item97" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Progress Events 1.0</h3><p><span class="date">2008-05-22:</span> The <a href="/2006/webapi/">Web API Working Group</a> has published a Working Draft of <a href="/TR/2008/WD-progress-events-20080521/">Progress Events 1.0</a>.This document describes event types that can be used for monitoring the progress of an operation. It is primarily intended for contexts such as data transfer operations specified by <a href="/TR/XMLHttpRequest">XMLHTTPRequest</a>, or <a href="/TR/MediaAccessEvents/">Media Access Events</a>. Learn more about the <a href="/2006/rwc/">Rich Web Client Activity</a>.<span class="archive"> (<a title="Progress Events 1.0" href="/News/2008#item97" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item96" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />XML Security Working Group to Take Next Steps on XML Signature, Encryption</h3><p><span class="date">2008-05-21:</span> W3C is pleased to announce the creation of the <a href="/2008/xmlsec/">XML Security Working Group</a>, whose mission is to evaluate and act on <a href="/2007/xmlsec/ws/report">recommendations</a> from the <a href="/2007/xmlsec/ws/agenda.html">September 2007 Workshop on XML Signature and XML Encryption</a> regarding next steps for XML Security specifications. The group's <a href="/2008/02/xmlsec-charter.html#deliverables">deliverables</a> include new work on XML Signature Syntax and Processing and XML Encryption Syntax and Processing, as well as maintenance of related specifications. Frederick Hirsch (Nokia) will Chair the group, with Thomas Roessler (W3C) as Team Contact. Learn more about the <a href="/Security/">W3C Security Activity</a>. <span class="archive"> (<a title="XML Security Working Group to Take Next Steps on XML Signature, Encryption" href="/News/2008#item96" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item94" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Last Call: Cascading Style Sheets (CSS) Snapshot 2007</h3><p><span class="date">2008-05-16:</span> The <a href="/Style/CSS/members">Cascading Style Sheets (CSS) Working Group</a> has published the Last Call Working Draft of <a href="/TR/2008/WD-css-beijing-20080516/">Cascading Style Sheets (CSS) Snapshot 2007</a>. This document collects together into one definition all the specifications that together form the current state of Cascading Style Sheets (CSS). The primary audience is CSS implementors, not CSS authors, as this definition includes modules by specification stability, not Web browser adoption rate. Comments are welcome through 09 June. Learn more about the <a href="/Style/">Style Activity</a>.<span class="archive"> (<a title="Last Call: Cascading Style Sheets (CSS) Snapshot 2007" href="/News/2008#item94" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item93" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />W3C Invites Implementations of XQuery and XPath Full Text 1.0 (Candidate Recommendation); Requirements and Use Cases Drafts Available</h3><p><span class="date">2008-05-16:</span> The W3C <a href="http://www.w3.org/XML/Query/">XML Query Working Group</a> and the W3C <a href="http://www.w3.org/Style/XSL/">XSL Working Group</a> jointly published today a Candidate Recommendation of <a href="/TR/2008/CR-xpath-full-text-10-20080516/">XQuery and XPath Full Text 1.0</a>. This document defines the syntax and formal semantics of XQuery and XPath Full Text 1.0 which is a language that extends XQuery 1.0 [XQuery 1.0: An XML Query Language] and XPath 2.0 [XML Path Language (XPath) 2.0] with full-text search capabilities. Implementors are encouraged to run the groups' <a href="http://dev.w3.org:/cvsweb/2007/xpath-full-text-10-test-suite/">test suite</a> and report their results. The Groups also published Working Drafts of <a href="/TR/2008/WD-xpath-full-text-10-requirements-20080516/">XQuery and XPath Full Text 1.0 Requirements</a> and <a href="/TR/2008/WD-xpath-full-text-10-use-cases-20080516/">Use Cases</a>. Learn more about the <a href="/XML/">XML Activity</a>.<span class="archive"> (<a title="W3C Invites Implementations of XQuery and XPath Full Text 1.0 (Candidate Recommendation); Requirements and Use Cases Drafts Available" href="/News/2008#item93" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item95" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />State Chart XML (SCXML) Working Draft Published</h3><p><span class="date">2008-05-16:</span> The <a href="/Voice/">Voice Browser Working Group</a> has published an updated Working Draft of <a href="/TR/2008/WD-scxml-20080516/">State Chart XML (SCXML): State Machine Notation for Control Abstraction</a>. <abbr title="State Chart eXtensible Markup Language">SCXML</abbr> is an execution environment based on <a href="http://www.uml.org/#UML1.5"><abbr title="Unified Modeling Language">UML</abbr></a> Harel State Tables and <a href="/TR/ccxml/"><abbr title="Call Control eXtensible Markup Language">CCXML</abbr></a>. The main differences from the previous draft are (1) the modularization of the language, (2) the introduction of profiles and (3) a revision of the algorithm for document interpretation; the document as a whole has changed significantly and the group welcomes review. Learn more about the <a href="/Voice/">Voice Browser Activity</a>.<span class="archive"> (<a title="State Chart XML (SCXML) Working Draft Published" href="/News/2008#item95" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item92" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />"Web Accessibility for Older Users: A Literature Review"; Comments Welcome on First Public Draft</h3><p><span class="date">2008-05-14:</span> The Web Accessibility Initiative (WAI) <a href="/WAI/EO/">Education and Outreach Working Group Working Group (EOWG)</a> has published <a href="/TR/2008/WD-wai-age-literature-20080514/">Web Accessibility for Older Users: A Literature Review</a> as a First Public Working Draft. The document includes reviews and analysis of guidelines and articles covering the requirements of people with Web accessibility needs related to ageing. This literature review will inform WAI efforts to promote accessibility solutions for older Web users and potentially to develop profiles or extensions to WAI guidelines. The literature review is a deliverable of the <a href="/WAI/WAI-AGE/">WAI-AGE Project</a> (Ageing Education and Harmonisation). See the <a href="http://lists.w3.org/Archives/Public/w3c-wai-ig/2008AprJun/0083.html">call for review and participation</a> for an introduction to the project and an invitation to contribute to the literature review and other WAI-AGE work; and about the <a href="/WAI/">Web Accessibility Initiative</a>.<span class="archive"> (<a title="Web Accessibility for Older Users: A Literature Review; Comments Welcome on First Public Draft" href="/News/2008#item92" rel="details">Permalink</a>) </span></p></div>
+
+<div id="item91" class="item"><h3><img alt="" width="17" height="11" src="/Icons/right" />Last Call: CURIE Syntax 1.0</h3><p><span class="date">2008-05-08:</span> The <a href="/MarkUp/">XHTML2 Working Group</a> has published the Last Call Working Draft of <a href="/TR/2008/WD-curie-20080506">CURIE Syntax 1.0</a>, which outlines a syntax for expressing URIs in a generic, abbreviated syntax ("Compact URI"). The specification targets language designers who need a mechanism to permit the use of extensible value collections. Any language designer considering the use of QNames in attribute values should consider instead using CURIEs, since CURIEs are designed for this purpose, while QNames are not. Comments are welcome through 10 June. Learn more about the <a href="/MarkUp/Activity">HTML Activity</a>.<span class="archive"> (<a title="Last Call: CURIE Syntax 1.0" href="/News/2008#item91" rel="details">Permalink</a>) </span></p></div>
+
+
+
+<h3 class="pastNews"><a href="/News/2008">Past News</a></h3>
+</div>
+
+<div class="navBlock">
+<h2 class="navhead"><a name="search" id="search">Search</a></h2>
+
+<p class="invisible"><a class="navlink" title="Skip search" href="#contents">Skip to Contents</a></p>
+
+<form method="get" action="http://www.google.com/custom" enctype="application/x-www-form-urlencoded">
+<div>
+<a class="navlink" href="http://www.google.com"><img src="/Icons/Logo_25wht.gif" width="75" height="32" alt="Google" /></a><br />
+<label for="inputField">Search W3C<br />
+<input type="text" size="15" id="inputField" name="q" accesskey="E" maxlength="255" /></label> <input type="submit" value="Go" id="goButton" name="sa" accesskey="G" /><br />
+<input type="hidden" name="cof" value="T:black;LW:72;ALC:#ff3300;L:http://www.w3.org/Icons/w3c_home;LC:#000099;LH:48;BGC:white;AH:left;VLC:#660066;GL:0;AWFID:0b9847e42caf283e;" />
+ <input type="hidden" id="searchW3C" name="sitesearch" checked="checked" value="www.w3.org" /><input type="hidden" name="domains" value="www.w3.org" />
+</div>
+</form>
+
+<p><a class="navlink" href="/Search/Mail/Public/">Search W3C Mailing
+Lists</a></p>
+
+<h2 class="navhead"><a name="contents" id="contents">Testimonials</a></h2>
+
+<div class="hpmt"><div class="hpmt-name">Fraunhofer Gesellschaft</div><div class="hpmt-logo"><a rel="nofollow" href="http://www.fraunhofer.de/"><img alt="Fraunhofer Gesellschaft" src="http://www.w3.org/Consortium/Member/Testimonial/Logo/119" /></a></div><p class="hpmt-testimonial">The Fraunhofer-Gesellschaft undertakes applied contract research in all fields of engineering sciences. Fraunhofer works with W3C to contribute to the development of Web technologies which are the base of many of our research activities. Fraunhofer hosts the W3C Office in Germany and Austria. <a class="hpmt-more" href="http://www.w3.org/Consortium/Member/Testimonial/List">(Member testimonials)</a></p></div>
+
+<h2 class="navhead">Members</h2>
+
+<ul>
+<li><a href="/Member/" class="navlink">Member Home Page</a></li>
+
+<li><a href="/Submission/" class="navlink">Member Submissions</a></li>
+
+<li><a href="/Consortium/Member/List" class="navlink">Current
+Members</a></li>
+
+<li><a href="/Consortium/meetings" class="navlink">Meetings</a></li>
+
+<li><a href="/Consortium/Recruitment/Fellows" class="navlink">Fellows</a> (<a href="/Consortium/Recruitment/Fellows#openings">New Openings</a>)</li>
+</ul>
+
+<h2 class="navhead">Get Involved</h2>
+
+<ul>
+<li><a href="/Consortium/membership-benefits" class="navlink">W3C
+Membership Benefits</a></li>
+
+<li><a href="/Consortium/membership#bizcase" class="navlink">Reasons to
+Join W3C</a></li>
+
+<li><a href="/Mail/" class="navlink">Mailing Lists</a></li>
+
+<li><a href="http://lists.w3.org/Archives/Public/public-new-work/latest">Potential
+New Work</a></li>
+
+<li><a href="/Consortium/Translation/" class="navlink">Translations</a></li>
+
+<li><a href="/2003/08/Workshops/" class="navlink">Workshops</a></li>
+
+<li><a href="/2001/11/StdLiaison" class="navlink">Liaisons</a></li>
+
+<li><a href="/Status" class="navlink">Open Source Software</a></li>
+
+<li><a href="/QA/" class="navlink">Q&amp;A Blog</a></li>
+
+<li><a href="/Consortium/Recruitment/" class="navlink">Employment</a></li>
+
+<li><span class="navText">More ways to</span> <a href="/Consortium/org#public" class="navlink">participate</a></li>
+</ul>
+
+<h2 class="navhead">Introduction</h2>
+
+<ul>
+<li><a href="/Consortium/" class="navlink">About W3C</a></li>
+
+<li><a href="/Consortium/faq" class="navlink">Frequently Asked
+Questions (FAQ)</a></li>
+
+<li><a href="/2003/glossary/" class="navlink">Glossary</a></li>
+
+<li><a href="/Consortium/Process/" class="navlink">Process
+Document</a></li>
+
+<li><a href="/2002/03/tutorials" class="navlink">Tutorials</a></li>
+
+<li><a href="/2002/03/new-to-w3c" class="navlink">More...</a></li>
+</ul>
+
+<h2 class="navhead">W3C Team</h2>
+
+<ul>
+<li><a href="/People/" class="navlink">People</a></li>
+
+<li><a href="/TeamSubmission/" class="navlink">Team
+Submissions</a></li>
+</ul>
+
+<h2 class="navhead">Presentations</h2>
+
+<ul>
+<li><a href="/Talks/" class="navlink">Public Presentations</a></li>
+</ul>
+
+<h2 class="navhead">News Room</h2>
+
+<ul>
+<li><a href="/News/" class="navlink">W3C News Archive</a> <span class="navText">(</span><a href="/2000/08/w3c-synd/home.rss" class="navlink">RSS</a><span class="navText">)</span></li>
+
+<li><a href="/News/Public/" class="navlink">Weekly Public Newsletter</a></li>
+
+<li><a href="/Press/" class="navlink">Press Releases</a></li>
+
+<li><a href="/Press/#rss" class="navlink">Multilingual Press Release
+RSS</a></li>
+
+<li><a href="/Press/Articles" class="navlink">W3C in the Press</a></li>
+</ul>
+
+<h2 class="navhead"><a name="Offices" id="Offices">World
+Offices</a></h2>
+
+<p class="navPara">The <a href="/Consortium/Offices/" class="navlink">W3C Offices</a>, part of the <a href="/2007/IntlRel.html">W3C
+International Relations team</a> translate many W3C home page news
+items. W3C Offices are located in these parts of the world:</p>
+
+<ul>
+<li><a href="http://www.w3c.org.au/" class="navlink" title="Australia">Australia</a></li>
+
+<li><a href="http://www.w3c.nl/index.shtml.nl" class="navlink" hreflang="nl" title="Benelux"><span xml:lang="nl" lang="nl">Benelux</span></a>/<a href="http://www.w3c.nl/index.shtml.fr" class="navlink" title="Benelux" hreflang="fr"><span xml:lang="fr" lang="fr">Bénélux</span></a></li>
+
+<li><a href="http://www.w3c.br/" class="navlink" title="Brazil" hreflang="pt-br"><span xml:lang="pt-br" lang="pt-br">Brasil</span>
+(Brazil)</a></li>
+
+<li><a href="http://www.chinaw3c.org/" class="navlink" title="China" hreflang="zh-hans"><span xml:lang="zh-hans" lang="zh-hans">中国</span>
+(China)</a></li>
+
+<li><a href="http://www.w3c.tut.fi/" class="navlink" title="Finland" hreflang="fi"><span xml:lang="fi" lang="fi">Suomi</span>
+(Finland)</a></li>
+
+<li><a href="http://www.w3c.de/" class="navlink" title="German and Austria" hreflang="de"><span xml:lang="de" lang="de">Deutschland und Österreich</span> (Germany and Austria)</a></li>
+
+<li><a href="http://www.w3c.gr/" class="navlink" title="Greece" hreflang="el"><span xml:lang="el" lang="el">Ελλάδα</span>
+(Greece)</a></li>
+
+<li><a href="http://www.w3c.hu/" class="navlink" title="Hungary" hreflang="hu"><span xml:lang="hu" lang="hu">Magyarország</span>
+(Hungary)</a></li>
+
+<li><a href="http://www.w3cindia.in/" class="navlink" title="India" hreflang="en"><span xml:lang="hi" lang="hi">भारत</span>
+(India)</a></li>
+
+<li><a href="http://www.w3c.org.il/" class="navlink" title="Israel" hreflang="he"><span xml:lang="he" lang="he">ישראל</span>
+(Israel)</a></li>
+
+<li><a href="http://www.w3c.it/" class="navlink" title="Italy" hreflang="it"><span xml:lang="it" lang="it">Italia</span>
+(Italy)</a></li>
+
+<li><a href="http://www.w3c.or.kr/" class="navlink" title="Korea" hreflang="ko"><span xml:lang="ko" lang="ko">한국</span> (Korea)</a></li>
+
+<li><a href="http://www.w3c.org.ma/" class="navlink" title="Morocco" hreflang="ar"><span xml:lang="ar" lang="ar">المغرب</span>
+(Morocco)</a></li>
+
+<li><a href="http://www.w3c.org.za/" class="navlink" title="Southern Africa" hreflang="en">Southern Africa</a></li>
+
+<li><a href="http://www.w3c.es/" class="navlink" title="Spain" hreflang="es"><span xml:lang="es" lang="es">España</span>
+(Spain)</a></li>
+
+<li><a href="http://www.w3c.se" class="navlink" title="Sweden" hreflang="sv"><span xml:lang="sv" lang="sv">Sverige</span>
+(Sweden)</a></li>
+
+<li><a href="http://www.w3c.rl.ac.uk/" class="navlink" title="UK and Ireland" hreflang="en-uk">United Kingdom and Ireland</a></li>
+</ul>
+
+<h2 class="navhead"><a name="systems" id="systems">Systems</a></h2>
+
+<ul>
+<li><a href="/Help/Account/" class="navlink">Get Password</a></li>
+
+<li><a href="/2003/08/system-status" class="navlink">System
+Status</a></li>
+</ul>
+</div>
+<hr class="hide" />
+
+<p class="small">W3C would like to thank the <a name="donors" id="donors" href="/Consortium/sup">Supporters</a> who have contributed
+financially or through a donation of goods to W3C.</p>
+
+<p class="small"><a name="footnotes" id="footnotes">Read</a> <a href="/2002/11/homepage">about the layout</a> and <a href="http://lists.w3.org/Archives/Public/site-comments/">send comments</a>
+about this page. <a href="/2000/08/w3c-synd/home.rss">Syndicate</a>
+this page with <a href="http://purl.org/rss/1.0/">RSS 1.0</a>, an
+<a href="/RDF/">RDF</a> vocabulary used for <a href="/2000/08/w3c-synd/#">site summaries</a>. </p>
+
+<address class="small">
+<a href="/Help/Webmaster">Webmaster</a> · Last modified:
+ $Date: 2008/06/05 17:06:19 $
+ <span class="whiteout">|</span><br />
+<a href="http://validator.w3.org/check?uri=referer"><img src="/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a> <span class="whiteout">|</span> <a href="http://jigsaw.w3.org/css-validator/"><img src="/Icons/valid-css" alt="Valid CSS!" height="31" width="88" /></a> <span class="whiteout">|</span> <a href="/WAI/WCAG1AA-Conformance" title="Explanation of Level Double-A Conformance"><img class="conform" height="31" width="88" src="/WAI/wcag1AA" alt="Level Double-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0" />
+</a> <span class="whiteout">|</span>
+</address>
+
+<p class="copyright"><a rel="Copyright" href="/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1994-2007
+<a href="/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
+<a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C
+<a href="/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
+<a href="/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>,
+<a rel="Copyright" href="/Consortium/Legal/copyright-documents">document use</a> and <a rel="Copyright" href="/Consortium/Legal/copyright-software">software
+licensing</a> rules apply. Your interactions with this site are in
+accordance with our <a href="/Consortium/Legal/privacy-statement#Public">public</a> and <a href="/Consortium/Legal/privacy-statement#Members">Member</a> privacy
+statements.</p>
+</body>
+</html>
diff --git a/examples/xml/htmlinfo/youtube_com.html b/examples/xml/htmlinfo/youtube_com.html
new file mode 100644
index 0000000..1de65a3
--- /dev/null
+++ b/examples/xml/htmlinfo/youtube_com.html
@@ -0,0 +1,1585 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
+
+
+ <html lang="en">
+
+<!-- machid: 519 -->
+<head>
+
+ <title>YouTube - Broadcast Yourself.</title>
+
+ <link rel="stylesheet" href="http://s.ytimg.com/yt/css/base_all-vfl42327.css" type="text/css">
+
+ <link rel="search" type="application/opensearchdescription+xml" href="/opensearch?locale=en_US" title="YouTube Video Search">
+ <link rel="icon" href="http://s.ytimg.com/yt/favicon-vfl1123.ico" type="image/x-icon">
+ <link rel="shortcut icon" href="http://s.ytimg.com/yt/favicon-vfl1123.ico" type="image/x-icon">
+
+
+ <meta name="description" content="Share your videos with friends and family">
+ <meta name="keywords" content="video,sharing,camera phone,video phone,free">
+
+ <link rel="alternate" type="application/rss+xml" title="YouTube - [RSS]" href="/rssls">
+
+ <link rel="alternate" media="handheld" href="http://m.youtube.com/index?desktop_uri=%2F&">
+
+ <script type="text/javascript">
+ window.google={kHL:"en"};
+ </script>
+
+ <script type="text/javascript" src="http://s.ytimg.com/yt/js/base_all_with_bidi-vfl42302.js"></script>
+
+ <script type="text/javascript">
+
+ function _hbLink (a,b) { return false; }
+ function urchinTracker (a,b) { }
+
+
+ var gXSRF_token = '';
+ var gXSRF_field_name = '';
+ var gXSRF_ql_pair = '';
+
+ gXSRF_token = 'fZg-xPKpfj11aUrz_5__moOGiAp8MTIxMjg1OTQ4OA==';
+ gXSRF_field_name = 'session_token';
+ onLoadFunctionList.push(populate_session_token);
+
+ gXSRF_ql_pair = 'session_token=kVjpl8qnfp7RPuqnTrIu6Q8BT5d8MA==';
+
+
+ var gQuickListTooltipText = 'Add Video to QuickList';
+ var gPartnerVideoText = 'Partner Video';
+ var gGoogleSuggest = true;
+ var gPixelGif = 'http://s.ytimg.com/yt/img/pixel-vfl73.gif';
+
+ var gInQuickListText = 'in <a href="/watch_queue?all">QuickList</a>';
+ var gIsResultsPage = false;
+ </script>
+
+
+
+<script type="text/javascript">
+
+function swapVideoList(linkObj)
+{
+ var linkId = linkObj.id;
+ var queryData = '';
+ var newDivId = '';
+ var headlineObj = document.getElementById('hpVideoListHead');
+ var moreLinkObj = document.getElementById('homepage-featured-more-top');
+ var bottomMoreLinkObj = document.getElementById('homepage-featured-more-bottom');
+
+ if (linkId == 'hpMostViewedLink') {
+ queryData = 'videoListType=mostViewed';
+ newDivId = 'hpMostViewed';
+ headlineObj.innerHTML = "Most Viewed Videos";
+ moreLinkObj.innerHTML = "<a href=\"/browse?s=mp\">See More Most Viewed Videos</a>";
+ bottomMoreLinkObj.innerHTML = "<a href=\"/browse?s=mp\">See More Most Viewed Videos</a>";
+ }
+ else if (linkId == 'hpMostDiscussedLink') {
+ queryData = 'videoListType=mostDiscussed';
+ newDivId = 'hpMostDiscussed';
+ headlineObj.innerHTML = "Most Discussed Videos";
+ moreLinkObj.innerHTML = "<a href=\"/browse?s=md\">See More Most Discussed Videos</a>";
+ bottomMoreLinkObj.innerHTML = "<a href=\"/browse?s=md\">See More Most Discussed Videos</a>";
+ }
+ else if (linkId == 'hpTopFavoritesLink') {
+ queryData = 'videoListType=topFavorites';
+ newDivId = 'hpTopFavorites';
+ headlineObj.innerHTML = "Top Favorites";
+ moreLinkObj.innerHTML = "<a href=\"/browse?s=mf\">See More Top Favorites</a>";
+ bottomMoreLinkObj.innerHTML = "<a href=\"/browse?s=mf\">See More Top Favorites</a>";
+ }
+ else if (linkId == 'hpFeaturedLink') {
+ newDivId = 'hpFeatured';
+ headlineObj.innerHTML = "Featured Videos";
+ moreLinkObj.innerHTML = "<a href=\"/browse?s=rf\">See More Featured Videos</a>";
+ bottomMoreLinkObj.innerHTML = "<a href=\"/browse?s=rf\">See More Featured Videos</a>";
+ }
+ self.containerDiv = 'homepage-video-list'
+ self.fillDiv = fillDiv
+ self.linkId = linkId
+ self.newDivId = newDivId
+ addClass(_gel(newDivId + 'Link'), 'hilite');
+ if (newDivId != 'hpMostViewed') {
+ removeClass(_gel('hpMostViewedLink'), 'hilite');
+ }
+ if (newDivId != 'hpMostDiscussed') {
+ removeClass(_gel('hpMostDiscussedLink'), 'hilite');
+ }
+ if (newDivId != 'hpTopFavorites') {
+ removeClass(_gel('hpTopFavoritesLink'), 'hilite');
+ }
+ if (newDivId != 'hpFeatured') {
+ removeClass(_gel('hpFeaturedLink'), 'hilite');
+ }
+ if (document.getElementById(newDivId))
+ {
+ document.getElementById(newDivId).style.display = 'block';
+ if (newDivId != 'hpMostViewed' && document.getElementById('hpMostViewed')) document.getElementById('hpMostViewed').style.display = 'none';
+ if (newDivId != 'hpMostDiscussed' && document.getElementById('hpMostDiscussed')) document.getElementById('hpMostDiscussed').style.display = 'none';
+ if (newDivId != 'hpTopFavorites' && document.getElementById('hpTopFavorites')) document.getElementById('hpTopFavorites').style.display = 'none';
+ if (newDivId != 'hpFeatured' && document.getElementById('hpFeatured')) document.getElementById('hpFeatured').style.display = 'none';
+ }
+ else if (queryData != '') {
+ postUrlXMLResponse('/ajax_video_list',queryData,self.fillDiv);
+ }
+}
+function fillDiv(req)
+{
+ if (document.getElementById('hpMostViewed')) document.getElementById('hpMostViewed').style.display = 'none';
+ if (document.getElementById('hpMostDiscussed')) document.getElementById('hpMostDiscussed').style.display = 'none';
+ if (document.getElementById('hpTopFavorites')) document.getElementById('hpTopFavorites').style.display = 'none';
+ if (document.getElementById('hpFeatured')) document.getElementById('hpFeatured').style.display = 'none';
+ var newContent = getNodeValue(req.responseXML, "html_content");
+ var newdiv = document.createElement('div');
+ newdiv.setAttribute("id",self.newDivId);
+ newdiv.innerHTML = newContent;
+ var container = document.getElementById(self.containerDiv);
+ container.appendChild(newdiv);
+ addQLIcons(container);
+}
+
+function hide_active_sharing() {
+ hideDiv("active_sharing_div");
+}
+</script>
+
+</head>
+
+
+<body onload="performOnLoadFunctions();" class="en_US is-english">
+
+<div id="baseDiv" class="date-20080606">
+
+ <div id="masthead">
+ <a href="/" class="logo"><img src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" width="132" height="63" border="0" alt=""/></a>
+ <div class="user-info">
+
+ <div id="loginBoxZ">
+ <div class="contentBox">
+ <div>
+ <div id="loginBoxZ-signup">
+ <a href="/signup">Sign Up</a>
+ | <a href="http://help.youtube.com/support/youtube/bin/topic.py?topic=10546&amp;hl=en_US">Help</a>
+ </div>
+ <div id="loginBoxZ-login">
+ Login
+ </div>
+ <div class="clear"></div>
+ </div>
+
+ <form method="post" name="loginForm" id="loginFormZ" action="/signup">
+ <input type="hidden" name="next" value="/" id="loginNextZ"/>
+ <input type="hidden" name="current_form" value="loginForm" />
+ <input type="hidden" name="action_login" value="1">
+ <div id="loginBoxZ-container">
+ <div id="loginBoxZ-labels" class="floatL">
+ <label for="loginUserZ" class="nowrap">Username:</label>
+ <label for="loginPassZ" class="nowrap">Password:</label>
+ </div>
+ <div class="floatL">
+ <input id="loginUserZ" class="loginBoxZ-input" type="text" size="16" name="username" value=""><br/>
+ <input id="loginPassZ" class="loginBoxZ-input" type="password" size="16" name="password"><br/>
+ <input type="submit" class="smallText" value="Login">
+ </div>
+ <div class="clearL"></div>
+ </div>
+ </form>
+ <div id="loginBoxZ-forgot">
+ <a href="/forgot_username?next=/">Forgot Username</a>
+ | <wbr><nobr><a href="/forgot?next=/">Forgot Password</a></nobr>
+ </div>
+ <div id="loginBoxZ-gaia">
+ <a href="https://www.google.com/accounts/ServiceLogin?service=youtube&amp;hl=en_US&amp;continue=http%3A//www.youtube.com/signup%3Fhl%3Den_US&amp;passive=true">Login with your Google account</a>&nbsp;
+ <a href="#" onClick="window.open('/t/help_gaia','login_help','width=580,height=480,resizable=yes,scrollbars=yes,status=0').focus();" rel="nofollow"><img src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" border="0" class="alignMid gaiaHelpBtn" alt=""></a>
+ </div>
+ </div>
+ </div>
+
+ <div id="localePickerBox">
+ <div id="flagDiv">
+ <script type="text/javascript">
+ var gLocales = [
+ ['ru_RU','&#x420;&#x43E;&#x441;&#x441;&#x438;&#x44F;'] , ['zh_TW','&#x53F0;&#x7063;'] , ['ja_JP','&#x65E5;&#x672C;'] , ['zh_HK','&#x9999;&#x6E2F;'] , ['ko_KR','&#xD55C;&#xAD6D;'] , ['en_AU','Australia'] , ['pt_BR','Brasil'] , ['en_CA','Canada'] , ['de_DE','Deutschland'] , ['es_ES','Espa&#xF1;a'] , ['fr_FR','France'] , ['en_US','Global'] , ['en_IN','India'] , ['en_IE','Ireland'] , ['it_IT','Italia'] , ['es_MX','M&#xE9;xico'] , ['nl_NL','Nederland'] , ['en_NZ','New Zealand'] , ['pl_PL','Polska'] , ['en_GB','United Kingdom']
+ ];
+ </script>
+ <div id="flagDivInner">
+ </div>
+
+ <div class="alignR smallText"><a href="#" onclick="closeLocalePicker(); return false;">Close</a></div>
+ </div>
+ </div>
+
+
+
+
+
+
+ <div id="util-links" class="normal-utility-links">
+
+ <span class="util-item first"><b><a href="/signup" onclick="_hbLink('SignUp','UtilityLinks');">Sign Up</a></b></span>
+ <span class="util-item"><a href="/watch_queue?all">QuickList</a> (<span id="quicklist-utility">0</span>)</span>
+ <span class="util-item"><a href="http://help.youtube.com/support/youtube/bin/static.py?page=start.cs&amp;hl=en_US">Help</a></span>
+ <span class="util-item"><a href="#" class="loginBoxZ eLink" onclick="return openLoginBox(event);">Log In</a></span>
+ <span class="util-item"><a href="#" class="localePickerLink eLink" onclick="loadFlagImgs();toggleDisplay('localePickerBox');return false;">Site:</a></span>
+ <span class="util-item first">&nbsp;<a href="#" class="localePickerLink" onclick="loadFlagImgs();toggleDisplay('localePickerBox');return false;"><img src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" class="currentFlag globalFlag" alt="Site:"></a></span>
+ </div>
+
+ <form name="logoutForm" method="post" target="_top" action="/index">
+ <input type="hidden" name="action_logout" value="1">
+ </form>
+
+
+ </div>
+ <div class="nav">
+ <div class="nav-item first selected" id="nav-item-home">
+ <span class="leftcap"></span>
+ <a class="content" href="/">Home</a>
+ <span class="rightcap"></span>
+ </div>
+ <div class="nav-item" id="nav-item-videos">
+ <div class="nav-tab">
+ <span class="leftcap"></span>
+ <a class="content" href="/browse?s=mp">Videos</a>
+ <span class="rightcap"></span>
+ </div>
+ </div>
+ <div class="nav-item" id="nav-item-channels">
+ <div class="nav-tab">
+ <span class="leftcap"></span>
+ <a class="content" href="/members">Channels</a>
+ <span class="rightcap"></span>
+ </div>
+ </div>
+ <div class="nav-item" id="nav-item-community">
+ <div class="nav-tab">
+ <span class="leftcap"></span>
+ <a class="content" href="/community">Community</a>
+ <span class="rightcap"></span>
+ </div>
+ </div>
+ </div>
+
+ <form autocomplete="off" action="/results" method="get" name="searchForm" onsubmit="return submitRegularSearchRequest()">
+
+ <div class="bar">
+ <span class="leftcap"></span>
+ <div class="search-bar">
+ <a href="/my_videos_upload" id="upload-button" class="action-button">
+ <span class="action-button-leftcap"></span>
+ <span class="action-button-text">Upload</span>
+ <span class="action-button-rightcap"></span>
+ </a>
+ <div id="search-form">
+ <input id="search-term" name="search_query" type="text" tabindex="1" onkeyup="goog.i18n.bidi.setDirAttribute(event,this)" value="" maxlength="128" />
+ <select class="search-type" name="search_type">
+ <option value="">Videos</option>
+ <option value="search_users" >Channels</option>
+ </select>
+ <input id="search-button" type="submit" value="Search" />
+ </div>
+ <div class="search-settings-link">
+ <a href="#" class="eLink" onClick="return toggleAdvSearch('', '', '', '', '', '')">
+ advanced
+ </a></div>
+ </div>
+ <span class="rightcap"></span>
+ </div>
+
+ </form>
+
+ <div id="search-advanced-form" class="hid">
+ <div class="search-setting-inner alignC">Loading...</div>
+ </div>
+
+ <div class="clear"></div>
+ </div>
+ <div id="search-settings-clr" class="hid"></div>
+
+
+
+
+
+
+<div id="homepage-main-content">
+ <div>
+ <div id="active_sharing_div" name="active_sharing_div" style="display:block"></div>
+ <script type="text/javascript">
+ // <![CDATA[
+ var fo = new SWFObject("active_sharing.swf", "active_sharing", "550", "115", 7, "#FFFFFF");
+ var showstr = "Videos being watched right now...";
+ fo.addParam('wmode', 'opaque');
+ fo.addVariable("t", showstr);
+ fo.write("active_sharing_div");
+ // ]]>
+ </script>
+</div>
+
+ <div class="homepage-content-block" style="margin-left:18px; border:0px #CCC solid;">
+ <div class="homepage-block-heading homepage-block-heading-gray">Promoted Videos</div>
+ <div>
+ <div class="homepage-sponsored-video marB0">
+ <div class="videoIconWrapperOuter">
+ <div class="videoIconWrapperInner">
+ <div class="vstill"><a href="/cthru?key=YSqt3w6VDhuNgxUzVZsryt0JX30ll7tCIrBT--_pvAtRC3KmvsBYFaUNR1qT0d0BnBJYjHz_G7LIr21ufG7W6gJL7zPdHNbcmuIxaafL1yry8cdcqeEOTitWLXkpm2q2QnTAlp4chC1jus7JLVCnCdacl0xUeDk4Vk8e6q9htmGbDZPN9QMnHsrX2RZnvDMx-3Im14C3GKi4jI8ee-jnOQ==" name="&lid=DV+-+BasiaBulatInTheNight+-+beggars&lpos=hp-s0"><img src="http://i.ytimg.com/vi/CebHAvPHyyU/default.jpg" class="vimg120"></a></div>
+ </div>
+ </div>
+
+ <div class="vtitle smallText">
+ <a href="/cthru?key=YSqt3w6VDhuNgxUzVZsryt0JX30ll7tCIrBT--_pvAtRC3KmvsBYFaUNR1qT0d0BnBJYjHz_G7LIr21ufG7W6gJL7zPdHNbcmuIxaafL1yry8cdcqeEOTitWLXkpm2q2QnTAlp4chC1jus7JLVCnCdacl0xUeDk4Vk8e6q9htmGbDZPN9QMnHsrX2RZnvDMx-3Im14C3GKi4jI8ee-jnOQ==" name="&lid=DV+-+BasiaBulatInTheNight+-+beggars&lpos=hp-s0">Basia Bulat - In Th...</a>
+ </div>
+ <div class="vfacets" style="margin-bottom: 0px;">
+ <a href="/user/beggars" class="dg">beggars</a>
+ </div>
+ </div>
+ <div class="homepage-sponsored-video marB0">
+ <div class="videoIconWrapperOuter">
+ <div class="videoIconWrapperInner">
+ <div class="vstill"><a href="/cthru?key=FIUXMxdvOKhDw2_wpR7bE9L-XUsHMZBHRpS_s21B0Kq0RTWlGXSqQ8bjw6tBQOUczUtO8b6_mktukdd5ChseYAl10dE5JQrlpiOQE6HNMOAsszaA0M9qhzFnOkWPrkFGMDW5vvaAOkIwas6ksi4e_R8wkiIhlNYPDiqi2f4LpVzB2jpe0LobjIEF9czWjFx9ymrPg8wx2x6w00jF-BzRfQ==" name="&lid=DV+-+Perfection+-+corporalcadet&lpos=hp-s1"><img src="http://i.ytimg.com/vi/Np4bhsmr3iE/default.jpg" class="vimg120"></a></div>
+ </div>
+ </div>
+
+ <div class="vtitle smallText">
+ <a href="/cthru?key=FIUXMxdvOKhDw2_wpR7bE9L-XUsHMZBHRpS_s21B0Kq0RTWlGXSqQ8bjw6tBQOUczUtO8b6_mktukdd5ChseYAl10dE5JQrlpiOQE6HNMOAsszaA0M9qhzFnOkWPrkFGMDW5vvaAOkIwas6ksi4e_R8wkiIhlNYPDiqi2f4LpVzB2jpe0LobjIEF9czWjFx9ymrPg8wx2x6w00jF-BzRfQ==" name="&lid=DV+-+Perfection+-+corporalcadet&lpos=hp-s1">Perfection</a>
+ </div>
+ <div class="vfacets" style="margin-bottom: 0px;">
+ <a href="/user/corporalcadet" class="dg">corporalcadet</a>
+ </div>
+ </div>
+ <div class="homepage-sponsored-video marB0">
+ <div class="videoIconWrapperOuter">
+ <div class="videoIconWrapperInner">
+ <div class="vstill"><a href="/cthru?key=1W2J508g9g7Bjsvodsvq3GHZo25JkqX7Js5JSHnyP1yZYB96KDh2LTC2pCKjeHc7LEiTUU4uhuwsrTzZfns_IR2dsA7leCUYMtvgq3noBHy-G0jTHmgiQtFUVTDU3jT2EkS39J6Ur2qxtHwAmybMcU83hK1guqpPdryKOfcbHovo-Kbwglzbbl28LrK1iNdz5E6NZ5CZCVZrYxldbWyjEA==" name="&lid=DV+-+WhatmatterstoyoumeVFS+-+Jr0canest&lpos=hp-s2"><img src="http://i.ytimg.com/vi/KExoP97KUnY/default.jpg" class="vimg120"></a></div>
+ </div>
+ </div>
+
+ <div class="vtitle smallText">
+ <a href="/cthru?key=1W2J508g9g7Bjsvodsvq3GHZo25JkqX7Js5JSHnyP1yZYB96KDh2LTC2pCKjeHc7LEiTUU4uhuwsrTzZfns_IR2dsA7leCUYMtvgq3noBHy-G0jTHmgiQtFUVTDU3jT2EkS39J6Ur2qxtHwAmybMcU83hK1guqpPdryKOfcbHovo-Kbwglzbbl28LrK1iNdz5E6NZ5CZCVZrYxldbWyjEA==" name="&lid=DV+-+WhatmatterstoyoumeVFS+-+Jr0canest&lpos=hp-s2">What matters to you...</a>
+ </div>
+ <div class="vfacets" style="margin-bottom: 0px;">
+ <a href="/user/Jr0canest" class="dg">Jr0canest</a>
+ </div>
+ </div>
+ <div class="homepage-sponsored-video marB0">
+ <div class="videoIconWrapperOuter">
+ <div class="videoIconWrapperInner">
+ <div class="vstill"><a href="/cthru?key=idL1slcMKbuzX2MFZaS-nifq5PWrCKLUZMXEPqCthRVET6PQSkxlmKQVMNmQvlYpQlFISkRprfO113rH-ER0ytYh0zSMWI4XbaO74zcrIZiSpB3oISku9zIGUwS5WI03Y0ZiHbGAC9GIYziEcRcgzcEYuizlUwNvTWDgNSvrCJHcyPYokMUjLjcwqD2wEEAe7jfIfcJRNl3sW7ODuiN_MA==" name="&lid=DV+-+LIfeisaMasquerade+-+bananaruthy&lpos=hp-s3"><img src="http://i.ytimg.com/vi/l9gjk5hHiGM/default.jpg" class="vimg120"></a></div>
+ </div>
+ </div>
+
+ <div class="vtitle smallText">
+ <a href="/cthru?key=idL1slcMKbuzX2MFZaS-nifq5PWrCKLUZMXEPqCthRVET6PQSkxlmKQVMNmQvlYpQlFISkRprfO113rH-ER0ytYh0zSMWI4XbaO74zcrIZiSpB3oISku9zIGUwS5WI03Y0ZiHbGAC9GIYziEcRcgzcEYuizlUwNvTWDgNSvrCJHcyPYokMUjLjcwqD2wEEAe7jfIfcJRNl3sW7ODuiN_MA==" name="&lid=DV+-+LIfeisaMasquerade+-+bananaruthy&lpos=hp-s3">LIfe is a Masquerade.</a>
+ </div>
+ <div class="vfacets" style="margin-bottom: 0px;">
+ <a href="/user/bananaruthy" class="dg">bananaruthy</a>
+ </div>
+ </div>
+ <div class="clearL" style="height: 1px;"></div>
+ </div>
+ </div>
+
+
+ <div id="homepage-featured-heading">
+ <div id="homepage-featured-more-top"><a id="hpVideoListMoreLink" href="/browse?s=rf">See More Featured Videos</a></div>
+ <h1 id="hpVideoListHead">Featured Videos</h1>
+ </div>
+
+ <div id="homepage-featured-tabs">
+ <a href="#" id="hpTopFavoritesLink" name="&lid=hpTopFavoritesTab&lpos=hpTabs" onclick="swapVideoList(this); return false;">Top Favorites</a>
+ <a href="#" id="hpMostDiscussedLink" name="&lid=hpMostDiscussedTab&lpos=hpTabs" onclick="swapVideoList(this); return false;">Most Discussed</a>
+ <a href="#" id="hpMostViewedLink" name="&lid=hpMostViewedTab&lpos=hpTabs" onclick="swapVideoList(this); return false;">Most Viewed</a>
+ <a href="#" id="hpFeaturedLink" name="&lid=hpFeaturedTab&lpos=hpTabs" onclick="swapVideoList(this); return false;" class="first hilite">Featured</a>
+ <div class="clear"></div>
+ </div>
+
+
+
+ <div id="homepage-video-list" class="browseListView">
+ <div id="hpFeatured">
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=uu-NTSZ27b0"><img src="http://i.ytimg.com/vi/uu-NTSZ27b0/default.jpg" class="vimg120" title="Caribbean PVC Marimba Children's Orchestra" qliconalt="uu-NTSZ27b0" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=uu-NTSZ27b0" title="Caribbean PVC Marimba Children's Orchestra" onclick="_hbLink('CaribbeanPVCMarimbaChildrensOrchestra','VidVert');">Caribbean PVC Marimba Children's...</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=uu-NTSZ27b0" title="Caribbean PVC Marimba Children's Orchestra" onclick="_hbLink('CaribbeanPVCMarimbaChildrensOrchestra','VidVert');">Caribbean PVC Marimba Children's Orchestra</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescuuNTSZ27b0">
+ Michael Greiner who is a neighbor and good friend of mine asked me to upload several Marim
+ </span>
+
+ <span id="RemainvidDescuuNTSZ27b0" style="display: none">Michael Greiner who is a neighbor and good friend of mine asked me to upload several Marimba videos for him (that's him on the left in the middle row). He currently teaches the music program at Aveson Charter School http://aveson.org/ and constructs musical instruments in classes with students' participation.<br/><br/>Michael Greiner created this set of plastic pipe marimbas. On this clip are three generations of prototypes designed to be low cost for use by childrens' programming. The top one bass version costs around $200 in materials. The mallets are home made using foam flip-flops mounted to sticks. Filmed at Norma Coombs primary school in Altadena CA in 2007.<br/><br/>*** Edited to Add ****<br/>Wow, it looks like this video's hit YouTube's front page. Thank you for all the wonderfully kind and supportive comments!</span>
+ <span id="MorevidDescuuNTSZ27b0" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescuuNTSZ27b0'); hideDiv('MorevidDescuuNTSZ27b0'); hideDiv('BeginvidDescuuNTSZ27b0'); showDiv('LessvidDescuuNTSZ27b0'); return false;">more</a>)</span>
+ <span id="LessvidDescuuNTSZ27b0" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescuuNTSZ27b0'); hideDiv('LessvidDescuuNTSZ27b0'); showDiv('BeginvidDescuuNTSZ27b0'); showDiv('MorevidDescuuNTSZ27b0'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/PlayHanghang">PlayHanghang</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 3,853<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-5.0" alt="4.84814814815" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">01:46</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=24">Entertainment</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=CFJRn7akXeQ"><img src="http://i.ytimg.com/vi/CFJRn7akXeQ/default.jpg" class="vimg120" title="&quot;Sharp Teeth&quot; Excerpt #1" qliconalt="CFJRn7akXeQ" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=CFJRn7akXeQ" title="&quot;Sharp Teeth&quot; Excerpt #1" onclick="_hbLink('SharpTeethExcerpt1','VidVert');">&quot;Sharp Teeth&quot; Excerpt #1</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=CFJRn7akXeQ" title="&quot;Sharp Teeth&quot; Excerpt #1" onclick="_hbLink('SharpTeethExcerpt1','VidVert');">&quot;Sharp Teeth&quot; Excerpt #1</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescCFJRn7akXeQ">
+ Check out the book "Sharp Teeth" on Amazon:<br/>http://www.amazon.com/Sharp-Teeth-Toby-Barlow
+ </span>
+
+ <span id="RemainvidDescCFJRn7akXeQ" style="display: none">Check out the book "Sharp Teeth" on Amazon:<br/>http://www.amazon.com/Sharp-Teeth-Toby-Barlow/dp/0061430226/ ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1212767529&sr=8-1<br/><br/>Animation directed by Limbert Fabian. Produced by Matt Thunell. For more information go to sharpteeththebook.com</span>
+ <span id="MorevidDescCFJRn7akXeQ" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescCFJRn7akXeQ'); hideDiv('MorevidDescCFJRn7akXeQ'); hideDiv('BeginvidDescCFJRn7akXeQ'); showDiv('LessvidDescCFJRn7akXeQ'); return false;">more</a>)</span>
+ <span id="LessvidDescCFJRn7akXeQ" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescCFJRn7akXeQ'); hideDiv('LessvidDescCFJRn7akXeQ'); showDiv('BeginvidDescCFJRn7akXeQ'); showDiv('MorevidDescCFJRn7akXeQ'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/tobybarlowny">tobybarlowny</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 67,438<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.39928057554" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">01:33</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=1">Film & Animation</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=sNROaXA6OSI"><img src="http://i.ytimg.com/vi/sNROaXA6OSI/default.jpg" class="vimg120" title="Touring to Alaska on Vegetable Oil!" qliconalt="sNROaXA6OSI" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=sNROaXA6OSI" title="Touring to Alaska on Vegetable Oil!" onclick="_hbLink('TouringtoAlaskaonVegetableOil','VidVert');">Touring to Alaska on Vegetable Oil!</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=sNROaXA6OSI" title="Touring to Alaska on Vegetable Oil!" onclick="_hbLink('TouringtoAlaskaonVegetableOil','VidVert');">Touring to Alaska on Vegetable Oil!</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescsNROaXA6OSI">
+ This video is for Mrs. Aderman's 1st Period Environmental Science Class.<br/><br/>We are Mose Gi
+ </span>
+
+ <span id="RemainvidDescsNROaXA6OSI" style="display: none">This video is for Mrs. Aderman's 1st Period Environmental Science Class.<br/><br/>We are Mose Giganticus and The Emotron and this year we are touring to Alaska on Vegetable Oil.</span>
+ <span id="MorevidDescsNROaXA6OSI" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescsNROaXA6OSI'); hideDiv('MorevidDescsNROaXA6OSI'); hideDiv('BeginvidDescsNROaXA6OSI'); showDiv('LessvidDescsNROaXA6OSI'); return false;">more</a>)</span>
+ <span id="LessvidDescsNROaXA6OSI" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescsNROaXA6OSI'); hideDiv('LessvidDescsNROaXA6OSI'); showDiv('BeginvidDescsNROaXA6OSI'); showDiv('MorevidDescsNROaXA6OSI'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/kylemotron">kylemotron</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 122,748<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.44329896907" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">04:02</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=27">Education</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=6iC3b5JnSIE"><img src="http://i.ytimg.com/vi/6iC3b5JnSIE/default.jpg" class="vimg120" title="JCJC" qliconalt="6iC3b5JnSIE" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=6iC3b5JnSIE" title="JCJC" onclick="_hbLink('JCJC','VidVert');">JCJC</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=6iC3b5JnSIE" title="JCJC" onclick="_hbLink('JCJC','VidVert');">JCJC</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDesc6iC3b5JnSIE">
+ His name is Okotanpe. <br/>His mail addless is fuseloopa@hotmail.com <br/><br/>The name of this son
+ </span>
+
+ <span id="RemainvidDesc6iC3b5JnSIE" style="display: none">His name is Okotanpe. <br/>His mail addless is fuseloopa@hotmail.com <br/><br/>The name of this song is 300ml(milk).<br/>An artist name is Rei harakami. <br/>Check it out!</span>
+ <span id="MorevidDesc6iC3b5JnSIE" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDesc6iC3b5JnSIE'); hideDiv('MorevidDesc6iC3b5JnSIE'); hideDiv('BeginvidDesc6iC3b5JnSIE'); showDiv('LessvidDesc6iC3b5JnSIE'); return false;">more</a>)</span>
+ <span id="LessvidDesc6iC3b5JnSIE" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDesc6iC3b5JnSIE'); hideDiv('LessvidDesc6iC3b5JnSIE'); showDiv('BeginvidDesc6iC3b5JnSIE'); showDiv('MorevidDesc6iC3b5JnSIE'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/YoneyaYu">YoneyaYu</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 532,447<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-5.0" alt="4.83995523223" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">05:26</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=24">Entertainment</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=L9Wu1V1JAHw"><img src="http://i.ytimg.com/vi/L9Wu1V1JAHw/default.jpg" class="vimg120" title="Certainty In Freedom ~ A Song for Burma (Original Song)" qliconalt="L9Wu1V1JAHw" partner="true" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=L9Wu1V1JAHw" title="Certainty In Freedom ~ A Song for Burma (Original Song)" onclick="_hbLink('CertaintyInFreedomASongforBurmaOriginalSong','VidVert');">Certainty In Freedom ~ A Song fo...</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=L9Wu1V1JAHw" title="Certainty In Freedom ~ A Song for Burma (Original Song)" onclick="_hbLink('CertaintyInFreedomASongforBurmaOriginalSong','VidVert');">Certainty In Freedom ~ A Song for Burma (Original Song)</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescL9Wu1V1JAHw">
+ I'm not a particularly political person, by which I mean I'd sooner just not get involved
+ </span>
+
+ <span id="RemainvidDescL9Wu1V1JAHw" style="display: none">I'm not a particularly political person, by which I mean I'd sooner just not get involved in conflict, but I realise that, at times, things happen outside your control which will you to say something or do something.<br/><br/>I got a comment on my last song from 'gersing' asking me if I'd sing a song for the monks and people of Burma. At first I misunderstood the comment but then it clicked and I felt compelled to offer something.. anything. <br/><br/>I know this song is going to change nothing; and I'm cautious calling it a protest song as I don't understand the situation fully (and I wouldn't want to upset anyone), but this is a tune I wrote in response to being repressed (I'm whatever guise) and how beautiful 'freedom' really is. I don't think anyone will ever understand that term fully but by singing and writing and thinking and speaking we can come somewhere close I'm sure. <br/><br/>As a disclaimer, I'd say that, personally, the chords and melody are arbitrary; merely the carrier of the sentiment...<br/><br/>Changing the subject ever so slightly I just wanted to say a big thank you to everyone that's shown support; it's overwhelming. An apology to anyone I've not yet responded to.. I've never been very good at juggling my time but I will be in touch.<br/><br/>Thanks again...<br/><br/>_________________<br/>Certainty In Freedom<br/><br/>If I had the will to talk<br/>I wonder if you'd give a thought <br/>To what I had to say - help make it go away<br/><br/>Cos there's certainty in freedom<br/>And in that we must believe in<br/>Cos I saw on the news today<br/><br/>If I saw you in the street now<br/>Would I look the other way?<br/>I hope I'm strong enough to say - help make it go away<br/><br/>When all you see is hatred<br/>Spirits crushed and souls deflated<br/>Easy to leave it for another day<br/><br/>Peace is pushing for love<br/>Love is leading the way<br/>You should follow its path<br/>Darkness leads you astray<br/>Peace is pushing for love<br/>Love is leading the way<br/><br/>So this, my only voice to speak<br/>My message strong, my tone is weak<br/>I find it hard to say - help make it go away<br/><br/>And if I come across obtuse<br/>I urge you now to cut the noose<br/>Don't leave it for another day<br/><br/>Peace is pushing for love<br/>Love is leading the way<br/>You should follow its path<br/>Darkness leads you astray<br/>Peace is pushing for love<br/>Love is leading the way<br/><br/>If I had the will to talk<br/>I wonder if you'd give a thought <br/>To what I had to say - help make it go away<br/><br/>Cos there's certainty in freedom<br/>And in that we must believe in<br/>Cos I saw on the news today<br/><br/>Peace is pushing for love<br/>Love is leading the way<br/>You should follow its path<br/>Darkness leads you astray<br/>Peace is pushing for love<br/>Love is leading the way<br/><br/>_____________________<br/>Peace<br/><br/>Available on the 'Unequal Measures', available through http://www.krisrowley.com<br/>© Kris Rowley 2007</span>
+ <span id="MorevidDescL9Wu1V1JAHw" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescL9Wu1V1JAHw'); hideDiv('MorevidDescL9Wu1V1JAHw'); hideDiv('BeginvidDescL9Wu1V1JAHw'); showDiv('LessvidDescL9Wu1V1JAHw'); return false;">more</a>)</span>
+ <span id="LessvidDescL9Wu1V1JAHw" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescL9Wu1V1JAHw'); hideDiv('LessvidDescL9Wu1V1JAHw'); showDiv('BeginvidDescL9Wu1V1JAHw'); showDiv('MorevidDescL9Wu1V1JAHw'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/zzzzzzzzap">zzzzzzzzap</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 136,222<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.65044814341" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">03:55</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=10">Music</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=gQNY7Sti8FY"><img src="http://s4.ytimg.com/vi/gQNY7Sti8FY/default.jpg" class="vimg120" title="the world is at your fingertips" qliconalt="gQNY7Sti8FY" partner="true" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=gQNY7Sti8FY" title="the world is at your fingertips" onclick="_hbLink('theworldisatyourfingertips','VidVert');">the world is at your fingertips</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=gQNY7Sti8FY" title="the world is at your fingertips" onclick="_hbLink('theworldisatyourfingertips','VidVert');">the world is at your fingertips</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescgQNY7Sti8FY">
+ for the taking.
+ </span>
+
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/SupaDupaFlyGirl">SupaDupaFlyGirl</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 509,825<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.0" alt="3.91057134971" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">05:15</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=28">Science & Technology</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=rGUt7ropzNA"><img src="http://i.ytimg.com/vi/rGUt7ropzNA/default.jpg" class="vimg120" title="Aimee Mann Freeway Video Contest" qliconalt="rGUt7ropzNA" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=rGUt7ropzNA" title="Aimee Mann Freeway Video Contest" onclick="_hbLink('AimeeMannFreewayVideoContest','VidVert');">Aimee Mann Freeway Video Contest</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=rGUt7ropzNA" title="Aimee Mann Freeway Video Contest" onclick="_hbLink('AimeeMannFreewayVideoContest','VidVert');">Aimee Mann Freeway Video Contest</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescrGUt7ropzNA">
+ Want a chance to sing with Aimee Mann live? Go to http://www.youtube.com/group/aimeemannco
+ </span>
+
+ <span id="RemainvidDescrGUt7ropzNA" style="display: none">Want a chance to sing with Aimee Mann live? Go to http://www.youtube.com/group/aimeemanncontest and upload a video of yourself singing Aimee Mann's new song "Freeway."<br/><br/>Aimee Mann and SuperEgo Records will pick their favorite entry to be featured on YouTube and www.aimeemann.com. The winner will have an opportunity to sing live with Aimee at one of her upcoming shows. Ten runners-up will receive an autographed copy of Aimee's new CD, @#%&*! Smilers.<br/><br/>Entrants can get the lyrics, the instrumental version of "Freeway" and contest details at: http://www.aimeemann.com/freewaycontest/<br/>Submissions must be received by July 7th 2008</span>
+ <span id="MorevidDescrGUt7ropzNA" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescrGUt7ropzNA'); hideDiv('MorevidDescrGUt7ropzNA'); hideDiv('BeginvidDescrGUt7ropzNA'); showDiv('LessvidDescrGUt7ropzNA'); return false;">more</a>)</span>
+ <span id="LessvidDescrGUt7ropzNA" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescrGUt7ropzNA'); hideDiv('LessvidDescrGUt7ropzNA'); showDiv('BeginvidDescrGUt7ropzNA'); showDiv('MorevidDescrGUt7ropzNA'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/aimeemann">aimeemann</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 283,776<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.0" alt="3.79036827195" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">02:22</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=10">Music</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=tbEei0I3kMQ"><img src="http://i.ytimg.com/vi/tbEei0I3kMQ/default.jpg" class="vimg120" title="Interactive card trick" qliconalt="tbEei0I3kMQ" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=tbEei0I3kMQ" title="Interactive card trick" onclick="_hbLink('Interactivecardtrick','VidVert');">Interactive card trick</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=tbEei0I3kMQ" title="Interactive card trick" onclick="_hbLink('Interactivecardtrick','VidVert');">Interactive card trick</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDesctbEei0I3kMQ">
+ This is the first interactive video on YouTube!<br/>Have fun and enjoy the show<br/>you can see
+ </span>
+
+ <span id="RemainvidDesctbEei0I3kMQ" style="display: none">This is the first interactive video on YouTube!<br/>Have fun and enjoy the show<br/>you can see our magician site:<br/>orenshalom.co.il</span>
+ <span id="MorevidDesctbEei0I3kMQ" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDesctbEei0I3kMQ'); hideDiv('MorevidDesctbEei0I3kMQ'); hideDiv('BeginvidDesctbEei0I3kMQ'); showDiv('LessvidDesctbEei0I3kMQ'); return false;">more</a>)</span>
+ <span id="LessvidDesctbEei0I3kMQ" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDesctbEei0I3kMQ'); hideDiv('LessvidDesctbEei0I3kMQ'); showDiv('BeginvidDesctbEei0I3kMQ'); showDiv('MorevidDesctbEei0I3kMQ'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/werneroi">werneroi</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 3,155,063<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-3.5" alt="3.41263230956" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">01:10</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=22">People & Blogs</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=irDEzQovftM"><img src="http://i.ytimg.com/vi/irDEzQovftM/default.jpg" class="vimg120" title="Biggest drawing in the world" qliconalt="irDEzQovftM" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=irDEzQovftM" title="Biggest drawing in the world" onclick="_hbLink('Biggestdrawingintheworld','VidVert');">Biggest drawing in the world</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=irDEzQovftM" title="Biggest drawing in the world" onclick="_hbLink('Biggestdrawingintheworld','VidVert');">Biggest drawing in the world</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescirDEzQovftM">
+ making the biggest drawing in the world
+ </span>
+
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/erikbjgn">erikbjgn</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 971,773<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.54770783066" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">04:04</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=1">Film & Animation</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=iAKJKBCyPUY"><img src="http://i.ytimg.com/vi/iAKJKBCyPUY/default.jpg" class="vimg120" title="Checkmate" qliconalt="iAKJKBCyPUY" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=iAKJKBCyPUY" title="Checkmate" onclick="_hbLink('Checkmate','VidVert');">Checkmate</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=iAKJKBCyPUY" title="Checkmate" onclick="_hbLink('Checkmate','VidVert');">Checkmate</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDesciAKJKBCyPUY">
+ The Internets Celebrities Dallas Penn and Rafi Kam go in for an investigative report on Ch
+ </span>
+
+ <span id="RemainvidDesciAKJKBCyPUY" style="display: none">The Internets Celebrities Dallas Penn and Rafi Kam go in for an investigative report on Check-Cashing. Themes explored include usury, economic instability, commercial banks and their profit line, and the cycle of poverty. <br/><br/>Oh yeah, it's a comedy.<br/><br/>The video is shot on location in Bushwick and Carroll Gardens in Brooklyn, New York. Also stars special guest Internets Celebrity Ben Popken of Consumerist.com.<br/><br/>Directed by Casimir Nozkowski<br/>Shot by Ian Savage, Josh Weisbrot<br/>Music by El Keter; instrumental from song "The Bottom Line" off Sankofa's album The Tortoise Hustle. Used with full permission.<br/><br/>http://www.internetscelebrities.com</span>
+ <span id="MorevidDesciAKJKBCyPUY" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDesciAKJKBCyPUY'); hideDiv('MorevidDesciAKJKBCyPUY'); hideDiv('BeginvidDesciAKJKBCyPUY'); showDiv('LessvidDesciAKJKBCyPUY'); return false;">more</a>)</span>
+ <span id="LessvidDesciAKJKBCyPUY" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDesciAKJKBCyPUY'); hideDiv('LessvidDesciAKJKBCyPUY'); showDiv('BeginvidDesciAKJKBCyPUY'); showDiv('MorevidDesciAKJKBCyPUY'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/InternetsCelebrities">InternetsCel...</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 412,830<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.52936962751" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">09:45</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=25">News & Politics</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=yLCl0xIg5-0"><img src="http://i.ytimg.com/vi/yLCl0xIg5-0/default.jpg" class="vimg120" title="Stories from the Front lines, Part 1" qliconalt="yLCl0xIg5-0" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=yLCl0xIg5-0" title="Stories from the Front lines, Part 1" onclick="_hbLink('StoriesfromtheFrontlinesPart1','VidVert');">Stories from the Front lines, Pa...</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=yLCl0xIg5-0" title="Stories from the Front lines, Part 1" onclick="_hbLink('StoriesfromtheFrontlinesPart1','VidVert');">Stories from the Front lines, Part 1</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescyLCl0xIg50">
+ Stories from the men and women of the miltary, stationed in the Al Anbar Province. Right f
+ </span>
+
+ <span id="RemainvidDescyLCl0xIg50" style="display: none">Stories from the men and women of the miltary, stationed in the Al Anbar Province. Right from the mouths of the troops themselves. Part 1 of 4</span>
+ <span id="MorevidDescyLCl0xIg50" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescyLCl0xIg50'); hideDiv('MorevidDescyLCl0xIg50'); hideDiv('BeginvidDescyLCl0xIg50'); showDiv('LessvidDescyLCl0xIg50'); return false;">more</a>)</span>
+ <span id="LessvidDescyLCl0xIg50" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescyLCl0xIg50'); hideDiv('LessvidDescyLCl0xIg50'); showDiv('BeginvidDescyLCl0xIg50'); showDiv('MorevidDescyLCl0xIg50'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/3rdID8487">3rdID8487</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 367,189<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.0" alt="4.2188365651" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">10:35</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=25">News & Politics</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+
+
+
+
+ <div class="vlentry" >
+
+ <div class="vlcontainer"><div class="v120WideEntry"><div class="v120WrapperOuter"><div class="v120WrapperInner"><a href="/watch?v=rFItE14EeSU"><img src="http://i.ytimg.com/vi/rFItE14EeSU/default.jpg" class="vimg120" title="Amazing video of multiple tornadoes in Northwest Kansas" qliconalt="rFItE14EeSU" partner="true" alt="video"></a></div></div> </div>
+
+ <div class="vldescbox">
+ <div class="vltitle">
+ <div class="vlshortTitle">
+ <a href="/watch?v=rFItE14EeSU" title="Amazing video of multiple tornadoes in Northwest Kansas" onclick="_hbLink('AmazingvideoofmultipletornadoesinNorthwestKansas','VidVert');">Amazing video of multiple tornad...</a>
+ </div>
+ <div class="vllongTitle">
+ <a href="/watch?v=rFItE14EeSU" title="Amazing video of multiple tornadoes in Northwest Kansas" onclick="_hbLink('AmazingvideoofmultipletornadoesinNorthwestKansas','VidVert');">Amazing video of multiple tornadoes in Northwest Kansas</a>
+ </div>
+ </div>
+
+ <div class="vldesc">
+
+
+ <span id="BeginvidDescrFItE14EeSU">
+ Video from TornadoVideos.net Live Stream Unit 3 of several tornadoes from close range.. In
+ </span>
+
+ <span id="RemainvidDescrFItE14EeSU" style="display: none">Video from TornadoVideos.net Live Stream Unit 3 of several tornadoes from close range.. Including one beautiful but strong rope and a large wedge tornado from within 1/2 mile. Check out TornadoVdeos.net for live streaming video, breaking weather news, and more extreme tornado footage.</span>
+ <span id="MorevidDescrFItE14EeSU" class="smallText">(<a href="#" class="eLink" onclick="showDiv('RemainvidDescrFItE14EeSU'); hideDiv('MorevidDescrFItE14EeSU'); hideDiv('BeginvidDescrFItE14EeSU'); showDiv('LessvidDescrFItE14EeSU'); return false;">more</a>)</span>
+ <span id="LessvidDescrFItE14EeSU" style="display: none" class="smallText">(<a href="#" class="eLink" onclick="hideDiv('RemainvidDescrFItE14EeSU'); hideDiv('LessvidDescrFItE14EeSU'); showDiv('BeginvidDescrFItE14EeSU'); showDiv('MorevidDescrFItE14EeSU'); return false;">less</a>)</span>
+
+
+
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+ </div>
+
+ <div class="vlfacets">
+ <div class="vladded">
+ </div>
+ <div><span class="grayText vlfromlbl">From:</span><span class="vlfrom"><a href="/user/TornadoVideosdotnet">TornadoVideo...</a></span></div>
+ <div class="clearL"></div>
+ <span class="grayText">Views:</span> 797,370<br/>
+
+ <div class="video-thumb-duration-rating">
+
+
+ <div>
+
+ <img class="ratingVS ratingVS-4.5" alt="4.28912552436" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+
+
+
+ </div>
+
+
+
+ <div class="runtime">07:10</div>
+ </div>
+
+ <div class="clear"></div>
+ <div class="vlcategory">
+ <span class="smgrayText">More in</span> <a href="/results?search_query=None&search_category=25">News & Politics</a>
+ </div>
+ </div>
+
+ <div class="vlclearaltl"></div>
+
+
+
+ </div> <!-- end vEntry -->
+
+
+ </div>
+ </div> <!-- end Video List -->
+ <div id="homepage-featured-more-bottom">
+ <div class="floatR"><a href="/browse?s=rf">See More Featured Videos</a></div>
+ <div class="clear"></div>
+ </div>
+</div>
+
+
+<div id="homepage-side-content" style="white-space: normal;">
+ <div>
+
+
+
+
+ <!-- Begin ad tag -->
+
+ <input type="hidden" id="pvaHl" value="en"/>
+ <input type="hidden" id="pvaTag" value="http://n4061ad.doubleclick.net/adj/com.ythome/_default;sz=399x299;kl=N;kga=-1;kgg=-1;tile=1;dcopt=ist;"/>
+ <input type="hidden" id="burl" value="http://www.youtube.com/pva/"/>
+ <input type="hidden" id="canv" value="False"/>
+ <div id="myAd_banner" style="visibility:hidden;height:35px;"></div>
+ <div id="myAd_pva">
+
+
+
+
+ <script type="text/javascript">
+ ord=Math.random()*10000000000000000 + 3;
+ if (false) {
+ ord = 1234567890;
+ }
+ document.write('<script language="JavaScript" src="http://n4061ad.doubleclick.net/adj/com.ythome/_default;sz=399x299;kl=N;kga=-1;kgg=-1;tile=1;dcopt=ist;ord=' + ord + '?" type="text/javascript"><\/script>');
+ </script>
+ <noscript><a
+ href="http://n4061ad.doubleclick.net/jump/_default;sz=399x299;ord=123456789?" target="_blank"><img
+ src="http://n4061ad.doubleclick.net/ad/_default;sz=399x299;ord=123456789?" width="399" height="299" border="0" alt=""></a>
+ </noscript>
+
+ </div>
+
+
+ <!-- End ad tag -->
+
+ </div>
+
+ <div class="homepage-content-block">
+ <div class="contentBox">
+ <div>
+ <div class="floatR"><span class="smallText"><b><a href="/signup">Sign Up</a> | <a href="http://help.youtube.com/support/youtube/bin/topic.py?topic=10546&amp;hl=en_US">Help</a></b></div>
+ <div class="floatL">
+ <span class="headerTitle homepage-block-heading-gray"> Login </span>
+ </div>
+ <div class="clear"></div>
+ </div>
+
+ <form method="post" name="loginForm" id="loginForm" action="signup">
+ <input type="hidden" name="action_login" value="1">
+ <table width="270">
+ <tr>
+ <td align="right"><label for="homeUsername"><span class="smallText"><b>Username:</b></span></label></td>
+ <td align="left"><input id="homeUsername" tabindex="101" class="smallText" type="text" size="16" name="username" value=""></td>
+ </tr>
+ <tr>
+ <td align="right"><label for="homePassword"><span class="smallText"><b>Password:</b></span></label></td>
+ <td align="left"><input id="homePassword" tabindex="102" class="smallText" type="password" size="16" name="password">
+ </tr>
+ <tr>
+ <td></td>
+ <td align="left">
+ <span><input type="submit" class="smallText" value="Login"></span>
+ </td>
+ </tr>
+ </table>
+ </form>
+ <div class="padT10 smallText">
+ <p align="center" class="marT0 marB0"><a href="/forgot_username?next=/">Forgot Username</a> | <a href="/forgot?next=/">Forgot Password</a></p>
+ </div>
+ <div class="homepage-border-dotted"></div>
+ <div class="alignC"><span class="smallText"><b><a href="
+https://www.google.com/accounts/ServiceLogin?service=youtube&hl=en_US&continue=http%3A//www.youtube.com/signup%3Fhl%3Den_US&passive=true">Login with your Google account</a>&nbsp; <a href="#" onClick="window.open('/t/help_gaia','login_help','width=580,height=480,resizable=yes,scrollbars=yes,status=0').focus();" rel="nofollow"><img src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" border="0" class="alignMid gaiaHelpBtn" alt=""></a></b></span></div>
+ </div>
+ </div> <!-- end homepage-content-block -->
+
+
+ <div class="homepage-content-block padT10">
+
+
+
+
+ <!-- Begin ad tag -->
+
+
+
+ <script type="text/javascript">
+ ord=Math.random()*10000000000000000 + 6;
+ if (false) {
+ ord = 1234567890;
+ }
+ document.write('<script language="JavaScript" src="http://n4061ad.doubleclick.net/adj/com.ythome/promo1;sz=300x50;kl=N;kga=-1;kgg=-1;tile=2;ord=' + ord + '?" type="text/javascript"><\/script>');
+ </script>
+ <noscript><a
+ href="http://n4061ad.doubleclick.net/jump/promo1;sz=300x50;ord=123456789?" target="_blank"><img
+ src="http://n4061ad.doubleclick.net/ad/promo1;sz=300x50;ord=123456789?" width="300" height="50" border="0" alt=""></a>
+ </noscript>
+
+
+ <!-- End ad tag -->
+
+ </div>
+
+ <div class="homepage-content-block padT10">
+
+
+
+
+ <!-- Begin ad tag -->
+
+
+
+ <script type="text/javascript">
+ ord=Math.random()*10000000000000000 + 6;
+ if (false) {
+ ord = 1234567890;
+ }
+ document.write('<script language="JavaScript" src="http://n4061ad.doubleclick.net/adj/com.ythome/promo3;sz=300x50;kl=N;kga=-1;kgg=-1;tile=4;ord=' + ord + '?" type="text/javascript"><\/script>');
+ </script>
+ <noscript><a
+ href="http://n4061ad.doubleclick.net/jump/promo3;sz=300x50;ord=123456789?" target="_blank"><img
+ src="http://n4061ad.doubleclick.net/ad/promo3;sz=300x50;ord=123456789?" width="300" height="50" border="0" alt=""></a>
+ </noscript>
+
+
+ <!-- End ad tag -->
+
+ </div>
+
+ <div class="homepage-side-block padT10">
+ <div class="homepage-yellow-block">
+ <div class="homepage-block-heading" style="color:#CC6600">What's New</div>
+
+ <div class="homepage-whatsnew-entry">
+ <div class="homepage-whatsnew-image"><a href="/t/annotations_about"><img src="http://s.ytimg.com/yt/img/whats_new/annotation-vfl42087.gif" border="0" width="30" height="37"/></a></div>
+ <div class="homepage-whatsnew-desc">
+ <b><a href="/t/annotations_about">Video Annotations</a></b><br/>Add interactive commentary and links to your videos
+ </div>
+ </div><div class="clear"></div>
+
+ <div class="homepage-whatsnew-entry">
+ <div class="homepage-whatsnew-image"><a href="/address_book"><img src="http://s.ytimg.com/yt/img/whats_new/addybook-vfl39351.gif" border="0" width="30" height="37"/></a></div>
+ <div class="homepage-whatsnew-desc">
+ <b><a href="/address_book">New Address Book</a></b><br/>Organizing your YouTube friends and contacts just got a lot simpler
+ </div>
+ </div><div class="clear"></div>
+
+ <div class="homepage-whatsnew-entry">
+ <div class="homepage-whatsnew-image"><a href="/inbox"><img src="http://s.ytimg.com/yt/img/whats_new/inbox-vfl39351.gif" border="0" width="30" height="37"/></a></div>
+ <div class="homepage-whatsnew-desc">
+ <b><a href="/inbox">Updated Inbox</a></b><br/>Manage your messages and invites with ease
+ </div>
+ </div><div class="clear"></div>
+
+
+ <div class="homepage-whatsnew-entry">
+ <div class="homepage-whatsnew-image"><a href="/mobile"><img src="http://s.ytimg.com/yt/img/whats_new/pic_home_mobile_30x37-vfl37458.gif" border="0" width="30" height="37"/></a></div>
+ <div class="homepage-whatsnew-desc">
+ <b><a href="/mobile">YouTube Mobile</a></b><br/> Watch and upload YouTube videos on your mobile device.
+ </div>
+ </div><div class="clear"></div>
+
+ <div class="bottomBorderDotted"></div>
+ <b><a href="/blog" style="color:#CC6600">Hear Ye, Hear Ye: Calling all Reporters</a></b><br>
+ Today we announce the launch of a new type of YouTube account: the Reporter. Reporter channels are just like the other YouTube channel types, but are specifically intended for citizens and profess...
+ <div class="alignR padT5">
+ <a href="/blog" style="color:#CC6600">Read more in our Blog</a>
+ </div>
+ <div style="font-size: 1px; height: 1px;"><br/></div>
+ </div><img class="homepage-yellow-block-bot" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" />
+</div>
+
+
+ <div class="homepage-side-block">
+
+
+
+
+ <!-- Begin ad tag -->
+
+
+
+ <script type="text/javascript">
+ ord=Math.random()*10000000000000000 + 6;
+ if (false) {
+ ord = 1234567890;
+ }
+ document.write('<script language="JavaScript" src="http://n4061ad.doubleclick.net/adj/com.ythome/promo2;sz=300x50;kl=N;kga=-1;kgg=-1;tile=3;ord=' + ord + '?" type="text/javascript"><\/script>');
+ </script>
+ <noscript><a
+ href="http://n4061ad.doubleclick.net/jump/promo2;sz=300x50;ord=123456789?" target="_blank"><img
+ src="http://n4061ad.doubleclick.net/ad/promo2;sz=300x50;ord=123456789?" width="300" height="50" border="0" alt=""></a>
+ </noscript>
+
+
+ <!-- End ad tag -->
+
+ </div>
+
+
+</div> <!-- end homepage-side-content -->
+
+<div class="clear"></div>
+
+
+
+ <div class="clear"></div>
+ <div id="footer">
+ <div class="search">
+ <div class="promo">
+ <a href="/youchoose" onclick="_hbLink('FooterPromo','Footer');"><img id="debates_footer_img" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" alt="footer-promo" /></a>
+ <a href="/youchoose" onclick="_hbLink('FooterPromo','Footer');">Face The Candidates</a>
+ </div>
+ <form autocomplete="off" name="footer-search-form" method="get" action="/results" style="width: 73.5%;">
+ <a href="http://www.google.com/webmasters/igoogle/youtube.html"><img id="igoogle_footer_img" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" alt=""/> <em id="igoogle_footer_text">Add to iGoogle</em></a>
+ <input type="text" name="search_query" maxlength="128" class="query" onkeyup="goog.i18n.bidi.setDirAttribute(event,this)" value="" id="footer-search-term">
+ <select class="search-type" name="search_type">
+ <option value="">Videos</option>
+ <option value="search_users" >Channels</option>
+ </select>
+ <input type="submit" name="search" value="Search" class="submit-button">
+ </form>
+ </div>
+ <div class="links">
+ <table cellpadding="0" cellspacing="0">
+ <tr>
+ <th colspan="2">Your Account</th>
+ <th class="separator" colspan="2">Help &amp; Info</th>
+ <th class="separator" colspan="2">YouTube</th>
+ </tr>
+ <tr>
+ <td><a href="/my_videos">Videos</a></td>
+ <td><a href="/inbox">Inbox</a></td>
+ <td class="separator"><a href="http://help.youtube.com/support/youtube/bin/static.py?page=start.cs&amp;hl=en_US">Help Resources</a></td>
+ <td><a href="/t/safety">Safety Tips</a></td>
+ <td class="separator"><a href="/t/about">Company Info</a></td>
+ <td><a href="/press_room">Press</a></td>
+ </tr>
+ <tr>
+ <td><a href="/my_favorites">Favorites</a></td>
+ <td><a href="/subscription_center">Subscriptions</a></td>
+ <td class="separator"><a href="/t/video_toolbox">Video Toolbox</a></td>
+ <td><a href="/t/dmca_policy">Copyright Notices</a></td>
+ <td class="separator"><a href="/testtube">TestTube</a></td>
+ <td><a href="/t/contact_us">Contact</a></td>
+ </tr>
+ <tr>
+ <td><a href="/my_playlists">Playlists</a></td>
+ <td><a href="/my_account">more...</a></td>
+ <td class="separator"><a href="/dev">Developer APIs</a></td>
+ <td><a href="/t/community_guidelines">Community Guidelines</a></td>
+ <td class="separator"><a href="/t/terms">Terms of Use</a></td>
+ <td>
+ <a href="/blog">Blog</a>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">&nbsp;</td>
+ <td class="separator"><a href="/advertise">Advertising</a></td>
+ <td><a href="/youtubeonyoursite">YouTube On Your Site</a></td>
+ <td class="separator"><a href="/t/privacy">Privacy Policy</a></td>
+ <td>
+ <a href="http://www.google.com/jobs/youtube">Jobs</a><br/>
+ </td>
+ </tr>
+
+
+
+ </table>
+ </div>
+ </div>
+ <div id="copyright">
+ &copy; 2008 YouTube, LLC
+ </div>
+
+
+</div> <!-- end baseDiv -->
+
+</body>
+<script type="text/javascript">
+ window.setTimeout('window.google.ac.install(document.searchForm,document.searchForm.search_query,"yt",true,"close",true,"Suggestions")',100);
+</script>
+
+
+
+</html> \ No newline at end of file
diff --git a/examples/xml/rsslisting/rsslisting.pro b/examples/xml/rsslisting/rsslisting.pro
index 95a23e9..c0a1ad3 100644
--- a/examples/xml/rsslisting/rsslisting.pro
+++ b/examples/xml/rsslisting/rsslisting.pro
@@ -8,3 +8,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS rsslisting.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/xml/rsslisting
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
diff --git a/examples/xml/saxbookmarks/main.cpp b/examples/xml/saxbookmarks/main.cpp
index 3f0a207..31c2246 100644
--- a/examples/xml/saxbookmarks/main.cpp
+++ b/examples/xml/saxbookmarks/main.cpp
@@ -47,7 +47,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow mainWin;
+#if defined(Q_OS_SYMBIAN)
+ mainWin.showFullScreen();
+#else
mainWin.show();
+#endif
mainWin.open();
return app.exec();
}
diff --git a/examples/xml/saxbookmarks/mainwindow.cpp b/examples/xml/saxbookmarks/mainwindow.cpp
index 9247eb7..18fe5ed 100644
--- a/examples/xml/saxbookmarks/mainwindow.cpp
+++ b/examples/xml/saxbookmarks/mainwindow.cpp
@@ -66,6 +66,9 @@ MainWindow::MainWindow()
void MainWindow::open()
{
+#if defined(Q_OS_SYMBIAN)
+ QDir::setCurrent("/Data/qt/saxbookmarks");
+#endif
QString fileName =
QFileDialog::getOpenFileName(this, tr("Open Bookmark File"),
QDir::currentPath(),
diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro
index d0eec44..3556c11 100644
--- a/examples/xml/saxbookmarks/saxbookmarks.pro
+++ b/examples/xml/saxbookmarks/saxbookmarks.pro
@@ -13,8 +13,17 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS saxbookmarks.pro *.xbel
sources.path = $$[QT_INSTALL_EXAMPLES]/xml/saxbookmarks
INSTALLS += target sources
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
+
wince*: {
addFiles.sources = frank.xbel jennifer.xbel
addFiles.path = \My Documents
DEPLOYMENT += addFiles
}
+
+symbian: {
+ TARGET.UID3 = 0xA000C60A
+ addFiles.sources = frank.xbel jennifer.xbel
+ addFiles.path = /data/qt/saxbookmarks
+ DEPLOYMENT += addFiles
+} \ No newline at end of file
diff --git a/examples/xml/streambookmarks/streambookmarks.pro b/examples/xml/streambookmarks/streambookmarks.pro
index e66b95a..f16a02e 100644
--- a/examples/xml/streambookmarks/streambookmarks.pro
+++ b/examples/xml/streambookmarks/streambookmarks.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xml/streambookmarks
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS streambookmarks.pro *.xbel
sources.path = $$[QT_INSTALL_EXAMPLES]/xml/streambookmarks
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xml/xml.pro b/examples/xml/xml.pro
index 866b0cc..2b6415c 100644
--- a/examples/xml/xml.pro
+++ b/examples/xml/xml.pro
@@ -1,12 +1,17 @@
TEMPLATE = subdirs
SUBDIRS = dombookmarks \
+ htmlinfo \
rsslisting \
saxbookmarks \
streambookmarks \
xmlstreamlint
+symbian: SUBDIRS = htmlinfo saxbookmarks
+
# install
target.path = $$[QT_INSTALL_EXAMPLES]/xml
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS xml.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/xml
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xml/xmlstreamlint/xmlstreamlint.pro b/examples/xml/xmlstreamlint/xmlstreamlint.pro
index 7034e7b..4f97387 100644
--- a/examples/xml/xmlstreamlint/xmlstreamlint.pro
+++ b/examples/xml/xmlstreamlint/xmlstreamlint.pro
@@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xml/xmlstreamlint
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS xmlstreamlint.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/xml/xmlstreamlint
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xmlpatterns/filetree/filetree.pro b/examples/xmlpatterns/filetree/filetree.pro
index 469ee8d..e30f2cf 100644
--- a/examples/xmlpatterns/filetree/filetree.pro
+++ b/examples/xmlpatterns/filetree/filetree.pro
@@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/filetree
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.xq *.html
sources.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/filetree
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xmlpatterns/recipes/recipes.pro b/examples/xmlpatterns/recipes/recipes.pro
index 87708a9..cee7b6d 100644
--- a/examples/xmlpatterns/recipes/recipes.pro
+++ b/examples/xmlpatterns/recipes/recipes.pro
@@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/recipes
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.xq *.html forms files
sources.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/recipes
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xmlpatterns/xmlpatterns.pro b/examples/xmlpatterns/xmlpatterns.pro
index 1a57005..081abde 100644
--- a/examples/xmlpatterns/xmlpatterns.pro
+++ b/examples/xmlpatterns/xmlpatterns.pro
@@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS xmlpatterns.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro b/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro
index 8ca900b..0016c41 100644
--- a/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro
+++ b/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro
@@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/xquery/globalVariables
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.cpp *.pro *.xq *.html globals.gccxml
sources.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/xquery/globalVariables
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/examples/xmlpatterns/xquery/xquery.pro b/examples/xmlpatterns/xquery/xquery.pro
index f7ac5ef..2a91188 100644
--- a/examples/xmlpatterns/xquery/xquery.pro
+++ b/examples/xmlpatterns/xquery/xquery.pro
@@ -6,3 +6,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/xquery
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS xquery.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/xquery
INSTALLS += target sources
+
+include($$QT_SOURCE_TREE/examples/examplebase.pri)
diff --git a/mkspecs/common/symbian/fixed_stdlib.h b/mkspecs/common/symbian/fixed_stdlib.h
new file mode 100644
index 0000000..7fd73d6
--- /dev/null
+++ b/mkspecs/common/symbian/fixed_stdlib.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef FIXED_STDLIB_H
+#define FIXED_STDLIB_H
+
+// This hack fixes defect in Symbian stdlib.h. The original file
+// does not work correctly when intermixing C and C++ (STL). Remove the hack
+// when Open C / C++ team has fixed the defect.
+
+// If _WCHAR_T_DECLARED is defined, undef it and store information that we
+// need to revert the _WCHAR_T_DECLARED define after include
+# ifdef _WCHAR_T_DECLARED
+# define REVERT_WCHAR_T_DECLARED
+# undef _WCHAR_T_DECLARED
+# endif //_WCHAR_T_DECLARED
+
+#include <stdlib.h>
+
+// Revert _WCHAR_T_DECLARED if necessary
+# ifdef REVERT_WCHAR_T_DECLARED
+# define _WCHAR_T_DECLARED
+# undef REVERT_WCHAR_T_DECLARED
+# endif //REVERT_WCHAR_T_DECLARED
+
+#endif \ No newline at end of file
diff --git a/mkspecs/common/symbian/qplatformdefs.h b/mkspecs/common/symbian/qplatformdefs.h
new file mode 100644
index 0000000..ebcd295
--- /dev/null
+++ b/mkspecs/common/symbian/qplatformdefs.h
@@ -0,0 +1,166 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the qmake spec 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPLATFORMDEFS_H
+#define QPLATFORMDEFS_H
+
+// Get Qt defines/settings
+
+#include "qglobal.h"
+
+// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
+
+// 1) need to reset default environment if _BSD_SOURCE is defined
+// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0
+// 3) it seems older glibc need this to include the X/Open stuff
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
+
+#include <unistd.h>
+
+
+// We are hot - unistd.h should have turned on the specific APIs we requested
+
+//#include <features.h>
+#include <pthread.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <grp.h>
+#include <pwd.h>
+//#include <signal.h>
+#include <dlfcn.h>
+#include <sys/select.h>
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/ipc.h>
+#include <sys/time.h>
+#include <sys/shm.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <netinet/in.h>
+#ifndef QT_NO_IPV6IFNAME
+#include <net/if.h>
+#endif
+#include <arpa/inet.h>
+
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_STATBUF struct stat64
+#define QT_STATBUF4TSTAT struct stat64
+#define QT_STAT ::stat64
+#define QT_FSTAT ::fstat64
+#define QT_LSTAT ::lstat64
+#define QT_OPEN ::open64
+#define QT_TRUNCATE ::truncate64
+#define QT_FTRUNCATE ::ftruncate64
+#define QT_LSEEK ::lseek64
+#else
+#define QT_STATBUF struct stat
+#define QT_STATBUF4TSTAT struct stat
+#define QT_STAT ::stat
+#define QT_FSTAT ::fstat
+#define QT_LSTAT ::lstat
+#define QT_OPEN ::open
+#define QT_TRUNCATE ::truncate
+#define QT_FTRUNCATE ::ftruncate
+#define QT_LSEEK ::lseek
+#endif
+
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_FOPEN ::fopen64
+#define QT_FSEEK ::fseeko64
+#define QT_FTELL ::ftello64
+#define QT_FGETPOS ::fgetpos64
+#define QT_FSETPOS ::fsetpos64
+#define QT_FPOS_T fpos64_t
+#define QT_OFF_T off64_t
+#else
+#define QT_FOPEN ::fopen
+#define QT_FSEEK ::fseek
+#define QT_FTELL ::ftell
+#define QT_FGETPOS ::fgetpos
+#define QT_FSETPOS ::fsetpos
+#define QT_FPOS_T fpos_t
+#define QT_OFF_T long
+#endif
+
+#define QT_STAT_REG S_IFREG
+#define QT_STAT_DIR S_IFDIR
+#define QT_STAT_MASK S_IFMT
+#define QT_STAT_LNK S_IFLNK
+#define QT_SOCKET_CONNECT ::connect
+#define QT_SOCKET_BIND ::bind
+#define QT_FILENO fileno
+#define QT_CLOSE ::close
+#define QT_READ ::read
+#define QT_WRITE ::write
+#define QT_ACCESS ::access
+#define QT_GETCWD ::getcwd
+#define QT_CHDIR ::chdir
+#define QT_MKDIR ::mkdir
+#define QT_RMDIR ::rmdir
+#define QT_OPEN_RDONLY O_RDONLY
+#define QT_OPEN_WRONLY O_WRONLY
+#define QT_OPEN_RDWR O_RDWR
+#define QT_OPEN_CREAT O_CREAT
+#define QT_OPEN_TRUNC O_TRUNC
+#define QT_OPEN_APPEND O_APPEND
+
+#define QT_SIGNAL_RETTYPE void
+#define QT_SIGNAL_ARGS int
+#define QT_SIGNAL_IGNORE SIG_IGN
+
+#if (defined(__GLIBC__) && (__GLIBC__ >= 2)) || defined(Q_OS_SYMBIAN)
+#define QT_SOCKLEN_T socklen_t
+#else
+#define QT_SOCKLEN_T int
+#endif
+
+
+#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
+#define QT_SNPRINTF ::snprintf
+#define QT_VSNPRINTF ::vsnprintf
+#endif
+
+
+#endif // QPLATFORMDEFS_H
diff --git a/mkspecs/common/symbian/stl-off/new b/mkspecs/common/symbian/stl-off/new
new file mode 100644
index 0000000..3939e11
--- /dev/null
+++ b/mkspecs/common/symbian/stl-off/new
@@ -0,0 +1,5 @@
+// new implemented in symbian libs, do nothing here, just keep Qt happpy
+#ifndef __NEW_SYMB_ADDON
+#define __NEW_SYMB_ADDON
+#include <e32base.h>
+#endif //__NEW_SYMB_ADDON
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
new file mode 100644
index 0000000..663a1df
--- /dev/null
+++ b/mkspecs/common/symbian/symbian.conf
@@ -0,0 +1,139 @@
+#
+# qmake configuration for symbian-*
+#
+
+TEMPLATE = app
+CONFIG += qt warn_on release incremental
+QT += core gui
+QMAKE_INCREMENTAL_STYLE = sublib
+
+DEFINES += UNICODE QT_KEYPAD_NAVIGATION
+QMAKE_COMPILER_DEFINES += SYMBIAN
+
+QMAKE_EXT_OBJ = .o
+QMAKE_EXT_RES = _res.o
+
+QMAKE_CC = gcc
+QMAKE_LEX = flex
+QMAKE_LEXFLAGS =
+QMAKE_YACC = byacc
+QMAKE_YACCFLAGS = -d
+QMAKE_CFLAGS =
+QMAKE_CFLAGS_DEPS =
+QMAKE_CFLAGS_WARN_ON =
+QMAKE_CFLAGS_WARN_OFF =
+QMAKE_CFLAGS_RELEASE =
+QMAKE_CFLAGS_DEBUG =
+QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+QMAKE_CXX = g++
+QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
+QMAKE_CXXFLAGS.CW =
+QMAKE_CXXFLAGS.ARMCC = --no_hide_all
+QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
+QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
+QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
+QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
+QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
+QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
+QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
+QMAKE_CXXFLAGS_RTTI_ON =
+QMAKE_CXXFLAGS_RTTI_OFF =
+QMAKE_CXXFLAGS_EXCEPTIONS_ON =
+QMAKE_CXXFLAGS_EXCEPTIONS_OFF =
+
+QMAKE_INCDIR =
+QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS]
+
+QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src
+QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
+QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
+QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+QMAKE_LINK = g++
+QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
+QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads -Wl
+QMAKE_LFLAGS_EXCEPTIONS_OFF =
+QMAKE_LFLAGS_RELEASE = -Wl,-s
+QMAKE_LFLAGS_DEBUG =
+QMAKE_LFLAGS_CONSOLE = -Wl,-subsystem,console
+QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
+QMAKE_LFLAGS_DLL = -shared
+QMAKE_LINK_OBJECT_MAX = 10
+QMAKE_LINK_OBJECT_SCRIPT= object_script
+
+QMAKE_DESKTOPSERVICES_LIBS = -lsendas2 -lplatformenv -lcommonui -letext -lapmime
+QMAKE_STATUSPANE_LIBS = -lavkon -leikcoctl
+
+QMAKE_LIBS = -llibc -llibm -leuser -llibdl
+QMAKE_LIBS_CORE = $$QMAKE_LIBS -llibpthread -lefsrv
+QMAKE_LIBS_GUI = $$QMAKE_LIBS_CORE -lfbscli -lbitgdi -lhal -lgdi -lws32 -lapgrfx -lcone -leikcore $$QMAKE_DESKTOPSERVICES_LIBS $$QMAKE_STATUSPANE_LIBS -lmediaclientaudio
+QMAKE_LIBS_NETWORK =
+QMAKE_LIBS_OPENGL =
+QMAKE_LIBS_OPENVG = -llibOpenVG -llibEGL -lcone
+QMAKE_LIBS_COMPAT =
+QMAKE_LIBS_QT_ENTRY = -llibcrt0.lib
+
+!isEmpty(QMAKE_SH) {
+ QMAKE_COPY = cp
+ QMAKE_COPY_DIR = cp -r
+ QMAKE_MOVE = mv
+ QMAKE_DEL_FILE = rm
+ QMAKE_MKDIR = mkdir
+ QMAKE_DEL_DIR = rmdir
+ QMAKE_CHK_DIR_EXISTS = test -d
+} else {
+ QMAKE_COPY = copy /y
+ QMAKE_COPY_DIR = xcopy /s /q /y /i
+ QMAKE_MOVE = move
+ QMAKE_DEL_FILE = del
+ QMAKE_MKDIR = mkdir
+ QMAKE_DEL_DIR = rmdir
+ QMAKE_CHK_DIR_EXISTS = if not exist
+}
+
+QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe
+QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe
+QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe
+
+QMAKE_IDL = midl
+QMAKE_LIB = ar -ru
+QMAKE_RC = windres
+QMAKE_ZIP = zip -r -9
+
+QMAKE_STRIP = strip
+QMAKE_STRIPFLAGS_LIB += --strip-unneeded
+
+load(qt_config)
+load(platform_paths)
+
+MMP_RULES += EXPORTUNFROZEN PAGED
+SYMBIAN_PLATFORMS = WINSCW GCCE ARMV5 ARMV6
+
+# Legacy support requires some hardcoded stdapis paths.
+INCLUDEPATH = \
+ $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian/stl-off \
+ $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian \
+ $${EPOCROOT}epoc32/include \
+ $$OS_LAYER_LIBC_SYSTEMINCLUDE \
+ $$INCLUDEPATH
+
+# Supports S60 3.0, 3.1, 3.2 and 5.0 by default
+default_deployment.depends = \
+ "[0x101F7961],0,0,0,{\"S60ProductID\"}" \
+ "[0x102032BE],0,0,0,{\"S60ProductID\"}" \
+ "[0x102752AE],0,0,0,{\"S60ProductID\"}" \
+ "[0x1028315F],0,0,0,{\"S60ProductID\"}"
+
+DEPLOYMENT += default_deployment
+
+exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/Series60v5.0.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/Series60v5.0.sis) {
+ S60_VERSION = 5.0
+} else {
+ exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/Series60v3.2.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/Series60v3.2.sis) {
+ S60_VERSION = 3.2
+ } else {
+ S60_VERSION = 3.1
+ MMP_RULES -= PAGED
+ }
+}
diff --git a/mkspecs/features/debug_and_release.prf b/mkspecs/features/debug_and_release.prf
index 8b89321..19031ef 100644
--- a/mkspecs/features/debug_and_release.prf
+++ b/mkspecs/features/debug_and_release.prf
@@ -1 +1 @@
-!macx-xcode:addExclusiveBuilds(debug, Debug, release, Release)
+!macx-xcode:!symbian-abld:addExclusiveBuilds(debug, Debug, release, Release)
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 0c6e09a..a790b60 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -118,6 +118,14 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
}
+ isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:symbian: {
+ QT_ITEM = $${QTPLUG}.dll
+
+ eval(qt_additional_plugin_$${QTPLUG}.sources = $${QT_ITEM})
+ eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH})
+
+ DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
+ }
}
}
#specific module settings
diff --git a/mkspecs/features/qttest_p4.prf b/mkspecs/features/qttest_p4.prf
index e9d79b0..ae58c5d 100644
--- a/mkspecs/features/qttest_p4.prf
+++ b/mkspecs/features/qttest_p4.prf
@@ -3,6 +3,14 @@ CONFIG += qt warn_on console depend_includepath
qtAddLibrary(QtTest)
+symbian:{
+# qt.prf sets TARGET.EPOCSTACKSIZE and TARGET.EPOCHEAPSIZE
+# DEFINES += QTEST_NO_SPECIALIZATIONS
+ TARGET.UID3 = $$generate_test_uid($$TARGET)
+ TARGET.CAPABILITY="ALL -TCB"
+ RSS_RULES ="group_name=\"QtTests\";"
+}
+
# prefix test binary with tst_
!contains(TARGET, ^tst_.*):TARGET = $$join(TARGET,,"tst_")
diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf
new file mode 100644
index 0000000..df4bb1c
--- /dev/null
+++ b/mkspecs/features/symbian/application_icon.prf
@@ -0,0 +1,39 @@
+load(data_caging_paths)
+
+# If no_icon keyword exist, the S60 UI app is just made hidden. This because S60 app FW
+# requires the registration resource file to exist always
+contains( CONFIG, no_icon ) {
+ symbian:RSS_RULES ="hidden = KAppIsHidden;"
+ CONFIG -= no_icon
+} else {
+# There is no sense to compile MIF icon is no_icon CONFIGS is set
+ !isEmpty(ICON) {
+
+ !count(ICON, $$size(TRANSLATIONS)):!count(ICON, 1) {
+ message("ICON keyword must have one or the same amout of items as in TRANSLATIONS keyword")
+ }
+
+ # MIF files will have UID in their names, if TARGET.UID3 is not set we need to generate it
+ isEmpty(TARGET.UID3):TARGET.UID3 = $$generate_test_uid($$TARGET)
+
+ # Note: symbian-sbsv2 builds can't utilize extra compiler for mifconv, so ICON handling is done in code
+ symbian-abld {
+ #Makefile: requires paths with backslash
+ ICON = $$replace( ICON, /, \\)
+
+ # Extra compiler rules for mifconv
+ mifconv.output = ${ZDIR}$$APP_RESOURCE_DIR/$${TARGET.UID3}.mif
+ # Based on: http://www.forum.nokia.com/document/Cpp_Developers_Library
+ # svg-t icons should always use /c32 depth
+ mifconv.commands = mifconv ${QMAKE_FILE_OUT} $$join(ICON, " /c32 ", "/c32 ",)
+ mifconv.input = ICON
+ mifconv.CONFIG = no_link combine
+ # target_predeps together with combine seems not to work correctly, lets define it by ourselves
+ PRE_TARGETDEPS += $$mifconv.output
+ QMAKE_EXTRA_COMPILERS += mifconv
+ }
+ # Rules to use generated MIF file from symbian resources
+ RSS_RULES.number_of_icons = $$size(ICON)
+ RSS_RULES.icon_file = $$replace( APP_RESOURCE_DIR, /, \\\\ )\\\\$${TARGET.UID3}.mif
+ }
+} \ No newline at end of file
diff --git a/mkspecs/features/symbian/data_caging_paths.prf b/mkspecs/features/symbian/data_caging_paths.prf
new file mode 100644
index 0000000..3ed5661
--- /dev/null
+++ b/mkspecs/features/symbian/data_caging_paths.prf
@@ -0,0 +1,80 @@
+#
+# ==============================================================================
+# Name : data_caging_paths.prf
+# Part of :
+# Interface : Data Caging Path Definitions API for Qt/S60
+# Description : Predefined include paths to be used in the pro-files for the
+# paths related to data caging.
+#
+# Usage examples:
+#
+# # Load these definitions on pro-file if needed:
+# load(data_caging_paths)
+#
+# # These variables are mostly useful when specifying deployment
+#
+# myLib.sources = myLib.dll
+# myLib.path = $$SHARED_LIB_DIR
+# DEPLOYMENT += myLib
+#
+# # Note: Do not use $$PLUGINS_DIR or $$PLUGINS_1_DIR to deploy Qt plugins.
+# # $$QT_PUBLIC_PLUGINS_BASE specifies the public base directory for Qt
+# # plugin stubs:
+#
+# myPublicImageFormatPlugin.sources = myImageFormat.dll
+# myPublicImageFormatPlugin.path = $$QT_PLUGINS_BASE_DIR/imageformats
+# DEPLOYMENT += myPublicImageFormatPlugin
+#
+# ==============================================================================
+
+exists($${EPOCROOT}epoc32/include/data_caging_paths.prf) {
+
+ # Load platform specific paths
+ load($${EPOCROOT}epoc32/include/data_caging_paths.prf)
+
+} else {
+ # No platform specific paths provided, use default paths
+
+ APPARC_RECOGNISER_RESOURCES_DIR = /resource/apps/registrationresourcefiles
+ APP_BITMAP_DIR = /resource/apps
+ APP_RESOURCE_DIR = /resource/apps
+ BITMAP_DIR = /resource/apps
+ BIOFILE_DIR = /resource/messaging/bif
+ CHARCONV_PLUGIN_DIR = /resource/charconv
+ CONTACTS_RESOURCE_DIR = /resource/cntmodel
+ CTRL_PANEL_RESOURCE_DIR = /resource/controls
+ CONVERTER_PLUGIN_RESOURCE_DIR = /resource/convert
+ ECOM_RESOURCE_DIR = /resource/plugins
+ ERROR_RESOURCE_DIR = /resource/errors
+ PROGRAMS_DIR = /sys/bin
+ FEP_RESOURCES_DIR = /resource/fep
+ HELP_FILE_DIR = /resource/help
+ LOG_ENGINE_RESOURCE_DIR = /resource/logengine
+ MTM_RESOURCE_DIR = /resource/messaging
+ MTM_INFO_FILE_DIR = /resource/messaging/mtm
+ PRINTER_DRIVER_DIR = /resource/printers
+ SHARED_LIB_DIR = /sys/bin
+ UIKLAF_RESOURCE_DIR = /resource/uiklaf
+ WAPPUSH_PLUGIN_RESOURCE_DIR = /resource/messaging/wappush
+ WATCHER_PLUGIN_RESOURCE_DIR = /resource/messaging/watchers
+ RECOGNISERS_DIR = /sys/bin
+ PARSERS_DIR = /sys/bin
+ NOTIFIERS_DIR = /sys/bin
+ PLUGINS_DIR = /sys/bin
+ PLUGINS_1_DIR = /sys/bin
+ RESOURCE_FILES_DIR = /resource
+
+ CA_CERTIFICATES_DIR = /private/101f72a6
+ COMMDB_DIR = /private/100012a5
+ SS_CONFIG_FILE_DIR = /private/101f7989/esock
+ TRUSTED_FONTS_DIR = /private/10003a16/fonts
+ UNTRUSTED_FONT_DIR = /private/10003a16/import/fonts
+ WINDOW_SERVER_INI_DIR = /private/10003b20
+ SKINS_DIR = /private/10207114
+ BOOTDATA_DIR = /resource/bootdata
+}
+
+isEmpty(QT_PLUGINS_BASE_DIR): QT_PLUGINS_BASE_DIR = /$$RESOURCE_FILES_DIR/qt/plugins
+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
diff --git a/mkspecs/features/symbian/default_post.prf b/mkspecs/features/symbian/default_post.prf
new file mode 100644
index 0000000..3c2944c
--- /dev/null
+++ b/mkspecs/features/symbian/default_post.prf
@@ -0,0 +1,31 @@
+load(default_post)
+
+contains(TEMPLATE, ".*app") {
+ contains(CONFIG, stdbinary) {
+ QMAKE_LIBS +=
+ } else:contains(QT, gui):contains(CONFIG,qt) {
+ S60MAIN_LIBS = -leuser -lavkon -leikcore -leiksrv -lws32 -lapparc -lcone -leikcoctl -lbafl -lefsrv
+ QMAKE_LIBS += -lqtmain.lib $$S60MAIN_LIBS
+ } else {
+ QMAKE_LIBS += $$QMAKE_LIBS_QT_ENTRY
+ }
+}
+contains(TEMPLATE, lib): {
+ contains(CONFIG, staticlib)|contains(CONFIG, static): {
+ # Static libs should not have LIBRARY statements in S60
+ QMAKE_LIBS =
+ # Static libs do not need def files
+ MMP_RULES -= EXPORTUNFROZEN
+ }
+ contains(CONFIG, plugin):!contains(CONFIG, stdbinary): {
+ # Plugins based on normal libraries have predefined def file
+ MMP_RULES -= EXPORTUNFROZEN
+ }
+} else {
+ # Applications don't need this
+ MMP_RULES -= EXPORTUNFROZEN
+}
+
+contains(TEMPLATE, ".*app"):contains(QT, gui):contains(CONFIG,qt) {
+ load(application_icon.prf)
+} \ No newline at end of file
diff --git a/mkspecs/features/symbian/default_pre.prf b/mkspecs/features/symbian/default_pre.prf
new file mode 100644
index 0000000..ddb23b3
--- /dev/null
+++ b/mkspecs/features/symbian/default_pre.prf
@@ -0,0 +1,2 @@
+CONFIG = stl_off $$CONFIG
+load(default_pre)
diff --git a/mkspecs/features/symbian/epocallowdlldata.prf b/mkspecs/features/symbian/epocallowdlldata.prf
new file mode 100644
index 0000000..b336f48
--- /dev/null
+++ b/mkspecs/features/symbian/epocallowdlldata.prf
@@ -0,0 +1 @@
+TARGET.EPOCALLOWDLLDATA=1
diff --git a/mkspecs/features/symbian/moc.prf b/mkspecs/features/symbian/moc.prf
new file mode 100644
index 0000000..089dddc
--- /dev/null
+++ b/mkspecs/features/symbian/moc.prf
@@ -0,0 +1,16 @@
+load(moc)
+
+RET = $$find(MOC_DIR, "\.[a-z]")
+!isEmpty(RET):{
+ error("Symbian does not support directories starting with a dot. Please set MOC_DIR to a different value in your profile.")
+}
+
+RET = $$find(RCC_DIR, "\.[a-z]")
+!isEmpty(RET):{
+ error("Symbian does not support directories starting with a dot. Please set RCC_DIR to a different value in your profile.")
+}
+
+RET = $$find(OBJECTS_DIR, "\.[a-z]")
+!isEmpty(RET):{
+ error("Symbian does not support directories starting with a dot. Please set OBJECTS_DIR to a different value in your profile.")
+}
diff --git a/mkspecs/features/symbian/platform_paths.prf b/mkspecs/features/symbian/platform_paths.prf
new file mode 100644
index 0000000..bec9811
--- /dev/null
+++ b/mkspecs/features/symbian/platform_paths.prf
@@ -0,0 +1,480 @@
+#
+# ==============================================================================
+# Name : platform_paths.prf
+# Part of :
+# Interface : Platform Path Definitions API for Qt/S60
+# Description : Predefined include paths to be used in the pro-files for the
+# components in the layered model. There is one definition for
+# each layer. The pro-file should use the statement that is
+# intended for the same layer as where the pro-file resides.
+#
+# Usage examples:
+#
+# Note: this file gets automatically added to all Qt/S60 projects
+#
+# Variable usages to add the system include paths
+#
+# The include paths has to be related to the layer in which your SW
+# resides. Thus as an example: a component residing in middleware
+# layer should use the MW specific macro.
+#
+# INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+# INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_SYSTEMINCLUDE
+#
+# If there is a need to include public headers of some S60 component,
+# various *_EXPORT_PATH macros can be utilized:
+#
+# INCLUDEPATH += $$OS_LAYER_PUBLIC_EXPORT_PATH(somecomponent)
+#
+# Variables related to using various parts of stdapis:
+#
+# To use STLLIB you need to have this in your pro-file:
+#
+# QMAKE_CXXFLAGS.CW *= $$STLLIB_USAGE_CW_FLAGS
+# DEFINES *= $$STLLIB_USAGE_DEFINES
+#
+# Depending on what module you are using from stdapis you need to have
+# one or more of the following variables in your pro-file.
+#
+# INCLUDEPATH += $$OS_LAYER_LIBC_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_GLIB_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_SSL_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_STDCPP_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_BOOST_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_DBUS_SYSTEMINCLUDE
+# INCLUDEPATH += $$OS_LAYER_LIBUTILITY_SYSTEMINCLUDE
+#
+#
+#
+#
+# ==============================================================================
+
+exists($${EPOCROOT}epoc32/include/platform_paths.prf) {
+
+ # Load platform specific paths
+ load($${EPOCROOT}epoc32/include/platform_paths.prf)
+
+} else {
+
+ # No platform specific paths provided, use default paths
+
+ exists($${EPOCROOT}epoc32/include/platform) { # New SF structure
+
+ # ---------------------------------------
+ # Location, where the applications layer specific public headers are exported
+ # ---------------------------------------
+
+ defineReplace(APP_LAYER_SDK_EXPORT_PATH) {
+ return (/epoc32/include/app/$$1)
+ }
+ defineReplace(APP_LAYER_PUBLIC_EXPORT_PATH) {
+ return (/epoc32/include/app/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the applications layer specific platform headers are exported
+ # ---------------------------------------
+
+ defineReplace(APP_LAYER_DOMAIN_EXPORT_PATH) {
+ return (/epoc32/include/platform/app/$$1)
+ }
+ defineReplace(APP_LAYER_PLATFORM_EXPORT_PATH) {
+ return (/epoc32/include/platform/app/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the middleware layer specific public headers are exported
+ # ---------------------------------------
+
+ defineReplace(MW_LAYER_SDK_EXPORT_PATH) {
+ return (/epoc32/include/mw/$$1)
+ }
+ defineReplace(MW_LAYER_PUBLIC_EXPORT_PATH) {
+ return (/epoc32/include/mw/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the middleware layer specific platform headers are exported
+ # ---------------------------------------
+
+ defineReplace(MW_LAYER_DOMAIN_EXPORT_PATH) {
+ return (/epoc32/include/platform/mw/$$1)
+ }
+ defineReplace(MW_LAYER_PLATFORM_EXPORT_PATH) {
+ return (/epoc32/include/platform/mw/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the os layer specific public headers are exported
+ # ---------------------------------------
+
+ defineReplace(OSEXT_LAYER_SDK_EXPORT_PATH) {
+ return (/epoc32/include/$$1)
+ }
+ # WARNING: If the following path changes see the exists() function around line 219
+ defineReplace(OS_LAYER_PUBLIC_EXPORT_PATH) {
+ return (/epoc32/include/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the os specific platform headers are exported
+ # ---------------------------------------
+
+ defineReplace(OSEXT_LAYER_DOMAIN_EXPORT_PATH) {
+ return (/epoc32/include/platform/$$1)
+ }
+ defineReplace(OS_LAYER_PLATFORM_EXPORT_PATH) {
+ return (/epoc32/include/platform/$$1)
+ }
+
+ # ---------------------------------------
+ # General comments about the 3 define statements related to include paths:
+ # 1) the /epoc32/include/oem is now defined there for backward compability.
+ # Once the directory is empty, the directory will be removed. However this
+ # enables us to ensure that if you use these define statements => you do
+ # not have to remove the statements later on, when the directory no longer
+ # exists.
+ # 2) These statements should be enough in normal cases. For certain specific
+ # cases you might need to add some specific directory from /epoc32/include
+ # (for instance /epoc32/include/ecom).
+ # In normal cases the include staments in code should be relative to one of
+ # the system include paths, but in certain cases, the included files requires
+ # that the subdirectory is also part of the system include paths.
+ # ---------------------------------------
+
+ # This variable defines the include paths, which are intended to be
+ # used in the pro-files that are part of the applications-layer. It includes all
+ # the needed directories from the /epoc32/include, that are valid ones for the
+ # application-layer components.
+ #
+ # Applications layer is the last one in the list, since most likely the most of
+ # the headers come from middleware or os-layer => thus they are first.
+
+ APP_LAYER_SYSTEMINCLUDE = \
+ /epoc32/include \
+ /epoc32/include/mw \
+ /epoc32/include/platform/mw \
+ /epoc32/include/platform \
+ /epoc32/include/app \
+ /epoc32/include/platform/app \
+ /epoc32/include/platform/loc \
+ /epoc32/include/platform/mw/loc \
+ /epoc32/include/platform/app/loc \
+ /epoc32/include/platform/loc/sc \
+ /epoc32/include/platform/mw/loc/sc \
+ /epoc32/include/platform/app/loc/sc
+
+ # This define statements defines the include paths, which are intended to be
+ # used in the pro-files that are part of the middleware-layer. It includes all
+ # the needed directories from the /epoc32/include, that are valid ones for the
+ # middleware-layer components.
+
+ MW_LAYER_SYSTEMINCLUDE = \
+ /epoc32/include \
+ /epoc32/include/mw \
+ /epoc32/include/platform/mw \
+ /epoc32/include/platform \
+ /epoc32/include/platform/loc \
+ /epoc32/include/platform/mw/loc \
+ /epoc32/include/platform/loc/sc \
+ /epoc32/include/platform/mw/loc/sc
+
+ # This define statements defines the include paths, which are intended to be
+ # used in the pro-files that are part of the osextensions-layer. It includes all
+ # the needed directories from the /epoc32/include, that are valid ones for the
+ # os-layer components.
+
+ OS_LAYER_SYSTEMINCLUDE = \
+ /epoc32/include \
+ /epoc32/include/platform \
+ /epoc32/include/platform/loc \
+ /epoc32/include/platform/loc/sc
+
+ # This define statements defines the include paths, which are intended to be
+ # used in the pro-files that are part of the os-layer. This is intended
+ # to be only used by those components which need to use in their mmp-file either
+ # kern_ext.mmh or nkern_ext.mmh. Reason is that those
+ # 2 files already contain the /epoc32/include as system include path.
+
+ OS_LAYER_KERNEL_SYSTEMINCLUDE = \
+ /epoc32/include/platform
+
+
+ # ---------------------------------------
+ # Definitions that also define the systeminclude paths for various
+ # part of stdapis. Append to INCLUDEPATH in pro-file.
+ # ---------------------------------------
+
+ OS_LAYER_LIBC_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/sys)
+
+ OS_LAYER_GLIB_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/glib) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/gObject)
+
+ OS_LAYER_SSL_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/openssl)
+
+ # stlportv5 is preferred over stlport as it has the throwing version of operator new
+ exists($${EPOCROOT}epoc32/include/stdapis/stlportv5) {
+ OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
+ } else {
+ OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport)
+ }
+
+ OS_LAYER_BOOST_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/boost)
+
+ OS_LAYER_DBUS_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0/dbus)
+
+ OS_LAYER_LIBUTILITY_SYSTEMINCLUDE = $$OS_LAYER_PLATFORM_EXPORT_PATH(stdapis/utility)
+
+ # ---------------------------------------
+ # Definitions to export IBY files to different folders where they will be taken
+ # to ROM image
+ # ---------------------------------------
+
+ defineReplace(CORE_APP_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/app/$$1)
+ }
+ defineReplace(CORE_MW_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/mw/$$1)
+ }
+ defineReplace(CORE_OSEXT_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/os/$$1)
+ }
+ defineReplace(CORE_OS_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/os/$$1)
+ }
+ defineReplace(CORE_ADAPT_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/$$1)
+ }
+
+ # You need to define the following in pro-file, if you are using the stllib:
+ # QMAKE_CXXFLAGS.CW *= $$STLLIB_USAGE_CW_FLAGS
+ # DEFINES *= $$STLLIB_USAGE_DEFINES
+ STLLIB_USAGE_CW_FLAGS = "-wchar_t on"
+ STLLIB_USAGE_DEFINES = _WCHAR_T_DECLARED
+
+ } else { # Old pre-SF structure
+
+ # ---------------------------------------
+ # Location, where the applications layer specific public headers are exported
+ # ---------------------------------------
+
+ defineReplace(APP_LAYER_SDK_EXPORT_PATH) {
+ return (/epoc32/include/applications/$$1)
+ }
+ defineReplace(APP_LAYER_PUBLIC_EXPORT_PATH) {
+ return (/epoc32/include/applications/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the applications layer specific platform headers are exported
+ # ---------------------------------------
+
+ defineReplace(APP_LAYER_DOMAIN_EXPORT_PATH) {
+ return (/epoc32/include/domain/applications/$$1)
+ }
+ defineReplace(APP_LAYER_PLATFORM_EXPORT_PATH) {
+ return (/epoc32/include/domain/applications/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the middleware layer specific public headers are exported
+ # ---------------------------------------
+
+ defineReplace(MW_LAYER_SDK_EXPORT_PATH) {
+ return (/epoc32/include/middleware/$$1)
+ }
+ defineReplace(MW_LAYER_PUBLIC_EXPORT_PATH) {
+ return (/epoc32/include/middleware/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the middleware layer specific platform headers are exported
+ # ---------------------------------------
+
+ defineReplace(MW_LAYER_DOMAIN_EXPORT_PATH) {
+ return (/epoc32/include/domain/middleware/$$1)
+ }
+ defineReplace(MW_LAYER_PLATFORM_EXPORT_PATH) {
+ return (/epoc32/include/domain/middleware/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the os layer specific public headers are exported
+ # ---------------------------------------
+
+ defineReplace(OSEXT_LAYER_SDK_EXPORT_PATH) {
+ return (/epoc32/include/osextensions/$$1)
+ }
+ # WARNING: If the following path changes see the exists() function around line 430
+ defineReplace(OS_LAYER_PUBLIC_EXPORT_PATH) {
+ return (/epoc32/include/osextensions/$$1)
+ }
+
+ # ---------------------------------------
+ # Location, where the os specific platform headers are exported
+ # ---------------------------------------
+
+ defineReplace(OSEXT_LAYER_DOMAIN_EXPORT_PATH) {
+ return (/epoc32/include/domain/osextensions/$$1)
+ }
+ defineReplace(OS_LAYER_PLATFORM_EXPORT_PATH) {
+ return (/epoc32/include/domain/osextensions/$$1)
+ }
+
+ # ---------------------------------------
+ # General comments about the 3 define statements related to include paths:
+ # 1) the /epoc32/include/oem is now defined there for backward compability.
+ # Once the directory is empty, the directory will be removed. However this
+ # enables us to ensure that if you use these define statements => you do
+ # not have to remove the statements later on, when the directory no longer
+ # exists.
+ # 2) These statements should be enough in normal cases. For certain specific
+ # cases you might need to add some specific directory from /epoc32/include
+ # (for instance /epoc32/include/ecom).
+ # In normal cases the include staments in code should be relative to one of
+ # the system include paths, but in certain cases, the included files requires
+ # that the subdirectory is also part of the system include paths.
+ # ---------------------------------------
+
+ # This variable defines the include paths, which are intended to be
+ # used in the pro-files that are part of the applications-layer. It includes all
+ # the needed directories from the /epoc32/include, that are valid ones for the
+ # application-layer components.
+ #
+ # Applications layer is the last one in the list, since most likely the most of
+ # the headers come from middleware or os-layer => thus they are first.
+
+ APP_LAYER_SYSTEMINCLUDE = \
+ /epoc32/include \
+ /epoc32/include/oem \
+ /epoc32/include/middleware \
+ /epoc32/include/domain/middleware \
+ /epoc32/include/osextensions \
+ /epoc32/include/domain/osextensions \
+ /epoc32/include/applications \
+ /epoc32/include/domain/applications \
+ /epoc32/include/domain/osextensions/loc \
+ /epoc32/include/domain/middleware/loc \
+ /epoc32/include/domain/applications/loc \
+ /epoc32/include/domain/osextensions/loc/sc \
+ /epoc32/include/domain/middleware/loc/sc \
+ /epoc32/include/domain/applications/loc/sc
+
+ # This define statements defines the include paths, which are intended to be
+ # used in the pro-files that are part of the middleware-layer. It includes all
+ # the needed directories from the /epoc32/include, that are valid ones for the
+ # middleware-layer components.
+
+ MW_LAYER_SYSTEMINCLUDE = \
+ /epoc32/include \
+ /epoc32/include/oem \
+ /epoc32/include/middleware \
+ /epoc32/include/domain/middleware \
+ /epoc32/include/osextensions \
+ /epoc32/include/domain/osextensions \
+ /epoc32/include/domain/osextensions/loc \
+ /epoc32/include/domain/middleware/loc \
+ /epoc32/include/domain/osextensions/loc/sc \
+ /epoc32/include/domain/middleware/loc/sc
+
+ # This define statements defines the include paths, which are intended to be
+ # used in the pro-files that are part of the osextensions-layer. It includes all
+ # the needed directories from the /epoc32/include, that are valid ones for the
+ # os-layer components.
+
+ OS_LAYER_SYSTEMINCLUDE = \
+ /epoc32/include \
+ /epoc32/include/oem \
+ /epoc32/include/osextensions \
+ /epoc32/include/domain/osextensions \
+ /epoc32/include/domain/osextensions/loc \
+ /epoc32/include/domain/osextensions/loc/sc
+
+ # This define statements defines the include paths, which are intended to be
+ # used in the pro-files that are part of the os-layer. This is intended
+ # to be only used by those components which need to use in their mmp-file either
+ # kern_ext.mmh or nkern_ext.mmh. Reason is that those
+ # 2 files already contain the /epoc32/include as system include path.
+
+ OS_LAYER_KERNEL_SYSTEMINCLUDE = \
+ /epoc32/include/oem \
+ /epoc32/include/osextensions \
+ /epoc32/include/domain/osextensions
+
+
+ # ---------------------------------------
+ # Definitions that also define the systeminclude paths for various
+ # part of stdapis. Append to INCLUDEPATH in pro-file.
+ # ---------------------------------------
+
+ OS_LAYER_LIBC_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/sys) \
+ /epoc32/include/stdapis \
+ /epoc32/include/stdapis/sys
+
+ OS_LAYER_GLIB_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/glib) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/gObject) \
+ /epoc32/include/stdapis/glib-2.0 \
+ /epoc32/include/stdapis/glib-2.0/glib \
+ /epoc32/include/stdapis/glib-2.0/gObject
+
+ OS_LAYER_SSL_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/openssl) \
+ /epoc32/include/stdapis/openssl
+
+ # stlportv5 is preferred over stlport as it has the throwing version of operator new
+ exists($${EPOCROOT}epoc32/include/osextensions/stdapis/stlportv5)|exists($${EPOCROOT}epoc32/include/stdapis/stlportv5) {
+ OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) \
+ /epoc32/include/stdapis/stlportv5
+ } else {
+ OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport) \
+ /epoc32/include/stdapis/stlport
+ }
+
+ OS_LAYER_BOOST_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/boost) \
+ /epoc32/include/stdapis/boost
+
+ OS_LAYER_DBUS_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0) \
+ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0/dbus) \
+ /epoc32/include/stdapis/dbus-1.0 \
+ /epoc32/include/stdapis/dbus-1.0/dbus
+
+ OS_LAYER_LIBUTILITY_SYSTEMINCLUDE = $$OS_LAYER_PLATFORM_EXPORT_PATH(stdapis/utility) \
+ /epoc32/include/stdapis/utility
+
+ # ---------------------------------------
+ # Definitions to export IBY files to different folders where they will be taken
+ # to ROM image
+ # ---------------------------------------
+
+ defineReplace(CORE_APP_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/app/$$1)
+ }
+ defineReplace(CORE_MW_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/mw/$$1)
+ }
+ defineReplace(CORE_OSEXT_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/osext/$$1)
+ }
+ defineReplace(CORE_OS_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/osext/$$1)
+ }
+ defineReplace(CORE_ADAPT_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/$$1)
+ }
+
+ # You need to define the following in pro-file, if you are using the stllib:
+ # QMAKE_CXXFLAGS.CW *= $$STLLIB_USAGE_CW_FLAGS
+ # DEFINES *= $$STLLIB_USAGE_DEFINES
+ STLLIB_USAGE_CW_FLAGS = "-wchar_t on"
+ STLLIB_USAGE_DEFINES = _WCHAR_T_DECLARED
+
+ }
+}
+
+
+
diff --git a/mkspecs/features/symbian/qt.prf b/mkspecs/features/symbian/qt.prf
new file mode 100644
index 0000000..29b39a5
--- /dev/null
+++ b/mkspecs/features/symbian/qt.prf
@@ -0,0 +1,15 @@
+contains(DEFINES, QT_MAKEDLL)|contains(DEFINES, QT_DLL) {
+ CONFIG *= epocallowdlldata
+}
+
+CONFIG += qtmain
+
+load(qt)
+
+contains(CONFIG, qt):!contains(TARGET.UID3, 0x2001E61C):!contains(TARGET.UID3, 0xE001E61C) {
+ default_deployment.depends += \
+ "(0x2001E61C), $${QT_MAJOR_VERSION}, $${QT_MINOR_VERSION}, $${QT_PATCH_VERSION}, {\"QtLibs pre-release\"}"
+}
+
+isEmpty(TARGET.EPOCSTACKSIZE):TARGET.EPOCSTACKSIZE = 0x14000
+isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x020000 0x800000
diff --git a/mkspecs/features/symbian/stl.prf b/mkspecs/features/symbian/stl.prf
new file mode 100644
index 0000000..9eb6b86
--- /dev/null
+++ b/mkspecs/features/symbian/stl.prf
@@ -0,0 +1,37 @@
+CONFIG -= stl_off
+
+# STL usage in S60 requires the following mmp variables to be uses
+# OPTION CW -wchar_t on
+# MACRO _WCHAR_T_DECLARED
+
+QMAKE_CXXFLAGS.CW *= $$STLLIB_USAGE_CW_FLAGS
+DEFINES *= $$STLLIB_USAGE_DEFINES
+
+# Legacy support requires some hardcoded stdapis paths.
+# Note: Also the new header is used from STL when it is enabled
+INCLUDEPATH += $$OS_LAYER_STDCPP_SYSTEMINCLUDE
+
+# Remove mkspecs/common/symbian/stl-off from beginning of includepath
+# in order to use new and delete operators from STL
+INCLUDEPATH -= $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian/stl-off
+
+# libstdcppv5 is preferred over libstdcpp as it has/uses the throwing version of operator new
+exists($${EPOCROOT}epoc32/release/armv5/urel/libstdcppv5.dll ) {
+ LIBS *= -llibstdcppv5.dll
+
+ # STDCPP turns on standard C++ new behaviour in SBSv2
+ MMP_RULES += "STDCPP"
+
+ # defining __SYMBIAN_STDCPP_SUPPORT__ turns on standard C++ new behaviour pre SBSv2
+ DEFINES += "__SYMBIAN_STDCPP_SUPPORT__"
+
+ # operator new is actually supplied in stdnew.lib for hardware builds
+ eabiStdNewLibBlock = \
+ "$${LITERAL_HASH}ifdef EABI" \
+ "LIBRARY stdnew.lib" \
+ "$${LITERAL_HASH}endif"
+
+ MMP_RULES += eabiStdNewLibBlock
+} else {
+ LIBS *= -llibstdcpp.dll
+}
diff --git a/mkspecs/features/symbian/stl_off.prf b/mkspecs/features/symbian/stl_off.prf
new file mode 100644
index 0000000..d5d1c7c
--- /dev/null
+++ b/mkspecs/features/symbian/stl_off.prf
@@ -0,0 +1,2 @@
+CONFIG -= stl
+
diff --git a/mkspecs/symbian-abld/qmake.conf b/mkspecs/symbian-abld/qmake.conf
new file mode 100644
index 0000000..499bf63
--- /dev/null
+++ b/mkspecs/symbian-abld/qmake.conf
@@ -0,0 +1,9 @@
+#
+# qmake configuration for symbian-abld
+#
+# Written for SYMBIAN_ABLD
+#
+
+MAKEFILE_GENERATOR = SYMBIAN_ABLD
+
+include(../common/symbian/symbian.conf)
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm b/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm
new file mode 100644
index 0000000..354ce26
--- /dev/null
+++ b/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm
@@ -0,0 +1,39 @@
+# /****************************************************************************
+# **
+# ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# ** Contact: Qt Software Information (qt-info@nokia.com)
+# **
+# ** This file is part of symbian-sbsv2 mkspec.
+# **
+# ****************************************************************************/
+
+include $(FLMHOME)/metaflm.mk
+
+SINGLETON:=$(call sanitise,TARGET_$(DEPLOY_TARGET))
+CLEAN_TARGET:=
+
+define qmake_emulator_deployment
+$(ALLTARGET):: $(1)
+FINAL::$(1)
+
+# Prevent duplicate targets from being created
+$(SINGLETON):=1
+
+CLEAN_TARGET:=$(1)
+
+$(1): $(2)
+ $(call startrule,qmake_emulator_deployment) \
+ $(GNUCP) --no-preserve=mode $(2) "$$@" && \
+ $(GNUCHMOD) a+rw "$$@" \
+ $(call endrule,qmake_emulator_deployment)
+endef
+
+ifeq ($($(SINGLETON)),)
+$(eval $(call qmake_emulator_deployment, $(subst $(CHAR_SPACE),\$(CHAR_SPACE),$(DEPLOY_TARGET)), $(subst $(CHAR_SPACE),\$(CHAR_SPACE),$(DEPLOY_SOURCE))))
+$(call makepath,$(dir $(DEPLOY_TARGET)))
+$(eval $(call GenerateStandardCleanTarget,$(CLEAN_TARGET),''))
+endif
+
+
+
+
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm b/mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm
new file mode 100644
index 0000000..9dc529f
--- /dev/null
+++ b/mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm
@@ -0,0 +1,35 @@
+# /****************************************************************************
+# **
+# ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# ** Contact: Qt Software Information (qt-info@nokia.com)
+# **
+# ** This file is part of symbian-sbsv2 mkspec.
+# **
+# ****************************************************************************/
+
+include $(FLMHOME)/metaflm.mk
+
+SINGLETON:=$(call sanitise,TARGET_$(PREDEP_TARGET))
+
+define qmake_extra_pre_targetdep
+$(ALLTARGET):: $(PREDEP_TARGET)
+EXPORT:: $(PREDEP_TARGET)
+LIBRARY:: $(PREDEP_TARGET)
+TARGET:: $(PREDEP_TARGET)
+
+# Prevent duplicate targets from being created
+$(SINGLETON):=1
+
+$(PREDEP_TARGET): $(DEPS)
+ $(call startrule,qmake_extra_pre_targetdep) \
+ $(COMMAND) \
+ $(call endrule,qmake_extra_pre_targetdep)
+endef
+
+ifeq ($($(SINGLETON)),)
+$(eval $(qmake_extra_pre_targetdep))
+$(eval $(call GenerateStandardCleanTarget,$(PREDEP_TARGET),''))
+endif
+
+
+
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qmake_post_link.flm b/mkspecs/symbian-sbsv2/flm/qt/qmake_post_link.flm
new file mode 100644
index 0000000..8cbd0a8
--- /dev/null
+++ b/mkspecs/symbian-sbsv2/flm/qt/qmake_post_link.flm
@@ -0,0 +1,34 @@
+# /****************************************************************************
+# **
+# ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# ** Contact: Qt Software Information (qt-info@nokia.com)
+# **
+# ** This file is part of symbian-sbsv2 mkspec.
+# **
+# ****************************************************************************/
+
+include $(FLMHOME)/metaflm.mk
+
+POST_LINK_TARGET:=POST_LINK_$(PLATFORM_PATH)_$(CFG_PATH)_$(call sanitise,$(LINK_TARGET))
+POST_LINK_DEP:=$(EPOCROOT)/epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/$(LINK_TARGET)
+
+# Passing $(PLATFORM_PATH) etc. variables in FLM options makes sbsv2 toolchain to double the dollar signs,
+# requiring evaluating them twice in order to get desired values,
+# so do an extra evaluation before using the command.
+define command_fixer
+ THE_COMMAND:=$(POST_LINK_CMD)
+endef
+
+define qmake_post_link
+$(ALLTARGET):: $(POST_LINK_TARGET)
+FINAL:: $(POST_LINK_TARGET)
+
+$(POST_LINK_TARGET): $(POST_LINK_DEP)
+ $(call startrule,qmake_post_link) \
+ $(THE_COMMAND) \
+ $(call endrule,qmake_post_link)
+endef
+
+$(eval $(command_fixer))
+$(eval $(qmake_post_link))
+
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qt.xml b/mkspecs/symbian-sbsv2/flm/qt/qt.xml
new file mode 100644
index 0000000..a5ed141
--- /dev/null
+++ b/mkspecs/symbian-sbsv2/flm/qt/qt.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+# /****************************************************************************
+# **
+# ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# ** Contact: Qt Software Information (qt-info@nokia.com)
+# **
+# ** This file is part of symbian-sbsv2 mkspec.
+# **
+# ****************************************************************************/
+-->
+
+<build xmlns="http://symbian.com/xml/build"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://symbian.com/xml/build http://symbian.com/xml/build/1_0.xsd">
+
+ <!-- Extension interfaces : replacements for Template Extension Makefiles -->
+
+ <interface name="qt.qmake_extra_pre_targetdep" extends="Symbian.UserFLM"
+ flm="qmake_extra_pre_targetdep.flm">
+ <param name='PREDEP_TARGET' />
+ <param name='DEPS' default = '' />
+ <param name='COMMAND' default = '' />
+ </interface>
+
+ <interface name="qt.qmake_emulator_deployment" extends="Symbian.UserFLM"
+ flm="qmake_emulator_deployment.flm">
+ <param name='DEPLOY_SOURCE' />
+ <param name='DEPLOY_TARGET' />
+ </interface>
+
+ <interface name="qt.qmake_post_link" extends="Symbian.UserFLM"
+ flm="qmake_post_link.flm">
+ <param name='POST_LINK_CMD' />
+ <param name='LINK_TARGET' />
+ </interface>
+</build>
diff --git a/mkspecs/symbian-sbsv2/qmake.conf b/mkspecs/symbian-sbsv2/qmake.conf
new file mode 100644
index 0000000..0a5e878
--- /dev/null
+++ b/mkspecs/symbian-sbsv2/qmake.conf
@@ -0,0 +1,9 @@
+#
+# qmake configuration for symbian-sbsv2
+#
+# Written for SYMBIAN_SBSV2
+#
+
+MAKEFILE_GENERATOR = SYMBIAN_SBSV2
+
+include(../common/symbian/symbian.conf)
diff --git a/mkspecs/win32-mwc/qmake.conf b/mkspecs/win32-mwc/qmake.conf
new file mode 100644
index 0000000..8ebe4ff
--- /dev/null
+++ b/mkspecs/win32-mwc/qmake.conf
@@ -0,0 +1,110 @@
+#
+# qmake configuration for win32-mwc
+#
+# Written for mwc
+#
+
+MAKEFILE_GENERATOR = MINGW
+TEMPLATE = app
+CONFIG += qt warn_on release link_prl copy_dir_files debug_and_release debug_and_release_target
+QT += core gui
+DEFINES += UNICODE QT_NO_PROCESS QT_NO_SHAREDMEMORY QT_NO_CONCURRENT QT_NO_SYSTEMSEMAPHORE
+QMAKE_COMPILER_DEFINES += __GNUC__ WIN32
+
+QMAKE_EXT_OBJ = .o
+QMAKE_EXT_RES = _res.o
+
+QMAKE_CC = mwccsym2
+QMAKE_LEX = flex
+QMAKE_LEXFLAGS =
+QMAKE_YACC = byacc
+QMAKE_YACCFLAGS = -d
+QMAKE_CFLAGS = -gccinc -stackcommit 1024000 -stackreserve 1024000
+QMAKE_CFLAGS_DEPS = -M
+QMAKE_CFLAGS_WARN_ON = -w on -w nonotused -w nonotinlined -w noimplicit -w nopadding -w noemptydecl -w nounusedexpr -w nopossible
+QMAKE_CFLAGS_WARN_OFF = -w off
+QMAKE_CFLAGS_RELEASE = -O2
+QMAKE_CFLAGS_DEBUG = -g -O1
+QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+QMAKE_CXX = mwccsym2
+QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
+QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
+QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
+QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
+QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
+QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
+QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
+QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
+QMAKE_CXXFLAGS_RTTI_ON = -RTTI on
+QMAKE_CXXFLAGS_RTTI_OFF = -RTTI off
+QMAKE_CXXFLAGS_EXCEPTIONS_ON = "-Cpp_exceptions on"
+QMAKE_CXXFLAGS_EXCEPTIONS_OFF = "-Cpp_exceptions off"
+
+QMAKE_INCDIR =
+QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS]
+QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS]
+
+QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src
+QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
+QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
+QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+QMAKE_LINK = mwldsym2
+#QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
+QMAKE_LFLAGS =
+QMAKE_LFLAGS_EXCEPTIONS_ON =
+QMAKE_LFLAGS_EXCEPTIONS_OFF =
+#QMAKE_LFLAGS_RELEASE = -Wl,-s
+QMAKE_LFLAGS_RELEASE =
+QMAKE_LFLAGS_DEBUG =
+#QMAKE_LFLAGS_CONSOLE = -Wl,-subsystem,console
+#QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
+QMAKE_LFLAGS_CONSOLE =
+QMAKE_LFLAGS_WINDOWS =
+QMAKE_LFLAGS_DLL = -runtime dm
+QMAKE_LINK_OBJECT_MAX = 99999999
+QMAKE_LINK_OBJECT_SCRIPT= object_script
+
+
+QMAKE_LIBS =
+QMAKE_LIBS_CORE = -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lws2_32
+QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lws2_32 -lole32 -luuid -luser32 -ladvapi32
+QMAKE_LIBS_NETWORK = -lws2_32
+QMAKE_LIBS_OPENGL = -lopengl32 -lglu32 -lgdi32 -luser32
+QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32
+#QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain
+QMAKE_LIBS_QT_ENTRY = -lqtmain
+
+!isEmpty(QMAKE_SH) {
+ MINGW_IN_SHELL = 1
+ QMAKE_DIR_SEP = /
+ QMAKE_COPY = cp
+ QMAKE_COPY_DIR = xcopy /s /q /y /i
+ QMAKE_MOVE = mv
+ QMAKE_DEL_FILE = rm
+ QMAKE_MKDIR = mkdir
+ QMAKE_DEL_DIR = rmdir
+ QMAKE_CHK_DIR_EXISTS = test -d
+} else {
+ QMAKE_COPY = copy /y
+ QMAKE_COPY_DIR = xcopy /s /q /y /i
+ QMAKE_MOVE = move
+ QMAKE_DEL_FILE = del
+ QMAKE_MKDIR = mkdir
+ QMAKE_DEL_DIR = rmdir
+ QMAKE_CHK_DIR_EXISTS = if not exist
+}
+
+QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe
+QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe
+QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe
+
+QMAKE_IDL = midl
+QMAKE_LIB = $$QMAKE_LINK -library -o
+QMAKE_RC = windres
+QMAKE_ZIP = zip -r -9
+
+QMAKE_STRIP = strip
+QMAKE_STRIPFLAGS_LIB += --strip-unneeded
+load(qt_config)
diff --git a/mkspecs/win32-mwc/qplatformdefs.h b/mkspecs/win32-mwc/qplatformdefs.h
new file mode 100644
index 0000000..0ce3ac6
--- /dev/null
+++ b/mkspecs/win32-mwc/qplatformdefs.h
@@ -0,0 +1,164 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the qmake spec 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPLATFORMDEFS_H
+#define QPLATFORMDEFS_H
+
+#ifdef UNICODE
+#ifndef _UNICODE
+#define _UNICODE
+#endif
+#endif
+
+// Get Qt defines/settings
+
+#include "qglobal.h"
+
+#include <tchar.h>
+#include <io.h>
+#include <direct.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <windows.h>
+#include <limits.h>
+
+#if !defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500)
+typedef enum {
+ NameUnknown = 0,
+ NameFullyQualifiedDN = 1,
+ NameSamCompatible = 2,
+ NameDisplay = 3,
+ NameUniqueId = 6,
+ NameCanonical = 7,
+ NameUserPrincipal = 8,
+ NameCanonicalEx = 9,
+ NameServicePrincipal = 10,
+ NameDnsDomain = 12
+} EXTENDED_NAME_FORMAT, *PEXTENDED_NAME_FORMAT;
+#endif
+
+#define Q_FS_FAT
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_STATBUF struct _stati64 // non-ANSI defs
+#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
+#define QT_STAT _stati64
+#define QT_FSTAT _fstati64
+#else
+#define QT_STATBUF struct _stat // non-ANSI defs
+#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
+#define QT_STAT _stat
+#define QT_FSTAT _fstat
+#endif
+#define QT_STAT_REG _S_IFREG
+#define QT_STAT_DIR _S_IFDIR
+#define QT_STAT_MASK _S_IFMT
+#if defined(_S_IFLNK)
+# define QT_STAT_LNK _S_IFLNK
+#endif
+#define QT_FILENO _fileno
+#define QT_OPEN _open
+#define QT_CLOSE _close
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_LSEEK _lseeki64
+#ifndef UNICODE
+#define QT_TSTAT _stati64
+#else
+#define QT_TSTAT _wstati64
+#endif
+#else
+#define QT_LSEEK _lseek
+#ifndef UNICODE
+#define QT_TSTAT _stat
+#else
+#define QT_TSTAT _wstat
+#endif
+#endif
+#define QT_READ _read
+#define QT_WRITE _write
+#define QT_ACCESS _access
+#define QT_GETCWD _getcwd
+#define QT_CHDIR _chdir
+#define QT_MKDIR _mkdir
+#define QT_RMDIR _rmdir
+#define QT_OPEN_LARGEFILE 0
+#define QT_OPEN_RDONLY _O_RDONLY
+#define QT_OPEN_WRONLY _O_WRONLY
+#define QT_OPEN_RDWR _O_RDWR
+#define QT_OPEN_CREAT _O_CREAT
+#define QT_OPEN_TRUNC _O_TRUNC
+#define QT_OPEN_APPEND _O_APPEND
+#if defined(O_TEXT)
+# define QT_OPEN_TEXT _O_TEXT
+# define QT_OPEN_BINARY _O_BINARY
+#endif
+
+#define QT_FOPEN fopen
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_FSEEK fseeko64
+#define QT_FTELL ftello64
+#else
+#define QT_FSEEK fseek
+#define QT_FTELL ftell
+#endif
+#define QT_FGETPOS fgetpos
+#define QT_FSETPOS fsetpos
+#define QT_FPOS_T fpos_t
+#ifdef QT_LARGEFILE_SUPPORT
+#define QT_OFF_T off64_t
+#else
+#define QT_OFF_T long
+#endif
+
+#define QT_SIGNAL_ARGS int
+
+#define QT_VSNPRINTF _vsnprintf
+#define QT_SNPRINTF _snprintf
+
+# define F_OK 0
+# define X_OK 1
+# define W_OK 2
+# define R_OK 4
+
+#define PATH_MAX 1024
+#endif // QPLATFORMDEFS_H
diff --git a/projects.pro b/projects.pro
index 68608a2..04acede 100644
--- a/projects.pro
+++ b/projects.pro
@@ -24,6 +24,10 @@ isEmpty(QT_BUILD_PARTS) { #defaults
}
}
+symbian {
+ QT_BUILD_PARTS = libs examples demos
+}
+
#process the projects
for(PROJECT, $$list($$lower($$unique(QT_BUILD_PARTS)))) {
isEqual(PROJECT, tools) {
@@ -48,9 +52,9 @@ for(PROJECT, $$list($$lower($$unique(QT_BUILD_PARTS)))) {
}
}
-confclean.depends += clean
+!symbian: confclean.depends += clean
confclean.commands =
-unix {
+unix:!symbian {
confclean.commands += (cd config.tests/unix/stl && $(MAKE) distclean); \
(cd config.tests/unix/endian && $(MAKE) distclean); \
(cd config.tests/unix/ipv6 && $(MAKE) distclean); \
@@ -100,6 +104,19 @@ win32 {
-$(DEL_FILE) .qmake.cache $$escape_expand(\n\t) \
(cd qmake && $(MAKE) distclean)
}
+symbian {
+ confclean.depends += distclean
+ confclean.commands += \
+ (cd src\tools\moc && $(MAKE) distclean) $$escape_expand(\n\t) \
+ (cd src\tools\rcc && $(MAKE) distclean) $$escape_expand(\n\t) \
+ (cd src\tools\uic && $(MAKE) distclean) $$escape_expand(\n\t) \
+ -$(DEL_FILE) src\corelib\global\qconfig.h $$escape_expand(\n\t) \
+ -$(DEL_FILE) src\corelib\global\qconfig.cpp $$escape_expand(\n\t) \
+ -$(DEL_FILE) mkspecs\qconfig.pri $$escape_expand(\n\t) \
+ -$(DEL_FILE) .qmake.cache $$escape_expand(\n\t) \
+ (cd qmake && $(MAKE) distclean)
+
+}
QMAKE_EXTRA_TARGETS += confclean
qmakeclean.commands += (cd qmake && $(MAKE) clean)
QMAKE_EXTRA_TARGETS += qmakeclean
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index 7634021..c7f4dc4 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -9,7 +9,8 @@ LFLAGS = @QMAKE_LFLAGS@
OBJS=project.o property.o main.o makefile.o unixmake2.o unixmake.o \
mingw_make.o option.o winmakefile.o projectgenerator.o \
meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
- borland_bmake.o msvc_dsp.o msvc_vcproj.o msvc_nmake.o msvc_objectmodel.o
+ borland_bmake.o msvc_dsp.o msvc_vcproj.o msvc_nmake.o msvc_objectmodel.o \
+ symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o
#qt code
QOBJS=qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o \
@@ -30,7 +31,7 @@ QOBJS=qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o \
qscriptgrammar.o qscriptlexer.o qscriptclassdata.o \
qscriptparser.o qscriptprettypretty.o qscriptsyntaxchecker.o \
qscriptvalue.o qscriptvalueimpl.o qscriptvalueiterator.o \
- qscriptvalueiteratorimpl.o \
+ qscriptvalueiteratorimpl.o qxmlstream.o qxmlutils.o \
qscriptclass.o qscriptclasspropertyiterator.o \
qscriptengineagent.o qscriptcontextinfo.o qscriptstring.o \
$(QTOBJS)
@@ -44,6 +45,8 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge
generators/mac/pbuilder_pbx.cpp generators/mac/xmloutput.cpp generators/metamakefile.cpp \
generators/makefiledeps.cpp option.cpp generators/win32/mingw_make.cpp generators/makefile.cpp \
generators/win32/msvc_objectmodel.cpp generators/win32/msvc_nmake.cpp generators/win32/borland_bmake.cpp \
+ generators/symbian/symmake.cpp generators/symbian/initprojectdeploy_symbian.cpp \
+ generators/symbian/symmake_abld.cpp generators/symbian/symmake_sbsv2.cpp \
$(SOURCE_PATH)/src/corelib/tools/qstring.cpp $(SOURCE_PATH)/src/corelib/io/qfile.cpp \
$(SOURCE_PATH)/src/corelib/io/qtextstream.cpp $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp \
$(SOURCE_PATH)/src/corelib/global/qmalloc.cpp \
@@ -83,16 +86,18 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge
$(SOURCE_PATH)/src/script/qscriptsyntaxchecker.cpp $(SOURCE_PATH)/src/script/qscriptvalueimpl.cpp \
$(SOURCE_PATH)/src/script/qscriptvalue.cpp $(SOURCE_PATH)/src/script/qscriptvalueiterator.cpp \
$(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp \
+ $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp \
+ $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp \
$(SOURCE_PATH)/src/script/qscriptclass.cpp $(SOURCE_PATH)/src/script/qscriptclasspropertyiterator.cpp \
$(SOURCE_PATH)/src/script/qscriptengineagent.cpp $(SOURCE_PATH)/src/script/qscriptcontextinfo.cpp \
$(SOURCE_PATH)/src/script/qscriptstring.cpp \
$(QTSRCS)
-CPPFLAGS = -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac \
+CPPFLAGS = -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian \
-I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \
-I$(BUILD_PATH)/src/corelib/global \
- -I$(SOURCE_PATH)/src/script -DQT_NO_PCRE \
- -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED \
+ -I$(SOURCE_PATH)/src/script -I$(BUILD_PATH)/src/corelib/xml \
+ -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL \
-DQT_NO_COMPRESS -I$(QMAKESPEC) -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT \
-DQT_NO_GEOM_VARIANT $(OPENSOURCE_CXXFLAGS)
@@ -292,6 +297,18 @@ pbuilder_pbx.o: generators/mac/pbuilder_pbx.cpp
msvc_dsp.o: generators/win32/msvc_dsp.cpp
$(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_dsp.cpp
+symmake.o: generators/symbian/symmake.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/symmake.cpp
+
+symmake_abld.o: generators/symbian/symmake_abld.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/symmake_abld.cpp
+
+symmake_sbsv2.o: generators/symbian/symmake_sbsv2.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+
+initprojectdeploy_symbian.o: generators/symbian/initprojectdeploy_symbian.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
+
projectgenerator.o: generators/projectgenerator.cpp
$(CXX) -c -o $@ $(CXXFLAGS) generators/projectgenerator.cpp
@@ -394,6 +411,12 @@ qscriptvalueiterator.o: $(SOURCE_PATH)/src/script/qscriptvalueiterator.cpp
qscriptvalueiteratorimpl.o: $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
+qxmlstream.o: $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+
+qxmlutils.o: $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
+
qscriptclass.o: $(SOURCE_PATH)/src/script/qscriptclass.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptclass.cpp
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 53130aa..54c2872 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -28,11 +28,12 @@ CFLAGS = /Zc:wchar_t-
CFLAGS = -c -Fo$@ \
-W3 -nologo -O2 \
- -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac \
+ -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\symbian \
-I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore \
-I$(SOURCE_PATH)\include -I$(SOURCE_PATH)\include\QtCore \
-I$(BUILD_PATH)\src\corelib\global \
-I$(BUILD_PATH)\include\QtScript \
+ -I$(BUILD_PATH)\src\corelib\xml \
-I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NODLL -DQT_NO_STL \
-DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD \
@@ -54,7 +55,7 @@ BCB = $(MAKEDIR)\..
CXX = bcc32
CFLAGS = -c -o$@ \
-tWR -w -w-hid -w-use -O1 \
- -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac \
+ -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\symbian \
-I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore \
-I$(SOURCE_PATH)\include -I$(SOURCE_PATH)\include\QtCore \
-I$(BUILD_PATH)\src\corelib\global \
@@ -74,7 +75,8 @@ OBJS = project.obj main.obj makefile.obj unixmake.obj unixmake2.obj mingw
option.obj winmakefile.obj projectgenerator.obj property.obj meta.obj \
makefiledeps.obj metamakefile.obj xmloutput.obj pbuilder_pbx.obj \
borland_bmake.obj msvc_nmake.obj msvc_dsp.obj msvc_vcproj.obj \
- msvc_objectmodel.obj
+ msvc_objectmodel.obj symmake.obj initprojectdeploy_symbian.obj \
+ symmake_abld.obj symmake_sbsv2.obj
!IFDEF QMAKE_OPENSOURCE_EDITION
CFLAGS = $(CFLAGS) -DQMAKE_OPENSOURCE_EDITION
@@ -158,7 +160,9 @@ QTOBJS= \
qscriptvalue.obj \
qscriptvalueimpl.obj \
qscriptvalueiterator.obj \
- qscriptvalueiteratorimpl.obj
+ qscriptvalueiteratorimpl.obj \
+ qxmlstream.obj \
+ qxmlutils.obj
first all: qmake.exe
@@ -225,6 +229,10 @@ clean::
-del msvc_dsp.obj
-del msvc_vcproj.obj
-del msvc_objectmodel.obj
+ -del symmake.obj
+ -del symmake_abld.obj
+ -del symmake_sbsv2.obj
+ -del initprojectdeploy_symbian.obj
-del pbuilder_pbx.obj
-del qnumeric.obj \
-del qscriptasm.obj \
@@ -265,6 +273,8 @@ clean::
-del qscriptvalueimpl.obj \
-del qscriptvalueiterator.obj \
-del qscriptvalueiteratorimpl.obj
+ -del qxmlstream.obj
+ -del qxmlutils.obj
-del vc60.pdb
-del vc70.pdb
-del qmake.pdb
@@ -444,8 +454,21 @@ msvc_vcproj.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp
msvc_objectmodel.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_objectmodel.cpp
$(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp
+symmake.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp
+
+symmake_abld.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_abld.cpp
+
+symmake_sbsv2.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+
+initprojectdeploy_symbian.obj: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
+
md5.obj: $(SOURCE_PATH)\src\3rdparty\md5\md5.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\3rdparty\md5\md5.cpp
+
project.obj: $(SOURCE_PATH)/qmake/project.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
$(CXX) $(CXXFLAGS) project.cpp
@@ -589,3 +612,9 @@ qscriptvalueiterator.obj: $(SOURCE_PATH)\src\script\qscriptvalueiterator.cpp
qscriptvalueiteratorimpl.obj: $(SOURCE_PATH)\src\script\qscriptvalueiteratorimpl.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\script\qscriptvalueiteratorimpl.cpp
+
+qxmlstream.obj: $(SOURCE_PATH)\src\corelib\xml\qxmlstream.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\xml\qxmlstream.cpp
+
+qxmlutils.obj: $(SOURCE_PATH)\src\corelib\xml\qxmlutils.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\xml\qxmlutils.cpp
diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++
index 229a456..dd65145 100644
--- a/qmake/Makefile.win32-g++
+++ b/qmake/Makefile.win32-g++
@@ -15,14 +15,17 @@ CXX = g++
CFLAGS = -c -o$@ -O \
-I. -Igenerators -Igenerators/unix \
-Igenerators/win32 -Igenerators/mac \
+ -Igenerators/symbian \
-I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \
-I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \
-I$(BUILD_PATH)/src/corelib/global \
-I$(BUILD_PATH)/include/QtScript \
+ -I$(BUILD_PATH)/src/corelib/xml \
-I$(SOURCE_PATH)/mkspecs/win32-g++ \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \
-DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \
- -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM
+ -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
+ -DQT_BOOTSTRAPPED
CXXFLAGS = $(CFLAGS)
LFLAGS =
LIBS = -lole32 -luuid
@@ -35,7 +38,8 @@ OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \
option.o winmakefile.o projectgenerator.o property.o meta.o \
makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
borland_bmake.o msvc_nmake.o msvc_dsp.o msvc_vcproj.o \
- msvc_objectmodel.o
+ msvc_objectmodel.o symmake.o initprojectdeploy_symbian.o \
+ symmake_abld.o symmake_sbsv2.o
ifdef QMAKE_OPENSOURCE_EDITION
CFLAGS += -DQMAKE_OPENSOURCE_EDITION
@@ -119,7 +123,9 @@ QTOBJS= \
qscriptvalue.o \
qscriptvalueimpl.o \
qscriptvalueiterator.o \
- qscriptvalueiteratorimpl.o
+ qscriptvalueiteratorimpl.o \
+ qxmlstream.o \
+ qxmlutils.o
qmake.exe: $(OBJS) $(QTOBJS)
@@ -294,6 +300,18 @@ msvc_vcproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp
msvc_objectmodel.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_objectmodel.cpp
$(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp
+symmake.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp
+
+symmake_abld.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_abld.cpp
+
+symmake_sbsv2.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+
+initprojectdeploy_symbian.o: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
+
project.o: $(SOURCE_PATH)/qmake/project.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
$(CXX) $(CXXFLAGS) project.cpp
@@ -437,3 +455,9 @@ qscriptvalueiterator.o: $(SOURCE_PATH)/src/script/qscriptvalueiterator.cpp
qscriptvalueiteratorimpl.o: $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
+
+qxmlstream.o: $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+
+qxmlutils.o: $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh
index 3f1b1df..646815b 100644
--- a/qmake/Makefile.win32-g++-sh
+++ b/qmake/Makefile.win32-g++-sh
@@ -15,14 +15,17 @@ CXX = g++
CFLAGS = -c -o$@ -O \
-I. -Igenerators -Igenerators/unix \
-Igenerators/win32 -Igenerators/mac \
+ -Igenerators/symbian \
-I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \
-I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \
-I$(BUILD_PATH)/src/corelib/global \
-I$(BUILD_PATH)/include/QtScript \
+ -I$(BUILD_PATH)/src/corelib/xml \
-I$(SOURCE_PATH)/mkspecs/win32-g++ \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \
-DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \
- -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM
+ -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
+ -DQT_BOOTSTRAPPED
CXXFLAGS = $(CFLAGS)
LFLAGS =
LIBS = -lole32 -luuid
@@ -35,7 +38,8 @@ OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \
option.o winmakefile.o projectgenerator.o property.o meta.o \
makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
borland_bmake.o msvc_nmake.o msvc_dsp.o msvc_vcproj.o \
- msvc_objectmodel.o
+ msvc_objectmodel.o symmake.o initprojectdeploy_symbian.o \
+ symmake_abld.o symmake_sbsv2.o
ifdef QMAKE_OPENSOURCE_EDITION
CFLAGS += -DQMAKE_OPENSOURCE_EDITION
@@ -119,7 +123,9 @@ QTOBJS= \
qscriptvalue.o \
qscriptvalueimpl.o \
qscriptvalueiterator.o \
- qscriptvalueiteratorimpl.o
+ qscriptvalueiteratorimpl.o \
+ qxmlstream.o \
+ qxmlutils.o
qmake.exe: $(OBJS) $(QTOBJS)
$(LINKQMAKE)
@@ -293,6 +299,18 @@ msvc_vcproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp
msvc_objectmodel.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_objectmodel.cpp
$(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp
+symmake.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp
+
+symmake_abld.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_abld.cpp
+
+symmake_sbsv2.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+
+initprojectdeploy_symbian.o: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
+
project.o: $(SOURCE_PATH)/qmake/project.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
$(CXX) $(CXXFLAGS) project.cpp
@@ -436,3 +454,9 @@ qscriptvalueiterator.o: $(SOURCE_PATH)/src/script/qscriptvalueiterator.cpp
qscriptvalueiteratorimpl.o: $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
+
+qxmlstream.o: $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+
+qxmlutils.o: $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
diff --git a/qmake/Makefile.win32-mwc b/qmake/Makefile.win32-mwc
new file mode 100644
index 0000000..08b6c49
--- /dev/null
+++ b/qmake/Makefile.win32-mwc
@@ -0,0 +1,469 @@
+ifeq "$(SOURCE_PATH)" ""
+SOURCE_PATH = ..
+endif
+
+# cmd version
+
+ifeq "$(BUILD_PATH)" ""
+BUILD_PATH = ..
+endif
+
+
+# specific stuff for Metroworks compiler
+
+CXX = mwccsym2
+CFLAGS = -gccinc \
+ -w on -w nonotused -w nonotinlined -w noimplicit -w nopadding -w noemptydecl \
+ -w nounusedexpr -w nopossible -c -o $@ -O \
+ -I. -Igenerators -Igenerators\unix \
+ -Igenerators\win32 -Igenerators\mac \
+ -Igenerators\symbian \
+ -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore \
+ -I$(SOURCE_PATH)\include -I$(SOURCE_PATH)\include\QtCore \
+ -I$(BUILD_PATH)\src\corelib\global \
+ -I$(SOURCE_PATH)\mkspecs\win32-mwc \
+ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \
+ -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DHAVE_QCONFIG_CPP \
+ -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
+ -DQT_NO_LIBRARY -I$(BUILD_PATH)\include\QtScript \
+ -I$(SOURCE_PATH)\corelib\xml -DQT_BOOTSTRAPPED
+
+CXXFLAGS = $(CFLAGS)
+LFLAGS = -heapcommit 1024 -heapreserve 102400
+LIBS = -ladvapi32.lib
+LINKQMAKE = mwccsym2 $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS)
+ADDCLEAN =
+
+
+# qmake code
+OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \
+ option.o winmakefile.o projectgenerator.o property.o meta.o \
+ makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
+ borland_bmake.o msvc_nmake.o msvc_dsp.o msvc_vcproj.o \
+ msvc_objectmodel.o initprojectdeploy_symbian.o qpopen.o \
+ symmake.o symmake_abld.o symmake_sbsv2.o
+
+ifdef QMAKE_OPENSOURCE_EDITION
+CFLAGS += -DQMAKE_OPENSOURCE_EDITION
+endif
+
+# qt code
+QTOBJS= \
+ qbitarray.o \
+ qbuffer.o \
+ qbytearray.o \
+ qcryptographichash.o \
+ qvsnprintf.o \
+ qbytearraymatcher.o \
+ qconfig.o \
+ qdatetime.o \
+ qdir.o \
+ qdiriterator.o \
+ qfile.o \
+ qtemporaryfile.o \
+ qfileinfo.o \
+ qabstractfileengine.o \
+ qfsfileengine.o \
+ qfsfileengine_iterator.o \
+ qfsfileengine_win.o \
+ qfsfileengine_iterator_win.o \
+ qglobal.o \
+ qhash.o \
+ qiodevice.o \
+ qlibraryinfo.o \
+ qlistdata.o \
+ qlinkedlist.o \
+ qlocale.o \
+ qmalloc.o \
+ qmap.o \
+ qregexp.o \
+ qstring.o \
+ qstringlist.o \
+ qtextstream.o \
+ quuid.o \
+ qvector.o \
+ qurl.o \
+ qsettings.o \
+ qsettings_win.o \
+ qvariant.o \
+ qmetatype.o \
+ qnumeric.o \
+ qscriptasm.o \
+ qscriptast.o \
+ qscriptastvisitor.o \
+ qscriptcompiler.o \
+ qscriptecmaarray.o \
+ qscriptecmaboolean.o \
+ qscriptecmacore.o \
+ qscriptecmadate.o \
+ qscriptecmafunction.o \
+ qscriptecmaglobal.o \
+ qscriptecmamath.o \
+ qscriptecmanumber.o \
+ qscriptecmaobject.o \
+ qscriptecmaregexp.o \
+ qscriptecmastring.o \
+ qscriptecmaerror.o \
+ qscriptcontext_p.o \
+ qscriptengine.o \
+ qscriptengine_p.o \
+ qscriptengineagent.o \
+ qscriptextenumeration.o \
+ qscriptextvariant.o \
+ qscriptcontext.o \
+ qscriptcontextinfo.o \
+ qscriptfunction.o \
+ qscriptgrammar.o \
+ qscriptlexer.o \
+ qscriptclassdata.o \
+ qscriptparser.o \
+ qscriptprettypretty.o \
+ qscriptsyntaxchecker.o \
+ qscriptclass.o \
+ qscriptclasspropertyiterator.o \
+ qscriptstring.o \
+ qscriptvalue.o \
+ qscriptvalueimpl.o \
+ qscriptvalueiterator.o \
+ qscriptvalueiteratorimpl.o \
+ qxmlstream.o \
+ qxmlutils.o
+
+
+qmake.exe: $(OBJS) $(QTOBJS)
+ $(LINKQMAKE)
+ -copy qmake.exe $(BUILD_PATH)\bin\qmake.exe
+
+Makefile: Makefile.win32-mwc
+ @echo "Out of date, please rerun configure"
+
+clean::
+ -del $(OBJS) $(QTOBJS) $(ADDCLEAN)
+
+distclean:: clean
+ -del qmake.exe
+ -del $(BUILD_PATH)\bin\qmake.exe
+
+.c.o:
+ $(CXX) $(CFLAGS) $<
+
+.cpp.o:
+ $(CXX) $(CXXFLAGS) $<
+
+qconfig.o: $(BUILD_PATH)/src/corelib/global/qconfig.cpp
+ $(CXX) $(CXXFLAGS) $(BUILD_PATH)/src/corelib/global/qconfig.cpp
+
+qsettings_win.o: $(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp
+
+qsettings.o: $(SOURCE_PATH)/src/corelib/io/qsettings.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qsettings.cpp
+
+qvariant.o: $(SOURCE_PATH)/src/corelib/kernel/qvariant.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/kernel/qvariant.cpp
+
+qurl.o: $(SOURCE_PATH)/src/corelib/io/qurl.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qurl.cpp
+
+qtextstream.o: $(SOURCE_PATH)/src/corelib/io/qtextstream.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qtextstream.cpp
+
+qdatastream.o: $(SOURCE_PATH)/src/corelib/io/qdatastream.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qdatastream.cpp
+
+qiodevice.o: $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp
+
+qlibraryinfo.o: $(SOURCE_PATH)/src/corelib/global/qlibraryinfo.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/global/qlibraryinfo.cpp
+
+qnumeric.o: $(SOURCE_PATH)/src/corelib/global/qnumeric.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/global/qnumeric.cpp
+
+qmalloc.o: $(SOURCE_PATH)/src/corelib/global/qmalloc.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/global/qmalloc.cpp
+
+qglobal.o: $(SOURCE_PATH)/src/corelib/global/qglobal.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/global/qglobal.cpp
+
+qhash.o: $(SOURCE_PATH)/src/corelib/tools/qhash.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qhash.cpp
+
+qbytearray.o: $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp
+
+qcryptographichash.o: $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp
+
+qvsnprintf.o: $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp
+
+qbytearraymatcher.o: $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
+
+qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
+
+qlocale.o: $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp
+
+quuid.o: $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp
+
+qbuffer.o: $(SOURCE_PATH)/src/corelib/io/qbuffer.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qbuffer.cpp
+
+qlistdata.o: $(SOURCE_PATH)/src/corelib/tools/qlistdata.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlistdata.cpp
+
+qlinkedlist.o: $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp
+
+qfile.o: $(SOURCE_PATH)/src/corelib/io/qfile.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfile.cpp
+
+qtemporaryfile.o: $(SOURCE_PATH)/src/corelib/io/qtemporaryfile.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qtemporaryfile.cpp
+
+qabstractfileengine.o: $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp
+
+qfsfileengine_win.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp
+
+qfsfileengine_iterator_win.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator_win.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator_win.cpp
+
+qfsfileengine.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp
+
+qfsfileengine_iterator.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp
+
+qtextcodec.o: $(SOURCE_PATH)/src/codecs/qtextcodec.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/codecs/qtextcodec.cpp
+
+qregexp.o: $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
+
+qvector.o: $(SOURCE_PATH)/src/corelib/tools/qvector.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qvector.cpp
+
+qbitarray.o: $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp
+
+qdir.o: $(SOURCE_PATH)/src/corelib/io/qdir.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qdir.cpp
+
+qdiriterator.o: $(SOURCE_PATH)/src/corelib/io/qdiriterator.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qdiriterator.cpp
+
+qmetatype.o: $(SOURCE_PATH)/src/corelib/kernel/qmetatype.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/kernel/qmetatype.cpp
+
+qfileinfo.o: $(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp
+
+qdatetime.o: $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp
+
+qstringlist.o: $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp
+
+qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qmap.cpp
+
+makefile.o: $(SOURCE_PATH)/qmake/generators/makefile.cpp
+ $(CXX) $(CXXFLAGS) generators/makefile.cpp
+
+unixmake.o: $(SOURCE_PATH)/qmake/generators/unix/unixmake.cpp
+ $(CXX) $(CXXFLAGS) generators/unix/unixmake.cpp
+
+unixmake2.o: $(SOURCE_PATH)/qmake/generators/unix/unixmake2.cpp
+ $(CXX) $(CXXFLAGS) generators/unix/unixmake2.cpp
+
+winmakefile.o: $(SOURCE_PATH)/qmake/generators/win32/winmakefile.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/winmakefile.cpp
+
+borland_bmake.o: $(SOURCE_PATH)/qmake/generators/win32/borland_bmake.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/borland_bmake.cpp
+
+mingw_make.o: $(SOURCE_PATH)/qmake/generators/win32/mingw_make.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/mingw_make.cpp
+
+msvc_nmake.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_nmake.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/msvc_nmake.cpp
+
+msvc_dsp.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_dsp.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/msvc_dsp.cpp
+
+msvc_vcproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/msvc_vcproj.cpp
+
+msvc_objectmodel.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_objectmodel.cpp
+ $(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp
+
+symmake.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp
+
+symmake_abld.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_abld.cpp
+
+symmake_sbsv2.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp
+
+initprojectdeploy_symbian.o: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+ $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp
+
+qpopen.o: $(SOURCE_PATH)/qmake/qpopen.cpp $(SOURCE_PATH)/qmake/qpopen.h
+ $(CXX) $(CXXFLAGS) qpopen.cpp
+
+project.o: $(SOURCE_PATH)/qmake/project.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
+ $(CXX) $(CXXFLAGS) project.cpp
+
+meta.o: $(SOURCE_PATH)/qmake/meta.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
+ $(CXX) $(CXXFLAGS) meta.cpp
+
+main.o: $(SOURCE_PATH)/qmake/main.cpp $(SOURCE_PATH)/qmake/project.h
+ $(CXX) $(CXXFLAGS) main.cpp
+
+option.o: $(SOURCE_PATH)/qmake/option.cpp $(SOURCE_PATH)/qmake/option.h
+ $(CXX) $(CXXFLAGS) option.cpp
+
+property.o: $(SOURCE_PATH)/qmake/property.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h
+ $(CXX) $(CXXFLAGS) property.cpp
+
+projectgenerator.o: $(SOURCE_PATH)/qmake/generators/projectgenerator.cpp
+ $(CXX) $(CXXFLAGS) generators/projectgenerator.cpp
+
+pbuilder_pbx.o: $(SOURCE_PATH)/qmake/generators/mac/pbuilder_pbx.cpp
+ $(CXX) $(CXXFLAGS) generators/mac/pbuilder_pbx.cpp
+
+makefiledeps.o: $(SOURCE_PATH)/qmake/generators/makefiledeps.cpp
+ $(CXX) $(CXXFLAGS) generators/makefiledeps.cpp
+
+metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp
+ $(CXX) $(CXXFLAGS) generators/metamakefile.cpp
+
+xmloutput.o: $(SOURCE_PATH)/qmake/generators/xmloutput.cpp
+ $(CXX) $(CXXFLAGS) generators/xmloutput.cpp
+
+qscriptasm.o: $(SOURCE_PATH)\src\script\qscriptasm.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\script\qscriptasm.cpp
+
+qscriptast.o: $(SOURCE_PATH)\src\script\qscriptast.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\script\qscriptast.cpp
+
+qscriptastvisitor.o: $(SOURCE_PATH)\src\script\qscriptastvisitor.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\script\qscriptastvisitor.cpp
+
+qscriptcompiler.o: $(SOURCE_PATH)\src\script\qscriptcompiler.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\script\qscriptcompiler.cpp
+
+qscriptecmaarray.o: $(SOURCE_PATH)\src\script\qscriptecmaarray.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\script\qscriptecmaarray.cpp
+
+qscriptecmaboolean.o: $(SOURCE_PATH)/src/script/qscriptecmaboolean.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmaboolean.cpp
+
+qscriptecmacore.o: $(SOURCE_PATH)/src/script/qscriptecmacore.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmacore.cpp
+
+qscriptecmadate.o: $(SOURCE_PATH)/src/script/qscriptecmadate.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmadate.cpp
+
+qscriptecmafunction.o: $(SOURCE_PATH)/src/script/qscriptecmafunction.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmafunction.cpp
+
+qscriptecmaglobal.o: $(SOURCE_PATH)/src/script/qscriptecmaglobal.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmaglobal.cpp
+
+qscriptecmamath.o: $(SOURCE_PATH)/src/script/qscriptecmamath.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmamath.cpp
+
+qscriptecmanumber.o: $(SOURCE_PATH)/src/script/qscriptecmanumber.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmanumber.cpp
+
+qscriptecmaobject.o: $(SOURCE_PATH)/src/script/qscriptecmaobject.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmaobject.cpp
+
+qscriptecmaregexp.o: $(SOURCE_PATH)/src/script/qscriptecmaregexp.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmaregexp.cpp
+
+qscriptecmastring.o: $(SOURCE_PATH)/src/script/qscriptecmastring.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmastring.cpp
+
+qscriptecmaerror.o: $(SOURCE_PATH)/src/script/qscriptecmaerror.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptecmaerror.cpp
+
+qscriptcontext_p.o: $(SOURCE_PATH)/src/script/qscriptcontext_p.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptcontext_p.cpp
+
+qscriptengine.o: $(SOURCE_PATH)/src/script/qscriptengine.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptengine.cpp
+
+qscriptengine_p.o: $(SOURCE_PATH)/src/script/qscriptengine_p.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptengine_p.cpp
+
+qscriptengineagent.o: $(SOURCE_PATH)/src/script/qscriptengineagent.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptengineagent.cpp
+
+qscriptextenumeration.o: $(SOURCE_PATH)/src/script/qscriptextenumeration.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptextenumeration.cpp
+
+qscriptextvariant.o: $(SOURCE_PATH)/src/script/qscriptextvariant.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptextvariant.cpp
+
+qscriptcontext.o: $(SOURCE_PATH)/src/script/qscriptcontext.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptcontext.cpp
+
+qscriptcontextinfo.o: $(SOURCE_PATH)/src/script/qscriptcontextinfo.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptcontextinfo.cpp
+
+qscriptfunction.o: $(SOURCE_PATH)/src/script/qscriptfunction.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptfunction.cpp
+
+qscriptgrammar.o: $(SOURCE_PATH)/src/script/qscriptgrammar.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptgrammar.cpp
+
+qscriptlexer.o: $(SOURCE_PATH)/src/script/qscriptlexer.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptlexer.cpp
+
+qscriptclassdata.o: $(SOURCE_PATH)/src/script/qscriptclassdata.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptclassdata.cpp
+
+qscriptparser.o: $(SOURCE_PATH)/src/script/qscriptparser.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptparser.cpp
+
+qscriptprettypretty.o: $(SOURCE_PATH)/src/script/qscriptprettypretty.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptprettypretty.cpp
+
+qscriptsyntaxchecker.o: $(SOURCE_PATH)/src/script/qscriptsyntaxchecker.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptsyntaxchecker.cpp
+
+qscriptclass.o: $(SOURCE_PATH)/src/script/qscriptclass.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptclass.cpp
+
+qscriptclasspropertyiterator.o: $(SOURCE_PATH)/src/script/qscriptclasspropertyiterator.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptclasspropertyiterator.cpp
+
+qscriptstring.o: $(SOURCE_PATH)/src/script/qscriptstring.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptstring.cpp
+
+qscriptvalue.o: $(SOURCE_PATH)/src/script/qscriptvalue.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalue.cpp
+
+qscriptvalueimpl.o: $(SOURCE_PATH)/src/script/qscriptvalueimpl.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalueimpl.cpp
+
+qscriptvalueiterator.o: $(SOURCE_PATH)/src/script/qscriptvalueiterator.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalueiterator.cpp
+
+qscriptvalueiteratorimpl.o: $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/script/qscriptvalueiteratorimpl.cpp
+
+qxmlstream.o: $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
+
+qxmlutils.o: $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 21d5aa4..b68f66c 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -275,10 +275,12 @@ MakefileGenerator::initOutPaths()
int slash = path.lastIndexOf(Option::dir_sep);
if(slash != -1) {
path = path.left(slash);
- if(path != "." &&
- !mkdir(fileFixify(path, qmake_getpwd(), Option::output_dir)))
- warn_msg(WarnLogic, "%s: Cannot access directory '%s'",
- (*it).toLatin1().constData(), path.toLatin1().constData());
+ // Make out path only if it does not contains makefile variables
+ if(!path.contains("${"))
+ if(path != "." &&
+ !mkdir(fileFixify(path, qmake_getpwd(), Option::output_dir)))
+ warn_msg(WarnLogic, "%s: Cannot access directory '%s'",
+ (*it).toLatin1().constData(), path.toLatin1().constData());
}
}
}
@@ -1579,8 +1581,11 @@ MakefileGenerator::verifyExtraCompiler(const QString &comp, const QString &file_
if(project->values(comp + ".CONFIG").indexOf("moc_verify") != -1) {
if(!file.isNull()) {
QMakeSourceFileInfo::addSourceFile(file, QMakeSourceFileInfo::SEEK_MOCS);
- if(!mocable(file))
+ if(!mocable(file)) {
return false;
+ } else {
+ project->values("MOCABLES").append(file);
+ }
}
} else if(project->values(comp + ".CONFIG").indexOf("function_verify") != -1) {
QString tmp_out = project->values(comp + ".output").first();
@@ -1697,6 +1702,10 @@ MakefileGenerator::writeExtraTargets(QTextStream &t)
if(!cmd.isEmpty())
t << "\n\t" << cmd;
t << endl << endl;
+
+ project->values(QLatin1String("QMAKE_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(targ);
+ project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(targ)) << deps.split(" ", QString::SkipEmptyParts);
+ project->values(QLatin1String("QMAKE_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(targ)) << cmd;
}
}
@@ -1784,6 +1793,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
tmp_clean = tmp_out;
if(tmp_clean.indexOf("${QMAKE_") == -1) {
t << "\n\t" << "-$(DEL_FILE) " << tmp_clean;
+ if (isForSymbian())
+ t << " 2> NUL"; // Eliminate unnecessary warnings
wrote_clean = true;
}
if(!wrote_clean_cmds || !wrote_clean) {
@@ -1812,7 +1823,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
}
if(!cleans.isEmpty())
- t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, "");
+ if (isForSymbian())
+ t << valGlue(cleans, "\n\t" + del_statement, " 2> NUL\n\t" + del_statement, " 2> NUL");
+ else
+ t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, "");
if(!wrote_clean_cmds) {
for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
t << "\n\t" << replaceExtraCompilerVariables(tmp_clean_cmds, (*input),
@@ -1839,6 +1853,17 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input),
tmp_out);
dep_cmd = fixEnvVariables(dep_cmd);
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+ QPopen procPipe;
+ if (procPipe.init(dep_cmd.toLatin1().constData(), "r")) {
+ QString indeps;
+ while(true) {
+ int read_in = procPipe.fread(buff, 255);
+ if(!read_in)
+ break;
+ indeps += QByteArray(buff, read_in);
+ }
+#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1848,6 +1873,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
indeps += QByteArray(buff, read_in);
}
QT_PCLOSE(proc);
+#endif
if(!indeps.isEmpty()) {
QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
@@ -1887,15 +1913,28 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
if (inputs.isEmpty())
continue;
- QString cmd = replaceExtraCompilerVariables(tmp_cmd, escapeFilePaths(inputs), QStringList(tmp_out));
+ QString cmd;
+ if (isForSymbianSbsv2()) {
+ // In sbsv2 the command inputs and outputs need to use absolute paths
+ cmd = replaceExtraCompilerVariables(tmp_cmd,
+ fileFixify(escapeFilePaths(inputs), FileFixifyAbsolute),
+ fileFixify(QStringList(tmp_out), FileFixifyAbsolute));
+ } else {
+ cmd = replaceExtraCompilerVariables(tmp_cmd, escapeFilePaths(inputs), QStringList(tmp_out));
+ }
+
t << escapeDependencyPath(tmp_out) << ":";
+ project->values(QLatin1String("QMAKE_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(tmp_out);
// compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies
if(project->values((*it) + ".CONFIG").indexOf("explicit_dependencies") != -1) {
t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, Option::output_dir, Option::output_dir)));
+ project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(tmp_out)) << tmp_dep;
} else {
t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(escapeDependencyPaths(deps));
+ project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(tmp_out)) << inputs << deps;
}
t << "\n\t" << cmd << endl << endl;
+ project->values(QLatin1String("QMAKE_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(tmp_out)) << cmd;
continue;
}
for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
@@ -1910,12 +1949,31 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
QString cmd = replaceExtraCompilerVariables(tmp_cmd, (*input), out);
// NOTE: The var -> QMAKE_COMP_var replace feature is unsupported, do not use!
+ if (isForSymbianSbsv2()) {
+ // In sbsv2 the command inputs and outputs need to use absolute paths
+ cmd = replaceExtraCompilerVariables(tmp_cmd,
+ fileFixify((*input), FileFixifyAbsolute),
+ fileFixify(out, FileFixifyAbsolute));
+ } else {
+ cmd = replaceExtraCompilerVariables(tmp_cmd, (*input), out);
+ }
for(QStringList::ConstIterator it3 = vars.constBegin(); it3 != vars.constEnd(); ++it3)
cmd.replace("$(" + (*it3) + ")", "$(QMAKE_COMP_" + (*it3)+")");
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
char buff[256];
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input), out);
dep_cmd = fixEnvVariables(dep_cmd);
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+ QPopen procPipe;
+ if (procPipe.init(dep_cmd.toLatin1().constData(), "r")) {
+ QString indeps;
+ while(true) {
+ int read_in = procPipe.fread(buff, 255);
+ if(!read_in)
+ break;
+ indeps += QByteArray(buff, read_in);
+ }
+#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1925,6 +1983,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
indeps += QByteArray(buff, read_in);
}
QT_PCLOSE(proc);
+#endif
if(!indeps.isEmpty()) {
QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
@@ -1999,6 +2058,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
t << escapeDependencyPath(out) << ": " << valList(escapeDependencyPaths(deps)) << "\n\t"
<< cmd << endl << endl;
+ project->values(QLatin1String("QMAKE_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(out);
+ project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(out)) << deps;
+ project->values(QLatin1String("QMAKE_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(out)) << cmd;
}
}
t << "compiler_clean: " << clean_targets << endl << endl;
@@ -2172,8 +2234,8 @@ MakefileGenerator::writeHeader(QTextStream &t)
t << endl;
}
-void
-MakefileGenerator::writeSubDirs(QTextStream &t)
+QList<MakefileGenerator::SubTarget*>
+MakefileGenerator::findSubDirsSubTargets() const
{
QList<SubTarget*> targets;
{
@@ -2270,6 +2332,13 @@ MakefileGenerator::writeSubDirs(QTextStream &t)
}
}
}
+ return targets;
+}
+
+void
+MakefileGenerator::writeSubDirs(QTextStream &t)
+{
+ QList<SubTarget*> targets = findSubDirsSubTargets();
t << "first: make_default" << endl;
int flags = SubTargetInstalls;
if(project->isActiveConfig("ordered"))
@@ -2286,39 +2355,43 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
for(QStringList::Iterator qeui_it = qeui.begin(); qeui_it != qeui.end(); ++qeui_it)
t << "include " << (*qeui_it) << endl;
- QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
- if(ofile.lastIndexOf(Option::dir_sep) != -1)
- ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1);
- t << "MAKEFILE = " << ofile << endl;
- /* Calling Option::fixPathToTargetOS() is necessary for MinGW/MSYS, which requires
- * back-slashes to be turned into slashes. */
- t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;
- t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
- t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
- t << "MKDIR = " << var("QMAKE_MKDIR") << endl;
- t << "COPY = " << var("QMAKE_COPY") << endl;
- t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl;
- t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << endl;
- t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
- t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
- t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
- t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
- t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl;
- t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
- t << "MOVE = " << var("QMAKE_MOVE") << endl;
- t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
- t << "MKDIR = " << var("QMAKE_MKDIR") << endl;
+ if (!(flags & SubTargetSkipDefaultVariables)) {
+ QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
+ if(ofile.lastIndexOf(Option::dir_sep) != -1)
+ ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1);
+ t << "MAKEFILE = " << ofile << endl;
+ /* Calling Option::fixPathToTargetOS() is necessary for MinGW/MSYS, which requires
+ * back-slashes to be turned into slashes. */
+ t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;
+ t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
+ t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
+ t << "MKDIR = " << var("QMAKE_MKDIR") << endl;
+ t << "COPY = " << var("QMAKE_COPY") << endl;
+ t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl;
+ t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << endl;
+ t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
+ t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
+ t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
+ t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
+ t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl;
+ t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
+ t << "MOVE = " << var("QMAKE_MOVE") << endl;
+ t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
+ t << "MKDIR = " << var("QMAKE_MKDIR") << endl;
+ t << "SUBTARGETS = "; // subtargets are sub-directory
+ for(int target = 0; target < targets.size(); ++target)
+ t << " \\\n\t\t" << targets.at(target)->target;
+ t << endl << endl;
+ }
writeExtraVariables(t);
- t << "SUBTARGETS = "; // subtargets are sub-directory
- for(int target = 0; target < targets.size(); ++target)
- t << " \\\n\t\t" << targets.at(target)->target;
- t << endl << endl;
QStringList targetSuffixes;
const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH");
- targetSuffixes << "make_default" << "make_first" << "all" << "clean" << "distclean"
- << QString((flags & SubTargetInstalls) ? "install_subtargets" : "install")
- << QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall");
+ if (!(flags & SubTargetSkipDefaultTargets)) {
+ targetSuffixes << "make_default" << "make_first" << "all" << "clean" << "distclean"
+ << QString((flags & SubTargetInstalls) ? "install_subtargets" : "install")
+ << QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall");
+ }
// generate target rules
for(int target = 0; target < targets.size(); ++target) {
@@ -2438,23 +2511,25 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
}
t << endl;
- if(project->values("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1)
- project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all");
+ if (!(flags & SubTargetSkipDefaultTargets)) {
+ if(project->values("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1)
+ project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all");
- writeMakeQmake(t);
+ writeMakeQmake(t);
- t << "qmake_all:";
- if(!targets.isEmpty()) {
- for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it) {
- if(!(*it)->profile.isEmpty())
- t << " " << (*it)->target << "-" << "qmake_all";
+ t << "qmake_all:";
+ if(!targets.isEmpty()) {
+ for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it) {
+ if(!(*it)->profile.isEmpty())
+ t << " " << (*it)->target << "-" << "qmake_all";
+ }
}
+ if(project->isEmpty("QMAKE_NOFORCE"))
+ t << " FORCE";
+ if(project->isActiveConfig("no_empty_targets"))
+ t << "\n\t" << "@cd .";
+ t << endl << endl;
}
- if(project->isEmpty("QMAKE_NOFORCE"))
- t << " FORCE";
- if(project->isActiveConfig("no_empty_targets"))
- t << "\n\t" << "@cd .";
- t << endl << endl;
for(int s = 0; s < targetSuffixes.size(); ++s) {
QString suffix = targetSuffixes.at(s);
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index cf09a6a..a6eec52 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -53,8 +53,12 @@
QT_BEGIN_NAMESPACE
#ifdef Q_OS_WIN32
+#if defined(Q_CC_MWERKS)
+#include "qpopen.h"
+#else
#define QT_POPEN _popen
#define QT_PCLOSE _pclose
+#endif
#else
#define QT_POPEN popen
#define QT_PCLOSE pclose
@@ -84,6 +88,7 @@ class MakefileGenerator : protected QMakeSourceFileInfo
QString build_args(const QString &outdir=QString());
void checkMultipleDefinition(const QString &, const QString &);
+protected:
//internal caches
mutable QHash<QString, QMakeLocalFileName> depHeuristicsCache;
mutable QHash<QString, QStringList> dependsCache;
@@ -116,9 +121,12 @@ protected:
enum SubTargetFlags {
SubTargetInstalls=0x01,
SubTargetOrdered=0x02,
+ SubTargetSkipDefaultVariables=0x04,
+ SubTargetSkipDefaultTargets=0x08,
SubTargetsNoFlags=0x00
};
+ QList<MakefileGenerator::SubTarget*> findSubDirsSubTargets() const;
void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags);
//extra compiler interface
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 1646b5b..5494b5d 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -258,8 +258,9 @@ MakefileGenerator
class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator
{
+protected:
+
bool init_flag;
-private:
struct Subdir {
Subdir() : makefile(0), indent(0) { }
~Subdir() { delete makefile; }
@@ -370,6 +371,7 @@ SubdirsMetaMakefileGenerator::init()
self->makefile = new BuildsMetaMakefileGenerator(project, name, false);
self->makefile->init();
subs.append(self);
+
return true;
}
@@ -413,6 +415,306 @@ SubdirsMetaMakefileGenerator::~SubdirsMetaMakefileGenerator()
subs.clear();
}
+class SymbianSubdirsMetaMakefileGenerator : public SubdirsMetaMakefileGenerator {
+
+public:
+ SymbianSubdirsMetaMakefileGenerator(QMakeProject *p, const QString &n, bool op) : SubdirsMetaMakefileGenerator(p, n, op) { }
+ virtual ~SymbianSubdirsMetaMakefileGenerator();
+
+ virtual bool init();
+ virtual bool write(const QString &);
+
+protected:
+
+ static QMap<QString, QString> mmpPaths;
+
+ static QMultiMap<QString, QString> mmpDependency;
+
+ static QStringList getDependencyList(QString mmpFilename, int recursionDepth);
+
+ static QStringList calculateRelativePaths(QString mmpParent, QStringList mmpChildren);
+
+private:
+ QString cleanFromSpecialCharacters(QString& str);
+
+};
+
+QMap<QString, QString> SymbianSubdirsMetaMakefileGenerator::mmpPaths;
+
+QMultiMap<QString, QString> SymbianSubdirsMetaMakefileGenerator::mmpDependency;
+
+QStringList SymbianSubdirsMetaMakefileGenerator::getDependencyList(QString mmpFilename, int recursionDepth) {
+
+ QStringList list;
+
+ // printf("Entering recursion mmpFilename = %s and depth = %d \n", qPrintable(mmpFilename), recursionDepth);
+
+ QList<QString> values = mmpDependency.values(mmpFilename);
+ if(recursionDepth < 0) {
+ // special case
+ // just first dependency level
+ list = values;
+ return list;
+
+ }
+ if(values.size() == 0) {
+
+ //reached recursion END condition
+ if(recursionDepth == 0) {
+ --recursionDepth;
+ return list; // empty list // no dependencies / return
+ }
+ else {
+ list.append(mmpFilename);
+ recursionDepth--;
+ return list; // leaf // return
+ }
+ } else {
+ recursionDepth++;
+ for (int i = 0; i < values.size(); ++i) {
+ QString current = values.at(i);
+ QStringList tailList = getDependencyList(current, recursionDepth);
+ for(int j = 0; j < tailList.size(); ++j) {
+ //QString path = mmpFilename + tailList.at(j);
+ QString path = tailList.at(j);
+ list.append(path);
+ //printf("MMPDEPENDENCY: %s\n", path.toAscii().data());
+ }// for(int j = 0; j < values.size(); ++j)
+ //list.append(current);
+ } // for (int i = 0; i < values.size(); ++i)
+
+ if(recursionDepth > 0) {
+ //for mmp somewhere in middle
+ list.append(mmpFilename);
+ }
+ recursionDepth--;
+ return list;
+ }
+
+}
+SymbianSubdirsMetaMakefileGenerator::~SymbianSubdirsMetaMakefileGenerator() { }
+
+bool SymbianSubdirsMetaMakefileGenerator::write(const QString &oldpwd) {
+ return SubdirsMetaMakefileGenerator::write(oldpwd);
+}
+
+QString SymbianSubdirsMetaMakefileGenerator::cleanFromSpecialCharacters(QString& str) {
+ QString tmp = str;
+
+ tmp.replace(QString("/"), QString("_"));
+ tmp.replace(QString("\\"), QString("_"));
+ tmp.replace(QString("-"), QString("_"));
+ tmp.replace(QString(":"), QString("_"));
+ tmp.replace(QString("."), QString("_"));
+
+ return tmp;
+}
+
+bool SymbianSubdirsMetaMakefileGenerator::init() {
+
+ if(init_flag)
+ return false;
+
+ init_flag = true;
+
+ /*
+ Not neccessary as it was
+ causing second pass through
+ subdir elements
+
+ SubdirsMetaMakefileGenerator::init();
+ */
+
+ /*
+ if we are here then we have template = subdirs
+
+ so... go for it ...
+ */
+
+ Option::recursive = true;
+
+ if(Option::recursive) {
+ QString old_output_dir = QDir::cleanPath(Option::output_dir);
+ if(!old_output_dir.endsWith('/'))
+ old_output_dir += '/';
+ QString old_output = Option::output.fileName();
+ QString oldpwd = QDir::cleanPath(qmake_getpwd());
+
+ if(!oldpwd.endsWith('/'))
+ oldpwd += '/';
+
+ // find the parent mmp filename
+ int end = oldpwd.size() - 1;
+ int start = oldpwd.lastIndexOf("/", end - 2);
+ QString parentMmpFilename = oldpwd.mid(start + 1, end - start - 1);
+ parentMmpFilename.prepend(oldpwd);
+ parentMmpFilename = parentMmpFilename.append(".mmp");
+
+
+ const QStringList &subdirs = project->values("SUBDIRS");
+ static int recurseDepth = -1;
+ ++recurseDepth;
+ for(int i = 0; i < subdirs.size(); ++i) {
+ Subdir *sub = new Subdir;
+ sub->indent = recurseDepth;
+
+ QFileInfo subdir(subdirs.at(i));
+ // childMmpFielname should be derived from subdirName
+ QString subdirName = subdirs.at(i);
+ if(!project->isEmpty(subdirs.at(i) + ".file"))
+ subdir = project->first(subdirs.at(i) + ".file");
+ else if(!project->isEmpty(subdirs.at(i) + ".subdir"))
+ subdir = project->first(subdirs.at(i) + ".subdir");
+ QString sub_name;
+
+ QString childMmpFilename;
+
+ if(subdir.isDir()) {
+ subdir = QFileInfo(subdir.filePath() + "/" + subdir.fileName() + Option::pro_ext);
+ childMmpFilename = subdir.fileName();
+ // TODO: create Option::mmp_ext
+ childMmpFilename = subdir.absoluteFilePath();
+ childMmpFilename.replace(Option::pro_ext, QString(""));
+ childMmpFilename.append(".mmp");
+ }
+ else {
+ childMmpFilename = subdir.absoluteFilePath();
+ childMmpFilename.replace(QString(".pro"), QString(".mmp"));
+ sub_name = childMmpFilename;
+ sub_name.replace(QString(".mmp"), QString(""));
+ sub_name.replace(0, sub_name.lastIndexOf("/") + 1, QString(""));
+ project->values("SHADOW_BLD_INFS").append(QString("bld.inf.") + sub_name);
+ }
+
+ //handle sub project
+ QMakeProject *sub_proj = new QMakeProject(project->properties());
+ for (int ind = 0; ind < sub->indent; ++ind)
+ printf(" ");
+ sub->input_dir = subdir.absolutePath();
+ if(subdir.isRelative() && old_output_dir != oldpwd) {
+ sub->output_dir = old_output_dir + "/" + subdir.path();
+ printf("Reading %s [%s]\n", subdir.absoluteFilePath().toLatin1().constData(), sub->output_dir.toLatin1().constData());
+ } else { //what about shadow builds?
+ sub->output_dir = sub->input_dir;
+ printf("Reading %s\n", subdir.absoluteFilePath().toLatin1().constData());
+ }
+
+ // find the child mmp filename
+ qmake_setpwd(sub->input_dir);
+
+ QString newpwd = qmake_getpwd();
+
+ Option::output_dir = sub->output_dir;
+ if(Option::output_dir.at(Option::output_dir.length()-1) != QLatin1Char('/'))
+ Option::output_dir += QLatin1Char('/');
+ sub_proj->read(subdir.fileName());
+ if(!sub_proj->variables()["QMAKE_FAILED_REQUIREMENTS"].isEmpty()) {
+ fprintf(stderr, "Project file(%s) not recursed because all requirements not met:\n\t%s\n",
+ subdir.fileName().toLatin1().constData(),
+ sub_proj->values("QMAKE_FAILED_REQUIREMENTS").join(" ").toLatin1().constData());
+ delete sub;
+ delete sub_proj;
+ //continue;
+ } else {
+ // map mmpfile to its absolut filepath
+ mmpPaths.insert(childMmpFilename, newpwd);
+
+ // update mmp files dependency map
+ mmpDependency.insert(parentMmpFilename, childMmpFilename);
+
+ sub->makefile = MetaMakefileGenerator::createMetaGenerator(sub_proj, sub_name);
+ if(0 && sub->makefile->type() == SUBDIRSMETATYPE) {
+ subs.append(sub);
+ } else {
+ const QString output_name = Option::output.fileName();
+ Option::output.setFileName(sub->output_file);
+ sub->makefile->write(sub->output_dir);
+ delete sub;
+ qmakeClearCaches();
+ sub = 0;
+ Option::output.setFileName(output_name);
+ }
+ }
+
+ Option::output_dir = old_output_dir;
+ qmake_setpwd(oldpwd);
+
+ }
+ --recurseDepth;
+ Option::output.setFileName(old_output);
+ Option::output_dir = old_output_dir;
+ qmake_setpwd(oldpwd);
+ }
+
+ Subdir *self = new Subdir;
+ self->input_dir = qmake_getpwd();
+
+ // to fully expand find all dependencies
+ // do as recursion, then
+ // insert result
+ // as subdirs data in project
+ QString newpwd = qmake_getpwd();
+ if(!newpwd.endsWith('/'))
+ newpwd += '/';
+ int end = newpwd.size() - 1;
+ int start = newpwd.lastIndexOf("/", end - 2);
+ QString mmpFilename = newpwd.mid(start + 1, end - start - 1);
+ mmpFilename.prepend(newpwd);
+ mmpFilename = mmpFilename.append(".mmp");
+
+ // map mmpfile to its absolut filepath
+ mmpPaths.insert(mmpFilename, newpwd);
+
+ QStringList directDependencyList = getDependencyList(mmpFilename, -1);
+ for(int i = 0; i < directDependencyList.size(); ++i) {
+ project->values("MMPFILES_DIRECT_DEPENDS").append(directDependencyList.at(i));
+ }
+
+ QStringList dependencyList = getDependencyList(mmpFilename, 0);
+/*
+ printf("\n \n PRINTING DEPENDENCY FOR: %s \n", mmpFilename.toAscii().data());
+ // print it for debug
+ for(int i = 0; i < dependencyList.size(); ++i) {
+ printf("FINAL MMP DEPENDENCIES: %s\n", dependencyList.at(i).toAscii().data());
+ }
+ printf("\n \n");
+
+ printf("\n \n PRINTING DIRECT DEPENDENCY FOR: %s \n", mmpFilename.toAscii().data());
+ // print it for debug
+ for(int i = 0; i < directDependencyList.size(); ++i) {
+ printf("DIRECT MMP DEPENDENCIES: %s\n", directDependencyList.at(i).toAscii().data());
+ }
+ printf("\n \n");
+*/
+ self->output_dir = Option::output_dir;
+ if(!Option::recursive || (!Option::output.fileName().endsWith(Option::dir_sep) && !QFileInfo(Option::output).isDir()))
+ self->output_file = Option::output.fileName();
+ self->makefile = new BuildsMetaMakefileGenerator(project, name, false);
+ self->makefile->init();
+ subs.append(self);
+ return true;
+}
+
+QStringList SymbianSubdirsMetaMakefileGenerator::calculateRelativePaths(QString mmpParent, QStringList mmpChildren) {
+ QStringList mmpRelativePaths;
+ QString parentDir = mmpPaths.value(mmpParent);
+ QDir directory(parentDir);
+ for(int i = 0; i < mmpChildren.size(); ++i) {
+ QString childDir = mmpPaths.value(mmpChildren.at(i));
+ if(mmpChildren.at(i) == mmpParent)
+ mmpRelativePaths.append(mmpChildren.at(i));
+ else {
+ QString relativePath = directory.relativeFilePath(childDir);
+ if(relativePath.startsWith(".."))
+ mmpRelativePaths.append(childDir);
+ else
+ directory.relativeFilePath(relativePath);
+ //mmpRelativePaths.append(directory.relativeFilePath(childDir) + "/" + mmpChildren.at(i));
+ }
+ }
+ return mmpRelativePaths;
+}
+
//Factory things
QT_BEGIN_INCLUDE_NAMESPACE
#include "unixmake.h"
@@ -423,6 +725,8 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include "borland_bmake.h"
#include "msvc_dsp.h"
#include "msvc_vcproj.h"
+#include "symmake_abld.h"
+#include "symmake_sbsv2.h"
QT_END_INCLUDE_NAMESPACE
MakefileGenerator *
@@ -459,6 +763,10 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO)
mkfile = new NmakeMakefileGenerator;
} else if(gen == "BMAKE") {
mkfile = new BorlandMakefileGenerator;
+ } else if(gen == "SYMBIAN_ABLD") {
+ mkfile = new SymbianAbldMakefileGenerator;
+ } else if(gen == "SYMBIAN_SBSV2") {
+ mkfile = new SymbianSbsv2MakefileGenerator;
} else {
fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData());
}
@@ -475,7 +783,10 @@ MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &na
MetaMakefileGenerator *ret = 0;
if((Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
Option::qmake_mode == Option::QMAKE_GENERATE_PRL)) {
- if(proj->first("TEMPLATE").endsWith("subdirs"))
+ if(proj->first("MAKEFILE_GENERATOR").startsWith("SYMBIAN") && proj->values("TEMPLATE").contains("subdirs")) {
+ // new metamakefilegenerator type to support subdirs for symbian related projects
+ ret = new SymbianSubdirsMetaMakefileGenerator(proj, name, op);
+ } else if (proj->first("TEMPLATE").endsWith("subdirs"))
ret = new SubdirsMetaMakefileGenerator(proj, name, op);
}
if(!ret)
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
new file mode 100644
index 0000000..0325264
--- /dev/null
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
@@ -0,0 +1,240 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "initprojectdeploy_symbian.h"
+#include <QDirIterator>
+#include <project.h>
+#include <qdebug.h>
+
+#define PLUGIN_STUB_DIR "qmakepluginstubs"
+
+static bool isPlugin(const QFileInfo& info, const QString& devicePath)
+{
+ // Libraries are plugins if deployment path is something else than
+ // \\sys\\bin or x:\\sys\\bin
+ if (0 == info.suffix().compare(QLatin1String("dll")) &&
+ (devicePath.size() < 8 ||
+ (0 != devicePath.compare(QLatin1String("\\sys\\bin")) &&
+ 0 != devicePath.mid(1).compare(QLatin1String(":\\sys\\bin"))))) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+static bool isBinary(const QFileInfo& info)
+{
+ if (0 == info.suffix().compare(QLatin1String("dll")) ||
+ 0 == info.suffix().compare(QLatin1String("exe"))) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+static void createPluginStub(const QFileInfo& info,
+ const QString& devicePath,
+ DeploymentList &deploymentList,
+ QStringList& generatedDirs,
+ QStringList& generatedFiles) {
+ QDir().mkpath(QLatin1String(PLUGIN_STUB_DIR "\\"));
+ if (!generatedDirs.contains(PLUGIN_STUB_DIR))
+ generatedDirs << PLUGIN_STUB_DIR;
+ // Plugin stubs must have different name from the actual plugins, because
+ // the toolchain for creating ROM images cannot handle non-binary .dll files properly.
+ QFile stubFile(QLatin1String(PLUGIN_STUB_DIR "\\") + info.completeBaseName() + ".qtplugin");
+ if(stubFile.open(QIODevice::WriteOnly)) {
+ if (!generatedFiles.contains(stubFile.fileName()))
+ generatedFiles << stubFile.fileName();
+ QTextStream t(&stubFile);
+ // Add note to stub so that people will not wonder what it is.
+ // Creation date is added to make new stub to deploy always to
+ // force plugin cache miss when loading plugins.
+ t << "This file is a Qt plugin stub file. The real Qt plugin is located in \\sys\\bin. Created:" << QDateTime::currentDateTime().toString(Qt::ISODate) << "\n";
+ } else {
+ fprintf(stderr, "cannot deploy \"%s\" because of plugin stub file creation failed\n", info.fileName().toLatin1().constData());
+ }
+ QFileInfo stubInfo(stubFile);
+ deploymentList.append(CopyItem(Option::fixPathToLocalOS(stubInfo.absoluteFilePath()),
+ Option::fixPathToLocalOS(devicePath + "\\" + stubInfo.fileName())));
+}
+
+void initProjectDeploySymbian(QMakeProject* project,
+ DeploymentList &deploymentList,
+ const QString &testPath,
+ bool deployBinaries,
+ const QString &platform,
+ const QString &build,
+ QStringList& generatedDirs,
+ QStringList& generatedFiles)
+{
+ QString targetPath = project->values("deploy.path").join(" ");
+ if (targetPath.isEmpty())
+ targetPath = testPath;
+ if (targetPath.endsWith("/") || targetPath.endsWith("\\"))
+ targetPath = targetPath.mid(0,targetPath.size()-1);
+
+ bool targetPathHasDriveLetter = false;
+ if (targetPath.size() > 1) {
+ targetPathHasDriveLetter = targetPath.at(1) == QLatin1Char(':');
+ }
+ QString deploymentDrive = targetPathHasDriveLetter ? targetPath.left(2) : QLatin1String("c:");
+
+ // foreach item in DEPLOYMENT
+ foreach(QString item, project->values("DEPLOYMENT")) {
+ // get item.path
+ QString devicePath = project->first(item + ".path");
+ if (!deployBinaries
+ && !devicePath.isEmpty()
+ && (0 == devicePath.compare(project->values("APP_RESOURCE_DIR").join(""))
+ || 0 == devicePath.compare(project->values("REG_RESOURCE_IMPORT_DIR").join("")))) {
+ // Do not deploy resources in emulator builds, as that seems to cause conflicts
+ // If there is ever a real need to deploy pre-built resources for emulator,
+ // BLD_INF_RULES.prj_exports can be used as a workaround.
+ continue;
+ }
+
+ bool devicePathHasDriveLetter = false;
+ if (devicePath.size() > 1) {
+ devicePathHasDriveLetter = devicePath.at(1) == QLatin1Char(':');
+ }
+
+ if (devicePath.isEmpty() || devicePath == QLatin1String(".")) {
+ devicePath = targetPath;
+ }
+ // check if item.path is relative (! either / or \)
+ else if (!(devicePath.at(0) == QLatin1Char('/')
+ || devicePath.at(0) == QLatin1Char('\\')
+ || devicePathHasDriveLetter)) {
+ // create output path
+ devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('\\') + devicePath));
+ } else {
+ if (0 == platform.compare(QLatin1String("winscw"))) {
+ devicePath = epocRoot() + "epoc32\\winscw\\c" + devicePath;
+ } else {
+ // Drive letter needed if targetpath contains one and it is not already in
+ if (targetPathHasDriveLetter && !devicePathHasDriveLetter) {
+ devicePath = deploymentDrive + devicePath;
+ }
+ }
+ }
+
+ devicePath.replace(QLatin1String("/"), QLatin1String("\\"));
+
+ if (!deployBinaries &&
+ 0 == devicePath.right(8).compare(QLatin1String("\\sys\\bin"))) {
+ // Skip deploying to \\sys\\bin for anything but binary deployments
+ // Note: Deploying pre-built binaries also follow this rule, so emulator builds
+ // will not get those deployed. Since there is no way to differentiate currently
+ // between pre-built binaries for emulator and HW anyway, this is not a major issue.
+ continue;
+ }
+
+ // foreach d in item.sources
+ foreach(QString source, project->values(item + ".sources")) {
+ source = Option::fixPathToLocalOS(source);
+ QString nameFilter;
+ QFileInfo info(source);
+ QString searchPath;
+ bool dirSearch = false;
+
+ if (info.isDir()) {
+ nameFilter = QLatin1String("*");
+ searchPath = info.absoluteFilePath();
+ dirSearch = true;
+ } else {
+ if (info.exists() || source.indexOf('*') != -1) {
+ nameFilter = source.split('\\').last();
+ searchPath = info.absolutePath();
+ } else {
+ // Entry was not found. That is ok if it is a binary, since those do not necessarily yet exist.
+ // Dlls need to be processed even when not deploying binaries for the stubs
+ if (isBinary(info)) {
+ if (deployBinaries) {
+ // Executables and libraries are deployed to \sys\bin
+ QFileInfo releasePath(epocRoot() + "epoc32\\release\\" + platform + "\\" + build + "\\");
+ deploymentList.append(CopyItem(Option::fixPathToLocalOS(releasePath.absolutePath() + "\\" + info.fileName()),
+ Option::fixPathToLocalOS(deploymentDrive + QLatin1String("\\sys\\bin\\") + info.fileName())));
+ }
+ if (isPlugin(info, devicePath)) {
+ createPluginStub(info, devicePath, deploymentList, generatedDirs, generatedFiles);
+ continue;
+ }
+ } else {
+ // Generate deployment even if file doesn't exist, as this may be the case
+ // when generating .pkg files.
+ deploymentList.append(CopyItem(Option::fixPathToLocalOS(info.absoluteFilePath()),
+ Option::fixPathToLocalOS(devicePath + "\\" + info.fileName())));
+ continue;
+ }
+ }
+ }
+
+ int pathSize = info.absolutePath().size();
+ QDirIterator iterator(searchPath, QStringList() << nameFilter
+ , QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks
+ , dirSearch ? QDirIterator::Subdirectories : QDirIterator::NoIteratorFlags );
+ // foreach dirIterator-entry in d
+ while(iterator.hasNext()) {
+ iterator.next();
+ QFileInfo iteratorInfo(iterator.filePath());
+ QString absoluteItemPath = Option::fixPathToLocalOS(iteratorInfo.absolutePath());
+ int diffSize = absoluteItemPath.size() - pathSize;
+
+ if (!iteratorInfo.isDir()) {
+ if (isPlugin(iterator.fileInfo(), devicePath)) {
+ // This deploys pre-built plugins. Other pre-built binaries will deploy normally,
+ // as they have \sys\bin target path.
+ if (deployBinaries) {
+ deploymentList.append(CopyItem(Option::fixPathToLocalOS(absoluteItemPath + "\\" + iterator.fileName()),
+ Option::fixPathToLocalOS(deploymentDrive + QLatin1String("\\sys\\bin\\") + iterator.fileName())));
+ }
+ createPluginStub(info, devicePath + "\\" + absoluteItemPath.right(diffSize), deploymentList, generatedDirs, generatedFiles);
+ continue;
+ } else {
+ deploymentList.append(CopyItem(Option::fixPathToLocalOS(absoluteItemPath + "\\" + iterator.fileName()),
+ Option::fixPathToLocalOS(devicePath + "\\" + absoluteItemPath.right(diffSize) + "\\" + iterator.fileName())));
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.h b/qmake/generators/symbian/initprojectdeploy_symbian.h
new file mode 100644
index 0000000..0aad431
--- /dev/null
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef INITPROJECTDEPLOYSYMBIAN_H
+#define INITPROJECTDEPLOYSYMBIAN_H
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qdatetime.h>
+#include <option.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <stdlib.h>
+
+struct CopyItem
+{
+ CopyItem(const QString& f, const QString& t) : from(f) , to(t) { }
+ QString from;
+ QString to;
+};
+typedef QList<CopyItem> DeploymentList;
+
+extern void initProjectDeploySymbian(QMakeProject* project,
+ DeploymentList &deploymentList,
+ const QString &testPath,
+ bool deployBinaries,
+ const QString &platform,
+ const QString &build,
+ QStringList& generatedDirs,
+ QStringList& generatedFiles);
+#endif // INITPROJECTDEPLOYSYMBIAN_H \ No newline at end of file
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
new file mode 100644
index 0000000..f1e9165
--- /dev/null
+++ b/qmake/generators/symbian/symmake.cpp
@@ -0,0 +1,1648 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "symmake.h"
+#include "initprojectdeploy_symbian.h"
+
+#include <qstring.h>
+#include <qhash.h>
+#include <qstringlist.h>
+#include <qdir.h>
+#include <qdatetime.h>
+#include <stdlib.h>
+#include <qdebug.h>
+
+#define RESOURCE_DIRECTORY_MMP "/resource/apps"
+#define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\"
+#define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps"
+#define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def"
+#define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonU.def"
+#define BLD_INF_FILENAME_LEN (sizeof(BLD_INF_FILENAME) - 1)
+
+#define BLD_INF_RULES_BASE "BLD_INF_RULES."
+#define BLD_INF_TAG_PLATFORMS "prj_platforms"
+#define BLD_INF_TAG_MMPFILES "prj_mmpfiles"
+#define BLD_INF_TAG_TESTMMPFILES "prj_testmmpfiles"
+#define BLD_INF_TAG_EXTENSIONS "prj_extensions"
+#define RSS_RULES "RSS_RULES"
+#define RSS_RULES_BASE "RSS_RULES."
+#define RSS_TAG_NBROFICONS "number_of_icons"
+#define RSS_TAG_ICONFILE "icon_file"
+
+#define DUMP_VAR(v) \
+{ \
+ QString s(v); \
+ QStringList list = project->values(s); \
+ printf("----------------------------------\n", qPrintable(s)); \
+ printf("Dumping %s (%d items) from %s, %d\n", \
+ qPrintable(s), \
+ list.count(), \
+ __FILE__, \
+ __LINE__); \
+ foreach(QString l, list) \
+ printf("\t%s\n", qPrintable(l)); \
+}
+
+QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const QDir& parentDir)
+{
+ static QString epocRootStr;
+ if (epocRootStr.isEmpty()) {
+ QFileInfo efi(epocRoot());
+ epocRootStr = efi.canonicalFilePath();
+ if (epocRootStr.isEmpty()) {
+ fprintf(stderr, "Unable to resolve epocRoot '%s' to real dir on current drive, defaulting to '/' for mmp paths\n", qPrintable(epocRoot()));
+ epocRootStr = "/";
+ }
+ if (!epocRootStr.endsWith("/"))
+ epocRootStr += "/";
+
+ epocRootStr += "epoc32/";
+ }
+
+ QString resultPath = origPath;
+
+ // Make it relative, unless it starts with "%epocroot%/epoc32/"
+ if (resultPath.startsWith(epocRootStr, Qt::CaseInsensitive)) {
+ resultPath.replace(epocRootStr, "/epoc32/", Qt::CaseInsensitive);
+ } else {
+ resultPath = parentDir.relativeFilePath(resultPath);
+ }
+ resultPath = QDir::cleanPath(resultPath);
+
+ if (resultPath.isEmpty())
+ resultPath = ".";
+
+ return resultPath;
+}
+
+QString SymbianMakefileGenerator::canonizePath(const QString& origPath)
+{
+ // Since current path gets appended almost always anyway, use it as default
+ // for nonexisting paths.
+ static QString defaultPath;
+ if (defaultPath.isEmpty()) {
+ QFileInfo fi(".");
+ defaultPath = fi.canonicalFilePath();
+ }
+
+ // Prepend epocroot to any paths beginning with "/epoc32/"
+ QString resultPath = QDir::fromNativeSeparators(origPath);
+ if (resultPath.startsWith("/epoc32/", Qt::CaseInsensitive))
+ resultPath = QDir::fromNativeSeparators(epocRoot()) + resultPath.mid(1);
+
+ QFileInfo fi(fileInfo(resultPath));
+ if(fi.isDir()) {
+ resultPath = fi.canonicalFilePath();
+ } else {
+ resultPath = fi.canonicalPath();
+ }
+
+ resultPath = QDir::cleanPath(resultPath);
+
+ if (resultPath.isEmpty())
+ resultPath = defaultPath;
+
+ return resultPath;
+}
+
+SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator() { }
+SymbianMakefileGenerator::~SymbianMakefileGenerator() { }
+
+void SymbianMakefileGenerator::writeHeader(QTextStream &t) {
+ t << "// ============================================================================" << endl;
+ t << "// * Makefile for building: " << escapeFilePath(var("TARGET")) << endl;
+ t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "// * This file is generated by qmake and should not be modified by the" << endl;
+ t << "// * user." << endl;
+ t << "// * Project: " << fileFixify(project->projectFile()) << endl;
+ t << "// * Template: " << var("TEMPLATE") << endl;
+ //if(!project->isActiveConfig("build_pass"))
+ // t << "// = Command: " << build_args().replace("$(QMAKE)",
+ // (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : var("QMAKE_QMAKE"))) << endl;
+ t << "// ============================================================================" << endl;
+ t << endl;
+
+ // defining define for bld.inf
+
+ QString shortProFilename = project->projectFile();
+ shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString(""));
+ shortProFilename.replace(QString(".pro"), QString(""));
+
+ QString bldinfDefine = shortProFilename;
+ bldinfDefine.append("_");
+ bldinfDefine.append(generate_uid(project->projectFile()));
+
+ bldinfDefine.prepend("BLD_INF_");
+ removeSpecialCharacters(bldinfDefine);
+
+ t << "#define " << bldinfDefine.toUpper() << endl << endl;
+}
+
+bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) {
+ writeHeader(t);
+
+ QString numberOfIcons;
+ QString iconFile;
+ QStringList userRssRules;
+ readRssRules(numberOfIcons, iconFile, userRssRules);
+
+ // Get the application translations and convert to symbian OS lang code, i.e. decical number
+ QStringList symbianLangCodes = symbianLangCodesFromTsFiles();
+
+ // Generate pkg files if there are any actual files to deploy
+ bool generatePkg = false;
+ if (getTargetExtension() == "exe") {
+ generatePkg = true;
+ } else {
+ foreach(QString item, project->values("DEPLOYMENT")) {
+ if (!project->values(item + ".sources").isEmpty()) {
+ generatePkg = true;
+ break;
+ }
+ }
+ }
+
+ if (generatePkg) {
+ QStringList platformList = project->values("SYMBIAN_PLATFORMS");
+ foreach(QString platform, platformList) {
+ if(platform.compare("WINSCW", Qt::CaseInsensitive)) {
+ generatePkgFile(platform.toLower(), "udeb", iconFile);
+ generatePkgFile(platform.toLower(), "urel", iconFile);
+ }
+ }
+ }
+
+ writeBldInfContent(t, generatePkg);
+
+ // Generate empty wrapper makefile here, because wrapper makefile must exist before writeMkFile,
+ // but all required data is not yet available.
+ bool isPrimaryMakefile = true;
+ QString wrapperFileName("Makefile");
+ QString outputFileName = fileInfo(Option::output.fileName()).fileName();
+ if (outputFileName != BLD_INF_FILENAME) {
+ wrapperFileName.append(".").append((outputFileName.size() > BLD_INF_FILENAME_LEN && outputFileName.left(BLD_INF_FILENAME_LEN) == BLD_INF_FILENAME) ? outputFileName.mid(8) : outputFileName);
+ isPrimaryMakefile = false;
+ }
+
+ QFile wrapperMakefile(wrapperFileName);
+ if(wrapperMakefile.open(QIODevice::WriteOnly)) {
+ generatedFiles << wrapperFileName;
+ } else {
+ fprintf(stderr, "Error: Could not open wrapper makefile '%s'\n", qPrintable(wrapperFileName));
+ return false;
+ }
+
+ if (getTargetExtension() == "subdirs") {
+ // If we have something to deploy, generate extension makefile for just that, since
+ // normal extension makefile is not getting generated and we need emulator deployment to be done.
+ if (generatePkg)
+ writeMkFile(wrapperFileName, true);
+ writeWrapperMakefile(wrapperMakefile, isPrimaryMakefile);
+ return true;
+ }
+
+ writeMkFile(wrapperFileName, false);
+
+ QString shortProFilename = project->projectFile();
+ shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString(""));
+ shortProFilename.replace(QString(".pro"), QString(""));
+
+ QString mmpFilename = shortProFilename;
+ mmpFilename.append("_");
+ mmpFilename.append(uid3);
+ mmpFilename.append(".mmp");
+ writeMmpFile(mmpFilename, symbianLangCodes);
+
+ if (getTargetExtension() == "exe") {
+ if (!project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {
+ QString appname = escapeFilePath(fileFixify(project->first("TARGET")));
+ appname = removePathSeparators(appname);
+ writeRegRssFile(appname, userRssRules);
+ writeRssFile(appname, numberOfIcons, iconFile);
+ writeLocFile(appname, symbianLangCodes);
+ }
+ }
+
+ writeCustomDefFile();
+ writeWrapperMakefile(wrapperMakefile, isPrimaryMakefile);
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QString &config, const QString &iconFile) {
+ QString pkgFilename = QString("%1_%2_%3.%4")
+ .arg(fileInfo(project->projectFile()).completeBaseName())
+ .arg(compiler)
+ .arg(config)
+ .arg("pkg");
+ QFile pkgFile(pkgFilename);
+ if (!pkgFile.open(QIODevice::WriteOnly | QIODevice::Text))
+ return false;
+
+ generatedFiles << pkgFile.fileName();
+
+ // header info
+ QTextStream t(&pkgFile);
+ t << QString("; %1 generated by qmake at %2").arg(pkgFilename).arg(QDateTime::currentDateTime().toString(Qt::ISODate)) << endl;
+ t << "; This file is generated by qmake and should not be modified by the user" << endl;
+ t << ";" << endl << endl;
+
+ // language, (*** hardcoded to english atm)
+ t << "; Language" << endl;
+ t << "&EN" << endl << endl;
+
+ // name of application, UID and version
+ QString applicationName = project->first("TARGET");
+ int last = applicationName.lastIndexOf(QLatin1Char('/'));
+ applicationName = applicationName.mid( last == -1 ? 0 : last+1 );
+
+ QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ',');
+
+ t << "; SIS header: name, uid, version" << endl;
+ t << QString("#{\"%1\"},(%2),%3").arg(applicationName).arg(uid3).arg(applicationVersion) << endl << endl;
+
+ // vendor names (*** hardcoded for now)
+ t << "; Localised Vendor name" << endl;
+ t << "%{\"Nokia, Qt Software\"}" << endl << endl;
+ t << "; Unique Vendor name" << endl;
+ t << ":\"Nokia, Qt Software\"" << endl << endl;
+
+ // Dependencies
+ t << "; Dependencies" << endl;
+ foreach(QString item, project->values("DEPLOYMENT")) {
+ QStringList dependencies = project->values(item + ".depends");
+ foreach(QString dependency, dependencies) {
+ t << dependency << endl;
+ }
+ }
+ t << endl;
+
+ // install paths on the phone *** should be dynamic at some point
+ QString installPathBin = "!:\\sys\\bin";
+ QString installPathResource = "!:\\resource\\apps";
+ QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps";
+
+ // find location of builds
+ QString epocReleasePath = QString("%1epoc32/release/%2/%3")
+ .arg(epocRoot())
+ .arg(compiler)
+ .arg(config);
+
+
+ if (getTargetExtension() == "exe") {
+ // deploy .exe file
+ t << "; Executable and default resource files" << endl;
+ QString exeFile = applicationName + ".exe";
+ t << QString("\"%1/%2\" - \"%3\\%4\"")
+ .arg(epocReleasePath)
+ .arg(exeFile)
+ .arg(installPathBin)
+ .arg(exeFile) << endl;
+
+ // deploy rsc & reg_rsc file
+ if (!project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {
+ t << QString("\"%1epoc32/data/z/resource/apps/%2\" - \"%3\\%4\"")
+ .arg(epocRoot())
+ .arg(applicationName + ".rsc")
+ .arg(installPathResource)
+ .arg(applicationName + ".rsc") << endl;
+
+ t << QString("\"%1epoc32/data/z/private/10003a3f/import/apps/%2\" - \"%3\\%4\"")
+ .arg(epocRoot())
+ .arg(applicationName + "_reg.rsc")
+ .arg(installPathRegResource)
+ .arg(applicationName + "_reg.rsc") << endl;
+
+ QString myIconFile = iconFile;
+ myIconFile = myIconFile.replace("\\\\", "\\");
+
+ if (!iconFile.isEmpty()) {
+ t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"")
+ .arg(epocRoot())
+ .arg(QString(myIconFile).replace('\\','/'))
+ .arg(myIconFile) << endl << endl;
+ }
+ }
+ }
+
+ // deploy any additional DEPLOYMENT files
+ DeploymentList depList;
+ QString remoteTestPath;
+ remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid);
+
+ initProjectDeploySymbian( project, depList, remoteTestPath, true, compiler, config, generatedDirs, generatedFiles );
+ if (depList.size())
+ t << "; DEPLOYMENT" << endl;
+ for (int i=0; i<depList.size(); ++i) {
+ t << QString("\"%1\" - \"%2\"")
+ .arg(QString(depList.at(i).from).replace('\\','/'))
+ .arg(depList.at(i).to) << endl;
+ }
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeCustomDefFile() {
+ if(targetType.compare("plugin", Qt::CaseInsensitive) == 0 && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {
+ // Create custom def file for plugin
+ QFile ft(QLatin1String(PLUGIN_COMMON_DEF_FILE_ACTUAL));
+
+ if(ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t(&ft);
+
+ t << "; ==============================================================================" << endl;
+ t << "; Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "; This file is generated by qmake and should not be modified by the" << endl;
+ t << "; user." << endl;
+ t << "; Name : " PLUGIN_COMMON_DEF_FILE_ACTUAL << endl;
+ t << "; Part of : " << project->values("TARGET").join(" ") << endl;
+ t << "; Description : Fixes common plugin symbols to known ordinals" << endl;
+ t << "; Version : " << endl;
+ t << ";" << endl;
+ t << "; ==============================================================================" << "\n" << endl;
+
+ t << endl;
+
+ t << "EXPORTS" << endl;
+ t << "\tqt_plugin_query_verification_data @ 1 NONAME" << endl;
+ t << "\tqt_plugin_instance @ 2 NONAME" << endl;
+ t << endl;
+ } else {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+void SymbianMakefileGenerator::init()
+{
+ MakefileGenerator::init();
+/*
+ DUMP_VAR("GENERATED_SOURCES");
+*/
+ // fixing again !!!
+ if(0 != project->values("QMAKE_PLATFORM").size())
+ platform = varGlue("QMAKE_PLATFORM", "", " ", "");
+
+ if(0 == project->values("QMAKESPEC").size())
+ project->values("QMAKESPEC").append(qgetenv("QMAKESPEC"));
+
+ if(!isConfigSetToSymbian())
+ project->values("QMAKE_LIBS") += escapeFilePaths(project->values("LIBS"));
+
+
+ // bld.inf
+ project->values("MAKEFILE") += BLD_INF_FILENAME;
+
+ // .mmp
+ initMmpVariables();
+
+ // UID1
+ uid1 = generateUID1();
+
+ // check TARGET.UID2 and TARGET.UID3 presence
+ if(0 != project->values("TARGET.UID3").size()) {
+ uid3 = project->first("TARGET.UID3");
+ } else {
+ uid3 = generateUID3();
+ }
+
+ // some fix
+ if((project->values("TEMPLATE")).contains("app"))
+ targetType = "exe";
+ else if((project->values("TEMPLATE")).contains("lib")) {
+ // check CONFIG to see if we are to build staticlib or dll
+ if(project->values("CONFIG").contains("staticlib") || project->values("CONFIG").contains("static"))
+ targetType = "staticlib";
+ else if (project->values("CONFIG").contains("plugin"))
+ targetType = "plugin";
+ else // for now it will be default
+ targetType = "dll";
+ }
+ else // fix
+ targetType = "subdirs";
+
+ if(0 != project->values("TARGET.UID2").size()) {
+ uid2 = project->first("TARGET.UID2");
+ } else if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {
+ uid2 = "0x20004C45";
+ } else {
+ if(getTargetExtension() == "exe") {
+ if(project->values("QT").contains("gui", Qt::CaseInsensitive)) {
+ // exe and also gui
+ uid2 = "0x100039CE";
+ } else {
+ // exe but not gui.. uid2 is ignored anyway
+ // set it to 0
+ uid2 = "0";
+ }
+ } else if(getTargetExtension() == "dll" || getTargetExtension() == "lib") {
+ uid2 = "0x1000008d";
+ }
+ }
+
+ uid2 = uid2.trimmed();
+ uid3 = uid3.trimmed();
+
+ // UID is valid as either hex or decimal, so just convert it to number and back to hex
+ // to get proper string for private dir
+ bool conversionOk = false;
+ uint uidNum = uid3.toUInt(&conversionOk, 0);
+
+ if (!conversionOk) {
+ fprintf(stderr, "Error: Invalid UID \"%s\".", uid3.toUtf8().constData());
+ } else {
+ privateDirUid.setNum(uidNum, 16);
+ while (privateDirUid.length() < 8)
+ privateDirUid.insert(0,QLatin1Char('0'));
+ }
+}
+
+QString SymbianMakefileGenerator::getTargetExtension() {
+ QString ret;
+ if(targetType.compare("exe", Qt::CaseInsensitive) == 0 || targetType.compare("app", Qt::CaseInsensitive) == 0) {
+ ret.append("exe");
+ } else if (targetType.compare("staticlib",Qt::CaseInsensitive) == 0) {
+ ret.append("lib");
+ } else if (targetType.compare("dll", Qt::CaseInsensitive) == 0 || targetType.compare("plugin", Qt::CaseInsensitive) == 0) {
+ ret.append("dll");
+ } else if (targetType.compare("subdirs", Qt::CaseInsensitive) == 0) {
+ // just fix
+ ret.append("subdirs");
+ } else {
+ // if nothing said then assume "exe"
+ ret.append("exe");
+ }
+
+ return ret;
+}
+
+bool SymbianMakefileGenerator::isConfigSetToSymbian() {
+ return project->values("CONFIG").contains("symbian", Qt::CaseInsensitive);
+}
+
+QString SymbianMakefileGenerator::generateUID1() {
+ // just for now
+ return QString("");
+}
+
+QString SymbianMakefileGenerator::generateUID2() {
+ // standard stuff; picked form symbian
+ // later meybe read from somewhere
+ return QString("");
+}
+
+QString SymbianMakefileGenerator::generateUID3() {
+
+ QString target = project->first("TARGET");
+ QString currPath = qmake_getpwd();
+ target.prepend("/").prepend(currPath);
+ return generate_test_uid(target);
+
+}
+
+bool SymbianMakefileGenerator::initMmpVariables() {
+ QStringList sysincspaths;
+ QStringList srcincpaths;
+ QStringList srcpaths;
+
+ srcpaths << project->values("SOURCES") << project->values("GENERATED_SOURCES");
+ srcpaths << project->values("UNUSED_SOURCES") << project->values("UI_SOURCES_DIR");
+ srcpaths << project->values("UI_DIR");
+
+ QDir current = QDir::current();
+ QString canonizedCurrent = canonizePath(".");
+
+ for(int j = 0; j < srcpaths.size(); ++j) {
+ QFileInfo fi(fileInfo(srcpaths.at(j)));
+ // Sometimes sources have other than *.c* files (e.g. *.moc); prune them.
+ if (fi.suffix().startsWith("c")) {
+ if(fi.filePath().length() > fi.fileName().length() ) {
+ appendIfnotExist(srcincpaths, fi.path() );
+ sources[canonizePath(fi.path())] += fi.fileName();
+ } else {
+ sources[canonizedCurrent] += fi.fileName();
+ appendIfnotExist(srcincpaths, canonizedCurrent);
+ }
+ }
+ }
+
+ QStringList incpaths;
+ incpaths << project->values("INCLUDEPATH");
+ incpaths << QLibraryInfo::location(QLibraryInfo::HeadersPath);
+ incpaths << project->values("HEADERS");
+ incpaths << srcincpaths;
+ incpaths << project->values("UI_HEADERS_DIR");
+ incpaths << project->values("UI_DIR");
+
+ QString epocPath("epoc32");
+ for(int j = 0; j < incpaths.size(); ++j) {
+ QString includepath = canonizePath(incpaths.at(j));
+ appendIfnotExist(sysincspaths, includepath);
+ if (!includepath.contains(epocPath)) // No temp dirs for epoc includes
+ appendIfnotExist(sysincspaths, includepath + QString("/tmp"));
+ }
+
+ // remove duplicate include path entries
+ // convert to native directory separators
+ // to check if includepaths are same
+ QStringList temporary;
+ for(int i = 0; i < sysincspaths.size(); ++i) {
+ QString origPath = sysincspaths.at(i);
+ QFileInfo origPathInfo(fileInfo(origPath));
+ bool bFound = false;
+
+ for(int j = 0; j < temporary.size(); ++j) {
+ QString tmpPath = temporary.at(j);
+ QFileInfo tmpPathInfo(fileInfo(tmpPath));
+
+ if(origPathInfo.absoluteFilePath() == tmpPathInfo.absoluteFilePath()) {
+ bFound = true;
+ if(!tmpPathInfo.isRelative() && origPathInfo.isRelative()) {
+ // we keep the relative notation
+ temporary.removeOne(tmpPath);
+ temporary << origPath;
+ }
+ }
+ }
+
+ if(!bFound)
+ temporary << origPath;
+
+ }
+
+ sysincspaths.clear();
+ sysincspaths << temporary;
+
+ systeminclude.insert("SYSTEMINCLUDE", sysincspaths);
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::removeDuplicatedStrings(QStringList& stringList) {
+
+ QStringList tmpStringList;
+
+ for(int i = 0; i < stringList.size(); ++i) {
+ QString string = stringList.at(i);
+ if(tmpStringList.contains(string))
+ continue;
+ else
+ tmpStringList.append(string);
+ }
+
+ stringList.clear();
+ stringList = tmpStringList;
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileHeader(QTextStream &t){
+ t << "// ==============================================================================" << endl;
+ t << "// Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "// This file is generated by qmake and should not be modified by the" << endl;
+ t << "// user." << endl;
+ t << "// Name : " << escapeFilePath(fileFixify(project->projectFile().remove(project->projectFile().length()-4,4))) << ".mmp" << endl;
+ t << "// ==============================================================================" << endl << endl;
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symbianLangCodes)
+{
+ QFile ft(filename);
+ if(ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+
+ //printf("WRITING: %s \n", qPrintable(filename));
+
+ QTextStream t(&ft);
+
+ writeMmpFileHeader(t);
+
+ writeMmpFileTargetPart(t);
+
+ writeMmpFileResourcePart(t, symbianLangCodes);
+
+ writeMmpFileMacrosPart(t);
+
+ writeMmpFileIncludePart(t);
+
+ QDir current = QDir::current();
+
+ for(QMap<QString, QStringList>::iterator it = sources.begin(); it != sources.end(); ++it) {
+ QStringList values = it.value();
+ QString currentSourcePath = it.key();
+
+ if (values.size())
+ t << "SOURCEPATH \t" << fixPathForMmp(currentSourcePath, current) << endl;
+
+ for (int i = 0; i < values.size(); ++i) {
+ QString sourceFileName = values.at(i);
+ t << "SOURCE\t\t" << sourceFileName << endl;
+ }
+ t << endl;
+ }
+ t << endl;
+
+ writeMmpFileLibraryPart(t);
+
+ writeMmpFileCapabilityPart(t);
+
+ writeMmpFileCompilerOptionPart(t);
+
+ writeMmpFileBinaryVersionPart(t);
+
+ writeMmpFileRulesPart(t);
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileMacrosPart(QTextStream& t) {
+
+ t << endl;
+
+ if(isConfigSetToSymbian())
+ return true;
+
+ QStringList &defines = project->values("DEFINES");
+ if (defines.size())
+ t << "// Qt Macros" << endl;
+ for(int i = 0; i < defines.size(); ++i) {
+ QString def = defines.at(i);
+ addMacro(t, def);
+ }
+
+ // These are required in order that all methods will be correctly exported e.g from qtestlib
+ QStringList &exp_defines = project->values("PRL_EXPORT_DEFINES");
+ if (exp_defines.size())
+ t << endl << "// Qt Export Defines" << endl;
+ for(int i = 0; i < exp_defines.size(); ++i) {
+ QString def = exp_defines.at(i);
+ addMacro(t, def);
+ }
+
+ t << endl;
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::addMacro(QTextStream& t, const QString& value) {
+ t << "MACRO" << "\t\t" << value << endl;
+ return true;
+}
+
+
+bool SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) {
+ if(getTargetExtension() == "exe") {
+ t << "TARGET" << "\t\t" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << "\n";
+ if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))
+ t << "TARGETTYPE" << "\t\t" << "STDEXE" << endl;
+ else
+ t << "TARGETTYPE" << "\t\t" << "EXE" << endl;
+ } else if (getTargetExtension() == "dll"){
+ t << "TARGET" << "\t\t" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".dll")) << "\n";
+ if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))
+ t << "TARGETTYPE" << "\t\t" << "STDDLL" << endl;
+ else
+ t << "TARGETTYPE" << "\t\t" << "DLL" << endl;
+ } else if (getTargetExtension() == "lib"){
+ t << "TARGET" << "\t\t" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".lib")) << "\n";
+ if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive))
+ t << "TARGETTYPE" << "\t\t" << "STDLIB" << endl;
+ else
+ t << "TARGETTYPE" << "\t\t" << "LIB" << endl;
+ } else {
+ printf("unexpected target and targettype %s\n", getTargetExtension().toAscii().data());
+ }
+
+ t << endl;
+
+ t << "UID" << "\t\t" << uid2 << " " << uid3 << endl;
+
+ if(0 != project->values("TARGET.SID").size()) {
+ t << "SECUREID" << "\t\t" << project->values("TARGET.SID").join(" ") << endl;
+ } else {
+ if(0 == uid3.size())
+ t << "SECUREID" << "\t\t" << "0" << endl;
+ else
+ t << "SECUREID" << "\t\t" << uid3 << endl;
+ }
+
+ // default value used from mkspecs..qconfig.h is 0
+ if(0 != project->values("TARGET.VID").size()) {
+ t << "VENDORID" << "\t\t" << project->values("TARGET.VID").join(" ") << endl;
+ }
+
+ t << endl;
+
+ if(0 != project->first("TARGET.EPOCSTACKSIZE").size())
+ t << "EPOCSTACKSIZE" << "\t\t" << project->first("TARGET.EPOCSTACKSIZE") << endl;
+ if(0 != project->values("TARGET.EPOCHEAPSIZE").size())
+ t << "EPOCHEAPSIZE" << "\t\t" << project->values("TARGET.EPOCHEAPSIZE").join(" ") << endl;
+ if(0 != project->values("TARGET.EPOCALLOWDLLDATA").size())
+ t << "EPOCALLOWDLLDATA" << endl;
+
+ if(targetType.compare("plugin", Qt::CaseInsensitive) == 0 && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) {
+ // use custom def file for Qt plugins
+ t << "DEFFILE " PLUGIN_COMMON_DEF_FILE_FOR_MMP << endl;
+ }
+
+ t << endl;
+
+ return true;
+}
+
+
+/*
+ Application registration resource files
+ should be installed to the
+
+ \private\10003a3f\import\apps directory.
+*/
+bool SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes) {
+ if((getTargetExtension() == "exe") &&
+ !project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) {
+ QString target = escapeFilePath(fileFixify(project->first("TARGET")));
+ target = removePathSeparators(target);
+
+ QString locTarget = target;
+ locTarget.append(".rss");
+
+ t << "SOURCEPATH\t\t\t. " << endl;
+ t << "LANG SC "; // no endl
+ foreach(QString lang, symbianLangCodes) {
+ t << lang << " "; // no endl
+ }
+ t << endl;
+ t << "START RESOURCE\t\t" << locTarget << endl;
+ t << "HEADER" << endl;
+ t << "TARGETPATH\t\t\t" RESOURCE_DIRECTORY_MMP<< endl;
+ t << "END" << endl << endl;
+
+ // now append extension
+ QString regTarget = target;
+ regTarget.append("_reg.rss");
+ // must state SOURCEPATH for resources
+ // relative placement (relative to dir where .mmp located)
+ // absolute placement (!RELATIVE! to EPOCROOT dir)
+
+
+ t << "SOURCEPATH\t\t\t. " << endl;
+ t << "START RESOURCE\t\t" << regTarget << endl;
+ if (isForSymbianSbsv2())
+ t << "DEPENDS " << target << ".rsg" << endl;
+ t << "TARGETPATH\t\t" REGISTRATION_RESOURCE_DIRECTORY_HW << endl;
+ t << "END" << endl << endl;
+ }
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileSystemIncludePart(QTextStream& t) {
+
+ QDir current = QDir::current();
+
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ QString handledPath = values.at(i);
+ t << "SYSTEMINCLUDE" << "\t\t" << fixPathForMmp(handledPath, current) << endl;
+ }
+ }
+
+ t << endl;
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileIncludePart(QTextStream& t) {
+
+ writeMmpFileSystemIncludePart(t);
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) {
+ QStringList &libs = project->values("LIBS");
+ libs << project->values("QMAKE_LIBS");
+
+ removeDuplicatedStrings(libs);
+
+ for(int i = 0; i < libs.size(); ++i) {
+ QString lib = libs.at(i);
+ // The -L flag is uninteresting, since all symbian libraries exist in the
+ // same directory.
+ if(lib.startsWith("-l")) {
+ lib.remove(0,2);
+ QString mmpStatement;
+ if (lib.endsWith(".dll")) {
+ lib.chop(4);
+ mmpStatement = "LIBRARY\t\t";
+ } else if (lib.endsWith(".lib")) {
+ lib.chop(4);
+ mmpStatement = "STATICLIBRARY\t";
+ } else {
+ // Hacky way to find out what kind of library it is. Check the
+ // ARMV5 build directory for library type. We default to shared
+ // library, since that is probably more common.
+ QString udebStaticLibLocation(epocRoot());
+ QString urelStaticLibLocation(udebStaticLibLocation);
+ udebStaticLibLocation += QString("epoc32/release/armv5/udeb/%1.lib").arg(lib);
+ urelStaticLibLocation += QString("epoc32/release/armv5/urel/%1.lib").arg(lib);
+ if (QFile::exists(udebStaticLibLocation) || QFile::exists(urelStaticLibLocation)) {
+ mmpStatement = "STATICLIBRARY\t";
+ } else {
+ mmpStatement = "LIBRARY\t\t";
+ }
+ }
+ t << mmpStatement << lib << ".lib" << endl;
+ }
+ }
+
+ t << endl;
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileCapabilityPart(QTextStream& t) {
+ if(0 != project->first("TARGET.CAPABILITY").size()) {
+ QStringList &capabilities = project->values("TARGET.CAPABILITY");
+ t << "CAPABILITY" << "\t\t";
+
+ for(int i = 0; i < capabilities.size(); ++i) {
+ QString cap = capabilities.at(i);
+ t << cap << " ";
+ }
+ }
+ else {
+ t << "CAPABILITY" << "\t\t" << "None";
+ }
+ t << endl << endl;
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) {
+ QString cw, armcc;
+
+ if(0 != project->values("QMAKE_CXXFLAGS.CW").size()) {
+ cw.append(project->values("QMAKE_CXXFLAGS.CW").join(" "));
+ cw.append(" ");
+ }
+
+ if(0 != project->values("QMAKE_CXXFLAGS.ARMCC").size()) {
+ armcc.append(project->values("QMAKE_CXXFLAGS.ARMCC").join(" "));
+ armcc.append(" ");
+ }
+
+ if(0 != project->values("QMAKE_CFLAGS.CW").size()) {
+ cw.append(project->values("QMAKE_CFLAGS.CW").join(" "));
+ cw.append(" ");
+ }
+
+ if(0 != project->values("QMAKE_CFLAGS.ARMCC").size()) {
+ armcc.append(project->values("QMAKE_CFLAGS.ARMCC").join(" "));
+ armcc.append(" ");
+ }
+
+ if(0 != project->values("QMAKE_CXXFLAGS").size()) {
+ cw.append(project->values("QMAKE_CXXFLAGS").join(" "));
+ cw.append(" ");
+ armcc.append(project->values("QMAKE_CXXFLAGS").join(" "));
+ armcc.append(" ");
+ }
+
+ if(0 != project->values("QMAKE_CFLAGS").size()) {
+ cw.append(project->values("QMAKE_CFLAGS").join(" "));
+ cw.append(" ");
+ armcc.append(project->values("QMAKE_CFLAGS").join(" "));
+ armcc.append(" ");
+ }
+
+ if (!cw.isEmpty() && cw[cw.size()-1] == ' ')
+ cw.chop(1);
+ if (!armcc.isEmpty() && armcc[armcc.size()-1] == ' ')
+ armcc.chop(1);
+
+ if (!cw.isEmpty())
+ t << "OPTION" << '\t' << " CW " << cw << endl;
+ if (!armcc.isEmpty())
+ t << "OPTION" << '\t' << " ARMCC "<< armcc << endl;
+ // others to come
+
+ t << endl;
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileBinaryVersionPart(QTextStream& t) {
+ QString applicationVersion = project->first("VERSION");
+ QStringList verNumList = applicationVersion.split('.');
+ uint major = 0;
+ uint minor = 0;
+ uint patch = 0;
+ bool success = false;
+
+ if (verNumList.size() > 0) {
+ major = verNumList[0].toUInt(&success);
+ if (success && verNumList.size() > 1) {
+ minor = verNumList[1].toUInt(&success);
+ if (success && verNumList.size() > 2) {
+ patch = verNumList[2].toUInt(&success);
+ }
+ }
+ }
+
+ QString mmpVersion;
+ if (success && major <= 0xFFFF && minor <= 0xFF && patch <= 0xFF) {
+ // Symbian binary version only has major and minor components, so compress
+ // Qt's minor and patch values into the minor component. Since Symbian's minor
+ // component is a 16 bit value, only allow 8 bits for each to avoid overflow.
+ mmpVersion.append(QString::number(major))
+ .append('.')
+ .append(QString::number((minor << 8) + patch));
+ } else {
+ if (!applicationVersion.isEmpty())
+ fprintf(stderr, "Invalid VERSION string: %s\n", qPrintable(applicationVersion));
+ mmpVersion = "10.0"; // Default binary version for symbian is 10.0
+ }
+
+ t << "VERSION " << mmpVersion << endl;
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t) {
+ foreach(QString item, project->values("MMP_RULES")) {
+ t << endl;
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line mmp statements
+ if (project->values(item).isEmpty()) {
+ t << item << endl;
+ } else {
+ foreach(QString itemRow, project->values(item)) {
+ t << itemRow << endl;
+ }
+ }
+ }
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension) {
+ // Read user defined bld inf rules
+ QMap<QString, QStringList> userBldInfRules;
+ for(QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) {
+ if (it.key().startsWith(BLD_INF_RULES_BASE)) {
+ QString newKey = it.key().mid(sizeof(BLD_INF_RULES_BASE)-1);
+ if (newKey.isEmpty()) {
+ fprintf(stderr, "Warning: Empty BLD_INF_RULES key encountered\n");
+ continue;
+ }
+ QStringList newValues;
+ QStringList values = it.value();
+ foreach(QString item, values) {
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line statements
+ if (project->values(item).isEmpty()) {
+ newValues << item;
+ } else {
+ foreach(QString itemRow, project->values(item)) {
+ newValues << itemRow;
+ }
+ }
+ }
+ userBldInfRules.insert(newKey, newValues);
+ }
+ }
+
+ // Add includes of subdirs bld.inf files
+
+ QString mmpfilename = escapeFilePath(fileFixify(project->projectFile()));
+ mmpfilename = mmpfilename.replace(mmpfilename.lastIndexOf(".")+1, 3, "mmp");
+ QString currentPath = qmake_getpwd();
+
+ if(!currentPath.endsWith(QString("/")))
+ currentPath.append("/");
+
+ QStringList mmpProjects = project->values("MMPFILES_DIRECT_DEPENDS");
+ QStringList shadowProjects = project->values("SHADOW_BLD_INFS");
+
+ removeDuplicatedStrings(mmpProjects);
+ removeDuplicatedStrings(shadowProjects);
+
+ // go in reverse order ... as that is the way how I build the list
+ QListIterator<QString> iT(mmpProjects);
+ iT.toBack();
+ while(iT.hasPrevious()) {
+ QString fullMmpName = iT.previous();
+ QString relativePath;
+ QString bldinfFilename;
+
+ QString fullProFilename = fullMmpName;
+ fullProFilename.replace(QString(".mmp"), QString(".pro"));
+ QString uid = generate_uid(fullProFilename);
+
+ QString cleanMmpName = fullProFilename;
+ cleanMmpName.replace(QString(".pro"), QString(""));
+ cleanMmpName.replace(0, cleanMmpName.lastIndexOf("/") + 1, QString(""));
+
+ if(shadowProjects.contains(BLD_INF_FILENAME "." + cleanMmpName)) { // shadow project
+ QDir directory(currentPath);
+ relativePath = directory.relativeFilePath(fullProFilename);
+ bldinfFilename = BLD_INF_FILENAME "." + cleanMmpName;
+ if(relativePath.contains("/")) {
+ // shadow .pro not in same
+ // directory as parent .pro
+ if(relativePath.startsWith("..")) {
+ // shadow .pro out of parent .pro
+ relativePath.replace(relativePath.lastIndexOf("/"), relativePath.length(), QString(""));
+ bldinfFilename.prepend("/").prepend(relativePath);
+ } else {
+ relativePath.replace(relativePath.lastIndexOf("/"), relativePath.length(), QString(""));
+ bldinfFilename.prepend("/").prepend(relativePath);
+ }
+ } else {
+ // shadow .pro and parent .pro in same directory
+ bldinfFilename.prepend("./");
+ }
+ } else { // regular project
+ // calc relative path
+ QDir directory(currentPath);
+ relativePath = directory.relativeFilePath(fullProFilename);
+ relativePath.replace(relativePath.lastIndexOf("/"), relativePath.length(), QString(""));
+ bldinfFilename = relativePath.append("/").append(BLD_INF_FILENAME);
+ }
+
+ QString bldinfDefine = QString("BLD_INF_") + cleanMmpName + QString("_") + uid;
+ bldinfDefine = bldinfDefine.toUpper();
+ removeSpecialCharacters(bldinfDefine);
+
+ t << "#ifndef " << bldinfDefine << endl;
+ t << "\t#include \"" << QDir::toNativeSeparators(bldinfFilename) << "\"" << endl;
+ t << "#endif // " << bldinfDefine << endl;
+ }
+
+ // Add supported project platforms
+
+ t << endl << BLD_INF_TAG_PLATFORMS << endl << endl;
+ if(0 != project->values("SYMBIAN_PLATFORMS").size())
+ t << project->values("SYMBIAN_PLATFORMS").join(" ") << endl;
+
+ QStringList userItems = userBldInfRules.value(BLD_INF_TAG_PLATFORMS);
+ foreach(QString item, userItems)
+ t << item << endl;
+ userBldInfRules.remove(BLD_INF_TAG_PLATFORMS);
+ t << endl;
+
+ // Add project mmps and old style extension makefiles
+ QString mmpTag;
+ if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
+ mmpTag = QLatin1String(BLD_INF_TAG_TESTMMPFILES);
+ else
+ mmpTag = QLatin1String(BLD_INF_TAG_MMPFILES);
+
+ t << endl << mmpTag << endl << endl;
+
+ writeBldInfMkFilePart(t, addDeploymentExtension);
+ if (getTargetExtension() == "subdirs") {
+ mmpProjects.removeOne(mmpfilename);
+ }
+
+ if(getTargetExtension() != "subdirs") {
+ QString shortProFilename = project->projectFile();
+ shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString(""));
+ shortProFilename.replace(QString(".pro"), QString(""));
+
+ QString mmpFilename = shortProFilename + QString("_") + uid3 + QString(".mmp");
+
+ t << mmpFilename << endl;
+ }
+
+ userItems = userBldInfRules.value(mmpTag);
+ foreach(QString item, userItems)
+ t << item << endl;
+ userBldInfRules.remove(mmpTag);
+
+ t << endl << BLD_INF_TAG_EXTENSIONS << endl << endl;
+
+ // Generate extension rules
+ writeBldInfExtensionRulesPart(t);
+
+ userItems = userBldInfRules.value(BLD_INF_TAG_EXTENSIONS);
+ foreach(QString item, userItems)
+ t << item << endl;
+ userBldInfRules.remove(BLD_INF_TAG_EXTENSIONS);
+
+ // Add rest of the user defined content
+
+ for(QMap<QString, QStringList>::iterator it = userBldInfRules.begin(); it != userBldInfRules.end(); ++it) {
+ t << endl << endl << it.key() << endl << endl;
+ userItems = it.value();
+ foreach(QString item, userItems)
+ t << item << endl;
+ }
+
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeRegRssFile(QString &appName, QStringList &userItems) {
+ QString filename(appName);
+ filename.append("_reg.rss");
+ QFile ft(filename);
+ if(ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t(&ft);
+ t << "// ============================================================================" << endl;
+ t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "// * This file is generated by qmake and should not be modified by the" << endl;
+ t << "// * user." << endl;
+ t << "// ============================================================================" << endl;
+ t << endl;
+ t << "#include <" << appName << ".rsg>" << endl;
+ t << "#include <appinfo.rh>" << endl;
+ t << endl;
+ //t << "#include <data_caging_paths.hrh>" << "\n" << endl;
+ t << "UID2 " << "KUidAppRegistrationResourceFile" << endl;
+ t << "UID3 " << uid3 << endl << endl;
+ t << "RESOURCE APP_REGISTRATION_INFO" << endl;
+ t << "\t{" << endl;
+ t << "\tapp_file=\"" << appName << "\";" << endl;
+ t << "\tlocalisable_resource_file=\"" RESOURCE_DIRECTORY_RESOURCE << appName << "\";" << endl;
+ t << endl;
+
+ foreach(QString item, userItems)
+ t << "\t" << item << endl;
+ t << "\t}" << endl;
+ } else {
+ return false;
+ }
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeRssFile(QString &appName, QString &numberOfIcons, QString &iconFile) {
+ QString filename(appName);
+ filename.append(".rss");
+ QFile ft(filename);
+ if(ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t(&ft);
+ t << "// ============================================================================" << endl;
+ t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "// * This file is generated by qmake and should not be modified by the" << endl;
+ t << "// * user." << endl;
+ t << "// ============================================================================" << endl;
+ t << endl;
+ t << "#include <appinfo.rh>" << endl;
+ t << "#include \"" << appName << ".loc\"" << endl;
+ t << endl;
+ t << "RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info" << endl;
+ t << "\t{" << endl;
+ t << "\tshort_caption = STRING_r_short_caption;" << endl;
+ t << "\tcaption_and_icon =" << endl;
+ t << "\tCAPTION_AND_ICON_INFO" << endl;
+ t << "\t\t{" << endl;
+ t << "\t\tcaption = STRING_r_caption;" << endl;
+
+ if(numberOfIcons.isEmpty() || iconFile.isEmpty() ) {
+ // There can be maximum one item in this tag, validated when parsed
+ t << "\t\tnumber_of_icons = 0;" << endl;
+ t << "\t\ticon_file = \"\";" << endl;
+ }
+ else {
+ // There can be maximum one item in this tag, validated when parsed
+ t << "\t\tnumber_of_icons = " << numberOfIcons << ";" << endl;
+ t << "\t\ticon_file = \"" << iconFile << "\";" << endl;
+ }
+ t << "\t\t};" << endl;
+ t << "\t}" << endl;
+ t << endl;
+ } else {
+ return false;
+ }
+ return true;
+}
+
+bool SymbianMakefileGenerator::writeLocFile(QString &appName, QStringList &symbianLangCodes) {
+ QString filename(appName);
+ filename.append(".loc");
+ QFile ft(filename);
+ if(ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t(&ft);
+ t << "// ============================================================================" << endl;
+ t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
+ t << "// * This file is generated by qmake and should not be modified by the" << endl;
+ t << "// * user." << endl;
+ t << "// ============================================================================" << endl;
+ t << endl;
+ t << "#ifdef LANGUAGE_SC" << endl;
+ //t << "#include \"" << appName << ".l01\"" << endl;
+ t << "#define STRING_r_short_caption \"" << appName << "\"" << endl;
+ t << "#define STRING_r_caption \"" << appName << "\"" << endl;
+ foreach(QString lang, symbianLangCodes) {
+ t << "#elif defined LANGUAGE_" << lang << endl;
+ //t << "#include \"" << appName << ".l" << lang << "\"" << endl;
+ t << "#define STRING_r_short_caption \"" << appName << "\"" << endl;
+ t << "#define STRING_r_caption \"" << appName << "\"" << endl;
+ }
+ t << "#else" << endl;
+ t << "#define STRING_r_short_caption \"" << appName << "\"" << endl;
+ t << "#define STRING_r_caption \"" << appName << "\"" << endl;
+ t << "#endif" << endl;
+ } else {
+ return false;
+ }
+ return true;
+}
+
+void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules) {
+ for(QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) {
+ if (it.key().startsWith(RSS_RULES_BASE)) {
+ QString newKey = it.key().mid(sizeof(RSS_RULES_BASE)-1);
+ if (newKey.isEmpty()) {
+ fprintf(stderr, "Warning: Empty RSS_RULES_BASE key encountered\n");
+ continue;
+ }
+ QStringList newValues;
+ QStringList values = it.value();
+ foreach(QString item, values) {
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line statements
+ if (project->values(item).isEmpty()) {
+ newValues << item;
+ } else {
+ foreach(QString itemRow, project->values(item)) {
+ newValues << itemRow;
+ }
+ }
+ }
+ // Verify thet there is exactly one value in RSS_TAG_NBROFICONS
+ if (newKey == RSS_TAG_NBROFICONS) {
+ if (newValues.count() == 1) {
+ numberOfIcons = newValues[0];
+ } else {
+ fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n",
+ RSS_RULES_BASE, RSS_TAG_NBROFICONS);
+ continue;
+ }
+ // Verify thet there is exactly one value in RSS_TAG_ICONFILE
+ } else if (newKey == RSS_TAG_ICONFILE) {
+ if (newValues.count() == 1) {
+ iconFile = newValues[0];
+ } else {
+ fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n",
+ RSS_RULES_BASE, RSS_TAG_ICONFILE);
+ continue;
+ }
+ } else {
+ fprintf(stderr, "Warning: Unsupported key:'%s%s'\n",
+ RSS_RULES_BASE, newKey.toLatin1().constData());
+ continue;
+ }
+ }
+ }
+
+ foreach(QString item, project->values(RSS_RULES)) {
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line mmp statements
+ if (project->values(item).isEmpty()) {
+ userRssRules << item;
+ } else {
+ userRssRules << project->values(item);
+ }
+ }
+
+ // Validate that either both RSS_TAG_NBROFICONS and RSS_TAG_ICONFILE keys exist
+ // or neither of them exist
+ if ( !((numberOfIcons.isEmpty() && iconFile.isEmpty()) ||
+ (!numberOfIcons.isEmpty() && !iconFile.isEmpty())) ) {
+ numberOfIcons.clear();
+ iconFile.clear();
+ fprintf(stderr, "Warning: Both or neither of '%s%s' and '%s%s' keys must exist.\n",
+ RSS_RULES_BASE, RSS_TAG_NBROFICONS, RSS_RULES_BASE, RSS_TAG_ICONFILE );
+ }
+
+ // Validate that RSS_TAG_NBROFICONS contains only numbers
+ if( !numberOfIcons.isEmpty() ) {
+ bool ok;
+ numberOfIcons = numberOfIcons.simplified();
+ int tmp = numberOfIcons.toInt(&ok);
+ if (!ok) {
+ numberOfIcons.clear();
+ iconFile.clear();
+ fprintf(stderr, "Warning: '%s%s' must be integer in decimal format.\n",
+ RSS_RULES_BASE, RSS_TAG_NBROFICONS );
+ }
+ }
+}
+
+QStringList SymbianMakefileGenerator::symbianLangCodesFromTsFiles() {
+ QStringList tsfiles;
+ QStringList symbianLangCodes;
+ tsfiles << project->values("TRANSLATIONS");
+
+ fillQt2S60LangMapTable();
+
+ foreach(QString file, tsfiles) {
+ int extIndex = file.lastIndexOf(".");
+ int langIndex = file.lastIndexOf("_", (extIndex - file.length()));
+ langIndex += 1;
+ QString qtlang = file.mid(langIndex, extIndex - langIndex );
+ QString s60lang = qt2S60LangMapTable.value(qtlang, QString("SC"));
+
+ if( !symbianLangCodes.contains(s60lang) && s60lang != "SC" )
+ symbianLangCodes += s60lang;
+ }
+
+ return symbianLangCodes;
+}
+
+void SymbianMakefileGenerator::fillQt2S60LangMapTable() {
+ qt2S60LangMapTable.reserve(170); // 165 items at time of writing.
+ qt2S60LangMapTable.insert("ab", "SC"); //Abkhazian //
+ qt2S60LangMapTable.insert("om", "SC"); //Afan //
+ qt2S60LangMapTable.insert("aa", "SC"); //Afar //
+ qt2S60LangMapTable.insert("af", "34"); //Afrikaans //Afrikaans
+ qt2S60LangMapTable.insert("sq", "35"); //Albanian //Albanian
+ qt2S60LangMapTable.insert("am", "36"); //Amharic //Amharic
+ qt2S60LangMapTable.insert("ar", "37"); //Arabic //Arabic
+ qt2S60LangMapTable.insert("hy", "38"); //Armenian //Armenian
+ qt2S60LangMapTable.insert("as", "SC"); //Assamese //
+ qt2S60LangMapTable.insert("ay", "SC"); //Aymara //
+ qt2S60LangMapTable.insert("az", "SC"); //Azerbaijani //
+ qt2S60LangMapTable.insert("ba", "SC"); //Bashkir //
+ qt2S60LangMapTable.insert("eu", "SC"); //Basque //
+ qt2S60LangMapTable.insert("bn", "41"); //Bengali //Bengali
+ qt2S60LangMapTable.insert("dz", "SC"); //Bhutani //
+ qt2S60LangMapTable.insert("bh", "SC"); //Bihari //
+ qt2S60LangMapTable.insert("bi", "SC"); //Bislama //
+ qt2S60LangMapTable.insert("br", "SC"); //Breton //
+ qt2S60LangMapTable.insert("bg", "42"); //Bulgarian //Bulgarian
+ qt2S60LangMapTable.insert("my", "43"); //Burmese //Burmese
+ qt2S60LangMapTable.insert("be", "40"); //Byelorussian //Belarussian
+ qt2S60LangMapTable.insert("km", "SC"); //Cambodian //
+ qt2S60LangMapTable.insert("ca", "44"); //Catalan //Catalan
+ qt2S60LangMapTable.insert("zh", "SC"); //Chinese //
+ qt2S60LangMapTable.insert("co", "SC"); //Corsican //
+ qt2S60LangMapTable.insert("hr", "45"); //Croatian //Croatian
+ qt2S60LangMapTable.insert("cs", "25"); //Czech //Czech
+ qt2S60LangMapTable.insert("da", "07"); //Danish //Danish
+ qt2S60LangMapTable.insert("nl", "18"); //Dutch //Dutch
+ qt2S60LangMapTable.insert("en", "01"); //English //English(UK)
+ qt2S60LangMapTable.insert("eo", "SC"); //Esperanto //
+ qt2S60LangMapTable.insert("et", "49"); //Estonian //Estonian
+ qt2S60LangMapTable.insert("fo", "SC"); //Faroese //
+ qt2S60LangMapTable.insert("fj", "SC"); //Fiji //
+ qt2S60LangMapTable.insert("fi", "09"); //Finnish //Finnish
+ qt2S60LangMapTable.insert("fr", "02"); //French //French
+ qt2S60LangMapTable.insert("fy", "SC"); //Frisian //
+ qt2S60LangMapTable.insert("gd", "52"); //Gaelic //Gaelic
+ qt2S60LangMapTable.insert("gl", "SC"); //Galician //
+ qt2S60LangMapTable.insert("ka", "53"); //Georgian //Georgian
+ qt2S60LangMapTable.insert("de", "03"); //German //German
+ qt2S60LangMapTable.insert("el", "54"); //Greek //Greek
+ qt2S60LangMapTable.insert("kl", "SC"); //Greenlandic //
+ qt2S60LangMapTable.insert("gn", "SC"); //Guarani //
+ qt2S60LangMapTable.insert("gu", "56"); //Gujarati //Gujarati
+ qt2S60LangMapTable.insert("ha", "SC"); //Hausa //
+ qt2S60LangMapTable.insert("he", "57"); //Hebrew //Hebrew
+ qt2S60LangMapTable.insert("hi", "58"); //Hindi //Hindi
+ qt2S60LangMapTable.insert("hu", "17"); //Hungarian //Hungarian
+ qt2S60LangMapTable.insert("is", "15"); //Icelandic //Icelandic
+ qt2S60LangMapTable.insert("id", "59"); //Indonesian //Indonesian
+ qt2S60LangMapTable.insert("ia", "SC"); //Interlingua //
+ qt2S60LangMapTable.insert("ie", "SC"); //Interlingue //
+ qt2S60LangMapTable.insert("iu", "SC"); //Inuktitut //
+ qt2S60LangMapTable.insert("ik", "SC"); //Inupiak //
+ qt2S60LangMapTable.insert("ga", "60"); //Irish //Irish
+ qt2S60LangMapTable.insert("it", "05"); //Italian //Italian
+ qt2S60LangMapTable.insert("ja", "32"); //Japanese //Japanese
+ qt2S60LangMapTable.insert("jv", "SC"); //Javanese //
+ qt2S60LangMapTable.insert("kn", "62"); //Kannada //Kannada
+ qt2S60LangMapTable.insert("ks", "SC"); //Kashmiri //
+ qt2S60LangMapTable.insert("kk", "63"); //Kazakh //Kazakh
+ qt2S60LangMapTable.insert("rw", "SC"); //Kinyarwanda //
+ qt2S60LangMapTable.insert("ky", "SC"); //Kirghiz //
+ qt2S60LangMapTable.insert("ko", "65"); //Korean //Korean
+ qt2S60LangMapTable.insert("ku", "SC"); //Kurdish //
+ qt2S60LangMapTable.insert("rn", "SC"); //Kurundi //
+ qt2S60LangMapTable.insert("lo", "66"); //Laothian //Laothian
+ qt2S60LangMapTable.insert("la", "SC"); //Latin //
+ qt2S60LangMapTable.insert("lv", "67"); //Latvian //Latvian
+ qt2S60LangMapTable.insert("ln", "SC"); //Lingala //
+ qt2S60LangMapTable.insert("lt", "68"); //Lithuanian //Lithuanian
+ qt2S60LangMapTable.insert("mk", "69"); //Macedonian //Macedonian
+ qt2S60LangMapTable.insert("mg", "SC"); //Malagasy //
+ qt2S60LangMapTable.insert("ms", "70"); //Malay //Malay
+ qt2S60LangMapTable.insert("ml", "71"); //Malayalam //Malayalam
+ qt2S60LangMapTable.insert("mt", "SC"); //Maltese //
+ qt2S60LangMapTable.insert("mi", "SC"); //Maori //
+ qt2S60LangMapTable.insert("mr", "72"); //Marathi //Marathi
+ qt2S60LangMapTable.insert("mo", "73"); //Moldavian //Moldovian
+ qt2S60LangMapTable.insert("mn", "74"); //Mongolian //Mongolian
+ qt2S60LangMapTable.insert("na", "SC"); //Nauru //
+ qt2S60LangMapTable.insert("ne", "SC"); //Nepali //
+ qt2S60LangMapTable.insert("nb", "08"); //Norwegian //Norwegian
+ qt2S60LangMapTable.insert("oc", "SC"); //Occitan //
+ qt2S60LangMapTable.insert("or", "SC"); //Oriya //
+ qt2S60LangMapTable.insert("ps", "SC"); //Pashto //
+ qt2S60LangMapTable.insert("fa", "SC"); //Persian //
+ qt2S60LangMapTable.insert("pl", "27"); //Polish //Polish
+ qt2S60LangMapTable.insert("pt", "13"); //Portuguese //Portuguese
+ qt2S60LangMapTable.insert("pa", "77"); //Punjabi //Punjabi
+ qt2S60LangMapTable.insert("qu", "SC"); //Quechua //
+ qt2S60LangMapTable.insert("rm", "SC"); //RhaetoRomance //
+ qt2S60LangMapTable.insert("ro", "78"); //Romanian //Romanian
+ qt2S60LangMapTable.insert("ru", "16"); //Russian //Russian
+ qt2S60LangMapTable.insert("sm", "SC"); //Samoan //
+ qt2S60LangMapTable.insert("sg", "SC"); //Sangho //
+ qt2S60LangMapTable.insert("sa", "SC"); //Sanskrit //
+ qt2S60LangMapTable.insert("sr", "79"); //Serbian //Serbian
+ qt2S60LangMapTable.insert("sh", "SC"); //SerboCroatian //
+ qt2S60LangMapTable.insert("st", "SC"); //Sesotho //
+ qt2S60LangMapTable.insert("tn", "SC"); //Setswana //
+ qt2S60LangMapTable.insert("sn", "SC"); //Shona //
+ qt2S60LangMapTable.insert("sd", "SC"); //Sindhi //
+ qt2S60LangMapTable.insert("si", "80"); //Singhalese //Sinhalese
+ qt2S60LangMapTable.insert("ss", "SC"); //Siswati //
+ qt2S60LangMapTable.insert("sk", "26"); //Slovak //Slovak
+ qt2S60LangMapTable.insert("sl", "28"); //Slovenian //Slovenian
+ qt2S60LangMapTable.insert("so", "81"); //Somali //Somali
+ qt2S60LangMapTable.insert("es", "04"); //Spanish //Spanish
+ qt2S60LangMapTable.insert("su", "SC"); //Sundanese //
+ qt2S60LangMapTable.insert("sw", "84"); //Swahili //Swahili
+ qt2S60LangMapTable.insert("sv", "06"); //Swedish //Swedish
+ qt2S60LangMapTable.insert("tl", "39"); //Tagalog //Tagalog
+ qt2S60LangMapTable.insert("tg", "SC"); //Tajik //
+ qt2S60LangMapTable.insert("ta", "87"); //Tamil //Tamil
+ qt2S60LangMapTable.insert("tt", "SC"); //Tatar //
+ qt2S60LangMapTable.insert("te", "88"); //Telugu //Telugu
+ qt2S60LangMapTable.insert("th", "33"); //Thai //Thai
+ qt2S60LangMapTable.insert("bo", "89"); //Tibetan //Tibetan
+ qt2S60LangMapTable.insert("ti", "90"); //Tigrinya //Tigrinya
+ qt2S60LangMapTable.insert("to", "SC"); //Tonga //
+ qt2S60LangMapTable.insert("ts", "SC"); //Tsonga //
+ qt2S60LangMapTable.insert("tr", "14"); //Turkish //Turkish
+ qt2S60LangMapTable.insert("tk", "92"); //Turkmen //Turkmen
+ qt2S60LangMapTable.insert("tw", "SC"); //Twi //
+ qt2S60LangMapTable.insert("ug", "SC"); //Uigur //
+ qt2S60LangMapTable.insert("uk", "93"); //Ukrainian //Ukrainian
+ qt2S60LangMapTable.insert("ur", "94"); //Urdu //Urdu
+ qt2S60LangMapTable.insert("uz", "SC"); //Uzbek //
+ qt2S60LangMapTable.insert("vi", "96"); //Vietnamese //Vietnamese
+ qt2S60LangMapTable.insert("vo", "SC"); //Volapuk //
+ qt2S60LangMapTable.insert("cy", "97"); //Welsh //Welsh
+ qt2S60LangMapTable.insert("wo", "SC"); //Wolof //
+ qt2S60LangMapTable.insert("xh", "SC"); //Xhosa //
+ qt2S60LangMapTable.insert("yi", "SC"); //Yiddish //
+ qt2S60LangMapTable.insert("yo", "SC"); //Yoruba //
+ qt2S60LangMapTable.insert("za", "SC"); //Zhuang //
+ qt2S60LangMapTable.insert("zu", "98"); //Zulu //Zulu
+ qt2S60LangMapTable.insert("nn", "75"); //Nynorsk //NorwegianNynorsk
+ qt2S60LangMapTable.insert("bs", "SC"); //Bosnian //
+ qt2S60LangMapTable.insert("dv", "SC"); //Divehi //
+ qt2S60LangMapTable.insert("gv", "SC"); //Manx //
+ qt2S60LangMapTable.insert("kw", "SC"); //Cornish //
+ qt2S60LangMapTable.insert("ak", "SC"); //Akan //
+ qt2S60LangMapTable.insert("kok", "SC"); //Konkani //
+ qt2S60LangMapTable.insert("gaa", "SC"); //Ga //
+ qt2S60LangMapTable.insert("ig", "SC"); //Igbo //
+ qt2S60LangMapTable.insert("kam", "SC"); //Kamba //
+ qt2S60LangMapTable.insert("syr", "SC"); //Syriac //
+ qt2S60LangMapTable.insert("byn", "SC"); //Blin //
+ qt2S60LangMapTable.insert("gez", "SC"); //Geez //
+ qt2S60LangMapTable.insert("kfo", "SC"); //Koro //
+ qt2S60LangMapTable.insert("sid", "SC"); //Sidamo //
+ qt2S60LangMapTable.insert("cch", "SC"); //Atsam //
+ qt2S60LangMapTable.insert("tig", "SC"); //Tigre //
+ qt2S60LangMapTable.insert("kaj", "SC"); //Jju //
+ qt2S60LangMapTable.insert("fur", "SC"); //Friulian //
+ qt2S60LangMapTable.insert("ve", "SC"); //Venda //
+ qt2S60LangMapTable.insert("ee", "SC"); //Ewe //
+ qt2S60LangMapTable.insert("wa", "SC"); //Walamo //
+ qt2S60LangMapTable.insert("haw", "SC"); //Hawaiian //
+ qt2S60LangMapTable.insert("kcg", "SC"); //Tyap //
+ qt2S60LangMapTable.insert("ny", "SC"); //Chewa //
+}
+
+void SymbianMakefileGenerator::appendIfnotExist(QStringList &list, QString value)
+{
+ if(!list.contains(value))
+ list += value;
+}
+
+void SymbianMakefileGenerator::appendIfnotExist(QStringList &list, QStringList values)
+{
+ foreach(QString item, values)
+ appendIfnotExist(list, item);
+}
+
+QString SymbianMakefileGenerator::removePathSeparators(QString &file)
+{
+ QString ret = file;
+ while(ret.indexOf(QDir::separator()) > 0) {
+ ret.remove(0, ret.indexOf(QDir::separator())+1);
+ }
+
+ return ret;
+}
+
+
+QString SymbianMakefileGenerator::removeTrailingPathSeparators(QString &file)
+{
+ QString ret = file;
+ if(ret.endsWith(QDir::separator())) {
+ ret.remove(ret.length()-1,1);
+ }
+
+ return ret;
+}
+
+bool SymbianMakefileGenerator::generateCleanCommands(QTextStream& t,
+ const QStringList& toClean,
+ const QString& cmd,
+ const QString& cmdOptions,
+ const QString& itemPrefix,
+ const QString& itemSuffix) {
+ for (int i = 0; i < toClean.size(); ++i) {
+ QString item = toClean.at(i);
+ item.prepend(itemPrefix).append(itemSuffix);
+#if defined(Q_OS_WIN)
+ t << "\t-@ if EXIST \"" << QDir::toNativeSeparators(item) << "\" ";
+ t << cmd << " " << cmdOptions << " \"" << QDir::toNativeSeparators(item) << "\"" << endl;
+#else
+ t << "\t-if test -f " << QDir::toNativeSeparators(item) << "; then ";
+ t << cmd << " " << cmdOptions << " " << QDir::toNativeSeparators(item) << "; fi" << endl;
+#endif
+ }
+
+ return true;
+}
+
+QString SymbianMakefileGenerator::getWithoutSpecialCharacters(QString& str) {
+ QString tmp = str;
+
+ tmp.replace(QString("/"), QString("_"));
+ tmp.replace(QString("\\"), QString("_"));
+ tmp.replace(QString("-"), QString("_"));
+ tmp.replace(QString(":"), QString("_"));
+ tmp.replace(QString("."), QString("_"));
+
+ return tmp;
+}
+
+void SymbianMakefileGenerator::removeSpecialCharacters(QString& str) {
+ str.replace(QString("/"), QString("_"));
+ str.replace(QString("\\"), QString("_"));
+ str.replace(QString("-"), QString("_"));
+ str.replace(QString(":"), QString("_"));
+ str.replace(QString("."), QString("_"));
+ str.replace(QString(" "), QString("_"));
+}
diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h
new file mode 100644
index 0000000..037faff
--- /dev/null
+++ b/qmake/generators/symbian/symmake.h
@@ -0,0 +1,154 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SYMMAKEFILE_H
+#define SYMMAKEFILE_H
+
+#include <makefile.h>
+
+QT_BEGIN_NAMESPACE
+
+// In the Qt evaluation and educational version, we have a postfix in the
+// library name (e.g. qtmteval301.dll). QTDLL_POSTFIX is used for this.
+// A script modifies these lines when building eval/edu version, so be careful
+// when changing them.
+#ifndef QTDLL_POSTFIX
+#define QTDLL_POSTFIX ""
+#endif
+
+#define BLD_INF_FILENAME "bld.inf"
+#define MAKEFILE_DEPENDENCY_SEPARATOR " \\\n\t"
+
+class SymbianMakefileGenerator : public MakefileGenerator {
+
+protected:
+
+ QString platform;
+ QString uid1;
+ QString uid2;
+ QString uid3;
+ QString privateDirUid;
+ QString targetType;
+ QMap<QString, QStringList> sources;
+ QMap<QString, QStringList> systeminclude;
+ QMap<QString, QStringList> library;
+ // (output file) (source , command)
+ QMap<QString, QStringList> makmakeCommands;
+
+ QStringList generatedFiles;
+ QStringList generatedDirs;
+ QHash<QString, QString> qt2S60LangMapTable;
+
+ void removeSpecialCharacters(QString& str);
+ QString getWithoutSpecialCharacters(QString& str);
+ QString fixPathForMmp(const QString& origPath, const QDir& parentDir);
+ QString canonizePath(const QString& origPath);
+
+ virtual bool writeMakefile(QTextStream &t);
+ bool generatePkgFile(const QString &compiler, const QString &config, const QString &iconFile);
+
+ virtual void init();
+
+ QString getTargetExtension();
+ bool isConfigSetToSymbian();
+
+ QString generateUID1();
+ QString generateUID2();
+ QString generateUID3();
+
+ bool initMmpVariables();
+
+ void writeHeader(QTextStream &t);
+ bool writeBldInfContent(QTextStream& t, bool addDeploymentExtension);
+
+ static bool removeDuplicatedStrings(QStringList& stringList);
+
+ bool writeMmpFileHeader(QTextStream &t);
+ bool writeMmpFile(QString &filename, QStringList &symbianLangCodes);
+ bool writeMmpFileMacrosPart(QTextStream& t);
+ bool addMacro(QTextStream& t, const QString& value);
+ bool writeMmpFileTargetPart(QTextStream& t);
+ bool writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes);
+ bool writeMmpFileSystemIncludePart(QTextStream& t);
+ bool writeMmpFileIncludePart(QTextStream& t);
+ bool writeMmpFileLibraryPart(QTextStream& t);
+ bool writeMmpFileCapabilityPart(QTextStream& t);
+ bool writeMmpFileCompilerOptionPart(QTextStream& t);
+ bool writeMmpFileBinaryVersionPart(QTextStream& t);
+ bool writeMmpFileRulesPart(QTextStream& t);
+
+ bool writeRegRssFile(QString &appname, QStringList &useritems);
+ bool writeRssFile(QString &appName, QString &numberOfIcons, QString &iconfile);
+ bool writeLocFile(QString &appName, QStringList &symbianLangCodes);
+ void readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules);
+ QStringList symbianLangCodesFromTsFiles();
+ void fillQt2S60LangMapTable();
+
+ void appendIfnotExist(QStringList &list, QString value);
+ void appendIfnotExist(QStringList &list, QStringList values);
+
+ QString removePathSeparators(QString &file);
+ QString removeTrailingPathSeparators(QString &file);
+ bool generateCleanCommands(QTextStream& t,
+ const QStringList& toClean,
+ const QString& cmd,
+ const QString& cmdOptions,
+ const QString& itemPrefix,
+ const QString& itemSuffix);
+
+
+ bool writeCustomDefFile();
+
+ // Subclass implements
+ virtual bool writeBldInfExtensionRulesPart(QTextStream& t) = 0;
+ virtual void writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension) = 0;
+ virtual bool writeMkFile(const QString& wrapperFileName, bool deploymentOnly) = 0;
+ virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile) = 0;
+
+public:
+
+ SymbianMakefileGenerator();
+ ~SymbianMakefileGenerator();
+
+};
+
+#endif // SYMMAKEFILE_H
+
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
new file mode 100644
index 0000000..8501224
--- /dev/null
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -0,0 +1,474 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "symmake_abld.h"
+#include "initprojectdeploy_symbian.h"
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qdir.h>
+#include <qdatetime.h>
+#include <qdebug.h>
+
+#define DO_NOTHING_TARGET "do_nothing"
+#define CREATE_TEMPS_TARGET "create_temps"
+#define EXTENSION_CLEAN "extension_clean"
+#define PRE_TARGETDEPS_TARGET "pre_targetdeps"
+#define COMPILER_CLEAN_TARGET "compiler_clean"
+#define FINALIZE_TARGET "finalize"
+#define GENERATED_SOURCES_TARGET "generated_sources"
+#define ALL_SOURCE_DEPS_TARGET "all_source_deps"
+#define WINSCW_DEPLOYMENT_TARGET "winscw_deployment"
+#define WINSCW_DEPLOYMENT_CLEAN_TARGET "winscw_deployment_clean"
+
+SymbianAbldMakefileGenerator::SymbianAbldMakefileGenerator() : SymbianMakefileGenerator() { }
+SymbianAbldMakefileGenerator::~SymbianAbldMakefileGenerator() { }
+
+bool SymbianAbldMakefileGenerator::writeMkFile(const QString& wrapperFileName, bool deploymentOnly)
+{
+
+ QString gnuMakefileName = QLatin1String("Makefile_") + uid3;
+ removeSpecialCharacters(gnuMakefileName);
+ gnuMakefileName.append(".mk");
+
+ QFile ft(gnuMakefileName);
+ if(ft.open(QIODevice::WriteOnly)) {
+ generatedFiles << ft.fileName();
+ QTextStream t(&ft);
+
+ t << "# ==============================================================================" << endl;
+ t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString() << endl;
+ t << "# This file is generated by qmake and should not be modified by the" << endl;
+ t << "# user." << endl;
+ t << "# Name : " << gnuMakefileName << endl;
+ t << "# Part of : " << project->values("TARGET").join(" ") << endl;
+ t << "# Description : This file is used to call necessary targets on wrapper makefile" << endl;
+ t << "# during normal Symbian build process." << endl;
+ t << "# Version : " << endl;
+ t << "#" << endl;
+ t << "# ==============================================================================" << "\n" << endl;
+
+ t << endl << endl;
+
+ t << "MAKE = make" << endl;
+ t << endl;
+
+ t << DO_NOTHING_TARGET " :" << endl;
+ t << "\t" << "@rem " DO_NOTHING_TARGET << endl << endl;
+
+ QString buildDeps;
+ QString cleanDeps;
+ QString finalDeps;
+ QString cleanDepsWinscw;
+ QString finalDepsWinscw;
+ QStringList wrapperTargets;
+ if (deploymentOnly) {
+ buildDeps.append(DO_NOTHING_TARGET);
+ cleanDeps.append(DO_NOTHING_TARGET);
+ cleanDepsWinscw.append( WINSCW_DEPLOYMENT_CLEAN_TARGET);
+ finalDeps.append(DO_NOTHING_TARGET);
+ finalDepsWinscw.append(WINSCW_DEPLOYMENT_TARGET);
+ wrapperTargets << WINSCW_DEPLOYMENT_TARGET << WINSCW_DEPLOYMENT_CLEAN_TARGET;
+ } else {
+ buildDeps.append(CREATE_TEMPS_TARGET " " PRE_TARGETDEPS_TARGET);
+ cleanDeps.append(EXTENSION_CLEAN);
+ cleanDepsWinscw.append(EXTENSION_CLEAN " " WINSCW_DEPLOYMENT_CLEAN_TARGET);
+ finalDeps.append(FINALIZE_TARGET);
+ finalDepsWinscw.append(FINALIZE_TARGET " " WINSCW_DEPLOYMENT_TARGET);
+ wrapperTargets << PRE_TARGETDEPS_TARGET
+ << CREATE_TEMPS_TARGET
+ << EXTENSION_CLEAN
+ << FINALIZE_TARGET
+ << WINSCW_DEPLOYMENT_CLEAN_TARGET
+ << WINSCW_DEPLOYMENT_TARGET;
+ }
+
+ t << "MAKMAKE: " << buildDeps << endl << endl;
+ t << "LIB: " << buildDeps << endl << endl;
+ t << "BLD: " << buildDeps << endl << endl;
+ t << "ifeq \"$(PLATFORM)\" \"WINSCW\"" << endl;
+ t << "CLEAN: " << cleanDepsWinscw << endl;
+ t << "else" << endl;
+ t << "CLEAN: " << cleanDeps << endl;
+ t << "endif" << endl << endl;
+ t << "CLEANLIB: " DO_NOTHING_TARGET << endl << endl;
+ t << "RESOURCE: " DO_NOTHING_TARGET << endl << endl;
+ t << "FREEZE: " DO_NOTHING_TARGET << endl << endl;
+ t << "SAVESPACE: " DO_NOTHING_TARGET << endl << endl;
+ t << "RELEASABLES: " DO_NOTHING_TARGET << endl << endl;
+ t << "ifeq \"$(PLATFORM)\" \"WINSCW\"" << endl;
+ t << "FINAL: " << finalDepsWinscw << endl;
+ t << "else" << endl;
+ t << "FINAL: " << finalDeps << endl;
+ t << "endif" << endl << endl;
+
+ QString makefile(Option::fixPathToTargetOS(fileInfo(wrapperFileName).canonicalFilePath()));
+ foreach(QString target, wrapperTargets) {
+ t << target << " : " << makefile << endl;
+ t << "\t-$(MAKE) -f \"" << makefile << "\" " << target << endl << endl;
+ }
+
+ t << endl;
+ } // if(ft.open(QIODevice::WriteOnly))
+
+ return true;
+}
+
+void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile)
+{
+ QStringList allPlatforms;
+ foreach(QString platform, project->values("SYMBIAN_PLATFORMS")) {
+ allPlatforms << platform.toLower();
+ }
+
+ QStringList debugPlatforms = allPlatforms;
+ QStringList releasePlatforms = allPlatforms;
+ releasePlatforms.removeAll("winscw"); // No release for emulator
+
+ bool isSubdirs = getTargetExtension() == "subdirs";
+
+ QString testClause;
+ if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
+ testClause = QLatin1String(" test");
+ else
+ testClause = QLatin1String("");
+
+ QTextStream t(&wrapperFile);
+
+ t << "# ==============================================================================" << endl;
+ t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString() << endl;
+ t << "# This file is generated by qmake and should not be modified by the" << endl;
+ t << "# user." << endl;
+ t << "# Name : " << wrapperFile.fileName() << endl;
+ t << "# Description : Wrapper Makefile for calling Symbian build tools" << endl;
+ t << "#" << endl;
+ t << "# ==============================================================================" << "\n" << endl;
+ t << endl;
+ QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
+ if(ofile.lastIndexOf(Option::dir_sep) != -1)
+ ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1);
+ t << "MAKEFILE = " << ofile << endl;
+ t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;
+ t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
+ t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
+ t << "XCOPY = xcopy /d /f /h /r /y /i" << endl;
+ t << "ABLD = ABLD.BAT" << endl;
+ t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl;
+ t << "RELEASE_PLATFORMS = " << releasePlatforms.join(" ") << endl;
+ t << "MAKE = make" << endl;
+ t << endl;
+ t << "ifeq (WINS,$(findstring WINS, $(PLATFORM)))" << endl;
+ t << "ZDIR=$(EPOCROOT)epoc32\\release\\$(PLATFORM)\\$(CFG)\\Z" << endl;
+ t << "else" << endl;
+ t << "ZDIR=$(EPOCROOT)epoc32\\data\\z" << endl;
+ t << "endif" << endl;
+ t << endl;
+ t << "DEFINES" << '\t' << " = "
+ << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
+ << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ")
+ << varGlue("DEFINES","-D"," -D","") << endl;
+
+ t << "INCPATH" << '\t' << " = ";
+
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ t << " -I\"" << values.at(i) << "\"";
+ }
+ }
+ t << endl;
+ t << "first: default" << endl;
+ if (debugPlatforms.contains("winscw"))
+ t << "default: debug-winscw";
+ else if (debugPlatforms.contains("armv5"))
+ t << "default: debug-armv5";
+ else if (debugPlatforms.size())
+ t << "default: debug-" << debugPlatforms.first();
+ else
+ t << "default: all";
+
+ t << endl;
+ if (!isPrimaryMakefile) {
+ t << "all:" << endl;
+ } else {
+ t << "all: debug release" << endl;
+ t << endl;
+ t << "qmake:" << endl;
+ t << "\t$(QMAKE) -spec symbian-abld -o \"" << fileInfo(Option::output.fileName()).fileName()
+ << "\" \"" << project->projectFile() << "\"" << endl;
+ t << endl;
+ t << BLD_INF_FILENAME ":" << endl;
+ t << "\t$(QMAKE)" << endl;
+ t << endl;
+ t << "$(ABLD): " BLD_INF_FILENAME << endl;
+ t << "\tbldmake bldfiles" << endl;
+ t << endl;
+
+ t << "debug: $(ABLD)" << endl;
+ foreach(QString item, debugPlatforms) {
+ t << "\t$(ABLD)" << testClause << " build " << item << " udeb" << endl;
+ }
+ t << endl;
+ t << "release: $(ABLD)" << endl;
+ foreach(QString item, releasePlatforms) {
+ t << "\t$(ABLD)" << testClause << " build " << item << " urel" << endl;
+ }
+ t << endl;
+
+ // For more specific builds, targets are in this form: build-platform, e.g. release-armv5
+ foreach(QString item, debugPlatforms) {
+ t << "debug-" << item << ": $(ABLD)" << endl;
+ t << "\t$(ABLD)" << testClause << " build " << item << " udeb" << endl;
+ }
+
+ foreach(QString item, releasePlatforms) {
+ t << "release-" << item << ": $(ABLD)" << endl;
+ t << "\t$(ABLD)" << testClause << " build " << item << " urel" << endl;
+ }
+
+ t << endl;
+ t << "export: $(ABLD)" << endl;
+ t << "\t$(ABLD)" << testClause << " export" << endl;
+ t << endl;
+
+ t << "cleanexport: $(ABLD)" << endl;
+ t << "\t$(ABLD)" << testClause << " cleanexport" << endl;
+ t << endl;
+
+ }
+
+ // pre_targetdeps target depends on:
+ // - all targets specified in PRE_TARGETDEPS
+ // - the GENERATED_SOURCES sources (so that they get generated)
+ // - all dependencies of sources targeted for compilation
+ // (mainly to ensure that any included UNUSED_SOURCES that need to be generated get generated)
+ //
+ // Unfortunately, Symbian build chain doesn't support linking generated objects to target,
+ // so supporting generating sources is the best we can do. This is enough for mocs.
+
+ if (!isSubdirs) {
+ writeExtraTargets(t);
+ writeExtraCompilerTargets(t);
+
+ t << CREATE_TEMPS_TARGET ":" << endl;
+ // generate command lines like this ...
+ // -@ if NOT EXIST ".\somedir" mkdir ".\somedir"
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ t << "\t-@ if NOT EXIST \"" << QDir::toNativeSeparators(values.at(i)) << "\\tmp\" mkdir \""
+ << QDir::toNativeSeparators(values.at(i)) << "\\tmp\"" << endl;
+ }
+ }
+ t << endl;
+
+ // Note: EXTENSION_CLEAN will get called many times when doing reallyclean
+ // This is why the "2> NUL" gets appended to generated clean targets in makefile.cpp.
+ t << EXTENSION_CLEAN ": " COMPILER_CLEAN_TARGET << endl;
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList dirsToClean = it.value();
+ generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_DIR"), " /S /Q ", "", "/tmp");
+ }
+ t << endl;
+
+ t << PRE_TARGETDEPS_TARGET ":"
+ << MAKEFILE_DEPENDENCY_SEPARATOR GENERATED_SOURCES_TARGET
+ << MAKEFILE_DEPENDENCY_SEPARATOR ALL_SOURCE_DEPS_TARGET;
+ if (project->values("PRE_TARGETDEPS").size())
+ t << MAKEFILE_DEPENDENCY_SEPARATOR << project->values("PRE_TARGETDEPS").join(MAKEFILE_DEPENDENCY_SEPARATOR);
+ t << endl << endl;
+ t << GENERATED_SOURCES_TARGET ":";
+ if (project->values("GENERATED_SOURCES").size())
+ t << MAKEFILE_DEPENDENCY_SEPARATOR << project->values("GENERATED_SOURCES").join(MAKEFILE_DEPENDENCY_SEPARATOR);
+ t << endl << endl;
+ t << ALL_SOURCE_DEPS_TARGET ":";
+
+ QStringList allDeps;
+ for(QMap<QString, QStringList>::iterator it = sources.begin(); it != sources.end(); ++it) {
+ QString currentSourcePath = it.key();
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ // we need additional check
+ QString sourceFile = currentSourcePath + "/" + values.at(i);
+ QStringList deps = findDependencies(QDir::toNativeSeparators(sourceFile));
+ appendIfnotExist(allDeps, deps);
+ }
+ }
+
+ foreach(QString item, allDeps) {
+ t << MAKEFILE_DEPENDENCY_SEPARATOR << item;
+ }
+ t << endl << endl;
+
+ // Post link operations
+ t << FINALIZE_TARGET ":" << endl;
+ if(!project->isEmpty("QMAKE_POST_LINK")) {
+ t << '\t' << var("QMAKE_POST_LINK");
+ t << endl;
+ }
+ t << endl;
+ }
+ else {
+ QList<MakefileGenerator::SubTarget*> subtargets = findSubDirsSubTargets();
+ writeSubTargets(t, subtargets, SubTargetSkipDefaultVariables|SubTargetSkipDefaultTargets);
+ qDeleteAll(subtargets);
+ }
+
+ writeDeploymentTargets(t);
+
+ t << "dodistclean:" << endl;
+ foreach(QString item, project->values("SUBDIRS")) {
+ bool fromFile = false;
+ QString fixedItem;
+ if(!project->isEmpty(item + ".file")) {
+ fixedItem = project->first(item + ".file");
+ fromFile = true;
+ } else if(!project->isEmpty(item + ".subdir")) {
+ fixedItem = project->first(item + ".subdir");
+ fromFile = false;
+ } else {
+ fromFile = item.endsWith(Option::pro_ext);
+ fixedItem = item;
+ }
+ QFileInfo fi(fileInfo(fixedItem));
+ if (!fromFile) {
+ t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fi.canonicalFilePath()) << "\\Makefile\" dodistclean" << endl;
+ } else {
+ QString itemName = fi.fileName();
+ int extIndex = itemName.lastIndexOf(Option::pro_ext);
+ if (extIndex)
+ fixedItem = fi.canonicalPath() + "/" + QString("Makefile.") + itemName.mid(0,extIndex);
+ t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fixedItem) << "\" dodistclean" << endl;
+ }
+
+ }
+
+ generatedFiles << Option::fixPathToTargetOS(fileInfo(Option::output.fileName()).canonicalFilePath()); // bld.inf
+ generatedFiles << project->values("QMAKE_INTERNAL_PRL_FILE"); // Add generated prl files for cleanup
+ generatedFiles << project->values("QMAKE_DISTCLEAN"); // Add any additional files marked for distclean
+ QStringList fixedFiles;
+ QStringList fixedDirs;
+ foreach(QString item, generatedFiles) {
+ QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).canonicalFilePath());
+ if (!fixedFiles.contains(fixedItem)) {
+ fixedFiles << fixedItem;
+ }
+ }
+ foreach(QString item, generatedDirs) {
+ QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).canonicalFilePath());
+ if (!fixedDirs.contains(fixedItem)) {
+ fixedDirs << fixedItem;
+ }
+ }
+ generateCleanCommands(t, fixedFiles, "$(DEL_FILE)", "", "", "");
+ generateCleanCommands(t, fixedDirs, "$(DEL_DIR)", "", "", "");
+ t << endl;
+
+ t << "distclean: clean dodistclean" << endl;
+ t << endl;
+ t << "clean: $(ABLD)" << endl;
+ t << "\t-$(ABLD)" << testClause << " reallyclean" << endl;
+ t << "\t-bldmake clean" << endl;
+ t << endl;
+
+ // create execution target
+ if (debugPlatforms.contains("winscw") && getTargetExtension() == "exe") {
+ t << "run:" << endl;
+ t << "\t-call " << epocRoot() << "epoc32\\release\\winscw\\udeb\\" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << endl << endl;
+ }
+}
+
+bool SymbianAbldMakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t)
+{
+ // We don't use extensions for anything in abld
+ Q_UNUSED(t);
+ return true;
+}
+
+bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t)
+{
+ t << WINSCW_DEPLOYMENT_TARGET ":" << endl;
+
+ QString remoteTestPath = epocRoot() + QLatin1String("epoc32\\winscw\\c\\private\\") + privateDirUid; // default 4 OpenC; 4 all Symbian too
+ DeploymentList depList;
+ initProjectDeploySymbian( project, depList, remoteTestPath, false, QLatin1String("winscw"), QLatin1String("udeb"), generatedDirs, generatedFiles );
+
+ if (depList.size())
+ t << "\t-echo Deploying changed files..." << endl;
+
+ for (int i=0; i<depList.size(); ++i) {
+ // xcopy prompts for selecting file or directory if target doesn't exist,
+ // and doesn't provide switch to force file selection. It does provide dir forcing, though,
+ // so strip the last part of the destination.
+ t << "\t-$(XCOPY) \"" << depList.at(i).from << "\" \"" << depList.at(i).to.left(depList.at(i).to.lastIndexOf("\\")+1) << "\"" << endl;
+ }
+
+ t << endl;
+
+ t << WINSCW_DEPLOYMENT_CLEAN_TARGET ":" << endl;
+ QStringList cleanList;
+ for (int i=0; i<depList.size(); ++i) {
+ cleanList.append(depList.at(i).to);
+ }
+ generateCleanCommands(t, cleanList, "$(DEL_FILE)", "", "", "");
+
+ // Note: If deployment creates any directories, they will not get deleted after cleanup.
+ // To do this in robust fashion could be quite complex.
+
+ t << endl;
+
+ return true;
+}
+
+void SymbianAbldMakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension)
+{
+ // Normally emulator deployment gets done via regular makefile, but since subdirs
+ // do not get that, special deployment only makefile is generated for them if needed.
+ if(getTargetExtension() != "subdirs" || addDeploymentExtension) {
+ QString gnuMakefileName = QLatin1String("Makefile_") + uid3;
+ removeSpecialCharacters(gnuMakefileName);
+ gnuMakefileName.append(".mk");
+ t << "gnumakefile " << gnuMakefileName << endl;
+ }
+}
+
diff --git a/qmake/generators/symbian/symmake_abld.h b/qmake/generators/symbian/symmake_abld.h
new file mode 100644
index 0000000..d323813
--- /dev/null
+++ b/qmake/generators/symbian/symmake_abld.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SYMMAKE_ABLD_H
+#define SYMMAKE_ABLD_H
+
+#include <symmake.h>
+
+QT_BEGIN_NAMESPACE
+
+class SymbianAbldMakefileGenerator : public SymbianMakefileGenerator {
+
+protected:
+
+ // Inherited from parent
+ virtual bool writeBldInfExtensionRulesPart(QTextStream& t);
+ virtual void writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension);
+ virtual bool writeMkFile(const QString& wrapperFileName, bool deploymentOnly);
+ virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile);
+
+ bool writeDeploymentTargets(QTextStream &t);
+
+public:
+
+ SymbianAbldMakefileGenerator();
+ ~SymbianAbldMakefileGenerator();
+
+};
+
+#endif // SYMMAKE_ABLD_H
+
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
new file mode 100644
index 0000000..7b739c7
--- /dev/null
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -0,0 +1,447 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "symmake_sbsv2.h"
+#include "initprojectdeploy_symbian.h"
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qdir.h>
+#include <qdatetime.h>
+#include <qdebug.h>
+
+SymbianSbsv2MakefileGenerator::SymbianSbsv2MakefileGenerator() : SymbianMakefileGenerator() { }
+SymbianSbsv2MakefileGenerator::~SymbianSbsv2MakefileGenerator() { }
+
+#define FLM_DEST_DIR "epoc32/tools/makefile_templates/qt"
+#define FLM_SOURCE_DIR "/mkspecs/symbian-sbsv2/flm/qt"
+
+// Copies Qt FLMs to correct location under epocroot.
+// This is not done by configure as it is possible to change epocroot after configure.
+void SymbianSbsv2MakefileGenerator::exportFlm()
+{
+ static bool flmExportDone = false;
+
+ if (!flmExportDone) {
+ QDir sourceDir = QDir(QLibraryInfo::location(QLibraryInfo::PrefixPath) + FLM_SOURCE_DIR);
+ QFileInfoList sourceInfos = sourceDir.entryInfoList(QDir::Files);
+
+ QDir destDir(epocRoot() + FLM_DEST_DIR);
+ if (!destDir.exists()) {
+ if (destDir.mkpath(destDir.absolutePath()))
+ generatedDirs << destDir.absolutePath();
+ }
+
+ foreach(QFileInfo item, sourceInfos) {
+ QFileInfo destInfo = QFileInfo(destDir.absolutePath() + "/" + item.fileName());
+ if (!destInfo.exists() || destInfo.lastModified() < item.lastModified()) {
+ if (destInfo.exists())
+ QFile::remove(destInfo.absoluteFilePath());
+ if (QFile::copy(item.absoluteFilePath(), destInfo.absoluteFilePath()))
+ generatedFiles << destInfo.absoluteFilePath();
+ else
+ fprintf(stderr, "Error: Could not copy '%s' -> '%s'\n", qPrintable(item.absoluteFilePath()), qPrintable(destInfo.absoluteFilePath()));
+ }
+ }
+ flmExportDone = true;
+ }
+}
+
+bool SymbianSbsv2MakefileGenerator::writeMkFile(const QString& wrapperFileName, bool deploymentOnly)
+{
+ // Can't use extension makefile with sbsv2
+ Q_UNUSED(wrapperFileName);
+ Q_UNUSED(deploymentOnly);
+ return true;
+}
+
+void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile)
+{
+ QStringList allPlatforms;
+ foreach(QString platform, project->values("SYMBIAN_PLATFORMS")) {
+ allPlatforms << platform.toLower();
+ }
+
+ QStringList debugPlatforms = allPlatforms;
+ QStringList releasePlatforms = allPlatforms;
+ releasePlatforms.removeAll("winscw"); // No release for emulator
+
+ bool isSubdirs = getTargetExtension() == "subdirs";
+
+ QString testClause;
+ if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive))
+ testClause = QLatin1String(".test");
+ else
+ testClause = QLatin1String("");
+
+ QTextStream t(&wrapperFile);
+
+ t << "# ==============================================================================" << endl;
+ t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
+ t << QDateTime::currentDateTime().toString() << endl;
+ t << "# This file is generated by qmake and should not be modified by the" << endl;
+ t << "# user." << endl;
+ t << "# Name : " << wrapperFile.fileName() << endl;
+ t << "# Description : Wrapper Makefile for calling Symbian build tools" << endl;
+ t << "#" << endl;
+ t << "# ==============================================================================" << "\n" << endl;
+ t << endl;
+ QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
+ if(ofile.lastIndexOf(Option::dir_sep) != -1)
+ ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1);
+ t << "MAKEFILE = " << ofile << endl;
+ t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;
+ t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
+ t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
+ t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl;
+ t << "RELEASE_PLATFORMS = " << releasePlatforms.join(" ") << endl;
+ t << "MAKE = make" << endl;
+ t << "SBS = sbs" << endl;
+ t << endl;
+ t << "DEFINES" << '\t' << " = "
+ << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
+ << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ")
+ << varGlue("DEFINES","-D"," -D","") << endl;
+
+ t << "INCPATH" << '\t' << " = ";
+
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ t << " -I\"" << values.at(i) << "\" ";
+ }
+ }
+ t << endl;
+ t << "first: default" << endl;
+ if (debugPlatforms.contains("winscw"))
+ t << "default: debug-winscw";
+ else if (debugPlatforms.contains("armv5"))
+ t << "default: debug-armv5";
+ else if (debugPlatforms.size())
+ t << "default: debug-" << debugPlatforms.first();
+ else
+ t << "default: all";
+
+ t << endl;
+ if (!isPrimaryMakefile) {
+ t << "all:" << endl;
+ } else {
+ t << "all: debug release" << endl;
+ t << endl;
+ t << "qmake:" << endl;
+ t << "\t$(QMAKE) -spec symbian-sbsv2 -o \"" << fileInfo(Option::output.fileName()).fileName()
+ << "\" \"" << project->projectFile() << "\"" << endl;
+ t << endl;
+ t << BLD_INF_FILENAME ":" << endl;
+ t << "\t$(QMAKE)" << endl;
+ t << endl;
+
+ t << "debug: " << BLD_INF_FILENAME << endl;
+ foreach(QString item, debugPlatforms) {
+ t << "\t$(SBS) -c " << item << "_udeb" << testClause << endl;
+ }
+ t << endl;
+ t << "release: " << BLD_INF_FILENAME << endl;
+ foreach(QString item, releasePlatforms) {
+ t << "\t$(SBS) -c " << item << "_urel" << testClause << endl;
+ }
+ t << endl;
+
+ // For more specific builds, targets are in this form: build-platform, e.g. release-armv5
+ foreach(QString item, debugPlatforms) {
+ t << "debug-" << item << ": " << BLD_INF_FILENAME << endl;
+ t << "\t$(SBS) -c " << item << "_udeb" << testClause << endl;
+ }
+
+ foreach(QString item, releasePlatforms) {
+ t << "release-" << item << ": " << BLD_INF_FILENAME << endl;
+ t << "\t$(SBS) -c " << item << "_urel" << testClause << endl;
+ }
+
+ t << endl;
+ t << "export: " << BLD_INF_FILENAME << endl;
+ t << "\t$(SBS) export" << endl;
+ t << endl;
+
+ t << "cleanexport: " << BLD_INF_FILENAME << endl;
+ t << "\t$(SBS) cleanexport" << endl;
+ t << endl;
+
+ }
+
+ // Add all extra targets including extra compiler targest also to wrapper makefile,
+ // even though many of them may have already been added to bld.inf as FLMs.
+ // This is to enable use of targets like 'mocables', which call targets generated by extra compilers.
+ if (!isSubdirs) {
+ t << extraTargetsCache;
+ t << extraCompilersCache;
+ }
+ else {
+ QList<MakefileGenerator::SubTarget*> subtargets = findSubDirsSubTargets();
+ writeSubTargets(t, subtargets, SubTargetSkipDefaultVariables|SubTargetSkipDefaultTargets);
+ qDeleteAll(subtargets);
+ }
+
+ t << "dodistclean:" << endl;
+ foreach(QString item, project->values("SUBDIRS")) {
+ bool fromFile = false;
+ QString fixedItem;
+ if(!project->isEmpty(item + ".file")) {
+ fixedItem = project->first(item + ".file");
+ fromFile = true;
+ } else if(!project->isEmpty(item + ".subdir")) {
+ fixedItem = project->first(item + ".subdir");
+ fromFile = false;
+ } else {
+ fromFile = item.endsWith(Option::pro_ext);
+ fixedItem = item;
+ }
+ QFileInfo fi(fileInfo(fixedItem));
+ if (!fromFile) {
+ t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fi.absoluteFilePath() + "/Makefile") << "\" dodistclean" << endl;
+ } else {
+ QString itemName = fi.fileName();
+ int extIndex = itemName.lastIndexOf(Option::pro_ext);
+ if (extIndex)
+ fixedItem = fi.absolutePath() + "/" + QString("Makefile.") + itemName.mid(0,extIndex);
+ t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fixedItem) << "\" dodistclean" << endl;
+ }
+
+ }
+
+ generatedFiles << Option::fixPathToTargetOS(fileInfo(Option::output.fileName()).absoluteFilePath()); // bld.inf
+ generatedFiles << project->values("QMAKE_INTERNAL_PRL_FILE"); // Add generated prl files for cleanup
+ generatedFiles << project->values("QMAKE_DISTCLEAN"); // Add any additional files marked for distclean
+ QStringList fixedFiles;
+ QStringList fixedDirs;
+ foreach(QString item, generatedFiles) {
+ QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
+ if (!fixedFiles.contains(fixedItem)) {
+ fixedFiles << fixedItem;
+ }
+ }
+ foreach(QString item, generatedDirs) {
+ QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
+ if (!fixedDirs.contains(fixedItem)) {
+ fixedDirs << fixedItem;
+ }
+ }
+ generateCleanCommands(t, fixedFiles, "$(DEL_FILE)", "", "", "");
+ generateCleanCommands(t, fixedDirs, "$(DEL_DIR)", "", "", "");
+ t << endl;
+
+ t << "distclean: clean dodistclean" << endl;
+ t << endl;
+ t << "clean: " << BLD_INF_FILENAME << endl;
+ t << "\t-$(SBS) reallyclean" << endl;
+ t << endl;
+
+ // create execution target
+ if (debugPlatforms.contains("winscw") && getTargetExtension() == "exe") {
+ t << "run:" << endl;
+ t << "\t-call " << epocRoot() << "epoc32/release/winscw/udeb/" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << endl << endl;
+ }
+}
+
+bool SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t)
+{
+ // Makes sure we have needed FLMs in place.
+ exportFlm();
+
+ // Parse extra compilers data
+ QStringList defines;
+ QStringList incPath;
+
+ defines << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
+ << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ")
+ << varGlue("DEFINES","-D"," -D","");
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ incPath << QLatin1String(" -I\"") + values.at(i) + "\"";
+ }
+ }
+
+ // Write extra compilers and targets to initialize QMAKE_ET_* variables
+ // Cache results to avoid duplicate calls when creating wrapper makefile
+ QTextStream extraCompilerStream(&extraCompilersCache);
+ QTextStream extraTargetStream(&extraTargetsCache);
+ writeExtraCompilerTargets(extraCompilerStream);
+ writeExtraTargets(extraTargetStream);
+
+ // Figure out everything the target depends on as we don't want to run extra targets that
+ // are not necessary.
+ QStringList allPreDeps;
+ foreach(QString item, project->values("PRE_TARGETDEPS")) {
+ // Predeps get mangled in windows, so fix them to more sbsv2 friendly format
+#if defined(Q_OS_WIN)
+ if (item.mid(1,1) == ":")
+ item = item.mid(0,1).toUpper().append(item.mid(1)); // Fix drive to uppercase
+#endif
+ item.replace("\\", "/");
+ allPreDeps << escapeDependencyPath(item);
+ }
+
+ foreach (QString item, project->values("GENERATED_SOURCES")) {
+ allPreDeps.append(fileInfo(item).absoluteFilePath());
+ }
+
+ for(QMap<QString, QStringList>::iterator it = sources.begin(); it != sources.end(); ++it) {
+ QString currentSourcePath = it.key();
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ QString sourceFile = currentSourcePath + "/" + values.at(i);
+ QStringList deps = findDependencies(QDir::toNativeSeparators(sourceFile));
+ foreach(QString depItem, deps) {
+ appendIfnotExist(allPreDeps, fileInfo(depItem).absoluteFilePath());
+ }
+ }
+ }
+
+ // Write FLM rules for all extra targets and compilers that we depend on to build the target.
+ QStringList extraTargets;
+ extraTargets << project->values("QMAKE_EXTRA_TARGETS") << project->values("QMAKE_EXTRA_COMPILERS");
+ foreach(QString item, extraTargets) {
+ foreach(QString targetItem, project->values(QLatin1String("QMAKE_ET_PARSED_TARGETS.") + item)) {
+ // Make sure targetpath is absolute
+ QString absoluteTarget = fileInfo(targetItem).absoluteFilePath();
+ if (allPreDeps.contains(absoluteTarget)) {
+ QStringList deps = project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + item + targetItem);
+ //QString depsItem = project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + item + targetItem).join(" ");
+ QString commandItem = project->values(QLatin1String("QMAKE_ET_PARSED_CMD.") + item + targetItem).join(" ");
+
+
+ // Make sure all deps paths are absolute
+ QString absoluteDeps;
+ foreach (QString depItem, deps) {
+ if (!depItem.isEmpty()) {
+ absoluteDeps.append(fileInfo(depItem).absoluteFilePath());
+ absoluteDeps.append(" ");
+ }
+ }
+
+ t << "START EXTENSION qt/qmake_extra_pre_targetdep" << endl;
+ t << "OPTION PREDEP_TARGET " << absoluteTarget << endl;
+ t << "OPTION DEPS " << absoluteDeps << endl;
+ //t << "OPTION DEPS " << depsItem << endl;
+
+ if (commandItem.indexOf("$(INCPATH)") != -1)
+ commandItem.replace("$(INCPATH)", incPath.join(" "));
+ if (commandItem.indexOf("$(DEFINES)") != -1)
+ commandItem.replace("$(DEFINES)", defines.join(" "));
+
+ // Sbsv2 strips all backslashes (even doubles ones) from option parameters, so just replace them with slashes
+ // Problem: If some command actually needs backslashes for something else than dir separator, we are out of luck...
+ commandItem.replace("\\", "/");
+ t << "OPTION COMMAND " << commandItem << endl;
+ t << "END" << endl;
+ }
+ }
+ }
+
+ t << endl;
+
+ // Write winscw deployment rules
+ QString remoteTestPath = epocRoot() + QLatin1String("epoc32/winscw/c/private/") + privateDirUid;
+ DeploymentList depList;
+ initProjectDeploySymbian( project, depList, remoteTestPath, false, QLatin1String("winscw"), QLatin1String("udeb"), generatedDirs, generatedFiles );
+
+ t << "#if defined(WINSCW)" << endl;
+ for (int i=0; i<depList.size(); ++i) {
+ t << "START EXTENSION qt/qmake_emulator_deployment" << endl;
+ QString fromItem = depList.at(i).from;
+ QString toItem = depList.at(i).to;
+ fromItem.replace("\\", "/");
+ toItem.replace("\\", "/");
+#if defined(Q_OS_WIN)
+ toItem.prepend(QDir::current().absolutePath().left(2)); // add drive
+#endif
+ t << "OPTION DEPLOY_SOURCE " << fromItem << endl;
+ t << "OPTION DEPLOY_TARGET " << toItem << endl;
+ t << "END" << endl;
+ }
+ t << "#endif" << endl;
+
+ t << endl;
+
+ // ### TODO: Linux emulator (platsim?) deployment
+
+ // Write post link rules
+ if(!project->isEmpty("QMAKE_POST_LINK")) {
+ t << "START EXTENSION qt/qmake_post_link" << endl;
+ t << "OPTION POST_LINK_CMD " << var("QMAKE_POST_LINK") << endl;
+ t << "OPTION LINK_TARGET " << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".").append(getTargetExtension())) << endl;
+ t << "END" << endl;
+ t << endl;
+ }
+
+ // Application icon generation
+ QStringList icons = project->values("ICON");
+ if (icons.size()) {
+ QString icon = icons.first();
+ if (icons.size() > 1)
+ fprintf(stderr, "Warning: Only first icon specified in ICON variable is used: '%s'.", icon);
+
+ t << "START EXTENSION s60/mifconv" << endl;
+
+ QFileInfo iconInfo = fileInfo(icon);
+ QString iconPath = iconInfo.path();
+ QString iconFile = iconInfo.baseName();
+
+ t << "OPTION SOURCES -c32 " << iconFile << endl;
+ t << "OPTION SOURCEDIR " << iconPath << endl;
+ t << "OPTION TARGETFILE " << uid3 << ".mif" << endl;
+ t << "OPTION SVGENCODINGVERSION 3" << endl; // Compatibility with S60 3.1 devices and up
+ t << "END" << endl;
+ }
+
+ t << endl;
+
+ return true;
+}
+
+void SymbianSbsv2MakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension)
+{
+ // We don't generate extension makefile in sbsb2
+ Q_UNUSED(t);
+ Q_UNUSED(addDeploymentExtension);
+}
+
diff --git a/qmake/generators/symbian/symmake_sbsv2.h b/qmake/generators/symbian/symmake_sbsv2.h
new file mode 100644
index 0000000..e55d177
--- /dev/null
+++ b/qmake/generators/symbian/symmake_sbsv2.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SYMMAKE_SBSV2_H
+#define SYMMAKE_SBSV2_H
+
+#include <symmake.h>
+
+QT_BEGIN_NAMESPACE
+
+class SymbianSbsv2MakefileGenerator : public SymbianMakefileGenerator {
+
+protected:
+
+ // Inherited from parent
+ virtual bool writeBldInfExtensionRulesPart(QTextStream& t);
+ virtual void writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension);
+ virtual bool writeMkFile(const QString& wrapperFileName, bool deploymentOnly);
+ virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile);
+
+public:
+
+ SymbianSbsv2MakefileGenerator();
+ ~SymbianSbsv2MakefileGenerator();
+
+private:
+ void exportFlm();
+
+ QString extraTargetsCache;
+ QString extraCompilersCache;
+};
+
+#endif // SYMMAKE_SBSV2_H
+
diff --git a/qmake/generators/win32/msvc_dsp.cpp b/qmake/generators/win32/msvc_dsp.cpp
index 17a5154..0fc309e 100644
--- a/qmake/generators/win32/msvc_dsp.cpp
+++ b/qmake/generators/win32/msvc_dsp.cpp
@@ -1123,6 +1123,20 @@ QString DspMakefileGenerator::writeBuildstepForFileForConfig(const QString &file
fileOut);
dep_cmd = Option::fixPathToLocalOS(dep_cmd, true, false);
if(config->canExecute(dep_cmd)) {
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+ QPopen procPipe;
+ if( procPipe.init(dep_cmd.toLatin1().constData(), "r") ) {
+ QString indeps;
+ while(true) {
+ int read_in = procPipe.fread(buff, 255);
+ if ( !read_in )
+ break;
+ indeps += QByteArray(buff, read_in);
+ }
+ if(!indeps.isEmpty())
+ step.deps += config->fileFixify(indeps.replace('\n', ' ').simplified().split(' '));
+ }
+#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1135,6 +1149,7 @@ QString DspMakefileGenerator::writeBuildstepForFileForConfig(const QString &file
if(!indeps.isEmpty())
step.deps += config->fileFixify(indeps.replace('\n', ' ').simplified().split(' '));
}
+#endif
}
}
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index c1f5ce1..6e36c47 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -2215,6 +2215,26 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
Option::fixPathToLocalOS(inFile, true, false),
out);
if(Project->canExecute(dep_cmd)) {
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+ QPopen procPipe;
+ if( procPipe.init(dep_cmd.toLatin1().constData(), "r") ) {
+ QString indeps;
+ while(true) {
+ int read_in = procPipe.fread(buff, 255);
+ if ( !read_in )
+ break;
+ indeps += QByteArray(buff, read_in);
+ }
+ if(!indeps.isEmpty()) {
+ QStringList extradeps = indeps.split(QLatin1Char('\n'));
+ for (int i = 0; i < extradeps.count(); ++i) {
+ QString dd = extradeps.at(i).simplified();
+ if (!dd.isEmpty())
+ deps += Project->fileFixify(dd);
+ }
+ }
+ }
+#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -2233,6 +2253,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
}
}
}
+#endif
}
}
for (int i = 0; i < deps.count(); ++i)
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 13bc05b..76c17ef 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -1448,6 +1448,20 @@ void VcprojGenerator::initResourceFiles()
dep_cmd = Option::fixPathToLocalOS(dep_cmd, true, false);
if(canExecute(dep_cmd)) {
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+ QPopen procPipe;
+ if( procPipe.init(dep_cmd.toLatin1().constData(), "r") ) {
+ QString indeps;
+ while(true) {
+ int read_in = procPipe.fread(buff, 255);
+ if ( !read_in )
+ break;
+ indeps += QByteArray(buff, read_in);
+ }
+ if(!indeps.isEmpty())
+ deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' '));
+ }
+#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1460,6 +1474,7 @@ void VcprojGenerator::initResourceFiles()
if(!indeps.isEmpty())
deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' '));
}
+#endif
}
}
vcProject.ResourceFiles.addFiles(deps);
diff --git a/qmake/project.cpp b/qmake/project.cpp
index b1918c0..8bae781 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -52,6 +52,8 @@
#include <qtextstream.h>
#include <qstack.h>
#include <qhash.h>
+#include <qxmlstream.h>
+#include <qsettings.h>
#include <qdebug.h>
#ifdef Q_OS_UNIX
#include <unistd.h>
@@ -63,8 +65,12 @@
#include <stdlib.h>
#ifdef Q_OS_WIN32
+#if defined(Q_CC_MWERKS)
+#include "qpopen.h"
+#else
#define QT_POPEN _popen
#define QT_PCLOSE _pclose
+#endif
#else
#define QT_POPEN popen
#define QT_PCLOSE pclose
@@ -76,7 +82,8 @@ QT_BEGIN_NAMESPACE
enum ExpandFunc { E_MEMBER=1, E_FIRST, E_LAST, E_CAT, E_FROMFILE, E_EVAL, E_LIST,
E_SPRINTF, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION,
E_FIND, E_SYSTEM, E_UNIQUE, E_QUOTE, E_ESCAPE_EXPAND,
- E_UPPER, E_LOWER, E_FILES, E_PROMPT, E_RE_ESCAPE, E_REPLACE };
+ E_UPPER, E_LOWER, E_FILES, E_PROMPT, E_RE_ESCAPE, E_REPLACE,
+ E_GENERATE_TEST_UID, E_SIZE };
QMap<QString, ExpandFunc> qmake_expandFunctions()
{
static QMap<QString, ExpandFunc> *qmake_expand_functions = 0;
@@ -107,6 +114,8 @@ QMap<QString, ExpandFunc> qmake_expandFunctions()
qmake_expand_functions->insert("files", E_FILES);
qmake_expand_functions->insert("prompt", E_PROMPT);
qmake_expand_functions->insert("replace", E_REPLACE);
+ qmake_expand_functions->insert("generate_test_uid", E_GENERATE_TEST_UID);
+ qmake_expand_functions->insert("size", E_SIZE);
}
return *qmake_expand_functions;
}
@@ -588,6 +597,69 @@ static void qmake_error_msg(const QString &msg)
msg.toLatin1().constData());
}
+enum isForSymbian_enum
+{
+ isForSymbian_NOT_SET = -1,
+ isForSymbian_FALSE = 0,
+ isForSymbian_ABLD = 1,
+ isForSymbian_SBSV2 = 2,
+};
+
+static isForSymbian_enum isForSymbian_value = isForSymbian_NOT_SET;
+
+// Checking for symbian build is primarily determined from the qmake spec,
+// but if that is not specified, detect if symbian is the default spec
+// by checking the MAKEFILE_GENERATOR variable value.
+static void init_isForSymbian(const QMap<QString, QStringList>& vars)
+{
+ if (isForSymbian_value != isForSymbian_NOT_SET)
+ return;
+
+ QString spec = QFileInfo(Option::mkfile::qmakespec).fileName();
+ if (spec.startsWith("symbian-abld", Qt::CaseInsensitive)) {
+ isForSymbian_value = isForSymbian_ABLD;
+ return;
+ }
+ if (spec.startsWith("symbian-sbsv2", Qt::CaseInsensitive)) {
+ isForSymbian_value = isForSymbian_SBSV2;
+ return;
+ }
+
+ QStringList generatorList = vars["MAKEFILE_GENERATOR"];
+
+ if (!generatorList.isEmpty()) {
+ QString generator = generatorList.first();
+ if (generator.startsWith("SYMBIAN_ABLD"))
+ isForSymbian_value = isForSymbian_ABLD;
+ else if (generator.startsWith("SYMBIAN_SBSV2"))
+ isForSymbian_value = isForSymbian_SBSV2;
+ else
+ isForSymbian_value = isForSymbian_FALSE;
+ } else {
+ isForSymbian_value = isForSymbian_FALSE;
+ }
+}
+
+bool isForSymbian()
+{
+ // If isForSymbian_value has not been initialized explicitly yet,
+ // call initializer with dummy map to check qmake spec.
+ if (isForSymbian_value == isForSymbian_NOT_SET)
+ init_isForSymbian(QMap<QString, QStringList>());
+
+ return (isForSymbian_value == isForSymbian_ABLD || isForSymbian_value == isForSymbian_SBSV2);
+}
+
+bool isForSymbianSbsv2()
+{
+ // If isForSymbian_value has not been initialized explicitly yet,
+ // call initializer with dummy map to check qmake spec.
+ if (isForSymbian_value == isForSymbian_NOT_SET)
+ init_isForSymbian(QMap<QString, QStringList>());
+
+ return (isForSymbian_value == isForSymbian_SBSV2);
+}
+
/*
1) environment variable QMAKEFEATURES (as separated by colons)
2) property variable QMAKEFEATURES (as separated by colons)
@@ -614,11 +686,21 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0)
concat << base_concat + QDir::separator() + "unix";
break;
case Option::TARG_UNIX_MODE:
- concat << base_concat + QDir::separator() + "unix";
- break;
+ {
+ if (isForSymbian())
+ concat << base_concat + QDir::separator() + "symbian";
+ else
+ concat << base_concat + QDir::separator() + "unix";
+ break;
+ }
case Option::TARG_WIN_MODE:
- concat << base_concat + QDir::separator() + "win32";
- break;
+ {
+ if (isForSymbian())
+ concat << base_concat + QDir::separator() + "symbian";
+ else
+ concat << base_concat + QDir::separator() + "win32";
+ break;
+ }
case Option::TARG_MAC9_MODE:
concat << base_concat + QDir::separator() + "mac";
concat << base_concat + QDir::separator() + "mac9";
@@ -1475,6 +1557,9 @@ QMakeProject::read(uchar cmd)
fprintf(stderr, "Failure to read QMAKESPEC conf file %s.\n", spec.toLatin1().constData());
return false;
}
+
+ init_isForSymbian(base_vars);
+
if(Option::mkfile::do_cache && !Option::mkfile::cachefile.isEmpty()) {
debug_msg(1, "QMAKECACHE file: reading %s", Option::mkfile::cachefile.toLatin1().constData());
read(Option::mkfile::cachefile, base_vars);
@@ -1609,25 +1694,34 @@ QMakeProject::isActiveConfig(const QString &x, bool regex, QMap<QString, QString
else if(x == "false")
return false;
+ static QString spec;
+ if(spec.isEmpty())
+ spec = QFileInfo(Option::mkfile::qmakespec).fileName();
+
+ // Symbian is an exception to how scopes are resolved. Since we do not
+ // have a separate target mode for Symbian, but we expect the scope to resolve
+ // on other platforms we base it entirely on the mkspec. This means that
+ // using a mkspec starting with 'symbian*' will resolve both the 'symbian'
+ // and the 'unix' (because of Open C) scopes to true.
+ if(isForSymbian() && (x == "symbian" || x == "unix"))
+ return true;
+
//mkspecs
if((Option::target_mode == Option::TARG_MACX_MODE || Option::target_mode == Option::TARG_QNX6_MODE ||
Option::target_mode == Option::TARG_UNIX_MODE) && x == "unix")
- return true;
+ return !isForSymbian();
else if(Option::target_mode == Option::TARG_MACX_MODE && x == "macx")
- return true;
+ return !isForSymbian();
else if(Option::target_mode == Option::TARG_QNX6_MODE && x == "qnx6")
- return true;
+ return !isForSymbian();
else if(Option::target_mode == Option::TARG_MAC9_MODE && x == "mac9")
- return true;
+ return !isForSymbian();
else if((Option::target_mode == Option::TARG_MAC9_MODE || Option::target_mode == Option::TARG_MACX_MODE) &&
x == "mac")
- return true;
+ return !isForSymbian();
else if(Option::target_mode == Option::TARG_WIN_MODE && x == "win32")
- return true;
+ return !isForSymbian();
QRegExp re(x, Qt::CaseSensitive, QRegExp::Wildcard);
- static QString spec;
- if(spec.isEmpty())
- spec = QFileInfo(Option::mkfile::qmakespec).fileName();
if((regex && re.exactMatch(spec)) || (!regex && spec == x))
return true;
#ifdef Q_OS_UNIX
@@ -1718,6 +1812,7 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QMap<QString, QStringL
if(file.indexOf(Option::dir_sep) == -1 || !QFile::exists(file)) {
static QStringList *feature_roots = 0;
if(!feature_roots) {
+ init_isForSymbian(base_vars);
feature_roots = new QStringList(qmake_feature_paths(prop));
qmakeAddCacheClear(qmakeDeleteCacheClear_QStringList, (void**)&feature_roots);
}
@@ -2158,11 +2253,33 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list,
} else {
QMakeProjectEnv env(place);
char buff[256];
- FILE *proc = QT_POPEN(args[0].toLatin1(), "r");
bool singleLine = true;
if(args.count() > 1)
singleLine = (args[1].toLower() == "true");
QString output;
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+ QPopen procPipe;
+ if( !procPipe.init(args[0].toLatin1(), "r") ) {
+ fprintf(stderr, "%s:%d system(%s) failed.\n",
+ parser.file.toLatin1().constData(),
+ parser.line_no,
+ qPrintable(args[0]));
+ }
+
+ while(true) {
+ int read_in = procPipe.fread(buff, 255);
+ if ( !read_in )
+ break;
+ for(int i = 0; i < read_in; ++i) {
+ if((singleLine && buff[i] == '\n') || buff[i] == '\t')
+ buff[i] = ' ';
+ }
+ buff[read_in] = '\0';
+ output += buff;
+ }
+ ret += split_value_list(output);
+#else
+ FILE *proc = QT_POPEN(args[0].toLatin1(), "r");
while(proc && !feof(proc)) {
int read_in = int(fread(buff, 1, 255, proc));
if(!read_in)
@@ -2177,6 +2294,7 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list,
ret += split_value_list(output);
if(proc)
QT_PCLOSE(proc);
+#endif
}
break; }
case E_UNIQUE: {
@@ -2311,6 +2429,32 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list,
ret += it->replace(before, after);
}
break; }
+ case E_GENERATE_TEST_UID: {
+ if(args.count() != 1) {
+ fprintf(stderr, "%s:%d: generate_test_uid(targetname) requires one argument.\n",
+ parser.file.toLatin1().constData(), parser.line_no);
+ } else {
+ QString target = args[0];
+
+ QString currPath = qmake_getpwd();
+ target.prepend("/").prepend(currPath);
+
+
+ QString tmp = generate_test_uid(target);
+
+ ret += tmp;
+ }
+ break; }
+ case E_SIZE: {
+ if(args.count() != 1) {
+ fprintf(stderr, "%s:%d: size(var) requires one argument.\n",
+ parser.file.toLatin1().constData(), parser.line_no);
+ } else {
+ //QString target = args[0];
+ int size = values(args[0]).size();
+ ret += QString::number(size);
+ }
+ break; }
default: {
#ifdef QTSCRIPT_SUPPORT
{
@@ -3185,9 +3329,161 @@ QStringList &QMakeProject::values(const QString &_var, QMap<QString, QStringList
} else if (var == QLatin1String("QMAKE_DIR_SEP")) {
if (place[var].isEmpty())
return values("DIR_SEPARATOR", place);
+ } else if (var == QLatin1String("EPOCROOT")) {
+ if (place[var].isEmpty())
+ place[var] = QStringList(epocRoot());
}
//qDebug("REPLACE [%s]->[%s]", qPrintable(var), qPrintable(place[var].join("::")));
return place[var];
}
+
+// UIDs starting with 0xE are test UIDs in symbian
+QString generate_test_uid(const QString& target) {
+ QString tmp = generate_uid(target);
+ tmp.replace(0,1,"E");
+ tmp.prepend("0x");
+
+ // printf("generate_test_uid for %s is %s \n", qPrintable(target), qPrintable(tmp));
+
+ return tmp;
+}
+
+
+// UIDs starting with 0xE are test UIDs in symbian
+QString generate_uid(const QString& target) {
+
+ static QMap<QString, QString> targetToUid;
+
+ QString tmp = targetToUid[target];
+
+ if(!tmp.isEmpty()) {
+ // printf("generate_uid for %s is %s \n", qPrintable(target), qPrintable(tmp));
+ return tmp;
+ }
+
+ unsigned long hash = 5381;
+ int c;
+
+ for(int i = 0; i < target.size(); ++i) {
+ c = target.at(i).toAscii();
+ hash ^= c + ((c-i) << i%20) + ((c+i) << (i+5)%20) + ((c-2*i) << (i+10)%20) + ((c+2*i) << (i+15)%20);
+ }
+
+ tmp.setNum(hash, 16);
+ for(int i = tmp.size(); i < 8; ++i)
+ tmp.prepend("0");
+
+#if 0
+ static QMap<QString, QString> uidConflictCheckList;
+ QString testStr = tmp;
+ testStr.replace(0,1,"E"); // Simulate actual UID generation
+ if (uidConflictCheckList.contains(testStr)) {
+ printf("\n\n!!!! generated duplicate uid for %s is %s <-> %s !!!!\n\n\n",
+ qPrintable(target),
+ qPrintable(testStr),
+ qPrintable(uidConflictCheckList.value(testStr)));
+ }
+ uidConflictCheckList.insert(testStr, target);
+ printf("generate_uid for %s is %s \n", qPrintable(target), qPrintable(tmp));
+#endif
+
+ targetToUid[target] = tmp;
+
+ return tmp;
+}
+
+static void fixEpocRootStr(QString& path)
+{
+ path.replace("\\","/");
+
+ if (path.size() > 1 && path[1] == QChar(':')) {
+ path = path.mid(2);
+ }
+
+ if (!path.size() || path[path.size()-1] != QChar('/')) {
+ path += QChar('/');
+ }
+}
+
+#define SYMBIAN_SDKS_KEY "HKEY_LOCAL_MACHINE\\Software\\Symbian\\EPOC SDKs"
+
+static QString epocRootStr;
+
+QString epocRoot()
+{
+ if (!epocRootStr.isEmpty())
+ {
+ return epocRootStr;
+ }
+
+ // First, check the env variable
+ epocRootStr = qgetenv("EPOCROOT");
+
+ if (epocRootStr.isEmpty()) {
+ // No EPOCROOT set, check the default device
+ // First check EPOCDEVICE env variable
+ QString defaultDevice = qgetenv("EPOCDEVICE");
+
+ // Check the windows registry via QSettings for devices.xml path
+ QSettings settings(SYMBIAN_SDKS_KEY, QSettings::NativeFormat);
+ QString devicesXmlPath = settings.value("CommonPath").toString();
+
+ if (!devicesXmlPath.isEmpty()) {
+ // Parse xml for correct device
+ devicesXmlPath += "/devices.xml";
+ QFile devicesFile(devicesXmlPath);
+ if (devicesFile.open(QIODevice::ReadOnly)) {
+ QXmlStreamReader xml(&devicesFile);
+ while (!xml.atEnd()) {
+ xml.readNext();
+ if (xml.isStartElement() && xml.name() == "devices") {
+ if (xml.attributes().value("version") == "1.0") {
+ // Look for correct device
+ while (!(xml.isEndElement() && xml.name() == "devices") && !xml.atEnd()) {
+ xml.readNext();
+ if (xml.isStartElement() && xml.name() == "device") {
+ if ((defaultDevice.isEmpty() && xml.attributes().value("default") == "yes") ||
+ (!defaultDevice.isEmpty() && (xml.attributes().value("id").toString() + QString(":") + xml.attributes().value("name").toString()) == defaultDevice)) {
+ // Found the correct device
+ while (!(xml.isEndElement() && xml.name() == "device") && !xml.atEnd()) {
+ xml.readNext();
+ if (xml.isStartElement() && xml.name() == "epocroot") {
+ epocRootStr = xml.readElementText();
+ fixEpocRootStr(epocRootStr);
+ return epocRootStr;
+ }
+ }
+ xml.raiseError("No epocroot element found");
+ }
+ }
+ }
+ } else {
+ xml.raiseError("Invalid 'devices' element version");
+ }
+ }
+ }
+ if (xml.hasError()) {
+ fprintf(stderr, "ERROR: \"%s\" when parsing devices.xml\n", qPrintable(xml.errorString()));
+ }
+ } else {
+ fprintf(stderr, "Could not open devices.xml (%s)\n", qPrintable(devicesXmlPath));
+ }
+ } else {
+ fprintf(stderr, "Could not retrieve " SYMBIAN_SDKS_KEY " setting\n");
+ }
+
+ fprintf(stderr, "Failed to determine epoc root.\n");
+ if (!defaultDevice.isEmpty())
+ fprintf(stderr, "The device indicated by EPOCDEVICE environment variable (%s) could not be found.\n", qPrintable(defaultDevice));
+ fprintf(stderr, "Either set EPOCROOT or EPOCDEVICE environment variable to a valid value, or provide a default Symbian device.\n");
+
+ // No valid device found; set epocroot to "/"
+ epocRootStr = QLatin1String("/");
+ }
+
+ fixEpocRootStr(epocRootStr);
+ return epocRootStr;
+}
+
QT_END_NAMESPACE
diff --git a/qmake/project.h b/qmake/project.h
index 1e2b754..30041e5 100644
--- a/qmake/project.h
+++ b/qmake/project.h
@@ -203,6 +203,13 @@ inline QString QMakeProject::first(const QString &v)
inline QMap<QString, QStringList> &QMakeProject::variables()
{ return vars; }
+// Helper functions needed for Symbian .mmp files and deployment
+QString generate_test_uid(const QString& target);
+QString generate_uid(const QString& target);
+QString epocRoot();
+bool isForSymbian();
+bool isForSymbianSbsv2();
+
QT_END_NAMESPACE
#endif // PROJECT_H
diff --git a/qmake/qmake.pri b/qmake/qmake.pri
index 9147ee8..2304fab 100644
--- a/qmake/qmake.pri
+++ b/qmake/qmake.pri
@@ -13,14 +13,29 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \
generators/xmloutput.cpp generators/win32/borland_bmake.cpp \
generators/win32/msvc_nmake.cpp generators/projectgenerator.cpp \
generators/win32/msvc_dsp.cpp generators/win32/msvc_vcproj.cpp \
- generators/win32/msvc_objectmodel.cpp
+ generators/win32/msvc_objectmodel.cpp \
+ generators/symbian/symmake.cpp \
+ generators/symbian/symmake_abld.cpp \
+ generators/symbian/symmake_sbsv2.cpp \
+ generators/symbian/initprojectdeploy_symbian.cpp
+
+# MWC does not provide an implementation of popen() so fake it.
+win32-mwc {
+ SOURCES += qpopen.cpp \
+}
+
+
HEADERS += project.h property.h generators/makefile.h \
generators/unix/unixmake.h meta.h option.h cachekeys.h \
generators/win32/winmakefile.h generators/projectgenerator.h \
generators/makefiledeps.h generators/metamakefile.h generators/mac/pbuilder_pbx.h \
generators/xmloutput.h generators/win32/borland_bmake.h generators/win32/msvc_nmake.h \
generators/win32/msvc_dsp.h generators/win32/msvc_vcproj.h \
- generators/win32/mingw_make.h generators/win32/msvc_objectmodel.h
+ generators/win32/mingw_make.h generators/win32/msvc_objectmodel.h \
+ generators/symbian/symmake.h \
+ generators/symbian/symmake_abld.h \
+ generators/symbian/symmake_sbsv2.h \
+ generators/symbian/initprojectdeploy_symbian.h
contains(QT_EDITION, OpenSource) {
DEFINES += QMAKE_OPENSOURCE_EDITION
@@ -63,7 +78,9 @@ bootstrap { #Qt code
qlibraryinfo.cpp \
qvariant.cpp \
qvector.cpp \
- qvsnprintf.cpp
+ qvsnprintf.cpp \
+ qxmlstream.cpp \
+ qxmlutils.cpp
HEADERS+= \
qbitarray.h \
@@ -97,7 +114,9 @@ bootstrap { #Qt code
qtextstream.h \
qurl.h \
quuid.h \
- qvector.h
+ qvector.h \
+ qxmlstream.h \
+ qxmlutils.h
unix {
SOURCES += qfsfileengine_unix.cpp qfsfileengine_iterator_unix.cpp
@@ -109,6 +128,7 @@ bootstrap { #Qt code
} else:win32 {
SOURCES += qfsfileengine_win.cpp qfsfileengine_iterator_win.cpp qsettings_win.cpp
win32-msvc*:LIBS += ole32.lib advapi32.lib
+ win32-mwc:LIBS += -lole32.lib -ladvapi32.lib
}
qnx {
diff --git a/qmake/qmake.pro b/qmake/qmake.pro
index 38c58fb..594e698 100644
--- a/qmake/qmake.pro
+++ b/qmake/qmake.pro
@@ -17,8 +17,9 @@ VPATH += $$QT_SOURCE_TREE/src/corelib/global \
$$QT_SOURCE_TREE/src/corelib/kernel \
$$QT_SOURCE_TREE/src/corelib/plugin \
$$QT_SOURCE_TREE/src/corelib/io \
+ $$QT_SOURCE_TREE/src/corelib/xml \
$$QT_SOURCE_TREE/src/script
-INCPATH += generators generators/unix generators/win32 generators/mac \
+INCPATH += generators generators/unix generators/win32 generators/mac generators/symbian \
$$QT_SOURCE_TREE/include $$QT_SOURCE_TREE/include/QtCore \
$$QT_SOURCE_TREE/qmake $$QT_SOURCE_TREE/include/QtScript
include(qmake.pri)
diff --git a/qmake/qpopen.cpp b/qmake/qpopen.cpp
new file mode 100644
index 0000000..ebde035
--- /dev/null
+++ b/qmake/qpopen.cpp
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qpopen.h"
+
+
+QPopen::QPopen()
+{
+}
+
+bool QPopen::init(const char *command, const char* /* mode */)
+{
+ SECURITY_ATTRIBUTES attributes;
+
+ attributes.nLength = sizeof(SECURITY_ATTRIBUTES);
+ attributes.bInheritHandle = TRUE;
+ attributes.lpSecurityDescriptor = NULL;
+
+ if (! CreatePipe(&childStdOutR, &childStdOutW, &attributes, 0)) {
+ return false;
+ }
+
+ // Ensure that the read handle to the child process's pipe for STDOUT is not inherited.
+ SetHandleInformation( childStdOutR, HANDLE_FLAG_INHERIT, 0);
+
+ // Create a pipe for the child process's STDIN.
+ if (! CreatePipe(&childStdInR, &childStdInW, &attributes, 0)) {
+ return false;
+ }
+
+ // Ensure that the write handle to the child process's pipe for STDIN is not inherited.
+ SetHandleInformation( childStdInW, HANDLE_FLAG_INHERIT, 0);
+
+ //TCHAR szCmdline[strlen(command)]=TEXT(command);
+ TCHAR *szCmdLine = new TCHAR[strlen(command)+1];
+ strcpy(szCmdLine, command);
+
+ // Set up members of the PROCESS_INFORMATION structure.
+
+ ZeroMemory( &processInfo, sizeof(PROCESS_INFORMATION) );
+
+ // Set up members of the STARTUPINFO structure.
+
+ ZeroMemory( &siStartInfo, sizeof(STARTUPINFO) );
+ siStartInfo.cb = sizeof(STARTUPINFO);
+ siStartInfo.hStdError = childStdOutW;
+ siStartInfo.hStdOutput = childStdOutW;
+ siStartInfo.hStdInput = childStdInR;
+ siStartInfo.dwFlags |= STARTF_USESTDHANDLES;
+
+ // Create the child process.
+
+ bool success = CreateProcess(NULL,
+ szCmdLine, // command line
+ NULL, // process security attributes
+ NULL, // primary thread security attributes
+ TRUE, // handles are inherited
+ 0, // creation flags
+ NULL, // use parent's environment
+ NULL, // use parent's current directory
+ &siStartInfo, // STARTUPINFO pointer
+ &processInfo); // receives PROCESS_INFORMATION
+
+ delete szCmdLine;
+
+ return success;
+}
+
+QPopen::~QPopen()
+{
+ CloseHandle(processInfo.hProcess);
+ CloseHandle(processInfo.hThread);
+ CloseHandle(childStdInR);
+ CloseHandle(childStdInW);
+ CloseHandle(childStdOutR);
+ CloseHandle(childStdOutW);
+}
+
+int QPopen::fwrite(char* buffer, int maxBytes)
+{
+ DWORD bytesWritten;
+
+ bool success = WriteFile(childStdInW, buffer, maxBytes, &bytesWritten, NULL);
+ if(success) {
+ return bytesWritten;
+ }
+
+ return 0;
+}
+
+
+int QPopen::fread(char* buffer, int maxBytes)
+{
+ DWORD bytesRead;
+
+ if( !CloseHandle(childStdOutW) )
+ return 0;
+
+ bool success = ReadFile(childStdOutR, buffer, maxBytes, &bytesRead, NULL);
+ if(success)
+ return bytesRead;
+
+ return 0;
+}
+
diff --git a/qmake/qpopen.h b/qmake/qpopen.h
new file mode 100644
index 0000000..e15830d
--- /dev/null
+++ b/qmake/qpopen.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPOPEN_H
+#define QPOPEN_H
+
+#include <windows.h>
+#include <tchar.h>
+#include <stdio.h>
+#include <string.h>
+
+class QPopen
+{
+public:
+ QPopen();
+ ~QPopen();
+ int fread(char* buffer, int maxBytes);
+ int fwrite(char* buffer, int maxBytes);
+ bool init(const char* command, const char* mode);
+
+private:
+ // This pair of handles represent the "Write" pipe
+ // ie: Parent -> Child
+ HANDLE childStdInR;
+ HANDLE childStdInW;
+
+ // This pair of handles represent the "Read" pipe
+ // ie: Child -> Parent
+ HANDLE childStdOutR;
+ HANDLE childStdOutW;
+ PROCESS_INFORMATION processInfo;
+ STARTUPINFO siStartInfo;
+};
+
+#endif
diff --git a/selfsigned.cer b/selfsigned.cer
new file mode 100644
index 0000000..af72449
--- /dev/null
+++ b/selfsigned.cer
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDFTCCAtOgAwIBAgIBADALBgcqhkjOOAQDBQAwcDELMAkGA1UEBhMCTk8xDjAM
+BgNVBAoTBU5va2lhMRQwEgYDVQQLEwtRdCBTb2Z0d2FyZTEOMAwGA1UEAxMFVHJv
+bGwxKzApBgkqhkiG9w0BCQEWHHF0czYwLWZlZWRiYWNrQHRyb2xsdGVjaC5jb20w
+HhcNMDgxMDAzMTMwNDM1WhcNMDkxMDAzMTMwNDM1WjBwMQswCQYDVQQGEwJOTzEO
+MAwGA1UEChMFTm9raWExFDASBgNVBAsTC1F0IFNvZnR3YXJlMQ4wDAYDVQQDEwVU
+cm9sbDErMCkGCSqGSIb3DQEJARYccXRzNjAtZmVlZGJhY2tAdHJvbGx0ZWNoLmNv
+bTCCAbYwggErBgcqhkjOOAQBMIIBHgKBgQC7OyI3lyV06OqahpbeEa5p9ucmoBxV
+n6YKvBjliPNMhQe7Di1Igv63rllQPqABv1Qu1YJc5CPiF4dSSQ/R7XjKEQqPZY4A
+PZooTKWVCs+e3Yo2HWaZYRks/euvcqvEOqmkZ2RUccaTb1T+b2et0vphFmlVYXPx
+BrIlbKtgJg+6QwIVAJnqTjBmWtEYQ6kFWfLE3yFIKx0BAoGAais4n6lD7yFJHB2F
+mb4W09EPx+LZTFSHgj9uzLiWWDEVl+j9jA4eYZBMb2yRBZ9zVXqjDSrFLWMuoNrV
+taqAVb9V2DrDHx3s0gSQmS5BNK2KThZCNOgj3YT4GRIZR4L6gqDBS5dkWLrwFUfC
+l6Hw9tizQR4EO4HgjEnMSxzXDzsDgYQAAoGAJH/tVAEb1boQKTt5eHRI/zCtw4ab
+Vtw7jHMzqQ+m921izJyzz5AJCVjtu6a1bLnW09i9oFIZ7bYs+Cd+qRgac2cVkX4x
+xmMXuAgw03VMf3vEbK2M2+BkjpUGrfoST5XG/eJbno6Tp1BGvYd88ZLt3gXBPnqi
+2QpMaOGqMED4mWkwCwYHKoZIzjgEAwUAAy8AMCwCFGCSlB1FYaBiIAuirrAACZzi
+p2jnAhQ/hlJjpxOgF7Z5RZCNAhz6HNhZ3g==
+-----END CERTIFICATE-----
diff --git a/selfsigned.key b/selfsigned.key
new file mode 100644
index 0000000..47c51a0
--- /dev/null
+++ b/selfsigned.key
@@ -0,0 +1,12 @@
+-----BEGIN DSA PRIVATE KEY-----
+MIIBugIBAAKBgQC7OyI3lyV06OqahpbeEa5p9ucmoBxVn6YKvBjliPNMhQe7Di1I
+gv63rllQPqABv1Qu1YJc5CPiF4dSSQ/R7XjKEQqPZY4APZooTKWVCs+e3Yo2HWaZ
+YRks/euvcqvEOqmkZ2RUccaTb1T+b2et0vphFmlVYXPxBrIlbKtgJg+6QwIVAJnq
+TjBmWtEYQ6kFWfLE3yFIKx0BAoGAais4n6lD7yFJHB2Fmb4W09EPx+LZTFSHgj9u
+zLiWWDEVl+j9jA4eYZBMb2yRBZ9zVXqjDSrFLWMuoNrVtaqAVb9V2DrDHx3s0gSQ
+mS5BNK2KThZCNOgj3YT4GRIZR4L6gqDBS5dkWLrwFUfCl6Hw9tizQR4EO4HgjEnM
+SxzXDzsCgYAkf+1UARvVuhApO3l4dEj/MK3DhptW3DuMczOpD6b3bWLMnLPPkAkJ
+WO27prVsudbT2L2gUhnttiz4J36pGBpzZxWRfjHGYxe4CDDTdUx/e8RsrYzb4GSO
+lQat+hJPlcb94luejpOnUEa9h3zxku3eBcE+eqLZCkxo4aowQPiZaQIUV0KZx9KH
+Qp9/xwskqgJvmWgR8KQ=
+-----END DSA PRIVATE KEY-----
diff --git a/src/3rdparty/freetype/src/gzip/zconf.h b/src/3rdparty/freetype/src/gzip/zconf.h
index 3ccc3a6..2030a7e 100644
--- a/src/3rdparty/freetype/src/gzip/zconf.h
+++ b/src/3rdparty/freetype/src/gzip/zconf.h
@@ -5,6 +5,11 @@
/* @(#) $Id: zconf.h,v 1.4 2007/06/01 06:56:17 wl Exp $ */
+#if defined(__ARMCC__) || defined(__CC_ARM)
+/* Ultra ugly hack that convinces RVCT to use the systems zlib */
+#include <stdapis/zconf.h>
+#else /* defined(__ARMCC__) || defined(__CC_ARM) */
+
#ifndef _ZCONF_H
#define _ZCONF_H
@@ -276,3 +281,5 @@ typedef uLong FAR uLongf;
#endif
#endif /* _ZCONF_H */
+
+#endif /* defined(__ARMCC__) || defined(__CC_ARM) */
diff --git a/src/3rdparty/freetype/src/gzip/zlib.h b/src/3rdparty/freetype/src/gzip/zlib.h
index 50d0d3f..0f98fdc 100644
--- a/src/3rdparty/freetype/src/gzip/zlib.h
+++ b/src/3rdparty/freetype/src/gzip/zlib.h
@@ -28,6 +28,11 @@
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
*/
+#if defined(__ARMCC__) || defined(__CC_ARM)
+/* Ultra ugly hack that convinces RVCT to use the systems zlib */
+#include <stdapis/zlib.h>
+#else /* defined(__ARMCC__) || defined(__CC_ARM) */
+
#ifndef _ZLIB_H
#define _ZLIB_H
@@ -828,3 +833,5 @@ ZEXTERN(int) inflateInit2_ OF((z_streamp strm, int windowBits,
#endif
#endif /* _ZLIB_H */
+
+#endif /* defined(__ARMCC__) || defined(__CC_ARM) */
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-global.h b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
index d4e6b46..393cc7b 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-global.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
@@ -28,7 +28,13 @@
#ifndef HARFBUZZ_GLOBAL_H
#define HARFBUZZ_GLOBAL_H
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#else
#include <stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
+
#include <string.h>
#ifdef __cplusplus
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
index 36b9282..2e3ef38 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
@@ -935,7 +935,13 @@ static HB_Stream getTableStream(void *font, HB_GetFontTableFunc tableFunc, HB_Ta
if (error)
return 0;
stream = (HB_Stream)malloc(sizeof(HB_StreamRec));
+ if (!stream)
+ return 0;
stream->base = (HB_Byte*)malloc(length);
+ if (!stream->base) {
+ free(stream);
+ return 0;
+ }
error = tableFunc(font, tag, stream->base, &length);
if (error) {
_hb_close_stream(stream);
@@ -950,6 +956,8 @@ static HB_Stream getTableStream(void *font, HB_GetFontTableFunc tableFunc, HB_Ta
HB_Face HB_NewFace(void *font, HB_GetFontTableFunc tableFunc)
{
HB_Face face = (HB_Face )malloc(sizeof(HB_FaceRec));
+ if (!face)
+ return 0;
face->isSymbolFont = false;
face->gdef = 0;
diff --git a/src/3rdparty/libjpeg/jinclude.h b/src/3rdparty/libjpeg/jinclude.h
index 0a4f151..725bd51 100644
--- a/src/3rdparty/libjpeg/jinclude.h
+++ b/src/3rdparty/libjpeg/jinclude.h
@@ -36,7 +36,12 @@
#endif
#ifdef HAVE_STDLIB_H
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#else
#include <stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
#endif
#ifdef NEED_SYS_TYPES_H
diff --git a/src/3rdparty/libmng/libmng_types.h b/src/3rdparty/libmng/libmng_types.h
index 81fb29f..45be543 100644
--- a/src/3rdparty/libmng/libmng_types.h
+++ b/src/3rdparty/libmng/libmng_types.h
@@ -198,7 +198,12 @@
#endif /* MNG_INCLUDE_IJG6B */
#if defined(MNG_INTERNAL_MEMMNGMT) || defined(MNG_INCLUDE_FILTERS)
-#include <stdlib.h> /* "calloc" & "free" & "abs" */
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#else
+#include <stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
#endif
#include <limits.h> /* get proper integer widths */
diff --git a/src/3rdparty/libpng/pngconf.h b/src/3rdparty/libpng/pngconf.h
index 19e4732..9edb468 100644
--- a/src/3rdparty/libpng/pngconf.h
+++ b/src/3rdparty/libpng/pngconf.h
@@ -353,7 +353,12 @@
/* Other defines for things like memory and the like can go here. */
#ifdef PNG_INTERNAL
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#else
#include <stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
* aren't usually used outside the library (as far as I know), so it is
@@ -1333,7 +1338,9 @@ typedef z_stream FAR * png_zstreamp;
defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
# ifndef PNGAPI
-# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
+# if (defined(__GNUC__) && defined(__arm__)) || defined (__ARMCC__)
+# define PNGAPI
+# elif defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) || defined(__WINSCW__)
# define PNGAPI __cdecl
# else
# define PNGAPI _cdecl
diff --git a/src/3rdparty/libtiff/libtiff/tif_config.h b/src/3rdparty/libtiff/libtiff/tif_config.h
index e95f7a4..324fbe8 100644
--- a/src/3rdparty/libtiff/libtiff/tif_config.h
+++ b/src/3rdparty/libtiff/libtiff/tif_config.h
@@ -104,7 +104,7 @@
/* #undef HAVE_PTHREAD */
/* Define to 1 if you have the <search.h> header file. */
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
#define HAVE_SEARCH_H 1
#endif
diff --git a/src/3rdparty/libtiff/libtiff/tif_unix.c b/src/3rdparty/libtiff/libtiff/tif_unix.c
index 28de5c9..b60a0e1 100644
--- a/src/3rdparty/libtiff/libtiff/tif_unix.c
+++ b/src/3rdparty/libtiff/libtiff/tif_unix.c
@@ -35,7 +35,12 @@
#endif
#include <stdarg.h>
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#else
#include <stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
@@ -181,7 +186,7 @@ TIFFOpen(const char* name, const char* mode)
return tif;
}
-#ifdef __WIN32__
+#if defined (__WIN32__) && !defined(__SYMBIAN32__)
#include <windows.h>
/*
* Open a TIFF file with a Unicode filename, for read/writing.
diff --git a/src/3rdparty/libtiff/libtiff/tiffio.h b/src/3rdparty/libtiff/libtiff/tiffio.h
index 7aaf561..96223d7 100644
--- a/src/3rdparty/libtiff/libtiff/tiffio.h
+++ b/src/3rdparty/libtiff/libtiff/tiffio.h
@@ -71,6 +71,11 @@ typedef uint32 toff_t; /* file offset */
#define __WIN32__
#endif
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
+
/*
* On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c
* or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c).
diff --git a/src/3rdparty/phonon/phonon/abstractmediastream.cpp b/src/3rdparty/phonon/phonon/abstractmediastream.cpp
index a661702..5b860f3 100644
--- a/src/3rdparty/phonon/phonon/abstractmediastream.cpp
+++ b/src/3rdparty/phonon/phonon/abstractmediastream.cpp
@@ -49,7 +49,6 @@ AbstractMediaStream::AbstractMediaStream(AbstractMediaStreamPrivate &dd, QObject
AbstractMediaStream::~AbstractMediaStream()
{
- delete d_ptr;
}
qint64 AbstractMediaStream::streamSize() const
diff --git a/src/3rdparty/phonon/phonon/abstractmediastream.h b/src/3rdparty/phonon/phonon/abstractmediastream.h
index 0daa92a..c4cde85 100644
--- a/src/3rdparty/phonon/phonon/abstractmediastream.h
+++ b/src/3rdparty/phonon/phonon/abstractmediastream.h
@@ -214,7 +214,7 @@ class PHONON_EXPORT AbstractMediaStream : public QObject
virtual void seekStream(qint64 offset);
AbstractMediaStream(AbstractMediaStreamPrivate &dd, QObject *parent);
- AbstractMediaStreamPrivate *d_ptr;
+ QScopedPointer<AbstractMediaStreamPrivate> d_ptr;
};
} // namespace Phonon
diff --git a/src/3rdparty/phonon/phonon/abstractmediastream_p.h b/src/3rdparty/phonon/phonon/abstractmediastream_p.h
index a9d6489..0e87c4d 100644
--- a/src/3rdparty/phonon/phonon/abstractmediastream_p.h
+++ b/src/3rdparty/phonon/phonon/abstractmediastream_p.h
@@ -45,6 +45,7 @@ class PHONON_EXPORT AbstractMediaStreamPrivate : private MediaNodeDestructionHan
public:
void setStreamInterface(StreamInterface *);
void setMediaObjectPrivate(MediaObjectPrivate *);
+ ~AbstractMediaStreamPrivate();
protected:
AbstractMediaStreamPrivate()
@@ -56,7 +57,6 @@ class PHONON_EXPORT AbstractMediaStreamPrivate : private MediaNodeDestructionHan
errorType(NoError)
{
}
- ~AbstractMediaStreamPrivate();
virtual void setStreamSize(qint64 newSize);
virtual void setStreamSeekable(bool s);
diff --git a/src/3rdparty/zlib/zutil.h b/src/3rdparty/zlib/zutil.h
index b7d5eff..3ecb1bb 100644
--- a/src/3rdparty/zlib/zutil.h
+++ b/src/3rdparty/zlib/zutil.h
@@ -21,7 +21,12 @@
# include <stddef.h>
# endif
# include <string.h>
-# include <stdlib.h>
+// Bug in stdlib.h, see more information from fixed_stdlib.h
+#if (defined __SYMBIAN32__ && !defined __cplusplus)
+#include <fixed_stdlib.h>
+#else
+#include <stdlib.h>
+#endif // defined __SYMBIAN32__ && !defined __cplusplus
#endif
#ifdef NO_ERRNO_H
# ifdef _WIN32_WCE
diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri
index 20b9227..de4de1f 100644
--- a/src/corelib/arch/arch.pri
+++ b/src/corelib/arch/arch.pri
@@ -4,7 +4,10 @@ win32:HEADERS += arch/qatomic_windows.h \
mac:HEADERS += arch/qatomic_macosx.h \
arch/qatomic_generic.h
-!wince*:!win32:!mac:HEADERS += arch/qatomic_alpha.h \
+symbian:HEADERS += arch/qatomic_symbian.h \
+ arch/qatomic_generic.h
+
+!wince*:!win32:!mac:!symbian:HEADERS += arch/qatomic_alpha.h \
arch/qatomic_avr32.h \
arch/qatomic_ia64.h \
arch/qatomic_parisc.h \
diff --git a/src/corelib/arch/generic/qatomic_generic_unix.cpp b/src/corelib/arch/generic/qatomic_generic_unix.cpp
index 15918be..876042f 100644
--- a/src/corelib/arch/generic/qatomic_generic_unix.cpp
+++ b/src/corelib/arch/generic/qatomic_generic_unix.cpp
@@ -39,10 +39,13 @@
**
****************************************************************************/
+#if !defined(Q_OS_SYMBIAN) || (defined(Q_OS_SYMBIAN) && !defined(Q_CC_RVCT))
+
#include "qplatformdefs.h"
#include <QtCore/qatomic.h>
+QT_BEGIN_NAMESPACE
static pthread_mutex_t qAtomicMutex = PTHREAD_MUTEX_INITIALIZER;
Q_CORE_EXPORT
@@ -116,3 +119,5 @@ void *QBasicAtomicPointer_fetchAndAddOrdered(void * volatile *_q_value, qptrdiff
pthread_mutex_unlock(&qAtomicMutex);
return returnValue;
}
+QT_END_NAMESPACE
+#endif //!defined(Q_OS_SYMBIAN) && !defined(Q_CC_RVCT)
diff --git a/src/corelib/arch/qatomic_arch.h b/src/corelib/arch/qatomic_arch.h
index 33641fc..7889147 100644
--- a/src/corelib/arch/qatomic_arch.h
+++ b/src/corelib/arch/qatomic_arch.h
@@ -80,6 +80,8 @@ QT_BEGIN_HEADER
# include "QtCore/qatomic_windowsce.h"
#elif defined(QT_ARCH_X86_64)
# include "QtCore/qatomic_x86_64.h"
+#elif defined(QT_ARCH_SYMBIAN)
+# include "QtCore/qatomic_symbian.h"
#elif defined(QT_ARCH_SH)
# include "QtCore/qatomic_sh.h"
#elif defined(QT_ARCH_SH4A)
diff --git a/src/corelib/arch/qatomic_arm.h b/src/corelib/arch/qatomic_arm.h
index 07ad70c..c025637 100644
--- a/src/corelib/arch/qatomic_arm.h
+++ b/src/corelib/arch/qatomic_arm.h
@@ -116,6 +116,12 @@ extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(void *oldval, void *newval
extern Q_CORE_EXPORT char q_atomic_lock;
Q_CORE_EXPORT void qt_atomic_yield(int *);
+#ifdef Q_CC_RVCT
+
+Q_CORE_EXPORT __asm char q_atomic_swp(volatile char *ptr, char newval);
+
+#else
+
inline char q_atomic_swp(volatile char *ptr, char newval)
{
register char ret;
@@ -126,7 +132,9 @@ inline char q_atomic_swp(volatile char *ptr, char newval)
return ret;
}
-#endif
+#endif // Q_CC_RVCT
+
+#endif // QT_NO_ARM_EABI
// Reference counting
@@ -213,6 +221,8 @@ inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue)
// Fetch and store for integers
+#ifndef Q_CC_RVCT
+
inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
{
int originalValue;
@@ -223,6 +233,8 @@ inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
return originalValue;
}
+#endif
+
inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue)
{
return fetchAndStoreOrdered(newValue);
@@ -323,6 +335,22 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValu
// Fetch and store for pointers
+#ifdef Q_CC_RVCT
+
+template <typename T>
+__asm T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
+{
+ add r2, pc, #0
+ bx r2
+ arm
+ swp r2,r1,[r0]
+ mov r0, r2
+ bx lr
+ thumb
+}
+
+#else
+
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
{
@@ -334,6 +362,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
return originalValue;
}
+#endif // Q_CC_RVCT
+
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
{
diff --git a/src/corelib/arch/qatomic_symbian.h b/src/corelib/arch/qatomic_symbian.h
new file mode 100644
index 0000000..9b8b341
--- /dev/null
+++ b/src/corelib/arch/qatomic_symbian.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QATOMIC_SYMBIAN_H
+#define QATOMIC_SYMBIAN_H
+
+QT_BEGIN_HEADER
+
+#if defined(Q_CC_RVCT)
+# define QT_NO_ARM_EABI
+# include <QtCore/qatomic_arm.h>
+#elif defined(Q_CC_NOKIAX86) || defined(Q_CC_GCCE)
+# include <QtCore/qatomic_generic.h>
+#endif
+
+QT_END_HEADER
+
+#endif // QATOMIC_SYMBIAN_H
diff --git a/src/corelib/arch/qatomic_windows.h b/src/corelib/arch/qatomic_windows.h
index 5135575..a1a5a7d 100644
--- a/src/corelib/arch/qatomic_windows.h
+++ b/src/corelib/arch/qatomic_windows.h
@@ -107,7 +107,7 @@ template <typename T>
Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
{ return true; }
-#if defined(Q_CC_MSVC)
+#if defined(Q_CC_MSVC) || defined(Q_CC_MWERKS)
// MSVC++ 6.0 doesn't generate correct code when optimizations are turned on!
#if _MSC_VER < 1300 && defined (_M_IX86)
@@ -218,7 +218,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueTo
#else
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_CC_MWERKS)
// use compiler intrinsics for all atomic functions
//those functions need to be define in the global namespace
QT_END_NAMESPACE
@@ -319,7 +319,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueTo
#else // Q_OS_WINCE
-#if _WIN32_WCE < 0x600 && defined(_X86_)
+#if (_WIN32_WCE < 0x600 && defined(_X86_)) || defined(Q_CC_MWERKS)
// For X86 Windows CE build we need to include winbase.h to be able
// to catch the inline functions which overwrite the regular
// definitions inside of coredll.dll. Though one could use the
@@ -327,8 +327,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueTo
// exported at all.
#include <winbase.h>
#else
-
-#if _WIN32_WCE >= 0x600
+#if _WIN32_WCE >= 0x600 || defined(Q_CC_MWERKS)
#define Q_ARGUMENT_TYPE volatile
# if defined(_X86_)
# define InterlockedIncrement _InterlockedIncrement
diff --git a/src/corelib/arch/symbian/arch.pri b/src/corelib/arch/symbian/arch.pri
new file mode 100644
index 0000000..deb94b1
--- /dev/null
+++ b/src/corelib/arch/symbian/arch.pri
@@ -0,0 +1,5 @@
+#
+# Symbian architecture
+#
+SOURCES += $$QT_ARCH_CPP/qatomic_symbian.cpp \
+ $$QT_ARCH_CPP/../generic/qatomic_generic_unix.cpp
diff --git a/src/corelib/arch/symbian/qatomic_symbian.cpp b/src/corelib/arch/symbian/qatomic_symbian.cpp
new file mode 100644
index 0000000..170b737
--- /dev/null
+++ b/src/corelib/arch/symbian/qatomic_symbian.cpp
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qatomic.h>
+
+#if defined(Q_CC_RVCT)
+
+#include "../arm/qatomic_arm.cpp"
+
+QT_BEGIN_NAMESPACE
+
+// This declspec needs to be explicit. RVCT has a bug which prevents embedded
+// assembler functions from being exported (normally all functions are
+// exported, and Q_CORE_EXPORT resolves to nothing).
+__declspec(dllexport) __asm char q_atomic_swp(volatile char *ptr, char newval)
+{
+ add r2, pc, #0
+ bx r2
+ arm
+ swpb r2,r1,[r0]
+ mov r0, r2
+ bx lr
+ thumb
+}
+
+__declspec(dllexport) __asm int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
+{
+ add r2, pc, #0
+ bx r2
+ arm
+ swp r2,r1,[r0]
+ mov r0, r2
+ bx lr
+ thumb
+}
+
+QT_END_NAMESPACE
+
+#endif // Q_CC_RVCT
+
diff --git a/src/corelib/codecs/qisciicodec.cpp b/src/corelib/codecs/qisciicodec.cpp
index de1e477..f9e3292 100644
--- a/src/corelib/codecs/qisciicodec.cpp
+++ b/src/corelib/codecs/qisciicodec.cpp
@@ -38,7 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
#include "qisciicodec_p.h"
#include "qlist.h"
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 2aec40f..fcf0be1 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -92,6 +92,11 @@
# define QT_NO_SETLOCALE
#endif
+#if 0 // ### TODO - remove me!
+// enabling this is not exception safe!
+#define Q_DEBUG_TEXTCODEC
+#endif
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_TEXTCODECPLUGIN
@@ -165,7 +170,9 @@ static QTextCodec *createForMib(int mib)
}
static QList<QTextCodec*> *all = 0;
+#ifdef Q_DEBUG_TEXTCODEC
static bool destroying_is_ok = false;
+#endif
static QTextCodec *localeMapper = 0;
QTextCodec *QTextCodec::cftr = 0;
@@ -187,15 +194,21 @@ QTextCodecCleanup::~QTextCodecCleanup()
if (!all)
return;
+#ifdef Q_DEBUG_TEXTCODEC
destroying_is_ok = true;
+#endif
- while (all->size())
- delete all->takeFirst();
+ for (QList<QTextCodec *>::const_iterator it = all->constBegin()
+ ; it != all->constEnd(); ++it) {
+ delete *it;
+ }
delete all;
all = 0;
localeMapper = 0;
+#ifdef Q_DEBUG_TEXTCODEC
destroying_is_ok = false;
+#endif
}
Q_GLOBAL_STATIC(QTextCodecCleanup, createQTextCodecCleanup)
@@ -654,8 +667,10 @@ static void setup()
if (all)
return;
+#ifdef Q_DEBUG_TEXTCODEC
if (destroying_is_ok)
qWarning("QTextCodec: Creating new codec during codec cleanup");
+#endif
all = new QList<QTextCodec*>;
// create the cleanup object to cleanup all codecs on exit
(void) createQTextCodecCleanup();
@@ -910,8 +925,10 @@ QTextCodec::QTextCodec()
*/
QTextCodec::~QTextCodec()
{
+#ifdef Q_DEBUG_TEXTCODEC
if (!destroying_is_ok)
qWarning("QTextCodec::~QTextCodec: Called by application");
+#endif
if (all)
all->removeAll(this);
}
diff --git a/src/corelib/concurrent/qtconcurrentiteratekernel.cpp b/src/corelib/concurrent/qtconcurrentiteratekernel.cpp
index 5c20146..bfc0e82 100644
--- a/src/corelib/concurrent/qtconcurrentiteratekernel.cpp
+++ b/src/corelib/concurrent/qtconcurrentiteratekernel.cpp
@@ -108,11 +108,17 @@ static qint64 getticks()
return 0;
return (ts.tv_sec * 1000000000) + ts.tv_nsec;
#else
+
+#ifdef Q_OS_SYMBIAN
+ return clock();
+#else
// no clock_gettime(), fall back to wall time
struct timeval tv;
gettimeofday(&tv, 0);
return (tv.tv_sec * 1000000) + tv.tv_usec;
#endif
+
+#endif
}
#elif defined(Q_OS_WIN)
diff --git a/src/corelib/concurrent/qtconcurrentiteratekernel.h b/src/corelib/concurrent/qtconcurrentiteratekernel.h
index 01c54a7..5cf4ebe 100644
--- a/src/corelib/concurrent/qtconcurrentiteratekernel.h
+++ b/src/corelib/concurrent/qtconcurrentiteratekernel.h
@@ -49,8 +49,10 @@
#include <QtCore/qatomic.h>
#include <QtCore/qtconcurrentmedian.h>
#include <QtCore/qtconcurrentthreadengine.h>
-#include <iterator>
+#ifndef QT_NO_STL
+# include <iterator>
+#endif
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -148,6 +150,7 @@ public:
inline void * getPointer() { return 0; }
};
+#ifndef QT_NO_STL
inline bool selectIteration(std::bidirectional_iterator_tag)
{
return false; // while
@@ -162,6 +165,14 @@ inline bool selectIteration(std::random_access_iterator_tag)
{
return true; // for
}
+#else
+// no stl support, always use while iteration
+template <typename T>
+inline bool selectIteration(T)
+{
+ return false; // while
+}
+#endif
template <typename Iterator, typename T>
class IterateKernel : public ThreadEngine<T>
@@ -170,7 +181,10 @@ public:
typedef T ResultType;
IterateKernel(Iterator _begin, Iterator _end)
-#ifndef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION
+#if defined (QT_NO_STL)
+ : begin(_begin), end(_end), current(_begin), currentIndex(0),
+ forIteration(false), progressReportingEnabled(true)
+#elif !defined(QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION)
: begin(_begin), end(_end), current(_begin), currentIndex(0),
forIteration(selectIteration(typename std::iterator_traits<Iterator>::iterator_category())), progressReportingEnabled(true)
#else
@@ -178,7 +192,12 @@ public:
forIteration(selectIteration(std::iterator_category(_begin))), progressReportingEnabled(true)
#endif
{
+#if defined (QT_NO_STL)
+ iterationCount = 0;
+#else
iterationCount = forIteration ? std::distance(_begin, _end) : 0;
+
+#endif
}
virtual ~IterateKernel() { }
diff --git a/src/corelib/concurrent/qtconcurrentthreadengine.h b/src/corelib/concurrent/qtconcurrentthreadengine.h
index 9e7d12e..444e0db 100644
--- a/src/corelib/concurrent/qtconcurrentthreadengine.h
+++ b/src/corelib/concurrent/qtconcurrentthreadengine.h
@@ -51,6 +51,7 @@
#include <QtCore/qdebug.h>
#include <QtCore/qtconcurrentexception.h>
#include <QtCore/qwaitcondition.h>
+#include <QtCore/qmutex.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/concurrent/qthreadpool.cpp b/src/corelib/concurrent/qthreadpool.cpp
index 30edfd4..8913b56 100644
--- a/src/corelib/concurrent/qthreadpool.cpp
+++ b/src/corelib/concurrent/qthreadpool.cpp
@@ -246,14 +246,14 @@ bool QThreadPoolPrivate::tooManyThreadsActive() const
*/
void QThreadPoolPrivate::startThread(QRunnable *runnable)
{
- QThreadPoolThread *thread = new QThreadPoolThread(this);
- allThreads.insert(thread);
+ QScopedPointer <QThreadPoolThread> thread(new QThreadPoolThread(this));
+ allThreads.insert(thread.data());
++activeThreads;
if (runnable->autoDelete())
++runnable->ref;
thread->runnable = runnable;
- thread->start();
+ thread.take()->start();
}
/*! \internal
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index db51d43..96e2b5c 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -28,3 +28,11 @@ QMAKE_LIBS += $$QMAKE_LIBS_CORE
QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtCore.dynlist
contains(DEFINES,QT_EVAL):include(eval.pri)
+
+symbian: {
+ TARGET.UID3=0x2001B2DC
+
+ # Workaroud for problems with paging this dll
+ MMP_RULES -= PAGED
+ MMP_RULES *= UNPAGED
+} \ No newline at end of file
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 763935e..6976c00 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -44,6 +44,8 @@
#include "qvector.h"
#include "qlist.h"
#include "qthreadstorage.h"
+#include "qdir.h"
+#include "qstringlist.h"
#ifndef QT_NO_QOBJECT
#include <private/qthread_p.h>
@@ -62,10 +64,15 @@
# endif
#endif
-#ifdef Q_CC_MWERKS
+#if defined(Q_CC_MWERKS) && defined(Q_OS_MACX)
#include <CoreServices/CoreServices.h>
#endif
+#if defined(Q_OS_SYMBIAN)
+#include <e32def.h>
+#include <e32debug.h>
+#endif
+
QT_BEGIN_NAMESPACE
@@ -1049,6 +1056,20 @@ bool qSharedBuild()
*/
/*!
+ \fn QSysInfo::SymVersion QSysInfo::symbianVersion()
+
+ Returns the version of the Symbian operating system on which the
+ application is run (Symbian only).
+*/
+
+/*!
+ \fn QSysInfo::S60Version QSysInfo::s60Version()
+
+ Returns the version of the S60 SDK system on which the
+ application is run (S60 only).
+*/
+
+/*!
\enum QSysInfo::Endian
\value BigEndian Big-endian byte order (also called Network byte order)
@@ -1104,7 +1125,7 @@ bool qSharedBuild()
\value WV_NT_based NT-based version of Windows
\value WV_CE_based CE-based version of Windows
- \sa MacVersion
+ \sa MacVersion, SymVersion
*/
/*!
@@ -1133,7 +1154,39 @@ bool qSharedBuild()
\value MV_LEOPARD Apple codename for MV_10_5
\value MV_SNOWLEOPARD Apple codename for MV_10_6
- \sa WinVersion
+ \sa WinVersion, SymVersion
+*/
+
+/*!
+ \enum QSysInfo::SymVersion
+
+ This enum provides symbolic names for the various versions of the
+ Symbian operating system. On Symbian, the
+ QSysInfo::symbianVersion() function gives the version of the
+ system on which the application is run.
+
+ \value SV_9_2 Symbian OS 9.2
+ \value SV_9_3 Symbian OS 9.3
+ \value SV_9_4 Symbian OS 9.4
+ \value SV_Unknown An unknown and currently unsupported platform
+
+ \sa S60Version, WinVersion, MacVersion
+*/
+
+/*!
+ \enum QSysInfo::S60Version
+
+ This enum provides symbolic names for the various versions of the
+ S60 SDK. On S60, the
+ QSysInfo::s60Version() function gives the version of the
+ SDK on which the application is run.
+
+ \value SV_S60_3_1 S60 3rd Edition Feature Pack 1
+ \value SV_S60_3_2 S60 3rd Edition Feature Pack 2
+ \value SV_S60_5_0 S60 5th Edition
+ \value SV_S60_Unknown An unknown and currently unsupported platform
+
+ \sa SymVersion, WinVersion, MacVersion
*/
/*!
@@ -1711,6 +1764,79 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion()
#endif
+#ifdef Q_OS_SYMBIAN
+# ifdef Q_WS_S60
+static QSysInfo::S60Version cachedS60Version = QSysInfo::S60Version(-1);
+
+QSysInfo::S60Version QSysInfo::s60Version()
+{
+# ifdef Q_CC_NOKIAX86
+ // For emulator builds. Emulators don't support the trick we use to figure
+ // out which SDK we are running under, so simply hardcode it there.
+# if defined(__SERIES60_31__)
+ return SV_S60_3_1;
+
+# elif defined(__S60_32__)
+ return SV_S60_3_2;
+
+# elif defined(__S60_50__)
+ return SV_S60_5_0;
+
+# else
+ return SV_S60_Unknown;
+
+# endif
+
+# else
+ // For hardware builds.
+ if (cachedS60Version != -1)
+ return cachedS60Version;
+
+ QDir dir(QLatin1String("z:\\system\\install"));
+ QStringList filters;
+ filters << QLatin1String("Series60v?.*.sis");
+ dir.setNameFilters(filters);
+
+ QStringList names = dir.entryList(QDir::NoFilter, QDir::Name | QDir::Reversed | QDir::IgnoreCase);
+ if (names.size() == 0)
+ return cachedS60Version = SV_S60_Unknown;
+
+ int major, minor;
+ major = names[0][9].toAscii() - '0';
+ minor = names[0][11].toAscii() - '0';
+ if (major == 3) {
+ if (minor == 1) {
+ return cachedS60Version = SV_S60_3_1;
+ } else if (minor == 2) {
+ return cachedS60Version = SV_S60_3_2;
+ }
+ } else if (major == 5) {
+ if (minor == 0) {
+ return cachedS60Version = SV_S60_5_0;
+ }
+ }
+
+ return cachedS60Version = SV_S60_Unknown;
+# endif
+}
+# else
+# error Qt does not support non-S60 Symbian versions yet.
+# endif // ifdef Q_WS_S60
+QSysInfo::SymVersion QSysInfo::symbianVersion()
+{
+ switch (s60Version()) {
+ case SV_S60_3_1:
+ return SV_9_2;
+ case SV_S60_3_2:
+ return SV_9_3;
+ case SV_S60_5_0:
+ return SV_9_4;
+ default:
+ return SV_Unknown;
+ }
+}
+#endif // ifdef Q_OS_SYMBIAN
+
/*!
\macro void Q_ASSERT(bool test)
\relates <QtGlobal>
@@ -1803,6 +1929,17 @@ void qt_check_pointer(const char *n, int l)
qWarning("In file %s, line %d: Out of memory", n, l);
}
+#ifndef QT_NO_EXCEPTIONS
+/* \internal
+ Allows you to throw an exception without including <new>
+ Called internally from Q_CHECK_PTR on certain OS combinations
+*/
+void qBadAlloc()
+{
+ QT_THROW(std::bad_alloc());
+}
+#endif
+
/*
The Q_ASSERT macro calls this function when the test fails.
*/
@@ -1860,7 +1997,7 @@ void *qMemSet(void *dest, int c, size_t n) { return memset(dest, c, n); }
static QtMsgHandler handler = 0; // pointer to debug handler
-#ifdef Q_CC_MWERKS
+#if defined(Q_CC_MWERKS) && defined(Q_OS_MACX)
extern bool qt_is_gui_used;
static void mac_default_handler(const char *msg)
{
@@ -1872,7 +2009,7 @@ static void mac_default_handler(const char *msg)
fprintf(stderr, msg);
}
}
-#endif // Q_CC_MWERKS
+#endif // Q_CC_MWERKS && Q_OS_MACX
@@ -2006,12 +2143,23 @@ void qt_message_output(QtMsgType msgType, const char *buf)
if (handler) {
(*handler)(msgType, buf);
} else {
-#if defined(Q_CC_MWERKS)
+#if defined(Q_CC_MWERKS) && defined(Q_OS_MACX)
mac_default_handler(buf);
#elif defined(Q_OS_WINCE)
QString fstr = QString::fromLatin1(buf);
fstr += QLatin1Char('\n');
OutputDebugString(reinterpret_cast<const wchar_t *> (fstr.utf16()));
+#elif defined(Q_OS_SYMBIAN)
+ // RDebug::Print has a cap of 256 characters so break it up
+ _LIT(format, "[Qt Message] %S");
+ const int maxBlockSize = 256 - ((const TDesC &)format).Length();
+ const TPtrC8 ptr(reinterpret_cast<const TUint8*>(buf));
+ HBufC* hbuffer = HBufC::NewL(qMin(maxBlockSize, ptr.Length()));
+ for (int i = 0; i < ptr.Length(); i += hbuffer->Length()) {
+ hbuffer->Des().Copy(ptr.Mid(i, qMin(maxBlockSize, ptr.Length()-i)));
+ RDebug::Print(format, hbuffer);
+ }
+ delete hbuffer;
#else
fprintf(stderr, "%s\n", buf);
fflush(stderr);
@@ -2038,7 +2186,14 @@ void qt_message_output(QtMsgType msgType, const char *buf)
_CrtDbgBreak();
#endif
-#if (defined(Q_OS_UNIX) || defined(Q_CC_MINGW))
+#if defined(Q_OS_SYMBIAN)
+ __DEBUGGER(); // on the emulator, get the debugger to kick in if there's one around
+ TBuf<256> tmp;
+ TPtrC8 ptr(reinterpret_cast<const TUint8*>(buf));
+ TInt len = Min(tmp.MaxLength(), ptr.Length());
+ tmp.Copy(ptr.Left(len));
+ User::Panic(tmp, 0); // Panic the current thread
+#elif (defined(Q_OS_UNIX) || defined(Q_CC_MINGW))
abort(); // trap; generates core dump
#else
exit(1); // goodbye cruel world
@@ -2046,6 +2201,48 @@ void qt_message_output(QtMsgType msgType, const char *buf)
}
}
+#if !defined(QT_NO_EXCEPTIONS)
+/*!
+ \internal
+ Uses a local buffer to output the message. Not locale safe + cuts off
+ everything after character 1023, but will work in out of memory situations.
+*/
+static void qEmergencyOut(QtMsgType msgType, const char *msg, va_list ap)
+{
+ char emergency_buf[256] = { '\0' };
+ emergency_buf[255] = '\0';
+ if (msg)
+ qvsnprintf(emergency_buf, 255, msg, ap);
+ qt_message_output(msgType, emergency_buf);
+}
+#endif
+
+/*!
+ \internal
+*/
+static void qt_message(QtMsgType msgType, const char *msg, va_list ap)
+{
+#if !defined(QT_NO_EXCEPTIONS)
+ if (std::uncaught_exception()) {
+ qEmergencyOut(msgType, msg, ap);
+ return;
+ }
+#endif
+ QByteArray buf;
+ if (msg) {
+ QT_TRY {
+ buf = QString().vsprintf(msg, ap).toLocal8Bit();
+ } QT_CATCH(const std::bad_alloc &) {
+#if !defined(QT_NO_EXCEPTIONS)
+ qEmergencyOut(msgType, msg, ap);
+ // don't rethrow - we use qWarning and friends in destructors.
+ return;
+#endif
+ }
+ }
+ qt_message_output(msgType, buf.constData());
+}
+
#undef qDebug
/*!
\relates <QtGlobal>
@@ -2083,14 +2280,10 @@ void qt_message_output(QtMsgType msgType, const char *buf)
*/
void qDebug(const char *msg, ...)
{
- QString buf;
va_list ap;
- va_start(ap, msg); // use variable arg list
- if (msg)
- buf.vsprintf(msg, ap);
+ va_start(ap, msg); // use variable arg list
+ qt_message(QtDebugMsg, msg, ap);
va_end(ap);
-
- qt_message_output(QtDebugMsg, buf.toLocal8Bit().constData());
}
#undef qWarning
@@ -2127,14 +2320,10 @@ void qDebug(const char *msg, ...)
*/
void qWarning(const char *msg, ...)
{
- QString buf;
va_list ap;
va_start(ap, msg); // use variable arg list
- if (msg)
- buf.vsprintf(msg, ap);
+ qt_message(QtWarningMsg, msg, ap);
va_end(ap);
-
- qt_message_output(QtWarningMsg, buf.toLocal8Bit().constData());
}
/*!
@@ -2167,15 +2356,12 @@ void qWarning(const char *msg, ...)
*/
void qCritical(const char *msg, ...)
{
- QString buf;
va_list ap;
va_start(ap, msg); // use variable arg list
- if (msg)
- buf.vsprintf(msg, ap);
+ qt_message(QtCriticalMsg, msg, ap);
va_end(ap);
-
- qt_message_output(QtCriticalMsg, buf.toLocal8Bit().constData());
}
+
#ifdef QT3_SUPPORT
void qSystemWarning(const char *msg, int code)
{ qCritical("%s (%s)", msg, qt_error_string(code).toLocal8Bit().constData()); }
@@ -2183,6 +2369,8 @@ void qSystemWarning(const char *msg, int code)
void qErrnoWarning(const char *msg, ...)
{
+ // qt_error_string() will allocate anyway, so we don't have
+ // to be careful here (like we do in plain qWarning())
QString buf;
va_list ap;
va_start(ap, msg);
@@ -2195,6 +2383,8 @@ void qErrnoWarning(const char *msg, ...)
void qErrnoWarning(int code, const char *msg, ...)
{
+ // qt_error_string() will allocate anyway, so we don't have
+ // to be careful here (like we do in plain qWarning())
QString buf;
va_list ap;
va_start(ap, msg);
@@ -2231,14 +2421,10 @@ void qErrnoWarning(int code, const char *msg, ...)
*/
void qFatal(const char *msg, ...)
{
- QString buf;
va_list ap;
va_start(ap, msg); // use variable arg list
- if (msg)
- buf.vsprintf(msg, ap);
+ qt_message(QtFatalMsg, msg, ap);
va_end(ap);
-
- qt_message_output(QtFatalMsg, buf.toLocal8Bit().constData());
}
// getenv is declared as deprecated in VS2005. This function
@@ -2307,7 +2493,7 @@ Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value
*/
void qsrand(uint seed)
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN)
SeedStorageType *pseed = randTLS()->localData();
if (!pseed)
randTLS()->setLocalData(pseed = new SeedStorageType);
@@ -2336,7 +2522,7 @@ void qsrand(uint seed)
*/
int qrand()
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN)
SeedStorageType *pseed = randTLS()->localData();
if (!pseed) {
randTLS()->setLocalData(pseed = new SeedStorageType);
@@ -3031,4 +3217,176 @@ bool QInternal::callFunction(InternalFunction func, void **args)
\sa Q_DECL_EXPORT
*/
+#if defined(Q_OS_SYMBIAN)
+
+#include <typeinfo>
+
+/*! \macro QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(function)
+ \relates <QtGlobal>
+ \ingroup qts60
+
+ TRAP leaves from Symbian \a function and throws an appropriate
+ standard C++ exception instead.
+ This must be used when calling Symbian OS leaving functions
+ from inside Qt or standard C++ code, so that the code can respond
+ correctly to the exception.
+
+ \warning This macro is only available on Symbian.
+
+ Example:
+
+ \code
+ // A Symbian leaving function is being called within a Qt function.
+ // Any leave must be converted to an exception
+ CAknTitlePane* titlePane = S60->titlePane();
+ if (titlePane) {
+ TPtrC captionPtr(qt_QString2TPtrC(caption));
+ QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(titlePane->SetTextL(captionPtr));
+ }
+ \endcode
+
+ \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE()
+*/
+
+/*! \macro QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(error, function)
+ \relates <QtGlobal>
+ \ingroup qts60
+
+ Catch standard C++ exceptions from a \a function and convert them to a Symbian OS
+ \a error code, or \c KErrNone if there is no exception.
+ This must be used inside Qt or standard C++ code when using exception throwing
+ code (practically anything) and returning an error code to Symbian OS.
+
+ \warning This macro is only available on Symbian.
+
+ Example:
+
+ \code
+ // An exception might be thrown in this Symbian TInt error returning function.
+ // It is caught and translated to an error code
+ TInt QServerApp::Connect(const QString &serverName)
+ {
+ TPtrC name;
+ TInt err;
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, name.Set(qt_QString2TPtrC(serverName)));
+ if (err != KErrNone)
+ return err;
+ return iServer.Connect(name);
+ }
+ \endcode
+}
+
+ \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(), QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION()
+*/
+
+/*! \macro QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(function)
+ \relates <QtGlobal>
+ \ingroup qts60
+
+ Catch standard C++ exceptions from \a function and convert them to Symbian OS
+ leaves. This must be used inside Qt or standard C++ code when using exception
+ throwing code (practically anything) and returning to Symbian OS from a leaving function.
+ For example inside a Symbian active object's \c RunL function implemented with Qt code.
+
+ \warning This macro is only available on Symbian.
+
+ Example:
+
+ \code
+ // This active object signals Qt code
+ // Exceptions from the Qt code must be converted to Symbian OS leaves for the active scheduler
+ void QWakeUpActiveObject::RunL()
+ {
+ iStatus = KRequestPending;
+ SetActive();
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->wakeUpWasCalled());
+ }
+ \endcode
+
+ \sa QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR()
+*/
+
+#include <stdexcept>
+
+class QSymbianLeaveException : public std::exception
+{
+public:
+ inline QSymbianLeaveException(int err) : error(err) {}
+ inline const char* what() const throw() { return "Symbian leave exception"; }
+
+public:
+ int error;
+};
+
+/*! \relates <QtGlobal>
+ \ingroup qts60
+
+ Throws an exception if the \a error parameter is a symbian error code.
+ This is the exception throwing equivalent of Symbian's User::LeaveIfError.
+
+ \warning This function is only available on Symbian.
+
+ \sa qt_translateExceptionToSymbianErrorL(), qt_translateExceptionToSymbianError()
+*/
+void qt_translateSymbianErrorToException(int error)
+{
+ if (error >= KErrNone)
+ return; // do nothing - not an exception
+ switch (error) {
+ case KErrNoMemory:
+ throw std::bad_alloc();
+ default:
+ throw QSymbianLeaveException(error);
+ }
+}
+
+/*! \relates <QtGlobal>
+ \ingroup qts60
+
+ Convert a caught standard C++ exception \a aThrow to a Symbian leave
+
+ \warning This function is only available on Symbian.
+
+ \sa qt_translateSymbianErrorToException(), qt_translateExceptionToSymbianError()
+*/
+void qt_translateExceptionToSymbianErrorL(const std::exception& aThrow)
+{
+ User::Leave(qt_translateExceptionToSymbianError(aThrow));
+}
+
+/*! \relates <QtGlobal>
+ \ingroup qts60
+
+ Convert a caught standard C++ exception \a aThrow to a Symbian error code
+
+ \warning This function is only available on Symbian.
+
+ \sa qt_translateSymbianErrorToException(), qt_translateExceptionToSymbianErrorL()
+*/
+int qt_translateExceptionToSymbianError(const std::exception& aThrow)
+{
+ const std::type_info& atype = typeid(aThrow);
+ int err = KErrGeneral;
+
+ if(atype == typeid (std::bad_alloc))
+ err = KErrNoMemory;
+ else if(atype == typeid(QSymbianLeaveException))
+ err = static_cast<const QSymbianLeaveException&>(aThrow).error;
+ else if(atype == typeid(std::invalid_argument))
+ err = KErrArgument;
+ else if(atype == typeid(std::out_of_range))
+ // std::out_of_range is of type logic_error which by definition means that it is
+ // "presumably detectable before the program executes".
+ // std::out_of_range is used to report an argument is not within the expected range.
+ // The description of KErrArgument says an argument is out of range. Hence the mapping.
+ err = KErrArgument;
+ else if(atype == typeid(std::overflow_error))
+ err = KErrOverflow;
+ else if(atype == typeid(std::underflow_error))
+ err = KErrUnderflow;
+
+ return err;
+}
+#endif
+
QT_END_NAMESPACE
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index a10b6d6..c95338d 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -144,6 +144,7 @@ namespace QT_NAMESPACE {}
The operating system, must be one of: (Q_OS_x)
DARWIN - Darwin OS (synonym for Q_OS_MAC)
+ SYMBIAN - Symbian
MSDOS - MS-DOS and Windows
OS2 - OS/2
OS2EMX - XFree86 on OS/2 (not PM)
@@ -182,6 +183,11 @@ namespace QT_NAMESPACE {}
# else
# define Q_OS_DARWIN32
# endif
+#elif defined(__SYMBIAN32__) || defined(SYMBIAN)
+# define Q_OS_SYMBIAN
+# define Q_NO_POSIX_SIGNALS
+// TODO: should this be in qconfig.h
+# define QT_NO_GETIFADDRS
#elif defined(__CYGWIN__)
# define Q_OS_CYGWIN
#elif defined(MSDOS) || defined(_MSDOS)
@@ -351,7 +357,9 @@ namespace QT_NAMESPACE {}
HIGHC - MetaWare High C/C++
PGI - Portland Group C++
GHS - Green Hills Optimizing C++ Compilers
+ GCCE - GCCE (Symbian GCCE builds)
RVCT - ARM Realview Compiler Suite
+ NOKIAX86 - Nokia x86 (Symbian WINSCW builds)
Should be sorted most to least authoritative.
@@ -372,6 +380,9 @@ namespace QT_NAMESPACE {}
#elif defined(__MWERKS__)
# define Q_CC_MWERKS
+# if defined(__EMU_SYMBIAN_OS__)
+# define Q_CC_NOKIAX86
+# endif
/* "explicit" recognized since 4.0d1 */
#elif defined(_MSC_VER)
@@ -442,7 +453,15 @@ namespace QT_NAMESPACE {}
# define QT_NO_QWS_CURSOR
# endif
-#elif defined(__CC_ARM)
+/* Symbian GCCE */
+#elif defined(__GCCE__)
+# define Q_CC_GCCE
+# define QT_VISIBILITY_AVAILABLE
+
+/* ARM Realview Compiler Suite
+ RVCT compiler also defines __EDG__ and __GNUC__ (if --gnu flag is given),
+ so check for it before that */
+#elif defined(__ARMCC__) || defined(__CC_ARM)
# define Q_CC_RVCT
#elif defined(__GNUC__)
@@ -684,6 +703,11 @@ namespace QT_NAMESPACE {}
# endif
# define Q_NO_USING_KEYWORD /* ### check "using" status */
+#elif defined(__WINSCW__) && !defined(Q_CC_NOKIAX86)
+# define Q_CC_NOKIAX86
+// # define Q_CC_MWERKS // May be required
+
+
#else
# error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
#endif
@@ -731,6 +755,7 @@ namespace QT_NAMESPACE {}
QWS - Qt for Embedded Linux
WIN32 - Windows
X11 - X Window System
+ S60 - Symbian S60
PM - unsupported
WIN16 - unsupported
*/
@@ -763,6 +788,8 @@ namespace QT_NAMESPACE {}
# elif defined(Q_OS_MAC32)
# define Q_WS_MAC32
# endif
+# elif defined(Q_OS_SYMBIAN)
+# define Q_WS_S60
# elif !defined(Q_WS_QWS)
# define Q_WS_X11
# endif
@@ -788,7 +815,7 @@ typedef short qint16; /* 16 bit signed */
typedef unsigned short quint16; /* 16 bit unsigned */
typedef int qint32; /* 32 bit signed */
typedef unsigned int quint32; /* 32 bit unsigned */
-#if defined(Q_OS_WIN) && !defined(Q_CC_GNU)
+#if defined(Q_OS_WIN) && !defined(Q_CC_GNU) && !defined(Q_CC_MWERKS)
# define Q_INT64_C(c) c ## i64 /* signed 64 bit constant */
# define Q_UINT64_C(c) c ## ui64 /* unsigned 64 bit constant */
typedef __int64 qint64; /* 64 bit signed */
@@ -806,7 +833,7 @@ typedef quint64 qulonglong;
#ifndef QT_POINTER_SIZE
# if defined(Q_OS_WIN64)
# define QT_POINTER_SIZE 8
-# elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
+# elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
# define QT_POINTER_SIZE 4
# endif
#endif
@@ -853,6 +880,12 @@ QT_END_INCLUDE_NAMESPACE
*/
#ifndef QT_LINUXBASE /* the LSB defines TRUE and FALSE for us */
+/* Symbian OS defines TRUE = 1 and FALSE = 0,
+redefine to built-in booleans to make autotests work properly */
+#ifdef Q_OS_SYMBIAN
+ #undef TRUE
+ #undef FALSE
+#endif
# ifndef TRUE
# define TRUE true
# define FALSE false
@@ -1007,7 +1040,7 @@ typedef int QNoImplicitBoolCast;
// This logic must match the one in qmetatype.h
#if defined(QT_COORD_TYPE)
typedef QT_COORD_TYPE qreal;
-#elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE)
+#elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
typedef float qreal;
#else
typedef double qreal;
@@ -1023,8 +1056,13 @@ inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
inline int qRound(qreal d)
{ return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); }
+#if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
+inline qint64 qRound64(double d)
+{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); }
+#else
inline qint64 qRound64(qreal d)
{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); }
+#endif
template <typename T>
inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; }
@@ -1086,6 +1124,8 @@ class QDataStream;
#ifndef Q_DECL_EXPORT
# ifdef Q_OS_WIN
# define Q_DECL_EXPORT __declspec(dllexport)
+# elif defined(Q_CC_NOKIAX86)
+# define Q_DECL_EXPORT __declspec(dllexport)
# elif defined(QT_VISIBILITY_AVAILABLE)
# define Q_DECL_EXPORT __attribute__((visibility("default")))
# endif
@@ -1096,6 +1136,8 @@ class QDataStream;
#ifndef Q_DECL_IMPORT
# if defined(Q_OS_WIN)
# define Q_DECL_IMPORT __declspec(dllimport)
+# elif defined(Q_CC_NOKIAX86)
+# define Q_DECL_IMPORT __declspec(dllimport)
# else
# define Q_DECL_IMPORT
# endif
@@ -1105,7 +1147,7 @@ class QDataStream;
Create Qt DLL if QT_DLL is defined (Windows only)
*/
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
# if defined(QT_NODLL)
# undef QT_MAKEDLL
# undef QT_DLL
@@ -1250,16 +1292,42 @@ class QDataStream;
for Trolltech's internal unit tests. If you want slower loading times and more
symbols that can vanish from version to version, feel free to define QT_BUILD_INTERNAL.
*/
-#if defined(QT_BUILD_INTERNAL) && defined(Q_OS_WIN) && defined(QT_MAKEDLL)
+#if defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_MAKEDLL)
# define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
-#elif defined(QT_BUILD_INTERNAL) && defined(Q_OS_WIN) && defined(QT_DLL)
+#elif defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_DLL)
# define Q_AUTOTEST_EXPORT Q_DECL_IMPORT
-#elif defined(QT_BUILD_INTERNAL) && !defined(Q_OS_WIN) && defined(QT_SHARED)
+#elif defined(QT_BUILD_INTERNAL) && !(defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_SHARED)
# define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
#else
# define Q_AUTOTEST_EXPORT
#endif
+inline void qt_noop() {}
+
+/* These wrap try/catch so we can switch off exceptions later.
+
+ Beware - do not use more than one QT_CATCH per QT_TRY, and do not use
+ the exception instance in the catch block.
+ If you can't live with those constraints, don't use these macros.
+ Use the QT_NO_EXCEPTIONS macro to protect your code instead.
+*/
+
+#ifdef QT_BOOTSTRAPPED
+# define QT_NO_EXCEPTIONS
+#endif
+
+#ifdef QT_NO_EXCEPTIONS
+# define QT_TRY if (true)
+# define QT_CATCH(A) else
+# define QT_THROW(A) qt_noop()
+# define QT_RETHROW qt_noop()
+#else
+# define QT_TRY try
+# define QT_CATCH(A) catch (A)
+# define QT_THROW(A) throw A
+# define QT_RETHROW throw
+#endif
+
/*
System information
*/
@@ -1356,6 +1424,24 @@ public:
};
static const MacVersion MacintoshVersion;
#endif
+#ifdef Q_OS_SYMBIAN
+ enum SymVersion {
+ SV_Unknown = 0x0000,
+ SV_9_2 = 0x0001,
+ SV_9_3 = 0x0002,
+ SV_9_4 = 0x0004
+ };
+ static SymVersion symbianVersion();
+# ifdef Q_WS_S60
+ enum S60Version {
+ SV_S60_Unknown = 0x0000,
+ SV_S60_3_1 = 0x0001,
+ SV_S60_3_2 = 0x0002,
+ SV_S60_5_0 = 0x0004
+ };
+ static S60Version s60Version();
+# endif
+#endif
};
Q_CORE_EXPORT const char *qVersion();
@@ -1383,6 +1469,9 @@ inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; }
#ifdef Q_OS_WINCE
#define QT_WA(uni, ansi) uni
#define QT_WA_INLINE(uni, ansi) (uni)
+#elif defined(Q_CC_MWERKS)
+#define QT_WA(uni, ansi) ansi
+#define QT_WA_INLINE(uni, ansi) (ansi)
#elif defined(UNICODE)
#define QT_WA(uni, ansi) if (!(QSysInfo::windowsVersion() & QSysInfo::WV_DOS_based)) { uni } else { ansi }
@@ -1420,6 +1509,10 @@ inline void qUnused(T &x) { (void)x; }
Debugging and error handling
*/
+#if defined(Q_OS_SYMBIAN) && defined(NDEBUG)
+# define QT_NO_DEBUG
+#endif
+
#if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
# define QT_DEBUG
#endif
@@ -1488,8 +1581,6 @@ inline QNoDebug qDebug();
#endif
-inline void qt_noop() {}
-
Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line);
#if !defined(Q_ASSERT)
@@ -1516,10 +1607,18 @@ Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *
Q_CORE_EXPORT void qt_check_pointer(const char *, int);
-#ifndef QT_NO_DEBUG
-# define Q_CHECK_PTR(p) do {if(!(p))qt_check_pointer(__FILE__,__LINE__);} while (0)
+#ifndef QT_NO_EXCEPTIONS
+Q_CORE_EXPORT void qBadAlloc();
+#endif
+
+#ifdef QT_NO_EXCEPTIONS
+# if defined(QT_NO_DEBUG)
+# define Q_CHECK_PTR(p) qt_noop();
+# else
+# define Q_CHECK_PTR(p) do {if(!(p))qt_check_pointer(__FILE__,__LINE__);} while (0)
+# endif
#else
-# define Q_CHECK_PTR(p)
+# define Q_CHECK_PTR(p) do { if (!(p)) qBadAlloc(); } while (0)
#endif
#if (defined(Q_CC_GNU) && !defined(Q_OS_SOLARIS)) || defined(Q_CC_HPACC)
@@ -1532,7 +1631,7 @@ Q_CORE_EXPORT void qt_check_pointer(const char *, int);
# define Q_FUNC_INFO __FUNCSIG__
# endif
#else
-# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC)
+# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) || defined(Q_OS_SYMBIAN)
# define Q_FUNC_INFO __FILE__ "(line number unavailable)"
# else
/* These two macros makes it possible to turn the builtin line expander into a
@@ -1541,9 +1640,9 @@ Q_CORE_EXPORT void qt_check_pointer(const char *, int);
# define QT_STRINGIFY(x) QT_STRINGIFY2(x)
# define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__)
# endif
- /* The MIPSpro compiler postpones macro expansion, and therefore macros must be in scope
- * when being used. */
-# if !defined(Q_CC_MIPS)
+ /* The MIPSpro and RVCT compilers postpones macro expansion,
+ and therefore macros must be in scope when being used. */
+# if !defined(Q_CC_MIPS) && !defined(Q_CC_RVCT) && !defined(Q_CC_NOKIAX86)
# undef QT_STRINGIFY2
# undef QT_STRINGIFY
# endif
@@ -1668,12 +1767,12 @@ public:
static TYPE *NAME() \
{ \
if (!this_##NAME.pointer && !this_##NAME.destroyed) { \
- TYPE *x = new TYPE; \
+ QScopedPointer<TYPE > x(new TYPE); \
INITIALIZER; \
- if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \
- delete x; \
- else \
+ if (this_##NAME.pointer.testAndSetOrdered(0, x.data())) { \
static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \
+ x.take(); \
+ } \
} \
return this_##NAME.pointer; \
}
@@ -1876,7 +1975,7 @@ public: \
types must declare a 'bool isDetached(void) const;' member for this
to work.
*/
-#if defined Q_CC_MSVC && _MSC_VER < 1300
+#if (defined Q_CC_MSVC && _MSC_VER < 1300) || defined(Q_CC_MWERKS)
template <typename T>
inline void qSwap_helper(T &value1, T &value2, T*)
{
@@ -2059,7 +2158,7 @@ typedef uint Flags;
#endif /* Q_NO_TYPESAFE_FLAGS */
-#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL)
+#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT)
/* make use of typeof-extension */
template <typename T>
class QForeachContainer {
@@ -2143,8 +2242,8 @@ inline const QForeachContainer<T> *qForeachContainer(const QForeachContainerBase
#endif
#define Q_DECLARE_PRIVATE(Class) \
- inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(d_ptr); } \
- inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(d_ptr); } \
+ inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(d_ptr.data()); } \
+ inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(d_ptr.data()); } \
friend class Class##Private;
#define Q_DECLARE_PRIVATE_D(Dptr, Class) \
@@ -2192,7 +2291,9 @@ inline const QForeachContainer<T> *qForeachContainer(const QForeachContainerBase
Class(const Class &); \
Class &operator=(const Class &);
#else
-# define Q_DISABLE_COPY(Class)
+# define Q_DISABLE_COPY(Class) \
+ Class(const Class &); \
+ Class &operator=(const Class &);
#endif
class QByteArray;
@@ -2229,6 +2330,44 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathTranslations();
QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
#endif
+#if defined(Q_OS_SYMBIAN)
+QT_END_NAMESPACE
+// forward declare std::exception
+#ifdef __cplusplus
+namespace std { class exception; }
+#endif
+QT_BEGIN_NAMESPACE
+Q_CORE_EXPORT void qt_translateSymbianErrorToException(int error);
+Q_CORE_EXPORT void qt_translateExceptionToSymbianErrorL(const std::exception& ex);
+Q_CORE_EXPORT int qt_translateExceptionToSymbianError(const std::exception& ex);
+
+#define QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(f) \
+ { \
+ TInt error; \
+ TRAP(error, f); \
+ if (error) \
+ qt_translateSymbianErrorToException(error); \
+ }
+
+#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \
+ { \
+ err = KErrNone; \
+ try { \
+ f; \
+ } catch (const std::exception &ex) { \
+ err = qt_translateExceptionToSymbianError(ex); \
+ } \
+ }
+
+#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(f) \
+ { \
+ TInt err; \
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \
+ User::LeaveIfError(err); \
+ }
+#endif
+
+
/*
This gives us the possibility to check which modules the user can
use. These are purely compile time checks and will generate no code.
@@ -2302,6 +2441,9 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
#define QT_LICENSED_MODULE(x) \
enum QtValidLicenseFor##x##Module { Licensed##x = true };
+/* qdoc is really unhappy with the following block of preprocessor checks,
+ making it difficult to document classes properly after this point. */
+
#if (QT_EDITION & QT_MODULE_CORE)
QT_LICENSED_MODULE(Core)
#endif
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 7f6ff20..6eb6c3a 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -40,11 +40,11 @@
****************************************************************************/
#include "qdir.h"
-#include "qfile.h"
+#include "qfile.h"
#include "qconfig.h"
#include "qsettings.h"
#include "qlibraryinfo.h"
-#include "qpointer.h"
+#include "qscopedpointer.h"
#ifdef QT_BUILD_QMAKE
QT_BEGIN_NAMESPACE
@@ -67,8 +67,7 @@ QT_BEGIN_NAMESPACE
struct QLibrarySettings
{
QLibrarySettings();
- ~QLibrarySettings() { delete static_cast<QSettings *>(settings); }
- QSettings *settings;
+ QScopedPointer<QSettings> settings;
};
Q_GLOBAL_STATIC(QLibrarySettings, qt_library_settings)
@@ -79,32 +78,19 @@ public:
static void cleanup()
{
QLibrarySettings *ls = qt_library_settings();
- if (ls) {
- delete static_cast<QSettings *>(ls->settings);
- ls->settings = 0;
- }
+ if (ls)
+ ls->settings.reset(0);
}
static QSettings *configuration()
{
-#ifdef QT_NO_THREAD
- // This recursion guard should be a temporary solution; the recursive
- // dependency should be found and removed.
- static bool initializing = false;
- if (initializing)
- return 0;
- initializing = true;
-#endif
QLibrarySettings *ls = qt_library_settings();
-#ifdef QT_NO_THREAD
- initializing = false;
-#endif
- return ls ? static_cast<QSettings *>(qt_library_settings()->settings) : (QSettings*)0;
+ return ls ? ls->settings.data() : 0;
}
};
QLibrarySettings::QLibrarySettings()
+ : settings(QLibraryInfoPrivate::findConfiguration())
{
- settings = QLibraryInfoPrivate::findConfiguration();
#ifndef QT_BUILD_QMAKE
qAddPostRoutine(QLibraryInfoPrivate::cleanup);
#endif
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 9e53d89..a94d6d0 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -44,6 +44,10 @@
#include <QtCore/qglobal.h>
+#ifdef Q_OS_SYMBIAN
+# include <e32def.h>
+#endif
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -1399,8 +1403,29 @@ public:
ImFont,
ImCursorPosition,
ImSurroundingText,
- ImCurrentSelection
+ ImCurrentSelection,
+ ImMaximumTextLength,
+ ImAnchorPosition
+ };
+
+ enum InputMethodHint {
+ ImhNone = 0x0,
+ ImhHiddenText = 0x1,
+ ImhNoAutoUppercase = 0x2,
+ ImhPreferNumbers = 0x4,
+ ImhPreferUppercase = 0x8,
+ ImhPreferLowercase = 0x10,
+ ImhNoPredictiveText = 0x20,
+
+ ImhDigitsOnly = 0x10000,
+ ImhFormattedNumbersOnly = 0x20000,
+ ImhUppercaseOnly = 0x40000,
+ ImhLowercaseOnly = 0x80000,
+ ImhDialableCharactersOnly = 0x100000,
+
+ ImhExclusiveInputMask = 0xffff0000
};
+ Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint)
enum ToolButtonStyle {
ToolButtonIconOnly,
@@ -1494,6 +1519,8 @@ public:
typedef unsigned long HANDLE;
#elif defined(Q_WS_QWS)
typedef void * HANDLE;
+#elif defined(Q_WS_S60)
+ typedef unsigned long int HANDLE; // equivalent to TUint32
#endif
typedef WindowFlags WFlags;
@@ -1561,6 +1588,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::DropActions)
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::ItemFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MatchFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TextInteractionFlags)
+Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::InputMethodHints)
typedef bool (*qInternalCallback)(void **);
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index 5033b21..edbab9c 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -64,7 +64,8 @@ win32 {
} else:unix {
SOURCES += io/qfsfileengine_unix.cpp
SOURCES += io/qfsfileengine_iterator_unix.cpp
- SOURCES += io/qprocess_unix.cpp
+ symbian:SOURCES += io/qprocess_symbian.cpp
+ else:SOURCES += io/qprocess_unix.cpp
mac:SOURCES += io/qsettings_mac.cpp
linux-*:{
@@ -81,4 +82,9 @@ win32 {
SOURCES += io/qfilesystemwatcher_kqueue.cpp
HEADERS += io/qfilesystemwatcher_kqueue_p.h
}
+
+ symbian {
+ SOURCES += io/qfilesystemwatcher_symbian.cpp
+ HEADERS += io/qfilesystemwatcher_symbian_p.h
+ }
}
diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp
index bedc121..63d4944 100644
--- a/src/corelib/io/qabstractfileengine.cpp
+++ b/src/corelib/io/qabstractfileengine.cpp
@@ -352,8 +352,6 @@ QAbstractFileEngine::QAbstractFileEngine(QAbstractFileEnginePrivate &dd) : d_ptr
*/
QAbstractFileEngine::~QAbstractFileEngine()
{
- delete d_ptr;
- d_ptr = 0;
}
/*!
@@ -881,7 +879,6 @@ QAbstractFileEngineIterator::QAbstractFileEngineIterator(QDir::Filters filters,
*/
QAbstractFileEngineIterator::~QAbstractFileEngineIterator()
{
- delete d;
}
/*!
diff --git a/src/corelib/io/qabstractfileengine.h b/src/corelib/io/qabstractfileengine.h
index d742467..5b75343 100644
--- a/src/corelib/io/qabstractfileengine.h
+++ b/src/corelib/io/qabstractfileengine.h
@@ -193,7 +193,7 @@ protected:
QAbstractFileEngine();
QAbstractFileEngine(QAbstractFileEnginePrivate &);
- QAbstractFileEnginePrivate *d_ptr;
+ QScopedPointer<QAbstractFileEnginePrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QAbstractFileEngine)
Q_DISABLE_COPY(QAbstractFileEngine)
@@ -237,7 +237,7 @@ private:
friend class QDirIterator;
friend class QDirIteratorPrivate;
void setPath(const QString &path);
- QAbstractFileEngineIteratorPrivate *d;
+ QScopedPointer<QAbstractFileEngineIteratorPrivate> d;
};
QT_END_NAMESPACE
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 54121f6..332058e 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -80,8 +80,11 @@ public:
inline QDebug &operator=(const QDebug &other);
inline ~QDebug() {
if (!--stream->ref) {
- if(stream->message_output)
- qt_message_output(stream->type, stream->buffer.toLocal8Bit().data());
+ if(stream->message_output) {
+ QT_TRY {
+ qt_message_output(stream->type, stream->buffer.toLocal8Bit().data());
+ } QT_CATCH(std::bad_alloc) { /* We're out of memory - give up. */ }
+ }
delete stream;
}
}
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 8aadf34..46c29d4 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE
static QString driveSpec(const QString &path)
{
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
if (path.size() < 2)
return QString();
char c = path.at(0).toAscii();
@@ -86,6 +86,7 @@ class QDirPrivate
QDir *q_ptr;
Q_DECLARE_PUBLIC(QDir)
+ friend class QScopedPointer<QDirPrivate>;
protected:
QDirPrivate(QDir*, const QDir *copy=0);
~QDirPrivate();
@@ -150,7 +151,7 @@ private:
QString path = p;
if ((path.endsWith(QLatin1Char('/')) || path.endsWith(QLatin1Char('\\')))
&& path.length() > 1) {
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
if (!(path.length() == 3 && path.at(1) == QLatin1Char(':')))
#endif
path.truncate(path.length() - 1);
@@ -588,8 +589,6 @@ QDir::QDir(const QDir &dir) : d_ptr(new QDirPrivate(this, &dir))
QDir::~QDir()
{
- delete d_ptr;
- d_ptr = 0;
}
/*!
@@ -787,6 +786,8 @@ QString QDir::relativeFilePath(const QString &fileName) const
if (fileDrive.toLower() != dirDrive.toLower()
|| (file.startsWith(QLatin1String("//"))
&& !dir.startsWith(QLatin1String("//"))))
+#elif defined(Q_OS_SYMBIAN)
+ if (fileDrive.toLower() != dirDrive.toLower())
#else
if (fileDrive != dirDrive)
#endif
@@ -802,7 +803,7 @@ QString QDir::relativeFilePath(const QString &fileName) const
int i = 0;
while (i < dirElts.size() && i < fileElts.size() &&
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
dirElts.at(i).toLower() == fileElts.at(i).toLower())
#else
dirElts.at(i) == fileElts.at(i))
@@ -849,7 +850,7 @@ QString QDir::convertSeparators(const QString &pathName)
QString QDir::toNativeSeparators(const QString &pathName)
{
QString n(pathName);
-#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX)
+#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN)
for (int i=0; i<(int)n.length(); i++) {
if (n[i] == QLatin1Char('/'))
n[i] = QLatin1Char('\\');
@@ -873,7 +874,7 @@ QString QDir::toNativeSeparators(const QString &pathName)
QString QDir::fromNativeSeparators(const QString &pathName)
{
QString n(pathName);
-#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX)
+#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN)
for (int i=0; i<(int)n.length(); i++) {
if (n[i] == QLatin1Char('\\'))
n[i] = QLatin1Char('/');
@@ -1821,10 +1822,10 @@ QFileInfoList QDir::drives()
QChar QDir::separator()
{
-#if defined(Q_OS_UNIX)
- return QLatin1Char('/');
-#elif defined (Q_FS_FAT) || defined(Q_WS_WIN)
+#if defined (Q_FS_FAT) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
return QLatin1Char('\\');
+#elif defined(Q_OS_UNIX)
+ return QLatin1Char('/');
#elif defined (Q_OS_MAC)
return QLatin1Char(':');
#else
@@ -1924,7 +1925,8 @@ QString QDir::currentPath()
Under non-Windows operating systems the \c HOME environment
variable is used if it exists, otherwise the path returned by the
- rootPath() function is used.
+ rootPath() function is used, except in Symbian, where c:\\data is
+ returned.
\sa home(), currentPath(), rootPath(), tempPath()
*/
@@ -2146,7 +2148,7 @@ QString QDir::cleanPath(const QString &path)
levels++;
}
} else if(last != -1 && iwrite - last == 1) {
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
eaten = (iwrite > 2);
#else
eaten = true;
diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h
index c4f6b1a..ac80094 100644
--- a/src/corelib/io/qdir.h
+++ b/src/corelib/io/qdir.h
@@ -45,6 +45,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qstringlist.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -57,7 +58,7 @@ class QDirPrivate;
class Q_CORE_EXPORT QDir
{
protected:
- QDirPrivate *d_ptr;
+ QScopedPointer<QDirPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QDir)
public:
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index bfb1aae..9cbd3dc 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -109,6 +109,7 @@ QFilePrivate::openExternalFile(int flags, int fd)
return false;
#else
delete fileEngine;
+ fileEngine = 0;
QFSFileEngine *fe = new QFSFileEngine;
fe->setFileName(fileName);
fileEngine = fe;
@@ -125,6 +126,7 @@ QFilePrivate::openExternalFile(int flags, FILE *fh)
return false;
#else
delete fileEngine;
+ fileEngine = 0;
QFSFileEngine *fe = new QFSFileEngine;
fe->setFileName(fileName);
fileEngine = fe;
@@ -408,9 +410,6 @@ QFile::QFile(QFilePrivate &dd, QObject *parent)
QFile::~QFile()
{
close();
-#ifdef QT_NO_QOBJECT
- delete d_ptr;
-#endif
}
/*!
@@ -745,9 +744,10 @@ QFile::rename(const QString &newName)
error = true;
}
}
- if (error)
+ if (error) {
out.remove();
- else {
+ } else {
+ fileEngine()->setFileName(newName);
setPermissions(permissions());
unsetError();
setFileName(newName);
@@ -793,6 +793,9 @@ QFile::rename(const QString &oldName, const QString &newName)
\note To create a valid link on Windows, \a linkName must have a \c{.lnk} file extension.
+ \note On Symbian, no link is created and false is returned if fileName()
+ currently specifies a directory.
+
\sa setFileName()
*/
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 4f1b943..82b21e9 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -376,8 +376,6 @@ QFileInfo::QFileInfo(const QFileInfo &fileinfo) : d_ptr(new QFileInfoPrivate(&fi
QFileInfo::~QFileInfo()
{
- delete d_ptr;
- d_ptr = 0;
}
/*!
diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h
index 97997a3..6c01f63 100644
--- a/src/corelib/io/qfileinfo.h
+++ b/src/corelib/io/qfileinfo.h
@@ -44,6 +44,7 @@
#include <QtCore/qfile.h>
#include <QtCore/qlist.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -165,7 +166,7 @@ public:
#endif
protected:
- QFileInfoPrivate *d_ptr;
+ QScopedPointer<QFileInfoPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QFileInfo)
};
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp
index 65cfb71..c5a58e2 100644
--- a/src/corelib/io/qfilesystemwatcher.cpp
+++ b/src/corelib/io/qfilesystemwatcher.cpp
@@ -59,6 +59,8 @@
# include "qfilesystemwatcher_dnotify_p.h"
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
# include "qfilesystemwatcher_kqueue_p.h"
+#elif defined(Q_OS_SYMBIAN)
+# include "qfilesystemwatcher_symbian_p.h"
#endif
QT_BEGIN_NAMESPACE
@@ -244,6 +246,8 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine()
return eng;
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
return QKqueueFileSystemWatcherEngine::create();
+#elif defined(Q_OS_SYMBIAN)
+ return new QSymbianFileSystemWatcherEngine;
#else
return 0;
#endif
diff --git a/src/corelib/io/qfilesystemwatcher_symbian.cpp b/src/corelib/io/qfilesystemwatcher_symbian.cpp
new file mode 100644
index 0000000..aeb19db
--- /dev/null
+++ b/src/corelib/io/qfilesystemwatcher_symbian.cpp
@@ -0,0 +1,282 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qfilesystemwatcher.h"
+#include "qfilesystemwatcher_symbian_p.h"
+#include "qfileinfo.h"
+#include "qdebug.h"
+#include "private/qcore_symbian_p.h"
+#include <QDir>
+
+#ifndef QT_NO_FILESYSTEMWATCHER
+
+
+QT_BEGIN_NAMESPACE
+
+CNotifyChangeEvent* CNotifyChangeEvent::New(RFs &fs, const TDesC& file,
+ QSymbianFileSystemWatcherEngine* e)
+{
+ CNotifyChangeEvent* self = new CNotifyChangeEvent(fs, file, e);
+ return self;
+}
+
+CNotifyChangeEvent::CNotifyChangeEvent(RFs &fs, const TDesC& file,
+ QSymbianFileSystemWatcherEngine* e, TInt aPriority) :
+ CActive(aPriority),
+ fsSession(fs),
+ watchedPath(file),
+ engine(e)
+{
+ fsSession.NotifyChange(ENotifyAll, iStatus, file);
+ CActiveScheduler::Add(this);
+ SetActive();
+}
+
+CNotifyChangeEvent::~CNotifyChangeEvent()
+{
+ Cancel();
+}
+
+void CNotifyChangeEvent::RunL()
+{
+ if (iStatus.Int() == KErrNone){
+ fsSession.NotifyChange(ENotifyAll, iStatus, watchedPath);
+ SetActive();
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(engine->emitPathChanged(this));
+ } else {
+ qWarning("CNotifyChangeEvent::RunL() - Failed to order change notifications: %d", iStatus.Int());
+ }
+}
+
+void CNotifyChangeEvent::DoCancel()
+{
+ fsSession.NotifyChangeCancel();
+}
+
+QSymbianFileSystemWatcherEngine::QSymbianFileSystemWatcherEngine() :
+ watcherStarted(false)
+{
+ moveToThread(this);
+}
+
+QSymbianFileSystemWatcherEngine::~QSymbianFileSystemWatcherEngine()
+{
+ stop();
+}
+
+QStringList QSymbianFileSystemWatcherEngine::addPaths(const QStringList &paths,
+ QStringList *files, QStringList *directories)
+{
+ QMutexLocker locker(&mutex);
+ QStringList p = paths;
+
+ if (!startWatcher()) {
+ qWarning("Could not start QSymbianFileSystemWatcherEngine thread");
+
+ return p;
+ }
+
+ QMutableListIterator<QString> it(p);
+ while (it.hasNext()) {
+ QString path = it.next();
+ QFileInfo fi(path);
+ if (!fi.exists())
+ continue;
+
+ bool isDir = fi.isDir();
+ if (isDir) {
+ if (directories->contains(path))
+ continue;
+ } else {
+ if (files->contains(path))
+ continue;
+ }
+
+ // Use absolute filepath as relative paths seem to have some issues.
+ QString filePath = fi.absoluteFilePath();
+ if(isDir && filePath.at(filePath.size()-1) != QChar('/')) {
+ filePath += QChar('/');
+ }
+
+ currentEvent = NULL;
+ QMetaObject::invokeMethod(this,
+ "addNativeListener",
+ Qt::QueuedConnection,
+ Q_ARG(QString, filePath));
+
+ syncCondition.wait(&mutex);
+
+ if (currentEvent) {
+ currentEvent->isDir = isDir;
+
+ activeObjectToPath.insert(currentEvent, path);
+ it.remove();
+
+ if (isDir)
+ directories->append(path);
+ else
+ files->append(path);
+ }
+ }
+
+ return p;
+}
+
+QStringList QSymbianFileSystemWatcherEngine::removePaths(const QStringList &paths,
+ QStringList *files, QStringList *directories)
+{
+ QMutexLocker locker(&mutex);
+
+ QStringList p = paths;
+ QMutableListIterator<QString> it(p);
+ while (it.hasNext()) {
+ QString path = it.next();
+
+ currentEvent = activeObjectToPath.key(path);
+ if (!currentEvent)
+ continue;
+ activeObjectToPath.remove(currentEvent);
+
+ QMetaObject::invokeMethod(this,
+ "removeNativeListener",
+ Qt::QueuedConnection);
+
+ syncCondition.wait(&mutex);
+
+ it.remove();
+
+ files->removeAll(path);
+ directories->removeAll(path);
+ }
+
+ if (activeObjectToPath.size() == 0)
+ stop();
+
+ return p;
+}
+
+void QSymbianFileSystemWatcherEngine::emitPathChanged(CNotifyChangeEvent *e)
+{
+ QMutexLocker locker(&mutex);
+
+ QString path = activeObjectToPath.value(e);
+ QFileInfo fi(path);
+
+ if (e->isDir) {
+ emit directoryChanged(path, !fi.exists());
+ } else {
+ emit fileChanged(path, !fi.exists());
+ }
+}
+
+void QSymbianFileSystemWatcherEngine::stop()
+{
+ QMetaObject::invokeMethod(this, "quit");
+ wait();
+}
+
+// This method must be called inside mutex
+bool QSymbianFileSystemWatcherEngine::startWatcher()
+{
+ bool retval = true;
+
+ if (!watcherStarted) {
+#if defined(Q_OS_SYMBIAN)
+ setStackSize(0x5000);
+#endif
+ start();
+ syncCondition.wait(&mutex);
+
+ if (errorCode != KErrNone) {
+ retval = false;
+ } else {
+ watcherStarted = true;
+ }
+ }
+ return retval;
+}
+
+
+void QSymbianFileSystemWatcherEngine::run()
+{
+ // Initialize file session
+
+ errorCode = fsSession.Connect();
+
+ mutex.lock();
+ syncCondition.wakeOne();
+ mutex.unlock();
+
+ if (errorCode == KErrNone) {
+ exec();
+
+ foreach(CNotifyChangeEvent* e, activeObjectToPath.keys()) {
+ e->Cancel();
+ delete e;
+ }
+
+ activeObjectToPath.clear();
+ fsSession.Close();
+ watcherStarted = false;
+ }
+}
+
+void QSymbianFileSystemWatcherEngine::addNativeListener(const QString &directoryPath)
+{
+ QMutexLocker locker(&mutex);
+ QString nativeDir(QDir::toNativeSeparators(directoryPath));
+ TPtrC ptr(qt_QString2TPtrC(nativeDir));
+ currentEvent = CNotifyChangeEvent::New(fsSession, ptr, this);
+ syncCondition.wakeOne();
+}
+
+void QSymbianFileSystemWatcherEngine::removeNativeListener()
+{
+ QMutexLocker locker(&mutex);
+ currentEvent->Cancel();
+ delete currentEvent;
+ currentEvent = NULL;
+ syncCondition.wakeOne();
+}
+
+
+QT_END_NAMESPACE
+#endif // QT_NO_FILESYSTEMWATCHER
diff --git a/src/corelib/io/qfilesystemwatcher_symbian_p.h b/src/corelib/io/qfilesystemwatcher_symbian_p.h
new file mode 100644
index 0000000..9919114
--- /dev/null
+++ b/src/corelib/io/qfilesystemwatcher_symbian_p.h
@@ -0,0 +1,131 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QFILESYSTEMWATCHER_SYMBIAN_P_H
+#define QFILESYSTEMWATCHER_SYMBIAN_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 "qfilesystemwatcher_p.h"
+#include "qhash.h"
+#include "qmutex.h"
+#include "qwaitcondition.h"
+
+#ifndef QT_NO_FILESYSTEMWATCHER
+
+#include <e32base.h>
+#include <f32file.h>
+
+QT_BEGIN_NAMESPACE
+
+class QSymbianFileSystemWatcherEngine;
+
+class CNotifyChangeEvent : public CActive
+{
+public:
+ CNotifyChangeEvent(RFs &fsSession, const TDesC& file, QSymbianFileSystemWatcherEngine* engine,
+ TInt aPriority = EPriorityStandard);
+ ~CNotifyChangeEvent();
+ static CNotifyChangeEvent* New(RFs &fsSession, const TDesC& file,
+ QSymbianFileSystemWatcherEngine* engine);
+
+ bool isDir;
+
+private:
+ void RunL();
+ void DoCancel();
+
+ RFs &fsSession;
+ TPath watchedPath;
+ QSymbianFileSystemWatcherEngine *engine;
+};
+
+class QSymbianFileSystemWatcherEngine : public QFileSystemWatcherEngine
+{
+ Q_OBJECT
+
+public:
+ QSymbianFileSystemWatcherEngine();
+ ~QSymbianFileSystemWatcherEngine();
+
+ QStringList addPaths(const QStringList &paths, QStringList *files,
+ QStringList *directories);
+ QStringList removePaths(const QStringList &paths, QStringList *files,
+ QStringList *directories);
+
+ void stop();
+
+protected:
+ void run();
+
+public Q_SLOTS:
+ void addNativeListener(const QString &directoryPath);
+ void removeNativeListener();
+
+private:
+ friend class CNotifyChangeEvent;
+ void emitPathChanged(CNotifyChangeEvent *e);
+
+ bool startWatcher();
+
+ RFs fsSession;
+ QHash<CNotifyChangeEvent*, QString> activeObjectToPath;
+ QMutex mutex;
+ QWaitCondition syncCondition;
+ int errorCode;
+ bool watcherStarted;
+ CNotifyChangeEvent *currentEvent;
+};
+
+#endif // QT_NO_FILESYSTEMWATCHER
+
+QT_END_NAMESPACE
+
+#endif // QFILESYSTEMWATCHER_WIN_P_H
diff --git a/src/corelib/io/qfsfileengine.h b/src/corelib/io/qfsfileengine.h
index a2b732e..f54a6e8 100644
--- a/src/corelib/io/qfsfileengine.h
+++ b/src/corelib/io/qfsfileengine.h
@@ -83,6 +83,9 @@ public:
FileFlags fileFlags(FileFlags type) const;
bool setPermissions(uint perms);
QString fileName(FileName file) const;
+#ifdef Q_OS_SYMBIAN
+ QString fileNameSymbian(FileName file) const;
+#endif
uint ownerId(FileOwner) const;
QString owner(FileOwner) const;
QDateTime fileTime(FileTime time) const;
diff --git a/src/corelib/io/qfsfileengine_iterator_unix.cpp b/src/corelib/io/qfsfileengine_iterator_unix.cpp
index 2284d9b..fd95f81 100644
--- a/src/corelib/io/qfsfileengine_iterator_unix.cpp
+++ b/src/corelib/io/qfsfileengine_iterator_unix.cpp
@@ -53,7 +53,7 @@ class QFSFileEngineIteratorPlatformSpecificData
public:
inline QFSFileEngineIteratorPlatformSpecificData()
: dir(0), dirEntry(0), done(false)
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN)
, mt_file(0)
#endif
{ }
@@ -62,7 +62,7 @@ public:
dirent *dirEntry;
bool done;
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN)
// for readdir_r
dirent *mt_file;
#endif
@@ -75,7 +75,7 @@ void QFSFileEngineIterator::advance()
if (!platform->dir)
return;
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN)
if (::readdir_r(platform->dir, platform->mt_file, &platform->dirEntry) != 0)
platform->done = true;
#else
@@ -86,7 +86,7 @@ void QFSFileEngineIterator::advance()
::closedir(platform->dir);
platform->dir = 0;
platform->done = true;
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN)
delete [] platform->mt_file;
platform->mt_file = 0;
#endif
@@ -102,7 +102,7 @@ void QFSFileEngineIterator::deletePlatformSpecifics()
{
if (platform->dir) {
::closedir(platform->dir);
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN)
delete [] platform->mt_file;
platform->mt_file = 0;
#endif
@@ -123,7 +123,7 @@ bool QFSFileEngineIterator::hasNext() const
if ((int) maxPathName == -1)
maxPathName = FILENAME_MAX;
maxPathName += sizeof(dirent) + 1;
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN)
if (that->platform->mt_file)
delete [] that->platform->mt_file;
that->platform->mt_file = (dirent *)new char[maxPathName];
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 3c443ff..c29e4ec 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -51,12 +51,16 @@
#include "qfile.h"
#include "qdir.h"
#include "qdatetime.h"
-#include "qdebug.h"
#include "qvarlengtharray.h"
#include <sys/mman.h>
#include <stdlib.h>
#include <limits.h>
+#if defined(Q_OS_SYMBIAN)
+# include <syslimits.h>
+# include <f32file.h>
+# include "private/qcore_symbian_p.h"
+#endif
#include <errno.h>
#if !defined(QWS) && defined(Q_OS_MAC)
# include <private/qcore_mac_p.h>
@@ -64,6 +68,22 @@
QT_BEGIN_NAMESPACE
+
+#ifdef Q_OS_SYMBIAN
+/*!
+ \internal
+
+ Returns true if supplied path is a relative path
+*/
+static bool isRelativePathSymbian(const QString& fileName)
+{
+ return !(fileName.startsWith(QLatin1Char('/'))
+ || (fileName.length() >= 2
+ && ((fileName.at(0).isLetter() && fileName.at(1) == QLatin1Char(':'))
+ || (fileName.at(0) == QLatin1Char('/') && fileName.at(1) == QLatin1Char('/')))));
+}
+#endif
+
/*!
\internal
@@ -376,10 +396,37 @@ bool QFSFileEngine::remove()
return unlink(d->nativeFilePath.constData()) == 0;
}
-bool QFSFileEngine::copy(const QString &)
+bool QFSFileEngine::copy(const QString &newName)
{
+#if defined(Q_OS_SYMBIAN)
+ Q_D(QFSFileEngine);
+ RFs rfs;
+ TInt err = rfs.Connect();
+ if (err == KErrNone) {
+ CFileMan* fm = NULL;
+ QString oldNative(QDir::toNativeSeparators(d->filePath));
+ TPtrC oldPtr(qt_QString2TPtrC(oldNative));
+ QFileInfo fi(newName);
+ QString absoluteNewName = fi.absolutePath() + QDir::separator() + fi.fileName();
+ QString newNative(QDir::toNativeSeparators(absoluteNewName));
+ TPtrC newPtr(qt_QString2TPtrC(newNative));
+ TRAP (err,
+ fm = CFileMan::NewL(rfs);
+ RFile rfile;
+ err = rfile.Open(rfs, oldPtr, EFileShareReadersOrWriters);
+ if (err == KErrNone) {
+ err = fm->Copy(rfile, newPtr);
+ rfile.Close();
+ }
+ ) // End TRAP
+ delete fm;
+ rfs.Close();
+ }
+ return (err == KErrNone);
+#else
// ### Add copy code for Unix here
return false;
+#endif
}
bool QFSFileEngine::rename(const QString &newName)
@@ -403,7 +450,11 @@ bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) con
{
QString dirName = name;
if (createParentDirectories) {
+#if defined(Q_OS_SYMBIAN)
+ dirName = QDir::toNativeSeparators(QDir::cleanPath(dirName));
+#else
dirName = QDir::cleanPath(dirName);
+#endif
for(int oldslash = -1, slash=0; slash != -1; oldslash = slash) {
slash = dirName.indexOf(QDir::separator(), oldslash+1);
if (slash == -1) {
@@ -435,7 +486,11 @@ bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) co
{
QString dirName = name;
if (recurseParentDirectories) {
+#if defined(Q_OS_SYMBIAN)
+ dirName = QDir::toNativeSeparators(QDir::cleanPath(dirName));
+#else
dirName = QDir::cleanPath(dirName);
+#endif
for(int oldslash = 0, slash=dirName.length(); slash > 0; oldslash = slash) {
QByteArray chunk = QFile::encodeName(dirName.left(slash));
QT_STATBUF st;
@@ -456,7 +511,11 @@ bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) co
bool QFSFileEngine::caseSensitive() const
{
+#if defined(Q_OS_SYMBIAN)
+ return false;
+#else
return true;
+#endif
}
bool QFSFileEngine::setCurrentPath(const QString &path)
@@ -470,6 +529,16 @@ QString QFSFileEngine::currentPath(const QString &)
{
QString result;
QT_STATBUF st;
+#if defined(Q_OS_SYMBIAN)
+ char currentName[PATH_MAX+1];
+ if (::getcwd(currentName, PATH_MAX))
+ result = QDir::fromNativeSeparators(QFile::decodeName(QByteArray(currentName)));
+ if (result.isEmpty()) {
+# if defined(QT_DEBUG)
+ qWarning("QDir::currentPath: getcwd() failed");
+# endif
+ } else
+#endif
if (QT_STAT(".", &st) == 0) {
#if defined(__GLIBC__) && !defined(PATH_MAX)
char *currentName = ::get_current_dir_name();
@@ -477,18 +546,26 @@ QString QFSFileEngine::currentPath(const QString &)
result = QFile::decodeName(QByteArray(currentName));
::free(currentName);
}
-#else
+#elif !defined(Q_OS_SYMBIAN)
char currentName[PATH_MAX+1];
if (::getcwd(currentName, PATH_MAX))
result = QFile::decodeName(QByteArray(currentName));
-#endif
-#if defined(QT_DEBUG)
+# if defined(QT_DEBUG)
if (result.isNull())
qWarning("QDir::currentPath: getcwd() failed");
+# endif
#endif
} else {
-#if defined(QT_DEBUG)
+#if defined(Q_OS_SYMBIAN)
+ // If current dir returned by Open C doesn't exist,
+ // try to create it (can happen with application private dirs)
+ // Ignore mkdir failures; we want to be consistent with Open C
+ // current path regardless.
+ ::mkdir(QFile::encodeName(currentName), 0777);
+#else
+# if defined(QT_DEBUG)
qWarning("QDir::currentPath: stat(\".\") failed");
+# endif
#endif
}
return result;
@@ -497,28 +574,61 @@ QString QFSFileEngine::currentPath(const QString &)
QString QFSFileEngine::homePath()
{
QString home = QFile::decodeName(qgetenv("HOME"));
+#if defined(Q_OS_SYMBIAN)
+ if (home.isEmpty())
+ home = QLatin1String("C:/Data");
+#else
if (home.isNull())
home = rootPath();
+#endif
return home;
}
QString QFSFileEngine::rootPath()
{
+#if defined(Q_OS_SYMBIAN)
+ return QString::fromLatin1("C:/");
+#else
return QString::fromLatin1("/");
+#endif
}
QString QFSFileEngine::tempPath()
{
- QString temp = QFile::decodeName(qgetenv("TMPDIR"));
- if (temp.isEmpty())
- temp = QString::fromLatin1("/tmp/");
+#ifdef Q_OS_SYMBIAN
+ QString temp = QDir::currentPath().left(2);
+ temp += QString::fromLatin1( "/system/temp/");
+#else
+ QString temp = QFile::decodeName(qgetenv("TMPDIR"));
+ if (temp.isEmpty())
+ temp = QString::fromLatin1("/tmp/");
+#endif
return temp;
}
QFileInfoList QFSFileEngine::drives()
{
QFileInfoList ret;
+#if defined(Q_OS_SYMBIAN)
+ TDriveList driveList;
+ RFs rfs;
+ TInt err = rfs.Connect();
+ if (err == KErrNone) {
+ err = rfs.DriveList(driveList);
+ if (err == KErrNone) {
+ for(char i=0; i < KMaxDrives; i++) {
+ if (driveList[i]) {
+ ret.append(QString("%1:/").arg(QChar('A'+i)));
+ }
+ }
+ } else {
+ qWarning("QDir::drives: Getting drives failed");
+ }
+ rfs.Close();
+ }
+#else
ret.append(rootPath());
+#endif
return ret;
}
@@ -551,6 +661,32 @@ bool QFSFileEnginePrivate::isSymlink() const
return is_link;
}
+#if defined(Q_OS_SYMBIAN)
+static bool _q_isSymbianHidden(const QString &path, bool isDir)
+{
+ bool retval = false;
+ RFs rfs;
+ TInt err = rfs.Connect();
+ if (err == KErrNone) {
+ QFileInfo fi(path);
+ QString absPath = fi.absoluteFilePath();
+ if (isDir && absPath.at(absPath.size()-1) != QChar('/')) {
+ absPath += QChar('/');
+ }
+ QString native(QDir::toNativeSeparators(absPath));
+ TPtrC ptr(qt_QString2TPtrC(native));
+ TUint attributes;
+ err = rfs.Att(ptr, attributes);
+ rfs.Close();
+ if (err == KErrNone && (attributes & KEntryAttHidden)) {
+ retval = true;
+ }
+ }
+
+ return retval;
+}
+#endif
+
#if !defined(QWS) && defined(Q_OS_MAC)
static bool _q_isMacHidden(const QString &path)
{
@@ -671,20 +807,147 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const
ret |= LocalDiskFlag;
if (exists)
ret |= ExistsFlag;
+#if defined(Q_OS_SYMBIAN)
+ if (d->filePath == QLatin1String("/") || (d->filePath.at(0).isLetter() && d->filePath.mid(1,d->filePath.length()) == QLatin1String(":/")))
+ ret |= RootFlag;
+
+ // In Symbian, all symlinks have hidden attribute for some reason;
+ // lets make them visible for better compatibility with other platforms.
+ // If somebody actually wants a hidden link, then they are out of luck.
+ if (!(ret & RootFlag) && !d->isSymlink())
+ if(_q_isSymbianHidden(d->filePath, ret & DirectoryType)
+#else
if (fileName(BaseName)[0] == QLatin1Char('.')
-#if !defined(QWS) && defined(Q_OS_MAC)
+# if !defined(QWS) && defined(Q_OS_MAC)
|| _q_isMacHidden(d->filePath)
+# endif
#endif
)
ret |= HiddenFlag;
+#if !defined(Q_OS_SYMBIAN)
if (d->filePath == QLatin1String("/"))
ret |= RootFlag;
+#endif
}
return ret;
}
+#ifdef Q_OS_SYMBIAN
+QString QFSFileEngine::fileNameSymbian(FileName file) const
+{
+ Q_D(const QFSFileEngine);
+ if(file == BaseName) {
+ int slash = d->filePath.lastIndexOf(QLatin1Char('/'));
+ if(slash == -1) {
+ int colon = d->filePath.lastIndexOf(QLatin1Char(':'));
+ if(colon != -1)
+ return d->filePath.mid(colon + 1);
+ return d->filePath;
+ }
+ return d->filePath.mid(slash + 1);
+ } else if(file == PathName) {
+ if(!d->filePath.size())
+ return d->filePath;
+
+ int slash = d->filePath.lastIndexOf(QLatin1Char('/'));
+ if(slash == -1) {
+ if(d->filePath.length() >= 2 && d->filePath.at(1) == QLatin1Char(':'))
+ return d->filePath.left(2);
+ return QString::fromLatin1(".");
+ } else {
+ if(!slash)
+ return QString::fromLatin1("/");
+ if(slash == 2 && d->filePath.length() >= 2 && d->filePath.at(1) == QLatin1Char(':'))
+ slash++;
+ return d->filePath.left(slash);
+ }
+ } else if(file == AbsoluteName || file == AbsolutePathName) {
+ QString ret;
+ if (!isRelativePath()) {
+ if (d->filePath.size() > 2 && d->filePath.at(1) == QLatin1Char(':')
+ && d->filePath.at(2) != QLatin1Char('/') || // It's a drive-relative path, so Z:a.txt -> Z:\currentpath\a.txt
+ d->filePath.startsWith(QLatin1Char('/')) // It's a absolute path to the current drive, so \a.txt -> Z:\a.txt
+ ) {
+ ret = QString(QDir::currentPath().left(2) + QDir::fromNativeSeparators(d->filePath));
+ } else {
+ ret = d->filePath;
+ }
+ } else {
+ ret = QDir::cleanPath(QDir::currentPath() + QLatin1Char('/') + d->filePath);
+ }
+
+ // The path should be absolute at this point.
+ // From the docs :
+ // Absolute paths begin with the directory separator "/"
+ // (optionally preceded by a drive specification under Windows).
+ if (ret.at(0) != QLatin1Char('/')) {
+ Q_ASSERT(ret.length() >= 2);
+ Q_ASSERT(ret.at(0).isLetter());
+ Q_ASSERT(ret.at(1) == QLatin1Char(':'));
+
+ // Force uppercase drive letters.
+ ret[0] = ret.at(0).toUpper();
+ }
+
+ if (file == AbsolutePathName) {
+ int slash = ret.lastIndexOf(QLatin1Char('/'));
+ if (slash < 0)
+ return ret;
+ else if (ret.at(0) != QLatin1Char('/') && slash == 2)
+ return ret.left(3); // include the slash
+ else
+ return ret.left(slash > 0 ? slash : 1);
+ }
+ return ret;
+ } else if(file == CanonicalName || file == CanonicalPathName) {
+ if (!(fileFlags(ExistsFlag) & ExistsFlag))
+ return QString();
+
+ QString ret = QFSFileEnginePrivate::canonicalized(fileName(AbsoluteName));
+ if (!ret.isEmpty() && file == CanonicalPathName) {
+ int slash = ret.lastIndexOf(QLatin1Char('/'));
+ if (slash == -1)
+ ret = QDir::fromNativeSeparators(QDir::currentPath());
+ else if (slash == 0)
+ ret = QLatin1String("/");
+ ret = ret.left(slash);
+ }
+ return ret;
+ } else if(file == LinkName) {
+ if (d->isSymlink()) {
+ char s[PATH_MAX+1];
+ int len = readlink(d->nativeFilePath.constData(), s, PATH_MAX);
+ if (len > 0) {
+ s[len] = '\0';
+ QString ret = QFile::decodeName(QByteArray(s));
+
+ if (isRelativePathSymbian(ret)) {
+ if (!isRelativePathSymbian(d->filePath)) {
+ ret.prepend(d->filePath.left(d->filePath.lastIndexOf(QLatin1Char('/')))
+ + QLatin1Char('/'));
+ } else {
+ ret.prepend(QDir::currentPath() + QLatin1Char('/'));
+ }
+ }
+ ret = QDir::cleanPath(ret);
+ if (ret.size() > 1 && ret.endsWith(QLatin1Char('/')))
+ ret.chop(1);
+ return ret;
+ }
+ }
+ return QString();
+ } else if(file == BundleName) {
+ return QString();
+ }
+ return d->filePath;
+}
+#endif
+
QString QFSFileEngine::fileName(FileName file) const
{
+#ifdef Q_OS_SYMBIAN
+ return fileNameSymbian(file);
+#endif
Q_D(const QFSFileEngine);
if (file == BundleName) {
#if !defined(QWS) && defined(Q_OS_MAC)
@@ -828,10 +1091,14 @@ QString QFSFileEngine::fileName(FileName file) const
bool QFSFileEngine::isRelativePath() const
{
Q_D(const QFSFileEngine);
+#ifdef Q_OS_SYMBIAN
+ return isRelativePathSymbian(d->filePath);
+#else
int len = d->filePath.length();
if (len == 0)
return true;
return d->filePath[0] != QLatin1Char('/');
+#endif
}
uint QFSFileEngine::ownerId(FileOwner own) const
@@ -867,6 +1134,9 @@ QString QFSFileEngine::owner(FileOwner own) const
if (pw)
return QFile::decodeName(QByteArray(pw->pw_name));
} else if (own == OwnerGroup) {
+#ifdef Q_OS_SYMBIAN
+ return QString();
+#endif
struct group *gr = 0;
#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
size_max = sysconf(_SC_GETGR_R_SIZE_MAX);
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index 9da9e66..896bcc1 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -1396,7 +1396,7 @@ bool QFSFileEnginePrivate::doStat() const
static QString readLink(const QString &link)
{
#if !defined(Q_OS_WINCE)
-#if !defined(QT_NO_LIBRARY)
+#if !defined(QT_NO_LIBRARY) && !defined(Q_CC_MWERKS)
QString ret;
QT_WA({
bool neededCoInit = false;
@@ -1496,7 +1496,7 @@ QString QFSFileEnginePrivate::getLink() const
bool QFSFileEngine::link(const QString &newName)
{
#if !defined(Q_OS_WINCE)
-#if !defined(QT_NO_LIBRARY)
+#if !defined(QT_NO_LIBRARY) && !defined(Q_CC_MWERKS)
bool ret = false;
QString linkName = newName;
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 8924b77..82e54fa 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1036,6 +1036,15 @@ qint64 QIODevice::readLine(char *data, qint64 maxSize)
if (readSoFar)
debugBinaryString(data, int(readSoFar));
#endif
+#if defined(Q_OS_SYMBIAN)
+ // Open C fgets strips '\r' but readSoFar gets returned as if it was still there
+ if ((d->openMode & Text) &&
+ readSoFar > 1 &&
+ data[readSoFar - 1] == '\0' &&
+ data[readSoFar - 2] == '\n') {
+ --readSoFar;
+ }
+#endif
if (readSoFar && data[readSoFar - 1] == '\n') {
if (d->openMode & Text) {
// QRingBuffer::readLine() isn't Text aware.
@@ -1074,6 +1083,12 @@ qint64 QIODevice::readLine(char *data, qint64 maxSize)
data[readSoFar] = '\0';
if (d->openMode & Text) {
+#if defined(Q_OS_SYMBIAN)
+ // Open C fgets strips '\r' but readSoFar gets returned as if it was still there
+ if (readSoFar > 1 && data[readSoFar - 1] == '\0' && data[readSoFar - 2] == '\n') {
+ --readSoFar;
+ }
+#endif
if (readSoFar > 1 && data[readSoFar - 1] == '\n' && data[readSoFar - 2] == '\r') {
data[readSoFar - 2] = '\n';
data[readSoFar - 1] = '\0';
diff --git a/src/corelib/io/qiodevice.h b/src/corelib/io/qiodevice.h
index 76d47ca..ad87125 100644
--- a/src/corelib/io/qiodevice.h
+++ b/src/corelib/io/qiodevice.h
@@ -46,6 +46,7 @@
#include <QtCore/qobject.h>
#else
#include <QtCore/qobjectdefs.h>
+#include <QtCore/qscopedpointer.h>
#endif
#include <QtCore/qstring.h>
@@ -160,7 +161,7 @@ protected:
void setErrorString(const QString &errorString);
#ifdef QT_NO_QOBJECT
- QIODevicePrivate *d_ptr;
+ QScopedPointer<QIODevicePrivate> d_ptr;
#endif
private:
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index afeaad6..0becbb6 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -176,7 +176,8 @@ void QProcessPrivate::Channel::clear()
used as an input source for QXmlReader, or for generating data to
be uploaded using QFtp.
- \note On Windows CE, reading and writing to a process is not supported.
+ \note On Windows CE and Symbian, reading and writing to a process
+ is not supported.
When the process exits, QProcess reenters the \l NotRunning state
(the initial state), and emits finished().
@@ -226,6 +227,10 @@ void QProcessPrivate::Channel::clear()
setWorkingDirectory(). By default, processes are run in the
current working directory of the calling process.
+ \note On Symbian, setting environment or working directory
+ is not supported. The working directory will always be the private
+ directory of the running process.
+
\section1 Synchronous Process API
QProcess provides a set of functions which allow it to be used
@@ -460,6 +465,10 @@ QProcessPrivate::QProcessPrivate()
#ifdef Q_OS_UNIX
serial = 0;
#endif
+#ifdef Q_OS_SYMBIAN
+ symbianProcess = NULL;
+ processLaunched = false;
+#endif
}
/*! \internal
@@ -533,6 +542,13 @@ void QProcessPrivate::cleanup()
#ifdef Q_OS_UNIX
serial = 0;
#endif
+#ifdef Q_OS_SYMBIAN
+ if (symbianProcess) {
+ symbianProcess->Close();
+ delete symbianProcess;
+ symbianProcess = NULL;
+ }
+#endif
}
/*! \internal
@@ -790,7 +806,7 @@ void QProcessPrivate::closeWriteChannel()
if (stdinChannel.notifier) {
qDeleteInEventHandler(stdinChannel.notifier);
stdinChannel.notifier = 0;
- }
+ }
}
#ifdef Q_OS_WIN
// ### Find a better fix, feeding the process little by little
@@ -1089,6 +1105,10 @@ QString QProcess::workingDirectory() const
process in this directory. The default behavior is to start the
process in the working directory of the calling process.
+ \note The working directory setting is ignored on Symbian;
+ the private directory of the process is considered its working
+ directory.
+
\sa workingDirectory(), start()
*/
void QProcess::setWorkingDirectory(const QString &dir)
@@ -1229,7 +1249,7 @@ void QProcess::setEnvironment(const QStringList &environment)
using setEnvironment() or setEnvironmentHash(). If no environment
has been set, the environment of the calling process will be used.
- \note The environment settings are ignored on Windows CE,
+ \note The environment settings are ignored on Windows CE and Symbian,
as there is no concept of an environment.
\sa environmentHash(), setEnvironment(), systemEnvironment()
@@ -1715,6 +1735,9 @@ void QProcess::start(const QString &program, OpenMode mode)
event loop does not handle the WM_CLOSE message, can only be terminated by
calling kill().
+ \note Terminating running processes from other processes will typically
+ cause a panic in Symbian due to platform security.
+
\sa kill()
*/
void QProcess::terminate()
@@ -1729,6 +1752,9 @@ void QProcess::terminate()
On Windows, kill() uses TerminateProcess, and on Unix and Mac OS X, the
SIGKILL signal is sent to the process.
+ \note Killing running processes from other processes will typically
+ cause a panic in Symbian due to platform security.
+
\sa terminate()
*/
void QProcess::kill()
@@ -1875,9 +1901,9 @@ QT_BEGIN_INCLUDE_NAMESPACE
#ifdef Q_OS_MAC
# include <crt_externs.h>
# define environ (*_NSGetEnviron())
-#elif defined(Q_OS_WINCE)
- static char *qt_wince_environ[] = { 0 };
-#define environ qt_wince_environ
+#elif defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
+ static char *qt_empty_environ[] = { 0 };
+#define environ qt_empty_environ
#elif !defined(Q_OS_WIN)
extern char **environ;
#endif
diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h
index bf9a5a6..65b5b3e 100644
--- a/src/corelib/io/qprocess.h
+++ b/src/corelib/io/qprocess.h
@@ -55,8 +55,13 @@ QT_MODULE(Core)
template <class Key, class T> class QHash;
-#if (!defined(Q_OS_WIN32) && !defined(Q_OS_WINCE)) || defined(qdoc)
+#if (!defined(Q_OS_WIN32) && !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)) || defined(qdoc)
typedef qint64 Q_PID;
+#elif defined(Q_OS_SYMBIAN)
+QT_END_NAMESPACE
+# include <e32std.h>
+QT_BEGIN_NAMESPACE
+typedef TProcessId Q_PID;
#else
QT_END_NAMESPACE
typedef struct _PROCESS_INFORMATION *Q_PID;
diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h
index f67fd2d..6a3342a 100644
--- a/src/corelib/io/qprocess_p.h
+++ b/src/corelib/io/qprocess_p.h
@@ -180,7 +180,7 @@ public:
QWinEventNotifier *processFinishedNotifier;
void startProcess();
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
void execChild(const char *workingDirectory, char **path, char **argv, char **envp);
#endif
bool processStarted();
@@ -221,6 +221,11 @@ public:
#ifdef Q_OS_UNIX
static void initializeProcessManager();
#endif
+
+#ifdef Q_OS_SYMBIAN
+ bool processLaunched;
+ RProcess* symbianProcess;
+#endif
};
QT_END_NAMESPACE
diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp
new file mode 100644
index 0000000..7da6a1d
--- /dev/null
+++ b/src/corelib/io/qprocess_symbian.cpp
@@ -0,0 +1,1035 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//#define QPROCESS_DEBUG
+
+#ifdef QPROCESS_DEBUG
+#include "qdebug.h"
+#define QPROCESS_DEBUG_PRINT(args...) qDebug(args);
+#else
+#define QPROCESS_DEBUG_PRINT(args...)
+#endif
+
+#ifndef QT_NO_PROCESS
+
+#define QPROCESS_ASSERT(check, panicReason, args...) \
+ if (!(check)) { \
+ qWarning(args); \
+ User::Panic(KQProcessPanic, panicReason); \
+ }
+
+#include <exception>
+#include <e32base.h>
+#include <e32std.h>
+#include <stdio.h>
+#include "qplatformdefs.h"
+
+#include "qstring.h"
+#include "qprocess.h"
+#include "qprocess_p.h"
+#include "qeventdispatcher_symbian_p.h"
+
+#include <private/qthread_p.h>
+#include <qmutex.h>
+#include <qmap.h>
+#include <qsocketnotifier.h>
+
+#include <errno.h>
+
+
+QT_BEGIN_NAMESPACE
+
+_LIT(KQProcessManagerThreadName, "QProcManThread");
+_LIT(KQProcessPanic, "QPROCESS");
+enum TQProcessPanic {
+ EProcessManagerMediatorRunError = 1,
+ EProcessManagerMediatorInactive = 2,
+ EProcessManagerMediatorNotPending = 3,
+ EProcessManagerMediatorInvalidCmd = 4,
+ EProcessManagerMediatorCreationFailed = 5,
+ EProcessManagerMediatorThreadOpenFailed = 6,
+ EProcessManagerMediatorNullObserver = 7,
+ EProcessActiveRunError = 10,
+ EProcessActiveNullParameter = 11,
+ EProcessManagerMutexCreationFail = 20,
+ EProcessManagerThreadCreationFail = 21,
+ EProcessManagerSchedulerCreationFail = 22,
+ EProcessManagerNullParam = 23
+};
+
+// Forward declarations
+class QProcessManager;
+
+
+// Active object to listen for child process death
+class CProcessActive : public CActive
+{
+public:
+ static CProcessActive* construct(QProcess* process,
+ RProcess** proc,
+ int serial,
+ int deathPipe);
+
+ virtual ~CProcessActive();
+
+ void start();
+ void stop();
+
+ bool error();
+
+protected:
+
+ // From CActive
+ void RunL();
+ TInt RunError(TInt aError);
+ void DoCancel();
+
+ CProcessActive();
+
+private:
+
+ QProcess* process;
+ RProcess** pproc;
+ int serial;
+ int deathPipe;
+ bool errorValue;
+};
+
+// Active object to communicate synchronously with process manager thread
+class CProcessManagerMediator : public CActive
+{
+public:
+ static CProcessManagerMediator* construct();
+
+ virtual ~CProcessManagerMediator();
+
+ bool add(CProcessActive* processObserver);
+ void remove(CProcessActive* processObserver);
+ void terminate();
+
+protected:
+
+ enum Commands {
+ ENoCommand,
+ EAdd,
+ ERemove,
+ ETerminate
+ };
+
+ // From CActive
+ void RunL();
+ TInt RunError(TInt aError);
+ void DoCancel();
+
+ CProcessManagerMediator();
+
+ bool notify(CProcessActive* processObserver, Commands command);
+
+private:
+ CProcessActive* currentObserver;
+ Commands currentCommand;
+
+ RThread processManagerThread;
+};
+
+// Process manager manages child process death listeners
+class QProcessManager
+{
+public:
+ QProcessManager();
+ ~QProcessManager();
+
+ void startThread();
+
+ TInt run(void* param);
+ bool add(QProcess *process);
+ void remove(QProcess *process);
+
+ inline void setMediator(CProcessManagerMediator* newMediator) {mediator = newMediator;};
+
+private:
+ inline void lock() {managerMutex.Wait();};
+ inline void unlock() {managerMutex.Signal();};
+
+ QMap<int, CProcessActive *> children;
+ CProcessManagerMediator* mediator;
+ RMutex managerMutex;
+ bool threadStarted;
+ RThread managerThread;
+};
+
+static bool qt_rprocess_running(RProcess* proc)
+{
+ if(proc && proc->Handle()) {
+ TExitType et = proc->ExitType();
+ if (et == EExitPending) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+static void qt_create_symbian_commandline(const QStringList &arguments, QString& commandLine)
+{
+ for (int i=0; i<arguments.size(); ++i) {
+ QString tmp = arguments.at(i);
+ // in the case of \" already being in the string the \ must also be escaped
+ tmp.replace( QLatin1String("\\\""), QLatin1String("\\\\\"") );
+ // escape a single " because the arguments will be parsed
+ tmp.replace( QLatin1String("\""), QLatin1String("\\\"") );
+ if (tmp.isEmpty() || tmp.contains(QLatin1Char(' ')) || tmp.contains(QLatin1Char('\t'))) {
+ // The argument must not end with a \ since this would be interpreted
+ // as escaping the quote -- rather put the \ behind the quote: e.g.
+ // rather use "foo"\ than "foo\"
+ QString endQuote(QLatin1String("\""));
+ int i = tmp.length();
+ while (i>0 && tmp.at(i-1) == QLatin1Char('\\')) {
+ --i;
+ endQuote += QLatin1String("\\");
+ }
+ commandLine += QLatin1String(" \"") + tmp.left(i) + endQuote;
+ } else {
+ commandLine += QLatin1Char(' ') + tmp;
+ }
+ }
+}
+
+static TInt qt_create_symbian_process(RProcess **proc, const QString &programName, const QStringList &arguments)
+{
+ RProcess* newProc = NULL;
+ newProc = new RProcess();
+
+ if (!newProc) {
+ return KErrNoMemory;
+ }
+
+ QString commandLine;
+ qt_create_symbian_commandline(arguments, commandLine);
+
+ TPtrC program_ptr(reinterpret_cast<const TText*>(programName.constData()));
+ TPtrC cmdline_ptr(reinterpret_cast<const TText*>(commandLine.constData()));
+
+ TInt err = newProc->Create(program_ptr, cmdline_ptr);
+
+ if (err == KErrNotFound){
+ // Strip path from program name and try again (i.e. try from default location "\sys\bin")
+ int index = programName.lastIndexOf(QChar('\\'));
+ int index2 = programName.lastIndexOf(QChar('/'));
+ index = qMax(index, index2);
+
+ if(index != -1 && programName.length() >= index){
+ QString strippedName;
+ strippedName = programName.mid(index+1);
+ QPROCESS_DEBUG_PRINT("qt_create_symbian_process() Process '%s' not found, try stripped version '%s'", qPrintable(programName), qPrintable(strippedName));
+
+ TPtrC stripped_ptr(reinterpret_cast<const TText*>(strippedName.constData()));
+ err = newProc->Create(stripped_ptr, cmdline_ptr);
+
+ if (err != KErrNone) {
+ QPROCESS_DEBUG_PRINT("qt_create_symbian_process() Unable to create process '%s': %d", qPrintable(strippedName), err);
+ }
+ }
+ }
+
+ if (err == KErrNone) {
+ *proc = newProc;
+ } else {
+ delete newProc;
+ }
+
+ return err;
+}
+
+static qint64 qt_native_read(int fd, char *data, qint64 maxlen)
+{
+ qint64 ret = 0;
+ do {
+ ret = ::read(fd, data, maxlen);
+ } while (ret == -1 && errno == EINTR);
+
+ QPROCESS_DEBUG_PRINT("qt_native_read(): fd: %d, result: %d, errno = %d", fd, (int)ret, errno);
+
+ return ret;
+}
+
+static qint64 qt_native_write(int fd, const char *data, qint64 len)
+{
+ qint64 ret = 0;
+ do {
+ ret = ::write(fd, data, len);
+ } while (ret == -1 && errno == EINTR);
+
+ QPROCESS_DEBUG_PRINT("qt_native_write(): fd: %d, result: %d, errno = %d", fd, (int)ret, errno);
+
+ return ret;
+}
+
+static void qt_native_close(int fd)
+{
+ int ret;
+ do {
+ ret = ::close(fd);
+ } while (ret == -1 && errno == EINTR);
+}
+
+static void qt_create_pipe(int *pipe)
+{
+ if (pipe[0] != -1)
+ qt_native_close(pipe[0]);
+ if (pipe[1] != -1)
+ qt_native_close(pipe[1]);
+ if (::pipe(pipe) != 0) {
+ qWarning("QProcessPrivate::createPipe: Cannot create pipe %p: %s",
+ pipe, qPrintable(qt_error_string(errno)));
+ } else {
+ QPROCESS_DEBUG_PRINT("qt_create_pipe(): Created pipe %d - %d", pipe[0], pipe[1]);
+ }
+}
+
+// Called from ProcessManagerThread
+CProcessActive* CProcessActive::construct(QProcess* process,
+ RProcess** proc,
+ int serial,
+ int deathPipe)
+{
+ QPROCESS_ASSERT((process || proc || *proc),
+ EProcessActiveNullParameter,
+ "CProcessActive::construct(): process (0x%x), proc (0x%x) or *proc == NULL, not creating an instance", process, proc)
+
+ CProcessActive* newInstance = new CProcessActive();
+
+ if (!newInstance) {
+ QPROCESS_DEBUG_PRINT("CProcessActive::construct(): Failed to create new instance");
+ } else {
+ newInstance->process = process;
+ newInstance->pproc = proc;
+ newInstance->serial = serial;
+ newInstance->deathPipe = deathPipe;
+ newInstance->errorValue = false;
+ }
+
+ return newInstance;
+}
+
+// Called from ProcessManagerThread
+CProcessActive::CProcessActive()
+ : CActive(CActive::EPriorityStandard)
+{
+ // Nothing to do
+}
+
+// Called from ProcessManagerThread
+CProcessActive::~CProcessActive()
+{
+ process = NULL;
+ pproc = NULL;
+}
+
+// Called from ProcessManagerThread
+void CProcessActive::start()
+{
+ if (qt_rprocess_running(*pproc)) {
+ CActiveScheduler::Add(this);
+ (*pproc)->Logon(iStatus);
+ SetActive();
+ QPROCESS_DEBUG_PRINT("CProcessActive::start(): Started monitoring for process exit.");
+ } else {
+ QPROCESS_DEBUG_PRINT("CProcessActive::start(): Process doesn't exist or is already dead");
+ // Assume process has already died
+ qt_native_write(deathPipe, "", 1);
+ errorValue = true;
+ }
+}
+
+// Called from ProcessManagerThread
+void CProcessActive::stop()
+{
+ QPROCESS_DEBUG_PRINT("CProcessActive::stop()");
+
+ // Remove this from scheduler (also cancels the request)
+ Deque();
+}
+
+bool CProcessActive::error()
+{
+ return errorValue;
+}
+
+// Called from ProcessManagerThread
+void CProcessActive::RunL()
+{
+ // If this method gets executed, the monitored process has died
+
+ // Notify main thread
+ qt_native_write(deathPipe, "", 1);
+ QPROCESS_DEBUG_PRINT("CProcessActive::RunL() sending death notice to %d", deathPipe);
+}
+
+// Called from ProcessManagerThread
+TInt CProcessActive::RunError(TInt aError)
+{
+ Q_UNUSED(aError);
+ // Handle RunL leave (should never happen)
+ QPROCESS_ASSERT(0, EProcessActiveRunError, "CProcessActive::RunError(): Should never get here!")
+ return 0;
+}
+
+// Called from ProcessManagerThread
+void CProcessActive::DoCancel()
+{
+ QPROCESS_DEBUG_PRINT("CProcessActive::DoCancel()");
+
+ if (qt_rprocess_running(*pproc)) {
+ (*pproc)->LogonCancel(iStatus);
+ QPROCESS_DEBUG_PRINT("CProcessActive::DoCancel(): Stopped monitoring for process exit.");
+ } else {
+ QPROCESS_DEBUG_PRINT("CProcessActive::DoCancel(): Process doesn't exist");
+ }
+}
+
+
+// Called from ProcessManagerThread
+CProcessManagerMediator* CProcessManagerMediator::construct()
+{
+ CProcessManagerMediator* newInstance = new CProcessManagerMediator;
+ TInt err(KErrNone);
+
+ newInstance->currentCommand = ENoCommand;
+ newInstance->currentObserver = NULL;
+
+ if (newInstance) {
+ err = newInstance->processManagerThread.Open(newInstance->processManagerThread.Id());
+ QPROCESS_ASSERT((err == KErrNone),
+ EProcessManagerMediatorThreadOpenFailed,
+ "CProcessManagerMediator::construct(): Failed to open processManagerThread (err:%d)", err)
+ } else {
+ QPROCESS_ASSERT(0,
+ EProcessManagerMediatorCreationFailed,
+ "CProcessManagerMediator::construct(): Failed to open construct mediator")
+ }
+
+ // Activate mediator
+ CActiveScheduler::Add(newInstance);
+ newInstance->iStatus = KRequestPending;
+ newInstance->SetActive();
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::construct(): new instance successfully created and activated");
+
+ return newInstance;
+}
+
+// Called from ProcessManagerThread
+CProcessManagerMediator::CProcessManagerMediator()
+ : CActive(CActive::EPriorityStandard)
+{
+ // Nothing to do
+}
+
+// Called from ProcessManagerThread
+CProcessManagerMediator::~CProcessManagerMediator()
+{
+ processManagerThread.Close();
+ currentCommand = ENoCommand;
+ currentObserver = NULL;
+}
+
+// Called from main thread
+bool CProcessManagerMediator::add(CProcessActive* processObserver)
+{
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::add()");
+ return notify(processObserver, EAdd);
+}
+
+// Called from main thread
+void CProcessManagerMediator::remove(CProcessActive* processObserver)
+{
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::remove()");
+ notify(processObserver, ERemove);
+}
+
+// Called from main thread
+void CProcessManagerMediator::terminate()
+{
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::terminate()");
+ notify(NULL, ETerminate);
+}
+
+// Called from main thread
+bool CProcessManagerMediator::notify(CProcessActive* processObserver, Commands command)
+{
+ bool success(true);
+
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::Notify(): Command: %d, processObserver: 0x%x", command, processObserver);
+
+ QPROCESS_ASSERT((command == ETerminate || processObserver),
+ EProcessManagerMediatorNullObserver,
+ "CProcessManagerMediator::Notify(): NULL processObserver not allowed for command: %d", command)
+
+ QPROCESS_ASSERT(IsActive(),
+ EProcessManagerMediatorInactive,
+ "CProcessManagerMediator::Notify(): Mediator is not active!")
+
+ QPROCESS_ASSERT(iStatus==KRequestPending,
+ EProcessManagerMediatorNotPending,
+ "CProcessManagerMediator::Notify(): Mediator request not pending!")
+
+ currentObserver = processObserver;
+ currentCommand = command;
+
+ // Sync with process manager thread
+ TRequestStatus pmStatus;
+ processManagerThread.Rendezvous(pmStatus);
+
+ // Complete request -> RunL will run in the process manager thread
+ TRequestStatus* status = &iStatus;
+ processManagerThread.RequestComplete(status, command);
+
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::Notify(): Waiting process manager to complete...");
+ User::WaitForRequest(pmStatus);
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::Notify(): Wait over");
+
+ if (currentObserver) {
+ success = !(currentObserver->error());
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::Notify(): success = %d", success);
+ }
+
+ currentObserver = NULL;
+ currentCommand = ENoCommand;
+
+ return success;
+}
+
+// Called from ProcessManagerThread
+void CProcessManagerMediator::RunL()
+{
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::RunL(): currentCommand: %d, iStatus: %d", currentCommand, iStatus.Int());
+ switch (currentCommand) {
+ case EAdd:
+ currentObserver->start();
+ break;
+ case ERemove:
+ currentObserver->stop();
+ break;
+ case ETerminate:
+ Deque();
+ CActiveScheduler::Stop();
+ return;
+ default:
+ QPROCESS_ASSERT(0,
+ EProcessManagerMediatorInvalidCmd,
+ "CProcessManagerMediator::RunL(): Invalid command!")
+ break;
+ }
+
+ iStatus = KRequestPending;
+ SetActive();
+
+ // Notify main thread that we are done
+ RThread::Rendezvous(KErrNone);
+}
+
+// Called from ProcessManagerThread
+TInt CProcessManagerMediator::RunError(TInt aError)
+{
+ Q_UNUSED(aError);
+ // Handle RunL leave (should never happen)
+ QPROCESS_ASSERT(0,
+ EProcessManagerMediatorRunError,
+ "CProcessManagerMediator::RunError(): Should never get here!")
+ return 0;
+}
+
+// Called from ProcessManagerThread
+void CProcessManagerMediator::DoCancel()
+{
+ QPROCESS_DEBUG_PRINT("CProcessManagerMediator::DoCancel()");
+ TRequestStatus* status = &iStatus;
+ processManagerThread.RequestComplete(status, KErrCancel);
+}
+
+Q_GLOBAL_STATIC(QProcessManager, processManager)
+
+TInt processManagerThreadFunction(TAny* param)
+{
+ QPROCESS_ASSERT(param,
+ EProcessManagerNullParam,
+ "processManagerThreadFunction(): NULL param")
+
+ QProcessManager* manager = reinterpret_cast<QProcessManager*>(param);
+
+ CActiveScheduler* scheduler = new CQtActiveScheduler();
+
+ QPROCESS_ASSERT(scheduler,
+ EProcessManagerSchedulerCreationFail,
+ "processManagerThreadFunction(): Scheduler creation failed")
+
+ CActiveScheduler::Install(scheduler);
+
+ //Creating mediator also adds it to scheduler and activates it. Failure will panic.
+ manager->setMediator(CProcessManagerMediator::construct());
+ RThread::Rendezvous(KErrNone);
+
+ CActiveScheduler::Start();
+
+ CActiveScheduler::Install(NULL);
+ delete scheduler;
+
+ return KErrNone;
+}
+
+QProcessManager::QProcessManager()
+ : mediator(NULL), threadStarted(false)
+{
+ TInt err = managerMutex.CreateLocal();
+
+ QPROCESS_ASSERT(err == KErrNone,
+ EProcessManagerMutexCreationFail,
+ "QProcessManager::QProcessManager(): Failed to create new managerMutex (err: %d)", err)
+}
+
+QProcessManager::~QProcessManager()
+{
+ QPROCESS_DEBUG_PRINT("QProcessManager::~QProcessManager()");
+ // Cancel death listening for all child processes
+ if (mediator) {
+ QMap<int, CProcessActive *>::Iterator it = children.begin();
+ while (it != children.end()) {
+ // Remove all monitors
+ CProcessActive *active = it.value();
+ mediator->remove(active);
+
+ QPROCESS_DEBUG_PRINT("QProcessManager::~QProcessManager() removed listening for a process");
+ ++it;
+ }
+
+ // Terminate process manager thread.
+ mediator->terminate();
+ delete mediator;
+ }
+
+ qDeleteAll(children.values());
+ children.clear();
+ managerThread.Close();
+ managerMutex.Close();
+}
+
+void QProcessManager::startThread()
+{
+ lock();
+
+ if (!threadStarted) {
+ TInt err = managerThread.Create(KQProcessManagerThreadName,
+ processManagerThreadFunction,
+ 0x5000,
+ (RAllocator*)NULL,
+ (TAny*)this,
+ EOwnerProcess);
+
+ QPROCESS_ASSERT(err == KErrNone,
+ EProcessManagerThreadCreationFail,
+ "QProcessManager::startThread(): Failed to create new managerThread (err:%d)", err)
+
+ threadStarted = true;
+
+ // Manager thread must start running before we continue, so sync with rendezvous
+ TRequestStatus status;
+ managerThread.Rendezvous(status);
+ managerThread.Resume();
+ User::WaitForRequest(status);
+ }
+
+ unlock();
+}
+
+static QBasicAtomicInt idCounter = Q_BASIC_ATOMIC_INITIALIZER(1);
+
+bool QProcessManager::add(QProcess *process)
+{
+ QPROCESS_ASSERT(process,
+ EProcessManagerNullParam,
+ "QProcessManager::add(): Failed to add CProcessActive to ProcessManager - NULL process")
+
+ lock();
+
+ int serial = idCounter.fetchAndAddRelaxed(1);
+ process->d_func()->serial = serial;
+
+ QPROCESS_DEBUG_PRINT("QProcessManager::add(): serial: %d, deathPipe: %d - %d, symbianProcess: 0x%x", serial, process->d_func()->deathPipe[0], process->d_func()->deathPipe[1], process->d_func()->symbianProcess);
+
+ CProcessActive* newActive =
+ CProcessActive::construct(process,
+ &(process->d_func()->symbianProcess),
+ serial,
+ process->d_func()->deathPipe[1]);
+
+ if (newActive){
+ if (mediator->add(newActive)) {
+ children.insert(serial, newActive);
+ unlock();
+ return true;
+ } else {
+ QPROCESS_DEBUG_PRINT("QProcessManager::add(): Failed to add CProcessActive to ProcessManager");
+ delete newActive;
+ }
+ }
+
+ unlock();
+
+ return false;
+}
+
+void QProcessManager::remove(QProcess *process)
+{
+ QPROCESS_ASSERT(process,
+ EProcessManagerNullParam,
+ "QProcessManager::remove(): Failed to remove CProcessActive from ProcessManager - NULL process")
+
+ lock();
+
+ int serial = process->d_func()->serial;
+ CProcessActive *active = children.value(serial);
+ if (!active) {
+ unlock();
+ return;
+ }
+
+ mediator->remove(active);
+
+ children.remove(serial);
+ delete active;
+
+ unlock();
+}
+
+void QProcessPrivate::destroyPipe(int *pipe)
+{
+ if (pipe[1] != -1) {
+ qt_native_close(pipe[1]);
+ pipe[1] = -1;
+ }
+ if (pipe[0] != -1) {
+ qt_native_close(pipe[0]);
+ pipe[0] = -1;
+ }
+}
+
+bool QProcessPrivate::createChannel(Channel &channel)
+{
+ Q_UNUSED(channel);
+ // No channels used
+ return false;
+}
+
+void QProcessPrivate::startProcess()
+{
+ Q_Q(QProcess);
+
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::startProcess()");
+
+ // Start the process (platform dependent)
+ q->setProcessState(QProcess::Starting);
+
+ processManager()->startThread();
+
+ qt_create_pipe(deathPipe);
+ if (threadData->eventDispatcher) {
+ deathNotifier = new QSocketNotifier(deathPipe[0],
+ QSocketNotifier::Read, q);
+ QObject::connect(deathNotifier, SIGNAL(activated(int)),
+ q, SLOT(_q_processDied()));
+ }
+
+ TInt err = qt_create_symbian_process(&symbianProcess, program, arguments);
+
+ if (err == KErrNone) {
+ pid = symbianProcess->Id();
+
+ ::fcntl(deathPipe[0], F_SETFL, ::fcntl(deathPipe[0], F_GETFL) | O_NONBLOCK);
+
+ if (!processManager()->add(q)) {
+ qWarning("QProcessPrivate::startProcess(): Failed to start monitoring for process death.");
+ err = KErrNoMemory;
+ }
+ }
+
+ if (err != KErrNone) {
+ // Cleanup, report error and return
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::startProcess() Process open failed, err: %d, '%s'", err, qPrintable(program));
+ q->setProcessState(QProcess::NotRunning);
+ processError = QProcess::FailedToStart;
+ q->setErrorString(QLatin1String(QT_TRANSLATE_NOOP(QProcess, "Resource error (qt_create_symbian_process failure)")));
+ emit q->error(processError);
+ cleanup();
+ return;
+ }
+
+ processLaunched = true;
+
+ symbianProcess->Resume();
+
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::startProcess(): this: 0x%x, pid: %d", this, (TUint)pid);
+
+ // Notify child start
+ _q_startupNotification();
+
+}
+
+bool QProcessPrivate::processStarted()
+{
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::processStarted() == %s", processLaunched ? "true" : "false");
+
+ // Since we cannot get information whether process has actually been launched
+ // or not in Symbian, we need to fake it. Assume process is started if launch was
+ // successful.
+
+ return processLaunched;
+}
+
+qint64 QProcessPrivate::bytesAvailableFromStdout() const
+{
+ // In Symbian, zero bytes are always available
+ return 0;
+}
+
+qint64 QProcessPrivate::bytesAvailableFromStderr() const
+{
+ // In Symbian, zero bytes are always available
+ return 0;
+}
+
+qint64 QProcessPrivate::readFromStdout(char *data, qint64 maxlen)
+{
+ Q_UNUSED(data);
+ Q_UNUSED(maxlen);
+ // In Symbian, zero bytes are always read
+ return 0;
+}
+
+qint64 QProcessPrivate::readFromStderr(char *data, qint64 maxlen)
+{
+ Q_UNUSED(data);
+ Q_UNUSED(maxlen);
+ // In Symbian, zero bytes are always read
+ return 0;
+}
+
+qint64 QProcessPrivate::writeToStdin(const char *data, qint64 maxlen)
+{
+ Q_UNUSED(data);
+ Q_UNUSED(maxlen);
+ // In Symbian, zero bytes are always written
+ return 0;
+}
+
+void QProcessPrivate::terminateProcess()
+{
+ // Not allowed by platform security - will panic kern-exec 46 if process has been started.
+ // Works if process is not yet started.
+ if (qt_rprocess_running(symbianProcess)) {
+ symbianProcess->Terminate(0);
+ } else {
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::terminateProcess(), Process not running");
+ }
+}
+
+void QProcessPrivate::killProcess()
+{
+ // Not allowed by platform security - will panic kern-exec 46 if process has been started.
+ // Works if process is not yet started.
+ if (qt_rprocess_running(symbianProcess)) {
+ symbianProcess->Kill(0);
+ } else {
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::killProcess(), Process not running");
+ }
+}
+
+bool QProcessPrivate::waitForStarted(int msecs)
+{
+ Q_UNUSED(msecs);
+ // Since we can get no actual feedback from process beyond its death,
+ // assume that started has already been emitted if process has been launched
+ return processLaunched;
+}
+
+bool QProcessPrivate::waitForReadyRead(int msecs)
+{
+ // Functionality not supported in Symbian
+ Q_UNUSED(msecs);
+ return false;
+}
+
+bool QProcessPrivate::waitForBytesWritten(int msecs)
+{
+ // Functionality not supported in Symbian
+ Q_UNUSED(msecs);
+ return false;
+}
+
+bool QProcessPrivate::waitForFinished(int msecs)
+{
+ Q_Q(QProcess);
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForFinished(%d)", msecs);
+
+ TRequestStatus timerStatus = 0;
+ TRequestStatus logonStatus = 0;
+ bool timeoutOccurred = false;
+
+ // Logon to process to observe its death
+ if (qt_rprocess_running(symbianProcess)) {
+ symbianProcess->Logon(logonStatus);
+
+ // Create timer
+ RTimer timer;
+ timer.CreateLocal();
+ TTimeIntervalMicroSeconds32 interval(msecs*1000);
+ timer.After(timerStatus, interval);
+
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForFinished() - Waiting...");
+ User::WaitForRequest(logonStatus, timerStatus);
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForFinished() - Wait completed");
+
+ if (timerStatus == KErrNone) {
+ timeoutOccurred = true;
+ }
+
+ timer.Cancel();
+ timer.Close();
+
+ symbianProcess->LogonCancel(logonStatus);
+
+ // Eat cancel request completion so that it won't mess up main thread scheduling later
+ User::WaitForRequest(logonStatus, timerStatus);
+ } else {
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForFinished(), qt_rprocess_running returned false");
+ }
+
+ if (timeoutOccurred) {
+ processError = QProcess::Timedout;
+ q->setErrorString(QLatin1String(QT_TRANSLATE_NOOP(QProcess, "Process operation timed out")));
+ return false;
+ }
+
+ _q_processDied();
+
+ return true;
+}
+
+bool QProcessPrivate::waitForWrite(int msecs)
+{
+ // Functionality not supported in Symbian
+ Q_UNUSED(msecs);
+ return false;
+}
+
+// Deceptively named function. Exit code is actually got in waitForDeadChild().
+void QProcessPrivate::findExitCode()
+{
+ Q_Q(QProcess);
+ processManager()->remove(q);
+}
+
+bool QProcessPrivate::waitForDeadChild()
+{
+ Q_Q(QProcess);
+
+ // read a byte from the death pipe
+ char c;
+ qt_native_read(deathPipe[0], &c, 1);
+
+ if (symbianProcess && symbianProcess->Handle()) {
+ TExitType et = symbianProcess->ExitType();
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForDeadChild() symbianProcess->ExitType: %d", et);
+ if (et != EExitPending) {
+ processManager()->remove(q);
+ exitCode = symbianProcess->ExitReason();
+ crashed = (et == EExitPanic);
+#if defined QPROCESS_DEBUG
+ TExitCategoryName catName = symbianProcess->ExitCategory();
+ qDebug() << "QProcessPrivate::waitForDeadChild() dead with exitCode"
+ << exitCode << ", crashed:" << crashed
+ << ", category:" << QString::fromUtf16(catName.Ptr());
+#endif
+ } else {
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForDeadChild() not dead!");
+ }
+ }
+
+ return true;
+}
+
+void QProcessPrivate::_q_notified()
+{
+ // Nothing to do in Symbian
+}
+
+/*! \internal
+ */
+bool QProcessPrivate::startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory, qint64 *pid)
+{
+ QPROCESS_DEBUG_PRINT("QProcessPrivate::startDetached()");
+ Q_UNUSED(workingDirectory);
+
+ RProcess* newProc = NULL;
+
+ TInt err = qt_create_symbian_process(&newProc, program, arguments);
+
+ if (err == KErrNone) {
+ if (pid) {
+ *pid = (qint64)newProc->Id();
+ }
+
+ newProc->Resume();
+ newProc->Close();
+ return true;
+ }
+
+ return false;
+}
+
+
+void QProcessPrivate::initializeProcessManager()
+{
+ (void) processManager();
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_PROCESS
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 94dfd4d..c3c7b76 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -377,7 +377,6 @@ QResource::QResource(const QString &file, const QLocale &locale) : d_ptr(new QRe
*/
QResource::~QResource()
{
- delete d_ptr;
}
/*!
diff --git a/src/corelib/io/qresource.h b/src/corelib/io/qresource.h
index 1e9b2d5..f260b68 100644
--- a/src/corelib/io/qresource.h
+++ b/src/corelib/io/qresource.h
@@ -91,7 +91,7 @@ protected:
QStringList children() const;
protected:
- QResourcePrivate *d_ptr;
+ QScopedPointer<QResourcePrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QResource)
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 6152518..afaaf28 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -1106,10 +1106,10 @@ static QString getPath(QSettings::Format format, QSettings::Scope scope)
QString homePath = QDir::homePath();
QString systemPath;
- globalMutex()->lock();
+ QMutexLocker locker(globalMutex());
PathHash *pathHash = pathHashFunc();
bool loadSystemPath = pathHash->isEmpty();
- globalMutex()->unlock();
+ locker.unlock();
if (loadSystemPath) {
/*
@@ -1121,7 +1121,7 @@ static QString getPath(QSettings::Format format, QSettings::Scope scope)
systemPath += QLatin1Char('/');
}
- QMutexLocker locker(globalMutex());
+ locker.relock();
if (pathHash->isEmpty()) {
/*
Lazy initialization of pathHash. We initialize the
@@ -1181,9 +1181,6 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format,
int i;
initFormat();
- for (i = 0; i < NumConfFiles; ++i)
- confFiles[i] = 0;
-
QString org = organization;
if (org.isEmpty()) {
setStatus(QSettings::AccessError);
@@ -1196,14 +1193,14 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format,
if (scope == QSettings::UserScope) {
QString userPath = getPath(format, QSettings::UserScope);
if (!application.isEmpty())
- confFiles[F_User | F_Application] = QConfFile::fromName(userPath + appFile, true);
- confFiles[F_User | F_Organization] = QConfFile::fromName(userPath + orgFile, true);
+ confFiles[F_User | F_Application].reset(QConfFile::fromName(userPath + appFile, true));
+ confFiles[F_User | F_Organization].reset(QConfFile::fromName(userPath + orgFile, true));
}
QString systemPath = getPath(format, QSettings::SystemScope);
if (!application.isEmpty())
- confFiles[F_System | F_Application] = QConfFile::fromName(systemPath + appFile, false);
- confFiles[F_System | F_Organization] = QConfFile::fromName(systemPath + orgFile, false);
+ confFiles[F_System | F_Application].reset(QConfFile::fromName(systemPath + appFile, false));
+ confFiles[F_System | F_Organization].reset(QConfFile::fromName(systemPath + orgFile, false));
for (i = 0; i < NumConfFiles; ++i) {
if (confFiles[i]) {
@@ -1222,9 +1219,7 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(const QString &fileName,
{
initFormat();
- confFiles[0] = QConfFile::fromName(fileName, true);
- for (int i = 1; i < NumConfFiles; ++i)
- confFiles[i] = 0;
+ confFiles[0].reset(QConfFile::fromName(fileName, true));
initAccess();
}
@@ -1241,19 +1236,27 @@ QConfFileSettingsPrivate::~QConfFileSettingsPrivate()
usedHash->remove(confFiles[i]->name);
if (confFiles[i]->size == 0) {
- delete confFiles[i];
+ delete confFiles[i].take();
} else if (unusedCache) {
- // compute a better size?
- unusedCache->insert(confFiles[i]->name, confFiles[i],
+ QT_TRY {
+ // compute a better size?
+ unusedCache->insert(confFiles[i]->name, confFiles[i].data(),
10 + (confFiles[i]->originalKeys.size() / 4));
+ confFiles[i].take();
+ } QT_CATCH(...) {
+ // out of memory. Do not cache the file.
+ delete confFiles[i].take();
+ }
}
}
+ // prevent the ScopedPointer to deref it again.
+ confFiles[i].take();
}
}
void QConfFileSettingsPrivate::remove(const QString &key)
{
- QConfFile *confFile = confFiles[spec];
+ QConfFile *confFile = confFiles[spec].data();
if (!confFile)
return;
@@ -1280,7 +1283,7 @@ void QConfFileSettingsPrivate::remove(const QString &key)
void QConfFileSettingsPrivate::set(const QString &key, const QVariant &value)
{
- QConfFile *confFile = confFiles[spec];
+ QConfFile *confFile = confFiles[spec].data();
if (!confFile)
return;
@@ -1297,7 +1300,7 @@ bool QConfFileSettingsPrivate::get(const QString &key, QVariant *value) const
bool found = false;
for (int i = 0; i < NumConfFiles; ++i) {
- if (QConfFile *confFile = confFiles[i]) {
+ if (QConfFile *confFile = confFiles[i].data()) {
QMutexLocker locker(&confFile->mutex);
if (!confFile->addedKeys.isEmpty()) {
@@ -1332,7 +1335,7 @@ QStringList QConfFileSettingsPrivate::children(const QString &prefix, ChildSpec
int startPos = prefix.size();
for (int i = 0; i < NumConfFiles; ++i) {
- if (QConfFile *confFile = confFiles[i]) {
+ if (QConfFile *confFile = confFiles[i].data()) {
QMutexLocker locker(&confFile->mutex);
if (thePrefix.isEmpty()) {
@@ -1365,7 +1368,7 @@ QStringList QConfFileSettingsPrivate::children(const QString &prefix, ChildSpec
void QConfFileSettingsPrivate::clear()
{
- QConfFile *confFile = confFiles[spec];
+ QConfFile *confFile = confFiles[spec].data();
if (!confFile)
return;
@@ -1381,7 +1384,7 @@ void QConfFileSettingsPrivate::sync()
// error we just try to go on and make the best of it
for (int i = 0; i < NumConfFiles; ++i) {
- QConfFile *confFile = confFiles[i];
+ QConfFile *confFile = confFiles[i].data();
if (confFile) {
QMutexLocker locker(&confFile->mutex);
syncConfFile(i);
@@ -1396,7 +1399,7 @@ void QConfFileSettingsPrivate::flush()
QString QConfFileSettingsPrivate::fileName() const
{
- QConfFile *confFile = confFiles[spec];
+ QConfFile *confFile = confFiles[spec].data();
if (!confFile)
return QString();
return confFile->name;
@@ -1407,7 +1410,7 @@ bool QConfFileSettingsPrivate::isWritable() const
if (format > QSettings::IniFormat && !writeFunc)
return false;
- QConfFile *confFile = confFiles[spec];
+ QConfFile *confFile = confFiles[spec].data();
if (!confFile)
return false;
@@ -1416,7 +1419,7 @@ bool QConfFileSettingsPrivate::isWritable() const
void QConfFileSettingsPrivate::syncConfFile(int confFileNo)
{
- QConfFile *confFile = confFiles[confFileNo];
+ QConfFile *confFile = confFiles[confFileNo].data();
bool readOnly = confFile->addedKeys.isEmpty() && confFile->removedKeys.isEmpty();
bool ok;
@@ -2759,11 +2762,13 @@ QSettings::QSettings(const QString &fileName, Format format)
QSettings::~QSettings()
{
Q_D(QSettings);
- if (d->pendingChanges)
- d->flush();
-#ifdef QT_NO_QOBJECT
- delete d;
-#endif
+ if (d->pendingChanges) {
+ QT_TRY {
+ d->flush();
+ } QT_CATCH(...) {
+ ; // ok. then don't flush but at least don't throw in the destructor
+ }
+ }
}
/*!
@@ -3566,8 +3571,7 @@ void QSettings::setPath_helper(Scope scope, const QString &organization, const Q
QSettingsPrivate *oldPriv = d;
QSettingsPrivate *newPriv = QSettingsPrivate::create(oldPriv->format, scope, organization, application);
static_cast<QObjectPrivate &>(*newPriv) = static_cast<QObjectPrivate &>(*oldPriv); // copy the QObject stuff over (hack)
- delete oldPriv;
- d_ptr = newPriv;
+ d_ptr.reset(newPriv);
}
/*! \fn bool QSettings::writeEntry(const QString &key, bool value)
diff --git a/src/corelib/io/qsettings.h b/src/corelib/io/qsettings.h
index cbb24ba..41bce89 100644
--- a/src/corelib/io/qsettings.h
+++ b/src/corelib/io/qsettings.h
@@ -78,7 +78,7 @@ class Q_CORE_EXPORT QSettings
#ifndef QT_NO_QOBJECT
Q_OBJECT
#else
- QSettingsPrivate *d_ptr;
+ QScopedPointer<QSettingsPrivate> d_ptr;
#endif
Q_DECLARE_PRIVATE(QSettings)
diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h
index 565aeb6..a0f19a4 100644
--- a/src/corelib/io/qsettings_p.h
+++ b/src/corelib/io/qsettings_p.h
@@ -300,7 +300,7 @@ private:
void ensureAllSectionsParsed(QConfFile *confFile) const;
void ensureSectionParsed(QConfFile *confFile, const QSettingsKey &key) const;
- QConfFile *confFiles[NumConfFiles];
+ QScopedSharedPointer<QConfFile> confFiles[NumConfFiles];
QSettings::ReadFunc readFunc;
QSettings::WriteFunc writeFunc;
QString extension;
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 728bf4f..2d0d9b8 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -512,6 +512,10 @@ QTemporaryFile::QTemporaryFile()
{
Q_D(QTemporaryFile);
d->templateName = QDir::tempPath() + QLatin1String("/qt_temp.XXXXXX");
+#ifdef Q_OS_SYMBIAN
+ //Just for verify that folder really exist on hardware
+ fileEngine()->mkdir( QDir::tempPath(), true );
+#endif
}
/*!
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 75c682a..0261c19 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -1114,9 +1114,6 @@ QTextStream::~QTextStream()
#endif
if (!d->writeBuffer.isEmpty())
d->flushWriteBuffer();
-
- delete d;
- d_ptr = 0;
}
/*!
diff --git a/src/corelib/io/qtextstream.h b/src/corelib/io/qtextstream.h
index 6302d34..cfacec6 100644
--- a/src/corelib/io/qtextstream.h
+++ b/src/corelib/io/qtextstream.h
@@ -46,6 +46,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qchar.h>
#include <QtCore/qlocale.h>
+#include <QtCore/qscopedpointer.h>
#ifndef QT_NO_TEXTCODEC
# ifdef QT3_SUPPORT
@@ -256,7 +257,7 @@ private:
Q_DISABLE_COPY(QTextStream)
- QTextStreamPrivate *d_ptr;
+ QScopedPointer<QTextStreamPrivate> d_ptr;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QTextStream::NumberFlags)
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index ecef555..f7d4208 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -88,9 +88,7 @@ mac {
unix {
SOURCES += \
- kernel/qcrashhandler.cpp \
- kernel/qsharedmemory_unix.cpp \
- kernel/qsystemsemaphore_unix.cpp
+ kernel/qcrashhandler.cpp
HEADERS += \
kernel/qcrashhandler_p.h
@@ -102,10 +100,24 @@ unix {
QMAKE_CXXFLAGS += $$QT_CFLAGS_GLIB
LIBS +=$$QT_LIBS_GLIB
}
+
+ symbian {
+ SOURCES += \
+ kernel/qeventdispatcher_symbian.cpp \
+ kernel/qcore_symbian_p.cpp \
+ kernel/qsharedmemory_symbian.cpp \
+ kernel/qsystemsemaphore_symbian.cpp
+ HEADERS += \
+ kernel/qeventdispatcher_symbian_p.h \
+ kernel/qcore_symbian_p.h
+ } else {
SOURCES += \
- kernel/qeventdispatcher_unix.cpp
+ kernel/qeventdispatcher_unix.cpp \
+ kernel/qsharedmemory_unix.cpp \
+ kernel/qsystemsemaphore_unix.cpp
HEADERS += \
kernel/qeventdispatcher_unix_p.h
+ }
contains(QT_CONFIG, clock-gettime):include($$QT_SOURCE_TREE/config.tests/unix/clock-gettime/clock-gettime.pri)
}
diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp
new file mode 100644
index 0000000..101ed44
--- /dev/null
+++ b/src/corelib/kernel/qcore_symbian_p.cpp
@@ -0,0 +1,178 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <exception>
+#include <e32base.h>
+#include <e32uid.h>
+#include "qcore_symbian_p.h"
+#include <string>
+
+QT_BEGIN_NAMESPACE
+
+/*
+ Helper function for calling into Symbian classes that expect a TDes&.
+ This function converts a QString to a TDes by allocating memory that
+ must be deleted by the caller.
+*/
+
+Q_CORE_EXPORT HBufC* qt_QString2HBufC(const QString& aString)
+{
+ HBufC *buffer;
+#ifdef QT_NO_UNICODE
+ TPtrC8 ptr(reinterpret_cast<const TUint8*>(aString.toLocal8Bit().constData()));
+#else
+ TPtrC16 ptr(qt_QString2TPtrC(aString));
+#endif
+ buffer = HBufC::New(ptr.Length());
+ Q_CHECK_PTR(buffer);
+ buffer->Des().Copy(ptr);
+ return buffer;
+}
+
+Q_CORE_EXPORT QString qt_TDesC2QStringL(const TDesC& aDescriptor)
+{
+#ifdef QT_NO_UNICODE
+ return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length());
+#else
+ return QString::fromUtf16(aDescriptor.Ptr(), aDescriptor.Length());
+#endif
+}
+
+QHBufC::QHBufC()
+ : m_hBufC(0)
+{
+}
+
+QHBufC::QHBufC(const QHBufC &src)
+{
+ m_hBufC = src.m_hBufC->Alloc();
+ Q_CHECK_PTR(m_hBufC);
+}
+
+/*!
+ \internal
+ Constructs a QHBufC from an HBufC. Note that the QHBufC instance takes
+ ownership of the HBufC.
+*/
+QHBufC::QHBufC(HBufC *src)
+ : m_hBufC(src)
+{
+}
+
+QHBufC::QHBufC(const QString &src)
+{
+ m_hBufC = qt_QString2HBufC(src);
+}
+
+QHBufC::~QHBufC()
+{
+ if (m_hBufC)
+ delete m_hBufC;
+}
+
+class QS60PluginResolver
+{
+public:
+ QS60PluginResolver()
+ : initTried(false) {}
+
+ ~QS60PluginResolver() {
+ lib.Close();
+ }
+
+ TLibraryFunction resolve(int ordinal) {
+ if (!initTried) {
+ init();
+ initTried = true;
+ }
+
+ if (lib.Handle())
+ return lib.Lookup(ordinal);
+ else
+ return reinterpret_cast<TLibraryFunction>(NULL);
+ }
+
+private:
+ void init() {
+ _LIT(KLibName_3_1, "qts60plugin_3_1.dll");
+ _LIT(KLibName_3_2, "qts60plugin_3_2.dll");
+ _LIT(KLibName_5_0, "qts60plugin_5_0.dll");
+ TPtrC libName;
+ TInt uidValue;
+ switch (QSysInfo::s60Version()) {
+ case QSysInfo::SV_S60_3_1:
+ libName.Set(KLibName_3_1);
+ uidValue = 0x2001E620;
+ break;
+ case QSysInfo::SV_S60_3_2:
+ libName.Set(KLibName_3_2);
+ uidValue = 0x2001E621;
+ break;
+ case QSysInfo::SV_S60_5_0: // Fall through to default
+ default:
+ // Default to 5.0 version, as any unknown platform is likely to be newer than that
+ libName.Set(KLibName_5_0);
+ uidValue = 0x2001E622;
+ break;
+ }
+
+ TUidType libUid(KDynamicLibraryUid, KSharedLibraryUid, TUid::Uid(uidValue));
+ lib.Load(libName, libUid);
+ }
+
+ RLibrary lib;
+ bool initTried;
+};
+
+Q_GLOBAL_STATIC(QS60PluginResolver, qt_s60_plugin_resolver);
+
+/*!
+ \internal
+ Resolves a platform version specific function from S60 plugin.
+ If plugin is missing or resolving fails for another reason, NULL is returned.
+*/
+Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal)
+{
+ return qt_s60_plugin_resolver()->resolve(ordinal);
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h
new file mode 100644
index 0000000..bd8f304
--- /dev/null
+++ b/src/corelib/kernel/qcore_symbian_p.h
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCORE_SYMBIAN_P_H
+#define QCORE_SYMBIAN_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <e32std.h>
+#include <QtCore/qglobal.h>
+#include <qstring.h>
+#include <qrect.h>
+#include <qhash.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+Q_CORE_EXPORT HBufC* qt_QString2HBufC(const QString& aString);
+
+Q_CORE_EXPORT QString qt_TDesC2QStringL(const TDesC& aDescriptor);
+inline QString qt_TDes2QStringL(const TDes& aDescriptor) { return qt_TDesC2QStringL(aDescriptor); }
+
+static inline QSize qt_TSize2QSize(const TSize& ts)
+{
+ return QSize(ts.iWidth, ts.iHeight);
+}
+
+static inline TSize qt_QSize2TSize(const QSize& qs)
+{
+ return TSize(qs.width(), qs.height());
+}
+
+static inline QRect qt_TRect2QRect(const TRect& tr)
+{
+ return QRect(tr.iTl.iX, tr.iTl.iY, tr.Width(), tr.Height());
+}
+
+static inline TRect qt_QRect2TRect(const QRect& qr)
+{
+ return TRect(TPoint(qr.left(), qr.top()), TSize(qr.width(), qr.height()));
+}
+
+// Returned TPtrC is valid as long as the given parameter is valid and unmodified
+static inline TPtrC qt_QString2TPtrC( const QString& string )
+{
+ return TPtrC16(static_cast<const TUint16*>(string.utf16()), string.length());
+}
+
+class Q_CORE_EXPORT QHBufC
+{
+public:
+ QHBufC();
+ QHBufC(const QHBufC &src);
+ QHBufC(HBufC *src);
+ QHBufC(const QString &src);
+ ~QHBufC();
+
+ inline operator HBufC *() { return m_hBufC; }
+ inline operator const HBufC *() const { return m_hBufC; }
+ inline HBufC *data() { return m_hBufC; }
+ inline const HBufC *data() const { return m_hBufC; }
+ inline HBufC & operator*() { return *m_hBufC; }
+ inline const HBufC & operator*() const { return *m_hBufC; }
+ inline HBufC * operator->() { return m_hBufC; }
+ inline const HBufC * operator->() const { return m_hBufC; }
+
+ inline bool operator==(const QHBufC &param) const { return data() == param.data(); }
+ inline bool operator!=(const QHBufC &param) const { return data() != param.data(); }
+
+private:
+ HBufC *m_hBufC;
+};
+
+inline uint qHash(TUid uid)
+{
+ return qHash(uid.iUid);
+}
+
+// S60 version specific function ordinals that can be resolved
+enum S60PluginFuncOrdinals
+{
+ S60Plugin_TimeFormatL = 1,
+ S60Plugin_GetTimeFormatSpec = 2,
+ S60Plugin_GetLongDateFormatSpec = 3,
+ S60Plugin_GetShortDateFormatSpec = 4,
+ S60Plugin_LocalizedDirectoryName = 5
+};
+
+Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal);
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif //QCORE_SYMBIAN_P_H
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index cb40f19..4fbd63c 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -62,7 +62,12 @@
#include <qlibraryinfo.h>
#include <private/qfactoryloader_p.h>
-#ifdef Q_OS_UNIX
+#ifdef Q_OS_SYMBIAN
+# include <exception>
+# include <f32file.h>
+# include "qeventdispatcher_symbian_p.h"
+# include "private/qcore_symbian_p.h"
+#elif defined(Q_OS_UNIX)
# if !defined(QT_NO_GLIB)
# include "qeventdispatcher_glib_p.h"
# endif
@@ -85,6 +90,21 @@
QT_BEGIN_NAMESPACE
+class QLockedMutexUnlocker
+{
+public:
+ inline explicit QLockedMutexUnlocker(QMutex *m)
+ : mtx(m)
+ { }
+ inline ~QLockedMutexUnlocker() { unlock(); }
+ inline void unlock() { if (mtx) mtx->unlock(); mtx = 0; }
+
+private:
+ Q_DISABLE_COPY(QLockedMutexUnlocker)
+
+ QMutex *mtx;
+};
+
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
extern QString qAppFileName();
#endif
@@ -156,7 +176,14 @@ void qRemovePostRoutine(QtCleanUpFunction p)
void Q_CORE_EXPORT qt_call_post_routines()
{
- QVFuncList *list = postRList();
+ QVFuncList *list = 0;
+ QT_TRY {
+ list = postRList();
+ } QT_CATCH(const std::bad_alloc &) {
+ // ignore - if we can't allocate a post routine list,
+ // there's a high probability that there's no post
+ // routine to be executed :)
+ }
if (!list)
return;
while (!list->isEmpty())
@@ -245,30 +272,34 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv)
QCoreApplicationPrivate::~QCoreApplicationPrivate()
{
+ if (threadData) {
#ifndef QT_NO_THREAD
- void *data = &threadData->tls;
- QThreadStorageData::finish((void **)data);
+ void *data = &threadData->tls;
+ QThreadStorageData::finish((void **)data);
#endif
- // need to clear the state of the mainData, just in case a new QCoreApplication comes along.
- QMutexLocker locker(&threadData->postEventList.mutex);
- for (int i = 0; i < threadData->postEventList.size(); ++i) {
- const QPostEvent &pe = threadData->postEventList.at(i);
- if (pe.event) {
- --pe.receiver->d_func()->postedEvents;
- pe.event->posted = false;
- delete pe.event;
+ // need to clear the state of the mainData, just in case a new QCoreApplication comes along.
+ QMutexLocker locker(&threadData->postEventList.mutex);
+ for (int i = 0; i < threadData->postEventList.size(); ++i) {
+ const QPostEvent &pe = threadData->postEventList.at(i);
+ if (pe.event) {
+ --pe.receiver->d_func()->postedEvents;
+ pe.event->posted = false;
+ delete pe.event;
+ }
}
+ threadData->postEventList.clear();
+ threadData->postEventList.recursion = 0;
+ threadData->quitNow = false;
}
- threadData->postEventList.clear();
- threadData->postEventList.recursion = 0;
- threadData->quitNow = false;
}
void QCoreApplicationPrivate::createEventDispatcher()
{
Q_Q(QCoreApplication);
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_SYMBIAN)
+ eventDispatcher = new QEventDispatcherSymbian(q);
+#elif defined(Q_OS_UNIX)
# if !defined(QT_NO_GLIB)
if (qgetenv("QT_NO_GLIB").isEmpty() && QEventDispatcherGlib::versionSupported())
eventDispatcher = new QEventDispatcherGlib(q);
@@ -306,6 +337,11 @@ void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver)
Q_UNUSED(currentThread);
Q_UNUSED(thr);
}
+#elif defined(Q_OS_SYMBIAN) && defined (QT_NO_DEBUG)
+// no implementation in release builds, but keep the symbol present
+void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver)
+{
+}
#endif
void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths()
@@ -313,10 +349,17 @@ void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths()
#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
QStringList *app_libpaths = coreappdata()->app_libpaths;
Q_ASSERT(app_libpaths);
+# if defined(Q_OS_SYMBIAN)
+ QString app_location( QCoreApplication::applicationDirPath() );
+ // File existence check for application's private dir requires additional '\' or
+ // platform security will not allow it.
+ if (app_location != QLibraryInfo::location(QLibraryInfo::PluginsPath) && QFile::exists(app_location + QLatin1Char('\\')) && !app_libpaths->contains(app_location))
+# else
QString app_location( QCoreApplication::applicationFilePath() );
app_location.truncate(app_location.lastIndexOf(QLatin1Char('/')));
app_location = QDir(app_location).canonicalPath();
if (app_location != QLibraryInfo::location(QLibraryInfo::PluginsPath) && QFile::exists(app_location) && !app_libpaths->contains(app_location))
+# endif
app_libpaths->append(app_location);
#endif
}
@@ -444,6 +487,13 @@ QCoreApplication::QCoreApplication(int &argc, char **argv)
{
init();
QCoreApplicationPrivate::eventDispatcher->startingUp();
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) && defined(Q_OS_SYMBIAN)
+ // Refresh factoryloader, as text codecs are requested during lib path
+ // resolving process and won't be therefore properly loaded.
+ // Unknown if this is symbian specific issue.
+ QFactoryLoader::refreshAll();
+#endif
+
}
extern void set_winapp_name();
@@ -520,7 +570,14 @@ QCoreApplication::~QCoreApplication()
#if !defined(QT_NO_THREAD)
#if !defined(QT_NO_CONCURRENT)
// Synchronize and stop the global thread pool threads.
- QThreadPool::globalInstance()->waitForDone();
+ QThreadPool *globalThreadPool = 0;
+ QT_TRY {
+ globalThreadPool = QThreadPool::globalInstance();
+ } QT_CATCH (...) {
+ // swallow the exception, since destructors shouldn't throw
+ }
+ if (globalThreadPool)
+ globalThreadPool->waitForDone();
#endif
QThread::cleanup();
#endif
@@ -616,17 +673,13 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
d->inEventHandler = true;
#endif
-#if defined(QT_NO_EXCEPTIONS)
- bool returnValue = notify(receiver, event);
-#else
bool returnValue;
- try {
+ QT_TRY {
returnValue = notify(receiver, event);
- } catch(...) {
+ } QT_CATCH (...) {
--threadData->loopLevel;
- throw;
+ QT_RETHROW;
}
-#endif
#ifdef QT_JAMBI_BUILD
// Restore the previous state if the object was not deleted..
@@ -955,7 +1008,7 @@ void QCoreApplication::exit(int returnCode)
The event is \e not deleted when the event has been sent. The normal
approach is to create the event on the stack, for example:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 0
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 0
\sa postEvent(), notify()
*/
@@ -1047,15 +1100,14 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority)
data->postEventList.mutex.lock();
}
+ QLockedMutexUnlocker locker(&data->postEventList.mutex);
+
// if this is one of the compressible events, do compression
if (receiver->d_func()->postedEvents
&& self && self->compressEvent(event, receiver, &data->postEventList)) {
- data->postEventList.mutex.unlock();
return;
}
- event->posted = true;
- ++receiver->d_func()->postedEvents;
if (event->type() == QEvent::DeferredDelete && data == QThreadData::current()) {
// remember the current running eventloop for DeferredDelete
// events posted in the receiver's thread
@@ -1076,8 +1128,10 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority)
QPostEventList::iterator at = qUpperBound(begin, end, priority);
data->postEventList.insert(at, QPostEvent(receiver, event, priority));
}
+ event->posted = true;
+ ++receiver->d_func()->postedEvents;
data->canWait = false;
- data->postEventList.mutex.unlock();
+ locker.unlock();
if (data->eventDispatcher)
data->eventDispatcher->wakeUp();
@@ -1472,7 +1526,7 @@ bool QCoreApplication::event(QEvent *e)
Example:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 1
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 1
\sa exit(), aboutToQuit(), QApplication::lastWindowClosed()
*/
@@ -1700,6 +1754,10 @@ bool QCoreApplicationPrivate::isTranslatorInstalled(QTranslator *translator)
function also assumes that the current directory has not been
changed by the application.
+ In Symbian this function will return the application private directory
+ in C-drive, not the path to executable itself, as those are always in
+ /sys/bin.
+
\sa applicationFilePath()
*/
QString QCoreApplication::applicationDirPath()
@@ -1711,7 +1769,32 @@ QString QCoreApplication::applicationDirPath()
QCoreApplicationPrivate *d = self->d_func();
if (d->cachedApplicationDirPath.isNull())
+#if defined(Q_OS_SYMBIAN)
+ {
+ QString appPath;
+ RProcess proc;
+ TInt err = proc.Open(proc.Id());
+ if (err == KErrNone) {
+#if defined(Q_CC_NOKIAX86)
+ // In emulator, always resolve the private dir on C-drive
+ appPath.append(QChar('C'));
+#else
+ appPath.append(QChar((proc.FileName())[0]));
+#endif
+ appPath.append(QLatin1String(":\\private\\"));
+ QString sid;
+ sid.setNum(proc.SecureId().iId, 16);
+ appPath.append(sid);
+ appPath.append(QLatin1Char('\\'));
+ proc.Close();
+ }
+
+ QFileInfo fi(appPath);
+ d->cachedApplicationDirPath = fi.exists() ? fi.canonicalFilePath() : QString();
+ }
+#else
d->cachedApplicationDirPath = QFileInfo(applicationFilePath()).path();
+#endif
return d->cachedApplicationDirPath;
}
@@ -1765,7 +1848,20 @@ QString QCoreApplication::applicationFilePath()
return d->cachedApplicationFilePath;
}
#endif
-#if defined( Q_OS_UNIX )
+#if defined(Q_OS_SYMBIAN)
+ QString appPath;
+ RProcess proc;
+ TInt err = proc.Open(proc.Id());
+ if (err == KErrNone) {
+ TFileName procName = proc.FileName();
+ appPath.append(QString(reinterpret_cast<const QChar*>(procName.Ptr()), procName.Length()));
+ proc.Close();
+ }
+
+ d->cachedApplicationFilePath = appPath;
+ return d->cachedApplicationFilePath;
+
+#elif defined( Q_OS_UNIX )
# ifdef Q_OS_LINUX
// Try looking for a /proc/<pid>/exe symlink first which points to
// the absolute path of the executable
@@ -2056,7 +2152,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive))
If you want to iterate over the list, you can use the \l foreach
pseudo-keyword:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 2
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 2
\sa setLibraryPaths(), addLibraryPath(), removeLibraryPath(), QLibrary,
{How to Create Qt Plugins}
@@ -2067,12 +2163,37 @@ QStringList QCoreApplication::libraryPaths()
if (!coreappdata()->app_libpaths) {
QStringList *app_libpaths = coreappdata()->app_libpaths = new QStringList;
QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath);
+#if defined(Q_OS_SYMBIAN)
+ // Add existing path on all drives for relative PluginsPath in Symbian
+ if (installPathPlugins.at(1) != QChar(':')) {
+ QString tempPath = installPathPlugins;
+ if (tempPath.at(tempPath.length()-1) != QChar('\\')) {
+ tempPath += QChar('\\');
+ }
+ RFs fs;
+ TInt err = fs.Connect();
+ if (err == KErrNone) {
+ TPtrC tempPathPtr(reinterpret_cast<const TText*>(tempPath.constData()));
+ TFindFile finder(fs);
+ err = finder.FindByDir(tempPathPtr, tempPathPtr);
+ while (err == KErrNone) {
+ QString foundDir = QString::fromUtf16(finder.File().Ptr(), finder.File().Length());
+ foundDir = QDir(foundDir).canonicalPath();
+ if (!app_libpaths->contains(foundDir))
+ app_libpaths->append(foundDir);
+ err = finder.Find();
+ }
+ fs.Close();
+ }
+ }
+#else
if (QFile::exists(installPathPlugins)) {
// Make sure we convert from backslashes to slashes.
installPathPlugins = QDir(installPathPlugins).canonicalPath();
if (!app_libpaths->contains(installPathPlugins))
app_libpaths->append(installPathPlugins);
}
+#endif
// If QCoreApplication is not yet instantiated,
// make sure we add the application path when we construct the QCoreApplication
@@ -2080,7 +2201,7 @@ QStringList QCoreApplication::libraryPaths()
const QByteArray libPathEnv = qgetenv("QT_PLUGIN_PATH");
if (!libPathEnv.isEmpty()) {
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
QLatin1Char pathSep(';');
#else
QLatin1Char pathSep(':');
@@ -2182,7 +2303,7 @@ void QCoreApplication::removeLibraryPath(const QString &path)
A function with the following signature that can be used as an
event filter:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 3
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 3
\sa setEventFilter()
*/
@@ -2379,7 +2500,7 @@ int QCoreApplication::loopLevel()
The function specified by \a ptr should take no arguments and should
return nothing. For example:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 4
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 4
Note that for an application- or module-wide cleanup,
qAddPostRoutine() is often not suitable. For example, if the
@@ -2393,7 +2514,7 @@ int QCoreApplication::loopLevel()
parent-child mechanism to call a cleanup function at the right
time:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 5
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 5
By selecting the right parent object, this can often be made to
clean up the module's data at the right moment.
@@ -2407,7 +2528,7 @@ int QCoreApplication::loopLevel()
translation functions, \c tr() and \c trUtf8(), with these
signatures:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 6
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 6
This macro is useful if you want to use QObject::tr() or
QObject::trUtf8() in classes that don't inherit from QObject.
@@ -2416,7 +2537,7 @@ int QCoreApplication::loopLevel()
class definition (before the first \c{public:} or \c{protected:}).
For example:
- \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 7
+ \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 7
The \a context parameter is normally the class name, but it can
be any string.
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index f7175ae..095d501 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -165,7 +165,7 @@ public:
virtual bool winEventFilter(MSG *message, long *result);
#endif
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
static void watchUnixSignal(int signal, bool watch);
#endif
@@ -195,6 +195,8 @@ private:
void init();
static QCoreApplication *self;
+
+ Q_DISABLE_COPY(QCoreApplication)
friend class QEventDispatcherUNIXPrivate;
friend class QApplication;
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h
index 9490ad7..c1118d1 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -92,7 +92,7 @@ public:
static void sendPostedEvents(QObject *receiver, int event_type, QThreadData *data);
static void removePostedEvents_unlocked(QObject *receiver, int type, QThreadData *data);
-#if !defined (QT_NO_DEBUG) || defined (QT_MAC_FRAMEWORK_BUILD)
+#if !defined (QT_NO_DEBUG) || defined (QT_MAC_FRAMEWORK_BUILD) || defined (Q_OS_SYMBIAN)
void checkReceiverThread(QObject *receiver);
#endif
int &argc;
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index d6b0174..6d26db6 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -108,6 +108,7 @@ QT_BEGIN_NAMESPACE
\value ApplicationLayoutDirectionChange The default application layout direction has changed.
\value ApplicationPaletteChange The default application palette has changed.
\value ApplicationWindowIconChange The application's icon has changed.
+ \value CloseSoftwareInputPanel A widget wants to close the software input panel (SIP).
\value ChildAdded An object gets a child (QChildEvent).
\value ChildInserted An object gets a child (QChildEvent). Qt3Support only, use ChildAdded instead.
\value ChildPolished A widget child gets polished (QChildEvent).
@@ -186,6 +187,7 @@ QT_BEGIN_NAMESPACE
\value Polish The widget is polished.
\value PolishRequest The widget should be polished.
\value QueryWhatsThis The widget should accept the event if it has "What's This?" help.
+ \value RequestSoftwareInputPanel A widget wants to open a software input panel (SIP).
\value Resize Widget's size changed (QResizeEvent).
\value Shortcut Key press in child for shortcut key handling (QShortcutEvent).
\value ShortcutOverride Key press in child, for overriding shortcut key handling (QKeyEvent).
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index 18188a8..1dd2ee4 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -271,6 +271,8 @@ public:
Signal = 192,
Wrapped = 193,
+ RequestSoftwareInputPanel = 194,
+ CloseSoftwareInputPanel = 195,
// 512 reserved for Qt Jambi's MetaCall event
// 513 reserved for Qt Jambi's DeleteOnMainThread event
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
new file mode 100644
index 0000000..88e2a88
--- /dev/null
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -0,0 +1,992 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qeventdispatcher_symbian_p.h"
+#include <private/qthread_p.h>
+#include <qcoreapplication.h>
+#include <private/qcoreapplication_p.h>
+#include <qdatetime.h>
+
+#include <unistd.h>
+#include <errno.h>
+
+QT_BEGIN_NAMESPACE
+
+#define WAKE_UP_PRIORITY CActive::EPriorityStandard
+#define TIMER_PRIORITY CActive::EPriorityLow
+#define COMPLETE_DEFERRED_ACTIVE_OBJECTS_PRIORITY CActive::EPriorityIdle
+
+static inline int qt_pipe_write(int socket, const char *data, qint64 len)
+{
+ return ::write(socket, data, len);
+}
+#if defined(write)
+# undef write
+#endif
+
+static inline int qt_pipe_close(int socket)
+{
+ return ::close(socket);
+}
+#if defined(close)
+# undef close
+#endif
+
+static inline int qt_pipe_fcntl(int socket, int command)
+{
+ return ::fcntl(socket, command);
+}
+static inline int qt_pipe2_fcntl(int socket, int command, int option)
+{
+ return ::fcntl(socket, command, option);
+}
+#if defined(fcntl)
+# undef fcntl
+#endif
+
+static inline int qt_socket_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
+{
+ return ::select(nfds, readfds, writefds, exceptfds, timeout);
+}
+
+// This simply interrupts the select and locks the mutex until destroyed.
+class QSelectMutexGrabber
+{
+public:
+ QSelectMutexGrabber(int fd, QMutex *mutex)
+ : m_mutex(mutex)
+ {
+ if (m_mutex->tryLock())
+ return;
+
+ char dummy = 0;
+ qt_pipe_write(fd, &dummy, 1);
+
+ m_mutex->lock();
+ }
+
+ ~QSelectMutexGrabber()
+ {
+ m_mutex->unlock();
+ }
+
+private:
+ QMutex *m_mutex;
+};
+
+/*
+ * This class is designed to aid in implementing event handling in a more round robin fashion. We
+ * cannot change active objects that we do not own, but the active objects that Qt owns will use
+ * this as a base class with convenience functions.
+ *
+ * Here is how it works: On every RunL, the deriving class should call okToRun(). This will allow
+ * exactly one run of the active object, and mark it as such. If it is called again, it will return
+ * false, and add the object to a queue so it can be run later.
+ *
+ * The QCompleteDeferredAOs class is a special object that runs after all others, which will
+ * reactivate the objects that were previously not run.
+ */
+inline QActiveObject::QActiveObject(TInt priority, QEventDispatcherSymbian *dispatcher)
+ : CActive(priority),
+ m_dispatcher(dispatcher),
+ m_hasAlreadyRun(false),
+ m_hasRunAgain(false),
+ m_iterationCount(1)
+{
+}
+
+QActiveObject::~QActiveObject()
+{
+ if (m_hasRunAgain)
+ m_dispatcher->removeDeferredActiveObject(this);
+}
+
+bool QActiveObject::okToRun()
+{
+ Q_ASSERT(!m_hasRunAgain);
+
+ if (!m_hasAlreadyRun || m_dispatcher->iterationCount() != m_iterationCount) {
+ // First occurrence of this event in this iteration.
+ m_hasAlreadyRun = true;
+ m_iterationCount = m_dispatcher->iterationCount();
+ return true;
+ } else {
+ // The event has already occurred.
+ m_dispatcher->addDeferredActiveObject(this);
+ m_hasRunAgain = true;
+ return false;
+ }
+}
+
+void QActiveObject::reactivateAndComplete()
+{
+ iStatus = KRequestPending;
+ SetActive();
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+
+ m_hasRunAgain = false;
+ m_hasAlreadyRun = false;
+}
+
+QWakeUpActiveObject::QWakeUpActiveObject(QEventDispatcherSymbian *dispatcher)
+ : CActive(WAKE_UP_PRIORITY),
+ m_dispatcher(dispatcher)
+{
+ CActiveScheduler::Add(this);
+ iStatus = KRequestPending;
+ SetActive();
+}
+
+QWakeUpActiveObject::~QWakeUpActiveObject()
+{
+ Cancel();
+}
+
+void QWakeUpActiveObject::DoCancel()
+{
+ if (iStatus.Int() & KRequestPending) {
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+}
+
+void QWakeUpActiveObject::RunL()
+{
+ iStatus = KRequestPending;
+ SetActive();
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->wakeUpWasCalled());
+}
+
+QTimerActiveObject::QTimerActiveObject(QEventDispatcherSymbian *dispatcher, SymbianTimerInfo *timerInfo)
+ : QActiveObject(TIMER_PRIORITY, dispatcher),
+ m_timerInfo(timerInfo)
+{
+}
+
+QTimerActiveObject::~QTimerActiveObject()
+{
+ Cancel();
+}
+
+void QTimerActiveObject::DoCancel()
+{
+ if (m_timerInfo->interval > 0) {
+ m_rTimer.Cancel();
+ m_rTimer.Close();
+ } else {
+ if (iStatus.Int() & KRequestPending) {
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+ }
+}
+
+void QTimerActiveObject::RunL()
+{
+ int error;
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(error, Run());
+ if (error < 0) {
+ CActiveScheduler::Current()->Error(error); // stop and report here, as this timer will be deleted on scope exit
+ }
+}
+
+void QTimerActiveObject::Run()
+{
+ if (!okToRun())
+ return;
+
+ if (m_timerInfo->interval > 0) {
+ // Start a new timer immediately so that we don't lose time.
+ iStatus = KRequestPending;
+ SetActive();
+ m_rTimer.After(iStatus, m_timerInfo->interval*1000);
+
+ m_timerInfo->dispatcher->timerFired(m_timerInfo->timerId);
+ } else {
+ // However, we only complete zero timers after the event has finished,
+ // in order to prevent busy looping when doing nested loops.
+
+ // Keep the refpointer around in order to avoid deletion until the end of this function.
+ SymbianTimerInfoPtr timerInfoPtr(m_timerInfo);
+
+ m_timerInfo->dispatcher->timerFired(m_timerInfo->timerId);
+
+ iStatus = KRequestPending;
+ SetActive();
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+}
+
+void QTimerActiveObject::Start()
+{
+ CActiveScheduler::Add(this);
+ if (m_timerInfo->interval > 0) {
+ m_rTimer.CreateLocal();
+ iStatus = KRequestPending;
+ SetActive();
+ m_rTimer.After(iStatus, m_timerInfo->interval*1000);
+ } else {
+ iStatus = KRequestPending;
+ SetActive();
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+}
+
+SymbianTimerInfo::~SymbianTimerInfo()
+{
+ delete timerAO;
+}
+
+QCompleteDeferredAOs::QCompleteDeferredAOs(QEventDispatcherSymbian *dispatcher)
+ : CActive(COMPLETE_DEFERRED_ACTIVE_OBJECTS_PRIORITY),
+ m_dispatcher(dispatcher)
+{
+ CActiveScheduler::Add(this);
+ iStatus = KRequestPending;
+ SetActive();
+}
+
+QCompleteDeferredAOs::~QCompleteDeferredAOs()
+{
+ Cancel();
+}
+
+void QCompleteDeferredAOs::complete()
+{
+ if (iStatus.Int() & KRequestPending) {
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+}
+
+void QCompleteDeferredAOs::DoCancel()
+{
+ if (iStatus.Int() & KRequestPending) {
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+}
+
+void QCompleteDeferredAOs::RunL()
+{
+ iStatus = KRequestPending;
+ SetActive();
+
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->reactivateDeferredActiveObjects());
+}
+
+QSelectThread::QSelectThread()
+ : m_quit(false)
+{
+ if (::pipe(m_pipeEnds) != 0) {
+ qWarning("Select thread was unable to open a pipe, errno: %i", errno);
+ } else {
+ int flags0 = qt_pipe_fcntl(m_pipeEnds[0], F_GETFL);
+ int flags1 = qt_pipe_fcntl(m_pipeEnds[1], F_GETFL);
+ // We should check the error code here, but Open C has a bug that returns
+ // failure even though the operation was successful.
+ qt_pipe2_fcntl(m_pipeEnds[0], F_SETFL, flags0 | O_NONBLOCK);
+ qt_pipe2_fcntl(m_pipeEnds[1], F_SETFL, flags1 | O_NONBLOCK);
+ }
+}
+
+QSelectThread::~QSelectThread()
+{
+ qt_pipe_close(m_pipeEnds[1]);
+ qt_pipe_close(m_pipeEnds[0]);
+}
+
+void QSelectThread::run()
+{
+ Q_D(QThread);
+
+ m_mutex.lock();
+
+ while (!m_quit) {
+ fd_set readfds;
+ fd_set writefds;
+ fd_set exceptionfds;
+
+ FD_ZERO(&readfds);
+ FD_ZERO(&writefds);
+ FD_ZERO(&exceptionfds);
+
+ int maxfd = 0;
+ maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Read, &readfds));
+ maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Write, &writefds));
+ maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Exception, &exceptionfds));
+ maxfd = qMax(maxfd, m_pipeEnds[0]);
+ maxfd++;
+
+ FD_SET(m_pipeEnds[0], &readfds);
+
+ int ret;
+ int savedSelectErrno;
+ //do {
+ ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0);
+ savedSelectErrno = errno;
+ //} while (ret == 0);
+
+ char buffer;
+
+ while (::read(m_pipeEnds[0], &buffer, 1) > 0) {}
+
+ if(ret == 0) {
+ // do nothing
+ } else if (ret < 0) {
+ switch (savedSelectErrno) {
+ case EBADF:
+ case EINVAL:
+ case ENOMEM:
+ case EFAULT:
+ qWarning("::select() returned an error: %i", savedSelectErrno);
+ break;
+ case ECONNREFUSED:
+ case EPIPE:
+ qWarning("::select() returned an error: %i (go through sockets)", savedSelectErrno);
+ // prepare to go through all sockets
+ // mark in fd sets both:
+ // good ones
+ // ones that return -1 in select
+ // after loop update notifiers for all of them
+
+ // as we dont have "exception" notifier type
+ // we should force monitoring fd_set of this
+ // type as well
+
+ // clean @ start
+ FD_ZERO(&readfds);
+ FD_ZERO(&writefds);
+ FD_ZERO(&exceptionfds);
+ {
+ for (QHash<QSocketNotifier *, TRequestStatus *>::const_iterator i = m_AOStatuses.begin();
+ i != m_AOStatuses.end(); ++i) {
+
+ fd_set onefds;
+ FD_ZERO(&onefds);
+ FD_SET(i.key()->socket(), &onefds);
+
+ fd_set excfds;
+ FD_ZERO(&excfds);
+ FD_SET(i.key()->socket(), &excfds);
+
+ maxfd = i.key()->socket() + 1;
+
+ struct timeval timeout;
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 0;
+
+ ret = 0;
+
+ if(i.key()->type() == QSocketNotifier::Read) {
+ ret = ::select(maxfd, &onefds, 0, &excfds, &timeout);
+ if(ret != 0) FD_SET(i.key()->socket(), &readfds);
+ } else if(i.key()->type() == QSocketNotifier::Write) {
+ ret = ::select(maxfd, 0, &onefds, &excfds, &timeout);
+ if(ret != 0) FD_SET(i.key()->socket(), &writefds);
+ }
+
+ } // end for
+ }
+
+ // traversed all, so update
+ updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
+ updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
+ updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
+
+ break;
+ case EINTR: // Should never occur on Symbian, but this is future proof!
+ default:
+ qWarning("::select() returned an unknown error: %i", savedSelectErrno);
+
+ break;
+ }
+ } else {
+ updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
+ updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
+ updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
+ }
+
+ m_waitCond.wait(&m_mutex);
+ }
+
+ m_mutex.unlock();
+}
+
+void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestStatus *status )
+{
+ Q_D(QThread);
+
+ if (!isRunning()) {
+ start();
+ }
+
+ QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+
+ Q_ASSERT(!m_AOStatuses.contains(notifier));
+
+ m_AOStatuses.insert(notifier, status);
+
+ m_waitCond.wakeAll();
+}
+
+void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
+{
+ QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+
+ m_AOStatuses.remove(notifier);
+
+ m_waitCond.wakeAll();
+}
+
+void QSelectThread::restart()
+{
+ QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+
+ m_waitCond.wakeAll();
+}
+
+int QSelectThread::updateSocketSet(QSocketNotifier::Type type, fd_set *fds)
+{
+ int maxfd = 0;
+ if(m_AOStatuses.isEmpty()) {
+ /*
+ * Wonder if should return -1
+ * to signal that no descriptors
+ * added to fds
+ */
+ return maxfd;
+ }
+ for ( QHash<QSocketNotifier *, TRequestStatus *>::const_iterator i = m_AOStatuses.begin();
+ i != m_AOStatuses.end(); ++i) {
+ if (i.key()->type() == type) {
+ FD_SET(i.key()->socket(), fds);
+ maxfd = qMax(maxfd, i.key()->socket());
+ } else if(type == QSocketNotifier::Exception) {
+ /*
+ * We are registering existing sockets
+ * always to exception set
+ *
+ * Doing double FD_SET shouldn't
+ * matter
+ */
+ FD_SET(i.key()->socket(), fds);
+ maxfd = qMax(maxfd, i.key()->socket());
+ }
+ }
+
+ return maxfd;
+}
+
+void QSelectThread::updateActivatedNotifiers(QSocketNotifier::Type type, fd_set *fds)
+{
+ Q_D(QThread);
+ if(m_AOStatuses.isEmpty()) {
+ return;
+ }
+ QList<QSocketNotifier *> toRemove;
+ for (QHash<QSocketNotifier *, TRequestStatus *>::const_iterator i = m_AOStatuses.begin();
+ i != m_AOStatuses.end(); ++i) {
+ if (i.key()->type() == type && FD_ISSET(i.key()->socket(), fds)) {
+ toRemove.append(i.key());
+ TRequestStatus *status = i.value();
+ // Thread data is still owned by the main thread.
+ QEventDispatcherSymbian::RequestComplete(d->threadData->symbian_thread_handle, status, KErrNone);
+ } else if(type == QSocketNotifier::Exception && FD_ISSET(i.key()->socket(), fds)) {
+ /*
+ * check if socket is in exception set
+ * then signal RequestComplete for it
+ */
+ qWarning("exception on %d", i.key()->socket());
+ toRemove.append(i.key());
+ TRequestStatus *status = i.value();
+ QEventDispatcherSymbian::RequestComplete(d->threadData->symbian_thread_handle, status, KErrNone);
+ }
+ }
+
+ for (int c = 0; c < toRemove.size(); ++c) {
+ m_AOStatuses.remove(toRemove[c]);
+ }
+}
+
+void QSelectThread::stop()
+{
+ m_quit = true;
+ restart();
+ wait();
+}
+
+QSocketActiveObject::QSocketActiveObject(QEventDispatcherSymbian *dispatcher, QSocketNotifier *notifier)
+ : QActiveObject(CActive::EPriorityStandard, dispatcher),
+ m_notifier(notifier),
+ m_inSocketEvent(false),
+ m_deleteLater(false)
+{
+ CActiveScheduler::Add(this);
+ iStatus = KRequestPending;
+ SetActive();
+}
+
+QSocketActiveObject::~QSocketActiveObject()
+{
+ Cancel();
+}
+
+void QSocketActiveObject::DoCancel()
+{
+ if (iStatus.Int() & KRequestPending) {
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, KErrNone);
+ }
+}
+
+void QSocketActiveObject::RunL()
+{
+ if (!okToRun())
+ return;
+
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->socketFired(this));
+}
+
+void QSocketActiveObject::deleteLater()
+{
+ if (m_inSocketEvent) {
+ m_deleteLater = true;
+ } else {
+ delete this;
+ }
+}
+
+QEventDispatcherSymbian::QEventDispatcherSymbian(QObject *parent)
+ : QAbstractEventDispatcher(parent),
+ m_activeScheduler(0),
+ m_wakeUpAO(0),
+ m_completeDeferredAOs(0),
+ m_interrupt(false),
+ m_wakeUpDone(0),
+ m_iterationCount(0),
+ m_noSocketEvents(false)
+{
+}
+
+QEventDispatcherSymbian::~QEventDispatcherSymbian()
+{
+ m_processHandle.Close();
+}
+
+void QEventDispatcherSymbian::startingUp()
+{
+ if( !CActiveScheduler::Current() ) {
+ m_activeScheduler = new(ELeave)CQtActiveScheduler();
+ CActiveScheduler::Install(m_activeScheduler);
+ }
+ m_wakeUpAO = new(ELeave) QWakeUpActiveObject(this);
+ m_completeDeferredAOs = new(ELeave) QCompleteDeferredAOs(this);
+ // We already might have posted events, wakeup once to process them
+ wakeUp();
+}
+
+void QEventDispatcherSymbian::closingDown()
+{
+ if (m_selectThread.isRunning()) {
+ m_selectThread.stop();
+ }
+
+ delete m_completeDeferredAOs;
+ delete m_wakeUpAO;
+ if (m_activeScheduler) {
+ delete m_activeScheduler;
+ }
+}
+
+bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags flags )
+{
+ bool handledAnyEvent = false;
+
+ QT_TRY {
+ Q_D(QAbstractEventDispatcher);
+
+ // It is safe if this counter overflows. The main importance is that each
+ // iteration count is different from the last.
+ m_iterationCount++;
+
+ RThread &thread = d->threadData->symbian_thread_handle;
+
+ bool block;
+ if (flags & QEventLoop::WaitForMoreEvents) {
+ block = true;
+ emit aboutToBlock();
+ } else {
+ block = false;
+ }
+
+ bool oldNoSocketEventsValue = m_noSocketEvents;
+ if (flags & QEventLoop::ExcludeSocketNotifiers) {
+ m_noSocketEvents = true;
+ } else {
+ m_noSocketEvents = false;
+ handledAnyEvent = sendDeferredSocketEvents();
+ }
+
+ bool handledSymbianEvent = false;
+ m_interrupt = false;
+
+ /*
+ * This QTime variable is used to measure the time it takes to finish
+ * the event loop. If we take too long in the loop, other processes
+ * may be starved and killed. After the first event has completed, we
+ * take the current time, and if the remaining events take longer than
+ * a preset time, we temporarily lower the priority to force a context
+ * switch. For applications that do not take unecessarily long in the
+ * event loop, the priority will not be altered.
+ */
+ QTime time;
+ enum {
+ FirstRun,
+ SubsequentRun,
+ TimeStarted
+ } timeState = FirstRun;
+
+ TProcessPriority priority;
+
+ while (1) {
+ if (block) {
+ // This is where Qt will spend most of its time.
+ CActiveScheduler::Current()->WaitForAnyRequest();
+ } else {
+ if (thread.RequestCount() == 0) {
+ break;
+ }
+ // This one should return without delay.
+ CActiveScheduler::Current()->WaitForAnyRequest();
+ }
+
+ if (timeState == SubsequentRun) {
+ time.start();
+ timeState = TimeStarted;
+ }
+
+ TInt error;
+ handledSymbianEvent = CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle);
+ if (error) {
+ qWarning("CActiveScheduler::RunIfReady() returned error: %i\n", error);
+ CActiveScheduler::Current()->Error(error);
+ }
+
+ if (!handledSymbianEvent) {
+ qFatal("QEventDispatcherSymbian::processEvents(): Caught Symbian stray signal");
+ }
+ handledAnyEvent = true;
+ if (m_interrupt) {
+ break;
+ }
+ block = false;
+ if (timeState == TimeStarted && time.elapsed() > 100) {
+ priority = m_processHandle.Priority();
+ m_processHandle.SetPriority(EPriorityLow);
+ time.start();
+ // Slight chance of race condition in the next lines, but nothing fatal
+ // will happen, just wrong priority.
+ if (m_processHandle.Priority() == EPriorityLow) {
+ m_processHandle.SetPriority(priority);
+ }
+ }
+ if (timeState == FirstRun)
+ timeState = SubsequentRun;
+ };
+
+ emit awake();
+
+ m_noSocketEvents = oldNoSocketEventsValue;
+ } QT_CATCH (const std::exception& ex) {
+#ifndef QT_NO_EXCEPTIONS
+ CActiveScheduler::Current()->Error(qt_translateExceptionToSymbianError(ex));
+#endif
+ }
+
+ return handledAnyEvent;
+}
+
+void QEventDispatcherSymbian::timerFired(int timerId)
+{
+ QHash<int, SymbianTimerInfoPtr>::iterator i = m_timerList.find(timerId);
+ if (i == m_timerList.end()) {
+ // The timer has been deleted. Ignore this event.
+ return;
+ }
+
+ SymbianTimerInfoPtr timerInfo = *i;
+
+ // Prevent infinite timer recursion.
+ if (timerInfo->inTimerEvent) {
+ return;
+ }
+
+ timerInfo->inTimerEvent = true;
+
+ QTimerEvent event(timerInfo->timerId);
+ QCoreApplication::sendEvent(timerInfo->receiver, &event);
+
+ timerInfo->inTimerEvent = false;
+
+ return;
+}
+
+void QEventDispatcherSymbian::socketFired(QSocketActiveObject *socketAO)
+{
+ if (m_noSocketEvents) {
+ m_deferredSocketEvents.append(socketAO);
+ return;
+ }
+
+ QEvent e(QEvent::SockAct);
+ socketAO->m_inSocketEvent = true;
+ QCoreApplication::sendEvent(socketAO->m_notifier, &e);
+ socketAO->m_inSocketEvent = false;
+
+ if (socketAO->m_deleteLater) {
+ delete socketAO;
+ } else {
+ socketAO->iStatus = KRequestPending;
+ socketAO->SetActive();
+ reactivateSocketNotifier(socketAO->m_notifier);
+ }
+}
+
+void QEventDispatcherSymbian::wakeUpWasCalled()
+{
+ // The reactivation should happen in RunL, right before the call to this function.
+ // This is because m_wakeUpDone is the "signal" that the object can be completed
+ // once more.
+ // Also, by dispatching the posted events after resetting m_wakeUpDone, we guarantee
+ // that no posted event notification will be lost. If we did it the other way
+ // around, it would be possible for another thread to post an event right after
+ // the sendPostedEvents was done, but before the object was ready to be completed
+ // again. This could deadlock the application if there are no other posted events.
+ m_wakeUpDone.fetchAndStoreOrdered(0);
+ sendPostedEvents();
+}
+
+void QEventDispatcherSymbian::interrupt()
+{
+ m_interrupt = true;
+ wakeUp();
+}
+
+void QEventDispatcherSymbian::wakeUp()
+{
+ Q_D(QAbstractEventDispatcher);
+
+ if (m_wakeUpAO && m_wakeUpDone.testAndSetAcquire(0, 1)) {
+ TRequestStatus *status = &m_wakeUpAO->iStatus;
+ QEventDispatcherSymbian::RequestComplete(d->threadData->symbian_thread_handle, status, KErrNone);
+ }
+}
+
+bool QEventDispatcherSymbian::sendPostedEvents()
+{
+ Q_D(QAbstractEventDispatcher);
+
+ // moveToThread calls this and canWait == true -> Events will never get processed
+ // if we check for d->threadData->canWait
+ //
+ // QCoreApplication::postEvent sets canWait = false, but after the object and events
+ // are moved to a new thread, the canWait in new thread is true i.e. not changed to reflect
+ // the flag on old thread. That's why events in a new thread will not get processed.
+ // This migth be actually bug in moveToThread functionality, but because other platforms
+ // do not check canWait in wakeUp (where we essentially are now) - decided to remove it from
+ // here as well.
+
+ //if (!d->threadData->canWait) {
+ QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData);
+ return true;
+ //}
+ //return false;
+}
+
+inline void QEventDispatcherSymbian::addDeferredActiveObject(QActiveObject *object)
+{
+ if (m_deferredActiveObjects.isEmpty()) {
+ m_completeDeferredAOs->complete();
+ }
+ m_deferredActiveObjects.append(object);
+}
+
+inline void QEventDispatcherSymbian::removeDeferredActiveObject(QActiveObject *object)
+{
+ m_deferredActiveObjects.removeAll(object);
+}
+
+void QEventDispatcherSymbian::reactivateDeferredActiveObjects()
+{
+ while (!m_deferredActiveObjects.isEmpty()) {
+ QActiveObject *object = m_deferredActiveObjects.takeFirst();
+ object->reactivateAndComplete();
+ }
+
+ // We do this because we want to return from processEvents. This is because
+ // each invocation of processEvents should only run each active object once.
+ // The active scheduler should run them continously, however.
+ m_interrupt = true;
+}
+
+bool QEventDispatcherSymbian::sendDeferredSocketEvents()
+{
+ bool sentAnyEvents = false;
+ while (!m_deferredSocketEvents.isEmpty()) {
+ sentAnyEvents = true;
+ socketFired(m_deferredSocketEvents.takeFirst());
+ }
+
+ return sentAnyEvents;
+}
+
+void QEventDispatcherSymbian::flush()
+{
+}
+
+bool QEventDispatcherSymbian::hasPendingEvents()
+{
+ Q_D(QAbstractEventDispatcher);
+ return (d->threadData->symbian_thread_handle.RequestCount() != 0
+ || !d->threadData->canWait || !m_deferredSocketEvents.isEmpty());
+}
+
+void QEventDispatcherSymbian::registerSocketNotifier ( QSocketNotifier * notifier )
+{
+ QSocketActiveObject *socketAO = new (ELeave) QSocketActiveObject(this, notifier);
+ m_notifiers.insert(notifier, socketAO);
+ m_selectThread.requestSocketEvents(notifier, &socketAO->iStatus);
+}
+
+void QEventDispatcherSymbian::unregisterSocketNotifier ( QSocketNotifier * notifier )
+{
+ m_selectThread.cancelSocketEvents(notifier);
+ if (m_notifiers.contains(notifier)) {
+ QSocketActiveObject *sockObj = *m_notifiers.find(notifier);
+ m_deferredSocketEvents.removeAll(sockObj);
+ sockObj->deleteLater();
+ m_notifiers.remove(notifier);
+ }
+}
+
+void QEventDispatcherSymbian::reactivateSocketNotifier(QSocketNotifier *notifier)
+{
+ m_selectThread.requestSocketEvents(notifier, &m_notifiers[notifier]->iStatus);
+}
+
+void QEventDispatcherSymbian::registerTimer ( int timerId, int interval, QObject * object )
+{
+ if (interval < 0) {
+ qWarning("Timer interval < 0");
+ interval = 0;
+ }
+
+ SymbianTimerInfoPtr timer(new SymbianTimerInfo);
+ timer->timerId = timerId;
+ timer->interval = interval;
+ timer->inTimerEvent = false;
+ timer->receiver = object;
+ timer->dispatcher = this;
+ timer->timerAO = new(ELeave) QTimerActiveObject(this, timer.data());
+ m_timerList.insert(timerId, timer);
+
+ timer->timerAO->Start();
+}
+
+bool QEventDispatcherSymbian::unregisterTimer ( int timerId )
+{
+ if (!m_timerList.contains(timerId)) {
+ return false;
+ }
+
+ SymbianTimerInfoPtr timerInfo = m_timerList.take(timerId);
+
+ return true;
+}
+
+bool QEventDispatcherSymbian::unregisterTimers ( QObject * object )
+{
+ QList<TimerInfo> idsToRemove = registeredTimers(object);
+
+ if (idsToRemove.isEmpty())
+ return false;
+
+ for (int c = 0; c < idsToRemove.size(); ++c) {
+ unregisterTimer(idsToRemove[c].first);
+ }
+
+ return true;
+}
+
+QList<QEventDispatcherSymbian::TimerInfo> QEventDispatcherSymbian::registeredTimers ( QObject * object ) const
+{
+ QList<TimerInfo> list;
+ for (QHash<int, SymbianTimerInfoPtr>::const_iterator i = m_timerList.begin(); i != m_timerList.end(); ++i) {
+ if ((*i)->receiver == object) {
+ list.push_back(TimerInfo((*i)->timerId, (*i)->interval));
+ }
+ }
+
+ return list;
+}
+
+/*
+ * This active scheduler class implements a simple report and continue policy, for Symbian OS leaves
+ * or exceptions from Qt that fall back to the scheduler.
+ * It will be used in cases where there is no existing active scheduler installed.
+ * Apps which link to qts60main.lib will have the UI active scheduler installed in the main thread
+ * instead of this one. But this would be used in other threads in the UI.
+ * An app could replace this behaviour by installing an alternative active scheduler.
+ */
+void CQtActiveScheduler::Error(TInt aError) const
+{
+ QT_TRY {
+ qWarning("Error from active scheduler %d", aError);
+ }
+ QT_CATCH (const std::bad_alloc&) {} // ignore alloc fails, nothing more can be done
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
new file mode 100644
index 0000000..b39d6df
--- /dev/null
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -0,0 +1,311 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QEVENTDISPATCHER_SYMBIAN_P_H
+#define QEVENTDISPATCHER_SYMBIAN_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 <qhash.h>
+#include <qset.h>
+#include <qshareddata.h>
+#include <qabstracteventdispatcher.h>
+#include <private/qabstracteventdispatcher_p.h>
+#include <qthread.h>
+#include <qmutex.h>
+#include <qwaitcondition.h>
+#include <qsocketnotifier.h>
+
+#include <e32base.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/select.h>
+
+QT_BEGIN_NAMESPACE
+
+
+class QEventDispatcherSymbian;
+class QTimerActiveObject;
+
+class QActiveObject : public CActive
+{
+public:
+ QActiveObject(TInt priority, QEventDispatcherSymbian *dispatcher);
+ ~QActiveObject();
+
+ bool okToRun();
+
+ void reactivateAndComplete();
+
+protected:
+ QEventDispatcherSymbian *m_dispatcher;
+
+private:
+ bool m_hasAlreadyRun : 1;
+ bool m_hasRunAgain : 1;
+ int m_iterationCount;
+};
+
+class QWakeUpActiveObject : public CActive
+{
+public:
+ QWakeUpActiveObject(QEventDispatcherSymbian *dispatcher);
+ ~QWakeUpActiveObject();
+
+ void Complete();
+
+protected:
+ void DoCancel();
+ void RunL();
+
+private:
+ QEventDispatcherSymbian *m_dispatcher;
+};
+
+struct SymbianTimerInfo : public QSharedData
+{
+ ~SymbianTimerInfo();
+
+ int timerId;
+ int interval;
+ bool inTimerEvent;
+ QObject *receiver;
+ QTimerActiveObject *timerAO;
+ QEventDispatcherSymbian *dispatcher;
+};
+
+typedef QExplicitlySharedDataPointer<SymbianTimerInfo> SymbianTimerInfoPtr;
+
+// This is a bit of a proxy class. See comments in SetActive and Start for details.
+class QTimerActiveObject : public QActiveObject
+{
+public:
+ QTimerActiveObject(QEventDispatcherSymbian *dispatcher, SymbianTimerInfo *timerInfo);
+ ~QTimerActiveObject();
+
+ void Start();
+
+protected:
+ void DoCancel();
+ void RunL();
+
+private:
+ void Run();
+
+private:
+ SymbianTimerInfo *m_timerInfo;
+ RTimer m_rTimer;
+};
+
+class QCompleteDeferredAOs : public CActive
+{
+public:
+ QCompleteDeferredAOs(QEventDispatcherSymbian *dispatcher);
+ ~QCompleteDeferredAOs();
+
+ void complete();
+
+protected:
+ void DoCancel();
+ void RunL();
+
+private:
+ QEventDispatcherSymbian *m_dispatcher;
+};
+
+class QSocketActiveObject : public QActiveObject
+{
+public:
+ QSocketActiveObject(QEventDispatcherSymbian *dispatcher, QSocketNotifier *notifier);
+ ~QSocketActiveObject();
+
+ void deleteLater();
+
+protected:
+ void DoCancel();
+ void RunL();
+
+private:
+ QSocketNotifier *m_notifier;
+ bool m_inSocketEvent;
+ bool m_deleteLater;
+
+ friend class QEventDispatcherSymbian;
+};
+
+class QSelectThread : public QThread
+{
+ Q_DECLARE_PRIVATE(QThread)
+
+public:
+ QSelectThread();
+ ~QSelectThread();
+
+ void requestSocketEvents ( QSocketNotifier *notifier, TRequestStatus *status );
+ void cancelSocketEvents ( QSocketNotifier *notifier );
+ void restart();
+ void stop();
+
+protected:
+ void run();
+
+private:
+ int updateSocketSet(QSocketNotifier::Type type, fd_set *fds);
+ void updateActivatedNotifiers(QSocketNotifier::Type type, fd_set *fds);
+
+private:
+ int m_pipeEnds[2];
+ QHash<QSocketNotifier *, TRequestStatus *> m_AOStatuses;
+ QMutex m_mutex;
+ QWaitCondition m_waitCond;
+ bool m_quit;
+};
+
+class Q_CORE_EXPORT CQtActiveScheduler : public CActiveScheduler
+{
+public: // from CActiveScheduler
+ virtual void Error(TInt aError) const;
+};
+
+class Q_CORE_EXPORT QEventDispatcherSymbian : public QAbstractEventDispatcher
+{
+ Q_DECLARE_PRIVATE(QAbstractEventDispatcher)
+
+public:
+ QEventDispatcherSymbian(QObject *parent = 0);
+ ~QEventDispatcherSymbian();
+
+ void flush();
+ bool hasPendingEvents();
+ void interrupt();
+ bool processEvents ( QEventLoop::ProcessEventsFlags flags );
+ void registerSocketNotifier ( QSocketNotifier * notifier );
+ void registerTimer ( int timerId, int interval, QObject * object );
+ QList<TimerInfo> registeredTimers ( QObject * object ) const;
+ void unregisterSocketNotifier ( QSocketNotifier * notifier );
+ bool unregisterTimer ( int timerId );
+ bool unregisterTimers ( QObject * object );
+ void wakeUp();
+
+ void startingUp();
+ void closingDown();
+
+ void timerFired(int timerId);
+ void socketFired(QSocketActiveObject *socketAO);
+ void wakeUpWasCalled();
+ void reactivateSocketNotifier(QSocketNotifier *notifier);
+
+ void addDeferredActiveObject(QActiveObject *object);
+ void removeDeferredActiveObject(QActiveObject *object);
+ void reactivateDeferredActiveObjects();
+
+ inline int iterationCount() const { return m_iterationCount; }
+
+ static void RequestComplete(TRequestStatus *&status, TInt reason);
+ static void RequestComplete(RThread &threadHandle, TRequestStatus *&status, TInt reason);
+
+private:
+ bool sendPostedEvents();
+ bool sendDeferredSocketEvents();
+
+private:
+ QSelectThread m_selectThread;
+
+ CQtActiveScheduler *m_activeScheduler;
+
+ QHash<int, SymbianTimerInfoPtr> m_timerList;
+ QHash<QSocketNotifier *, QSocketActiveObject *> m_notifiers;
+
+ QWakeUpActiveObject *m_wakeUpAO;
+ QCompleteDeferredAOs *m_completeDeferredAOs;
+
+ volatile bool m_interrupt;
+ QAtomicInt m_wakeUpDone;
+
+ unsigned char m_iterationCount;
+ bool m_noSocketEvents;
+ QList<QSocketActiveObject *> m_deferredSocketEvents;
+
+ QList<QActiveObject *> m_deferredActiveObjects;
+
+ RProcess m_processHandle;
+};
+
+#ifdef QT_DEBUG
+// EActive is defined to 1 and ERequestPending to 2, but they are both private.
+// A little dangerous to rely on, but it is only for debugging.
+# define REQUEST_STATUS_ACTIVE_AND_PENDING 3
+# define VERIFY_PENDING_REQUEST_STATUS \
+ Q_ASSERT(status->Int() & REQUEST_STATUS_ACTIVE_AND_PENDING == REQUEST_STATUS_ACTIVE_AND_PENDING);
+#else
+# define REQUEST_STATUS_ACTIVE_AND_PENDING
+# define VERIFY_PENDING_REQUEST_STATUS
+#endif
+
+// Convenience functions for doing some sanity checking on our own complete code.
+// Unless QT_DEBUG is defined, it is exactly equivalent to the Symbian version.
+inline void QEventDispatcherSymbian::RequestComplete(TRequestStatus *&status, TInt reason)
+{
+ VERIFY_PENDING_REQUEST_STATUS
+ User::RequestComplete(status, reason);
+}
+inline void QEventDispatcherSymbian::RequestComplete(RThread &threadHandle, TRequestStatus *&status, TInt reason)
+{
+ VERIFY_PENDING_REQUEST_STATUS
+ threadHandle.RequestComplete(status, reason);
+}
+
+#undef REQUEST_STATUS_ACTIVE_AND_PENDING
+#undef VERIFY_PENDING_REQUEST_STATUS
+
+QT_END_NAMESPACE
+
+#endif // QEVENTDISPATCHER_SYMBIAN_P_H
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index 033225b..fe0db73 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -184,7 +184,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
continue;
for (int i = 0; i < list.size(); ++i) {
- QSockNot *sn = list.at(i);
+ QSockNot *sn = list[i];
FD_ZERO(&fdset);
FD_SET(sn->fd, &fdset);
@@ -241,7 +241,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
for (int i=0; i<3; i++) {
QSockNotType::List &list = sn_vec[i].list;
for (int j = 0; j < list.size(); ++j) {
- QSockNot *sn = list.at(j);
+ QSockNot *sn = list[j];
if (FD_ISSET(sn->fd, &sn_vec[i].select_fds))
q->setSocketNotifierPending(sn->obj);
}
@@ -599,7 +599,10 @@ QEventDispatcherUNIX::QEventDispatcherUNIX(QEventDispatcherUNIXPrivate &dd, QObj
{ }
QEventDispatcherUNIX::~QEventDispatcherUNIX()
-{ }
+{
+ Q_D(QEventDispatcherUNIX);
+ d->threadData->eventDispatcher = 0;
+}
int QEventDispatcherUNIX::select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
timeval *timeout)
@@ -706,8 +709,8 @@ QSockNotType::QSockNotType()
QSockNotType::~QSockNotType()
{
- while (!list.isEmpty())
- delete list.takeFirst();
+ for (int i = 0; i < list.size(); ++i)
+ delete list[i];
}
/*****************************************************************************
@@ -743,7 +746,7 @@ void QEventDispatcherUNIX::registerSocketNotifier(QSocketNotifier *notifier)
int i;
for (i = 0; i < list.size(); ++i) {
- QSockNot *p = list.at(i);
+ QSockNot *p = list[i];
if (p->fd < sockfd)
break;
if (p->fd == sockfd) {
@@ -781,7 +784,7 @@ void QEventDispatcherUNIX::unregisterSocketNotifier(QSocketNotifier *notifier)
QSockNot *sn = 0;
int i;
for (i = 0; i < list.size(); ++i) {
- sn = list.at(i);
+ sn = list[i];
if(sn->obj == notifier && sn->fd == sockfd)
break;
}
@@ -799,7 +802,7 @@ void QEventDispatcherUNIX::unregisterSocketNotifier(QSocketNotifier *notifier)
for (int i=0; i<3; i++) {
if (!d->sn_vec[i].list.isEmpty())
d->sn_highest = qMax(d->sn_highest, // list is fd-sorted
- d->sn_vec[i].list.first()->fd);
+ d->sn_vec[i].list[0]->fd);
}
}
}
@@ -823,7 +826,7 @@ void QEventDispatcherUNIX::setSocketNotifierPending(QSocketNotifier *notifier)
QSockNot *sn = 0;
int i;
for (i = 0; i < list.size(); ++i) {
- sn = list.at(i);
+ sn = list[i];
if(sn->obj == notifier && sn->fd == sockfd)
break;
}
diff --git a/src/corelib/kernel/qeventdispatcher_unix_p.h b/src/corelib/kernel/qeventdispatcher_unix_p.h
index 8c08bd2..ac2de50 100644
--- a/src/corelib/kernel/qeventdispatcher_unix_p.h
+++ b/src/corelib/kernel/qeventdispatcher_unix_p.h
@@ -57,6 +57,7 @@
#include "QtCore/qlist.h"
#include "private/qabstracteventdispatcher_p.h"
#include "private/qpodlist_p.h"
+#include "QtCore/qvarlengtharray.h"
#include <sys/types.h>
#include <sys/time.h>
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 55d70c1..eeb3550 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -371,7 +371,9 @@ void QMetaObject::removeGuard(QObject **ptr)
if (!*ptr)
return;
GuardHash *hash = guardHash();
- if (!hash)
+ /* check that the hash is empty - otherwise we might detach
+ the shared_null hash, which will alloc, which is not nice */
+ if (!hash || hash->isEmpty())
return;
QMutexLocker locker(guardHashLock());
GuardHash::iterator it = hash->find(*ptr);
@@ -427,9 +429,19 @@ void QObjectPrivate::clearGuards(QObject *object)
{
if (!QObjectPrivate::get(object)->hasGuards)
return;
- GuardHash *hash = guardHash();
- if (hash) {
- QMutexLocker locker(guardHashLock());
+ GuardHash *hash = 0;
+ QMutex *mutex = 0;
+ QT_TRY {
+ hash = guardHash();
+ mutex = guardHashLock();
+ } QT_CATCH(const std::bad_alloc &) {
+ // do nothing in case of OOM - code below is safe
+ }
+
+ /* check that the hash is empty - otherwise we might detach
+ the shared_null hash, which will alloc, which is not nice */
+ if (hash && !hash->isEmpty()) {
+ QMutexLocker locker(mutex);
GuardHash::iterator it = hash->find(object);
const GuardHash::iterator end = hash->end();
while (it.key() == object && it != end) {
@@ -747,7 +759,14 @@ QObject::~QObject()
QObjectPrivate::clearGuards(this);
}
- emit destroyed(this);
+ QT_TRY {
+ emit destroyed(this);
+ } QT_CATCH(...) {
+ // all the signal/slots connections are still in place - if we don't
+ // quit now, we will crash pretty soon.
+ qWarning("Detected an unexpected exception in ~QObject while emitting destroyed().");
+ QT_RETHROW;
+ }
{
QMutexLocker locker(signalSlotLock(this));
@@ -846,9 +865,6 @@ QObject::~QObject()
objectName().isNull() ? "unnamed" : qPrintable(objectName()));
}
#endif
-
- delete d;
- d_ptr = 0;
}
QObjectPrivate::Connection::~Connection()
@@ -1097,11 +1113,11 @@ bool QObject::event(QEvent *e)
#if defined(QT_NO_EXCEPTIONS)
mce->placeMetaCall(this);
#else
- try {
+ QT_TRY {
mce->placeMetaCall(this);
- } catch (...) {
+ } QT_CATCH(...) {
QObjectPrivate::resetCurrentSender(this, &currentSender, previousSender);
- throw;
+ QT_RETHROW;
}
#endif
QObjectPrivate::resetCurrentSender(this, &currentSender, previousSender);
@@ -1394,8 +1410,10 @@ void QObjectPrivate::setThreadData_helper(QThreadData *currentData, QThreadData
++eventsMoved;
}
}
- if (eventsMoved > 0 && targetData->eventDispatcher)
+ if (eventsMoved > 0 && targetData->eventDispatcher) {
+ targetData->canWait = false;
targetData->eventDispatcher->wakeUp();
+ }
// the current emitting thread shouldn't restore currentSender after calling moveToThread()
if (currentSender)
@@ -3114,9 +3132,9 @@ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal
#if defined(QT_NO_EXCEPTIONS)
receiver->qt_metacall(QMetaObject::InvokeMetaMethod, method, argv ? argv : empty_argv);
#else
- try {
+ QT_TRY {
receiver->qt_metacall(QMetaObject::InvokeMetaMethod, method, argv ? argv : empty_argv);
- } catch (...) {
+ } QT_CATCH(...) {
locker.relock();
QObjectPrivate::resetCurrentSender(receiver, &currentSender, previousSender);
@@ -3125,7 +3143,7 @@ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal
Q_ASSERT(connectionLists->inUse >= 0);
if (connectionLists->orphaned && !connectionLists->inUse)
delete connectionLists;
- throw;
+ QT_RETHROW;
}
#endif
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index b1f41ad..72f2a65 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -51,6 +51,7 @@
#ifdef QT_INCLUDE_COMPAT
#include <QtCore/qcoreevent.h>
#endif
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -287,7 +288,7 @@ protected:
QObject(QObjectPrivate &dd, QObject *parent = 0);
protected:
- QObjectData *d_ptr;
+ QScopedPointer<QObjectData> d_ptr;
static const QMetaObject staticQtMetaObject;
diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp
index 87e154f..dc9cabf 100644
--- a/src/corelib/kernel/qsharedmemory.cpp
+++ b/src/corelib/kernel/qsharedmemory.cpp
@@ -44,7 +44,9 @@
#include "qsystemsemaphore.h"
#include <qdir.h>
#include <qcryptographichash.h>
-
+#ifdef Q_OS_SYMBIAN
+#include <e32const.h>
+#endif
#include <qdebug.h>
QT_BEGIN_NAMESPACE
@@ -57,6 +59,7 @@ QT_BEGIN_NAMESPACE
the subset that the win/unix kernel allows.
On Unix this will be a file name
+ On Symbian key will be truncated to 80 characters
*/
QString
QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
@@ -70,10 +73,12 @@ QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
QString part1 = key;
part1.replace(QRegExp(QLatin1String("[^A-Za-z]")), QString());
result.append(part1);
+#ifdef Q_OS_SYMBIAN
+ return result.left(KMaxKernelName);
+#endif
QByteArray hex = QCryptographicHash::hash(key.toUtf8(), QCryptographicHash::Sha1).toHex();
result.append(QLatin1String(hex));
-
#ifdef Q_OS_WIN
return result;
#else
@@ -118,6 +123,14 @@ QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
process. This means that QSharedMemory should not be used across
multiple threads in the same process in HP-UX.
+ \o Symbian: QSharedMemory does not "own" the shared memory segment.
+ When all threads or processes that have an instance of QSharedMemory
+ attached to a particular shared memory segment have either destroyed
+ their instance of QSharedMemory or exited, the Symbian kernel
+ releases the shared memory segment automatically.
+ Also, access to a shared memory segment cannot be limited to read-only
+ in Symbian.
+
\endlist
Remember to lock the shared memory with lock() before reading from
diff --git a/src/corelib/kernel/qsharedmemory_p.h b/src/corelib/kernel/qsharedmemory_p.h
index 08f0321..a7524d9 100644
--- a/src/corelib/kernel/qsharedmemory_p.h
+++ b/src/corelib/kernel/qsharedmemory_p.h
@@ -71,6 +71,9 @@ namespace QSharedMemoryPrivate
#ifdef Q_OS_WIN
#include <qt_windows.h>
+#elif defined(Q_OS_SYMBIAN)
+#include <e32std.h>
+#include <sys/types.h>
#else
#include <sys/sem.h>
#endif
@@ -140,7 +143,11 @@ public:
bool attach(QSharedMemory::AccessMode mode);
bool detach();
+#ifdef Q_OS_SYMBIAN
+ void setErrorString(const QString &function, TInt errorCode);
+#else
void setErrorString(const QString &function);
+#endif
#ifndef QT_NO_SYSTEMSEMAPHORE
bool tryLocker(QSharedMemoryLocker *locker, const QString function) {
@@ -156,6 +163,8 @@ public:
private:
#ifdef Q_OS_WIN
HANDLE hand;
+#elif defined(Q_OS_SYMBIAN)
+ RChunk chunk;
#else
key_t unix_key;
#endif
diff --git a/src/corelib/kernel/qsharedmemory_symbian.cpp b/src/corelib/kernel/qsharedmemory_symbian.cpp
new file mode 100644
index 0000000..d05f9f3
--- /dev/null
+++ b/src/corelib/kernel/qsharedmemory_symbian.cpp
@@ -0,0 +1,178 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qsharedmemory.h"
+#include "qsharedmemory_p.h"
+#include "qsystemsemaphore.h"
+#include "qcore_symbian_p.h"
+#include <qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_NO_SHAREDMEMORY
+
+#define QSHAREDMEMORY_DEBUG
+
+QSharedMemoryPrivate::QSharedMemoryPrivate() : QObjectPrivate(),
+ memory(0), size(0), error(QSharedMemory::NoError),
+ systemSemaphore(QString()), lockedByMe(false)
+{
+}
+
+void QSharedMemoryPrivate::setErrorString(const QString &function, TInt errorCode)
+{
+ if (errorCode == KErrNone)
+ return;
+ switch (errorCode) {
+ case KErrAlreadyExists:
+ error = QSharedMemory::AlreadyExists;
+ errorString = QSharedMemory::tr("%1: already exists").arg(function);
+ break;
+ case KErrNotFound:
+ error = QSharedMemory::NotFound;
+ errorString = QSharedMemory::tr("%1: doesn't exists").arg(function);
+ break;
+ case KErrArgument:
+ error = QSharedMemory::InvalidSize;
+ errorString = QSharedMemory::tr("%1: invalid size").arg(function);
+ break;
+ case KErrNoMemory:
+ error = QSharedMemory::OutOfResources;
+ errorString = QSharedMemory::tr("%1: out of resources").arg(function);
+ break;
+ case KErrPermissionDenied:
+ error = QSharedMemory::PermissionDenied;
+ errorString = QSharedMemory::tr("%1: permission denied").arg(function);
+ break;
+ default:
+ errorString = QSharedMemory::tr("%1: unknown error %2").arg(function).arg(errorCode);
+ error = QSharedMemory::UnknownError;
+#if defined QSHAREDMEMORY_DEBUG
+ qDebug() << errorString << "key" << key;
+#endif
+ }
+}
+
+key_t QSharedMemoryPrivate::handle()
+{
+ // Not really cost effective to check here if shared memory is attachable, as it requires
+ // exactly the same call as attaching, so always assume handle is valid and return failure
+ // from attach.
+ return 1;
+}
+
+bool QSharedMemoryPrivate::cleanHandle()
+{
+ chunk.Close();
+ return true;
+}
+
+bool QSharedMemoryPrivate::create(int size)
+{
+ // Get a windows acceptable key
+ QString safeKey = makePlatformSafeKey(key);
+ QString function = QLatin1String("QSharedMemory::create");
+ if (safeKey.isEmpty()) {
+ error = QSharedMemory::KeyError;
+ errorString = QSharedMemory::tr("%1: key error").arg(function);
+ return false;
+ }
+
+ TPtrC ptr(qt_QString2TPtrC(safeKey));
+
+ TInt err = chunk.CreateGlobal(ptr, size, size);
+
+ setErrorString(function, err);
+
+ if (err != KErrNone)
+ return false;
+
+ // Zero out the created chunk
+ Mem::FillZ(chunk.Base(), chunk.Size());
+
+ return true;
+}
+
+bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
+{
+ // Grab a pointer to the memory block
+ TBool readOnly = (mode == QSharedMemory::ReadOnly ? true : false);
+
+ if (!chunk.Handle()) {
+ QString function = QLatin1String("QSharedMemory::handle");
+ QString safeKey = makePlatformSafeKey(key);
+ if (safeKey.isEmpty()) {
+ error = QSharedMemory::KeyError;
+ errorString = QSharedMemory::tr("%1: unable to make key").arg(function);
+ return false;
+ }
+
+ TPtrC ptr(qt_QString2TPtrC(safeKey));
+
+ TInt err = KErrNoMemory;
+
+ err = chunk.OpenGlobal(ptr, false);
+
+ if (err != KErrNone) {
+ setErrorString(function, err);
+ return false;
+ }
+ }
+
+ size = chunk.Size();
+ memory = chunk.Base();
+
+ return true;
+}
+
+bool QSharedMemoryPrivate::detach()
+{
+ chunk.Close();
+
+ memory = 0;
+ size = 0;
+
+ return true;
+}
+
+#endif //QT_NO_SHAREDMEMORY
+
+QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qsharedmemory_unix.cpp b/src/corelib/kernel/qsharedmemory_unix.cpp
index 9187ad3..b664093 100644
--- a/src/corelib/kernel/qsharedmemory_unix.cpp
+++ b/src/corelib/kernel/qsharedmemory_unix.cpp
@@ -48,9 +48,6 @@
#include <qdebug.h>
#include <errno.h>
-
-#ifndef QT_NO_SHAREDMEMORY
-
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
@@ -59,6 +56,8 @@
#include <fcntl.h>
#include <unistd.h>
+#ifndef QT_NO_SHAREDMEMORY
+
QT_BEGIN_NAMESPACE
QSharedMemoryPrivate::QSharedMemoryPrivate()
diff --git a/src/corelib/kernel/qsystemsemaphore.cpp b/src/corelib/kernel/qsystemsemaphore.cpp
index e8426b3..fb9385a 100644
--- a/src/corelib/kernel/qsystemsemaphore.cpp
+++ b/src/corelib/kernel/qsystemsemaphore.cpp
@@ -123,6 +123,11 @@ QT_BEGIN_NAMESPACE
operations that were not released. Thus if the process acquires a
resource and then exits without releasing it, Unix will release that
resource.
+
+ \o Symbian: QSystemSemaphore behaves the same as Windows semaphores.
+ In other words, the operating system owns the semaphore and ignores
+ QSystemSemaphore::AccessMode.
+
\endlist
\sa QSharedMemory, QSemaphore
@@ -147,7 +152,7 @@ QT_BEGIN_NAMESPACE
creates a new semaphore for that key and sets its resource count to
\a initialValue.
- In Windows, \a mode is ignored, and the system always tries to
+ In Windows and in Symbian, \a mode is ignored, and the system always tries to
create a semaphore for the specified \a key. If the system does not
already have a semaphore identified as \a key, it creates the
semaphore and sets its resource count to \a initialValue. But if the
@@ -165,8 +170,8 @@ QT_BEGIN_NAMESPACE
\sa acquire(), key()
*/
QSystemSemaphore::QSystemSemaphore(const QString &key, int initialValue, AccessMode mode)
+ : d(new QSystemSemaphorePrivate)
{
- d = new QSystemSemaphorePrivate;
setKey(key, initialValue, mode);
}
@@ -188,7 +193,6 @@ QSystemSemaphore::QSystemSemaphore(const QString &key, int initialValue, AccessM
QSystemSemaphore::~QSystemSemaphore()
{
d->cleanHandle();
- delete d;
}
/*!
@@ -198,7 +202,7 @@ QSystemSemaphore::~QSystemSemaphore()
enable handling the problem in Unix implementations of semaphores
that survive a crash. In Unix, when a semaphore survives a crash, we
need a way to force it to reset its resource count, when the system
- reuses the semaphore. In Windows, where semaphores can't survive a
+ reuses the semaphore. In Windows and in Symbian, where semaphores can't survive a
crash, this enum has no effect.
\value Open If the semaphore already exists, its initial resource
@@ -211,7 +215,7 @@ QSystemSemaphore::~QSystemSemaphore()
This value should be passed to the constructor, when the first
semaphore for a particular key is constructed and you know that if
the semaphore already exists it could only be because of a crash. In
- Windows, where a semaphore can't survive a crash, Create and Open
+ Windows and in Symbian, where a semaphore can't survive a crash, Create and Open
have the same behavior.
*/
@@ -231,7 +235,7 @@ void QSystemSemaphore::setKey(const QString &key, int initialValue, AccessMode m
return;
d->error = NoError;
d->errorString = QString();
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
// optimization to not destroy/create the file & semaphore
if (key == d->key && mode == Create && d->createdSemaphore && d->createdFile) {
d->initialValue = initialValue;
diff --git a/src/corelib/kernel/qsystemsemaphore.h b/src/corelib/kernel/qsystemsemaphore.h
index 5a02072..3cafebf 100644
--- a/src/corelib/kernel/qsystemsemaphore.h
+++ b/src/corelib/kernel/qsystemsemaphore.h
@@ -43,6 +43,7 @@
#define QSYSTEMSEMAPHORE_H
#include <QtCore/qstring.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -89,7 +90,7 @@ public:
private:
Q_DISABLE_COPY(QSystemSemaphore)
- QSystemSemaphorePrivate *d;
+ QScopedPointer<QSystemSemaphorePrivate> d;
};
#endif // QT_NO_SYSTEMSEMAPHORE
diff --git a/src/corelib/kernel/qsystemsemaphore_p.h b/src/corelib/kernel/qsystemsemaphore_p.h
index a4a7389..0e6def3 100644
--- a/src/corelib/kernel/qsystemsemaphore_p.h
+++ b/src/corelib/kernel/qsystemsemaphore_p.h
@@ -62,6 +62,10 @@
# include <sys/types.h>
#endif
+#ifdef Q_OS_SYMBIAN
+class RSemaphore;
+#endif
+
QT_BEGIN_NAMESPACE
class QSystemSemaphorePrivate
@@ -77,10 +81,14 @@ public:
#ifdef Q_OS_WIN
HANDLE handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
+ void setErrorString(const QString &function);
+#elif defined(Q_OS_SYMBIAN)
+ int handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
+ void setErrorString(const QString &function,int err = 0);
#else
key_t handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
-#endif
void setErrorString(const QString &function);
+#endif
void cleanHandle();
bool modifySemaphore(int count);
@@ -90,13 +98,14 @@ public:
#ifdef Q_OS_WIN
HANDLE semaphore;
HANDLE semaphoreLock;
+#elif defined(Q_OS_SYMBIAN)
+ RSemaphore semaphore;
#else
int semaphore;
bool createdFile;
bool createdSemaphore;
key_t unix_key;
#endif
-
QString errorString;
QSystemSemaphore::SystemSemaphoreError error;
};
diff --git a/src/corelib/kernel/qsystemsemaphore_symbian.cpp b/src/corelib/kernel/qsystemsemaphore_symbian.cpp
new file mode 100644
index 0000000..8179046
--- /dev/null
+++ b/src/corelib/kernel/qsystemsemaphore_symbian.cpp
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qsystemsemaphore.h"
+#include "qsystemsemaphore_p.h"
+#include "qcoreapplication.h"
+#include <qdebug.h>
+
+#include <qcore_symbian_p.h>
+#include <e32cmn.h>
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_NO_SYSTEMSEMAPHORE
+
+QSystemSemaphorePrivate::QSystemSemaphorePrivate() :
+ error(QSystemSemaphore::NoError)
+{
+}
+
+void QSystemSemaphorePrivate::setErrorString(const QString &function, int err)
+{
+ if (err == KErrNone){
+ return;
+ }
+ switch(err){
+ case KErrAlreadyExists:
+ errorString = QCoreApplication::tr("%1: already exists", "QSystemSemaphore").arg(function);
+ error = QSystemSemaphore::AlreadyExists;
+ break;
+ case KErrNotFound:
+ errorString = QCoreApplication::tr("%1: doesn't exists", "QSystemSemaphore").arg(function);
+ error = QSystemSemaphore::NotFound;
+ break;
+ case KErrNoMemory:
+ case KErrInUse:
+ errorString = QCoreApplication::tr("%1: out of resources", "QSystemSemaphore").arg(function);
+ error = QSystemSemaphore::OutOfResources;
+ break;
+default:
+ errorString = QCoreApplication::tr("%1: unknown error %2", "QSystemSemaphore").arg(function).arg(err);
+ error = QSystemSemaphore::UnknownError;
+ }
+
+#if defined QSYSTEMSEMAPHORE_DEBUG
+ qDebug() << errorString << "key" << key;
+#endif
+}
+
+int QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode)
+{
+ // don't allow making handles on empty keys
+ if (key.isEmpty())
+ return 0;
+ QString safeName = makeKeyFileName();
+ TPtrC name(qt_QString2TPtrC(safeName));
+ int err;
+ err = semaphore.OpenGlobal(name,EOwnerProcess);
+ if (err == KErrNotFound){
+ err = semaphore.CreateGlobal(name,initialValue, EOwnerProcess);
+ }
+ if (err){
+ setErrorString(QLatin1String("QSystemSemaphore::handle"),err);
+ return 0;
+ }
+ return semaphore.Handle();
+}
+
+void QSystemSemaphorePrivate::cleanHandle()
+{
+ semaphore.Close();
+}
+
+bool QSystemSemaphorePrivate::modifySemaphore(int count)
+{
+ if (0 == handle())
+ return false;
+
+ if (count > 0) {
+ semaphore.Signal(count);
+ } else {
+ semaphore.Wait();
+ }
+ return true;
+}
+
+#endif //QT_NO_SYSTEMSEMAPHORE
+
+QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index a3434a4..9fc230e 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -156,16 +156,43 @@ static void construct(QVariant::Private *x, const void *copy)
x->data.b = copy ? *static_cast<const bool *>(copy) : false;
break;
case QVariant::Double:
+#if defined(Q_CC_RVCT)
+ // Using trinary operator with 64bit constants crashes when ran on Symbian device
+ if (copy){
+ x->data.d = *static_cast<const double*>(copy);
+ } else {
+ x->data.d = 0.0;
+ }
+#else
x->data.d = copy ? *static_cast<const double*>(copy) : 0.0;
+#endif
break;
case QMetaType::Float:
x->data.f = copy ? *static_cast<const float*>(copy) : 0.0f;
break;
case QVariant::LongLong:
+#if defined(Q_CC_RVCT)
+ // Using trinary operator with 64bit constants crashes when ran on Symbian device
+ if (copy){
+ x->data.ll = *static_cast<const qlonglong *>(copy);
+ } else {
+ x->data.ll = Q_INT64_C(0);
+ }
+#else
x->data.ll = copy ? *static_cast<const qlonglong *>(copy) : Q_INT64_C(0);
+#endif
break;
case QVariant::ULongLong:
+#if defined(Q_CC_RVCT)
+ // Using trinary operator with 64bit constants crashes when ran on Symbian device
+ if (copy){
+ x->data.ull = *static_cast<const qulonglong *>(copy);
+ } else {
+ x->data.ull = Q_UINT64_C(0);
+ }
+#else
x->data.ull = copy ? *static_cast<const qulonglong *>(copy) : Q_UINT64_C(0);
+#endif
break;
case QVariant::Invalid:
case QVariant::UserType:
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 79400a8..0ca0169 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -98,10 +98,10 @@ Q_GLOBAL_STATIC(QMutex, qt_library_mutex)
Unix), unless the file name has an absolute path. If the file
cannot be found, QLibrary tries the name with different
platform-specific file suffixes, like ".so" on Unix, ".dylib" on
- the Mac, or ".dll" on Windows. This makes it possible to specify
- shared libraries that are only identified by their basename (i.e.
- without their suffix), so the same code will work on different
- operating systems.
+ the Mac, or ".dll" on Windows and Symbian. This makes it possible
+ to specify shared libraries that are only identified by their
+ basename (i.e. without their suffix), so the same code will work
+ on different operating systems.
The most important functions are load() to dynamically load the
library file, isLoaded() to check whether loading was successful,
@@ -120,6 +120,11 @@ Q_GLOBAL_STATIC(QMutex, qt_library_mutex)
linking", which is done by the link step in the build process when
linking an executable against a library.
+ Note: In Symbian resolving symbols using their names is supported
+ only if the library is built as STDDLL. Otherwise ordinals must
+ be used. Also, in Symbian the path of the library is ignored and
+ system default library location is always used.
+
The following code snippet loads a library, resolves the symbol
"mysymbol", and calls the function if everything succeeded. If
something goes wrong, e.g. the library file does not exist or the
@@ -288,7 +293,7 @@ static bool qt_parse_pattern(const char *s, uint *version, bool *debug, QByteArr
}
#endif // QT_NO_PLUGIN_CHECK
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(QT_NO_PLUGIN_CHECK)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_PLUGIN_CHECK)
#if defined(Q_OS_FREEBSD) || defined(Q_OS_LINUX)
# define USE_MMAP
@@ -361,7 +366,7 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB
char *filedata = 0;
ulong fdlen = 0;
-#ifdef USE_MMAP
+# ifdef USE_MMAP
char *mapaddr = 0;
size_t maplen = file.size();
mapaddr = (char *) mmap(mapaddr, maplen, PROT_READ, MAP_PRIVATE, file.handle(), 0);
@@ -378,14 +383,14 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB
lib->errorString = QLibrary::tr("Could not mmap '%1': %2")
.arg(library)
.arg(qt_error_string());
-#endif // USE_MMAP
+# endif // USE_MMAP
// try reading the data into memory instead
data = file.readAll();
filedata = data.data();
fdlen = data.size();
-#ifdef USE_MMAP
+# ifdef USE_MMAP
}
-#endif // USE_MMAP
+# endif // USE_MMAP
// verify that the pattern is present in the plugin
const char pattern[] = "pattern=QT_PLUGIN_VERIFICATION_DATA";
@@ -398,7 +403,7 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB
if (!ret && lib)
lib->errorString = QLibrary::tr("Plugin verification data mismatch in '%1'").arg(library);
-#ifdef USE_MMAP
+# ifdef USE_MMAP
if (mapaddr != MAP_FAILED && munmap(mapaddr, maplen) != 0) {
if (qt_debug_component())
qWarning("munmap: %s", qPrintable(qt_error_string(errno)));
@@ -407,13 +412,13 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB
.arg(library)
.arg( qt_error_string() );
}
-#endif // USE_MMAP
+# endif // USE_MMAP
file.close();
return ret;
}
-#endif // Q_OS_UNIX && !Q_OS_MAC && !defined(QT_NO_PLUGIN_CHECK)
+#endif // Q_OS_UNIX && !Q_OS_MAC && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_PLUGIN_CHECK)
typedef QMap<QString, QLibraryPrivate*> LibraryMap;
Q_GLOBAL_STATIC(LibraryMap, libraryMap)
@@ -493,6 +498,11 @@ bool QLibraryPrivate::loadPlugin()
}
if (load()) {
instance = (QtPluginInstanceFunction)resolve("qt_plugin_instance");
+#if defined(Q_OS_SYMBIAN)
+ // If resolving with function name failed (i.e. not STDDLL), try resolving using known ordinal
+ if (!instance)
+ instance = (QtPluginInstanceFunction)resolve("2");
+#endif
return instance;
}
return false;
@@ -517,6 +527,10 @@ bool QLibrary::isLibrary(const QString &fileName)
{
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
return fileName.endsWith(QLatin1String(".dll"));
+#elif defined(Q_OS_SYMBIAN)
+ // Plugin stubs are also considered libraries in Symbian.
+ return (fileName.endsWith(QLatin1String(".dll")) ||
+ fileName.endsWith(QLatin1String(".qtplugin")));
#else
QString completeSuffix = QFileInfo(fileName).completeSuffix();
if (completeSuffix.isEmpty())
@@ -597,10 +611,10 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
.arg(fileName);
QStringList reg;
#ifndef QT_NO_SETTINGS
- bool madeSettings = false;
+ QScopedPointer<QSettings> madeSettings;
if (!settings) {
settings = new QSettings(QSettings::UserScope, QLatin1String("Trolltech"));
- madeSettings = true;
+ madeSettings.reset(settings);
}
reg = settings->value(regkey).toStringList();
#endif
@@ -610,7 +624,7 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
key = reg.at(2).toLatin1();
success = qt_version != 0;
} else {
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN)
if (!pHnd) {
// use unix shortcut to avoid loading the library
success = qt_unix_query(fileName, &qt_version, &debug, &key, this);
@@ -629,6 +643,10 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
temporary_load = load_sys();
});
#else
+# if defined(Q_OS_SYMBIAN)
+ //Guard against accidentally trying to load non-plugin libraries by making sure the stub exists
+ if (fileinfo.exists())
+# endif
temporary_load = load_sys();
#endif
}
@@ -647,8 +665,17 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
#endif
: (QtPluginQueryVerificationDataFunction) resolve("qt_plugin_query_verification_data");
#else
- QtPluginQueryVerificationDataFunction qtPluginQueryVerificationDataFunction =
- (QtPluginQueryVerificationDataFunction) resolve("qt_plugin_query_verification_data");
+ QtPluginQueryVerificationDataFunction qtPluginQueryVerificationDataFunction = NULL;
+# if defined(Q_OS_SYMBIAN)
+ if (temporary_load) {
+ qtPluginQueryVerificationDataFunction = (QtPluginQueryVerificationDataFunction) resolve("qt_plugin_query_verification_data");
+ // If resolving with function name failed (i.e. not STDDLL), try resolving using known ordinal
+ if (!qtPluginQueryVerificationDataFunction)
+ qtPluginQueryVerificationDataFunction = (QtPluginQueryVerificationDataFunction) resolve("1");
+ }
+# else
+ qtPluginQueryVerificationDataFunction = (QtPluginQueryVerificationDataFunction) resolve("qt_plugin_query_verification_data");
+# endif
#endif
if (!qtPluginQueryVerificationDataFunction
@@ -681,8 +708,7 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
#endif
}
#ifndef QT_NO_SETTINGS
- if (madeSettings)
- delete settings;
+ madeSettings.reset();
#endif
if (!success) {
@@ -819,6 +845,8 @@ QLibrary::QLibrary(QObject *parent)
QLibrary will automatically look for the file with the appropriate
suffix in accordance with the platform, e.g. ".so" on Unix,
".dylib" on Mac OS X, and ".dll" on Windows. (See \l{fileName}.)
+
+ Note: In Symbian the path portion of the \a fileName is ignored.
*/
QLibrary::QLibrary(const QString& fileName, QObject *parent)
:QObject(parent), d(0), did_load(false)
@@ -830,13 +858,15 @@ QLibrary::QLibrary(const QString& fileName, QObject *parent)
/*!
Constructs a library object with the given \a parent that will
load the library specified by \a fileName and major version number \a verNum.
- Currently, the version number is ignored on Windows.
+ Currently, the version number is ignored on Windows and Symbian.
We recommend omitting the file's suffix in \a fileName, since
QLibrary will automatically look for the file with the appropriate
suffix in accordance with the platform, e.g. ".so" on Unix,
".dylib" on Mac OS X, and ".dll" on Windows. (See \l{fileName}.)
- */
+
+ Note: In Symbian the path portion of the \a fileName is ignored.
+*/
QLibrary::QLibrary(const QString& fileName, int verNum, QObject *parent)
:QObject(parent), d(0), did_load(false)
{
@@ -846,12 +876,14 @@ QLibrary::QLibrary(const QString& fileName, int verNum, QObject *parent)
/*!
Constructs a library object with the given \a parent that will
load the library specified by \a fileName and full version number \a version.
- Currently, the version number is ignored on Windows.
+ Currently, the version number is ignored on Windows and Symbian.
We recommend omitting the file's suffix in \a fileName, since
QLibrary will automatically look for the file with the appropriate
suffix in accordance with the platform, e.g. ".so" on Unix,
".dylib" on Mac OS X, and ".dll" on Windows. (See \l{fileName}.)
+
+ Note: In Symbian the path portion of the \a fileName is ignored.
*/
QLibrary::QLibrary(const QString& fileName, const QString &version, QObject *parent)
:QObject(parent), d(0), did_load(false)
@@ -893,6 +925,8 @@ QLibrary::~QLibrary()
platforms, fileName() will return "libGL.so". If the file name was
originally passed as "/usr/lib/libGL", fileName() will return
"/usr/lib/libGL.so".
+
+ Note: In Symbian the path portion of the \a fileName is ignored.
*/
void QLibrary::setFileName(const QString &fileName)
@@ -920,7 +954,10 @@ QString QLibrary::fileName() const
Sets the fileName property and major version number to \a fileName
and \a versionNumber respectively.
- The \a versionNumber is ignored on Windows.
+ The \a versionNumber is ignored on Windows and Symbian.
+
+ Note: In Symbian the path portion of the \a fileName is ignored.
+
\sa setFileName()
*/
void QLibrary::setFileNameAndVersion(const QString &fileName, int verNum)
@@ -941,7 +978,10 @@ void QLibrary::setFileNameAndVersion(const QString &fileName, int verNum)
Sets the fileName property and full version number to \a fileName
and \a version respectively.
- The \a version parameter is ignored on Windows.
+ The \a version parameter is ignored on Windows and Symbian.
+
+ Note: In Symbian the path portion of the \a fileName is ignored.
+
\sa setFileName()
*/
void QLibrary::setFileNameAndVersion(const QString &fileName, const QString &version)
@@ -977,6 +1017,8 @@ void QLibrary::setFileNameAndVersion(const QString &fileName, const QString &ver
\snippet doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp 4
+ Note: In Symbian resolving with symbol names works only if the loaded
+ library was built as STDDLL. Otherwise, the ordinals must be used.
*/
void *QLibrary::resolve(const char *symbol)
{
@@ -996,6 +1038,9 @@ void *QLibrary::resolve(const char *symbol)
The function returns 0 if the symbol could not be resolved or if
the library could not be loaded.
+ Note: In Symbian resolving with symbol names works only if the loaded
+ library was built as STDDLL. Otherwise, the ordinals must be used.
+
\sa resolve()
*/
void *QLibrary::resolve(const QString &fileName, const char *symbol)
@@ -1016,6 +1061,9 @@ void *QLibrary::resolve(const QString &fileName, const char *symbol)
The function returns 0 if the symbol could not be resolved or if
the library could not be loaded.
+ Note: In Symbian resolving with symbol names works only if the loaded
+ library was built as STDDLL. Otherwise, the ordinals must be used.
+
\sa resolve()
*/
void *QLibrary::resolve(const QString &fileName, int verNum, const char *symbol)
@@ -1037,6 +1085,9 @@ void *QLibrary::resolve(const QString &fileName, int verNum, const char *symbol)
The function returns 0 if the symbol could not be resolved or if
the library could not be loaded.
+ Note: In Symbian resolving with symbol names works only if the loaded
+ library was built as STDDLL. Otherwise, the ordinals must be used.
+
\sa resolve()
*/
void *QLibrary::resolve(const QString &fileName, const QString &version, const char *symbol)
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index de1baac..f6830f2 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -77,18 +77,31 @@ static QString qdlerror()
bool QLibraryPrivate::load_sys()
{
QFileInfo fi(fileName);
+
+#if defined(Q_OS_SYMBIAN)
+ QString path; // In Symbian, always resolve with just the filename
+ QString name;
+
+ // Replace possible ".qtplugin" suffix with ".dll"
+ if (fi.suffix() == QLatin1String("qtplugin"))
+ name = fi.completeBaseName() + QLatin1String(".dll");
+ else
+ name = fi.fileName();
+#else
QString path = fi.path();
QString name = fi.fileName();
if (path == QLatin1String(".") && !fileName.startsWith(path))
path.clear();
else
path += QLatin1Char('/');
-
+#endif
// The first filename we want to attempt to load is the filename as the callee specified.
// Thus, the first attempt we do must be with an empty prefix and empty suffix.
QStringList suffixes(QLatin1String("")), prefixes(QLatin1String(""));
if (pluginState != IsAPlugin) {
+#if !defined(Q_OS_SYMBIAN)
prefixes << QLatin1String("lib");
+#endif
#if defined(Q_OS_HPUX)
// according to
// http://docs.hp.com/en/B2355-90968/linkerdifferencesiapa.htm
@@ -116,6 +129,9 @@ bool QLibraryPrivate::load_sys()
}
#elif defined(Q_OS_AIX)
suffixes << ".a";
+
+#elif defined(Q_OS_SYMBIAN)
+ suffixes << QLatin1String(".dll");
#else
if (!fullVersion.isEmpty()) {
suffixes << QString::fromLatin1(".so.%1").arg(fullVersion);
@@ -153,7 +169,7 @@ bool QLibraryPrivate::load_sys()
else {
#if defined(Q_OS_MAC)
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4)
-#endif
+#endif
dlFlags |= RTLD_LOCAL;
}
#endif
@@ -185,6 +201,12 @@ bool QLibraryPrivate::load_sys()
#else
pHnd = dlopen(QFile::encodeName(attempt), dlFlags);
#endif
+
+#if defined(Q_OS_SYMBIAN)
+ // Never try again in symbian, dlopen already handles the library search logic,
+ // and there is only one possible suffix.
+ retry = false;
+#else
if (!pHnd && fileName.startsWith(QLatin1Char('/')) && QFile::exists(attempt)) {
// We only want to continue if dlopen failed due to that the shared library did not exist.
// However, we are only able to apply this check for absolute filenames (since they are
@@ -192,6 +214,7 @@ bool QLibraryPrivate::load_sys()
// This is all because dlerror is flawed and cannot tell us the reason why it failed.
retry = false;
}
+#endif
}
}
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 15ebe3d..8d1c0f7 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -46,6 +46,7 @@
#include <qfileinfo.h>
#include "qlibrary_p.h"
#include "qdebug.h"
+#include "qdir.h"
#ifndef QT_NO_LIBRARY
@@ -116,6 +117,16 @@ QT_BEGIN_NAMESPACE
link to plugins statically. You can use QLibrary if you need to
load dynamic libraries in a statically linked application.
+ \note In Symbian the plugin stub files must be used whenever a
+ path to plugin is needed. For the purposes of loading plugins,
+ the stubs can be considered to have the same name as the actual
+ plugin binary. In practice they have ".qtplugin" extension
+ instead of ".dll", but this difference is handled transparently
+ by QPluginLoader and QLibrary to avoid need for Symbian specific
+ plugin handling in most Qt applications. Plugin stubs are needed
+ because Symbian Platform Security denies all access to the directory
+ where the actual plugin binaries are located.
+
\sa QLibrary, {Plug & Paint Example}
*/
@@ -136,6 +147,8 @@ QPluginLoader::QPluginLoader(QObject *parent)
Unix, - \c .dylib on Mac OS X, and \c .dll on Windows. The suffix
can be verified with QLibrary::isLibrary().
+ Note: In Symbian the \a fileName must point to plugin stub file.
+
\sa setFileName()
*/
QPluginLoader::QPluginLoader(const QString &fileName, QObject *parent)
@@ -170,7 +183,7 @@ QPluginLoader::~QPluginLoader()
The root component, returned by this function, is not deleted when
the QPluginLoader is destroyed. If you want to ensure that the root
component is deleted, you should call unload() as soon you don't
- need to access the core component anymore. When the library is
+ need to access the core component anymore. When the library is
finally unloaded, the root component will automatically be deleted.
The component object is a QObject. Use qobject_cast() to access
@@ -221,9 +234,9 @@ bool QPluginLoader::load()
call will fail, and unloading will only happen when every instance
has called unload().
- Don't try to delete the root component. Instead rely on
+ Don't try to delete the root component. Instead rely on
that unload() will automatically delete it when needed.
-
+
\sa instance(), load()
*/
bool QPluginLoader::unload()
@@ -261,6 +274,8 @@ bool QPluginLoader::isLoaded() const
By default, this property contains an empty string.
+ Note: In Symbian the \a fileName must point to plugin stub file.
+
\sa load()
*/
void QPluginLoader::setFileName(const QString &fileName)
@@ -273,7 +288,42 @@ void QPluginLoader::setFileName(const QString &fileName)
d = 0;
did_load = false;
}
+
+#if defined(Q_OS_SYMBIAN)
+ // In Symbian we actually look for plugin stub, so modify the filename
+ // to make canonicalFilePath find the file, if .dll is specified.
+ QFileInfo fi(fileName);
+
+ if (fi.suffix() == QLatin1String("dll")) {
+ QString stubName = fileName;
+ stubName.chop(3);
+ stubName += QLatin1String("qtplugin");
+ fi = QFileInfo(stubName);
+ }
+
+ QString fn = fi.canonicalFilePath();
+ // If not found directly, check also all the available drives
+ if (!fn.length()) {
+ QString stubPath(fi.fileName().length() ? fi.absoluteFilePath() : QString());
+ if (stubPath.length() > 1) {
+ if (stubPath.at(1).toAscii() == ':')
+ stubPath.remove(0,2);
+ QFileInfoList driveList(QDir::drives());
+ foreach(const QFileInfo& drive, driveList) {
+ QString testFilePath(drive.absolutePath() + stubPath);
+ testFilePath = QDir::cleanPath(testFilePath);
+ if (QFile::exists(testFilePath)) {
+ fn = testFilePath;
+ break;
+ }
+ }
+ }
+ }
+
+#else
QString fn = QFileInfo(fileName).canonicalFilePath();
+#endif
+
d = QLibraryPrivate::findOrCreate(fn);
d->loadHints = lh;
if (fn.isEmpty())
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index cee8bf7..a6138a1 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -558,7 +558,7 @@ bool QUuid::operator>(const QUuid &other) const
\sa variant(), version()
*/
-#if defined(Q_OS_WIN32)
+#if defined(Q_OS_WIN32) && ! defined(Q_CC_MWERKS)
QT_BEGIN_INCLUDE_NAMESPACE
#include <objbase.h> // For CoCreateGuid
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 8fba574..a2b944d 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -129,35 +129,6 @@ void QThreadData::deref()
#endif
}
-
-#ifndef QT_NO_THREAD
-/*
- QThreadPrivate
-*/
-
-QThreadPrivate::QThreadPrivate(QThreadData *d)
- : QObjectPrivate(), running(false), finished(false), terminated(false),
- stackSize(0), priority(QThread::InheritPriority), data(d)
-{
-#if defined (Q_OS_UNIX)
- thread_id = 0;
-#elif defined (Q_WS_WIN)
- handle = 0;
- id = 0;
- waiters = 0;
- terminationEnabled = true;
- terminatePending = false;
-#endif
-
- if (!data)
- data = new QThreadData;
-}
-
-QThreadPrivate::~QThreadPrivate()
-{
- data->deref();
-}
-
/*
QAdoptedThread
*/
@@ -167,25 +138,28 @@ QAdoptedThread::QAdoptedThread(QThreadData *data)
{
// thread should be running and not finished for the lifetime
// of the application (even if QCoreApplication goes away)
+#ifndef QT_NO_THREAD
d_func()->running = true;
d_func()->finished = false;
init();
+#endif
// fprintf(stderr, "new QAdoptedThread = %p\n", this);
}
QAdoptedThread::~QAdoptedThread()
{
+#ifndef QT_NO_THREAD
QThreadPrivate::finish(this);
-
+#endif
// fprintf(stderr, "~QAdoptedThread = %p\n", this);
}
QThread *QAdoptedThread::createThreadForAdoption()
{
- QThread *t = new QAdoptedThread(0);
- t->moveToThread(t);
- return t;
+ QScopedPointer<QThread> t(new QAdoptedThread(0));
+ t->moveToThread(t.data());
+ return t.take();
}
void QAdoptedThread::run()
@@ -193,6 +167,35 @@ void QAdoptedThread::run()
// this function should never be called
qFatal("QAdoptedThread::run(): Internal error, this implementation should never be called.");
}
+#ifndef QT_NO_THREAD
+/*
+ QThreadPrivate
+*/
+
+QThreadPrivate::QThreadPrivate(QThreadData *d)
+ : QObjectPrivate(), running(false), finished(false), terminated(false),
+ stackSize(0), priority(QThread::InheritPriority), data(d)
+{
+#if defined (Q_OS_UNIX)
+ thread_id = 0;
+#elif defined (Q_WS_WIN)
+ handle = 0;
+ id = 0;
+ waiters = 0;
+#endif
+#if defined (Q_WS_WIN) || defined (Q_OS_SYMBIAN)
+ terminationEnabled = true;
+ terminatePending = false;
+#endif
+
+ if (!data)
+ data = new QThreadData;
+}
+
+QThreadPrivate::~QThreadPrivate()
+{
+ data->deref();
+}
/*!
\class QThread
@@ -474,10 +477,10 @@ uint QThread::stackSize() const
int QThread::exec()
{
Q_D(QThread);
- d->mutex.lock();
+ QMutexLocker locker(&d->mutex);
d->data->quitNow = false;
QEventLoop eventLoop;
- d->mutex.unlock();
+ locker.unlock();
int returnCode = eventLoop.exec();
return returnCode;
}
@@ -710,25 +713,37 @@ QThread::Priority QThread::priority() const
#else // QT_NO_THREAD
-QT_BEGIN_INCLUDE_NAMESPACE
-#include <private/qcoreapplication_p.h>
-QT_END_INCLUDE_NAMESPACE
-
-Q_GLOBAL_STATIC_WITH_ARGS(QThreadData, staticThreadData, (0));
-QThread* QThread::instance = 0;
-
-QThread::QThread() : QObject(*new QThreadPrivate, (QObject*)0)
-{
+QThread::QThread(QObject *parent)
+ : QObject(*(new QThreadPrivate), (QObject*)0){
Q_D(QThread);
d->data->thread = this;
- QCoreApplicationPrivate::theMainThread = this;
+}
+
+QThread *QThread::currentThread()
+{
+ return QThreadData::current()->thread;
}
QThreadData* QThreadData::current()
{
- if (QThread::instance)
- return QThread::instance->d_func()->data;
- return staticThreadData();
+ static QThreadData *data = 0; // reinterpret_cast<QThreadData *>(pthread_getspecific(current_thread_data_key));
+ if (!data) {
+ QScopedPointer<QThreadData> newdata(new QThreadData);
+ newdata->thread = new QAdoptedThread(newdata.data());
+ data = newdata.take();
+ data->deref();
+ }
+ return data;
+}
+
+/*! \internal
+ */
+QThread::QThread(QThreadPrivate &dd, QObject *parent)
+ : QObject(dd, parent)
+{
+ Q_D(QThread);
+ // fprintf(stderr, "QThreadData %p taken from private data for thread %p\n", d->data, this);
+ d->data->thread = this;
}
#endif // QT_NO_THREAD
diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h
index d9a6240..7cbb264 100644
--- a/src/corelib/thread/qthread.h
+++ b/src/corelib/thread/qthread.h
@@ -142,15 +142,18 @@ class Q_CORE_EXPORT QThread : public QObject
{
public:
static Qt::HANDLE currentThreadId() { return Qt::HANDLE(currentThread()); }
- static QThread* currentThread()
- { if (!instance) instance = new QThread(); return instance; }
+ static QThread* currentThread();
+
+protected:
+ QThread(QThreadPrivate &dd, QObject *parent = 0);
private:
- QThread();
+ explicit QThread(QObject *parent = 0);
static QThread *instance;
friend class QCoreApplication;
friend class QThreadData;
+ friend class QAdoptedThread;
Q_DECLARE_PRIVATE(QThread)
};
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index eb290db..c575005 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -62,6 +62,10 @@
#include "QtCore/qmap.h"
#include "private/qobject_p.h"
+#ifdef Q_OS_SYMBIAN
+#include <e32base.h>
+#endif
+
QT_BEGIN_NAMESPACE
class QAbstractEventDispatcher;
@@ -132,46 +136,37 @@ public:
QWaitCondition thread_done;
static void *start(void *arg);
- static void finish(void *arg);
+#if defined(Q_OS_SYMBIAN)
+ static void finish(void *arg, bool lockAnyway=true, bool closeNativeHandle=true);
+#else
+ static void finish(void *);
#endif
+#endif // Q_OS_UNIX
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
HANDLE handle;
unsigned int id;
int waiters;
- bool terminationEnabled, terminatePending;
static unsigned int __stdcall start(void *);
static void finish(void *, bool lockAnyway=true);
#endif // Q_OS_WIN32
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined (Q_OS_SYMBIAN)
+ bool terminationEnabled, terminatePending;
+# endif
QThreadData *data;
static void createEventDispatcher(QThreadData *data);
};
-// thread wrapper for the main() thread
-class QAdoptedThread : public QThread
-{
- Q_DECLARE_PRIVATE(QThread)
-
-public:
- QAdoptedThread(QThreadData *data = 0);
- ~QAdoptedThread();
- void init();
-
- static QThread *createThreadForAdoption();
-private:
- void run();
-};
-
#else // QT_NO_THREAD
class QThreadPrivate : public QObjectPrivate
{
public:
- QThreadPrivate() : data(QThreadData::current()) {}
- ~QThreadPrivate() { }
+ QThreadPrivate(QThreadData *d = 0) : data(d ? d : new QThreadData) {}
+ ~QThreadPrivate() { delete data; }
QThreadData *data;
@@ -210,6 +205,10 @@ public:
QMap<int, void *> tls;
QMutex mutex;
+
+# ifdef Q_OS_SYMBIAN
+ RThread symbian_thread_handle;
+# endif
};
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 8f1c698..d2a824a 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -47,7 +47,12 @@
#if !defined(QT_NO_GLIB)
# include "../kernel/qeventdispatcher_glib_p.h"
#endif
+
+#ifdef Q_OS_SYMBIAN
+#include <private/qeventdispatcher_symbian_p.h>
+#else
#include <private/qeventdispatcher_unix_p.h>
+#endif
#include "qthreadstorage.h"
@@ -119,7 +124,14 @@ QThreadData *QThreadData::current()
} else {
data = new QThreadData;
pthread_setspecific(current_thread_data_key, data);
- data->thread = new QAdoptedThread(data);
+ QT_TRY {
+ data->thread = new QAdoptedThread(data);
+ } QT_CATCH(...) {
+ pthread_setspecific(current_thread_data_key, 0);
+ data->deref();
+ data = 0;
+ QT_RETHROW;
+ }
data->deref();
}
if (!QCoreApplicationPrivate::theMainThread)
@@ -131,7 +143,13 @@ QThreadData *QThreadData::current()
void QAdoptedThread::init()
{
- d_func()->thread_id = pthread_self();
+ Q_D(QThread);
+ d->thread_id = pthread_self();
+#ifdef Q_OS_SYMBIAN
+ d->data->symbian_thread_handle = RThread();
+ TThreadId threadId = d->data->symbian_thread_handle.Id();
+ d->data->symbian_thread_handle.Open(threadId);
+#endif
}
/*
@@ -159,7 +177,11 @@ void QThreadPrivate::createEventDispatcher(QThreadData *data)
data->eventDispatcher = new QEventDispatcherGlib;
else
#endif
+#ifdef Q_OS_SYMBIAN
+ data->eventDispatcher = new QEventDispatcherSymbian;
+#else
data->eventDispatcher = new QEventDispatcherUNIX;
+#endif
data->eventDispatcher->startingUp();
}
@@ -167,12 +189,24 @@ void QThreadPrivate::createEventDispatcher(QThreadData *data)
void *QThreadPrivate::start(void *arg)
{
+#ifndef Q_OS_SYMBIAN
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
pthread_cleanup_push(QThreadPrivate::finish, arg);
-
+#endif
+
QThread *thr = reinterpret_cast<QThread *>(arg);
QThreadData *data = QThreadData::get2(thr);
+#ifdef Q_OS_SYMBIAN
+ // Because Symbian Open C does not provide a way to convert between
+ // RThread and pthread_t, we must delay initialization of the RThread
+ // handle when creating a thread, until we are running in the new thread.
+ // Here, we pick up the current thread and assign that to the handle.
+ data->symbian_thread_handle = RThread();
+ TThreadId threadId = data->symbian_thread_handle.Id();
+ data->symbian_thread_handle.Open(threadId);
+#endif
+
pthread_once(&current_thread_data_once, create_current_thread_data_key);
pthread_setspecific(current_thread_data_key, data);
@@ -183,19 +217,33 @@ void *QThreadPrivate::start(void *arg)
createEventDispatcher(data);
emit thr->started();
+#ifndef Q_OS_SYMBIAN
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_testcancel();
+#endif
thr->run();
+#ifndef Q_OS_SYMBIAN
pthread_cleanup_pop(1);
+#else
+ QThreadPrivate::finish(arg);
+#endif
+
return 0;
}
+#ifdef Q_OS_SYMBIAN
+void QThreadPrivate::finish(void *arg, bool lockAnyway, bool closeNativeHandle)
+#else
void QThreadPrivate::finish(void *arg)
+#endif
{
QThread *thr = reinterpret_cast<QThread *>(arg);
QThreadPrivate *d = thr->d_func();
- QMutexLocker locker(&d->mutex);
+#ifdef Q_OS_SYMBIAN
+ if (lockAnyway)
+#endif
+ d->mutex.lock();
d->priority = QThread::InheritPriority;
d->running = false;
@@ -216,7 +264,15 @@ void QThreadPrivate::finish(void *arg)
QThreadStorageData::finish((void **)data);
d->thread_id = 0;
+#ifdef Q_OS_SYMBIAN
+ if (closeNativeHandle)
+ d->data->symbian_thread_handle.Close();
+#endif
d->thread_done.wakeAll();
+#ifdef Q_OS_SYMBIAN
+ if (lockAnyway)
+#endif
+ d->mutex.unlock();
}
@@ -268,6 +324,9 @@ int QThread::idealThreadCount()
cores = (int)sysconf(_SC_NPROC_ONLN);
#elif defined(Q_OS_INTEGRITY)
// ### TODO - how to get the amound of CPUs on INTEGRITY?
+#elif defined(Q_OS_SYMBIAN)
+ // ### TODO - Get the number of cores from HAL? when multicore architectures (SMP) are supported
+ cores = 1;
#else
// the rest: Linux, Solaris, AIX, Tru64
cores = (int)sysconf(_SC_NPROCESSORS_ONLN);
@@ -352,7 +411,8 @@ void QThread::start(Priority priority)
d->priority = priority;
-#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
+#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && !defined(Q_OS_SYMBIAN) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
+// ### Need to implement thread sheduling and priorities for symbian os. Implementation removed for now
switch (priority) {
case InheritPriority:
{
@@ -434,7 +494,9 @@ void QThread::start(Priority priority)
if (code == EPERM) {
// caller does not have permission to set the scheduling
// parameters/policy
+#ifndef Q_OS_SYMBIAN
pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED);
+#endif
code =
pthread_create(&d->thread_id, &attr, QThreadPrivate::start, this);
}
@@ -447,6 +509,9 @@ void QThread::start(Priority priority)
d->running = false;
d->finished = false;
d->thread_id = 0;
+#ifdef Q_OS_SYMBIAN
+ d->data->symbian_thread_handle.Close();
+#endif
}
}
@@ -458,6 +523,7 @@ void QThread::terminate()
if (!d->thread_id)
return;
+#ifndef Q_OS_SYMBIAN
int code = pthread_cancel(d->thread_id);
if (code) {
qWarning("QThread::start: Thread termination error: %s",
@@ -465,6 +531,21 @@ void QThread::terminate()
} else {
d->terminated = true;
}
+#else
+ if (!d->running)
+ return;
+ if (!d->terminationEnabled) {
+ d->terminatePending = true;
+ return;
+ }
+
+ d->terminated = true;
+ QThreadPrivate::finish(this, false, false);
+ d->data->symbian_thread_handle.Terminate(KErrNone);
+ d->data->symbian_thread_handle.Close();
+#endif
+
+
}
bool QThread::wait(unsigned long time)
@@ -489,11 +570,24 @@ bool QThread::wait(unsigned long time)
void QThread::setTerminationEnabled(bool enabled)
{
- Q_ASSERT_X(currentThread() != 0, "QThread::setTerminationEnabled()",
+ QThread *thr = currentThread();
+ Q_ASSERT_X(thr != 0, "QThread::setTerminationEnabled()",
"Current thread was not started with QThread.");
+#ifndef Q_OS_SYMBIAN
pthread_setcancelstate(enabled ? PTHREAD_CANCEL_ENABLE : PTHREAD_CANCEL_DISABLE, NULL);
if (enabled)
pthread_testcancel();
+#else
+ QThreadPrivate *d = thr->d_func();
+ QMutexLocker locker(&d->mutex);
+ d->terminationEnabled = enabled;
+ if (enabled && d->terminatePending) {
+ d->terminated = true;
+ QThreadPrivate::finish(thr, false);
+ locker.unlock(); // don't leave the mutex locked!
+ pthread_exit(NULL);
+ }
+#endif
}
void QThread::setPriority(Priority priority)
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index 7094e3d..76e551e 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -112,7 +112,14 @@ QThreadData *QThreadData::current()
// This needs to be called prior to new AdoptedThread() to
// avoid recursion.
TlsSetValue(qt_current_thread_data_tls_index, threadData);
- threadData->thread = new QAdoptedThread(threadData);
+ QT_TRY {
+ threadData->thread = new QAdoptedThread(threadData);
+ } QT_CATCH(...) {
+ TlsSetValue(qt_current_thread_data_tls_index, 0);
+ threadData->deref();
+ threadData = 0;
+ QT_RETHROW;
+ }
threadData->deref();
}
diff --git a/src/corelib/thread/qthreadstorage.cpp b/src/corelib/thread/qthreadstorage.cpp
index 35c55c1..4657009 100644
--- a/src/corelib/thread/qthreadstorage.cpp
+++ b/src/corelib/thread/qthreadstorage.cpp
@@ -101,12 +101,14 @@ void **QThreadStorageData::get() const
qWarning("QThreadStorage::get: QThreadStorage can only be used with threads started with QThread");
return 0;
}
- QMap<int, void *>::iterator it = data->tls.find(id);
+ QMap<int, void *>::const_iterator it = data->tls.constFind(id);
DEBUG_MSG("QThreadStorageData: Returning storage %d, data %p, for thread %p",
id,
it != data->tls.end() ? it.value() : 0,
data->thread);
- return it != data->tls.end() && it.value() != 0 ? &it.value() : 0;
+ // const_cast below is a bit evil - but we have to make sure not to detach here
+ // otherwise we'll go bonkers in oom situations
+ return it != data->tls.constEnd() && it.value() != 0 ? const_cast<void **>(&it.value()) : 0;
}
void **QThreadStorageData::set(void *p)
@@ -129,9 +131,9 @@ void **QThreadStorageData::set(void *p)
void *q = it.value();
it.value() = 0;
- mutex()->lock();
+ QMutexLocker locker(mutex());
void (*destructor)(void *) = destructors()->value(id);
- mutex()->unlock();
+ locker.unlock();
destructor(q);
}
@@ -167,9 +169,9 @@ void QThreadStorageData::finish(void **p)
continue;
}
- mutex()->lock();
+ QMutexLocker locker(mutex());
void (*destructor)(void *) = destructors()->value(id);
- mutex()->unlock();
+ locker.unlock();
if (!destructor) {
if (QThread::currentThread())
diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h
index 3bfa6ad..35da4cd 100644
--- a/src/corelib/tools/qalgorithms.h
+++ b/src/corelib/tools/qalgorithms.h
@@ -142,7 +142,7 @@ inline void qCount(const Container &container, const T &value, Size &n)
}
-#if defined Q_CC_MSVC && _MSC_VER < 1300
+#if (defined Q_CC_MSVC && _MSC_VER < 1300) || defined(Q_CC_MWERKS)
template <typename T>
inline void qSwap(T &value1, T &value2)
{
diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp
index 591cfa9..5653842 100644
--- a/src/corelib/tools/qbitarray.cpp
+++ b/src/corelib/tools/qbitarray.cpp
@@ -209,6 +209,8 @@ void QBitArray::resize(int size)
uchar* c = reinterpret_cast<uchar*>(d.data());
if (size > (s << 3))
memset(c + s, 0, d.size() - s);
+ else if ( size % 8)
+ *(c+1+size/8) &= (1 << (size%8)) - 1;
*c = d.size()*8 - size;
}
}
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index cbd9d4e..f73adf8 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -1233,14 +1233,11 @@ QByteArray::QByteArray(const char *str)
} else {
int len = qstrlen(str);
d = static_cast<Data *>(qMalloc(sizeof(Data)+len));
- if (!d) {
- d = &shared_null;
- } else {
- d->ref = 0;;
- d->alloc = d->size = len;
- d->data = d->array;
- memcpy(d->array, str, len+1); // include null terminator
- }
+ Q_CHECK_PTR(d);
+ d->ref = 0;;
+ d->alloc = d->size = len;
+ d->data = d->array;
+ memcpy(d->array, str, len+1); // include null terminator
}
d->ref.ref();
}
@@ -1264,15 +1261,12 @@ QByteArray::QByteArray(const char *data, int size)
d = &shared_empty;
} else {
d = static_cast<Data *>(qMalloc(sizeof(Data) + size));
- if (!d) {
- d = &shared_null;
- } else {
- d->ref = 0;
- d->alloc = d->size = size;
- d->data = d->array;
- memcpy(d->array, data, size);
- d->array[size] = '\0';
- }
+ Q_CHECK_PTR(d);
+ d->ref = 0;
+ d->alloc = d->size = size;
+ d->data = d->array;
+ memcpy(d->array, data, size);
+ d->array[size] = '\0';
}
d->ref.ref();
}
@@ -1290,15 +1284,12 @@ QByteArray::QByteArray(int size, char ch)
d = &shared_null;
} else {
d = static_cast<Data *>(qMalloc(sizeof(Data)+size));
- if (!d) {
- d = &shared_null;
- } else {
- d->ref = 0;
- d->alloc = d->size = size;
- d->data = d->array;
- d->array[size] = '\0';
- memset(d->array, ch, size);
- }
+ Q_CHECK_PTR(d);
+ d->ref = 0;
+ d->alloc = d->size = size;
+ d->data = d->array;
+ d->array[size] = '\0';
+ memset(d->array, ch, size);
}
d->ref.ref();
}
@@ -1334,8 +1325,7 @@ void QByteArray::resize(int size)
// QByteArray a(sz);
//
Data *x = static_cast<Data *>(qMalloc(sizeof(Data)+size));
- if (!x)
- return;
+ Q_CHECK_PTR(x);
x->ref = 1;
x->alloc = x->size = size;
x->data = x->array;
@@ -1377,8 +1367,7 @@ void QByteArray::realloc(int alloc)
{
if (d->ref != 1 || d->data != d->array) {
Data *x = static_cast<Data *>(qMalloc(sizeof(Data) + alloc));
- if (!x)
- return;
+ Q_CHECK_PTR(x);
x->size = qMin(alloc, d->size);
::memcpy(x->array, d->data, x->size);
x->array[x->size] = '\0';
@@ -1390,8 +1379,7 @@ void QByteArray::realloc(int alloc)
d = x;
} else {
Data *x = static_cast<Data *>(qRealloc(d, sizeof(Data) + alloc));
- if (!x)
- return;
+ Q_CHECK_PTR(x);
x->alloc = alloc;
x->data = x->array;
d = x;
@@ -1812,11 +1800,13 @@ QByteArray &QByteArray::replace(const char *before, int bsize, const char *after
const char *b = before;
if (after >= d->data && after < d->data + d->size) {
char *copy = (char *)malloc(asize);
+ Q_CHECK_PTR(copy);
memcpy(copy, after, asize);
a = copy;
}
if (before >= d->data && before < d->data + d->size) {
char *copy = (char *)malloc(bsize);
+ Q_CHECK_PTR(copy);
memcpy(copy, before, bsize);
b = copy;
}
@@ -3739,6 +3729,7 @@ QByteArray QByteArray::number(double n, char f, int prec)
QByteArray QByteArray::fromRawData(const char *data, int size)
{
Data *x = static_cast<Data *>(qMalloc(sizeof(Data)));
+ Q_CHECK_PTR(x);
if (data) {
x->data = const_cast<char *>(data);
} else {
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index f6422fb..55028f2 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -122,6 +122,17 @@ template <typename T> class QList;
class Q_CORE_EXPORT QByteArray
{
+private:
+ struct Data {
+ QBasicAtomicInt ref;
+ int alloc, size;
+ // ### Qt 5.0: We need to add the missing capacity bit
+ // (like other tool classes have), to maintain the
+ // reserved memory on resize.
+ char *data;
+ char array[1];
+ };
+
public:
inline QByteArray();
QByteArray(const char *);
@@ -347,15 +358,6 @@ public:
private:
operator QNoImplicitBoolCast() const;
- struct Data {
- QBasicAtomicInt ref;
- int alloc, size;
- // ### Qt 5.0: We need to add the missing capacity bit
- // (like other tool classes have), to maintain the
- // reserved memory on resize.
- char *data;
- char array[1];
- };
static Data shared_null;
static Data shared_empty;
Data *d;
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index e438179..917679c 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -41,6 +41,10 @@
#include <qcryptographichash.h>
+#ifdef Q_OS_SYMBIAN
+#define _MD5_H_ // Needed to disable system header
+#endif
+
#include "../../3rdparty/md5/md5.h"
#include "../../3rdparty/md5/md5.cpp"
#include "../../3rdparty/md4/md4.h"
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index de41360..356c56e 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -2200,8 +2200,8 @@ int QTime::elapsed() const
\sa isValid()
*/
QDateTime::QDateTime()
+ : d(new QDateTimePrivate)
{
- d = new QDateTimePrivate;
}
@@ -2211,8 +2211,8 @@ QDateTime::QDateTime()
*/
QDateTime::QDateTime(const QDate &date)
+ : d(new QDateTimePrivate)
{
- d = new QDateTimePrivate;
d->date = date;
d->time = QTime(0, 0, 0);
}
@@ -2225,8 +2225,8 @@ QDateTime::QDateTime(const QDate &date)
*/
QDateTime::QDateTime(const QDate &date, const QTime &time, Qt::TimeSpec spec)
+ : d(new QDateTimePrivate)
{
- d = new QDateTimePrivate;
d->date = date;
d->time = date.isValid() && !time.isValid() ? QTime(0, 0, 0) : time;
d->spec = (spec == Qt::UTC) ? QDateTimePrivate::UTC : QDateTimePrivate::LocalUnknown;
@@ -2237,8 +2237,8 @@ QDateTime::QDateTime(const QDate &date, const QTime &time, Qt::TimeSpec spec)
*/
QDateTime::QDateTime(const QDateTime &other)
+ : d(other.d.data())
{
- d = other.d;
d->ref.ref();
}
@@ -2247,8 +2247,6 @@ QDateTime::QDateTime(const QDateTime &other)
*/
QDateTime::~QDateTime()
{
- if (!d->ref.deref())
- delete d;
}
/*!
@@ -2258,7 +2256,7 @@ QDateTime::~QDateTime()
QDateTime &QDateTime::operator=(const QDateTime &other)
{
- qAtomicAssign(d, other.d);
+ d.assign(other.d.data());
return *this;
}
@@ -3298,7 +3296,7 @@ QDateTime QDateTime::fromString(const QString &string, const QString &format)
*/
void QDateTime::detach()
{
- qAtomicDetach(d);
+ d.detach();
}
/*****************************************************************************
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index 3278297..cf4246d 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -44,6 +44,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qnamespace.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -284,7 +285,7 @@ public:
private:
friend class QDateTimePrivate;
void detach();
- QDateTimePrivate *d;
+ QScopedSharedPointer<QDateTimePrivate> d;
#ifndef QT_NO_DATASTREAM
friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDateTime &);
diff --git a/src/corelib/tools/qharfbuzz.cpp b/src/corelib/tools/qharfbuzz.cpp
index 1940209..923eda4 100644
--- a/src/corelib/tools/qharfbuzz.cpp
+++ b/src/corelib/tools/qharfbuzz.cpp
@@ -126,6 +126,7 @@ char *HB_TextCodec_ConvertFromUnicode(void *codec, const HB_UChar16 *unicode, hb
QByteArray data = reinterpret_cast<QTextCodec *>(codec)->fromUnicode((const QChar *)unicode, length);
// ### suboptimal
char *output = (char *)malloc(data.length() + 1);
+ Q_CHECK_PTR(output);
memcpy(output, data.constData(), data.length() + 1);
if (outputLength)
*outputLength = data.length();
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 2313e0e..a703621 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -171,7 +171,9 @@ QHashData QHashData::shared_null = {
void *QHashData::allocateNode()
{
- return qMalloc(nodeSize);
+ void *ptr = qMalloc(nodeSize);
+ Q_CHECK_PTR(ptr);
+ return ptr;
}
void QHashData::freeNode(void *node)
@@ -181,6 +183,13 @@ void QHashData::freeNode(void *node)
QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize)
{
+ return detach_helper( node_duplicate, 0, nodeSize );
+}
+
+QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *),
+ void (*node_delete)(Node *),
+ int nodeSize)
+{
union {
QHashData *d;
Node *e;
@@ -197,18 +206,43 @@ QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), int
d->sharable = true;
if (numBuckets) {
- d->buckets = new Node *[numBuckets];
+ QT_TRY {
+ d->buckets = new Node *[numBuckets];
+ } QT_CATCH(...) {
+ // restore a consistent state for d
+ d->numBuckets = 0;
+ // roll back
+ d->free_helper(node_delete);
+ QT_RETHROW;
+ }
+
Node *this_e = reinterpret_cast<Node *>(this);
for (int i = 0; i < numBuckets; ++i) {
Node **nextNode = &d->buckets[i];
Node *oldNode = buckets[i];
while (oldNode != this_e) {
- Node *dup = static_cast<Node *>(allocateNode());
- node_duplicate(oldNode, dup);
- dup->h = oldNode->h;
- *nextNode = dup;
- nextNode = &dup->next;
- oldNode = oldNode->next;
+ QT_TRY {
+ Node *dup = static_cast<Node *>(allocateNode());
+
+ QT_TRY {
+ node_duplicate(oldNode, dup);
+ } QT_CATCH(...) {
+ freeNode( dup );
+ QT_RETHROW;
+ }
+
+ dup->h = oldNode->h;
+ *nextNode = dup;
+ nextNode = &dup->next;
+ oldNode = oldNode->next;
+ } QT_CATCH(...) {
+ // restore a consistent state for d
+ *nextNode = e;
+ d->numBuckets = i+1;
+ // roll back
+ d->free_helper(node_delete);
+ QT_RETHROW;
+ }
}
*nextNode = e;
}
@@ -216,6 +250,26 @@ QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), int
return d;
}
+void QHashData::free_helper(void (*node_delete)(Node *))
+{
+ if (node_delete) {
+ Node *this_e = reinterpret_cast<Node *>(this);
+ Node **bucket = reinterpret_cast<Node **>(this->buckets);
+
+ int n = numBuckets;
+ while (n--) {
+ Node *cur = *bucket++;
+ while (cur != this_e) {
+ Node *next = cur->next;
+ node_delete(cur);
+ cur = next;
+ }
+ }
+ }
+ delete [] buckets;
+ delete this;
+}
+
QHashData::Node *QHashData::nextNode(Node *node)
{
union {
@@ -298,9 +352,10 @@ void QHashData::rehash(int hint)
Node **oldBuckets = buckets;
int oldNumBuckets = numBuckets;
+ int nb = primeForNumBits(hint);
+ buckets = new Node *[nb];
numBits = hint;
- numBuckets = primeForNumBits(hint);
- buckets = new Node *[numBuckets];
+ numBuckets = nb;
for (int i = 0; i < numBuckets; ++i)
buckets[i] = e;
@@ -327,8 +382,7 @@ void QHashData::rehash(int hint)
void QHashData::destroyAndFree()
{
- delete [] buckets;
- delete this;
+ free_helper(0);
}
#ifdef QT_QHASH_DEBUG
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index 632c422..b3f82e9 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -129,12 +129,15 @@ struct Q_CORE_EXPORT QHashData
void *allocateNode();
void freeNode(void *node);
- QHashData *detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize);
+ QHashData *detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize); // ### Qt5 remove me
+ QHashData *detach_helper(void (*node_duplicate)(Node *, void *), void (*node_delete)(Node *),
+ int nodeSize);
void mightGrow();
bool willGrow();
void hasShrunk();
void rehash(int hint);
- void destroyAndFree();
+ void free_helper(void (*node_delete)(Node *));
+ void destroyAndFree(); // ### Qt5 remove me
Node *firstNode();
#ifdef QT_QHASH_DEBUG
void dump();
@@ -476,21 +479,30 @@ private:
Node **findNode(const Key &key, uint *hp = 0) const;
Node *createNode(uint h, const Key &key, const T &value, Node **nextNode);
void deleteNode(Node *node);
+ static void deleteNode(QHashData::Node *node);
static void duplicateNode(QHashData::Node *originalNode, void *newNode);
};
+
template <class Key, class T>
Q_INLINE_TEMPLATE void QHash<Key, T>::deleteNode(Node *node)
{
+ deleteNode(reinterpret_cast<QHashData::Node*>(node));
+}
+
+
+template <class Key, class T>
+Q_INLINE_TEMPLATE void QHash<Key, T>::deleteNode(QHashData::Node *node)
+{
#ifdef Q_CC_BOR
- node->~QHashNode<Key, T>();
+ concrete(node)->~QHashNode<Key, T>();
#elif defined(QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION)
- node->~QHashNode();
+ concrete(node)->~QHashNode();
#else
- node->~Node();
+ concrete(node)->~Node();
#endif
- d->freeNode(node);
+ qFree(node);
}
template <class Key, class T>
@@ -538,18 +550,7 @@ Q_INLINE_TEMPLATE QHash<Key, T> &QHash<Key, T>::unite(const QHash<Key, T> &other
template <class Key, class T>
Q_OUTOFLINE_TEMPLATE void QHash<Key, T>::freeData(QHashData *x)
{
- Node *e_for_x = reinterpret_cast<Node *>(x);
- Node **bucket = reinterpret_cast<Node **>(x->buckets);
- int n = x->numBuckets;
- while (n--) {
- Node *cur = *bucket++;
- while (cur != e_for_x) {
- Node *next = cur->next;
- deleteNode(cur);
- cur = next;
- }
- }
- x->destroyAndFree();
+ x->free_helper(deleteNode);
}
template <class Key, class T>
@@ -561,7 +562,7 @@ Q_INLINE_TEMPLATE void QHash<Key, T>::clear()
template <class Key, class T>
Q_OUTOFLINE_TEMPLATE void QHash<Key, T>::detach_helper()
{
- QHashData *x = d->detach_helper(duplicateNode,
+ QHashData *x = d->detach_helper(duplicateNode, deleteNode,
QTypeInfo<T>::isDummy ? sizeof(DummyNode) : sizeof(Node));
if (!d->ref.deref())
freeData(d);
@@ -911,7 +912,8 @@ public:
inline QMultiHash operator+(const QMultiHash &other) const
{ QMultiHash result = *this; result += other; return result; }
-#ifndef Q_NO_USING_KEYWORD
+#if !defined(Q_NO_USING_KEYWORD) && !defined(Q_CC_RVCT)
+ // RVCT compiler doesn't handle using-keyword right when used functions are overloaded in child class
using QHash<Key, T>::contains;
using QHash<Key, T>::remove;
using QHash<Key, T>::count;
@@ -981,7 +983,12 @@ Q_INLINE_TEMPLATE int QMultiHash<Key, T>::remove(const Key &key, const T &value)
typename QHash<Key, T>::iterator end(QHash<Key, T>::end());
while (i != end && i.key() == key) {
if (i.value() == value) {
+#if defined(Q_CC_RVCT)
+ // RVCT has problems with scoping, apparently.
+ i = QHash<Key, T>::erase(i);
+#else
i = erase(i);
+#endif
++n;
} else {
++i;
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index 6a85386..79311bc 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -265,15 +265,22 @@ void QLinkedList<T>::detach_helper()
x.d->ref = 1;
x.d->size = d->size;
x.d->sharable = true;
- Node *i = e->n, *j = x.e;
- while (i != e) {
- j->n = new Node(i->t);
- j->n->p = j;
- i = i->n;
- j = j->n;
+ Node *original = e->n;
+ Node *copy = x.e;
+ while (original != e) {
+ QT_TRY {
+ copy->n = new Node(original->t);
+ copy->n->p = copy;
+ original = original->n;
+ copy = copy->n;
+ } QT_CATCH(...) {
+ copy->n = x.e;
+ free(x.d);
+ QT_RETHROW;
+ }
}
- j->n = x.e;
- x.e->p = j;
+ copy->n = x.e;
+ x.e->p = copy;
if (!d->ref.deref())
free(d);
d = x.d;
@@ -474,14 +481,21 @@ QLinkedList<T> &QLinkedList<T>::operator+=(const QLinkedList<T> &l)
detach();
int n = l.d->size;
d->size += n;
- Node *o = l.e->n;
+ Node *original = l.e->n;
while (n--) {
- Node *i = new Node(o->t);
- o = o->n;
- i->n = e;
- i->p = e->p;
- i->p->n = i;
- e->p = i;
+ QT_TRY {
+ Node *copy = new Node(original->t);
+ original = original->n;
+ copy->n = e;
+ copy->p = e->p;
+ copy->p->n = copy;
+ e->p = copy;
+ } QT_CATCH(...) {
+ // restore the original list
+ while (n++<d->size)
+ removeLast();
+ QT_RETHROW;
+ }
}
return *this;
}
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 3c21ec1..7540035 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -117,6 +117,14 @@ public:
inline int size() const { return p.size(); }
inline void detach() { if (d->ref != 1) detach_helper(); }
+
+ inline void detachShared()
+ {
+ // The "this->" qualification is needed for GCCE.
+ if (d->ref != 1 && this->d != &QListData::shared_null)
+ detach_helper();
+ }
+
inline bool isDetached() const { return d->ref == 1; }
inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
@@ -352,12 +360,27 @@ Q_INLINE_TEMPLATE void QList<T>::node_destruct(Node *n)
template <typename T>
Q_INLINE_TEMPLATE void QList<T>::node_copy(Node *from, Node *to, Node *src)
{
- if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic)
- while(from != to)
- (from++)->v = new T(*reinterpret_cast<T*>((src++)->v));
- else if (QTypeInfo<T>::isComplex)
- while(from != to)
- new (from++) T(*reinterpret_cast<T*>(src++));
+ Node *current = from;
+ if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
+ QT_TRY {
+ while(current != to)
+ (current++)->v = new T(*reinterpret_cast<T*>((src++)->v));
+ } QT_CATCH(...) {
+ while (current != from)
+ delete reinterpret_cast<T*>(current--);
+ QT_RETHROW;
+ }
+ }
+ else if (QTypeInfo<T>::isComplex) {
+ QT_TRY {
+ while(current != to)
+ new (current++) T(*reinterpret_cast<T*>(src++));
+ } QT_CATCH(...) {
+ while (current != from)
+ (reinterpret_cast<T*>(current--))->~T();
+ QT_RETHROW;
+ }
+ }
}
template <typename T>
@@ -384,8 +407,16 @@ Q_INLINE_TEMPLATE QList<T> &QList<T>::operator=(const QList<T> &l)
}
template <typename T>
inline typename QList<T>::iterator QList<T>::insert(iterator before, const T &t)
-{ Node *n = reinterpret_cast<Node *>(p.insert(before.i-reinterpret_cast<Node *>(p.begin())));
- node_construct(n,t); return n; }
+{
+ Node *n = reinterpret_cast<Node *>(p.insert(before.i - reinterpret_cast<Node *>(p.begin())));
+ QT_TRY {
+ node_construct(n, t);
+ } QT_CATCH(...) {
+ p.remove(before.i - reinterpret_cast<Node *>(p.begin()));
+ QT_RETHROW;
+ }
+ return n;
+}
template <typename T>
inline typename QList<T>::iterator QList<T>::erase(iterator it)
{ node_destruct(it.i);
@@ -423,10 +454,22 @@ Q_OUTOFLINE_TEMPLATE void QList<T>::append(const T &t)
{
detach();
if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
- node_construct(reinterpret_cast<Node *>(p.append()), t);
+ Node *n = reinterpret_cast<Node *>(p.append());
+ QT_TRY {
+ node_construct(n, t);
+ } QT_CATCH(...) {
+ --d->end;
+ QT_RETHROW;
+ }
} else {
const T cpy(t);
- node_construct(reinterpret_cast<Node *>(p.append()), cpy);
+ Node *n = reinterpret_cast<Node *>(p.append());
+ QT_TRY {
+ node_construct(n, cpy);
+ } QT_CATCH(...) {
+ --d->end;
+ QT_RETHROW;
+ }
}
}
@@ -435,10 +478,22 @@ inline void QList<T>::prepend(const T &t)
{
detach();
if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
- node_construct(reinterpret_cast<Node *>(p.prepend()), t);
+ Node *n = reinterpret_cast<Node *>(p.prepend());
+ QT_TRY {
+ node_construct(n, t);
+ } QT_CATCH(...) {
+ ++d->begin;
+ QT_RETHROW;
+ }
} else {
const T cpy(t);
- node_construct(reinterpret_cast<Node *>(p.prepend()), cpy);
+ Node *n = reinterpret_cast<Node *>(p.prepend());
+ QT_TRY {
+ node_construct(n, cpy);
+ } QT_CATCH(...) {
+ ++d->begin;
+ QT_RETHROW;
+ }
}
}
@@ -447,10 +502,22 @@ inline void QList<T>::insert(int i, const T &t)
{
detach();
if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
- node_construct(reinterpret_cast<Node *>(p.insert(i)), t);
+ Node *n = reinterpret_cast<Node *>(p.insert(i));
+ QT_TRY {
+ node_construct(n, t);
+ } QT_CATCH(...) {
+ p.remove(i);
+ QT_RETHROW;
+ }
} else {
const T cpy(t);
- node_construct(reinterpret_cast<Node *>(p.insert(i)), cpy);
+ Node *n = reinterpret_cast<Node *>(p.insert(i));
+ QT_TRY {
+ node_construct(n, cpy);
+ } QT_CATCH(...) {
+ p.remove(i);
+ QT_RETHROW;
+ }
}
}
@@ -522,7 +589,14 @@ Q_OUTOFLINE_TEMPLATE void QList<T>::detach_helper()
{
Node *n = reinterpret_cast<Node *>(p.begin());
QListData::Data *x = p.detach2();
- node_copy(reinterpret_cast<Node *>(p.begin()), reinterpret_cast<Node *>(p.end()), n);
+ QT_TRY {
+ node_copy(reinterpret_cast<Node *>(p.begin()), reinterpret_cast<Node *>(p.end()), n);
+ } QT_CATCH(...) {
+ qFree(d);
+ d = x;
+ QT_RETHROW;
+ }
+
if (!x->ref.deref())
free(x);
}
@@ -572,7 +646,7 @@ Q_OUTOFLINE_TEMPLATE void QList<T>::clear()
template <typename T>
Q_OUTOFLINE_TEMPLATE int QList<T>::removeAll(const T &_t)
{
- detach();
+ detachShared();
const T t = _t;
int removedCount=0, i=0;
Node *n;
@@ -590,7 +664,7 @@ Q_OUTOFLINE_TEMPLATE int QList<T>::removeAll(const T &_t)
template <typename T>
Q_OUTOFLINE_TEMPLATE bool QList<T>::removeOne(const T &_t)
{
- detach();
+ detachShared();
int index = indexOf(_t);
if (index != -1) {
removeAt(index);
diff --git a/src/corelib/tools/qlistdata.cpp b/src/corelib/tools/qlistdata.cpp
index 34a5d80..efdde64 100644
--- a/src/corelib/tools/qlistdata.cpp
+++ b/src/corelib/tools/qlistdata.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#include <new>
#include "qlist.h"
#include "qtools_p.h"
#include <string.h>
@@ -71,8 +72,7 @@ static int grow(int size)
QListData::Data *QListData::detach()
{
Data *x = static_cast<Data *>(qMalloc(DataHeaderSize + d->alloc * sizeof(void *)));
- if (!x)
- qFatal("QList: Out of memory");
+ Q_CHECK_PTR(x);
::memcpy(x, d, DataHeaderSize + d->alloc * sizeof(void *));
x->alloc = d->alloc;
@@ -91,10 +91,10 @@ QListData::Data *QListData::detach()
QListData::Data *QListData::detach2()
{
Data *x = d;
- d = static_cast<Data *>(qMalloc(DataHeaderSize + x->alloc * sizeof(void *)));
- if (!d)
- qFatal("QList: Out of memory");
+ Data* t = static_cast<Data *>(qMalloc(DataHeaderSize + x->alloc * sizeof(void *)));
+ Q_CHECK_PTR(t);
+ d = t;
::memcpy(d, x, DataHeaderSize + x->alloc * sizeof(void *));
d->alloc = x->alloc;
d->ref = 1;
@@ -109,8 +109,7 @@ void QListData::realloc(int alloc)
{
Q_ASSERT(d->ref == 1);
Data *x = static_cast<Data *>(qRealloc(d, DataHeaderSize + alloc * sizeof(void *)));
- if (!x)
- qFatal("QList: Out of memory");
+ Q_CHECK_PTR(x);
d = x;
d->alloc = alloc;
@@ -514,6 +513,15 @@ void **QListData::erase(void **xi)
\internal
*/
+/*! \fn void QList::detachShared()
+
+ \internal
+
+ like detach(), but does nothing if we're shared_null.
+ This prevents needless mallocs, and makes QList more exception safe
+ in case of cleanup work done in destructors on empty lists.
+*/
+
/*! \fn bool QList::isDetached() const
\internal
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 4898e10..357b5d7 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -122,6 +122,13 @@ Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok);
static qlonglong qstrtoll(const char *nptr, const char **endptr, register int base, bool *ok);
static qulonglong qstrtoull(const char *nptr, const char **endptr, register int base, bool *ok);
+#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
+inline bool isascii(int c)
+{
+ return (c >= 0 && c <=127);
+}
+#endif
+
/******************************************************************************
** Helpers for accessing Qt locale database
*/
@@ -290,7 +297,7 @@ static bool splitLocaleName(const QString &name, QChar *lang_begin, QChar *cntry
return lang_len == 2 || lang_len == 3;
}
-static void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry)
+void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry)
{
lang = QLocale::C;
cntry = QLocale::AnyCountry;
@@ -1270,7 +1277,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
return QVariant();
}
-#elif defined(Q_OS_UNIX)
+#elif defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
static uint unixGetSystemMeasurementSystem()
{
@@ -1314,7 +1321,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant /* in */) const
}
}
-#else
+#elif !defined(Q_OS_SYMBIAN)
/*!
Returns a fallback locale, that will get used for everything that
@@ -5116,6 +5123,7 @@ static Bigint *Balloc(int k)
x = 1 << k;
rv = static_cast<Bigint *>(MALLOC(sizeof(Bigint) + (x-1)*sizeof(Long)));
+ Q_CHECK_PTR(rv);
rv->k = k;
rv->maxwds = x;
rv->sign = rv->wds = 0;
@@ -6789,6 +6797,7 @@ static char *_qdtoa( NEEDS_VOLATILE double d, int mode, int ndigits, int *decpt,
i = 1;
}
*resultp = static_cast<char *>(malloc(i + 1));
+ Q_CHECK_PTR(resultp);
s = s0 = *resultp;
if (ilim >= 0 && ilim <= Quick_max && try_quick) {
@@ -7210,6 +7219,7 @@ Q_CORE_EXPORT char *qdtoa( double d, int mode, int ndigits, int *decpt, int *sig
n = i + 1;
}
*resultp = static_cast<char*>(malloc(n + 1));
+ Q_CHECK_PTR(resultp);
qstrncpy(*resultp, res, n + 1);
return *resultp;
}
diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp
new file mode 100644
index 0000000..976227d
--- /dev/null
+++ b/src/corelib/tools/qlocale_symbian.cpp
@@ -0,0 +1,879 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtCore 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDate>
+#include <QLocale>
+#include <QTime>
+#include <QVariant>
+
+#include <e32std.h>
+#include "private/qcore_symbian_p.h"
+
+
+QT_BEGIN_NAMESPACE
+
+// Located in qlocale.cpp
+extern void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry);
+
+static TExtendedLocale _s60Locale;
+
+// Type definitions for runtime resolved function pointers
+typedef void (*FormatFunc)(TTime&, TDes&, const TDesC&, const TLocale&);
+typedef TPtrC (*FormatSpecFunc)(TExtendedLocale&);
+
+// Runtime resolved functions
+static FormatFunc ptrTimeFormatL = NULL;
+static FormatSpecFunc ptrGetTimeFormatSpec = NULL;
+static FormatSpecFunc ptrGetLongDateFormatSpec = NULL;
+static FormatSpecFunc ptrGetShortDateFormatSpec = NULL;
+
+// Default functions if functions cannot be resolved
+static void defaultTimeFormatL(TTime&, TDes& des, const TDesC&, const TLocale&)
+{
+ des.Zero();
+}
+
+static TPtrC defaultFormatSpec(TExtendedLocale&)
+{
+ return TPtrC(KNullDesC);
+}
+
+/*!
+ Definition of struct for mapping Symbian to ISO locale
+*/
+struct symbianToISO {
+ int symbian_language;
+ char iso_name[8];
+};
+
+
+/*!
+ Mapping from Symbian to ISO locale
+*/
+static const symbianToISO symbian_to_iso_list[] = {
+ { ELangEnglish, "en_GB" },
+ { ELangFrench, "fr_FR" },
+ { ELangGerman, "de_DE" },
+ { ELangSpanish, "es_ES" },
+ { ELangItalian, "it_IT" },
+ { ELangSwedish, "sv_SE" },
+ { ELangDanish, "da_DK" },
+ { ELangNorwegian, "no_NO" },
+ { ELangFinnish, "fi_FI" },
+ { ELangAmerican, "en_US" },
+ { ELangPortuguese, "pt_PT" },
+ { ELangTurkish, "tr_TR" },
+ { ELangIcelandic, "is_IS" },
+ { ELangRussian, "ru_RU" },
+ { ELangHungarian, "hu_HU" },
+ { ELangDutch, "nl_NL" },
+ { ELangBelgianFlemish, "nl_BE" },
+ { ELangCzech, "cs_CZ" },
+ { ELangSlovak, "sk_SK" },
+ { ELangPolish, "pl_PL" },
+ { ELangSlovenian, "sl_SI" },
+ { ELangTaiwanChinese, "zh_TW" },
+ { ELangHongKongChinese, "zh_HK" },
+ { ELangPrcChinese, "zh_CN" },
+ { ELangJapanese, "ja_JP" },
+ { ELangThai, "th_TH" },
+ { ELangArabic, "ar_AE" },
+ { ELangTagalog, "tl_PH" },
+ { ELangBulgarian, "bg_BG" },
+ { ELangCatalan, "ca_ES" },
+ { ELangCroatian, "hr_HR" },
+ { ELangEstonian, "et_EE" },
+ { ELangFarsi, "fa_IR" },
+ { ELangCanadianFrench, "fr_CA" },
+ { ELangGreek, "el_GR" },
+ { ELangHebrew, "he_IL" },
+ { ELangHindi, "hi_IN" },
+ { ELangIndonesian, "id_ID" },
+ { ELangLatvian, "lv_LV" },
+ { ELangLithuanian, "lt_LT" },
+ { ELangMalay, "ms_MY" },
+ { ELangBrazilianPortuguese, "pt_BR" },
+ { ELangRomanian, "ro_RO" },
+ { ELangSerbian, "sr_YU" },
+ { ELangLatinAmericanSpanish, "es" },
+ { ELangUkrainian, "uk_UA" },
+ { ELangUrdu, "ur_PK" }, // India/Pakistan
+ { ELangVietnamese, "vi_VN" },
+#ifdef __E32LANG_H__
+// 5.0
+ { ELangBasque, "eu_ES" },
+ { ELangGalician, "gl_ES" },
+#endif
+#if !defined(__SERIES60_31__)
+ { ELangEnglish_Apac, "en" },
+ { ELangEnglish_Taiwan, "en_TW" },
+ { ELangEnglish_HongKong, "en_HK" },
+ { ELangEnglish_Prc, "en_CN" },
+ { ELangEnglish_Japan, "en_JP"},
+ { ELangEnglish_Thailand, "en_TH" },
+ { ELangMalay_Apac, "ms" }
+#endif
+};
+
+/*!
+ Returns ISO name corresponding to the Symbian locale code \a sys_fmt.
+*/
+static QByteArray symbianLocaleName(int code)
+{
+ //Number of Symbian to ISO locale mappings
+ static const int symbian_to_iso_count
+ = sizeof(symbian_to_iso_list)/sizeof(symbianToISO);
+
+ int cmp = code - symbian_to_iso_list[0].symbian_language;
+ if (cmp < 0)
+ return 0;
+
+ if (cmp == 0)
+ return symbian_to_iso_list[0].iso_name;
+
+ int begin = 0;
+ int end = symbian_to_iso_count;
+
+ while (end - begin > 1) {
+ uint mid = (begin + end)/2;
+
+ const symbianToISO *elt = symbian_to_iso_list + mid;
+ int cmp = code - elt->symbian_language;
+ if (cmp < 0)
+ end = mid;
+ else if (cmp > 0)
+ begin = mid;
+ else
+ return elt->iso_name;
+ }
+
+ return 0;
+}
+
+
+// order is: normal, abbr, nmode, nmode+abbr
+static const char *us_locale_dep[] = {
+ "MM", "dd", "yyyy", "MM", "dd",
+ "M", "d", "yy", "M", "d",
+ "MMMM", "dd", "yyyy", "MMMM", "dd",
+ "MMM", "d", "yy", "MMM", "d" };
+
+static const char *eu_locale_dep[] = {
+ "dd", "MM", "yyyy", "dd", "MM",
+ "d", "M", "yy", "d", "M",
+ "dd", "MMMM", "yyyy", "dd", "MMMM",
+ "d", "MMM", "yy", "d", "MMM" };
+
+static const char *jp_locale_dep[] = {
+ "yyyy", "MM", "dd", "MM", "dd",
+ "yy", "M", "d", "M", "d",
+ "yyyy", "MMMM", "dd", "MMMM", "dd",
+ "yy", "MMM", "d", "MMM", "d" };
+
+/*!
+ Returns a Qt version of the given \a sys_fmt Symbian locale format string.
+*/
+static QString s60ToQtFormat(const QString &sys_fmt)
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ QString result;
+ QString other;
+ QString qtformatchars = QString::fromLatin1("adhmsyzAHM");
+
+ QChar c;
+ int i = 0;
+ bool open_escape = false;
+ bool abbrev_next = false;
+ bool locale_indep_ordering = false;
+ bool minus_mode = false;
+ bool plus_mode = false;
+ bool n_mode = false;
+ TTimeFormat tf = locale->TimeFormat();
+
+ while (i < sys_fmt.size()) {
+
+ c = sys_fmt.at(i);
+
+ // let formatting thru
+ if (c.unicode() == '%') {
+ // if we have gathered string, concat it
+ if (!other.isEmpty()) {
+ result += other;
+ other.clear();
+ }
+ // if we have open escape, end it
+ if (open_escape) {
+ result += QLatin1Char('\'');
+ open_escape = false;
+ }
+
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+
+ // process specials
+ abbrev_next = c.unicode() == '*';
+ plus_mode = c.unicode() == '+';
+ minus_mode = c.unicode() == '-';
+
+ if (abbrev_next || plus_mode || minus_mode) {
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+
+ if (plus_mode || minus_mode) {
+ // break on undefined plus/minus mode
+ if (c.unicode() != 'A' && c.unicode() != 'B')
+ break;
+ }
+ }
+
+ switch (c.unicode()) {
+ case 'F':
+ {
+ // locale indep mode on
+ locale_indep_ordering = true;
+ break;
+ }
+
+ case '/':
+ {
+ // date sep 0-3
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+ if (c.isDigit() && c.digitValue() <= 3) {
+ TChar s = locale->DateSeparator(c.digitValue());
+ TUint val = s;
+ // some indexes return zero for empty
+ if (val > 0)
+ result += QChar(val);
+ }
+ break;
+ }
+
+ case 'D':
+ {
+ if (!locale_indep_ordering)
+ break;
+
+ if (!abbrev_next)
+ result += QLatin1String("dd");
+ else
+ result += QLatin1Char('d');
+
+ break;
+ }
+
+ case 'M':
+ {
+ if (!locale_indep_ordering)
+ break;
+
+ if (!n_mode) {
+ if (!abbrev_next)
+ result += QLatin1String("MM");
+ else
+ result += QLatin1String("M");
+ } else {
+ if (!abbrev_next)
+ result += QLatin1String("MMMM");
+ else
+ result += QLatin1String("MMM");
+ }
+
+ break;
+ }
+
+ case 'N':
+ {
+ n_mode = true;
+
+ if (!locale_indep_ordering)
+ break;
+
+ if (!abbrev_next)
+ result += QLatin1String("MMMM");
+ else
+ result += QLatin1String("MMM");
+
+ break;
+ }
+
+ case 'Y':
+ {
+ if (!locale_indep_ordering)
+ break;
+
+ if (!abbrev_next)
+ result += QLatin1String("yyyy");
+ else
+ result += QLatin1String("yy");
+
+ break;
+ }
+
+ case 'E':
+ {
+ if (!abbrev_next)
+ result += QLatin1String("dddd");
+ else
+ result += QLatin1String("ddd");
+
+ break;
+ }
+
+ case ':':
+ {
+ // timesep 0-3
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+ if (c.isDigit() && c.digitValue() <= 3) {
+ TChar s = locale->TimeSeparator(c.digitValue());
+ TUint val = s;
+ // some indexes return zero for empty
+ if (val > 0)
+ result += QChar(val);
+ }
+
+ break;
+ }
+
+ case 'J':
+ {
+ if (tf == ETime24 && !abbrev_next)
+ result += QLatin1String("hh");
+ else
+ result += QLatin1Char('h');
+
+ break;
+ }
+
+ case 'H':
+ {
+ if (!abbrev_next)
+ result += QLatin1String("hh");
+ else
+ result += QLatin1Char('h');
+
+ break;
+ }
+
+ case 'I':
+ {
+ result += QLatin1Char('h');
+ break;
+ }
+
+ case 'T':
+ {
+ if (!abbrev_next)
+ result += QLatin1String("mm");
+ else
+ result += QLatin1Char('m');
+
+ break;
+ }
+
+ case 'S':
+ {
+ if (!abbrev_next)
+ result += QLatin1String("ss");
+ else
+ result += QLatin1Char('s');
+
+ break;
+ }
+
+ case 'B':
+ {
+ // only done for 12h clock
+ if (tf == ETime24)
+ break;
+ }
+
+ // fallthru to A
+ case 'A': {
+ // quickie to get capitalization, can't use s60 string as is because Qt 'hh' format's am/pm logic
+ TAmPmName ampm = TAmPmName();
+ TChar first(ampm[0]);
+ QString qtampm = QString::fromLatin1(first.IsUpper() ? "AP" : "ap");
+
+ int pos = locale->AmPmSymbolPosition();
+
+ if ((minus_mode && pos != ELocaleBefore) ||
+ (plus_mode && pos != ELocaleAfter))
+ break;
+
+ if (!abbrev_next && locale->AmPmSpaceBetween()) {
+ if (pos == ELocaleBefore)
+ qtampm.append(QLatin1Char(' '));
+ else
+ qtampm.prepend(QLatin1Char(' '));
+ }
+
+ result += qtampm;
+ }
+ break;
+
+ case '.': {
+ // decimal sep
+ TChar s = locale->DecimalSeparator();
+ TUint val = s;
+ if (val > 0)
+ result += QChar(val);
+ }
+ break;
+
+ case 'C':
+ {
+ // six digits in s60, three digits in qt
+ if (!abbrev_next) {
+ result += QLatin1String("zzz");
+ } else {
+ // next char is number from 0-6, how many digits to display
+ ++i;
+ if (i >= sys_fmt.size())
+ break;
+
+ c = sys_fmt.at(i);
+
+ if (c.isDigit()) {
+ // try to match wanted digits
+ QChar val(c.digitValue());
+
+ if (val >= 3) {
+ result += QLatin1String("zzz");
+ } else if (val > 0) {
+ result += QLatin1Char('z');
+ }
+ }
+ }
+ break;
+ }
+
+ // these cases fallthru
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ {
+
+ // shouldn't parse these with %F
+ if (locale_indep_ordering)
+ break;
+
+ TDateFormat df = locale->DateFormat();
+
+ const char **locale_dep;
+ switch (df) {
+ default: // fallthru to american
+ case EDateAmerican:
+ locale_dep = us_locale_dep;
+ break;
+ case EDateEuropean:
+ locale_dep = eu_locale_dep;
+ break;
+ case EDateJapanese:
+ locale_dep = jp_locale_dep;
+ break;
+ }
+ int offset = 0;
+ if (abbrev_next)
+ offset += 5;
+ if (n_mode)
+ offset += 10;
+
+ result += QLatin1String(locale_dep[offset + (c.digitValue()-1)]);
+ break;
+ }
+
+ case '%': // fallthru percent
+ {
+ // any junk gets copied as is
+ }
+ default:
+ {
+ result += c;
+ break;
+ }
+
+ case 'Z': // Qt doesn't support these :(
+ case 'X':
+ case 'W':
+ {
+ break;
+ }
+ }
+ } else {
+ // double any single quotes, don't begin escape
+ if (c.unicode() == '\'') {
+ // end open escape
+ if (open_escape) {
+ result += other;
+ other.clear();
+ result += QLatin1Char('\'');
+ open_escape = false;
+ }
+
+ other += c;
+ }
+
+ // gather chars and escape them in one go if any format chars are found
+ if (!open_escape && qtformatchars.indexOf(c) != -1) {
+ result += QLatin1Char('\'');
+ open_escape = true;
+ }
+ other += c;
+ }
+
+ ++i;
+ }
+
+ if (!other.isEmpty())
+ result += other;
+ if (open_escape)
+ result += QLatin1Char('\'');
+
+ return result;
+}
+
+/*!
+ Retrieves Symbian locale decimal separator.
+*/
+static QString symbianDecimalPoint()
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ TChar decPoint = locale->DecimalSeparator();
+ int val = decPoint;
+ return QChar(val);
+}
+
+/*!
+ Retrieves Symbian locale group separator.
+*/
+static QString symbianGroupSeparator()
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ TChar grpSep = locale->ThousandsSeparator();
+ int val = grpSep;
+ return QChar(val);
+}
+
+/*!
+ Retrieves Symbian locale zero digit.
+*/
+static QString symbianZeroDigit()
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ // TDigitType enumeration value returned by TLocale
+ // will always correspond to zero digit unicode value.
+ TDigitType digit = locale->DigitType();
+ return QChar(digit);
+}
+
+/*!
+ Retrieves a day name from Symbian locale. The \a day is an integer
+ from 1 to 7. When \a short_format is true the method returns
+ the day in short format. Otherwise it returns the day in a long format.
+*/
+static QString symbianDayName(int day, bool short_format)
+{
+ day -= 1;
+
+ if (day < 0 || day > 6)
+ return QString();
+
+ if (short_format) {
+ return qt_TDes2QStringL(TDayNameAbb(TDay(day)));
+ } else {
+ return qt_TDes2QStringL(TDayName(TDay(day)));
+ }
+}
+
+/*!
+ Retrieves a month name from Symbian locale. The \a month is an integer
+ from 1 to 12. When \a short_format is true the method returns
+ the month in short format. Otherwise it returns the month in a long format.
+*/
+static QString symbianMonthName(int month, bool short_format)
+{
+ month -= 1;
+ if (month < 0 || month > 11)
+ return QString();
+
+ if (short_format) {
+ return qt_TDes2QStringL(TMonthNameAbb(TMonth(month)));
+ } else {
+ return qt_TDes2QStringL(TMonthName(TMonth(month)));
+ }
+}
+
+/*!
+ Retrieves date format from Symbian locale and
+ transforms it to Qt format.
+
+ When \a short_format is true the method returns
+ short date format. Otherwise it returns the long format.
+*/
+static QString symbianDateFormat(bool short_format)
+{
+ TPtrC dateFormat;
+
+ if (short_format) {
+ dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale));
+ } else {
+ dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale));
+ }
+
+ return s60ToQtFormat(qt_TDesC2QStringL(dateFormat));
+}
+
+/*!
+ Retrieves time format from Symbian locale and
+ transforms it to Qt format.
+*/
+static QString symbianTimeFormat()
+{
+ return s60ToQtFormat(qt_TDesC2QStringL(ptrGetTimeFormatSpec(_s60Locale)));
+}
+
+/*!
+ Returns localized string representation of given \a date
+ formatted with Symbian locale date format.
+
+ If \a short_format is true the format will be a short version.
+ Otherwise it uses a longer version.
+*/
+static QString symbianDateToString(const QDate &date, bool short_format)
+{
+ int month = date.month() - 1;
+ int day = date.day() - 1;
+ int year = date.year();
+
+ TDateTime dateTime;
+ dateTime.Set(year, TMonth(month), day, 0, 0, 0, 0);
+
+ TTime timeStr(dateTime);
+ TBuf<KMaxLongDateFormatSpec*2> buffer;
+
+ TPtrC dateFormat;
+ if (short_format) {
+ dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale));
+ } else {
+ dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale));
+ }
+
+ TRAPD(err, ptrTimeFormatL(timeStr, buffer, dateFormat, *_s60Locale.GetLocale());)
+
+ if (err == KErrNone)
+ return qt_TDes2QStringL(buffer);
+ else
+ return QString();
+}
+
+/*!
+ Returns localized string representation of given \a time
+ formatted with Symbian locale time format.
+*/
+static QString symbianTimeToString(const QTime &time)
+{
+ int hour = time.hour();
+ int minute = time.minute();
+ int second = time.second();
+ int milliseconds = 0;
+
+ TDateTime dateTime;
+ dateTime.Set(0, TMonth(0), 0, hour, minute, second, milliseconds);
+
+ TTime timeStr(dateTime);
+ TBuf<KMaxTimeFormatSpec*2> buffer;
+
+ TRAPD(err, ptrTimeFormatL(
+ timeStr,
+ buffer,
+ ptrGetTimeFormatSpec(_s60Locale),
+ *_s60Locale.GetLocale());
+ )
+
+ if (err == KErrNone)
+ return qt_TDes2QStringL(buffer);
+ else
+ return QString();
+}
+
+/*!
+ Returns the measurement system stored in Symbian locale
+
+ \sa QLocale::MeasurementSystem
+*/
+static QLocale::MeasurementSystem symbianMeasurementSystem()
+{
+ TLocale *locale = _s60Locale.GetLocale();
+
+ TUnitsFormat unitFormat = locale->UnitsGeneral();
+ if (unitFormat == EUnitsImperial)
+ return QLocale::ImperialSystem;
+ else
+ return QLocale::MetricSystem;
+}
+
+QLocale QSystemLocale::fallbackLocale() const
+{
+ // load system data before query calls
+ static bool initDone = false;
+ if (!initDone) {
+ _s60Locale.LoadSystemSettings();
+
+ // Initialize platform version dependent function pointers
+ ptrTimeFormatL = reinterpret_cast<FormatFunc>
+ (qt_resolveS60PluginFunc(S60Plugin_TimeFormatL));
+ ptrGetTimeFormatSpec = reinterpret_cast<FormatSpecFunc>
+ (qt_resolveS60PluginFunc(S60Plugin_GetTimeFormatSpec));
+ ptrGetLongDateFormatSpec = reinterpret_cast<FormatSpecFunc>
+ (qt_resolveS60PluginFunc(S60Plugin_GetLongDateFormatSpec));
+ ptrGetShortDateFormatSpec = reinterpret_cast<FormatSpecFunc>
+ (qt_resolveS60PluginFunc(S60Plugin_GetShortDateFormatSpec));
+ if (!ptrTimeFormatL)
+ ptrTimeFormatL = &defaultTimeFormatL;
+ if (!ptrGetTimeFormatSpec)
+ ptrGetTimeFormatSpec = &defaultFormatSpec;
+ if (!ptrGetLongDateFormatSpec)
+ ptrGetLongDateFormatSpec = &defaultFormatSpec;
+ if (!ptrGetShortDateFormatSpec)
+ ptrGetShortDateFormatSpec = &defaultFormatSpec;
+ }
+
+ TLanguage lang = User::Language();
+ QString locale = symbianLocaleName(lang);
+ return QLocale(locale);
+}
+
+/*!
+ Generic query method for locale data. Provides indirection.
+ Denotes the \a type of the query
+ with \a in as input data depending on the query.
+
+ \sa QSystemLocale::QueryType
+*/
+QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
+{
+ switch(type) {
+ case DecimalPoint:
+ return symbianDecimalPoint();
+ case GroupSeparator:
+ return symbianGroupSeparator();
+
+ case ZeroDigit:
+ return symbianZeroDigit();
+
+ case DayNameLong:
+ case DayNameShort:
+ return symbianDayName(in.toInt(), (type == DayNameShort) );
+
+ case MonthNameLong:
+ case MonthNameShort:
+ return symbianMonthName(in.toInt(), (type == MonthNameShort) );
+
+ case DateFormatLong:
+ case DateFormatShort:
+ return symbianDateFormat( (type == DateFormatShort) );
+ case TimeFormatLong:
+ case TimeFormatShort:
+ return symbianTimeFormat();
+ case DateTimeFormatLong:
+ case DateTimeFormatShort:
+ return symbianDateFormat( (type == DateTimeFormatShort) ) + QLatin1Char(' ') + symbianTimeFormat();
+ case DateToStringShort:
+ case DateToStringLong:
+ return symbianDateToString(in.toDate(), (type == DateToStringShort) );
+ case TimeToStringShort:
+ case TimeToStringLong:
+ return symbianTimeToString(in.toTime());
+ case DateTimeToStringShort:
+ case DateTimeToStringLong: {
+ const QDateTime dt = in.toDateTime();
+ return symbianDateToString(dt.date(), (type == DateTimeToStringShort) )
+ + QLatin1Char(' ') + symbianTimeToString(dt.time());
+ }
+ case MeasurementSystem:
+ return static_cast<int>(symbianMeasurementSystem());
+ case LanguageId:
+ case CountryId: {
+ TLanguage language = User::Language();
+ QString locale = symbianLocaleName(language);
+ QLocale::Language lang;
+ QLocale::Country cntry;
+ getLangAndCountry(locale, lang, cntry);
+ if (type == LanguageId)
+ return lang;
+ // few iso codes have no country and will use this
+ if (cntry == QLocale::AnyCountry)
+ return fallbackLocale().country();
+
+ return cntry;
+ }
+ case NegativeSign:
+ case PositiveSign:
+ case AMText:
+ case PMText:
+ break;
+ default:
+ break;
+ }
+ return QVariant();
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index 07df28d..ceaf370 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -59,6 +59,7 @@ QMapData QMapData::shared_null = {
QMapData *QMapData::createData()
{
QMapData *d = new QMapData;
+ Q_CHECK_PTR(d);
Node *e = reinterpret_cast<Node *>(d);
e->backward = e;
e->forward[0] = e;
@@ -84,6 +85,15 @@ void QMapData::continueFreeData(int offset)
delete this;
}
+/*!
+ Creates a new node inside the data structure.
+
+ \a update is an array with pointers to the node after which the new node
+ should be inserted. Because of the strange skip list data structure there
+ could be several pointers to this node on different levels.
+ \a offset is an amount of bytes that needs to reserved just before the
+ QMapData::Node structure.
+*/
QMapData::Node *QMapData::node_create(Node *update[], int offset)
{
int level = 0;
@@ -94,10 +104,6 @@ QMapData::Node *QMapData::node_create(Node *update[], int offset)
mask <<= Sparseness;
}
- ++randomBits;
- if (level == 3 && !insertInOrder)
- randomBits = qrand();
-
if (level > topLevel) {
Node *e = reinterpret_cast<Node *>(this);
level = ++topLevel;
@@ -105,7 +111,13 @@ QMapData::Node *QMapData::node_create(Node *update[], int offset)
update[level] = e;
}
+ ++randomBits;
+ if (level == 3 && !insertInOrder)
+ randomBits = qrand();
+
void *concreteNode = qMalloc(offset + sizeof(Node) + level * sizeof(Node *));
+ Q_CHECK_PTR(concreteNode);
+
Node *abstractNode = reinterpret_cast<Node *>(reinterpret_cast<char *>(concreteNode) + offset);
abstractNode->backward = update[0];
@@ -116,6 +128,7 @@ QMapData::Node *QMapData::node_create(Node *update[], int offset)
update[i]->forward[i] = abstractNode;
update[i] = abstractNode;
}
+ // update[level+1]=reinterpret_cast<Node *>(this);
++size;
return abstractNode;
}
@@ -146,7 +159,7 @@ uint QMapData::adjust_ptr(Node *node)
void QMapData::dump()
{
- qDebug("Map data (ref = %d, size = %d, randomBits = %#.8x)", ref.atomic, size, randomBits);
+ qDebug("Map data (ref = %d, size = %d, randomBits = %#.8x)", int(ref), size, randomBits);
QString preOutput;
QVector<QString> output(topLevel + 1);
@@ -158,12 +171,12 @@ void QMapData::dump()
Node *update[LastLevel + 1];
for (int i = 0; i <= topLevel; ++i) {
- str.sprintf("%d: [%.8x] -", i, adjust_ptr(forward[i]));
+ str.sprintf("%d: [%.8x] -", i, adjust_ptr(reinterpret_cast<Node *>(forward[i])));
output[i] += str;
- update[i] = forward[i];
+ update[i] = reinterpret_cast<Node *>(forward[i]);
}
- Node *node = forward[0];
+ Node *node = reinterpret_cast<Node *>(forward[0]);
while (node != e) {
int level = 0;
while (level < topLevel && update[level + 1] == node)
@@ -178,13 +191,13 @@ void QMapData::dump()
update[i] = node->forward[i];
}
for (int j = level + 1; j <= topLevel; ++j)
- output[j] += "---------------";
+ output[j] += QString("---------------");
node = node->forward[0];
}
- qDebug(preOutput.ascii());
+ qDebug("%s", preOutput.ascii());
for (int i = 0; i <= topLevel; ++i)
- qDebug(output[i].ascii());
+ qDebug("%s", output[i].ascii());
}
#endif
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 32c8d17..65247cd 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -416,9 +416,29 @@ Q_INLINE_TEMPLATE typename QMapData::Node *
QMap<Key, T>::node_create(QMapData *adt, QMapData::Node *aupdate[], const Key &akey, const T &avalue)
{
QMapData::Node *abstractNode = adt->node_create(aupdate, payload());
- Node *concreteNode = concrete(abstractNode);
- new (&concreteNode->key) Key(akey);
- new (&concreteNode->value) T(avalue);
+ QT_TRY {
+ Node *concreteNode = concrete(abstractNode);
+ new (&concreteNode->key) Key(akey);
+ QT_TRY {
+ new (&concreteNode->value) T(avalue);
+ } QT_CATCH(...) {
+ concreteNode->key.~Key();
+ QT_RETHROW;
+ }
+ } QT_CATCH(...) {
+ adt->node_delete(aupdate, payload(), abstractNode);
+ QT_RETHROW;
+ }
+
+ // clean up the update array for further insertions
+ /*
+ for (int i = 0; i <= d->topLevel; ++i) {
+ if ( aupdate[i]==reinterpret_cast<QMapData::Node *>(adt) || aupdate[i]->forward[i] != abstractNode)
+ break;
+ aupdate[i] = abstractNode;
+ }
+*/
+
return abstractNode;
}
@@ -704,8 +724,13 @@ Q_OUTOFLINE_TEMPLATE void QMap<Key, T>::detach_helper()
QMapData::Node *cur = e->forward[0];
update[0] = x.e;
while (cur != e) {
- Node *concreteNode = concrete(cur);
- node_create(x.d, update, concreteNode->key, concreteNode->value);
+ QT_TRY {
+ Node *concreteNode = concrete(cur);
+ node_create(x.d, update, concreteNode->key, concreteNode->value);
+ } QT_CATCH(...) {
+ freeData(x.d);
+ QT_RETHROW;
+ }
cur = cur->forward[0];
}
x.d->insertInOrder = false;
@@ -923,7 +948,8 @@ public:
inline QMultiMap operator+(const QMultiMap &other) const
{ QMultiMap result = *this; result += other; return result; }
-#ifndef Q_NO_USING_KEYWORD
+#if !defined(Q_NO_USING_KEYWORD) && !defined(Q_CC_RVCT)
+ // RVCT compiler doesn't handle using-keyword right when used functions are overloaded in child class
using QMap<Key, T>::contains;
using QMap<Key, T>::remove;
using QMap<Key, T>::count;
@@ -993,7 +1019,12 @@ Q_INLINE_TEMPLATE int QMultiMap<Key, T>::remove(const Key &key, const T &value)
typename QMap<Key, T>::iterator end(QMap<Key, T>::end());
while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
if (i.value() == value) {
+#if defined(Q_CC_RVCT)
+ // RVCT has problems with scoping, apparently.
+ i = QMap<Key, T>::erase(i);
+#else
i = erase(i);
+#endif
++n;
} else {
++i;
diff --git a/src/corelib/tools/qpodlist_p.h b/src/corelib/tools/qpodlist_p.h
index 9708f8d..9e6d19b 100644
--- a/src/corelib/tools/qpodlist_p.h
+++ b/src/corelib/tools/qpodlist_p.h
@@ -53,9 +53,7 @@
// We mean it.
//
-#include <QtCore/qcontainerfwd.h>
-#include <QtCore/qglobal.h>
-#include <new>
+#include <QtCore/qvarlengtharray.h>
QT_BEGIN_HEADER
@@ -63,87 +61,29 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Core)
-template<class T, int Prealloc>
-class QPodList
+template <typename T, int Prealloc>
+class QPodList : public QVarLengthArray<T, Prealloc>
{
+ using QVarLengthArray<T, Prealloc>::s;
+ using QVarLengthArray<T, Prealloc>::a;
+ using QVarLengthArray<T, Prealloc>::ptr;
+ using QVarLengthArray<T, Prealloc>::realloc;
public:
- inline explicit QPodList(int size = 0);
+ inline explicit QPodList(int size = 0)
+ : QVarLengthArray<T, Prealloc>(size)
+ {}
- inline QPodList(const QPodList<T, Prealloc> &other)
- : a(Prealloc), s(0), ptr(reinterpret_cast<T *>(array))
+ inline void insert(int idx, const T &t)
{
- append(other.constData(), other.size());
- }
-
- inline ~QPodList() {
- if (ptr != reinterpret_cast<T *>(array))
- qFree(ptr);
- }
- inline QPodList<T, Prealloc> &operator=(const QPodList<T, Prealloc> &other)
- {
- if (this != &other) {
- clear();
- append(other.constData(), other.size());
- }
- return *this;
- }
-
- inline int size() const { return s; }
- inline int count() const { return s; }
- inline bool isEmpty() const { return (s == 0); }
- inline void resize(int size);
- inline void clear() { resize(0); }
-
- inline int capacity() const { return a; }
- inline void reserve(int size);
-
- inline T &operator[](int idx) {
- Q_ASSERT(idx >= 0 && idx < s);
- return ptr[idx];
- }
- inline const T &operator[](int idx) const {
- Q_ASSERT(idx >= 0 && idx < s);
- return ptr[idx];
- }
-
- inline const T &at(int idx) const {
- Q_ASSERT(idx >= 0 && idx < s);
- return ptr[idx];
- }
-
- inline const T &first() const {
- return at(0);
- }
-
- inline T& append() {
- const int idx = s++;
- if (s == a)
- realloc(s, s<<1);
- return ptr[idx];
- }
- inline void append(const T &t) {
- append() = t;
- }
-
- inline T& insert(int idx) {
- Q_ASSERT(idx >= 0 && idx <= s);
const int sz = s++;
if (s == a)
- realloc(s, s<<1);
+ realloc(s, s << 1);
::memmove(ptr + idx + 1, ptr + idx, (sz - idx) * sizeof(T));
- return ptr[idx];
- }
- inline void insert(int idx, const T &t) {
- insert(idx) = t;
+ ptr[idx] = t;
}
- inline void removeAt(int idx) {
- Q_ASSERT(idx >= 0 && idx < s);
- ::memmove(ptr + idx, ptr + idx + 1, (s - idx - 1) * sizeof(T));
- --s;
- }
-
- inline void removeAll(const T &t) {
+ inline void removeAll(const T &t)
+ {
int i = 0;
for (int j = 0; j < s; ++j) {
if (ptr[j] != t)
@@ -152,110 +92,22 @@ public:
s = i;
}
- inline int indexOf(const T &t, int from = 0) const {
- if (from < 0)
- from = qMax(from + s, 0);
- if (from < s) {
- const T *n = ptr + from - 1;
- const T *e = ptr + s;
- while (++n != e)
- if (*n == t)
- return n - ptr;
- }
- return -1;
- }
-
- inline bool contains(const T &t) const {
- return indexOf(t) >= 0;
+ inline void removeAt(int idx)
+ {
+ Q_ASSERT(idx >= 0 && idx < s);
+ ::memmove(ptr + idx, ptr + idx + 1, (s - idx - 1) * sizeof(T));
+ --s;
}
- inline T takeFirst() {
+ inline T takeFirst()
+ {
Q_ASSERT(s > 0);
T tmp = ptr[0];
removeAt(0);
return tmp;
}
-
- inline T *data() { return ptr; }
- inline const T *data() const { return ptr; }
- inline const T * constData() const { return ptr; }
-
-private:
- void append(const T *buf, int size);
- void realloc(int size, int alloc);
-
- int a;
- int s;
- T *ptr;
- union {
- // ### Qt 5: Use 'Prealloc * sizeof(T)' as array size
- char array[sizeof(qint64) * (((Prealloc * sizeof(T)) / sizeof(qint64)) + 1)];
- qint64 q_for_alignment_1;
- double q_for_alignment_2;
- };
};
-template <class T, int Prealloc>
-Q_INLINE_TEMPLATE QPodList<T, Prealloc>::QPodList(int asize)
- : s(asize) {
- if (s > Prealloc) {
- ptr = reinterpret_cast<T *>(qMalloc(s * sizeof(T)));
- a = s;
- } else {
- ptr = reinterpret_cast<T *>(array);
- a = Prealloc;
- }
-}
-
-template <class T, int Prealloc>
-Q_INLINE_TEMPLATE void QPodList<T, Prealloc>::resize(int asize)
-{ realloc(asize, qMax(asize, a)); }
-
-template <class T, int Prealloc>
-Q_INLINE_TEMPLATE void QPodList<T, Prealloc>::reserve(int asize)
-{ if (asize > a) realloc(s, asize); }
-
-template <class T, int Prealloc>
-Q_OUTOFLINE_TEMPLATE void QPodList<T, Prealloc>::append(const T *abuf, int asize)
-{
- Q_ASSERT(abuf);
- if (asize <= 0)
- return;
-
- const int idx = s;
- const int news = s + asize;
- if (news >= a)
- realloc(news, news<<1);
- else
- s = news;
-
- qMemCopy(&ptr[idx], abuf, asize * sizeof(T));
-}
-
-template <class T, int Prealloc>
-Q_OUTOFLINE_TEMPLATE void QPodList<T, Prealloc>::realloc(int asize, int aalloc)
-{
- Q_ASSERT(aalloc >= asize);
- T *oldPtr = ptr;
- int osize = s;
- s = asize;
-
- if (aalloc != a) {
- ptr = reinterpret_cast<T *>(qMalloc(aalloc * sizeof(T)));
- if (ptr) {
- a = aalloc;
- qMemCopy(ptr, oldPtr, osize * sizeof(T));
- } else {
- ptr = oldPtr;
- s = 0;
- asize = 0;
- }
- }
-
- if (oldPtr != reinterpret_cast<T *>(array) && oldPtr != ptr)
- qFree(oldPtr);
-}
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index 9c62c7a..92ac3ba 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -1297,14 +1297,20 @@ void QRegExpMatchState::prepareForMatch(QRegExpEngine *eng)
int ns = eng->s.size(); // number of states
int ncap = eng->ncap;
#ifndef QT_NO_REGEXP_OPTIM
- slideTabSize = qMax(eng->minl + 1, 16);
+ int newSlideTabSize = qMax(eng->minl + 1, 16);
#else
- slideTabSize = 0;
+ int newSlideTabSize = 0;
#endif
int numCaptures = eng->numCaptures();
- capturedSize = 2 + 2 * numCaptures;
- bigArray = (int *)realloc(bigArray, ((3 + 4 * ncap) * ns + 4 * ncap + slideTabSize + capturedSize)*sizeof(int));
+ int newCapturedSize = 2 + 2 * numCaptures;
+ bigArray = (int *)realloc(bigArray, ((3 + 4 * ncap) * ns + 4 * ncap + newSlideTabSize + newCapturedSize)*sizeof(int));
+ Q_CHECK_PTR(bigArray);
+ // set all internal variables only _after_ bigArray is realloc'ed
+ // to prevent a broken regexp in oom case
+
+ slideTabSize = newSlideTabSize;
+ capturedSize = newCapturedSize;
inNextStack = bigArray;
memset(inNextStack, -1, ns * sizeof(int));
curStack = inNextStack + ns;
@@ -3281,10 +3287,15 @@ static void derefEngine(QRegExpEngine *eng, const QRegExpEngineKey &key)
#if !defined(QT_NO_REGEXP_OPTIM)
if (globalEngineCache()) {
QMutexLocker locker(mutex());
- globalEngineCache()->insert(key, eng, 4 + key.pattern.length() / 4);
- }
- else
+ QT_TRY {
+ globalEngineCache()->insert(key, eng, 4 + key.pattern.length() / 4);
+ } QT_CATCH(const std::bad_alloc &) {
+ // in case of an exception (e.g. oom), just delete the engine
+ delete eng;
+ }
+ } else {
delete eng;
+ }
#else
Q_UNUSED(key);
delete eng;
diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h
index 02cc497..939f4e0 100644
--- a/src/corelib/tools/qringbuffer_p.h
+++ b/src/corelib/tools/qringbuffer_p.h
@@ -248,6 +248,9 @@ public:
QByteArray tmp = buffers[0];
buffers.clear();
buffers << tmp;
+ //TODO merge this optimization ?
+ //buffers.erase(buffers.begin() + 1, buffers.end());
+ //>>>>>>> 08ae7ee1fb930e7d4b4039e2294cba69f9380964:src/corelib/tools/qringbuffer_p.h
if (buffers.at(0).size() != basicBlockSize)
buffers[0].resize(basicBlockSize);
}
diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp
new file mode 100644
index 0000000..912edb6
--- /dev/null
+++ b/src/corelib/tools/qscopedpointer.cpp
@@ -0,0 +1,192 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtCore 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \class QScopedPointer
+ \brief The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon destruction.
+ \since 4.6
+ \reentrant
+ \ingroup misc
+
+ Managing heap allocated objects manually is hard and error prone, with the
+ common result that code leaks memory and is hard to maintain.
+ QScopedPointer is a small utility class that heavily simplifies this by
+ assigning stack-based memory ownership to heap allocations, more generally
+ called resource acquisition is initialization(RAII).
+
+ QScopedPointer guarantees that the object pointed to will get deleted when
+ the current scope dissapears, and it also has no way of releasing
+ ownership, hence clearly communicating the lifetime and ownership of the
+ object. These guarantees are convenient when reading the code.
+
+ Consider this function which does heap allocations, and have various exit points:
+
+ \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 0
+
+ It's encumbered by the manual delete calls. With QScopedPointer, the code
+ can be simplified to:
+
+ \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 1
+
+ The code the compiler generates for QScopedPointer is the same as when
+ writing it manually. Code that makes use of \a delete are candidates for
+ QScopedPointer usage(and if not, possibly another type of smart pointer
+ such as QSharedPointer). QScopedPointer intentionally has no copy
+ constructor or assignment operator, such that ownership and lifetime is
+ clearly communicated.
+
+ The const qualification on a regular C++ pointer can also be expressed with
+ a QScopedPointer:
+
+ \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 2
+
+ \note QScopedPointer does not work with arrays.
+
+ \section1 Forward Declared Pointers
+
+ Classes that are forward declared can be used within QScopedPointer, as
+ long as the destructor of the forward declared class is available whenever
+ a QScopedPointer needs to clean up.
+
+ Concretely, this means that all classes containing a QScopedPointer that
+ points to a forward declared class must have non-inline constructors,
+ destructors and assignment operators:
+
+ \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 4
+
+ Otherwise, the compiler output a warning about not being able to destruct
+ \c MyPrivateClass.
+
+ \sa QSharedPointer
+*/
+
+/*!
+ \fn QScopedPointer::QScopedPointer(T *p = 0)
+
+ Constructs this QScopedPointer instance and sets its pointer to \a p.
+*/
+
+/*!
+ \fn QScopedPointer::~QScopedPointer()
+
+ Destroys this QScopedPointer object. Delete the object its pointer points
+ to.
+*/
+
+/*!
+ \fn T *QScopedPointer::data() const
+
+ Returns the value of the pointer referenced by this object. QScopedPointer
+ still owns the object pointed to.
+*/
+
+/*!
+ \fn T &QScopedPointer::operator*() const
+
+ Provides access to the scoped pointer's object.
+
+ If the contained pointer is \c null, behavior is undefined.
+ \sa isNull()
+*/
+
+/*!
+ \fn T *QScopedPointer::operator->() const
+
+ Provides access to the scoped pointer's object.
+
+ If the contained pointer is \c null, behavior is undefined.
+
+ \sa isNull()
+*/
+
+/*!
+ \fn QScopedPointer::operator bool() const
+
+ Returns \c true if this object is not \c null. This function is suitable
+ for use in \tt if-constructs, like:
+
+ \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 3
+
+ \sa isNull()
+*/
+
+/*!
+ \fn bool QScopedPointer::operator==(const QScopedPointer<T> &other) const
+
+ Equality operator. Returns true if the scoped pointer \a other
+ is pointing to the same object as this pointer, otherwise returns false.
+*/
+
+
+/*!
+ \fn bool QScopedPointer::operator!=(const QScopedPointer<T> &other) const
+
+ Inequality operator. Returns true if the scoped pointer \a other
+ is not pointing to the same object as this pointer, otherwise returns false.
+*/
+
+/*!
+ \fn bool QScopedPointer::isNull() const
+
+ Returns \c true if this object is holding a pointer that is \c null.
+*/
+
+/*!
+ \fn void QScopedPointer::reset(T *other = 0)
+
+ Deletes the existing object it is pointing to if any, and sets its pointer to
+ \a other. QScopedPointer now owns \a other and will delete it in its
+ destructor.
+
+ If \a other is equal to the value returned by data(), behavior is
+ undefined.
+*/
+
+/*!
+ \fn T *QScopedPointer::take()
+
+ Returns the value of the pointer referenced by this object. The pointer of this
+ QScopedPointer object will be reset to \c null.
+*/
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h
new file mode 100644
index 0000000..fc8f9e2
--- /dev/null
+++ b/src/corelib/tools/qscopedpointer.h
@@ -0,0 +1,199 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtCore 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSCOPEDPOINTER_H
+#define QSCOPEDPOINTER_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+QT_MODULE(Core)
+
+template <typename T>
+class QScopedPointer
+{
+public:
+ explicit inline QScopedPointer(T *p = 0) : d(p)
+ {
+ }
+
+ inline ~QScopedPointer()
+ {
+ delete d;
+ }
+
+ inline T &operator*() const
+ {
+ return *d;
+ }
+
+ inline T *operator->() const
+ {
+ return d;
+ }
+
+ inline bool operator==(const QScopedPointer<T> &other) const
+ {
+ return d == other.d;
+ }
+
+ inline bool operator!=(const QScopedPointer<T> &other) const
+ {
+ return d != other.d;
+ }
+
+ inline operator bool() const
+ {
+ return d;
+ }
+
+ inline T *data() const
+ {
+ return d;
+ }
+
+ inline bool isNull() const
+ {
+ return !d;
+ }
+
+ inline void reset(T *other = 0)
+ {
+ T *oldD = d;
+ d = other;
+ delete oldD;
+ }
+
+ inline T *take()
+ {
+ T *oldD = d;
+ d = 0;
+ return oldD;
+ }
+
+protected:
+ T *d;
+
+private:
+ Q_DISABLE_COPY(QScopedPointer)
+};
+
+/* internal class - allows special handling for resetting and cleaning the pointer */
+template <typename T, typename CustomHandler>
+class QScopedCustomPointer : public QScopedPointer<T>
+{
+public:
+ inline QScopedCustomPointer(T *p = 0)
+ : QScopedPointer<T>(p)
+ {
+ }
+
+ inline ~QScopedCustomPointer()
+ {
+ T *oldD = this->d;
+ this->d = 0;
+ CustomHandler::cleanup(oldD);
+ }
+
+ inline void reset(T *other = 0)
+ {
+ CustomHandler::reset(this->d, other);
+ }
+
+ inline T *&data_ptr()
+ {
+ return this->d;
+ }
+};
+
+/* Internal helper class - a handler for QShared* classes, to be used in QScopedCustomPointer */
+template <typename T>
+class QScopedSharedPointerHandler
+{
+public:
+ static inline void cleanup(T *d)
+ {
+ if (d && !d->ref.deref())
+ delete d;
+ }
+
+ static inline void reset(T *&d, T *other)
+ {
+ T *oldD = d;
+ d = other;
+ cleanup(oldD);
+ }
+};
+
+/* Internal. This should really have been a typedef, but you can't have a templated typedef :)
+ This class is basically a scoped pointer pointing to a ref-counted object
+ */
+template <typename T>
+class QScopedSharedPointer : public QScopedCustomPointer<T, QScopedSharedPointerHandler<T> >
+{
+public:
+ inline QScopedSharedPointer(T *p = 0)
+ : QScopedCustomPointer<T, QScopedSharedPointerHandler<T> >(p)
+ {
+ }
+
+ inline void detach()
+ {
+ qAtomicDetach(this->d);
+ }
+
+ inline void assign(T *other)
+ {
+ if (this->d == other)
+ return;
+ if (other)
+ other->ref.ref();
+ T *oldD = this->d;
+ this->d = other;
+ QScopedSharedPointerHandler<T>::cleanup(oldD);
+ }
+};
+
+QT_END_NAMESPACE
+QT_END_HEADER
+
+#endif // QSCOPEDPOINTER_H
diff --git a/src/corelib/tools/qshareddata.cpp b/src/corelib/tools/qshareddata.cpp
index 2b879ea..03bc964 100644
--- a/src/corelib/tools/qshareddata.cpp
+++ b/src/corelib/tools/qshareddata.cpp
@@ -231,7 +231,7 @@ QT_BEGIN_NAMESPACE
In the member function documentation, \e{d pointer} always refers
to the internal pointer to the shared data object.
- \sa QSharedData, QExplicitlySharedDataPointer
+ \sa QSharedData, QExplicitlySharedDataPointer, QScopedPointer, QSharedPointer
*/
/*! \fn T& QSharedDataPointer::operator*()
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index c3a989e..dee06f0 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -102,13 +102,18 @@
except that it only detaches if
QExplicitlySharedDataPointer::detach() is explicitly called.
+ QScopedPointer simply holds a pointer to a heap allocated object and
+ deletes it in its destructor. This class is useful when an object needs to
+ be heap allocated and deleted, but no more. QScopedPointer is lightweight,
+ it makes no use of additional structure or reference counting.
+
Finally, QPointer holds a pointer to a QObject-derived object, but
it does so weakly. QPointer is similar, in that behaviour, to
QWeakPointer: it does not allow you to prevent the object from
being destroyed. All you can do is query whether it has been
destroyed or not.
- \sa QSharedDataPointer, QWeakPointer
+ \sa QSharedDataPointer, QWeakPointer, QScopedPointer
*/
/*!
@@ -130,7 +135,7 @@
must first create a QSharedPointer object and verify if the pointer
is null or not.
- \sa QSharedPointer
+ \sa QSharedPointer, QScopedPointer
*/
/*!
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index ad2d9f2..88b8b8c 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -109,13 +109,19 @@ namespace QtSharedPointer {
template <class T>
class Basic
{
+#ifndef Q_CC_NOKIAX86
typedef T *Basic:: *RestrictedBool;
+#endif
public:
typedef T Type;
inline T *data() const { return value; }
inline bool isNull() const { return !data(); }
+#ifndef Q_CC_NOKIAX86
inline operator RestrictedBool() const { return isNull() ? 0 : &Basic::value; }
+#else
+ inline operator bool() const { return isNull() ? 0 : &Basic::value; }
+#endif
inline bool operator !() const { return isNull(); }
inline T &operator*() const { return *data(); }
inline T *operator->() const { return data(); }
@@ -249,7 +255,7 @@ namespace QtSharedPointer {
if (o && !o->strongref)
o = 0;
if (o) {
- verifyReconstruction(actual);
+ Basic<T>::verifyReconstruction(actual);
o->weakref.ref();
o->strongref.ref();
}
@@ -277,15 +283,15 @@ public:
inline QSharedPointer() { }
// inline ~QSharedPointer() { }
- inline explicit QSharedPointer(T *ptr) { internalConstruct(ptr); }
+ inline explicit QSharedPointer(T *ptr) { BaseClass::internalConstruct(ptr); }
template <typename Deleter>
- inline QSharedPointer(T *ptr, Deleter d) { internalConstruct(ptr, d); }
+ inline QSharedPointer(T *ptr, Deleter d) { BaseClass::internalConstruct(ptr, d); }
inline QSharedPointer(const QSharedPointer<T> &other) : BaseClass(other) { }
inline QSharedPointer<T> &operator=(const QSharedPointer<T> &other)
{
- internalCopy(other);
+ BaseClass::internalCopy(other);
return *this;
}
@@ -301,7 +307,7 @@ public:
inline QSharedPointer<T> &operator=(const QSharedPointer<X> &other)
{
QSHAREDPOINTER_VERIFY_AUTO_CAST(T, X); // if you get an error in this line, the cast is invalid
- internalCopy(other);
+ BaseClass::internalCopy(other);
return *this;
}
@@ -339,12 +345,18 @@ public:
template <class T>
class QWeakPointer
{
+#ifndef Q_CC_NOKIAX86
typedef T *QWeakPointer:: *RestrictedBool;
+#endif
typedef QtSharedPointer::ExternalRefCountData Data;
public:
inline bool isNull() const { return d == 0 || d->strongref == 0 || value == 0; }
+#ifndef Q_CC_NOKIAX86
inline operator RestrictedBool() const { return isNull() ? 0 : &QWeakPointer::value; }
+#else
+ inline operator bool() const { return isNull() ? 0 : &QWeakPointer::value; }
+#endif
inline bool operator !() const { return isNull(); }
inline QWeakPointer() : d(0), value(0) { }
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index c64e1d6..6ae3c38 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -908,6 +908,7 @@ QString::QString(const QChar *unicode, int size)
d->ref.ref();
} else {
d = (Data*) qMalloc(sizeof(Data)+size*sizeof(QChar));
+ Q_CHECK_PTR(d);
d->ref = 1;
d->alloc = d->size = size;
d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
@@ -931,6 +932,7 @@ QString::QString(int size, QChar ch)
d->ref.ref();
} else {
d = (Data*) qMalloc(sizeof(Data)+size*sizeof(QChar));
+ Q_CHECK_PTR(d);
d->ref = 1;
d->alloc = d->size = size;
d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
@@ -973,7 +975,9 @@ QString::QString(int size, Uninitialized)
*/
QString::QString(QChar ch)
{
- d = (Data *)qMalloc(sizeof(Data) + sizeof(QChar));
+ void *buf = qMalloc(sizeof(Data) + sizeof(QChar));
+ Q_CHECK_PTR(buf);
+ d = reinterpret_cast<Data *>(buf);
d->ref = 1;
d->alloc = d->size = 1;
d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
@@ -1143,8 +1147,7 @@ void QString::realloc(int alloc)
{
if (d->ref != 1 || d->data != d->array) {
Data *x = static_cast<Data *>(qMalloc(sizeof(Data) + alloc * sizeof(QChar)));
- if (!x)
- return;
+ Q_CHECK_PTR(x);
x->size = qMin(alloc, d->size);
::memcpy(x->array, d->data, x->size * sizeof(QChar));
x->array[x->size] = 0;
@@ -1167,8 +1170,7 @@ void QString::realloc(int alloc)
}
#endif
Data *x = static_cast<Data *>(qRealloc(d, sizeof(Data) + alloc * sizeof(QChar)));
- if (!x)
- return;
+ Q_CHECK_PTR(x);
x->alloc = alloc;
x->data = x->array;
d = x;
@@ -1325,6 +1327,7 @@ QString& QString::insert(int i, const QChar *unicode, int size)
if (s >= d->data && s < d->data + d->alloc) {
// Part of me - take a copy
ushort *tmp = static_cast<ushort *>(qMalloc(size * sizeof(QChar)));
+ Q_CHECK_PTR(tmp);
memcpy(tmp, s, size * sizeof(QChar));
insert(i, reinterpret_cast<const QChar *>(tmp), size);
qFree(tmp);
@@ -1679,51 +1682,69 @@ QString &QString::replace(const QString &before, const QString &after, Qt::CaseS
*/
void QString::replace_helper(uint *indices, int nIndices, int blen, const QChar *after, int alen)
{
- if (blen == alen) {
- detach();
- for (int i = 0; i < nIndices; ++i)
- memcpy(d->data + indices[i], after, alen * sizeof(QChar));
- } else if (alen < blen) {
+ // copy *after in case it lies inside our own d->data area
+ // (which we could possibly invalidate via a realloc or corrupt via memcpy operations.)
+ QChar *afterBuffer = const_cast<QChar *>(after);
+ if (after >= reinterpret_cast<QChar *>(d->data) && after < reinterpret_cast<QChar *>(d->data) + d->size) {
+ afterBuffer = static_cast<QChar *>(qMalloc(alen*sizeof(QChar)));
+ Q_CHECK_PTR(afterBuffer);
+ ::memcpy(afterBuffer, after, alen*sizeof(QChar));
+ }
+
+ QT_TRY {
detach();
- uint to = indices[0];
- if (alen)
- memcpy(d->data+to, after, alen*sizeof(QChar));
- to += alen;
- uint movestart = indices[0] + blen;
- for (int i = 1; i < nIndices; ++i) {
- int msize = indices[i] - movestart;
- if (msize > 0) {
- memmove(d->data + to, d->data + movestart, msize * sizeof(QChar));
- to += msize;
+ if (blen == alen) {
+ // replace in place
+ for (int i = 0; i < nIndices; ++i)
+ memcpy(d->data + indices[i], afterBuffer, alen * sizeof(QChar));
+ } else if (alen < blen) {
+ // replace from front
+ uint to = indices[0];
+ if (alen)
+ memcpy(d->data+to, after, alen*sizeof(QChar));
+ to += alen;
+ uint movestart = indices[0] + blen;
+ for (int i = 1; i < nIndices; ++i) {
+ int msize = indices[i] - movestart;
+ if (msize > 0) {
+ memmove(d->data + to, d->data + movestart, msize * sizeof(QChar));
+ to += msize;
+ }
+ if (alen) {
+ memcpy(d->data + to, afterBuffer, alen*sizeof(QChar));
+ to += alen;
+ }
+ movestart = indices[i] + blen;
}
- if (alen) {
- memcpy(d->data + to, after, alen*sizeof(QChar));
- to += alen;
+ int msize = d->size - movestart;
+ if (msize > 0)
+ memmove(d->data + to, d->data + movestart, msize * sizeof(QChar));
+ resize(d->size - nIndices*(blen-alen));
+ } else {
+ // replace from back
+ int adjust = nIndices*(alen-blen);
+ int newLen = d->size + adjust;
+ int moveend = d->size;
+ resize(newLen);
+
+ while (nIndices) {
+ --nIndices;
+ int movestart = indices[nIndices] + blen;
+ int insertstart = indices[nIndices] + nIndices*(alen-blen);
+ int moveto = insertstart + alen;
+ memmove(d->data + moveto, d->data + movestart,
+ (moveend - movestart)*sizeof(QChar));
+ memcpy(d->data + insertstart, afterBuffer, alen*sizeof(QChar));
+ moveend = movestart-blen;
}
- movestart = indices[i] + blen;
- }
- int msize = d->size - movestart;
- if (msize > 0)
- memmove(d->data + to, d->data + movestart, msize * sizeof(QChar));
- resize(d->size - nIndices*(blen-alen));
- } else {
- // we have a table of replacement positions, use them for fast replacing
- int adjust = nIndices*(alen-blen);
- int newLen = d->size + adjust;
- int moveend = d->size;
- resize(newLen);
-
- while (nIndices) {
- --nIndices;
- int movestart = indices[nIndices] + blen;
- int insertstart = indices[nIndices] + nIndices*(alen-blen);
- int moveto = insertstart + alen;
- memmove(d->data + moveto, d->data + movestart,
- (moveend - movestart)*sizeof(QChar));
- memcpy(d->data + insertstart, after, alen*sizeof(QChar));
- moveend = movestart-blen;
}
+ } QT_CATCH(const std::bad_alloc &) {
+ if (afterBuffer != after)
+ qFree(afterBuffer);
+ QT_RETHROW;
}
+ if (afterBuffer != after)
+ qFree(afterBuffer);
}
/*!
@@ -1751,21 +1772,7 @@ QString &QString::replace(const QChar *before, int blen,
if (alen == 0 && blen == 0)
return *this;
- // protect against before or after being part of this
- const QChar *a = after;
- const QChar *b = before;
- if (after >= (const QChar *)d->data && after < (const QChar *)d->data + d->size) {
- QChar *copy = (QChar *)malloc(alen*sizeof(QChar));
- memcpy(copy, after, alen*sizeof(QChar));
- a = copy;
- }
- if (before >= (const QChar *)d->data && before < (const QChar *)d->data + d->size) {
- QChar *copy = (QChar *)malloc(blen*sizeof(QChar));
- memcpy(copy, before, blen*sizeof(QChar));
- b = copy;
- }
-
- QStringMatcher matcher(b, blen, cs);
+ QStringMatcher matcher(before, blen, cs);
int index = 0;
while (1) {
@@ -1784,7 +1791,7 @@ QString &QString::replace(const QChar *before, int blen,
if (!pos)
break;
- replace_helper(indices, pos, blen, a, alen);
+ replace_helper(indices, pos, blen, after, alen);
if (index == -1)
break;
@@ -1792,11 +1799,6 @@ QString &QString::replace(const QChar *before, int blen,
index += pos*(alen-blen);
}
- if (a != after)
- ::free((QChar *)a);
- if (b != before)
- ::free((QChar *)b);
-
return *this;
}
@@ -3531,6 +3533,7 @@ QString::Data *QString::fromLatin1_helper(const char *str, int size)
if (size < 0)
size = qstrlen(str);
d = static_cast<Data *>(qMalloc(sizeof(Data) + size * sizeof(QChar)));
+ Q_CHECK_PTR(d);
d->ref = 1;
d->alloc = d->size = size;
d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0;
@@ -3538,7 +3541,7 @@ QString::Data *QString::fromLatin1_helper(const char *str, int size)
ushort *i = d->data;
d->array[size] = '\0';
while (size--)
- *i++ = (uchar)*str++;
+ *i++ = (uchar)*str++;
}
return d;
}
@@ -6948,6 +6951,7 @@ void QString::updateProperties() const
QString QString::fromRawData(const QChar *unicode, int size)
{
Data *x = static_cast<Data *>(qMalloc(sizeof(Data)));
+ Q_CHECK_PTR(x);
if (unicode) {
x->data = (ushort *)unicode;
} else {
diff --git a/src/corelib/tools/qtextboundaryfinder.cpp b/src/corelib/tools/qtextboundaryfinder.cpp
index bc9b675..5ca6a11 100644
--- a/src/corelib/tools/qtextboundaryfinder.cpp
+++ b/src/corelib/tools/qtextboundaryfinder.cpp
@@ -38,11 +38,11 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "private/qharfbuzz_p.h"
#include <QtCore/qtextboundaryfinder.h>
#include <QtCore/qvarlengtharray.h>
#include <private/qunicodetables_p.h>
#include <qdebug.h>
+#include "private/qharfbuzz_p.h"
QT_BEGIN_NAMESPACE
@@ -176,6 +176,7 @@ QTextBoundaryFinder::QTextBoundaryFinder(const QTextBoundaryFinder &other)
, freePrivate(true)
{
d = (QTextBoundaryFinderPrivate *) malloc(length*sizeof(HB_CharAttributes));
+ Q_CHECK_PTR(d);
memcpy(d, other.d, length*sizeof(HB_CharAttributes));
}
@@ -193,8 +194,11 @@ QTextBoundaryFinder &QTextBoundaryFinder::operator=(const QTextBoundaryFinder &o
length = other.length;
pos = other.pos;
freePrivate = true;
-
- d = (QTextBoundaryFinderPrivate *) realloc(d, length*sizeof(HB_CharAttributes));
+
+ QTextBoundaryFinderPrivate *newD = (QTextBoundaryFinderPrivate *)
+ realloc(d, length*sizeof(HB_CharAttributes));
+ Q_CHECK_PTR(newD);
+ d = newD;
memcpy(d, other.d, length*sizeof(HB_CharAttributes));
return *this;
@@ -221,6 +225,7 @@ QTextBoundaryFinder::QTextBoundaryFinder(BoundaryType type, const QString &strin
, freePrivate(true)
{
d = (QTextBoundaryFinderPrivate *) malloc(length*sizeof(HB_CharAttributes));
+ Q_CHECK_PTR(d);
init(t, chars, length, d->attributes);
}
@@ -248,6 +253,7 @@ QTextBoundaryFinder::QTextBoundaryFinder(BoundaryType type, const QChar *chars,
freePrivate = false;
} else {
d = (QTextBoundaryFinderPrivate *) malloc(length*sizeof(HB_CharAttributes));
+ Q_CHECK_PTR(d);
freePrivate = true;
}
init(t, chars, length, d->attributes);
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index e2f60ed..b41240e 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -52,6 +52,9 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Core)
+template<class T, int Prealloc>
+class QPodList;
+
// Prealloc = 256 by default, specified in qcontainerfwd.h
template<class T, int Prealloc>
class QVarLengthArray
@@ -122,6 +125,7 @@ public:
inline const T * constData() const { return ptr; }
private:
+ friend class QPodList<T, Prealloc>;
void realloc(int size, int alloc);
int a;
@@ -140,6 +144,7 @@ Q_INLINE_TEMPLATE QVarLengthArray<T, Prealloc>::QVarLengthArray(int asize)
: s(asize) {
if (s > Prealloc) {
ptr = reinterpret_cast<T *>(qMalloc(s * sizeof(T)));
+ Q_CHECK_PTR(ptr);
a = s;
} else {
ptr = reinterpret_cast<T *>(array);
@@ -161,25 +166,24 @@ Q_INLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::reserve(int asize)
{ if (asize > a) realloc(s, asize); }
template <class T, int Prealloc>
-Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::append(const T *abuf, int asize)
+Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::append(const T *abuf, int increment)
{
Q_ASSERT(abuf);
- if (asize <= 0)
+ if (increment <= 0)
return;
- const int idx = s;
- const int news = s + asize;
- if (news >= a)
- realloc(s, qMax(s<<1, news));
- s = news;
+ const int asize = s + increment;
+
+ if (asize >= a)
+ realloc(s, qMax(s*2, asize));
if (QTypeInfo<T>::isComplex) {
- T *i = ptr + idx;
- T *j = i + asize;
- while (i < j)
- new (i++) T(*abuf++);
+ // call constructor for new objects (which can throw)
+ while (s < asize)
+ new (ptr+(s++)) T(*abuf++);
} else {
- qMemCopy(&ptr[idx], abuf, asize * sizeof(T));
+ qMemCopy(&ptr[s], abuf, increment * sizeof(T));
+ s = asize;
}
}
@@ -189,46 +193,58 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
Q_ASSERT(aalloc >= asize);
T *oldPtr = ptr;
int osize = s;
- s = asize;
+ // s = asize;
if (aalloc != a) {
ptr = reinterpret_cast<T *>(qMalloc(aalloc * sizeof(T)));
+ Q_CHECK_PTR(ptr);
if (ptr) {
+ s = 0;
a = aalloc;
if (QTypeInfo<T>::isStatic) {
- T *i = ptr + osize;
- T *j = oldPtr + osize;
- while (i != ptr) {
- new (--i) T(*--j);
- j->~T();
+ QT_TRY {
+ while (s < asize) {
+ new (ptr+s) T(*(oldPtr+s));
+ (oldPtr+s)->~T();
+ s++;
+ }
+ } QT_CATCH(...) {
+ // clean up all the old objects and then free the old ptr
+ int sClean = s;
+ while (sClean < osize)
+ (oldPtr+(sClean++))->~T();
+ if (oldPtr != reinterpret_cast<T *>(array) && oldPtr != ptr)
+ qFree(oldPtr);
+ QT_RETHROW;
}
} else {
- qMemCopy(ptr, oldPtr, osize * sizeof(T));
+ qMemCopy(ptr, oldPtr, qMin(asize, osize) * sizeof(T));
+ s = asize;
}
} else {
ptr = oldPtr;
- s = 0;
- asize = 0;
+ return;
}
}
if (QTypeInfo<T>::isComplex) {
- if (asize < osize) {
- T *i = oldPtr + osize;
- T *j = oldPtr + asize;
- while (i-- != j)
- i->~T();
- } else {
- T *i = ptr + asize;
- T *j = ptr + osize;
- while (i != j)
- new (--i) T;
- }
+ while (osize > asize)
+ (oldPtr+(--osize))->~T();
+ if( oldPtr == ptr )
+ s = osize;
}
if (oldPtr != reinterpret_cast<T *>(array) && oldPtr != ptr)
qFree(oldPtr);
+
+ if (QTypeInfo<T>::isComplex) {
+ // call default constructor for new objects (which can throw)
+ while (s < asize)
+ new (ptr+(s++)) T;
+ } else {
+ s = asize;
+ }
}
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp
index 6b26b2e..04e9ace 100644
--- a/src/corelib/tools/qvector.cpp
+++ b/src/corelib/tools/qvector.cpp
@@ -50,6 +50,7 @@ QVectorData QVectorData::shared_null = { Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, tr
QVectorData *QVectorData::malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init)
{
QVectorData* p = (QVectorData *)qMalloc(sizeofTypedData + (size - 1) * sizeofT);
+ Q_CHECK_PTR(p);
::memcpy(p, init, sizeofTypedData + (qMin(size, init->alloc) - 1) * sizeofT);
return p;
}
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 38254cd..d9fad3a 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -77,6 +77,7 @@ struct Q_CORE_EXPORT QVectorData
static QVectorData shared_null;
// ### Qt 5: rename to 'allocate()'. The current name causes problems for
// some debugges when the QVector is member of a class within an unnamed namespace.
+ // ### Qt 5: can be removed completely. (Ralf)
static QVectorData *malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init);
static int grow(int sizeofTypedData, int size, int sizeofT, bool excessive);
};
@@ -376,7 +377,9 @@ QVector<T> &QVector<T>::operator=(const QVector<T> &v)
template <typename T>
inline QVectorData *QVector<T>::malloc(int aalloc)
{
- return static_cast<QVectorData *>(qMalloc(sizeOfTypedData() + (aalloc - 1) * sizeof(T)));
+ QVectorData *data = static_cast<QVectorData *>(qMalloc(sizeOfTypedData() + (aalloc - 1) * sizeof(T)));
+ Q_CHECK_PTR(data);
+ return data;
}
template <typename T>
@@ -425,74 +428,79 @@ void QVector<T>::free(Data *x)
template <typename T>
void QVector<T>::realloc(int asize, int aalloc)
{
- T *j, *i, *b;
+ T *pOld;
+ T *pNew;
union { QVectorData *d; Data *p; } x;
x.d = d;
- if (QTypeInfo<T>::isComplex && aalloc == d->alloc && d->ref == 1) {
- // pure resize
- i = p->array + d->size;
- j = p->array + asize;
- if (i > j) {
- while (i-- != j)
- i->~T();
- } else {
- while (j-- != i)
- new (j) T;
+ if (QTypeInfo<T>::isComplex && asize < d->size && d->ref == 1 ) {
+ // call the destructor on all objects that need to be
+ // destroyed when shrinking
+ pOld = d->array + d->size;
+ pNew = d->array + asize;
+ while (asize < d->size) {
+ (--pOld)->~T();
+ d->size--;
}
- d->size = asize;
- return;
}
if (aalloc != d->alloc || d->ref != 1) {
// (re)allocate memory
if (QTypeInfo<T>::isStatic) {
- x.d = malloc(aalloc);
+ x.p = malloc(aalloc);
+ Q_CHECK_PTR(x.p);
+ x.d->size = 0;
} else if (d->ref != 1) {
- x.d = QVectorData::malloc(sizeOfTypedData(), aalloc, sizeof(T), d);
- } else {
+ x.p = malloc(aalloc);
+ Q_CHECK_PTR(x.p);
if (QTypeInfo<T>::isComplex) {
- // call the destructor on all objects that need to be
- // destroyed when shrinking
- if (asize < d->size) {
- j = p->array + asize;
- i = p->array + d->size;
- while (i-- != j)
- i->~T();
- i = p->array + asize;
- }
+ x.d->size = 0;
+ } else {
+ ::memcpy(x.p, p, sizeOfTypedData() + (qMin(aalloc, p->alloc) - 1) * sizeof(T));
+ x.d->size = d->size;
+ }
+ } else {
+ QT_TRY {
+ QVectorData *mem = static_cast<QVectorData *>(qRealloc(p, sizeOfTypedData() + (aalloc - 1) * sizeof(T)));
+ Q_CHECK_PTR(mem);
+ x.p = p = mem;
+ x.d->size = d->size;
+ } QT_CATCH (const std::bad_alloc &) {
+ if (aalloc > d->alloc) // ignore the error in case we are just shrinking.
+ QT_RETHROW;
}
- x.d = d = static_cast<QVectorData *>(qRealloc(d, sizeOfTypedData() + (aalloc - 1) * sizeof(T)));
}
x.d->ref = 1;
+ x.d->alloc = aalloc;
x.d->sharable = true;
x.d->capacity = d->capacity;
-
}
+
if (QTypeInfo<T>::isComplex) {
- if (asize < d->size) {
- j = p->array + asize;
- i = x.p->array + asize;
- } else {
- // construct all new objects when growing
- i = x.p->array + asize;
- j = x.p->array + d->size;
- while (i != j)
- new (--i) T;
- j = p->array + d->size;
- }
- if (i != j) {
+ QT_TRY {
+ pOld = d->array + x.d->size;
+ pNew = x.d->array + x.d->size;
// copy objects from the old array into the new array
- b = x.p->array;
- while (i != b)
- new (--i) T(*--j);
+ while (x.d->size < qMin(asize, d->size)) {
+ new (pNew++) T(*pOld++);
+ x.d->size++;
+ }
+ // construct all new objects when growing
+ while (x.d->size < asize) {
+ new (pNew++) T;
+ x.d->size++;
+ }
+ } QT_CATCH (...) {
+ free(x.d);
+ QT_RETHROW;
}
- } else if (asize > d->size) {
+
+ } else if (asize > x.d->size) {
// initialize newly allocated memory to 0
- qMemSet(x.p->array + d->size, 0, (asize - d->size) * sizeof(T));
+ qMemSet(x.d->array + x.d->size, 0, (asize - x.d->size) * sizeof(T));
}
x.d->size = asize;
- x.d->alloc = aalloc;
+
if (d != x.d) {
if (!d->ref.deref())
free(p);
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index aea0c6c..cf13cc9 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -39,7 +39,8 @@ HEADERS += \
tools/qtimeline.h \
tools/qunicodetables_p.h \
tools/qvarlengtharray.h \
- tools/qvector.h
+ tools/qvector.h \
+ tools/qscopedpointer.h
SOURCES += \
@@ -70,6 +71,7 @@ SOURCES += \
tools/qvector.cpp \
tools/qvsnprintf.cpp
+symbian:SOURCES+=tools/qlocale_symbian.cpp
#zlib support
contains(QT_CONFIG, zlib) {
@@ -106,4 +108,7 @@ SOURCES += ../3rdparty/harfbuzz/src/harfbuzz-buffer.c \
tools/qharfbuzz.cpp
HEADERS += tools/qharfbuzz_p.h
-!macx-icc:unix:LIBS += -lm
+INCLUDEPATH += ../3rdparty/md5 \
+ ../3rdparty/md4
+
+!macx-icc:unix:!symbian:LIBS += -lm
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index fddcecf..bce7161 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -429,7 +429,6 @@ QXmlStreamReader::~QXmlStreamReader()
Q_D(QXmlStreamReader);
if (d->deleteDevice)
delete d->device;
- delete d;
}
/*! \fn bool QXmlStreamReader::hasError() const
@@ -818,7 +817,9 @@ inline void QXmlStreamReaderPrivate::reallocateStack()
{
stack_size <<= 1;
sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
+ Q_CHECK_PTR(sym_stack);
state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
+ Q_CHECK_PTR(sym_stack);
}
@@ -3130,8 +3131,6 @@ QXmlStreamWriter::QXmlStreamWriter(QString *string)
*/
QXmlStreamWriter::~QXmlStreamWriter()
{
- Q_D(QXmlStreamWriter);
- delete d;
}
diff --git a/src/corelib/xml/qxmlstream.h b/src/corelib/xml/qxmlstream.h
index 2ba7972..6903d56 100644
--- a/src/corelib/xml/qxmlstream.h
+++ b/src/corelib/xml/qxmlstream.h
@@ -48,6 +48,7 @@
#include <QtCore/QString>
#include <QtCore/QVector>
+#include <QtCore/QScopedPointer>
QT_BEGIN_HEADER
@@ -392,7 +393,7 @@ public:
private:
Q_DISABLE_COPY(QXmlStreamReader)
Q_DECLARE_PRIVATE(QXmlStreamReader)
- QXmlStreamReaderPrivate *d_ptr;
+ QScopedPointer<QXmlStreamReaderPrivate> d_ptr;
};
#endif // QT_NO_XMLSTREAMREADER
@@ -465,7 +466,7 @@ public:
private:
Q_DISABLE_COPY(QXmlStreamWriter)
Q_DECLARE_PRIVATE(QXmlStreamWriter)
- QXmlStreamWriterPrivate *d_ptr;
+ QScopedPointer<QXmlStreamWriterPrivate> d_ptr;
};
#endif // QT_NO_XMLSTREAMWRITER
diff --git a/src/dbus/qdbusabstractadaptor.cpp b/src/dbus/qdbusabstractadaptor.cpp
index 883aabf..350f1aa 100644
--- a/src/dbus/qdbusabstractadaptor.cpp
+++ b/src/dbus/qdbusabstractadaptor.cpp
@@ -264,7 +264,7 @@ void QDBusAdaptorConnector::polish()
void QDBusAdaptorConnector::relaySlot(void **argv)
{
- QObjectPrivate *d = static_cast<QObjectPrivate *>(d_ptr);
+ QObjectPrivate *d = static_cast<QObjectPrivate *>(d_ptr.data());
relay(d->currentSender->sender, d->currentSender->signal, argv);
}
diff --git a/src/dbus/qdbuscontext.h b/src/dbus/qdbuscontext.h
index 3d043cf..6ece5b6 100644
--- a/src/dbus/qdbuscontext.h
+++ b/src/dbus/qdbuscontext.h
@@ -74,7 +74,7 @@ public:
private:
QDBusContextPrivate *d_ptr;
- Q_DECLARE_PRIVATE(QDBusContext)
+ friend class QDBusContextPrivate;
};
QT_END_NAMESPACE
diff --git a/src/gui/dialogs/dialogs.pri b/src/gui/dialogs/dialogs.pri
index f1ec858..b9fad41 100644
--- a/src/gui/dialogs/dialogs.pri
+++ b/src/gui/dialogs/dialogs.pri
@@ -7,6 +7,7 @@ HEADERS += \
dialogs/qabstractpagesetupdialog_p.h \
dialogs/qcolordialog.h \
dialogs/qcolordialog_p.h \
+ dialogs/qfscompleter_p.h \
dialogs/qdialog.h \
dialogs/qdialog_p.h \
dialogs/qerrormessage.h \
@@ -45,7 +46,7 @@ win32 {
!win32-borland:!wince*: LIBS += -lshell32 # the filedialog needs this library
}
-!mac:!embedded:unix {
+!mac:!embedded:!symbian:unix {
HEADERS += dialogs/qpagesetupdialog_unix_p.h
SOURCES += dialogs/qprintdialog_unix.cpp \
dialogs/qpagesetupdialog_unix.cpp
@@ -70,7 +71,7 @@ embedded {
}
}
-wince*: FORMS += dialogs/qfiledialog_wince.ui
+wince*|symbian: FORMS += dialogs/qfiledialog_embedded.ui
else: FORMS += dialogs/qfiledialog.ui
INCLUDEPATH += $$PWD
@@ -94,4 +95,4 @@ SOURCES += \
FORMS += dialogs/qpagesetupwidget.ui
RESOURCES += dialogs/qprintdialog.qrc
-RESOURCES += dialogs/qmessagebox.qrc \ No newline at end of file
+RESOURCES += dialogs/qmessagebox.qrc
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index b3f3c5b..2d31c0b 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -64,8 +64,12 @@ extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp
extern bool qt_wince_is_smartphone(); //is defined in qguifunctions_wce.cpp
#elif defined(Q_WS_X11)
# include "../kernel/qt_x11_p.h"
+#elif defined(Q_WS_S60)
+# include "qfiledialog.h"
+#endif
+#if defined(Q_OS_SYMBIAN)
+#include "qmenubar.h"
#endif
-
#ifndef SPI_GETSNAPTODEFBUTTON
# define SPI_GETSNAPTODEFBUTTON 95
#endif
@@ -292,9 +296,13 @@ QDialog::QDialog(QDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f)
QDialog::~QDialog()
{
- // Need to hide() here, as our (to-be) overridden hide()
- // will not be called in ~QWidget.
- hide();
+ QT_TRY {
+ // Need to hide() here, as our (to-be) overridden hide()
+ // will not be called in ~QWidget.
+ hide();
+ } QT_CATCH(...) {
+ // we're in the destructor - just swallow the exception
+ }
}
/*!
@@ -486,7 +494,22 @@ int QDialog::exec()
#endif //QT_NO_MENUBAR
#endif //Q_WS_WINCE_WM
+#ifdef Q_OS_SYMBIAN
+#ifndef QT_NO_MENUBAR
+ QMenuBar *menuBar = 0;
+ if (!findChild<QMenuBar *>())
+ menuBar = new QMenuBar(this);
+#endif
+#endif
+
+#if !defined(Q_WS_S60)
show();
+#else
+ if (qobject_cast<QFileDialog *>(this))
+ showFullScreen();
+ else
+ show();
+#endif
#ifdef Q_WS_MAC
d->mac_nativeDialogModalHelp();
@@ -511,6 +534,13 @@ int QDialog::exec()
delete menuBar;
#endif //QT_NO_MENUBAR
#endif //Q_WS_WINCE_WM
+#ifdef Q_OS_SYMBIAN
+#ifndef QT_NO_MENUBAR
+ else if (menuBar)
+ delete menuBar;
+#endif //QT_NO_MENUBAR
+#endif //Q_OS_SYMBIAN
+
return res;
}
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index 493cec5..e3a4ca4 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -58,12 +58,15 @@
#include <qdebug.h>
#include <qapplication.h>
#include <qstylepainter.h>
-#ifndef Q_WS_WINCE
+#if !defined(Q_WS_WINCE) && !defined(Q_WS_S60)
#include "ui_qfiledialog.h"
#else
-#include "ui_qfiledialog_wince.h"
+#define Q_EMBEDDED_SMALLSCREEN
+#include "ui_qfiledialog_embedded.h"
+#if defined(Q_OS_WINCE)
extern bool qt_priv_ptr_valid;
#endif
+#endif
QT_BEGIN_NAMESPACE
@@ -353,7 +356,6 @@ QFileDialog::~QFileDialog()
settings.beginGroup(QLatin1String("Qt"));
settings.setValue(QLatin1String("filedialog"), saveState());
#endif
- delete d->qFileDialogUi;
d->deleteNativeDialog_sys();
}
@@ -485,6 +487,38 @@ void QFileDialog::changeEvent(QEvent *e)
QDialog::changeEvent(e);
}
+QFileDialogPrivate::QFileDialogPrivate()
+ :
+#ifndef QT_NO_PROXYMODEL
+ proxyModel(0),
+#endif
+ model(0),
+ fileMode(QFileDialog::AnyFile),
+ acceptMode(QFileDialog::AcceptOpen),
+ currentHistoryLocation(-1),
+ renameAction(0),
+ deleteAction(0),
+ showHiddenAction(0),
+ useDefaultCaption(true),
+ defaultFileTypes(true),
+ fileNameLabelExplicitlySat(false),
+ nativeDialogInUse(false),
+#ifdef Q_WS_MAC
+ mDelegate(0),
+#ifndef QT_MAC_USE_COCOA
+ mDialog(0),
+ mDialogStarted(false),
+ mDialogClosed(true),
+#endif
+#endif
+ qFileDialogUi(0)
+{
+}
+
+QFileDialogPrivate::~QFileDialogPrivate()
+{
+}
+
void QFileDialogPrivate::retranslateWindowTitle()
{
Q_Q(QFileDialog);
@@ -2078,7 +2112,7 @@ void QFileDialogPrivate::init(const QString &directory, const QString &nameFilte
q->restoreState(settings.value(QLatin1String("filedialog")).toByteArray());
#endif
-#ifdef Q_WS_WINCE
+#if defined(Q_EMBEDDED_SMALLSCREEN)
qFileDialogUi->lookInLabel->setVisible(false);
qFileDialogUi->fileNameLabel->setVisible(false);
qFileDialogUi->fileTypeLabel->setVisible(false);
@@ -2118,7 +2152,7 @@ void QFileDialogPrivate::createWidgets()
q, SLOT(_q_rowsInserted(const QModelIndex &)));
model->setReadOnly(false);
- qFileDialogUi = new Ui_QFileDialog();
+ qFileDialogUi.reset(new Ui_QFileDialog());
qFileDialogUi->setupUi(q);
QList<QUrl> initialBookmarks;
@@ -2144,7 +2178,7 @@ void QFileDialogPrivate::createWidgets()
qFileDialogUi->fileNameLabel->setBuddy(qFileDialogUi->fileNameEdit);
#endif
#ifndef QT_NO_COMPLETER
- completer = new QFSCompletor(model, q);
+ completer = new QFSCompleter(model, q);
qFileDialogUi->fileNameEdit->setCompleter(completer);
QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)),
q, SLOT(_q_autoCompleteFileName(QString)));
@@ -2202,9 +2236,9 @@ void QFileDialogPrivate::createWidgets()
treeHeader->addAction(showHeader);
}
- QItemSelectionModel *selModel = qFileDialogUi->treeView->selectionModel();
+ QScopedPointer<QItemSelectionModel> selModel(qFileDialogUi->treeView->selectionModel());
qFileDialogUi->treeView->setSelectionModel(qFileDialogUi->listView->selectionModel());
- delete selModel;
+
QObject::connect(qFileDialogUi->treeView, SIGNAL(activated(QModelIndex)),
q, SLOT(_q_enterDirectory(QModelIndex)));
QObject::connect(qFileDialogUi->treeView, SIGNAL(customContextMenuRequested(QPoint)),
@@ -2286,9 +2320,9 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel)
connect(d->model, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
this, SLOT(_q_rowsInserted(const QModelIndex &)));
}
- QItemSelectionModel *selModel = d->qFileDialogUi->treeView->selectionModel();
+ QScopedPointer<QItemSelectionModel> selModel(d->qFileDialogUi->treeView->selectionModel());
d->qFileDialogUi->treeView->setSelectionModel(d->qFileDialogUi->listView->selectionModel());
- delete selModel;
+
d->setRootIndex(idx);
// reconnect selection
@@ -3169,7 +3203,7 @@ void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e)
#ifndef QT_NO_COMPLETER
-QString QFSCompletor::pathFromIndex(const QModelIndex &index) const
+QString QFSCompleter::pathFromIndex(const QModelIndex &index) const
{
const QFileSystemModel *dirModel;
if (proxyModel)
@@ -3184,14 +3218,17 @@ QString QFSCompletor::pathFromIndex(const QModelIndex &index) const
return index.data(QFileSystemModel::FilePathRole).toString();
}
-QStringList QFSCompletor::splitPath(const QString &path) const
+QStringList QFSCompleter::splitPath(const QString &path) const
{
if (path.isEmpty())
return QStringList(completionPrefix());
QString pathCopy = QDir::toNativeSeparators(path);
QString sep = QDir::separator();
-#ifdef Q_OS_WIN
+#if defined(Q_OS_SYMBIAN)
+ if (pathCopy == QLatin1String("\\"))
+ return QStringList(pathCopy);
+#elif defined(Q_OS_WIN)
if (pathCopy == QLatin1String("\\") || pathCopy == QLatin1String("\\\\"))
return QStringList(pathCopy);
QString doubleSlash(QLatin1String("\\\\"));
@@ -3203,7 +3240,11 @@ QStringList QFSCompletor::splitPath(const QString &path) const
QRegExp re(QLatin1Char('[') + QRegExp::escape(sep) + QLatin1Char(']'));
-#ifdef Q_OS_WIN
+#if defined(Q_OS_SYMBIAN)
+ QStringList parts = pathCopy.split(re, QString::SkipEmptyParts);
+ if (pathCopy.endsWith(sep))
+ parts.append(QString());
+#elif defined(Q_OS_WIN)
QStringList parts = pathCopy.split(re, QString::SkipEmptyParts);
if (!doubleSlash.isEmpty() && !parts.isEmpty())
parts[0].prepend(doubleSlash);
@@ -3215,7 +3256,7 @@ QStringList QFSCompletor::splitPath(const QString &path) const
parts[0] = sep[0];
#endif
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
bool startsFromRoot = !parts.isEmpty() && parts[0].endsWith(QLatin1Char(':'));
#else
bool startsFromRoot = path[0] == sep[0];
diff --git a/src/gui/dialogs/qfiledialog_wince.ui b/src/gui/dialogs/qfiledialog_embedded.ui
index 8aa9e1b..8aa9e1b 100644
--- a/src/gui/dialogs/qfiledialog_wince.ui
+++ b/src/gui/dialogs/qfiledialog_embedded.ui
diff --git a/src/gui/dialogs/qfiledialog_p.h b/src/gui/dialogs/qfiledialog_p.h
index a393ec7..2925c8c 100644
--- a/src/gui/dialogs/qfiledialog_p.h
+++ b/src/gui/dialogs/qfiledialog_p.h
@@ -76,6 +76,7 @@
#include <qtimeline.h>
#include <qdebug.h>
#include "qsidebar_p.h"
+#include "qfscompleter_p.h"
#if defined (Q_OS_UNIX)
#include <unistd.h>
@@ -91,25 +92,6 @@ class QCompleter;
class QHBoxLayout;
class Ui_QFileDialog;
-#ifndef QT_NO_COMPLETER
-/*!
- QCompleter that can deal with QFileSystemModel
- */
-class QFSCompletor : public QCompleter {
-public:
- QFSCompletor(QFileSystemModel *model, QObject *parent = 0) : QCompleter(model, parent), proxyModel(0), sourceModel(model)
- {
-#ifdef Q_OS_WIN
- setCaseSensitivity(Qt::CaseInsensitive);
-#endif
- }
- QString pathFromIndex(const QModelIndex &index) const;
- QStringList splitPath(const QString& path) const;
-
- QAbstractProxyModel *proxyModel;
- QFileSystemModel *sourceModel;
-};
-#endif // QT_NO_COMPLETER
struct QFileDialogArgs
{
@@ -131,31 +113,7 @@ class Q_AUTOTEST_EXPORT QFileDialogPrivate : public QDialogPrivate
Q_DECLARE_PUBLIC(QFileDialog)
public:
- QFileDialogPrivate() :
-#ifndef QT_NO_PROXYMODEL
- proxyModel(0),
-#endif
- model(0),
- fileMode(QFileDialog::AnyFile),
- acceptMode(QFileDialog::AcceptOpen),
- currentHistoryLocation(-1),
- renameAction(0),
- deleteAction(0),
- showHiddenAction(0),
- useDefaultCaption(true),
- defaultFileTypes(true),
- fileNameLabelExplicitlySat(false),
- nativeDialogInUse(false),
-#ifdef Q_WS_MAC
- mDelegate(0),
-#ifndef QT_MAC_USE_COCOA
- mDialog(0),
- mDialogStarted(false),
- mDialogClosed(true),
-#endif
-#endif
- qFileDialogUi(0)
- {}
+ QFileDialogPrivate();
void createToolButtons();
void createMenuActions();
@@ -224,7 +182,7 @@ public:
static inline QString toInternal(const QString &path)
{
-#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX)
+#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN)
QString n(path);
for (int i = 0; i < (int)n.length(); ++i)
if (n[i] == QLatin1Char('\\')) n[i] = QLatin1Char('/');
@@ -298,7 +256,7 @@ public:
bool defaultFileTypes;
bool fileNameLabelExplicitlySat;
QStringList nameFilters;
-
+
// Members for using native dialogs:
bool nativeDialogInUse;
// setVisible_sys returns true if it ends up showing a native
@@ -360,7 +318,7 @@ public:
void mac_nativeDialogModalHelp();
#endif
- Ui_QFileDialog *qFileDialogUi;
+ QScopedPointer<Ui_QFileDialog> qFileDialogUi;
QString acceptLabel;
@@ -369,6 +327,11 @@ public:
QByteArray signalToDisconnectOnClose;
QFileDialog::Options opts;
+
+ ~QFileDialogPrivate();
+
+private:
+ Q_DISABLE_COPY(QFileDialogPrivate)
};
class QFileDialogLineEdit : public QLineEdit
diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp
index 23a2cbc..119164d 100644
--- a/src/gui/dialogs/qfileinfogatherer.cpp
+++ b/src/gui/dialogs/qfileinfogatherer.cpp
@@ -83,10 +83,10 @@ QFileInfoGatherer::QFileInfoGatherer(QObject *parent)
*/
QFileInfoGatherer::~QFileInfoGatherer()
{
- mutex.lock();
+ QMutexLocker locker(&mutex);
abort = true;
condition.wakeOne();
- mutex.unlock();
+ locker.unlock();
wait();
}
@@ -94,9 +94,8 @@ void QFileInfoGatherer::setResolveSymlinks(bool enable)
{
Q_UNUSED(enable);
#ifdef Q_OS_WIN
- mutex.lock();
+ QMutexLocker locker(&mutex);
m_resolveSymlinks = enable;
- mutex.unlock();
#endif
}
@@ -107,9 +106,8 @@ bool QFileInfoGatherer::resolveSymlinks() const
void QFileInfoGatherer::setIconProvider(QFileIconProvider *provider)
{
- mutex.lock();
+ QMutexLocker locker(&mutex);
m_iconProvider = provider;
- mutex.unlock();
}
QFileIconProvider *QFileInfoGatherer::iconProvider() const
@@ -124,12 +122,11 @@ QFileIconProvider *QFileInfoGatherer::iconProvider() const
*/
void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStringList &files)
{
- mutex.lock();
+ QMutexLocker locker(&mutex);
// See if we already have this dir/file in our que
int loc = this->path.lastIndexOf(path);
while (loc > 0) {
if (this->files.at(loc) == files) {
- mutex.unlock();
return;
}
loc = this->path.lastIndexOf(path, loc - 1);
@@ -137,7 +134,6 @@ void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStr
this->path.push(path);
this->files.push(files);
condition.wakeAll();
- mutex.unlock();
}
/*!
@@ -160,10 +156,9 @@ void QFileInfoGatherer::updateFile(const QString &filePath)
void QFileInfoGatherer::clear()
{
#ifndef QT_NO_FILESYSTEMWATCHER
- mutex.lock();
+ QMutexLocker locker(&mutex);
watcher->removePaths(watcher->files());
watcher->removePaths(watcher->directories());
- mutex.unlock();
#endif
}
@@ -175,9 +170,8 @@ void QFileInfoGatherer::clear()
void QFileInfoGatherer::removePath(const QString &path)
{
#ifndef QT_NO_FILESYSTEMWATCHER
- mutex.lock();
+ QMutexLocker locker(&mutex);
watcher->removePath(path);
- mutex.unlock();
#endif
}
@@ -198,9 +192,8 @@ void QFileInfoGatherer::run()
{
forever {
bool updateFiles = false;
- mutex.lock();
+ QMutexLocker locker(&mutex);
if (abort) {
- mutex.unlock();
return;
}
if (this->path.isEmpty())
@@ -214,8 +207,9 @@ void QFileInfoGatherer::run()
this->files.pop_front();
updateFiles = true;
}
- mutex.unlock();
- if (updateFiles) getFileInfos(path, list);
+ locker.unlock();
+ if (updateFiles)
+ getFileInfos(path, list);
}
}
@@ -287,6 +281,8 @@ QString QFileInfoGatherer::translateDriveName(const QFileInfo &drive) const
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
if (driveName.startsWith(QLatin1Char('/'))) // UNC host
return drive.fileName();
+#endif
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
if (driveName.endsWith(QLatin1Char('/')))
driveName.chop(1);
#endif
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp
index 603789e..d9ae5bf 100644
--- a/src/gui/dialogs/qfilesystemmodel.cpp
+++ b/src/gui/dialogs/qfilesystemmodel.cpp
@@ -355,7 +355,7 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QS
// ### TODO can we use bool QAbstractFileEngine::caseSensitive() const?
QStringList pathElements = absolutePath.split(QLatin1Char('/'), QString::SkipEmptyParts);
if ((pathElements.isEmpty())
-#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE)
+#if (!defined(Q_OS_WIN) || defined(Q_OS_WINCE)) && !defined(Q_OS_SYMBIAN)
&& QDir::fromNativeSeparators(longPath) != QLatin1String("/")
#endif
)
@@ -384,9 +384,21 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QS
r = translateVisibleLocation(rootNode, r);
index = q->index(r, 0, QModelIndex());
pathElements.pop_front();
- } else {
+ } else
+#endif
+
+#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
+ {
if (!pathElements.at(0).contains(QLatin1String(":")))
+#if defined(Q_CC_NOKIAX86)
+ {
+ // Workaround for bizarre compiler crash.
+ QString rootPath = QDir(longPath).rootPath();
+ pathElements.prepend(rootPath);
+ }
+#else
pathElements.prepend(QDir(longPath).rootPath());
+#endif
if (pathElements.at(0).endsWith(QLatin1Char('/')))
pathElements[0].chop(1);
}
@@ -1596,12 +1608,25 @@ void QFileSystemModelPrivate::_q_directoryChanged(const QString &directory, cons
if (parentNode->children.count() == 0)
return;
QStringList toRemove;
+#if defined(Q_OS_SYMBIAN)
+ // Filename case must be exact in qBinaryFind below, so create a list of all lowercase names.
+ QStringList newFiles;
+ for(int i = 0; i < files.size(); i++) {
+ newFiles << files.at(i).toLower();
+ }
+#else
QStringList newFiles = files;
+#endif
qSort(newFiles.begin(), newFiles.end());
QHash<QString, QFileSystemNode*>::const_iterator i = parentNode->children.constBegin();
while (i != parentNode->children.constEnd()) {
QStringList::iterator iterator;
- iterator = qBinaryFind(newFiles.begin(), newFiles.end(), i.value()->fileName);
+ iterator = qBinaryFind(newFiles.begin(), newFiles.end(),
+#if defined(Q_OS_SYMBIAN)
+ i.value()->fileName.toLower());
+#else
+ i.value()->fileName);
+#endif
if (iterator == newFiles.end()) {
toRemove.append(i.value()->fileName);
}
@@ -1924,8 +1949,8 @@ bool QFileSystemModelPrivate::passNameFilters(const QFileSystemNode *node) const
return true;
}
-#include "moc_qfilesystemmodel.cpp"
+QT_END_NAMESPACE
-#endif // QT_NO_FILESYSTEMMODEL
+#include "moc_qfilesystemmodel.cpp"
-QT_END_NAMESPACE
+#endif // QT_NO_FILESYSTEMMODEL \ No newline at end of file
diff --git a/src/gui/dialogs/qfscompleter_p.h b/src/gui/dialogs/qfscompleter_p.h
new file mode 100644
index 0000000..c65eeea
--- /dev/null
+++ b/src/gui/dialogs/qfscompleter_p.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCOMPLETOR_P_H
+#define QCOMPLETOR_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 "qcompleter.h"
+#include <QtGui/qfilesystemmodel.h>
+QT_BEGIN_NAMESPACE
+#ifndef QT_NO_COMPLETER
+
+/*!
+ QCompleter that can deal with QFileSystemModel
+ */
+class QFSCompleter : public QCompleter {
+public:
+ QFSCompleter(QFileSystemModel *model, QObject *parent = 0)
+ : QCompleter(model, parent), proxyModel(0), sourceModel(model)
+ {
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+ setCaseSensitivity(Qt::CaseInsensitive);
+#endif
+ }
+ QString pathFromIndex(const QModelIndex &index) const;
+ QStringList splitPath(const QString& path) const;
+
+ QAbstractProxyModel *proxyModel;
+ QFileSystemModel *sourceModel;
+};
+#endif // QT_NO_COMPLETER
+QT_END_NAMESPACE
+#endif // QCOMPLETOR_P_H
+
diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp
index 1fefb67..68044c8 100644
--- a/src/gui/dialogs/qmessagebox.cpp
+++ b/src/gui/dialogs/qmessagebox.cpp
@@ -270,7 +270,7 @@ void QMessageBoxPrivate::updateSize()
return;
QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
-#if defined(Q_WS_QWS) || defined(Q_WS_WINCE)
+#if defined(Q_WS_QWS) || defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN)
// the width of the screen, less the window border.
int hardLimit = screenSize.width() - (q->frameGeometry().width() - q->geometry().width());
#else
diff --git a/src/gui/dialogs/qpagesetupdialog_win.cpp b/src/gui/dialogs/qpagesetupdialog_win.cpp
index 2c74ed2..ffad77c 100644
--- a/src/gui/dialogs/qpagesetupdialog_win.cpp
+++ b/src/gui/dialogs/qpagesetupdialog_win.cpp
@@ -71,7 +71,7 @@ int QPageSetupDialog::exec()
return Rejected;
QWin32PrintEngine *engine = static_cast<QWin32PrintEngine*>(d->printer->paintEngine());
- QWin32PrintEnginePrivate *ep = static_cast<QWin32PrintEnginePrivate *>(engine->d_ptr);
+ QWin32PrintEnginePrivate *ep = static_cast<QWin32PrintEnginePrivate *>(engine->d_ptr.data());
PAGESETUPDLG psd;
memset(&psd, 0, sizeof(PAGESETUPDLG));
diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp
index 8456d13..2f7f7c1 100644
--- a/src/gui/dialogs/qprintdialog_unix.cpp
+++ b/src/gui/dialogs/qprintdialog_unix.cpp
@@ -44,7 +44,6 @@
#ifndef QT_NO_PRINTDIALOG
#include "private/qabstractprintdialog_p.h"
-#include "qfiledialog_p.h"
#include <QtGui/qmessagebox.h>
#include "qprintdialog.h"
#include "qfiledialog.h"
@@ -55,6 +54,7 @@
#include <QtGui/qdialogbuttonbox.h>
+#include "qfscompleter_p.h"
#include "ui_qprintpropertieswidget.h"
#include "ui_qprintsettingsoutput.h"
#include "ui_qprintwidget.h"
@@ -696,7 +696,7 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p)
QFileSystemModel *fsm = new QFileSystemModel(widget.filename);
fsm->setRootPath(QDir::homePath());
#if !defined(QT_NO_COMPLETER) && !defined(QT_NO_FILEDIALOG)
- widget.filename->setCompleter(new QFSCompletor(fsm, widget.filename));
+ widget.filename->setCompleter(new QFSCompleter(fsm, widget.filename));
#endif
#endif
_q_printerChanged(currentPrinterIndex);
diff --git a/src/gui/dialogs/qprintpreviewdialog.cpp b/src/gui/dialogs/qprintpreviewdialog.cpp
index a696160..835f372 100644
--- a/src/gui/dialogs/qprintpreviewdialog.cpp
+++ b/src/gui/dialogs/qprintpreviewdialog.cpp
@@ -42,6 +42,7 @@
#include "qprintpreviewdialog.h"
#include "qprintpreviewwidget.h"
#include <private/qprinter_p.h>
+#include "private/qdialog_p.h"
#include <QtGui/qaction.h>
#include <QtGui/qboxlayout.h>
@@ -138,12 +139,12 @@ private:
};
} // anonymous namespace
-class QPrintPreviewDialogPrivate
+class QPrintPreviewDialogPrivate : public QDialogPrivate
{
Q_DECLARE_PUBLIC(QPrintPreviewDialog)
public:
- QPrintPreviewDialogPrivate(QPrintPreviewDialog *q)
- : q_ptr(q), printDialog(0), ownPrinter(false),
+ QPrintPreviewDialogPrivate()
+ : printDialog(0), ownPrinter(false),
initialized(false) {}
// private slots
@@ -168,7 +169,6 @@ public:
void updatePageNumLabel();
void updateZoomFactor();
- QPrintPreviewDialog *q_ptr;
QPrintDialog *printDialog;
QPrintPreviewWidget *preview;
QPrinter *printer;
@@ -662,7 +662,7 @@ void QPrintPreviewDialogPrivate::_q_zoomFactorChanged()
\sa QWidget::setWindowFlags()
*/
QPrintPreviewDialog::QPrintPreviewDialog(QPrinter* printer, QWidget *parent, Qt::WindowFlags flags)
- : QDialog(parent, flags), d_ptr(new QPrintPreviewDialogPrivate(this))
+ : QDialog(*new QPrintPreviewDialogPrivate, parent, flags)
{
Q_D(QPrintPreviewDialog);
d->init(printer);
@@ -676,7 +676,7 @@ QPrintPreviewDialog::QPrintPreviewDialog(QPrinter* printer, QWidget *parent, Qt:
system default printer.
*/
QPrintPreviewDialog::QPrintPreviewDialog(QWidget *parent, Qt::WindowFlags f)
- : QDialog(parent, f), d_ptr(new QPrintPreviewDialogPrivate(this))
+ : QDialog(*new QPrintPreviewDialogPrivate, parent, f)
{
Q_D(QPrintPreviewDialog);
d->init();
@@ -691,7 +691,6 @@ QPrintPreviewDialog::~QPrintPreviewDialog()
if (d->ownPrinter)
delete d->printer;
delete d->printDialog;
- delete d_ptr;
}
/*!
diff --git a/src/gui/dialogs/qprintpreviewdialog.h b/src/gui/dialogs/qprintpreviewdialog.h
index c3a4d57..49262db 100644
--- a/src/gui/dialogs/qprintpreviewdialog.h
+++ b/src/gui/dialogs/qprintpreviewdialog.h
@@ -94,7 +94,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_previewChanged())
Q_PRIVATE_SLOT(d_func(), void _q_zoomFactorChanged())
- QPrintPreviewDialogPrivate *d_ptr;
+ void *dummy; // ### Qt 5 - remove me
};
diff --git a/src/gui/embedded/qsoundqss_qws.cpp b/src/gui/embedded/qsoundqss_qws.cpp
index 283bbd3..ed988ca 100644
--- a/src/gui/embedded/qsoundqss_qws.cpp
+++ b/src/gui/embedded/qsoundqss_qws.cpp
@@ -1036,24 +1036,28 @@ void QWSSoundServerPrivate::stopFile(int wid, int sid)
void QWSSoundServerPrivate::stopAll(int wid)
{
QWSSoundServerProvider *bucket;
- QList<QWSSoundServerProvider*>::Iterator it = active.begin();
- while (it != active.end()) {
- bucket = *it;
- if (bucket->groupId() == wid) {
- it = active.erase(it);
- delete bucket;
- } else {
- ++it;
+ if (!active.isEmpty()) {
+ QList<QWSSoundServerProvider*>::Iterator it = active.begin();
+ while (it != active.end()) {
+ bucket = *it;
+ if (bucket->groupId() == wid) {
+ it = active.erase(it);
+ delete bucket;
+ } else {
+ ++it;
+ }
}
}
- it = inactive.begin();
- while (it != inactive.end()) {
- bucket = *it;
- if (bucket->groupId() == wid) {
- it = inactive.erase(it);
- delete bucket;
- } else {
- ++it;
+ if (!inactive.isEmpty()) {
+ QList<QWSSoundServerProvider*>::Iterator it = inactive.begin();
+ while (it != inactive.end()) {
+ bucket = *it;
+ if (bucket->groupId() == wid) {
+ it = inactive.erase(it);
+ delete bucket;
+ } else {
+ ++it;
+ }
}
}
}
diff --git a/src/gui/embedded/qwindowsystem_qws.cpp b/src/gui/embedded/qwindowsystem_qws.cpp
index a15decd..45d5bce 100644
--- a/src/gui/embedded/qwindowsystem_qws.cpp
+++ b/src/gui/embedded/qwindowsystem_qws.cpp
@@ -1304,7 +1304,13 @@ QWSServer::QWSServer(int flags, QObject *parent) :
QObject(*new QWSServerPrivate, parent)
{
Q_D(QWSServer);
- d->initServer(flags);
+ QT_TRY {
+ d->initServer(flags);
+ } QT_CATCH(...) {
+ qwsServer = 0;
+ qwsServerPrivate = 0;
+ QT_RETHROW;
+ }
}
#ifdef QT3_SUPPORT
@@ -1750,21 +1756,23 @@ void QWSServerPrivate::cleanupFonts(bool force)
#if defined(QWS_DEBUG_FONTCLEANUP)
qDebug() << "cleanupFonts()";
#endif
- QMap<QByteArray, int>::Iterator it = fontReferenceCount.begin();
- while (it != fontReferenceCount.end()) {
- if (it.value() && !force) {
- ++it;
- continue;
- }
+ if (!fontReferenceCount.isEmpty()) {
+ QMap<QByteArray, int>::Iterator it = fontReferenceCount.begin();
+ while (it != fontReferenceCount.end()) {
+ if (it.value() && !force) {
+ ++it;
+ continue;
+ }
- const QByteArray &fontName = it.key();
+ const QByteArray &fontName = it.key();
#if defined(QWS_DEBUG_FONTCLEANUP)
- qDebug() << "removing unused font file" << fontName;
+ qDebug() << "removing unused font file" << fontName;
#endif
- QFile::remove(QFile::decodeName(fontName));
- sendFontRemovedEvent(fontName);
+ QFile::remove(QFile::decodeName(fontName));
+ sendFontRemovedEvent(fontName);
- it = fontReferenceCount.erase(it);
+ it = fontReferenceCount.erase(it);
+ }
}
if (crashedClientIds.isEmpty())
@@ -3966,7 +3974,8 @@ void QWSServerPrivate::openDisplay()
void QWSServerPrivate::closeDisplay()
{
- qt_screen->shutdownDevice();
+ if (qt_screen)
+ qt_screen->shutdownDevice();
}
/*!
@@ -4065,9 +4074,14 @@ void QWSServer::startup(int flags)
void QWSServer::closedown()
{
- unlink(qws_qtePipeFilename().toLatin1().constData());
- delete qwsServer;
+ QScopedPointer<QWSServer> server(qwsServer);
qwsServer = 0;
+ QT_TRY {
+ unlink(qws_qtePipeFilename().toLatin1().constData());
+ } QT_CATCH(const std::bad_alloc &) {
+ // ### TODO - what to do when we run out of memory
+ // when calling toLatin1?
+ }
}
void QWSServerPrivate::emergency_cleanup()
diff --git a/src/gui/embedded/qwscursor_qws.cpp b/src/gui/embedded/qwscursor_qws.cpp
index 3a5bd2c..b25e9b1 100644
--- a/src/gui/embedded/qwscursor_qws.cpp
+++ b/src/gui/embedded/qwscursor_qws.cpp
@@ -531,7 +531,7 @@ void QWSCursor::set(const uchar *data, const uchar *mask,
cursor = QImage(width,height, QImage::Format_Indexed8);
- if (!width || !height || !data || !mask)
+ if (!width || !height || !data || !mask || cursor.isNull())
return;
cursor.setNumColors(3);
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index a436805..d9cba2a 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -568,6 +568,7 @@
#include <QtGui/qpixmapcache.h>
#include <QtGui/qstyleoption.h>
#include <QtGui/qevent.h>
+#include <QInputContext>
#include <private/qgraphicsitem_p.h>
#include <private/qgraphicswidget_p.h>
@@ -3324,7 +3325,7 @@ QTransform QGraphicsItem::itemTransform(const QGraphicsItem *other, bool *ok) co
QTransform x;
const QGraphicsItem *p = child;
do {
- p->d_ptr->combineTransformToParent(&x);
+ p->d_ptr->.data()->combineTransformToParent(&x);
} while ((p = p->d_ptr->parent) && p != root);
if (parentOfOther)
return x.inverted(ok);
@@ -3682,7 +3683,7 @@ QRectF QGraphicsItem::sceneBoundingRect() const
const QGraphicsItem *parentItem = this;
const QGraphicsItemPrivate *itemd;
do {
- itemd = parentItem->d_ptr;
+ itemd = parentItem->d_ptr.data();
if (itemd->transformData)
break;
offset += itemd->pos;
@@ -8391,7 +8392,7 @@ class QGraphicsTextItemPrivate
{
public:
QGraphicsTextItemPrivate()
- : control(0), pageNumber(0), useDefaultImpl(false), tabChangesFocus(false)
+ : control(0), pageNumber(0), useDefaultImpl(false), tabChangesFocus(false), clickCausedFocus(0)
{ }
mutable QTextControl *control;
@@ -8412,6 +8413,8 @@ public:
bool useDefaultImpl;
bool tabChangesFocus;
+ uint clickCausedFocus : 1;
+
QGraphicsTextItem *qq;
};
@@ -8741,7 +8744,13 @@ void QGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
dd->useDefaultImpl = false;
return;
}
+
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8753,7 +8762,13 @@ void QGraphicsTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QGraphicsItem::mouseMoveEvent(event);
return;
}
+
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8773,7 +8788,23 @@ void QGraphicsTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
return;
}
+
+ if (event->button() == Qt::LeftButton && qApp->autoSipEnabled()
+ && (!dd->clickCausedFocus || qApp->autoSipOnMouseFocus())) {
+ QEvent _event(QEvent::RequestSoftwareInputPanel);
+ QApplication::sendEvent(event->widget(), &_event);
+ } else {
+ QGraphicsItem::mouseReleaseEvent(event);
+ }
+ dd->clickCausedFocus = 0;
+
dd->sendControlEvent(event);
+
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8792,6 +8823,11 @@ void QGraphicsTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
}
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8800,6 +8836,11 @@ void QGraphicsTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
void QGraphicsTextItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8808,6 +8849,18 @@ void QGraphicsTextItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
void QGraphicsTextItem::keyPressEvent(QKeyEvent *event)
{
dd->sendControlEvent(event);
+ QList<QGraphicsView *> views = scene()->views();
+ for (int i = 0; i < views.size(); ++i) {
+ QGraphicsView *view = views.at(i);
+ Q_ASSERT(view->viewport());
+ if(view->viewport()->hasFocus()) {
+ QInputContext *qic = view->viewport()->inputContext();
+ if(qic){
+ qic->update();
+ }
+ break;
+ }
+ }
}
/*!
@@ -8816,6 +8869,18 @@ void QGraphicsTextItem::keyPressEvent(QKeyEvent *event)
void QGraphicsTextItem::keyReleaseEvent(QKeyEvent *event)
{
dd->sendControlEvent(event);
+ QList<QGraphicsView *> views = scene()->views();
+ for (int i = 0; i < views.size(); ++i) {
+ QGraphicsView *view = views.at(i);
+ Q_ASSERT(view->viewport());
+ if(view->viewport()->hasFocus()) {
+ QInputContext *qic = view->viewport()->inputContext();
+ if(qic){
+ qic->update();
+ }
+ break;
+ }
+ }
}
/*!
@@ -8824,7 +8889,22 @@ void QGraphicsTextItem::keyReleaseEvent(QKeyEvent *event)
void QGraphicsTextItem::focusInEvent(QFocusEvent *event)
{
dd->sendControlEvent(event);
+ if (event->reason() == Qt::MouseFocusReason) {
+ dd->clickCausedFocus = 1;
+ }
update();
+ QList<QGraphicsView *> views = scene()->views();
+ for (int i = 0; i < views.size(); ++i) {
+ QGraphicsView *view = views.at(i);
+ Q_ASSERT(view->viewport());
+ if(view->viewport()->hasFocus()) {
+ QInputContext *qic = view->viewport()->inputContext();
+ if(qic){
+ qic->reset();
+ }
+ break;
+ }
+ }
}
/*!
@@ -8834,6 +8914,18 @@ void QGraphicsTextItem::focusOutEvent(QFocusEvent *event)
{
dd->sendControlEvent(event);
update();
+ QList<QGraphicsView *> views = scene()->views();
+ for (int i = 0; i < views.size(); ++i) {
+ QGraphicsView *view = views.at(i);
+ Q_ASSERT(view->viewport());
+ if(view->viewport()->hasFocus()) {
+ QInputContext *qic = view->viewport()->inputContext();
+ if(qic){
+ qic->reset();
+ }
+ break;
+ }
+ }
}
/*!
@@ -8842,6 +8934,11 @@ void QGraphicsTextItem::focusOutEvent(QFocusEvent *event)
void QGraphicsTextItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8850,6 +8947,11 @@ void QGraphicsTextItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
void QGraphicsTextItem::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8858,6 +8960,11 @@ void QGraphicsTextItem::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
void QGraphicsTextItem::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8866,6 +8973,11 @@ void QGraphicsTextItem::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
void QGraphicsTextItem::dropEvent(QGraphicsSceneDragDropEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8882,6 +8994,11 @@ void QGraphicsTextItem::inputMethodEvent(QInputMethodEvent *event)
void QGraphicsTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8890,6 +9007,11 @@ void QGraphicsTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
void QGraphicsTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
@@ -8898,6 +9020,11 @@ void QGraphicsTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
void QGraphicsTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
dd->sendControlEvent(event);
+ Q_ASSERT(event->widget());
+ QInputContext *qic = event->widget()->inputContext();
+ if(qic) {
+ qic->update();
+ }
}
/*!
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index 6ea17c2..989be43 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -46,6 +46,7 @@
#include <QtCore/qobject.h>
#include <QtCore/qvariant.h>
#include <QtCore/qrect.h>
+#include <QtCore/qscopedpointer.h>
#include <QtGui/qpainterpath.h>
#include <QtGui/qpixmap.h>
@@ -421,7 +422,7 @@ protected:
protected:
QGraphicsItem(QGraphicsItemPrivate &dd,
QGraphicsItem *parent, QGraphicsScene *scene);
- QGraphicsItemPrivate *d_ptr;
+ QScopedPointer<QGraphicsItemPrivate> d_ptr;
void addToIndex();
void removeFromIndex();
diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp
index b58eb53..2d4bddb 100644
--- a/src/gui/graphicsview/qgraphicslayoutitem.cpp
+++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp
@@ -369,7 +369,6 @@ QGraphicsLayoutItem::~QGraphicsLayoutItem()
}
}
}
- delete d_ptr;
}
/*!
diff --git a/src/gui/graphicsview/qgraphicslayoutitem.h b/src/gui/graphicsview/qgraphicslayoutitem.h
index 31f5d90..d667c4f 100644
--- a/src/gui/graphicsview/qgraphicslayoutitem.h
+++ b/src/gui/graphicsview/qgraphicslayoutitem.h
@@ -42,6 +42,7 @@
#ifndef QGRAPHICSLAYOUTITEM_H
#define QGRAPHICSLAYOUTITEM_H
+#include <QtCore/qscopedpointer.h>
#include <QtGui/qsizepolicy.h>
#include <QtGui/qevent.h>
@@ -112,7 +113,7 @@ protected:
QGraphicsLayoutItem(QGraphicsLayoutItemPrivate &dd);
virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const = 0;
- QGraphicsLayoutItemPrivate *d_ptr;
+ QScopedPointer<QGraphicsLayoutItemPrivate> d_ptr;
private:
QSizeF *effectiveSizeHints(const QSizeF &constraint) const;
diff --git a/src/gui/graphicsview/qgraphicsproxywidget.h b/src/gui/graphicsview/qgraphicsproxywidget.h
index ab8c9da..0c874c8 100644
--- a/src/gui/graphicsview/qgraphicsproxywidget.h
+++ b/src/gui/graphicsview/qgraphicsproxywidget.h
@@ -129,7 +129,7 @@ protected Q_SLOTS:
private:
Q_DISABLE_COPY(QGraphicsProxyWidget)
- Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr, QGraphicsProxyWidget)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QGraphicsProxyWidget)
Q_PRIVATE_SLOT(d_func(), void _q_removeWidgetSlot())
friend class QWidget;
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 673fd23..900fa1a 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -1984,8 +1984,8 @@ void QGraphicsScenePrivate::invalidateSortCache()
inline bool qt_closestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
{
// Return true if sibling item1 is on top of item2.
- const QGraphicsItemPrivate *d1 = item1->d_ptr;
- const QGraphicsItemPrivate *d2 = item2->d_ptr;
+ const QGraphicsItemPrivate *d1 = item1->d_ptr.data();
+ const QGraphicsItemPrivate *d2 = item2->d_ptr.data();
bool f1 = d1->flags & QGraphicsItem::ItemStacksBehindParent;
bool f2 = d2->flags & QGraphicsItem::ItemStacksBehindParent;
if (f1 != f2) return f2;
@@ -2017,8 +2017,8 @@ inline bool qt_closestItemFirst(const QGraphicsItem *item1, const QGraphicsItem
bool QGraphicsScenePrivate::closestItemFirst_withoutCache(const QGraphicsItem *item1, const QGraphicsItem *item2)
{
// Siblings? Just check their z-values.
- const QGraphicsItemPrivate *d1 = item1->d_ptr;
- const QGraphicsItemPrivate *d2 = item2->d_ptr;
+ const QGraphicsItemPrivate *d1 = item1->d_ptr.data();
+ const QGraphicsItemPrivate *d2 = item2->d_ptr.data();
if (d1->parent == d2->parent)
return qt_closestLeaf(item1, item2);
@@ -4746,7 +4746,7 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte
const QStyleOptionGraphicsItem *option, QWidget *widget,
bool painterStateProtection)
{
- QGraphicsItemPrivate *itemd = item->d_ptr;
+ QGraphicsItemPrivate *itemd = item->d_ptr.data();
QGraphicsItem::CacheMode cacheMode = QGraphicsItem::CacheMode(itemd->cacheMode);
// Render directly, using no cache.
diff --git a/src/gui/graphicsview/qgraphicssceneevent.cpp b/src/gui/graphicsview/qgraphicssceneevent.cpp
index 0ffd2b1..ad57aac 100644
--- a/src/gui/graphicsview/qgraphicssceneevent.cpp
+++ b/src/gui/graphicsview/qgraphicssceneevent.cpp
@@ -313,7 +313,6 @@ QGraphicsSceneEvent::QGraphicsSceneEvent(QGraphicsSceneEventPrivate &dd, Type ty
*/
QGraphicsSceneEvent::~QGraphicsSceneEvent()
{
- delete d_ptr;
}
/*!
diff --git a/src/gui/graphicsview/qgraphicssceneevent.h b/src/gui/graphicsview/qgraphicssceneevent.h
index be50e96..4ebe3df 100644
--- a/src/gui/graphicsview/qgraphicssceneevent.h
+++ b/src/gui/graphicsview/qgraphicssceneevent.h
@@ -44,6 +44,7 @@
#include <QtCore/qcoreevent.h>
#include <QtCore/qpoint.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -70,7 +71,7 @@ public:
protected:
QGraphicsSceneEvent(QGraphicsSceneEventPrivate &dd, Type type = None);
- QGraphicsSceneEventPrivate *d_ptr;
+ QScopedPointer<QGraphicsSceneEventPrivate> d_ptr;
Q_DECLARE_PRIVATE(QGraphicsSceneEvent)
};
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index c94c1d7..a3e2ebe 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -751,7 +751,7 @@ QRect QGraphicsViewPrivate::mapToViewRect(const QGraphicsItem *item, const QRect
const QGraphicsItem *parentItem = item;
const QGraphicsItemPrivate *itemd;
do {
- itemd = parentItem->d_ptr;
+ itemd = parentItem->d_ptr.data();
if (itemd->transformData)
break;
offset += itemd->pos;
@@ -1001,6 +1001,11 @@ QGraphicsView::QGraphicsView(QWidget *parent)
// using a simple reference count. The same goes for acceptDrops and mouse
// tracking.
setAttribute(Qt::WA_InputMethodEnabled);
+
+ // viewport part of the graphics view has to be enabled
+ // as well, because when events come this widget is asked
+ // for input context and so on
+ viewport()->setAttribute(Qt::WA_InputMethodEnabled);
}
/*!
@@ -1015,6 +1020,11 @@ QGraphicsView::QGraphicsView(QGraphicsScene *scene, QWidget *parent)
setAcceptDrops(true);
setBackgroundRole(QPalette::Base);
setAttribute(Qt::WA_InputMethodEnabled);
+
+ // viewport part of the graphics view has to be enabled
+ // as well, because when events come this widget is asked
+ // for input context and so on
+ viewport()->setAttribute(Qt::WA_InputMethodEnabled);
}
/*!
@@ -1027,6 +1037,11 @@ QGraphicsView::QGraphicsView(QGraphicsViewPrivate &dd, QWidget *parent)
setAcceptDrops(true);
setBackgroundRole(QPalette::Base);
setAttribute(Qt::WA_InputMethodEnabled);
+
+ // viewport part of the graphics view has to be enabled
+ // as well, because when events come this widget is asked
+ // for input context and so on
+ viewport()->setAttribute(Qt::WA_InputMethodEnabled);
}
/*!
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index 78bd062..4e4944c 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -333,7 +333,7 @@ void QGraphicsWidget::resize(const QSizeF &size)
void QGraphicsWidget::setGeometry(const QRectF &rect)
{
QGraphicsWidgetPrivate *wd = QGraphicsWidget::d_func();
- QGraphicsLayoutItemPrivate *d = QGraphicsLayoutItem::d_ptr;
+ QGraphicsLayoutItemPrivate *d = QGraphicsLayoutItem::d_ptr.data();
QRectF newGeom;
QPointF oldPos = d->geom.topLeft();
if (!wd->inSetPos) {
diff --git a/src/gui/graphicsview/qgraphicswidget.h b/src/gui/graphicsview/qgraphicswidget.h
index 337490c..0563dcb 100644
--- a/src/gui/graphicsview/qgraphicswidget.h
+++ b/src/gui/graphicsview/qgraphicswidget.h
@@ -228,7 +228,7 @@ protected:
private:
Q_DISABLE_COPY(QGraphicsWidget)
- Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr, QGraphicsWidget)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QGraphicsWidget)
friend class QGraphicsScene;
friend class QGraphicsScenePrivate;
friend class QGraphicsView;
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index 329fb01..4ff3a27 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -4,7 +4,7 @@ QT = core
DEFINES += QT_BUILD_GUI_LIB QT_NO_USING_NAMESPACE
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000
-!win32:!embedded:!mac:CONFIG += x11
+!win32:!embedded:!mac:!symbian:CONFIG += x11
unix:QMAKE_PKGCONFIG_REQUIRES = QtCore
@@ -45,3 +45,7 @@ QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist
DEFINES += Q_INTERNAL_QAPP_SRC
+symbian:TARGET.UID3=0x2001B2DD
+
+# ro-section in gui can exceed default allocated space, so more rw-section little further
+symbian-sbsv2: MMP_RULES += "LINKEROPTION armcc --rw-base 0x800000" \ No newline at end of file
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index bf348af..c15e8b6 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -62,6 +62,9 @@ mac {
HEADERS += image/qpixmap_mac_p.h
SOURCES += image/qpixmap_mac.cpp
}
+symbian {
+ SOURCES += image/qpixmap_s60.cpp
+}
# Built-in image format support
HEADERS += \
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 75538a8..281d8d4 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -185,6 +185,13 @@ static int depthForFormat(QImage::Format format)
return depth;
}
+/*! \fn QImageData * QImageData::create(const QSize &size, QImage::Format format, int numColors)
+
+ \internal
+
+ Creates a new image data.
+ Returns 0 if invalid parameters are give or anything else failed.
+*/
QImageData * QImageData::create(const QSize &size, QImage::Format format, int numColors)
{
if (!size.isValid() || numColors < 0 || format == QImage::Format_Invalid)
@@ -223,7 +230,7 @@ QImageData * QImageData::create(const QSize &size, QImage::Format format, int nu
|| INT_MAX/sizeof(uchar *) < uint(height))
return 0;
- QImageData *d = new QImageData;
+ QScopedPointer<QImageData> d(new QImageData);
d->colortable.resize(numColors);
if (depth == 1) {
d->colortable[0] = QColor(Qt::black).rgba();
@@ -246,12 +253,11 @@ QImageData * QImageData::create(const QSize &size, QImage::Format format, int nu
d->data = (uchar *)malloc(d->nbytes);
if (!d->data) {
- delete d;
return 0;
}
d->ref.ref();
- return d;
+ return d.take();
}
@@ -1621,6 +1627,7 @@ int QImage::numColors() const
/*!
Returns a pointer to the scanline pointer table. This is the
beginning of the data block for the image.
+ Returns 0 in case of an error.
Use the bits() or scanLine() function instead.
*/
@@ -1636,6 +1643,8 @@ uchar **QImage::jumpTable()
if (!d->jumptable) {
d->jumptable = (uchar **)malloc(d->height*sizeof(uchar *));
+ if (!d->jumptable)
+ return 0;
uchar *data = d->data;
int height = d->height;
uchar **p = d->jumptable;
@@ -1656,6 +1665,8 @@ const uchar * const *QImage::jumpTable() const
return 0;
if (!d->jumptable) {
d->jumptable = (uchar **)malloc(d->height*sizeof(uchar *));
+ if (!d->jumptable)
+ return 0;
uchar *data = d->data;
int height = d->height;
uchar **p = d->jumptable;
diff --git a/src/gui/image/qimageiohandler.cpp b/src/gui/image/qimageiohandler.cpp
index a47c69e..f432f87 100644
--- a/src/gui/image/qimageiohandler.cpp
+++ b/src/gui/image/qimageiohandler.cpp
@@ -272,7 +272,6 @@ QImageIOHandler::QImageIOHandler(QImageIOHandlerPrivate &dd)
*/
QImageIOHandler::~QImageIOHandler()
{
- delete d_ptr;
}
/*!
diff --git a/src/gui/image/qimageiohandler.h b/src/gui/image/qimageiohandler.h
index 3b654f3..34de715 100644
--- a/src/gui/image/qimageiohandler.h
+++ b/src/gui/image/qimageiohandler.h
@@ -44,6 +44,7 @@
#include <QtCore/qplugin.h>
#include <QtCore/qfactoryinterface.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_HEADER
@@ -109,7 +110,7 @@ public:
protected:
QImageIOHandler(QImageIOHandlerPrivate &dd);
- QImageIOHandlerPrivate *d_ptr;
+ QScopedPointer<QImageIOHandlerPrivate> d_ptr;
private:
Q_DISABLE_COPY(QImageIOHandler)
};
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index 23baa96..96f2a14 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -132,7 +132,6 @@ QPicture::QPicture(int formatVersion)
{
Q_D(QPicture);
d_ptr->q_ptr = this;
- d->paintEngine = 0;
if (formatVersion == 0)
qWarning("QPicture: invalid format version 0");
@@ -155,7 +154,7 @@ QPicture::QPicture(int formatVersion)
*/
QPicture::QPicture(const QPicture &pic)
- : QPaintDevice(), d_ptr(pic.d_ptr)
+ : QPaintDevice(), d_ptr(pic.d_ptr.data())
{
d_func()->ref.ref();
}
@@ -173,10 +172,6 @@ QPicture::QPicture(QPicturePrivate &dptr)
*/
QPicture::~QPicture()
{
- if (!d_func()->ref.deref()) {
- delete d_func()->paintEngine;
- delete d_func();
- }
}
/*!
@@ -1030,9 +1025,7 @@ void QPicture::detach_helper()
x->formatMinor = d->formatMinor;
x->brect = d->brect;
x->override_rect = d->override_rect;
- if (!d->ref.deref())
- delete d;
- d_ptr = x;
+ d_ptr.reset(x);
}
/*!
@@ -1041,13 +1034,25 @@ void QPicture::detach_helper()
*/
QPicture& QPicture::operator=(const QPicture &p)
{
- qAtomicAssign<QPicturePrivate>(d_ptr, p.d_ptr);
+ d_ptr.assign(p.d_ptr.data());
return *this;
}
/*!
\internal
+ Constructs a QPicturePrivate
+*/
+QPicturePrivate::QPicturePrivate()
+ : in_memory_only(false),
+ q_ptr(0)
+{
+ ref = 1;
+}
+
+/*!
+ \internal
+
Sets formatOk to false and resets the format version numbers to default
*/
@@ -1135,8 +1140,8 @@ bool QPicturePrivate::checkFormat()
QPaintEngine *QPicture::paintEngine() const
{
if (!d_func()->paintEngine)
- const_cast<QPicture*>(this)->d_func()->paintEngine = new QPicturePaintEngine;
- return d_func()->paintEngine;
+ const_cast<QPicture*>(this)->d_func()->paintEngine.reset(new QPicturePaintEngine);
+ return d_func()->paintEngine.data();
}
/*****************************************************************************
diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h
index edfac71..d28131f 100644
--- a/src/gui/image/qpicture.h
+++ b/src/gui/image/qpicture.h
@@ -106,7 +106,7 @@ private:
bool exec(QPainter *p, QDataStream &ds, int i);
void detach_helper();
- QPicturePrivate *d_ptr;
+ QScopedSharedPointer<QPicturePrivate> d_ptr;
friend class QPicturePaintEngine;
friend class Q3Picture;
friend class QAlphaPaintEngine;
@@ -114,7 +114,7 @@ private:
public:
typedef QPicturePrivate* DataPtr;
- inline DataPtr &data_ptr() { return d_ptr; }
+ inline DataPtr &data_ptr() { return d_ptr.data_ptr(); }
};
Q_DECLARE_SHARED(QPicture)
diff --git a/src/gui/image/qpicture_p.h b/src/gui/image/qpicture_p.h
index 3e8391f..a9c4dd5 100644
--- a/src/gui/image/qpicture_p.h
+++ b/src/gui/image/qpicture_p.h
@@ -143,7 +143,7 @@ public:
PdcReservedStop = 199 // for Qt
};
- inline QPicturePrivate() : in_memory_only(false), q_ptr(0) { ref = 1; }
+ QPicturePrivate();
QAtomicInt ref;
bool checkFormat();
@@ -156,7 +156,7 @@ public:
int formatMinor;
QRect brect;
QRect override_rect;
- QPaintEngine *paintEngine;
+ QScopedPointer<QPaintEngine> paintEngine;
bool in_memory_only;
QList<QImage> image_list;
QList<QPixmap> pixmap_list;
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index f6b5de2..0ab14aa 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -76,6 +76,10 @@
# include <private/qpixmap_x11_p.h>
#endif
+#if defined(Q_OS_SYMBIAN)
+# include <private/qt_s60_p.h>
+#endif
+
#include "qpixmap_raster_p.h"
QT_BEGIN_NAMESPACE
@@ -1901,7 +1905,10 @@ int QPixmap::defaultDepth()
return 32; // XXX
#elif defined(Q_WS_MAC)
return 32;
+#elif defined(Q_OS_SYMBIAN)
+ return S60->screenDepth;
#endif
+
}
typedef void (*_qt_pixmap_cleanup_hook_64)(qint64);
diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h
index a5609e4..afe7b1c 100644
--- a/src/gui/image/qpixmap.h
+++ b/src/gui/image/qpixmap.h
@@ -51,6 +51,10 @@
QT_BEGIN_HEADER
+#if defined(Q_OS_SYMBIAN)
+class CFbsBitmap;
+#endif
+
QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
@@ -59,7 +63,6 @@ class QImageWriter;
class QColor;
class QVariant;
class QX11Info;
-
class QPixmapData;
class Q_GUI_EXPORT QPixmap : public QPaintDevice
@@ -152,6 +155,11 @@ public:
static QPixmap fromMacCGImageRef(CGImageRef image);
#endif
+#if defined(Q_OS_SYMBIAN)
+ CFbsBitmap *toSymbianCFbsBitmap() const;
+ static QPixmap fromSymbianCFbsBitmap(CFbsBitmap *bitmap);
+#endif
+
inline QPixmap copy(int x, int y, int width, int height) const;
QPixmap copy(const QRect &rect = QRect()) const;
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
new file mode 100644
index 0000000..132e26e
--- /dev/null
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -0,0 +1,233 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the $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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <exception>
+#include <w32std.h>
+#include <fbs.h>
+
+#include <private/qt_s60_p.h>
+#include "qpixmap.h"
+#include "qpixmap_raster_p.h"
+#include <qwidget.h>
+
+QT_BEGIN_NAMESPACE
+
+QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h )
+{
+ CWsScreenDevice* screenDevice = S60->screenDevice();
+ TSize screenSize = screenDevice->SizeInPixels();
+
+ TSize srcSize;
+ // Find out if this is one of our windows.
+ QSymbianControl *sControl;
+ sControl = winId->MopGetObject(sControl);
+ if (sControl && sControl->widget()->windowType() == Qt::Desktop) {
+ // Grabbing desktop widget
+ srcSize = screenSize;
+ } else {
+ TPoint relativePos = winId->PositionRelativeToScreen();
+ x += relativePos.iX;
+ y += relativePos.iY;
+ srcSize = winId->Size();
+ }
+
+ TRect srcRect(TPoint(x, y), srcSize);
+ // Clip to the screen
+ srcRect.Intersection(TRect(screenSize));
+
+ if (w > 0 && h > 0) {
+ TRect subRect(TPoint(x, y), TSize(w, h));
+ // Clip to the subRect
+ srcRect.Intersection(subRect);
+ }
+
+ if (srcRect.IsEmpty())
+ return QPixmap();
+
+ TDisplayMode displayMode = screenDevice->DisplayMode();
+ CFbsBitmap* temporary = new (ELeave) CFbsBitmap();
+ TInt error = temporary->Create(srcRect.Size(), displayMode);
+ if (error == KErrNone)
+ error = screenDevice->CopyScreenToBitmap(temporary, srcRect);
+
+ if (error != KErrNone) {
+ CBase::Delete(temporary);
+ return QPixmap();
+ }
+
+ QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(temporary);
+ CBase::Delete(temporary);
+ return pixmap;
+}
+
+/*!
+\since 4.6
+
+Returns a \c CFbsBitmap that is equivalent to the QPixmap by copying the data.
+
+It is the caller's responsibility to delete the \c CFbsBitmap after use.
+
+\warning This function is only available on Symbian OS.
+
+\sa fromSymbianCFbsBitmap()
+*/
+
+CFbsBitmap *QPixmap::toSymbianCFbsBitmap() const
+{
+ if (isNull())
+ return 0;
+
+ TDisplayMode mode;
+ const QImage img = toImage();
+ QImage::Format destFormat = img.format();
+ switch (img.format()) {
+ case QImage::Format_Mono:
+ destFormat = QImage::Format_MonoLSB;
+ // Fall through intended
+ case QImage::Format_MonoLSB:
+ mode = EGray2;
+ break;
+ case QImage::Format_Indexed8:
+ if (img.isGrayscale())
+ mode = EGray256;
+ else
+ mode = EColor256;
+ break;
+ case QImage::Format_RGB32:
+ mode = EColor16MU;
+ break;
+ case QImage::Format_ARGB6666_Premultiplied:
+ case QImage::Format_ARGB8565_Premultiplied:
+ case QImage::Format_ARGB8555_Premultiplied:
+ destFormat = QImage::Format_ARGB32_Premultiplied;
+ // Fall through intended
+ case QImage::Format_ARGB32_Premultiplied:
+#if !defined(__SERIES60_31__) && !defined(__S60_32__)
+ // ### TODO: Add runtime detection as well?
+ mode = EColor16MAP;
+ break;
+#endif
+ destFormat = QImage::Format_ARGB32;
+ // Fall through intended
+ case QImage::Format_ARGB32:
+ mode = EColor16MA;
+ break;
+ case QImage::Format_RGB555:
+ destFormat = QImage::Format_RGB16;
+ // Fall through intended
+ case QImage::Format_RGB16:
+ mode = EColor64K;
+ break;
+ case QImage::Format_RGB666:
+ destFormat = QImage::Format_RGB888;
+ // Fall through intended
+ case QImage::Format_RGB888:
+ mode = EColor16M;
+ break;
+ case QImage::Format_RGB444:
+ mode = EColor4K;
+ break;
+ case QImage::Format_Invalid:
+ return 0;
+ default:
+ qWarning("Image format not supported: %d", img.format());
+ return 0;
+ }
+
+ CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
+ TSize size(width(), height());
+ if (bitmap->Create(size, mode) != KErrNone) {
+ CBase::Delete(bitmap);
+ return 0;
+ }
+
+ const QImage converted = img.convertToFormat(destFormat);
+
+ bitmap->LockHeap();
+ const uchar *sptr = converted.bits();
+ uchar *dptr = (uchar*)bitmap->DataAddress();
+ Mem::Copy(dptr, sptr, converted.numBytes());
+ bitmap->UnlockHeap();
+ return bitmap;
+}
+
+/*!
+\since 4.6
+
+Returns a QPixmap that is equivalent to the \c CFbsBitmap by copying the data.
+If the CFbsBitmap is not valid or is compressed in memory, this function will
+return a null QPixmap.
+
+\warning This function is only available on Symbian OS.
+
+\sa toSymbianCFbsBitmap(), {QPixmap#Pixmap Conversion}{Pixmap Conversion}
+*/
+
+QPixmap QPixmap::fromSymbianCFbsBitmap(CFbsBitmap *bitmap)
+{
+ int width = bitmap->SizeInPixels().iWidth;
+ int height = bitmap->SizeInPixels().iHeight;
+
+ if (!bitmap || width <= 0 || height <= 0 || bitmap->IsCompressedInRAM())
+ return QPixmap();
+
+ TDisplayMode displayMode = bitmap->DisplayMode();
+ QImage::Format format = qt_TDisplayMode2Format(displayMode);
+ int bytesPerLine = CFbsBitmap::ScanLineLength(width, displayMode);
+ bitmap->LockHeap();
+ QImage image = QImage((const uchar*)bitmap->DataAddress(), width, height, bytesPerLine, format);
+ if (displayMode == EGray2) {
+ image.setNumColors(2);
+ image.setColor(0, QColor(Qt::color0).rgba());
+ image.setColor(1, QColor(Qt::color1).rgba());
+ } else if (displayMode == EGray256) {
+ for (int i=0; i < 256; ++i)
+ image.setColor(i, qRgb(i, i, i));
+ }else if (displayMode == EColor256) {
+ const TColor256Util *palette = TColor256Util::Default();
+ for (int i=0; i < 256; ++i)
+ image.setColor(i, (QRgb)(palette->Color256(i).Value()));
+ }
+ QPixmap pixmap = QPixmap::fromImage(image.copy());
+ bitmap->UnlockHeap();
+ return pixmap;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index bdcddfd..59c8ce7 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp