summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex <qt-info@nokia.com>2009-11-19 16:51:09 +1000
committerAlex <qt-info@nokia.com>2009-11-19 16:51:09 +1000
commit62b3f8c161eabcdc9fdda92120bc12e8f1c3802c (patch)
tree19a17b81956f8535bf6166f53d2f7a9531c102fa
parent2825cf5f3eede8e41707e8ef7b7a0325dcdeda51 (diff)
catch up with recent master changes
-rw-r--r--configure.bat2
-rw-r--r--doc/html/annotated.html4
-rw-r--r--doc/html/publ-subs.html26
-rw-r--r--doc/html/qabstractvaluespacelayer.html10
-rw-r--r--doc/html/qt-mobility-library.dcf4
-rw-r--r--doc/html/qt-mobility-library.index20
-rw-r--r--doc/html/qtmobility.qhp4
-rw-r--r--doc/html/qvaluespace.html39
-rw-r--r--doc/html/qvaluespaceprovider-members.html8
-rw-r--r--doc/html/qvaluespaceprovider.html81
-rw-r--r--doc/html/qvaluespacesubscriber-members.html8
-rw-r--r--doc/html/qvaluespacesubscriber.html78
-rw-r--r--doc/src/index.qdoc17
-rw-r--r--doc/src/messaging.qdoc2
-rw-r--r--doc/src/publ-subs.qdoc30
-rw-r--r--doc/src/qtmobility.qdocconf1
-rw-r--r--examples/cameracapture/cameracapture.cpp2
-rw-r--r--examples/cameracapture/cameracapture.ui20
-rw-r--r--examples/serviceactions/mainwindow.cpp15
-rw-r--r--plugins/contacts/contacts.pro1
-rw-r--r--plugins/gstreamer/mediacapture/qgstreamercameracontrol.cpp98
-rw-r--r--plugins/multimedia/audiocapture/audiocapture.pro (renamed from plugins/audiocapture/audiocapture.pro)8
-rw-r--r--plugins/multimedia/audiocapture/audiocaptureservice.cpp (renamed from plugins/audiocapture/audiocaptureservice.cpp)0
-rw-r--r--plugins/multimedia/audiocapture/audiocaptureservice.h (renamed from plugins/audiocapture/audiocaptureservice.h)0
-rw-r--r--plugins/multimedia/audiocapture/audiocaptureserviceplugin.cpp (renamed from plugins/audiocapture/audiocaptureserviceplugin.cpp)0
-rw-r--r--plugins/multimedia/audiocapture/audiocaptureserviceplugin.h (renamed from plugins/audiocapture/audiocaptureserviceplugin.h)0
-rw-r--r--plugins/multimedia/audiocapture/audiocapturesession.cpp (renamed from plugins/audiocapture/audiocapturesession.cpp)32
-rw-r--r--plugins/multimedia/audiocapture/audiocapturesession.h (renamed from plugins/audiocapture/audiocapturesession.h)2
-rw-r--r--plugins/multimedia/audiocapture/audiodevicecontrol.cpp (renamed from plugins/audiocapture/audiodevicecontrol.cpp)0
-rw-r--r--plugins/multimedia/audiocapture/audiodevicecontrol.h (renamed from plugins/audiocapture/audiodevicecontrol.h)0
-rw-r--r--plugins/multimedia/audiocapture/audioencodercontrol.cpp (renamed from plugins/audiocapture/audioencodercontrol.cpp)2
-rw-r--r--plugins/multimedia/audiocapture/audioencodercontrol.h (renamed from plugins/audiocapture/audioencodercontrol.h)2
-rw-r--r--plugins/multimedia/audiocapture/audiomediarecordercontrol.cpp (renamed from plugins/audiocapture/audiomediarecordercontrol.cpp)0
-rw-r--r--plugins/multimedia/audiocapture/audiomediarecordercontrol.h (renamed from plugins/audiocapture/audiomediarecordercontrol.h)0
-rw-r--r--plugins/multimedia/directshow/camera/camera.pri (renamed from plugins/directshow/camera/camera.pri)0
-rw-r--r--plugins/multimedia/directshow/camera/dscameracontrol.cpp (renamed from plugins/directshow/camera/dscameracontrol.cpp)0
-rw-r--r--plugins/multimedia/directshow/camera/dscameracontrol.h (renamed from plugins/directshow/camera/dscameracontrol.h)0
-rw-r--r--plugins/multimedia/directshow/camera/dscameraservice.cpp (renamed from plugins/directshow/camera/dscameraservice.cpp)2
-rw-r--r--plugins/multimedia/directshow/camera/dscameraservice.h (renamed from plugins/directshow/camera/dscameraservice.h)0
-rw-r--r--plugins/multimedia/directshow/camera/dscamerasession.cpp (renamed from plugins/directshow/camera/dscamerasession.cpp)2
-rw-r--r--plugins/multimedia/directshow/camera/dscamerasession.h (renamed from plugins/directshow/camera/dscamerasession.h)2
-rw-r--r--plugins/multimedia/directshow/camera/dsimagecapturecontrol.cpp (renamed from plugins/directshow/camera/dsimagecapturecontrol.cpp)2
-rw-r--r--plugins/multimedia/directshow/camera/dsimagecapturecontrol.h (renamed from plugins/directshow/camera/dsimagecapturecontrol.h)2
-rw-r--r--plugins/multimedia/directshow/camera/dsvideodevicecontrol.cpp (renamed from plugins/directshow/camera/dsvideodevicecontrol.cpp)2
-rw-r--r--plugins/multimedia/directshow/camera/dsvideodevicecontrol.h (renamed from plugins/directshow/camera/dsvideodevicecontrol.h)2
-rw-r--r--plugins/multimedia/directshow/camera/dsvideooutputcontrol.cpp (renamed from plugins/directshow/camera/dsvideooutputcontrol.cpp)2
-rw-r--r--plugins/multimedia/directshow/camera/dsvideooutputcontrol.h (renamed from plugins/directshow/camera/dsvideooutputcontrol.h)2
-rw-r--r--plugins/multimedia/directshow/camera/dsvideorenderer.cpp (renamed from plugins/directshow/camera/dsvideorenderer.cpp)2
-rw-r--r--plugins/multimedia/directshow/camera/dsvideorenderer.h (renamed from plugins/directshow/camera/dsvideorenderer.h)2
-rw-r--r--plugins/multimedia/directshow/directshow.pro (renamed from plugins/directshow/directshow.pro)4
-rw-r--r--plugins/multimedia/directshow/dsserviceplugin.cpp (renamed from plugins/directshow/dsserviceplugin.cpp)0
-rw-r--r--plugins/multimedia/directshow/dsserviceplugin.h (renamed from plugins/directshow/dsserviceplugin.h)0
-rw-r--r--plugins/multimedia/gstreamer/gstreamer.pro (renamed from plugins/gstreamer/gstreamer.pro)4
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/mediacapture.pri (renamed from plugins/gstreamer/mediacapture/mediacapture.pri)6
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreameraudioencode.cpp (renamed from plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp)2
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreameraudioencode.h (renamed from plugins/gstreamer/mediacapture/qgstreameraudioencode.h)6
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamercameracontrol.cpp319
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamercameracontrol.h (renamed from plugins/gstreamer/mediacapture/qgstreamercameracontrol.h)12
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamercapturemetadatacontrol.cpp (renamed from plugins/gstreamer/mediacapture/qgstreamercapturemetadatacontrol.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamercapturemetadatacontrol.h (renamed from plugins/gstreamer/mediacapture/qgstreamercapturemetadatacontrol.h)0
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamercaptureservice.cpp (renamed from plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp)5
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamercaptureservice.h (renamed from plugins/gstreamer/mediacapture/qgstreamercaptureservice.h)0
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamercapturesession.cpp (renamed from plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp)93
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamercapturesession.h (renamed from plugins/gstreamer/mediacapture/qgstreamercapturesession.h)22
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp (renamed from plugins/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamerimagecapturecontrol.h (renamed from plugins/gstreamer/mediacapture/qgstreamerimagecapturecontrol.h)0
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamerimageencode.cpp94
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamerimageencode.h77
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamermediaformatcontrol.cpp (renamed from plugins/gstreamer/mediacapture/qgstreamermediaformatcontrol.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamermediaformatcontrol.h (renamed from plugins/gstreamer/mediacapture/qgstreamermediaformatcontrol.h)0
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp (renamed from plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamerrecordercontrol.h (renamed from plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.h)0
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamervideoencode.cpp (renamed from plugins/gstreamer/mediacapture/qgstreamervideoencode.cpp)30
-rw-r--r--plugins/multimedia/gstreamer/mediacapture/qgstreamervideoencode.h (renamed from plugins/gstreamer/mediacapture/qgstreamervideoencode.h)16
-rw-r--r--plugins/multimedia/gstreamer/mediaplayer/mediaplayer.pri (renamed from plugins/gstreamer/mediaplayer/mediaplayer.pri)0
-rw-r--r--plugins/multimedia/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp (renamed from plugins/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/mediaplayer/qgstreamermetadataprovider.h (renamed from plugins/gstreamer/mediaplayer/qgstreamermetadataprovider.h)0
-rw-r--r--plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp (renamed from plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayercontrol.h (renamed from plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.h)0
-rw-r--r--plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayerservice.cpp (renamed from plugins/gstreamer/mediaplayer/qgstreamerplayerservice.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayerservice.h (renamed from plugins/gstreamer/mediaplayer/qgstreamerplayerservice.h)0
-rw-r--r--plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.cpp (renamed from plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.h (renamed from plugins/gstreamer/mediaplayer/qgstreamerplayersession.h)0
-rw-r--r--plugins/multimedia/gstreamer/mediaplayer/qgstreamerstreamscontrol.cpp (renamed from plugins/gstreamer/mediaplayer/qgstreamerstreamscontrol.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/mediaplayer/qgstreamerstreamscontrol.h (renamed from plugins/gstreamer/mediaplayer/qgstreamerstreamscontrol.h)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreameraudioinputdevicecontrol.cpp (renamed from plugins/gstreamer/qgstreameraudioinputdevicecontrol.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreameraudioinputdevicecontrol.h (renamed from plugins/gstreamer/qgstreameraudioinputdevicecontrol.h)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamerbushelper.cpp (renamed from plugins/gstreamer/qgstreamerbushelper.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamerbushelper.h (renamed from plugins/gstreamer/qgstreamerbushelper.h)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamermessage.cpp (renamed from plugins/gstreamer/qgstreamermessage.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamermessage.h (renamed from plugins/gstreamer/qgstreamermessage.h)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamerserviceplugin.cpp (renamed from plugins/gstreamer/qgstreamerserviceplugin.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamerserviceplugin.h (renamed from plugins/gstreamer/qgstreamerserviceplugin.h)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamervideoinputdevicecontrol.cpp (renamed from plugins/gstreamer/qgstreamervideoinputdevicecontrol.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamervideoinputdevicecontrol.h (renamed from plugins/gstreamer/qgstreamervideoinputdevicecontrol.h)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamervideooutputcontrol.cpp (renamed from plugins/gstreamer/qgstreamervideooutputcontrol.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamervideooutputcontrol.h (renamed from plugins/gstreamer/qgstreamervideooutputcontrol.h)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamervideooverlay.cpp (renamed from plugins/gstreamer/qgstreamervideooverlay.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamervideooverlay.h (renamed from plugins/gstreamer/qgstreamervideooverlay.h)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamervideorenderer.cpp (renamed from plugins/gstreamer/qgstreamervideorenderer.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamervideorenderer.h (renamed from plugins/gstreamer/qgstreamervideorenderer.h)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamervideorendererinterface.cpp (renamed from plugins/gstreamer/qgstreamervideorendererinterface.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamervideorendererinterface.h (renamed from plugins/gstreamer/qgstreamervideorendererinterface.h)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamervideowidget.cpp (renamed from plugins/gstreamer/qgstreamervideowidget.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/qgstreamervideowidget.h (renamed from plugins/gstreamer/qgstreamervideowidget.h)0
-rw-r--r--plugins/multimedia/gstreamer/qgstvideobuffer.cpp (renamed from plugins/gstreamer/qgstvideobuffer.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/qgstvideobuffer.h (renamed from plugins/gstreamer/qgstvideobuffer.h)0
-rw-r--r--plugins/multimedia/gstreamer/qvideosurfacegstsink.cpp (renamed from plugins/gstreamer/qvideosurfacegstsink.cpp)0
-rw-r--r--plugins/multimedia/gstreamer/qvideosurfacegstsink.h (renamed from plugins/gstreamer/qvideosurfacegstsink.h)0
-rw-r--r--plugins/multimedia/gstreamer/qx11videosurface.cpp (renamed from plugins/gstreamer/qx11videosurface.cpp)2
-rw-r--r--plugins/multimedia/gstreamer/qx11videosurface.h (renamed from plugins/gstreamer/qx11videosurface.h)0
-rw-r--r--plugins/multimedia/m3u/m3u.pro (renamed from plugins/m3u/m3u.pro)8
-rw-r--r--plugins/multimedia/m3u/main.cpp (renamed from plugins/m3u/main.cpp)0
-rw-r--r--plugins/multimedia/m3u/qm3uhandler.cpp (renamed from plugins/m3u/qm3uhandler.cpp)0
-rw-r--r--plugins/multimedia/m3u/qm3uhandler.h (renamed from plugins/m3u/qm3uhandler.h)0
-rw-r--r--plugins/multimedia/multimedia.pro37
-rw-r--r--plugins/multimedia/phonon/phonon.pro (renamed from plugins/phonon/phonon.pro)8
-rw-r--r--plugins/multimedia/phonon/qphononmetadataprovider.cpp (renamed from plugins/phonon/qphononmetadataprovider.cpp)0
-rw-r--r--plugins/multimedia/phonon/qphononmetadataprovider.h (renamed from plugins/phonon/qphononmetadataprovider.h)0
-rw-r--r--plugins/multimedia/phonon/qphononplayercontrol.cpp (renamed from plugins/phonon/qphononplayercontrol.cpp)0
-rw-r--r--plugins/multimedia/phonon/qphononplayercontrol.h (renamed from plugins/phonon/qphononplayercontrol.h)0
-rw-r--r--plugins/multimedia/phonon/qphononplayerservice.cpp (renamed from plugins/phonon/qphononplayerservice.cpp)0
-rw-r--r--plugins/multimedia/phonon/qphononplayerservice.h (renamed from plugins/phonon/qphononplayerservice.h)0
-rw-r--r--plugins/multimedia/phonon/qphononserviceplugin.cpp (renamed from plugins/phonon/qphononserviceplugin.cpp)0
-rw-r--r--plugins/multimedia/phonon/qphononserviceplugin.h (renamed from plugins/phonon/qphononserviceplugin.h)0
-rw-r--r--plugins/multimedia/phonon/qphononvideowidget.cpp (renamed from plugins/phonon/qphononvideowidget.cpp)0
-rw-r--r--plugins/multimedia/phonon/qphononvideowidget.h (renamed from plugins/phonon/qphononvideowidget.h)0
-rw-r--r--plugins/multimedia/v4l/camera/camera.pri (renamed from plugins/v4l/camera/camera.pri)0
-rw-r--r--plugins/multimedia/v4l/camera/cameraformatconverter.cpp (renamed from plugins/v4l/camera/cameraformatconverter.cpp)0
-rw-r--r--plugins/multimedia/v4l/camera/cameraformatconverter.h (renamed from plugins/v4l/camera/cameraformatconverter.h)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lcameracontrol.cpp (renamed from plugins/v4l/camera/v4lcameracontrol.cpp)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lcameracontrol.h (renamed from plugins/v4l/camera/v4lcameracontrol.h)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lcameraservice.cpp (renamed from plugins/v4l/camera/v4lcameraservice.cpp)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lcameraservice.h (renamed from plugins/v4l/camera/v4lcameraservice.h)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lcamerasession.cpp (renamed from plugins/v4l/camera/v4lcamerasession.cpp)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lcamerasession.h (renamed from plugins/v4l/camera/v4lcamerasession.h)0
-rw-r--r--plugins/multimedia/v4l/camera/v4limagecapturecontrol.cpp (renamed from plugins/v4l/camera/v4limagecapturecontrol.cpp)0
-rw-r--r--plugins/multimedia/v4l/camera/v4limagecapturecontrol.h (renamed from plugins/v4l/camera/v4limagecapturecontrol.h)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lmediaformatcontrol.cpp (renamed from plugins/v4l/camera/v4lmediaformatcontrol.cpp)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lmediaformatcontrol.h (renamed from plugins/v4l/camera/v4lmediaformatcontrol.h)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lrecordercontrol.cpp (renamed from plugins/v4l/camera/v4lrecordercontrol.cpp)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lrecordercontrol.h (renamed from plugins/v4l/camera/v4lrecordercontrol.h)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lvideobuffer.cpp (renamed from plugins/v4l/camera/v4lvideobuffer.cpp)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lvideobuffer.h (renamed from plugins/v4l/camera/v4lvideobuffer.h)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lvideodevicecontrol.cpp (renamed from plugins/v4l/camera/v4lvideodevicecontrol.cpp)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lvideodevicecontrol.h (renamed from plugins/v4l/camera/v4lvideodevicecontrol.h)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lvideoencode.cpp (renamed from plugins/v4l/camera/v4lvideoencode.cpp)12
-rw-r--r--plugins/multimedia/v4l/camera/v4lvideoencode.h (renamed from plugins/v4l/camera/v4lvideoencode.h)12
-rw-r--r--plugins/multimedia/v4l/camera/v4lvideooutputcontrol.cpp (renamed from plugins/v4l/camera/v4lvideooutputcontrol.cpp)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lvideooutputcontrol.h (renamed from plugins/v4l/camera/v4lvideooutputcontrol.h)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lvideorenderer.cpp (renamed from plugins/v4l/camera/v4lvideorenderer.cpp)0
-rw-r--r--plugins/multimedia/v4l/camera/v4lvideorenderer.h (renamed from plugins/v4l/camera/v4lvideorenderer.h)0
-rw-r--r--plugins/multimedia/v4l/radio/radio.pri (renamed from plugins/v4l/radio/radio.pri)0
-rw-r--r--plugins/multimedia/v4l/radio/v4lradiocontrol.cpp (renamed from plugins/v4l/radio/v4lradiocontrol.cpp)5
-rw-r--r--plugins/multimedia/v4l/radio/v4lradiocontrol.h (renamed from plugins/v4l/radio/v4lradiocontrol.h)2
-rw-r--r--plugins/multimedia/v4l/radio/v4lradioservice.cpp (renamed from plugins/v4l/radio/v4lradioservice.cpp)0
-rw-r--r--plugins/multimedia/v4l/radio/v4lradioservice.h (renamed from plugins/v4l/radio/v4lradioservice.h)0
-rw-r--r--plugins/multimedia/v4l/v4l.pro (renamed from plugins/v4l/v4l.pro)4
-rw-r--r--plugins/multimedia/v4l/v4lserviceplugin.cpp (renamed from plugins/v4l/v4lserviceplugin.cpp)0
-rw-r--r--plugins/multimedia/v4l/v4lserviceplugin.h (renamed from plugins/v4l/v4lserviceplugin.h)0
-rw-r--r--plugins/multimedia/wmp/qevrvideooverlay.cpp (renamed from plugins/wmp/qevrvideooverlay.cpp)0
-rw-r--r--plugins/multimedia/wmp/qevrvideooverlay.h (renamed from plugins/wmp/qevrvideooverlay.h)0
-rw-r--r--plugins/multimedia/wmp/qmfactivate.cpp (renamed from plugins/wmp/qmfactivate.cpp)0
-rw-r--r--plugins/multimedia/wmp/qmfactivate.h (renamed from plugins/wmp/qmfactivate.h)0
-rw-r--r--plugins/multimedia/wmp/qwmpevents.cpp (renamed from plugins/wmp/qwmpevents.cpp)0
-rw-r--r--plugins/multimedia/wmp/qwmpevents.h (renamed from plugins/wmp/qwmpevents.h)0
-rw-r--r--plugins/multimedia/wmp/qwmpglobal.cpp (renamed from plugins/wmp/qwmpglobal.cpp)0
-rw-r--r--plugins/multimedia/wmp/qwmpglobal.h (renamed from plugins/wmp/qwmpglobal.h)0
-rw-r--r--plugins/multimedia/wmp/qwmpmetadata.cpp (renamed from plugins/wmp/qwmpmetadata.cpp)0
-rw-r--r--plugins/multimedia/wmp/qwmpmetadata.h (renamed from plugins/wmp/qwmpmetadata.h)0
-rw-r--r--plugins/multimedia/wmp/qwmpplayercontrol.cpp (renamed from plugins/wmp/qwmpplayercontrol.cpp)0
-rw-r--r--plugins/multimedia/wmp/qwmpplayercontrol.h (renamed from plugins/wmp/qwmpplayercontrol.h)0
-rw-r--r--plugins/multimedia/wmp/qwmpplayerservice.cpp (renamed from plugins/wmp/qwmpplayerservice.cpp)13
-rw-r--r--plugins/multimedia/wmp/qwmpplayerservice.h (renamed from plugins/wmp/qwmpplayerservice.h)0
-rw-r--r--plugins/multimedia/wmp/qwmpplaylist.cpp (renamed from plugins/wmp/qwmpplaylist.cpp)0
-rw-r--r--plugins/multimedia/wmp/qwmpplaylist.h (renamed from plugins/wmp/qwmpplaylist.h)0
-rw-r--r--plugins/multimedia/wmp/qwmpplaylistcontrol.cpp (renamed from plugins/wmp/qwmpplaylistcontrol.cpp)0
-rw-r--r--plugins/multimedia/wmp/qwmpplaylistcontrol.h (renamed from plugins/wmp/qwmpplaylistcontrol.h)0
-rw-r--r--plugins/multimedia/wmp/qwmpserviceprovider.cpp (renamed from plugins/wmp/qwmpserviceprovider.cpp)0
-rw-r--r--plugins/multimedia/wmp/qwmpserviceprovider.h (renamed from plugins/wmp/qwmpserviceprovider.h)0
-rw-r--r--plugins/multimedia/wmp/qwmpvideooutputcontrol.cpp (renamed from plugins/wmp/qwmpvideooutputcontrol.cpp)0
-rw-r--r--plugins/multimedia/wmp/qwmpvideooutputcontrol.h (renamed from plugins/wmp/qwmpvideooutputcontrol.h)0
-rw-r--r--plugins/multimedia/wmp/qwmpvideooverlay.cpp (renamed from plugins/wmp/qwmpvideooverlay.cpp)0
-rw-r--r--plugins/multimedia/wmp/qwmpvideooverlay.h (renamed from plugins/wmp/qwmpvideooverlay.h)0
-rw-r--r--plugins/multimedia/wmp/wmp.pro (renamed from plugins/wmp/wmp.pro)4
-rw-r--r--plugins/plugins.pro30
-rw-r--r--src/contacts/qcontactdetaildefinitionfield.cpp23
-rw-r--r--src/contacts/qcontactdetaildefinitionfield.h22
-rw-r--r--src/contacts/qcontactdetaildefinitionfield_p.h23
-rw-r--r--src/global/qmobilityglobal.h10
-rw-r--r--src/messaging/qmessage.cpp52
-rw-r--r--src/messaging/qmessage.h6
-rw-r--r--src/messaging/qmessage_maemo.cpp24
-rw-r--r--src/messaging/qmessage_qmf.cpp39
-rw-r--r--src/messaging/qmessage_symbian.cpp24
-rw-r--r--src/messaging/qmessage_win.cpp168
-rw-r--r--src/messaging/qmessagecontentcontainer_p.h3
-rw-r--r--src/messaging/qmessagecontentcontainerid.h2
-rw-r--r--src/messaging/qmessagecontentcontainerid_p.h10
-rw-r--r--src/messaging/qmessagecontentcontainerid_win.cpp11
-rw-r--r--src/messaging/qmessagedatacomparator.cpp4
-rw-r--r--src/messaging/qmessagefilter_win.cpp21
-rw-r--r--src/messaging/qmessageid_win.cpp2
-rw-r--r--src/messaging/qmessageordering.cpp19
-rw-r--r--src/messaging/qmessageordering_win.cpp46
-rw-r--r--src/messaging/qmessageserviceaction.cpp21
-rw-r--r--src/messaging/qmessageserviceaction.h2
-rw-r--r--src/messaging/qmessageserviceaction_maemo.cpp3
-rw-r--r--src/messaging/qmessageserviceaction_qmf.cpp3
-rw-r--r--src/messaging/qmessageserviceaction_symbian.cpp3
-rw-r--r--src/messaging/qmessageserviceaction_symbian_p.h23
-rw-r--r--src/messaging/qmessageserviceaction_win.cpp30
-rw-r--r--src/messaging/qmessagestore.cpp31
-rw-r--r--src/messaging/qmessagestore_p.h8
-rw-r--r--src/messaging/qmessagestore_win.cpp21
-rw-r--r--src/messaging/qmtmengine_symbian.cpp23
-rw-r--r--src/messaging/qmtmengine_symbian_p.h23
-rw-r--r--src/messaging/winhelpers.cpp156
-rw-r--r--src/messaging/winhelpers_p.h21
-rw-r--r--src/multimedia/experimental/qcamera.cpp3
-rw-r--r--src/multimedia/experimental/qcamera.h2
-rw-r--r--src/multimedia/qaudioencodercontrol.cpp9
-rw-r--r--src/multimedia/qaudioencodercontrol.h2
-rw-r--r--src/multimedia/qimageencodercontrol.cpp69
-rw-r--r--src/multimedia/qimageencodercontrol.h6
-rw-r--r--src/multimedia/qlocalmediaplaylistprovider.cpp34
-rw-r--r--src/multimedia/qlocalmediaplaylistprovider.h2
-rw-r--r--src/multimedia/qmediaobject.cpp39
-rw-r--r--src/multimedia/qmediaobject_p.h4
-rw-r--r--src/multimedia/qmediaplaylist.cpp23
-rw-r--r--src/multimedia/qmediaplaylist.h2
-rw-r--r--src/multimedia/qmediaplaylistprovider.cpp31
-rw-r--r--src/multimedia/qmediaplaylistprovider.h2
-rw-r--r--src/multimedia/qmediarecorder.cpp105
-rw-r--r--src/multimedia/qmediarecorder.h22
-rw-r--r--src/multimedia/qpaintervideosurface.cpp3
-rw-r--r--src/multimedia/qradiotuner.cpp24
-rw-r--r--src/multimedia/qradiotuner.h11
-rw-r--r--src/multimedia/qradiotunercontrol.cpp13
-rw-r--r--src/multimedia/qradiotunercontrol.h3
-rw-r--r--src/multimedia/qvideoencodercontrol.cpp43
-rw-r--r--src/multimedia/qvideoencodercontrol.h12
-rw-r--r--src/multimedia/qvideowidget.cpp437
-rw-r--r--src/multimedia/qvideowidget.h9
-rw-r--r--src/multimedia/qvideowidget_p.h92
-rw-r--r--src/publishsubscribe/contextkitlayer.cpp2
-rw-r--r--src/publishsubscribe/publishsubscribe.pro4
-rw-r--r--src/publishsubscribe/qmallocpool_p.h1
-rw-r--r--src/publishsubscribe/qpacketprotocol_p.h1
-rw-r--r--src/publishsubscribe/qpublishsubscribeglobal.h89
-rw-r--r--src/publishsubscribe/qsystemreadwritelock_p.h17
-rw-r--r--src/publishsubscribe/qsystemreadwritelock_unix.cpp545
-rw-r--r--src/publishsubscribe/qsystemreadwritelock_win.cpp (renamed from src/publishsubscribe/qsystemreadwritelock.cpp)12
-rw-r--r--src/publishsubscribe/qvaluespace.cpp121
-rw-r--r--src/publishsubscribe/qvaluespace.h8
-rw-r--r--src/publishsubscribe/qvaluespaceprovider.cpp102
-rw-r--r--src/publishsubscribe/qvaluespaceprovider.h2
-rw-r--r--src/publishsubscribe/qvaluespacesubscriber.cpp114
-rw-r--r--src/publishsubscribe/qvaluespacesubscriber.h2
-rw-r--r--src/publishsubscribe/registrylayer_win.cpp56
-rw-r--r--src/publishsubscribe/sharedmemorylayer.cpp14
-rw-r--r--src/src.pro8
-rw-r--r--tests/auto/auto.pro4
-rw-r--r--tests/auto/databasemanager/tst_databasemanager.cpp36
-rw-r--r--tests/auto/databasemanager/tst_databasemanager_s60.cpp26
-rw-r--r--tests/auto/qaudiocapturesource/tst_qaudiocapturesource.cpp4
-rw-r--r--tests/auto/qcamera/tst_qcamera.cpp20
-rw-r--r--tests/auto/qmediaimageviewer/qmediaimageviewer.pro2
-rw-r--r--tests/auto/qmediaplayer/tst_qmediaplayer.cpp2
-rw-r--r--tests/auto/qmediaplaylist/qmediaplaylist.pro6
-rw-r--r--tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp71
-rw-r--r--tests/auto/qmediapluginloader/qmediapluginloader.pro6
-rw-r--r--tests/auto/qmediarecorder/tst_qmediarecorder.cpp37
-rw-r--r--tests/auto/qmessage/tst_qmessage.cpp530
-rw-r--r--tests/auto/qmessagestore/tst_qmessagestore.cpp60
-rw-r--r--tests/auto/qmessagestorekeys/qmessagestorekeys.pro12
-rw-r--r--tests/auto/qmessagestorekeys/testdata/1.txt19
-rw-r--r--tests/auto/qmessagestorekeys/tst_qmessagestorekeys.cpp794
-rw-r--r--tests/auto/qradiotuner/tst_qradiotuner.cpp32
-rw-r--r--tests/auto/qsystemreadwritelock/tst_qsystemreadwritelock.cpp6
-rw-r--r--tests/auto/qsystemreadwritelock_oop/tst_qsystemreadwritelock_oop.cpp13
-rw-r--r--tests/auto/qvaluespaceprovider/tst_qvaluespaceprovider.cpp2
-rw-r--r--tests/auto/qvaluespacesubscriber/tst_qvaluespacesubscribershared.cpp9
-rw-r--r--tests/auto/qvideowidget/tst_qvideowidget.cpp8
-rw-r--r--tests/auto/support/support_qmf.cpp15
-rw-r--r--tests/auto/support/support_win.cpp12
-rw-r--r--tools/qcrmlgen/qcrmlgen.cpp7
-rw-r--r--tools/tools.pro4
288 files changed, 3844 insertions, 2235 deletions
diff --git a/configure.bat b/configure.bat
index 98d7a24284..f89082e33f 100644
--- a/configure.bat
+++ b/configure.bat
@@ -274,7 +274,7 @@ rd /s /q %BUILD_PATH%\include
mkdir %BUILD_PATH%\include
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\global
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\bearer
-perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\context
+perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\publishsubscribe
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\location
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\serviceframework
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\systeminfo
diff --git a/doc/html/annotated.html b/doc/html/annotated.html
index 15d23aaec3..eb0a9b95c2 100644
--- a/doc/html/annotated.html
+++ b/doc/html/annotated.html
@@ -156,8 +156,8 @@
<tr valign="top" class="even"><th><a href="qsystemnetworkinfo.html">QSystemNetworkInfo</a></th><td>Access to network information from the system</td></tr>
<tr valign="top" class="odd"><th><a href="qsystemscreensaver.html">QSystemScreenSaver</a></th><td>Access to screen saver and blanking</td></tr>
<tr valign="top" class="even"><th><a href="qsystemstorageinfo.html">QSystemStorageInfo</a></th><td>Access to memory and disk information from the system</td></tr>
-<tr valign="top" class="odd"><th><a href="qvaluespaceprovider.html">QValueSpaceProvider</a></th><td>Allows applications to add entries to the Value Space</td></tr>
-<tr valign="top" class="even"><th><a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a></th><td>Access to values stored in the Value Space</td></tr>
+<tr valign="top" class="odd"><th><a href="qvaluespaceprovider.html">QValueSpaceProvider</a></th><td>Allows applications to publish values in the Value Space</td></tr>
+<tr valign="top" class="even"><th><a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a></th><td>Allows applications to read and subscribe to Value Space paths</td></tr>
<tr valign="top" class="odd"><th><a href="qvideodevicecontrol.html">QVideoDeviceControl</a></th><td>Video device selector media control</td></tr>
<tr valign="top" class="even"><th><a href="qvideoencodercontrol.html">QVideoEncoderControl</a></th><td>Access to the settings of a media service that performs video encoding</td></tr>
<tr valign="top" class="odd"><th><a href="qvideoencodersettings.html">QVideoEncoderSettings</a></th><td>Set of video encoder settings</td></tr>
diff --git a/doc/html/publ-subs.html b/doc/html/publ-subs.html
index eb84c390e9..6d4c23d016 100644
--- a/doc/html/publ-subs.html
+++ b/doc/html/publ-subs.html
@@ -38,17 +38,19 @@
<p>Existing values within the Value Space are accessed through the <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> class. This class provides a means to read values, receive change notifications for a given path and navigate through the Value Space.</p>
<p>New values are added to the Value Space via the <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> class. This class allows applications to publish values and receive interest notifications when applications connect to a path. Interest notifications can be used to refrain from updating values in the Value Space when there are no interested parties.</p>
<p>Nodes in the Value Space can be thought of as representing schema objects. Obviously this is a conceptual differentiation and not a physical one, as internally the Value Space is treated as one large tree. By applying structured schema to the space &quot;explore-ability&quot; is increased. For example, the <tt>/Device/Buttons</tt> schema can be defined as containing a value representing the number of mappable buttons on a device, and a sub-item for each adhering to the <tt>MappableButton</tt> schema. The <tt>MappableButton</tt> schema itself may be defined as containing two attributes <tt>Name</tt> and <tt>Usable</tt>. Change notification is modeled in this fashion also. Were the <tt>/Device/Buttons/1/Name</tt> item to change, the <tt>/Device/Buttons/1</tt> item would also be marked as changed, and so on up the tree. This allows, for example, subscription to just <tt>/Device/Buttons</tt> to be notified when anything &quot;button&quot; related changes.</p>
-<p>Internally, the Value Space consists of an arbitrary number of data source trees, or layers, which are stacked on top of each other to form the final unified view. If a &quot;higher&quot; layer contains an item, it shadows the value of items in the layers below it. Consider the Value Space item <tt>/Device/Buttons</tt>. If two layer contained this item, the value in the layer with the higher layer order (see <a href="qabstractvaluespacelayer.html#order">QAbstractValueSpaceLayer::order</a>()) would shadow that with the lower layer order. However, if only the layer with the lower order contained this item, it would be visible through the <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> class, even if the higher order layer contained sub-items such as <tt>/Device/Buttons/1</tt>. That is, layer shadowing occurs by value not by path.</p>
+<p>Internally, the Value Space consists of an arbitrary number of data source trees, or layers, which are stacked on top of each other to form the final unified view. If a &quot;higher&quot; layer contains an item, it shadows the value of items in the layers below it. Consider the Value Space item <tt>/Device/Buttons</tt>. If two layers contained this item, the value in the layer with the higher layer order would shadow that with the lower layer order. However, if only the layer with the lower order contained this item, it would be visible through the <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> class, even if the higher order layer contained sub-items such as <tt>/Device/Buttons/1</tt>. That is, layer shadowing occurs by value not by path.</p>
<p>Layer order is fixed and is defined in the layer implementation.</p>
-<p>The Qt Value Space contains the following layers:</p>
+<p>The following Value Space layers are available:</p>
<p><table class="generic" align="center" cellpadding="2" cellspacing="1" border="0">
<thead><tr valign="top" class="qt-style"><th>Layer</th><th>Description</th></tr></thead>
-<tr valign="top" class="odd"><td><a href="#shared-memory-layer">Shared Memory Layer</a></td><td>The Shared Memory layer provides a non-permanent Value Space backing store using shared memory and local sockets. The Shared Memory layer is only available on Unix platforms.</td></tr>
-<tr valign="top" class="even"><td>Volatile Registry Layer</td><td>The Volatile Registry layer provides a non-permanent Value Space backing store using volatile keys stored in the Windows' registry. The Volatile Registry layer is only available on Windows platforms.</td></tr>
-<tr valign="top" class="odd"><td>Non-volatile Registry Layer</td><td>The Non-volatile Registry layer provides a permanent Value Space backing store using keys stored in the Windows' registry. The Non-volatile Registry layer is only available on Windows platforms.</td></tr>
-<tr valign="top" class="even"><td>ContextKit Layer</td><td>The ContextKit layer provides a non-permanent Value Space backing store using ContextKit. Publishing values to this layer via <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> is currently not supported.</td></tr>
+<tr valign="top" class="odd"><td><a href="#shared-memory-layer">Shared Memory Layer</a></td><td>The Shared Memory layer provides a non-permanent Value Space backing store using shared memory and local sockets. The Shared Memory layer is only available on Unix platforms.<p>The Shared Memory layer has an order of 0x10000000.</p>
+</td></tr>
+<tr valign="top" class="even"><td>Volatile Registry Layer</td><td>The Volatile Registry layer provides a non-permanent Value Space backing store using volatile keys stored in the Windows' registry. The Volatile Registry layer is only available on Windows platforms.<p>The Volatile Registry layer has an order of 0x1000.</p>
+</td></tr>
+<tr valign="top" class="odd"><td>Non-volatile Registry Layer</td><td>The Non-volatile Registry layer provides a permanent Value Space backing store using keys stored in the Windows' registry. The Non-volatile Registry layer is only available on Windows platforms. The Non-volatile Registry layer has an order of 0.</td></tr>
+<tr valign="top" class="even"><td>ContextKit Layer</td><td>The ContextKit layer provides a non-permanent Value Space backing store using ContextKit. Publishing values to this layer via <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> is currently not supported. The ContextKit layer has an order of 0.</td></tr>
</table></p>
-<p>The Qt Value Space has support for both client/server and peer-to-peer layer architectures. If a layer that uses a client/server architecture is used and a server process is not provided by the underlying system it will be necessary to start one. This can be done by calling QValueSpace::initValueSpaceServer() prior to any other use of the Value Space.</p>
+<p>The Value Space has support for both client/server and peer-to-peer layer architectures. If a layer that uses a client/server architecture is used and a server process is not provided by the underlying system it will be necessary to start one. This can be done by calling QValueSpace::initValueSpaceServer() prior to any other use of the Value Space.</p>
<a name="detailed-layer-descriptions"></a>
<h3>Detailed Layer Descriptions</h3>
<a name="shared-memory-layer"></a>
@@ -61,17 +63,17 @@
<h3>Examples</h3>
<a name="publish-and-subscribe"></a>
<h4>Publish and Subscribe</h4>
-<p>In the example <a href="publish-subscribe.html">Publish and Subscribe</a> the Qt Value Space is used as a method of communicating changes in one dialog (the provider) to another dialog (the consumer).</p>
+<p>In the example <a href="publish-subscribe.html">Publish and Subscribe</a> the Value Space is used as a method of communicating changes in one dialog (the provider) to another dialog (the consumer).</p>
<a name="battery-charging-accessing-publish-and-subscribe-from-qml"></a>
<h4>Battery Charging - Accessing Publish and Subscribe from QML</h4>
-<p>In the example <a href="battery-charge.html">Accessing Publish and Subscribe from QML</a> the Publish and Subscribe concept is now extended to make the provider an input of the level of charge in a battery. A slider on the provider dialog represents the modifiable level of charge. The Qt Value Space acts as a communications medium between the provider dialog and the consumer graphical battery animation. The battery is implemented in QML and C++ with Qt Value Space supplying the charge level for the animation to represent.</p>
+<p>In the example <a href="battery-charge.html">Accessing Publish and Subscribe from QML</a> the Publish and Subscribe concept is now extended to make the provider an input of the level of charge in a battery. A slider on the provider dialog represents the modifiable level of charge. The Value Space acts as a communications medium between the provider dialog and the consumer graphical battery animation. The battery is implemented in QML and C++ with Value Space supplying the charge level for the animation to represent.</p>
<a name="namespaces-and-classes"></a>
<h3>Namespaces and Classes</h3>
<p><table width="100%" class="annotated" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><th><a href="qabstractvaluespacelayer.html">QAbstractValueSpaceLayer</a></th><td>Support for adding new logical data layers to the Qt Value Space</td></tr>
-<tr valign="top" class="even"><th><a href="qvaluespace.html">QValueSpace</a></th><td>Methods that are useful to Value Space layer implementors</td></tr>
-<tr valign="top" class="odd"><th><a href="qvaluespaceprovider.html">QValueSpaceProvider</a></th><td>Allows applications to add entries to the Value Space</td></tr>
-<tr valign="top" class="even"><th><a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a></th><td>Access to values stored in the Value Space</td></tr>
+<tr valign="top" class="even"><th><a href="qvaluespace.html">QValueSpace</a></th><td>Contains miscellaneous identifiers used throughtout the Publish and Subscribe API</td></tr>
+<tr valign="top" class="odd"><th><a href="qvaluespaceprovider.html">QValueSpaceProvider</a></th><td>Allows applications to publish values in the Value Space</td></tr>
+<tr valign="top" class="even"><th><a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a></th><td>Allows applications to read and subscribe to Value Space paths</td></tr>
</table></p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
diff --git a/doc/html/qabstractvaluespacelayer.html b/doc/html/qabstractvaluespacelayer.html
index 4be686d2bc..7d42a1c031 100644
--- a/doc/html/qabstractvaluespacelayer.html
+++ b/doc/html/qabstractvaluespacelayer.html
@@ -93,7 +93,7 @@
<hr />
<h2>Member Type Documentation</h2>
<h3 class="fn"><a name="Handle-typedef"></a>typedef QAbstractValueSpaceLayer::Handle</h3>
-<p>The Handle type is an opaque, pointer sized contextual handle used to represent paths within value space layers. Handles are only ever created by <a href="qabstractvaluespacelayer.html#item">QAbstractValueSpaceLayer::item</a>() and are always released by calls to <a href="qabstractvaluespacelayer.html#removeHandle">QAbstractValueSpaceLayer::removeHandle</a>(). The special value, <tt>InvalidHandle</tt> is reserved to represent an invalid handle.</p>
+<p>The Handle type is an opaque, pointer sized contextual handle used to represent paths within Value Space layers. Handles are only ever created by <a href="qabstractvaluespacelayer.html#item">QAbstractValueSpaceLayer::item</a>() and are always released by calls to <a href="qabstractvaluespacelayer.html#removeHandle">QAbstractValueSpaceLayer::removeHandle</a>(). The special value, <tt>InvalidHandle</tt> is reserved to represent an invalid handle.</p>
<h3 class="fn"><a name="Properties-enum"></a>enum QAbstractValueSpaceLayer::Properties</h3>
<p>To allow for efficient layer implementations, expensive handle operations, currently only monitoring for changes, are enabled and disabled as needed on a per-handle basis. The Properties enumeration is a bitmask representing the different properties that can exist on a handle.</p>
<p><table class="valuelist" border="1" cellpadding="2" cellspacing="1" width="100%">
@@ -101,7 +101,7 @@
<tr><td valign="top"><tt>QAbstractValueSpaceLayer::Publish</tt></td><td align="center" valign="top"><tt>0x00000001</tt></td><td valign="top">Enable change notification for the handle. When set, the layer should emit <a href="qabstractvaluespacelayer.html#handleChanged">QAbstractValueSpaceLayer::handleChanged</a>() signals when appropriate for the handle.</td></tr>
</table></p>
<h3 class="fn"><a name="Type-enum"></a>enum QAbstractValueSpaceLayer::Type</h3>
-<p>Value Space layers are initialized in either a &quot;Server&quot; or a &quot;Client&quot; context. There is only a single server in the value space architecture, and its layers are always initialized before any clients. This distinction allows layers to implement Client/Server architecture <i>if required</i>. If not, layers are free to treat Server and Client contexts identically.</p>
+<p>Value Space layers are initialized in either a &quot;Server&quot; or a &quot;Client&quot; context. There is only a single server in the Value Space architecture, and its layers are always initialized before any clients. This distinction allows layers to implement Client/Server architecture <i>if required</i>. If not, layers are free to treat Server and Client contexts identically.</p>
<p><table class="valuelist" border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QAbstractValueSpaceLayer::Server</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The layer is being initialized in the &quot;server&quot; context.</td></tr>
@@ -144,7 +144,7 @@
<p>Process calls to QValueSpaceProvider::~QValueSpaceProvider() by removing the entire sub tree created by <i>creator</i> under <i>handle</i>.</p>
<p>Returns true on success; otherwise returns false.</p>
<h3 class="fn"><a name="removeValue"></a>bool QAbstractValueSpaceLayer::removeValue ( <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> * <i>creator</i>, <a href="qabstractvaluespacelayer.html#Handle-typedef">Handle</a> <i>handle</i>, const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>subPath</i> )&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
-<p>Process calls to <a href="qvaluespaceprovider.html#removeAttribute">QValueSpaceProvider::removeAttribute</a>() by removing the value space item identified by <i>handle</i> and <i>subPath</i> and created by <i>creator</i>.</p>
+<p>Process calls to <a href="qvaluespaceprovider.html#removeAttribute">QValueSpaceProvider::removeAttribute</a>() by removing the Value Space item identified by <i>handle</i> and <i>subPath</i> and created by <i>creator</i>.</p>
<p>Returns true on success; otherwise returns false.</p>
<h3 class="fn"><a name="removeWatches"></a>void QAbstractValueSpaceLayer::removeWatches ( <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> * <i>creator</i>, <a href="qabstractvaluespacelayer.html#Handle-typedef">Handle</a> <i>parent</i> )&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Removes all registered change notifications for <i>creator</i> under <i>parent</i>.</p>
@@ -152,7 +152,7 @@
<h3 class="fn"><a name="setProperty"></a>void QAbstractValueSpaceLayer::setProperty ( <a href="qabstractvaluespacelayer.html#Handle-typedef">Handle</a> <i>handle</i>, <a href="qabstractvaluespacelayer.html#Properties-enum">Properties</a> <i>property</i> )&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Apply the specified <i>property</i> mask to <i>handle</i>.</p>
<h3 class="fn"><a name="setValue"></a>bool QAbstractValueSpaceLayer::setValue ( <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> * <i>creator</i>, <a href="qabstractvaluespacelayer.html#Handle-typedef">Handle</a> <i>handle</i>, const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>subPath</i>, const <a href="http://qt.nokia.com/doc/4.5/qvariant.html">QVariant</a> &amp; <i>value</i> )&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
-<p>Process calls to <a href="qvaluespaceprovider.html#setAttribute">QValueSpaceProvider::setAttribute</a>() by setting the value specified by the <i>subPath</i> under <i>handle</i> to <i>value</i>. Ownership of the value space item is assigned to <i>creator</i>.</p>
+<p>Process calls to <a href="qvaluespaceprovider.html#setAttribute">QValueSpaceProvider::setAttribute</a>() by setting the value specified by the <i>subPath</i> under <i>handle</i> to <i>value</i>. Ownership of the Value Space item is assigned to <i>creator</i>.</p>
<p>Returns true on success; otherwise returns false.</p>
<p>See also <a href="qabstractvaluespacelayer.html#value">value</a>().</p>
<h3 class="fn"><a name="startup"></a>bool QAbstractValueSpaceLayer::startup ( <a href="qabstractvaluespacelayer.html#Type-enum">Type</a> <i>type</i> )&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
@@ -170,7 +170,7 @@
<hr />
<h2>Macro Documentation</h2>
<h3 class="fn"><a name="QVALUESPACE_AUTO_INSTALL_LAYER"></a>QVALUESPACE_AUTO_INSTALL_LAYER ( <i>className</i> )</h3>
-<p>This macro installs new value space layer. <i>className</i> is the name of the class implementing the new layer.</p>
+<p>This macro installs new Value Space layer. <i>className</i> is the name of the class implementing the new layer.</p>
<p>The method <tt>className *className::instance()</tt> must exist and return a pointer to an instance of the layer to install. This method will only be invoked <i>after</i> <a href="http://qt.nokia.com/doc/4.5/qapplication.html">QApplication</a> has been constructed, making it safe to use any Qt class in your layer's constructor.</p>
<p>This macro can only be used once for any given class and it should be used where the implementation is written rather than in a header file.</p>
<p /><address><hr /><div align="center">
diff --git a/doc/html/qt-mobility-library.dcf b/doc/html/qt-mobility-library.dcf
index f30de07fce..4281c0e81e 100644
--- a/doc/html/qt-mobility-library.dcf
+++ b/doc/html/qt-mobility-library.dcf
@@ -2877,9 +2877,9 @@
<keyword ref="qvaluespace.html#LayerOption-enum">LayerOption</keyword>
<keyword ref="qvaluespace.html#LayerOption-enum">LayerOptions</keyword>
<keyword ref="qvaluespace.html#LayerOption-enum">QValueSpace::UnspecifiedLayer</keyword>
- <keyword ref="qvaluespace.html#LayerOption-enum">QValueSpace::WriteableLayer</keyword>
<keyword ref="qvaluespace.html#LayerOption-enum">QValueSpace::PermanentLayer</keyword>
- <keyword ref="qvaluespace.html#LayerOption-enum">QValueSpace::NonWriteableLayer</keyword>
+ <keyword ref="qvaluespace.html#LayerOption-enum">QValueSpace::WritableLayer</keyword>
+ <keyword ref="qvaluespace.html#LayerOption-enum">QValueSpace::NonWritableLayer</keyword>
<keyword ref="qvaluespace.html#LayerOption-enum">QValueSpace::NonPermanentLayer</keyword>
<keyword ref="qvaluespace.html#QVALUESPACE_CONTEXTKIT_LAYER">QVALUESPACE_CONTEXTKIT_LAYER</keyword>
<keyword ref="qvaluespace.html#QVALUESPACE_NONVOLATILEREGISTRY_LAYER">QVALUESPACE_NONVOLATILEREGISTRY_LAYER</keyword>
diff --git a/doc/html/qt-mobility-library.index b/doc/html/qt-mobility-library.index
index 3971e5d10b..5069e4d23a 100644
--- a/doc/html/qt-mobility-library.index
+++ b/doc/html/qt-mobility-library.index
@@ -200,8 +200,8 @@
<value name="UnspecifiedLayer" value="0x0000"/>
<value name="PermanentLayer" value="0x0001"/>
<value name="NonPermanentLayer" value="0x0002"/>
- <value name="WriteableLayer" value="0x0004"/>
- <value name="NonWriteableLayer" value="0x0008"/>
+ <value name="WritableLayer" value="0x0004"/>
+ <value name="NonWritableLayer" value="0x0008"/>
</enum>
<typedef access="public" threadsafety="unspecified" status="commendable" name="LayerOptions" fullname="QValueSpace::LayerOptions" href="qvaluespace.html#LayerOptions-typedef" location="qvaluespace.h" enum="QValueSpace::LayerOption"/>
</namespace>
@@ -4470,21 +4470,21 @@
<parameter left="const QString &amp;" right="" name="path" default=""/>
<parameter left="QObject *" right="" name="parent" default="0"/>
</function>
- <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceProvider" fullname="QValueSpaceProvider::QValueSpaceProvider" href="qvaluespaceprovider.html#QValueSpaceProvider-2" location="qvaluespaceprovider.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="2" type="" signature="QValueSpaceProvider(const char * path, QObject * parent)">
+ <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceProvider" fullname="QValueSpaceProvider::QValueSpaceProvider" href="qvaluespaceprovider.html#QValueSpaceProvider-4" location="qvaluespaceprovider.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="4" type="" signature="QValueSpaceProvider(const char * path, QObject * parent)">
<parameter left="const char *" right="" name="path" default=""/>
<parameter left="QObject *" right="" name="parent" default="0"/>
</function>
- <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceProvider" fullname="QValueSpaceProvider::QValueSpaceProvider" href="qvaluespaceprovider.html#QValueSpaceProvider-3" location="qvaluespaceprovider.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="3" type="" signature="QValueSpaceProvider(const QString &amp; path, QFlags&lt;QValueSpace::LayerOption&gt; filter, QObject * parent)">
+ <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceProvider" fullname="QValueSpaceProvider::QValueSpaceProvider" href="qvaluespaceprovider.html#QValueSpaceProvider-2" location="qvaluespaceprovider.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="2" type="" signature="QValueSpaceProvider(const QString &amp; path, QFlags&lt;QValueSpace::LayerOption&gt; filter, QObject * parent)">
<parameter left="const QString &amp;" right="" name="path" default=""/>
<parameter left="QFlags&lt;QValueSpace::LayerOption&gt;" right="" name="filter" default=""/>
<parameter left="QObject *" right="" name="parent" default="0"/>
</function>
- <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceProvider" fullname="QValueSpaceProvider::QValueSpaceProvider" href="qvaluespaceprovider.html#QValueSpaceProvider-4" location="qvaluespaceprovider.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="4" type="" signature="QValueSpaceProvider(const char * path, QFlags&lt;QValueSpace::LayerOption&gt; filter, QObject * parent)">
+ <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceProvider" fullname="QValueSpaceProvider::QValueSpaceProvider" href="qvaluespaceprovider.html#QValueSpaceProvider-5" location="qvaluespaceprovider.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="5" type="" signature="QValueSpaceProvider(const char * path, QFlags&lt;QValueSpace::LayerOption&gt; filter, QObject * parent)">
<parameter left="const char *" right="" name="path" default=""/>
<parameter left="QFlags&lt;QValueSpace::LayerOption&gt;" right="" name="filter" default=""/>
<parameter left="QObject *" right="" name="parent" default="0"/>
</function>
- <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceProvider" fullname="QValueSpaceProvider::QValueSpaceProvider" href="qvaluespaceprovider.html#QValueSpaceProvider-5" location="qvaluespaceprovider.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="5" type="" signature="QValueSpaceProvider(const QString &amp; path, const QUuid &amp; uuid, QObject * parent)">
+ <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceProvider" fullname="QValueSpaceProvider::QValueSpaceProvider" href="qvaluespaceprovider.html#QValueSpaceProvider-3" location="qvaluespaceprovider.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="3" type="" signature="QValueSpaceProvider(const QString &amp; path, const QUuid &amp; uuid, QObject * parent)">
<parameter left="const QString &amp;" right="" name="path" default=""/>
<parameter left="const QUuid &amp;" right="" name="uuid" default=""/>
<parameter left="QObject *" right="" name="parent" default="0"/>
@@ -5646,21 +5646,21 @@
<parameter left="const QString &amp;" right="" name="path" default=""/>
<parameter left="QObject *" right="" name="parent" default="0"/>
</function>
- <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceSubscriber" fullname="QValueSpaceSubscriber::QValueSpaceSubscriber" href="qvaluespacesubscriber.html#QValueSpaceSubscriber-3" location="qvaluespacesubscriber.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="3" type="" signature="QValueSpaceSubscriber(const char * path, QObject * parent)">
+ <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceSubscriber" fullname="QValueSpaceSubscriber::QValueSpaceSubscriber" href="qvaluespacesubscriber.html#QValueSpaceSubscriber-5" location="qvaluespacesubscriber.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="5" type="" signature="QValueSpaceSubscriber(const char * path, QObject * parent)">
<parameter left="const char *" right="" name="path" default=""/>
<parameter left="QObject *" right="" name="parent" default="0"/>
</function>
- <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceSubscriber" fullname="QValueSpaceSubscriber::QValueSpaceSubscriber" href="qvaluespacesubscriber.html#QValueSpaceSubscriber-4" location="qvaluespacesubscriber.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="4" type="" signature="QValueSpaceSubscriber(const QString &amp; path, QFlags&lt;QValueSpace::LayerOption&gt; filter, QObject * parent)">
+ <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceSubscriber" fullname="QValueSpaceSubscriber::QValueSpaceSubscriber" href="qvaluespacesubscriber.html#QValueSpaceSubscriber-3" location="qvaluespacesubscriber.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="3" type="" signature="QValueSpaceSubscriber(const QString &amp; path, QFlags&lt;QValueSpace::LayerOption&gt; filter, QObject * parent)">
<parameter left="const QString &amp;" right="" name="path" default=""/>
<parameter left="QFlags&lt;QValueSpace::LayerOption&gt;" right="" name="filter" default=""/>
<parameter left="QObject *" right="" name="parent" default="0"/>
</function>
- <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceSubscriber" fullname="QValueSpaceSubscriber::QValueSpaceSubscriber" href="qvaluespacesubscriber.html#QValueSpaceSubscriber-5" location="qvaluespacesubscriber.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="5" type="" signature="QValueSpaceSubscriber(const char * path, QFlags&lt;QValueSpace::LayerOption&gt; filter, QObject * parent)">
+ <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceSubscriber" fullname="QValueSpaceSubscriber::QValueSpaceSubscriber" href="qvaluespacesubscriber.html#QValueSpaceSubscriber-6" location="qvaluespacesubscriber.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="6" type="" signature="QValueSpaceSubscriber(const char * path, QFlags&lt;QValueSpace::LayerOption&gt; filter, QObject * parent)">
<parameter left="const char *" right="" name="path" default=""/>
<parameter left="QFlags&lt;QValueSpace::LayerOption&gt;" right="" name="filter" default=""/>
<parameter left="QObject *" right="" name="parent" default="0"/>
</function>
- <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceSubscriber" fullname="QValueSpaceSubscriber::QValueSpaceSubscriber" href="qvaluespacesubscriber.html#QValueSpaceSubscriber-6" location="qvaluespacesubscriber.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="6" type="" signature="QValueSpaceSubscriber(const QString &amp; path, const QUuid &amp; uuid, QObject * parent)">
+ <function access="public" threadsafety="unspecified" status="commendable" name="QValueSpaceSubscriber" fullname="QValueSpaceSubscriber::QValueSpaceSubscriber" href="qvaluespacesubscriber.html#QValueSpaceSubscriber-4" location="qvaluespacesubscriber.h" virtual="non" meta="constructor" const="false" static="false" overload="true" overload-number="4" type="" signature="QValueSpaceSubscriber(const QString &amp; path, const QUuid &amp; uuid, QObject * parent)">
<parameter left="const QString &amp;" right="" name="path" default=""/>
<parameter left="const QUuid &amp;" right="" name="uuid" default=""/>
<parameter left="QObject *" right="" name="parent" default="0"/>
diff --git a/doc/html/qtmobility.qhp b/doc/html/qtmobility.qhp
index 97c1a05562..9ba8560c29 100644
--- a/doc/html/qtmobility.qhp
+++ b/doc/html/qtmobility.qhp
@@ -2863,8 +2863,8 @@
<keyword name="QValueSpace::UnspecifiedLayer" id="QValueSpace::UnspecifiedLayer" ref="qvaluespace.html#LayerOption-enum"/>
<keyword name="QValueSpace::PermanentLayer" id="QValueSpace::PermanentLayer" ref="qvaluespace.html#LayerOption-enum"/>
<keyword name="QValueSpace::NonPermanentLayer" id="QValueSpace::NonPermanentLayer" ref="qvaluespace.html#LayerOption-enum"/>
- <keyword name="QValueSpace::WriteableLayer" id="QValueSpace::WriteableLayer" ref="qvaluespace.html#LayerOption-enum"/>
- <keyword name="QValueSpace::NonWriteableLayer" id="QValueSpace::NonWriteableLayer" ref="qvaluespace.html#LayerOption-enum"/>
+ <keyword name="QValueSpace::WritableLayer" id="QValueSpace::WritableLayer" ref="qvaluespace.html#LayerOption-enum"/>
+ <keyword name="QValueSpace::NonWritableLayer" id="QValueSpace::NonWritableLayer" ref="qvaluespace.html#LayerOption-enum"/>
<keyword name="QValueSpace::LayerOptions" id="QValueSpace::LayerOptions" ref="qvaluespace.html#LayerOption-enum"/>
<keyword name="QValueSpaceProvider" id="QValueSpaceProvider" ref="qvaluespaceprovider.html"/>
<keyword name="attributeInterestChanged" id="QValueSpaceProvider::attributeInterestChanged" ref="qvaluespaceprovider.html#attributeInterestChanged"/>
diff --git a/doc/html/qvaluespace.html b/doc/html/qvaluespace.html
index b0e0bb3784..e948b1baef 100644
--- a/doc/html/qvaluespace.html
+++ b/doc/html/qvaluespace.html
@@ -13,14 +13,14 @@
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qtlogo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot;</td>
<td align="right" valign="top" width="230"><img src="images/codeless.png" border="0" /></td></tr></table><h1 class="title">QValueSpace Namespace Reference</h1>
-<p>The QValueSpace namespace provides methods that are useful to Value Space layer implementors. <a href="#details">More...</a></p>
+<p>The QValueSpace namespace contains miscellaneous identifiers used throughtout the Publish and Subscribe API. <a href="#details">More...</a></p>
<pre> #include &lt;QValueSpace&gt;</pre><ul>
</ul>
<hr />
<a name="types"></a>
<h2>Types</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
-<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qvaluespace.html#LayerOption-enum">LayerOption</a></b> { UnspecifiedLayer, PermanentLayer, NonPermanentLayer, WriteableLayer, NonWriteableLayer }</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qvaluespace.html#LayerOption-enum">LayerOption</a></b> { UnspecifiedLayer, PermanentLayer, NonPermanentLayer, WritableLayer, NonWritableLayer }</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">flags </td><td class="memItemRight" valign="bottom"><b><a href="qvaluespace.html#LayerOption-enum">LayerOptions</a></b></td></tr>
</table>
<hr />
@@ -35,8 +35,7 @@
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
-<p>The QValueSpace namespace provides methods that are useful to Value Space layer implementors.</p>
-<p>Value Space layers that are available at link time can be automatically installed using <a href="qabstractvaluespacelayer.html#QVALUESPACE_AUTO_INSTALL_LAYER">QVALUESPACE_AUTO_INSTALL_LAYER</a>() macro. Value Space layers that are only available at run-time can be installed using installLayer().</p>
+<p>The QValueSpace namespace contains miscellaneous identifiers used throughtout the Publish and Subscribe API.</p>
<hr />
<h2>Type Documentation</h2>
<h3 class="flags"><a name="LayerOption-enum"></a>enum QValueSpace::LayerOption<br />flags QValueSpace::LayerOptions</h3>
@@ -44,30 +43,30 @@
<p><table class="valuelist" border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QValueSpace::UnspecifiedLayer</tt></td><td align="center" valign="top"><tt>0x0000</tt></td><td valign="top">Used as a filter to specify that any layer should be used.</td></tr>
-<tr><td valign="top"><tt>QValueSpace::PermanentLayer</tt></td><td align="center" valign="top"><tt>0x0001</tt></td><td valign="top">Indicates that the layer uses a permanent backing store. When used as a filter only layers that use a permanent backing store will be used.</td></tr>
-<tr><td valign="top"><tt>QValueSpace::NonPermanentLayer</tt></td><td align="center" valign="top"><tt>0x0002</tt></td><td valign="top">Indicates that the layer does not use a permanent backing store. When used as a filter only layers that do not use permanent backing stores will be used.</td></tr>
-<tr><td valign="top"><tt>QValueSpace::WriteableLayer</tt></td><td align="center" valign="top"><tt>0x0004</tt></td><td valign="top">Indicates that the layer can update its contents. When used as a filter only layers that are writeable will be used.</td></tr>
-<tr><td valign="top"><tt>QValueSpace::NonWriteableLayer</tt></td><td align="center" valign="top"><tt>0x0008</tt></td><td valign="top">Indicates that the layer cannot update its contents. When used as a filter only layers that are read-only will be used.</td></tr>
+<tr><td valign="top"><tt>QValueSpace::PermanentLayer</tt></td><td align="center" valign="top"><tt>0x0001</tt></td><td valign="top">Indicates that the layer uses a permanent backing store. When used as a filter only layers that use a permanent backing store will be used. <br/> Values stored in a layer with this option will persist with in the layer after the <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> that published them is destroyed. Whether the value persists in the layer after the server or device is restarted is system dependent. <br/> This option and the NonPermanentLayer option are mutually exclusive.</td></tr>
+<tr><td valign="top"><tt>QValueSpace::NonPermanentLayer</tt></td><td align="center" valign="top"><tt>0x0002</tt></td><td valign="top">Indicates that the layer does not use a permanent backing store. When used as a filter only layers that do not use permanent backing stores will be used. <br/> Values stored in a layer with this option will be removed when the <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> that published them is destroyed. <br/> This option and the PermanentLayer option are mutually exclusive.</td></tr>
+<tr><td valign="top"><tt>QValueSpace::WritableLayer</tt></td><td align="center" valign="top"><tt>0x0004</tt></td><td valign="top">Indicates that the layer can update its contents. When used as a filter only layers that are writable will be used. <br/> Applications can use <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> to publish values to layers that have this option. <br/> This option and the NonWritableLayer option are mutually exclusive.</td></tr>
+<tr><td valign="top"><tt>QValueSpace::NonWritableLayer</tt></td><td align="center" valign="top"><tt>0x0008</tt></td><td valign="top">Indicates that the layer cannot update its contents. When used as a filter only layers that are read-only will be used. <br/> Applications can not publish values to layers with this option. <br/> This option and the WritableLayer option are mutually exclusive.</td></tr>
</table></p>
<p>The LayerOptions type is a typedef for <a href="qflags.html">QFlags</a>&lt;LayerOption&gt;. It stores an OR combination of LayerOption values.</p>
<hr />
<h2>Macro Documentation</h2>
<h3 class="fn"><a name="QVALUESPACE_CONTEXTKIT_LAYER"></a>QVALUESPACE_CONTEXTKIT_LAYER</h3>
-<p>The UUID of the ContextKit Layer as a <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a>. The actual UUID values is {2c769b9e-d949-4cd1-848f-d32241fe07ff}.</p>
-<p>This values can be passed to the constructor of <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> to force the constructed value space provider to publish its values in the ContextKit Layer.</p>
-<p>You can test if the ContextKit Layer is available by checking if the list returned by QValueSpace::availableLayers() contains this value.</p>
+<p>The UUID of the ContextKit layer as a <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a>. The actual UUID values is {2c769b9e-d949-4cd1-848f-d32241fe07ff}.</p>
+<p>This value can be passed to the constructor of <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> or <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> to force the constructed object to only access the ContextKit layer.</p>
+<p>You can test if the ContextKit layer is available by checking if the list returned by QValueSpace::availableLayers() contains this value.</p>
<h3 class="fn"><a name="QVALUESPACE_NONVOLATILEREGISTRY_LAYER"></a>QVALUESPACE_NONVOLATILEREGISTRY_LAYER</h3>
-<p>The UUID of the Non-Volatile Registry Layer as a <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a>. The actual UUID value is {8e29561c-a0f0-4e89-ba56-080664abc017}.</p>
-<p>This value can be passed to the constructor of <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> to force the constructed value space provider to publish its values in the Non-Volatile Registry Layer.</p>
-<p>You can test if the Non-Volatile Registry Layer is available by checking if the list returned by QValueSpace::availableLayers() contains this value. The Non-Volatile Registry Layer is only available on Windows platforms.</p>
+<p>The UUID of the Non-Volatile Registry layer as a <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a>. The actual UUID value is {8e29561c-a0f0-4e89-ba56-080664abc017}.</p>
+<p>This value can be passed to the constructor of <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> or <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> to force the constructed object to only access the Non-Volatile Registry layer.</p>
+<p>You can test if the Non-Volatile Registry layer is available by checking if the list returned by QValueSpace::availableLayers() contains this value. The Non-Volatile Registry layer is only available on Windows platforms.</p>
<h3 class="fn"><a name="QVALUESPACE_SHAREDMEMORY_LAYER"></a>QVALUESPACE_SHAREDMEMORY_LAYER</h3>
-<p>The UUID of the Shared Memory Layer as a <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a>. The actual UUID value is {d81199c1-6f60-4432-934e-0ce4d37ef252}.</p>
-<p>This value can be passed to the constructor of <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> to force the constructed value space provider to publish its values in the Shared Memory Layer.</p>
-<p>You can test if the Shared Memory Layer is available by checking if the list returned by QValueSpace::availableLayers() contains this value.</p>
+<p>The UUID of the Shared Memory layer as a <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a>. The actual UUID value is {d81199c1-6f60-4432-934e-0ce4d37ef252}.</p>
+<p>This value can be passed to the constructor of <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> or <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> to force the constructed object to only access the Shared Memory layer.</p>
+<p>You can test if the Shared Memory layer is available by checking if the list returned by QValueSpace::availableLayers() contains this value.</p>
<h3 class="fn"><a name="QVALUESPACE_VOLATILEREGISTRY_LAYER"></a>QVALUESPACE_VOLATILEREGISTRY_LAYER</h3>
-<p>The UUID of the Volatile Registry Layer as a <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a>. The actual UUID value is {8ceb5811-4968-470f-8fc2-264767e0bbd9}.</p>
-<p>This value can be passed to the constructor of <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> to force the constructed value space provider to publish its values in the Volatile Registry Layer.</p>
-<p>You can test if the Volatile Registry Layer is available by checking if the list returned by QValueSpace::availableLayers() contains this value. The Volatile Registry Layer is only available on Windows platforms.</p>
+<p>The UUID of the Volatile Registry layer as a <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a>. The actual UUID value is {8ceb5811-4968-470f-8fc2-264767e0bbd9}.</p>
+<p>This value can be passed to the constructor of <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> or <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> to force the constructed object to only access the Volatile Registry layer.</p>
+<p>You can test if the Volatile Registry layer is available by checking if the list returned by QValueSpace::availableLayers() contains this value. The Volatile Registry layer is only available on Windows platforms.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
diff --git a/doc/html/qvaluespaceprovider-members.html b/doc/html/qvaluespaceprovider-members.html
index 6b6872aa77..bd87832c4e 100644
--- a/doc/html/qvaluespaceprovider-members.html
+++ b/doc/html/qvaluespaceprovider-members.html
@@ -17,10 +17,10 @@
<p><table class="propsummary" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="45%" valign="top"><ul>
<li><div class="fn"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider">QValueSpaceProvider</a></b> ( const QString &amp;, QObject * )</div></li>
-<li><div class="fn"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-2">QValueSpaceProvider</a></b> ( const char *, QObject * )</div></li>
-<li><div class="fn"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-3">QValueSpaceProvider</a></b> ( const QString &amp;, QValueSpace::LayerOptions, QObject * )</div></li>
-<li><div class="fn"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-4">QValueSpaceProvider</a></b> ( const char *, QValueSpace::LayerOptions, QObject * )</div></li>
-<li><div class="fn"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-5">QValueSpaceProvider</a></b> ( const QString &amp;, const QUuid &amp;, QObject * )</div></li>
+<li><div class="fn"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-2">QValueSpaceProvider</a></b> ( const QString &amp;, QValueSpace::LayerOptions, QObject * )</div></li>
+<li><div class="fn"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-3">QValueSpaceProvider</a></b> ( const QString &amp;, const QUuid &amp;, QObject * )</div></li>
+<li><div class="fn"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-4">QValueSpaceProvider</a></b> ( const char *, QObject * )</div></li>
+<li><div class="fn"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-5">QValueSpaceProvider</a></b> ( const char *, QValueSpace::LayerOptions, QObject * )</div></li>
<li><div class="fn"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-6">QValueSpaceProvider</a></b> ( const char *, const QUuid &amp;, QObject * )</div></li>
<li><div class="fn"><b><a href="qvaluespaceprovider.html#dtor.QValueSpaceProvider">~QValueSpaceProvider</a></b> ()</div></li>
<li><div class="fn"><b><a href="qvaluespaceprovider.html#attributeInterestChanged">attributeInterestChanged</a></b> ( const QString &amp;, bool )</div></li>
diff --git a/doc/html/qvaluespaceprovider.html b/doc/html/qvaluespaceprovider.html
index f328440e61..c0dc8a7cb5 100644
--- a/doc/html/qvaluespaceprovider.html
+++ b/doc/html/qvaluespaceprovider.html
@@ -13,7 +13,7 @@
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qtlogo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot;</td>
<td align="right" valign="top" width="230"><img src="images/codeless.png" border="0" /></td></tr></table><h1 class="title">QValueSpaceProvider Class Reference</h1>
-<p>The QValueSpaceProvider class allows applications to add entries to the Value Space. <a href="#details">More...</a></p>
+<p>The QValueSpaceProvider class allows applications to publish values in the Value Space. <a href="#details">More...</a></p>
<pre> #include &lt;QValueSpaceProvider&gt;</pre><p>Inherits <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a>.</p>
<ul>
<li><a href="qvaluespaceprovider-members.html">List of all members, including inherited members</a></li>
@@ -23,10 +23,10 @@
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider">QValueSpaceProvider</a></b> ( const QString &amp; <i>path</i>, QObject * <i>parent</i> = 0 )</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-2">QValueSpaceProvider</a></b> ( const char * <i>path</i>, QObject * <i>parent</i> = 0 )</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-3">QValueSpaceProvider</a></b> ( const QString &amp; <i>path</i>, QValueSpace::LayerOptions <i>filter</i>, QObject * <i>parent</i> = 0 )</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-4">QValueSpaceProvider</a></b> ( const char * <i>path</i>, QValueSpace::LayerOptions <i>filter</i>, QObject * <i>parent</i> = 0 )</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-5">QValueSpaceProvider</a></b> ( const QString &amp; <i>path</i>, const QUuid &amp; <i>uuid</i>, QObject * <i>parent</i> = 0 )</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-2">QValueSpaceProvider</a></b> ( const QString &amp; <i>path</i>, QValueSpace::LayerOptions <i>filter</i>, QObject * <i>parent</i> = 0 )</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-3">QValueSpaceProvider</a></b> ( const QString &amp; <i>path</i>, const QUuid &amp; <i>uuid</i>, QObject * <i>parent</i> = 0 )</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-4">QValueSpaceProvider</a></b> ( const char * <i>path</i>, QObject * <i>parent</i> = 0 )</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-5">QValueSpaceProvider</a></b> ( const char * <i>path</i>, QValueSpace::LayerOptions <i>filter</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespaceprovider.html#QValueSpaceProvider-6">QValueSpaceProvider</a></b> ( const char * <i>path</i>, const QUuid &amp; <i>uuid</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><b><a href="qvaluespaceprovider.html#dtor.QValueSpaceProvider">~QValueSpaceProvider</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qvaluespaceprovider.html#isConnected">isConnected</a></b> () const</td></tr>
@@ -85,9 +85,10 @@
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
-<p>The QValueSpaceProvider class allows applications to add entries to the Value Space.</p>
-<p>For an overview of the Qt Value Space, please see the <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> documentation.</p>
-<p>The QValueSpaceProvider class allows applications to write entries into the Value Space that are automatically removed when the QValueSpaceProvider is destroyed, or the application exits either cleanly or abnormally. All applications in the system will have access to the data set through QValueSpaceProvider and, if desired, can be notified when the data changes.</p>
+<p>The QValueSpaceProvider class allows applications to publish values in the Value Space.</p>
+<p>When multiple Value Space layers are available QValueSpaceProvider only publishes values to the layer with the highest order. The layers that QValueSpaceProvider can access can be limited by specifying either a <a href="qvaluespace.html#LayerOption-enum">filter</a> or a <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a> at construction time.</p>
+<p>The lifetime of values published in the Value Space is specified by the particular Value Space layer that the value is published in. For details on the different behaviors see <a href="qvaluespace.html#LayerOption-enum">QValueSpace::LayerOption</a>.</p>
+<p>Once a value is published all applications in the system will have read access to it via the <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> class.</p>
<p>Although, logically, the Value Space is a simple collection of hierarchical paths, these paths can conceptually be visualized as a set of objects with attributes. For example, rather than viewing the following list as 12 distinct Value Space paths:</p>
<pre> /Device/Network/Interfaces/eth0/Name
/Device/Network/Interfaces/eth0/Type
@@ -102,56 +103,39 @@
/Device/Network/Interfaces/ppp0/BytesReceived
/Device/Network/Interfaces/ppp0/Time</pre>
<p>it can be thought of as describing two Value Space objects, <tt>{ /Device/Network/Interfaces/eth0, /Device/Network/Interfaces/ppp0 }</tt>, each with the six attributes <tt>{Name, Type, Status, BytesSent, BytesReceived, Time}</tt>. The QValueSpaceProvider class encapsulates this abstraction.</p>
-<p>In the case of two or more applications creating an application object with overlapping attributes, only the first is visible to observers in the system. The other attributes are not discarded, but are buffered until the first releases its hold on the attribute, either by manually removing it, destroying the QValueSpaceProvider or by terminating. For example:</p>
-<pre> QValueSpaceProvider *object1 = new QValueSpaceProvider(&quot;/Device&quot;);
- object1-&gt;setAttribute(&quot;Buttons&quot;, 2);
-
-<span class="comment"> // QValueSpaceSubscriber(&quot;/Device/Buttons&quot;).value() == QVariant(2)</span>
-
- QValueSpaceProvider *object2 = new QValueSpaceProvider(&quot;/Device&quot;);
- object2-&gt;setAttribute(&quot;Buttons&quot;, 3);
-
-<span class="comment"> // QValueSpaceSubscriber(&quot;/Device/Buttons&quot;).value() == QVariant(2)</span>
-
- object2-&gt;removeAttribute(&quot;Buttons&quot;);
-<span class="comment"> // QValueSpaceSubscriber(&quot;/Device/Buttons&quot;).value() == QVariant(3)</span></pre>
-<p>For performance reasons the setting of and removing of attributes is buffered internally by the QValueSpaceProvider and applied as a batch sometime later. Normally this occurs the next time the application enters the Qt event loop, but this behavior should not be relied upon. If an application must synchronize application objects with others, the <a href="qvaluespaceprovider.html#sync">QValueSpaceProvider::sync</a>() method can be used to force the application of changes. This call is generally unnecessary, and should be used sparingly to prevent unnecessary load on the system.</p>
-<p><i>Note:</i> The QValueSpaceProvider class is not thread safe and may only be used from an application's main thread.</p>
+<p>For performance reasons the setting of and removing of attributes is buffered internally by the QValueSpaceProvider and applied as a batch sometime later. Normally this occurs the next time the application enters the Qt event loop, but this behavior should not be relied upon. If an application must synchronize with others, the <a href="qvaluespaceprovider.html#sync">QValueSpaceProvider::sync</a>() and <a href="qvaluespaceprovider.html#syncAll">QValueSpaceProvider::syncAll</a>() functions can be used to force the application of changes. This call is generally unnecessary, and should be used sparingly to prevent unnecessary load on the system.</p>
<p>See also <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QValueSpaceProvider"></a>QValueSpaceProvider::QValueSpaceProvider ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>path</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
-<p>This is an overloaded function.</p>
-<p>Constructs a <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> with the specified <i>parent</i> that publishes values under <i>path</i>. This constructor is equivalent to calling <tt>QValueSpaceSubscriber(path.toUtf8(), parent)</tt>.</p>
-<h3 class="fn"><a name="QValueSpaceProvider-2"></a>QValueSpaceProvider::QValueSpaceProvider ( const char * <i>path</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
-<p>This is an overloaded function.</p>
-<p>Constructs a <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> with the specified <i>parent</i> that publishes values under <i>path</i>. This constructor is equivalent to calling <tt>QValueSpaceSubscriber(QString(path), parent)</tt>.</p>
-<h3 class="fn"><a name="QValueSpaceProvider-3"></a>QValueSpaceProvider::QValueSpaceProvider ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>path</i>, <a href="qvaluespace.html#LayerOption-enum">QValueSpace::LayerOptions</a> <i>filter</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
-<p>This is an overloaded function.</p>
-<p>Constructs a <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> with the specified <i>parent</i> that publishes values under <i>path</i>. The <i>filter</i> parameter is used to limit which layer this <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> will access. This constructor is equivalent to calling <tt>QValueSpaceProvider(path.toUtf8(), filter, parent)</tt>.</p>
-<p>The constructed Value Space provier will access the <a href="qabstractvaluespacelayer.html">layer</a> with the highest <a href="qabstractvaluespacelayer.html#order">order</a> that matches <i>filter</i> and for which <i>path</i> is a valid path.</p>
+<p>Constructs a <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> with the specified <i>parent</i> that publishes values under <i>path</i>.</p>
+<h3 class="fn"><a name="QValueSpaceProvider-2"></a>QValueSpaceProvider::QValueSpaceProvider ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>path</i>, <a href="qvaluespace.html#LayerOption-enum">QValueSpace::LayerOptions</a> <i>filter</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
+<p>Constructs a <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> with the specified <i>parent</i> that publishes values under <i>path</i>. The <i>filter</i> parameter is used to limit which layer this <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> will access.</p>
+<p>The constructed Value Space provider will access the <a href="qabstractvaluespacelayer.html">layer</a> with the highest <a href="qabstractvaluespacelayer.html#order">order</a> that matches <i>filter</i> and for which <i>path</i> is a valid path.</p>
<p>If no suitable <a href="qabstractvaluespacelayer.html">layer</a> is found, the constructed <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> will be unconnected.</p>
<p>See also <a href="qvaluespaceprovider.html#isConnected">isConnected</a>().</p>
-<h3 class="fn"><a name="QValueSpaceProvider-4"></a>QValueSpaceProvider::QValueSpaceProvider ( const char * <i>path</i>, <a href="qvaluespace.html#LayerOption-enum">QValueSpace::LayerOptions</a> <i>filter</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
+<h3 class="fn"><a name="QValueSpaceProvider-3"></a>QValueSpaceProvider::QValueSpaceProvider ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>path</i>, const <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a> &amp; <i>uuid</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
+<p>Constructs a <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> with the specified <i>parent</i> that publishes values under <i>path</i>. Only the layer identified by <i>uuid</i> will be accessed by this provider.</p>
+<p>Use of this constructor is not platform agnostic. If possible use one of the constructors that take a QAbstractValueSpaceLayer::LayerOptions parameter instead.</p>
+<p>If a layer with a matching <i>uuid</i> is not found, the constructed <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> will be unconnected.</p>
+<p>See also <a href="qvaluespaceprovider.html#isConnected">isConnected</a>().</p>
+<h3 class="fn"><a name="QValueSpaceProvider-4"></a>QValueSpaceProvider::QValueSpaceProvider ( const char * <i>path</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
+<p>This is an overloaded function.</p>
+<p>Constructs a <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> with the specified <i>parent</i> that publishes values under <i>path</i>. This constructor is equivalent to calling <tt>QValueSpaceSubscriber(QString::fromLatin1(path), parent)</tt>.</p>
+<h3 class="fn"><a name="QValueSpaceProvider-5"></a>QValueSpaceProvider::QValueSpaceProvider ( const char * <i>path</i>, <a href="qvaluespace.html#LayerOption-enum">QValueSpace::LayerOptions</a> <i>filter</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
<p>This is an overloaded function.</p>
<p>Constructs a <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> with the specified <i>parent</i> that publishes values under <i>path</i>. The <i>filter</i> parameter is used to limit which layer this <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> will access. This constructor is equivalent to calling <tt>QValueSpaceProvider(QString::fromLatin1(path), filter, parent)</tt>.</p>
<p>The constructed Value Space provider will access the <a href="qabstractvaluespacelayer.html">layer</a> with the highest <a href="qabstractvaluespacelayer.html#order">order</a> that matches <i>filter</i> and for which <i>path</i> is a valid path.</p>
<p>If no suitable <a href="qabstractvaluespacelayer.html">layer</a> is found, the constructed <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> will be unconnected.</p>
<p>See also <a href="qvaluespaceprovider.html#isConnected">isConnected</a>().</p>
-<h3 class="fn"><a name="QValueSpaceProvider-5"></a>QValueSpaceProvider::QValueSpaceProvider ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>path</i>, const <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a> &amp; <i>uuid</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
-<p>This is an overloaded function.</p>
-<p>Constructs a <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> with the specified <i>parent</i> that publishes values under <i>path</i>. Only the layer identified by <i>uuid</i> will be accessed by this provider. This constructor is equivalent to calling <tt>QValueSpaceProvider(path.toUtf8(), uuid, parent)</tt>.</p>
-<p>Use of this constructor is not platform agnostic. If possible use one of the constructors that take a QAbstractValueSpaceLayer::LayerOptions parameter instead.</p>
-<p>If a layer with a matching <i>uuid</i> is not found, the constructed <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> will be unconnected.</p>
-<p>See also <a href="qvaluespaceprovider.html#isConnected">isConnected</a>().</p>
<h3 class="fn"><a name="QValueSpaceProvider-6"></a>QValueSpaceProvider::QValueSpaceProvider ( const char * <i>path</i>, const <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a> &amp; <i>uuid</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
<p>This is an overloaded function.</p>
-<p>Constructs a <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> with the specified <i>parent</i> that publishes values under <i>path</i>. Only the layer identified by <i>uuid</i> will be accessed by this provider. This constructor is equivalent to calling <tt>QValueSpaceProvider(QString(path), uuid, parent)</tt>.</p>
+<p>Constructs a <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> with the specified <i>parent</i> that publishes values under <i>path</i>. Only the layer identified by <i>uuid</i> will be accessed by this provider. This constructor is equivalent to calling <tt>QValueSpaceProvider(QString::fromLatin1(path), uuid, parent)</tt>.</p>
<p>Use of this constructor is not platform agnostic. If possible use one of the constructors that take a QAbstractValueSpaceLayer::LayerOptions parameter instead.</p>
<p>If a layer with a matching <i>uuid</i> is not found, the constructed <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> will be unconnected.</p>
<p>See also <a href="qvaluespaceprovider.html#isConnected">isConnected</a>().</p>
<h3 class="fn"><a name="dtor.QValueSpaceProvider"></a>QValueSpaceProvider::~QValueSpaceProvider ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
-<p>Destroys the <a href="qvaluespaceprovider.html">QValueSpaceProvider</a>. This will remove the values set by this provider in all <a href="qvaluespace.html#LayerOption-enum">non-permanent</a> layers.</p>
+<p>Destroys the <a href="qvaluespaceprovider.html">QValueSpaceProvider</a>. This will remove all values published by this provider in <a href="qvaluespace.html#LayerOption-enum">non-permanent</a> layers.</p>
<h3 class="fn"><a name="attributeInterestChanged"></a>void QValueSpaceProvider::attributeInterestChanged ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>attribute</i>, bool <i>interested</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>Signal that is emitted when interest in <i>attribute</i> changes. If <i>interested</i> is true at least on <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> is interested in the value of <i>attribute</i>.</p>
<h3 class="fn"><a name="connectNotify"></a>void QValueSpaceProvider::connectNotify ( const char * <i>member</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
@@ -165,7 +149,7 @@
<h3 class="fn"><a name="path"></a><a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> QValueSpaceProvider::path () const</h3>
<p>Returns the path that this <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> refers to.</p>
<h3 class="fn"><a name="removeAttribute"></a>void QValueSpaceProvider::removeAttribute ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>attribute</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
-<p>Removes the proivder <i>attribute</i> and all sub-attributes from the system.</p>
+<p>Removes the provider <i>attribute</i> and all sub-attributes from the system.</p>
<p>For example:</p>
<pre> QValueSpaceProvider provider(&quot;/Device&quot;);
provider.setAttribute(&quot;State&quot;, &quot;Starting&quot;);
@@ -180,9 +164,9 @@
<span class="comment"> // QValueSpaceSubscriber(&quot;/Device/State/Memory&quot;).value() == QVariant();</span></pre>
<h3 class="fn"><a name="removeAttribute-2"></a>void QValueSpaceProvider::removeAttribute ( const char * <i>attribute</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>This is an overloaded function.</p>
-<p>This is a convenience overload and is equivalent to <tt>removeAttribute(QString(attribute))</tt>.</p>
+<p>This is a convenience overload and is equivalent to <tt>removeAttribute(QString::fromLatin1(attribute))</tt>.</p>
<h3 class="fn"><a name="setAttribute"></a>void QValueSpaceProvider::setAttribute ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>attribute</i>, const <a href="http://qt.nokia.com/doc/4.5/qvariant.html">QVariant</a> &amp; <i>data</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
-<p>Set an <i>attribute</i> on the provider to <i>data</i>. If attribute is empty, this call will set the value of this providers path.</p>
+<p>Set <i>attribute</i> on the provider to <i>data</i>. If attribute is empty, this call will set the value of this providers path.</p>
<p>For example:</p>
<pre> QValueSpaceProvider provider(&quot;/Device&quot;);
provider.setAttribute(&quot;State&quot;, &quot;Starting&quot;);
@@ -191,13 +175,16 @@
<span class="comment"> // QValueSpaceSubscriber(&quot;/Device/State&quot;).value() == QVariant(&quot;Starting&quot;)</span></pre>
<h3 class="fn"><a name="setAttribute-2"></a>void QValueSpaceProvider::setAttribute ( const char * <i>attribute</i>, const <a href="http://qt.nokia.com/doc/4.5/qvariant.html">QVariant</a> &amp; <i>data</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>This is an overloaded function.</p>
-<p>This is a convenience overload and is equivalent to <tt>setAttribute(QString(attribute), data)</tt>.</p>
+<p>This is a convenience overload and is equivalent to <tt>setAttribute(QString::fromLatin1(attribute), data)</tt>.</p>
<h3 class="fn"><a name="sync"></a>void QValueSpaceProvider::sync ()</h3>
<p>Forcibly sync all Value Space providers using the same layer as this provider.</p>
+<p>For performance reasons attribute changes are batched internally by <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> instances. In cases where the visibility of changes must be synchronized with other processes, calling this function will flush these batches. By the time this function returns, all other processes in the system will be able to see the attribute changes.</p>
+<p>Generally, calling this function is unnecessary.</p>
+<p>See also <a href="qvaluespaceprovider.html#syncAll">syncAll</a>().</p>
<h3 class="fn"><a name="syncAll"></a>void QValueSpaceProvider::syncAll ()&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Forcibly sync all Value Space providers.</p>
-<p>For performance reasons attribute changes are batched internally by <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> instances. In cases where the visibility of changes must be synchronized with other processes, calling <a href="qvaluespaceprovider.html#sync">QValueSpaceProvider::sync</a>() will flush these batches. By the time syncAll() returns, all other processes in the system will be able to see the attribute changes.</p>
-<p>In the common asynchronous case, calling syncAll() is unnecessary.</p>
+<p>This function is equivalent to calling <a href="qvaluespaceprovider.html#sync">sync</a>() for all Value Space layers.</p>
+<p>Generally, calling this function is unnecessary.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
diff --git a/doc/html/qvaluespacesubscriber-members.html b/doc/html/qvaluespacesubscriber-members.html
index 140d973bf9..09f4716f51 100644
--- a/doc/html/qvaluespacesubscriber-members.html
+++ b/doc/html/qvaluespacesubscriber-members.html
@@ -18,10 +18,10 @@
<tr><td width="45%" valign="top"><ul>
<li><div class="fn"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber">QValueSpaceSubscriber</a></b> ( QObject * )</div></li>
<li><div class="fn"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-2">QValueSpaceSubscriber</a></b> ( const QString &amp;, QObject * )</div></li>
-<li><div class="fn"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-3">QValueSpaceSubscriber</a></b> ( const char *, QObject * )</div></li>
-<li><div class="fn"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-4">QValueSpaceSubscriber</a></b> ( const QString &amp;, QValueSpace::LayerOptions, QObject * )</div></li>
-<li><div class="fn"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-5">QValueSpaceSubscriber</a></b> ( const char *, QValueSpace::LayerOptions, QObject * )</div></li>
-<li><div class="fn"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-6">QValueSpaceSubscriber</a></b> ( const QString &amp;, const QUuid &amp;, QObject * )</div></li>
+<li><div class="fn"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-3">QValueSpaceSubscriber</a></b> ( const QString &amp;, QValueSpace::LayerOptions, QObject * )</div></li>
+<li><div class="fn"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-4">QValueSpaceSubscriber</a></b> ( const QString &amp;, const QUuid &amp;, QObject * )</div></li>
+<li><div class="fn"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-5">QValueSpaceSubscriber</a></b> ( const char *, QObject * )</div></li>
+<li><div class="fn"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-6">QValueSpaceSubscriber</a></b> ( const char *, QValueSpace::LayerOptions, QObject * )</div></li>
<li><div class="fn"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-7">QValueSpaceSubscriber</a></b> ( const char *, const QUuid &amp;, QObject * )</div></li>
<li><div class="fn"><b><a href="qvaluespacesubscriber.html#dtor.QValueSpaceSubscriber">~QValueSpaceSubscriber</a></b> ()</div></li>
<li><div class="fn"><b><a href="http://qt.nokia.com/doc/4.5/qobject.html#blockSignals">blockSignals</a></b> ( bool )</div></li>
diff --git a/doc/html/qvaluespacesubscriber.html b/doc/html/qvaluespacesubscriber.html
index 12119bb395..f6fc6fe245 100644
--- a/doc/html/qvaluespacesubscriber.html
+++ b/doc/html/qvaluespacesubscriber.html
@@ -13,7 +13,7 @@
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qtlogo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot;</td>
<td align="right" valign="top" width="230"><img src="images/codeless.png" border="0" /></td></tr></table><h1 class="title">QValueSpaceSubscriber Class Reference</h1>
-<p>The QValueSpaceSubscriber class provides access to values stored in the Value Space. <a href="#details">More...</a></p>
+<p>The QValueSpaceSubscriber class allows applications to read and subscribe to Value Space paths. <a href="#details">More...</a></p>
<pre> #include &lt;QValueSpaceSubscriber&gt;</pre><p>Inherits <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a>.</p>
<ul>
<li><a href="qvaluespacesubscriber-members.html">List of all members, including inherited members</a></li>
@@ -34,10 +34,10 @@
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber">QValueSpaceSubscriber</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-2">QValueSpaceSubscriber</a></b> ( const QString &amp; <i>path</i>, QObject * <i>parent</i> = 0 )</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-3">QValueSpaceSubscriber</a></b> ( const char * <i>path</i>, QObject * <i>parent</i> = 0 )</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-4">QValueSpaceSubscriber</a></b> ( const QString &amp; <i>path</i>, QValueSpace::LayerOptions <i>filter</i>, QObject * <i>parent</i> = 0 )</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-5">QValueSpaceSubscriber</a></b> ( const char * <i>path</i>, QValueSpace::LayerOptions <i>filter</i>, QObject * <i>parent</i> = 0 )</td></tr>
-<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-6">QValueSpaceSubscriber</a></b> ( const QString &amp; <i>path</i>, const QUuid &amp; <i>uuid</i>, QObject * <i>parent</i> = 0 )</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-3">QValueSpaceSubscriber</a></b> ( const QString &amp; <i>path</i>, QValueSpace::LayerOptions <i>filter</i>, QObject * <i>parent</i> = 0 )</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-4">QValueSpaceSubscriber</a></b> ( const QString &amp; <i>path</i>, const QUuid &amp; <i>uuid</i>, QObject * <i>parent</i> = 0 )</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-5">QValueSpaceSubscriber</a></b> ( const char * <i>path</i>, QObject * <i>parent</i> = 0 )</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-6">QValueSpaceSubscriber</a></b> ( const char * <i>path</i>, QValueSpace::LayerOptions <i>filter</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvaluespacesubscriber.html#QValueSpaceSubscriber-7">QValueSpaceSubscriber</a></b> ( const char * <i>path</i>, const QUuid &amp; <i>uuid</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><b><a href="qvaluespacesubscriber.html#dtor.QValueSpaceSubscriber">~QValueSpaceSubscriber</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qvaluespacesubscriber.html#cd">cd</a></b> ( const QString &amp; <i>path</i> )</td></tr>
@@ -73,9 +73,10 @@
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
-<p>The QValueSpaceSubscriber class provides access to values stored in the Value Space.</p>
-<p>The Value Space is an inter-application hierarchy of readable, writable and subscribable data. The QValueSpaceSubscriber class allows applications to read and subscribe to this data.</p>
-<p>Conceptually, the Value Space is a hierarchical tree of which each item can optionally contain a <a href="http://qt.nokia.com/doc/4.5/qvariant.html">QVariant</a> value and sub-items. A serialized version of a simple example might look like this.</p>
+<p>The QValueSpaceSubscriber class allows applications to read and subscribe to Value Space paths.</p>
+<p>By default QValueSpaceSubscriber can read values from and report change notifications for all available Value Space layers. Only data from the layer with the highest order and that contains the specific key is returned by this class.</p>
+<p>The layers that QValueSpaceSubscriber accesses can be limited by specifying either a <a href="qvaluespace.html#LayerOption-enum">filter</a> or a <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a> at construction time.</p>
+<p>Applications subscribe to a particular path in the Value Space. If anything under that path changes the contextChanged() signal is emitted. For example given the schema:</p>
<pre> /Device/Buttons = 3
/Device/Buttons/1/Name = Menu
/Device/Buttons/1/Usable = true
@@ -83,23 +84,10 @@
/Device/Buttons/2/Usable = false
/Device/Buttons/3/Name = Back
/Device/Buttons/3/Usable = true</pre>
-<p>Any application in Qt can read values from the Value Space, or be notified asynchronously when they change using the QValueSpaceSubscriber class.</p>
-<p>Items in the Value Space can be thought of as representing &quot;objects&quot; adhering to a well known schema. This is a conceptual differentiation, not a physical one, as internally the Value Space is treated as one large tree. In the sample above, the <tt>/Device/Buttons</tt> schema can be defined as containing a value representing the number of mappable buttons on a device, and a sub-item for each. Likewise, the sub-item object schema contains two attributes - <tt>Name</tt> and <tt>Usable</tt>.</p>
-<p>Applications may use the <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> class to create a schema object within the Value Space. Objects remain in the Value Space as long as the <a href="qvaluespaceprovider.html">QValueSpaceProvider</a> instance exists - that is, they are not persistent. If the object is destroyed, or the application containing it exits (or crashes) the items are removed.</p>
-<p>Change notification is modeled in a similar way. Applications subscribe to notifications at a particular path in the tree. If anything under that path changes, the application is notified. This allows, for example, subscription to just the <tt>/Device/Buttons</tt> item to receive notification when anything &quot;button&quot; related changes.</p>
-<p>For example,</p>
-<pre> QValueSpaceSubscriber *buttons = new QValueSpaceSubscriber(&quot;/Device/Buttons&quot;);
- qWarning() &lt;&lt; &quot;There are&quot; &lt;&lt; buttons-&gt;value().toUInt() &lt;&lt; &quot;buttons&quot;;
- QObject::connect(buttons, SIGNAL(contentsChanged()),
- this, SLOT(buttonInfoChanged()));</pre>
-<p>will invoke the <tt>buttonInfoChanged()</tt> slot whenever any values under <tt>/Device/Buttons</tt> changes. This includes the value of <tt>/Device/Buttons</tt> itself, a change of a sub-object such as <tt>/Device/Buttons/2/Name</tt> or the creation (or removal) of a new sub-object, such as <tt>/Device/Buttons/4</tt>.</p>
-<p>When a QValueSpaceSubscriber is constructed it will access zero, one or many <a href="qabstractvaluespacelayer.html">layers</a>, depending on the constructor and filter parameters used to construct it. Calls to <a href="qvaluespacesubscriber.html#value">value</a>() will return the value that is stored in the layer with the highest <a href="qabstractvaluespacelayer.html#order">order</a> of all the accessible layers that contain the specified key.</p>
-<p>For example,</p>
-<pre> QValueSpaceSubscriber *buttons = new QValueSpaceSubscriber(&quot;/Device/Buttons&quot;,
- QAbstractValueSpaceLayer::NonPermanentLayer);
- qWarning() &lt;&lt; &quot;There are&quot; &lt;&lt; buttons-&gt;value().toUInt() &lt;&lt; &quot;buttons&quot;;</pre>
-<p>will print out the number of buttons defined in all non-permanent layers. If the same button is defined in multiple non-permanent layers only the values from the layer with the highest <a href="qabstractvaluespacelayer.html#order">order</a> will be visible.</p>
-<p><i>Note:</i> The QValueSpaceSubscriber class is not thread safe and may only be used from an application's main thread.</p>
+<p>The code:</p>
+<pre> QValueSpaceSubscriber *buttons = new QValueSpaceSubscriber(&quot;/Device/Buttons&quot;);
+ QObject::connect(buttons, SIGNAL(contentsChanged()), this, SLOT(buttonInfoChanged()));</pre>
+<p>will invoke the <tt>buttonInfoChanged()</tt> slot whenever any value under <tt>/Device/Buttons</tt> changes. This includes the value of <tt>/Device/Buttons</tt> itself, a change of a subpath such as <tt>/Device/Buttons/2/Name</tt> or the creation or removal of a subpath.</p>
<hr />
<h2>Property Documentation</h2>
<h3 class="fn"><a name="path-prop"></a>path : <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a></h3>
@@ -123,43 +111,41 @@
<p>Constructs a <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> with the specified <i>parent</i> that refers to the root path.</p>
<p>The constructed Value Space subscriber will access all available <a href="qabstractvaluespacelayer.html">layers</a>.</p>
<h3 class="fn"><a name="QValueSpaceSubscriber-2"></a>QValueSpaceSubscriber::QValueSpaceSubscriber ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>path</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
-<p>This is an overloaded function.</p>
-<p>Constructs a <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> with the specified <i>parent</i> that refers to <i>path</i>. This constructor is equivalent to calling <tt>QValueSpaceSubscriber(path.toUtf8(), parent)</tt>.</p>
-<p>The constructed Value Space subscriber will access all available <a href="qabstractvaluespacelayer.html">layers</a>.</p>
-<h3 class="fn"><a name="QValueSpaceSubscriber-3"></a>QValueSpaceSubscriber::QValueSpaceSubscriber ( const char * <i>path</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
-<p>This is an overloaded function.</p>
-<p>Constructs a <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> with the specified <i>parent</i> that refers to <i>path</i>. This constructor is equivalent to calling <tt>QValueSpaceSubscriber(QString(path), parent)</tt>.</p>
+<p>Constructs a <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> with the specified <i>parent</i> that refers to <i>path</i>.</p>
<p>The constructed Value Space subscriber will access all available <a href="qabstractvaluespacelayer.html">layers</a>.</p>
-<h3 class="fn"><a name="QValueSpaceSubscriber-4"></a>QValueSpaceSubscriber::QValueSpaceSubscriber ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>path</i>, <a href="qvaluespace.html#LayerOption-enum">QValueSpace::LayerOptions</a> <i>filter</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
-<p>This is an overloaded function.</p>
-<p>Constructs a <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> with the specified <i>parent</i> that refers to <i>path</i>. The <i>filter</i> parameter is used to limit which layers this <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> will access. This constructor is equivalent to calling <tt>QValueSpaceSubscriber(path.toUtf8(), filter, parent)</tt>.</p>
-<p>If a layer matching <i>filter</i> is not found, the constructed <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> will be unconnected.</p>
-<p>See also <a href="qvaluespacesubscriber.html#isConnected">isConnected</a>().</p>
-<h3 class="fn"><a name="QValueSpaceSubscriber-5"></a>QValueSpaceSubscriber::QValueSpaceSubscriber ( const char * <i>path</i>, <a href="qvaluespace.html#LayerOption-enum">QValueSpace::LayerOptions</a> <i>filter</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
-<p>This is an overloaded function.</p>
-<p>Constructs a <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> with the specified <i>parent</i> that refers to <i>path</i>. The <i>filter</i> parameter is used to limit which layers this <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> will access. This constructor is equivalent to calling <tt>QValueSpaceSubscriber(QString(path), filter, parent)</tt>.</p>
+<h3 class="fn"><a name="QValueSpaceSubscriber-3"></a>QValueSpaceSubscriber::QValueSpaceSubscriber ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>path</i>, <a href="qvaluespace.html#LayerOption-enum">QValueSpace::LayerOptions</a> <i>filter</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
+<p>Constructs a <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> with the specified <i>parent</i> that refers to <i>path</i>. The <i>filter</i> parameter is used to limit which layers this <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> will access.</p>
<p>If a layer matching <i>filter</i> is not found, the constructed <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> will be unconnected.</p>
<p>See also <a href="qvaluespacesubscriber.html#isConnected">isConnected</a>().</p>
-<h3 class="fn"><a name="QValueSpaceSubscriber-6"></a>QValueSpaceSubscriber::QValueSpaceSubscriber ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>path</i>, const <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a> &amp; <i>uuid</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
-<p>This is an overloaded function.</p>
-<p>Constructs a <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> with the specified <i>parent</i> that refers to <i>path</i>. This <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> will only use the layer identified by <i>uuid</i>. This constructor is equivalent to calling <tt>QValueSpaceSubscriber(path.toUtf8(), uuid, parent)</tt>.</p>
+<h3 class="fn"><a name="QValueSpaceSubscriber-4"></a>QValueSpaceSubscriber::QValueSpaceSubscriber ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>path</i>, const <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a> &amp; <i>uuid</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
+<p>Constructs a <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> with the specified <i>parent</i> that refers to <i>path</i>. This <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> will only use the layer identified by <i>uuid</i>.</p>
<p>Use of this constructor is not platform agnostic. If possible use one of the constructors that take a QAbstractValueSpaceLayer::LayerOptions parameter instead.</p>
<p>If a layer with a matching <i>uuid</i> is not found, the constructed <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> will be unconnected.</p>
<p>See also <a href="qabstractvaluespacelayer.html#id">QAbstractValueSpaceLayer::id</a>(), <a href="qvaluespace.html">QValueSpace</a>, and <a href="qvaluespacesubscriber.html#isConnected">isConnected</a>().</p>
+<h3 class="fn"><a name="QValueSpaceSubscriber-5"></a>QValueSpaceSubscriber::QValueSpaceSubscriber ( const char * <i>path</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
+<p>This is an overloaded function.</p>
+<p>Constructs a <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> with the specified <i>parent</i> that refers to <i>path</i>. This constructor is equivalent to calling <tt>QValueSpaceSubscriber(QString::fromLatin1(path), parent)</tt>.</p>
+<p>The constructed Value Space subscriber will access all available <a href="qabstractvaluespacelayer.html">layers</a>.</p>
+<h3 class="fn"><a name="QValueSpaceSubscriber-6"></a>QValueSpaceSubscriber::QValueSpaceSubscriber ( const char * <i>path</i>, <a href="qvaluespace.html#LayerOption-enum">QValueSpace::LayerOptions</a> <i>filter</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
+<p>This is an overloaded function.</p>
+<p>Constructs a <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> with the specified <i>parent</i> that refers to <i>path</i>. The <i>filter</i> parameter is used to limit which layers this <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> will access. This constructor is equivalent to calling <tt>QValueSpaceSubscriber(QString::fromLatin1(path), filter, parent)</tt>.</p>
+<p>If a layer matching <i>filter</i> is not found, the constructed <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> will be unconnected.</p>
+<p>See also <a href="qvaluespacesubscriber.html#isConnected">isConnected</a>().</p>
<h3 class="fn"><a name="QValueSpaceSubscriber-7"></a>QValueSpaceSubscriber::QValueSpaceSubscriber ( const char * <i>path</i>, const <a href="http://qt.nokia.com/doc/4.5/quuid.html">QUuid</a> &amp; <i>uuid</i>, <a href="http://qt.nokia.com/doc/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
<p>This is an overloaded function.</p>
-<p>Constructs a <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> with the specified <i>parent</i> that refers to <i>path</i>. This <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> will only use the layer identified by <i>uuid</i>. This constructor is equivalent to calling <tt>QValueSpaceSubscriber(QString(path), uuid, parent)</tt>.</p>
+<p>Constructs a <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> with the specified <i>parent</i> that refers to <i>path</i>. This <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> will only use the layer identified by <i>uuid</i>. This constructor is equivalent to calling <tt>QValueSpaceSubscriber(QString::fromLatin1(path), uuid, parent)</tt>.</p>
<p>Use of this constructor is not platform agnostic. If possible use one of the constructors that take a QAbstractValueSpaceLayer::LayerOptions parameter instead.</p>
<p>If a layer with a matching <i>uuid</i> is not found, the constructed <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> will be unconnected.</p>
<p>See also <a href="qabstractvaluespacelayer.html#id">QAbstractValueSpaceLayer::id</a>(), <a href="qvaluespace.html">QValueSpace</a>, and <a href="qvaluespacesubscriber.html#isConnected">isConnected</a>().</p>
<h3 class="fn"><a name="dtor.QValueSpaceSubscriber"></a>QValueSpaceSubscriber::~QValueSpaceSubscriber ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
-<p>Destroys the <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a></p>
+<p>Destroys the <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a>.</p>
<h3 class="fn"><a name="cd"></a>void QValueSpaceSubscriber::cd ( const <a href="http://qt.nokia.com/doc/4.5/qstring.html">QString</a> &amp; <i>path</i> )</h3>
-<p>Changes the path to <i>path</i>.</p>
+<p>Changes the path to the absolute path if <i>path</i> starts with a '/'; otherwise changes to the sub path of the current path.</p>
<h3 class="fn"><a name="cdUp"></a>void QValueSpaceSubscriber::cdUp ()</h3>
<p>Sets the path to parent of the current path.</p>
<h3 class="fn"><a name="contentsChanged"></a>void QValueSpaceSubscriber::contentsChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
-<p>Emitted whenever any value under this subscriber path changes.</p>
+<p>Emitted whenever any value under the current path changes.</p>
+<p><b>Note:</b> that if a value changes multiple times in quick succession, only the most recent value may be accessible via the <a href="qvaluespacesubscriber.html#value">value</a>() function.</p>
<h3 class="fn"><a name="isConnected"></a>bool QValueSpaceSubscriber::isConnected () const</h3>
<p>Returns true if this <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> is connected to at least one available layer; otherwise returns false. An unconnected <a href="qvaluespacesubscriber.html">QValueSpaceSubscriber</a> is constructed if the filtering parameters passed to the constructor eliminate all available layers.</p>
<h3 class="fn"><a name="subPaths"></a><a href="http://qt.nokia.com/doc/4.5/qstringlist.html">QStringList</a> QValueSpaceSubscriber::subPaths () const</h3>
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index bdbaab4042..5e11620794 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -155,6 +155,23 @@
Supports the sending of messages with attachments, and in situations of
low battery to leave attachments on the server unless opened.
+ For more details see the \l {Messaging API} {messaging API overview}.
+
+ \section2 Messaging dependencies and requirements
+
+ The Linux backend depends on QMF, for information on QMF see the
+ \l {http://labs.trolltech.com/blogs/category/qtmessaging/}
+ {QMF Labs article}
+
+ The Windows Mobile backend depends on ActiveSync version 4.5.
+
+ Whilst not supported for this release the Windows Desktop backend
+ depends on Microsoft Outlook 2003 or later being installed.
+
+ The messaging API SMS/MMS functionality requires that the platform
+ provides SMS/MMS facilites. Email functionality requires that an email
+ account is available on the platform.
+
\section1 Multimedia
An API to record and play audio and video of various formats. The playing
diff --git a/doc/src/messaging.qdoc b/doc/src/messaging.qdoc
index b227691a51..ad98344f65 100644
--- a/doc/src/messaging.qdoc
+++ b/doc/src/messaging.qdoc
@@ -43,7 +43,7 @@
\page messaging.html
\ingroup mobility
-\title Messaging
+\title Messaging API
\brief The Messaging API enables access to messaging services.
diff --git a/doc/src/publ-subs.qdoc b/doc/src/publ-subs.qdoc
index bf5b348ff4..25fa6901ed 100644
--- a/doc/src/publ-subs.qdoc
+++ b/doc/src/publ-subs.qdoc
@@ -39,7 +39,6 @@
**
****************************************************************************/
-
/*!
\page publ-subs.html
@@ -99,15 +98,15 @@ subscription to just \c {/Device/Buttons} to be notified when anything
Internally, the Value Space consists of an arbitrary number of data source trees, or layers, which
are stacked on top of each other to form the final unified view. If a "higher" layer contains an
item, it shadows the value of items in the layers below it. Consider the Value Space item
-\c {/Device/Buttons}. If two layer contained this item, the value in the layer with the higher
-layer order (see \l {QAbstractValueSpaceLayer::order()}) would shadow that with the lower layer
-order. However, if only the layer with the lower order contained this item, it would be visible
-through the QValueSpaceSubscriber class, even if the higher order layer contained sub-items such as
-\c {/Device/Buttons/1}. That is, layer shadowing occurs by value not by path.
+\c {/Device/Buttons}. If two layers contained this item, the value in the layer with the higher
+layer order would shadow that with the lower layer order. However, if only the layer with the
+lower order contained this item, it would be visible through the QValueSpaceSubscriber class, even
+if the higher order layer contained sub-items such as \c {/Device/Buttons/1}. That is, layer
+shadowing occurs by value not by path.
Layer order is fixed and is defined in the layer implementation.
-The Qt Value Space contains the following layers:
+The following Value Space layers are available:
\table
\header
@@ -117,24 +116,30 @@ The Qt Value Space contains the following layers:
\o \l{Shared Memory Layer}
\o The Shared Memory layer provides a non-permanent Value Space backing store using shared
memory and local sockets. The Shared Memory layer is only available on Unix platforms.
+
+The Shared Memory layer has an order of 0x10000000.
\row
\o Volatile Registry Layer
\o The Volatile Registry layer provides a non-permanent Value Space backing store using
volatile keys stored in the Windows' registry. The Volatile Registry layer is only
available on Windows platforms.
+
+ The Volatile Registry layer has an order of 0x1000.
\row
\o Non-volatile Registry Layer
\o The Non-volatile Registry layer provides a permanent Value Space backing store using
keys stored in the Windows' registry. The Non-volatile Registry layer is only available
on Windows platforms.
+ The Non-volatile Registry layer has an order of 0.
\row
\o ContextKit Layer
\o The ContextKit layer provides a non-permanent Value Space backing store using
ContextKit. Publishing values to this layer via QValueSpaceProvider is currently not
supported.
+ The ContextKit layer has an order of 0.
\endtable
-The Qt Value Space has support for both client/server and peer-to-peer layer architectures. If a
+The Value Space has support for both client/server and peer-to-peer layer architectures. If a
layer that uses a client/server architecture is used and a server process is not provided by the
underlying system it will be necessary to start one. This can be done by calling
QValueSpace::initValueSpaceServer() prior to any other use of the Value Space.
@@ -169,17 +174,16 @@ exactly what has changed without the need for a bulkier change notification prot
\section2 Publish and Subscribe
-In the example \l{publish-subscribe}{Publish and Subscribe} the Qt Value Space
-is used as a method of communicating changes in one dialog (the provider) to
-another dialog (the consumer).
+In the example \l {publish-subscribe}{Publish and Subscribe} the Value Space is used as a method of
+communicating changes in one dialog (the provider) to another dialog (the consumer).
\section2 Battery Charging - Accessing Publish and Subscribe from QML
In the example \l {battery-charge}{Accessing Publish and Subscribe from QML} the Publish and
Subscribe concept is now extended to make the provider an input of the level of charge in a
-battery. A slider on the provider dialog represents the modifiable level of charge. The Qt Value
+battery. A slider on the provider dialog represents the modifiable level of charge. The Value
Space acts as a communications medium between the provider dialog and the consumer graphical
-battery animation. The battery is implemented in QML and C++ with Qt Value Space supplying the
+battery animation. The battery is implemented in QML and C++ with Value Space supplying the
charge level for the animation to represent.
\section1 Namespaces and Classes
diff --git a/doc/src/qtmobility.qdocconf b/doc/src/qtmobility.qdocconf
index 90bd4a1355..f3d4e97dc5 100644
--- a/doc/src/qtmobility.qdocconf
+++ b/doc/src/qtmobility.qdocconf
@@ -167,4 +167,5 @@ HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"</tr></table></div></address>"
macro.raisedaster.HTML = "<sup>*</sup>"
+macro.br.HTML = "<br/>"
diff --git a/examples/cameracapture/cameracapture.cpp b/examples/cameracapture/cameracapture.cpp
index cd7a555838..42bacc84d8 100644
--- a/examples/cameracapture/cameracapture.cpp
+++ b/examples/cameracapture/cameracapture.cpp
@@ -162,7 +162,7 @@ void CameraCapture::updateRecordTime()
void CameraCapture::processCapturedImage(const QString& fname, const QImage& img)
{
- Q_UNUSED(img);
+ ui->lastImagePreviewLabel->setPixmap( QPixmap::fromImage(img.scaledToWidth(128)) );
qDebug() << "image captured:" << fname;
}
diff --git a/examples/cameracapture/cameracapture.ui b/examples/cameracapture/cameracapture.ui
index 6fe67219d5..8185fd40a5 100644
--- a/examples/cameracapture/cameracapture.ui
+++ b/examples/cameracapture/cameracapture.ui
@@ -122,17 +122,17 @@
</widget>
</item>
<item row="1" column="0">
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
+ <widget class="QLabel" name="lastImagePreviewLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>64</height>
- </size>
+ <property name="text">
+ <string/>
</property>
- </spacer>
+ </widget>
</item>
</layout>
</widget>
@@ -194,7 +194,7 @@
<x>0</x>
<y>0</y>
<width>606</width>
- <height>27</height>
+ <height>26</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
diff --git a/examples/serviceactions/mainwindow.cpp b/examples/serviceactions/mainwindow.cpp
index 20249a3f6a..eb96512e4f 100644
--- a/examples/serviceactions/mainwindow.cpp
+++ b/examples/serviceactions/mainwindow.cpp
@@ -73,15 +73,6 @@ static const QSize WindowGeometry(400,300);
static const QString WindowTitle("Service-actions Example");
static unsigned int RecentMessagesCount = 50;
-typedef struct
-{
- QMessageId id;
- QString subject;
- bool partial;
-} MessageInfo;
-
-typedef QList<MessageInfo> MessageInfoList;
-
class AccountsWidget : public QWidget
{
Q_OBJECT
@@ -819,14 +810,16 @@ void MessageViewWidget::view(const QMessageId& messageId)
bool MessageViewWidget::retrieveBody()
{
-
if(m_state != Loading && !m_loadTimer.isActive())
{
m_loadTimer.setSingleShot(true);
m_loadTimer.start(LoadTimeLimit * 1000);
m_state = Unloaded;
+
+ return m_service->retrieveBody(m_messageId);
}
- return m_service->retrieveBody(m_messageId);
+
+ return false;
}
void MessageViewWidget::showEvent(QShowEvent* e)
diff --git a/plugins/contacts/contacts.pro b/plugins/contacts/contacts.pro
index 84b3550aa8..0da075e9e2 100644
--- a/plugins/contacts/contacts.pro
+++ b/plugins/contacts/contacts.pro
@@ -6,6 +6,5 @@ include(../../common.pri)
# If qmake has CONTACTS_BACKEND option specified, build that backend too
contains(CONTACTS_BACKENDS, symbian): SUBDIRS += symbian
-contains(CONTACTS_BACKENDS, symbian): SUBDIRS += symbian/tsrc
contains(CONTACTS_BACKENDS, wince): SUBDIRS += wince
contains(CONTACTS_BACKENDS, maemo): SUBDIRS += qtcontacts-tracker
diff --git a/plugins/gstreamer/mediacapture/qgstreamercameracontrol.cpp b/plugins/gstreamer/mediacapture/qgstreamercameracontrol.cpp
deleted file mode 100644
index e8202bc139..0000000000
--- a/plugins/gstreamer/mediacapture/qgstreamercameracontrol.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qgstreamercameracontrol.h"
-
-#include <QtCore/qdebug.h>
-
-QGstreamerCameraControl::QGstreamerCameraControl(QGstreamerCaptureSession *session)
- :QCameraControl(session), m_session(session), m_state(QCamera::StoppedState)
-{
- connect(m_session, SIGNAL(stateChanged(QGstreamerCaptureSession::State)),
- this, SLOT(updateState()));
-}
-
-QGstreamerCameraControl::~QGstreamerCameraControl()
-{
-}
-
-GstElement *QGstreamerCameraControl::buildElement()
-{
- GstElement *camera = gst_element_factory_make("v4l2src", "camera_source");
-
- if (camera && !m_device.isEmpty() )
- g_object_set(G_OBJECT(camera), "device", m_device.constData(), NULL);
-
- return camera;
-}
-
-void QGstreamerCameraControl::start()
-{
- if (m_session->state() == QGstreamerCaptureSession::StoppedState)
- m_session->setState(QGstreamerCaptureSession::PreviewState);
-}
-
-void QGstreamerCameraControl::stop()
-{
- m_session->setState(QGstreamerCaptureSession::StoppedState);
-}
-
-void QGstreamerCameraControl::setDevice(const QString &device)
-{
- m_device = device.toLocal8Bit().constData();
-}
-
-QCamera::State QGstreamerCameraControl::state() const
-{
- if (m_session->state() == QGstreamerCaptureSession::StoppedState)
- return QCamera::StoppedState;
- else
- return QCamera::ActiveState;
-}
-
-void QGstreamerCameraControl::updateState()
-{
- QCamera::State newState = state();
- if (m_state != newState) {
- m_state = newState;
- emit stateChanged(m_state);
- }
-}
diff --git a/plugins/audiocapture/audiocapture.pro b/plugins/multimedia/audiocapture/audiocapture.pro
index 6f02b4e193..9924d4f7cf 100644
--- a/plugins/audiocapture/audiocapture.pro
+++ b/plugins/multimedia/audiocapture/audiocapture.pro
@@ -3,8 +3,8 @@ CONFIG += plugin
TARGET = $$qtLibraryTarget(audioengine)
PLUGIN_TYPE=mediaservice
-include (../../common.pri)
-INCLUDEPATH += ../../src/multimedia
+include (../../../common.pri)
+INCLUDEPATH += ../../../src/multimedia
qtAddLibrary(QtMedia)
@@ -25,5 +25,9 @@ SOURCES += audioencodercontrol.cpp \
audiocaptureserviceplugin.cpp \
audiocapturesession.cpp
+symbian {
+ TARGET.CAPABILITY = ALL -TCB
+ TARGET.EPOCALLOWDLLDATA = 1
+}
target.path=$$QT_MOBILITY_PREFIX/plugins/mediaservice
INSTALLS+=target
diff --git a/plugins/audiocapture/audiocaptureservice.cpp b/plugins/multimedia/audiocapture/audiocaptureservice.cpp
index 58318646f5..58318646f5 100644
--- a/plugins/audiocapture/audiocaptureservice.cpp
+++ b/plugins/multimedia/audiocapture/audiocaptureservice.cpp
diff --git a/plugins/audiocapture/audiocaptureservice.h b/plugins/multimedia/audiocapture/audiocaptureservice.h
index 2cc1e3fcad..2cc1e3fcad 100644
--- a/plugins/audiocapture/audiocaptureservice.h
+++ b/plugins/multimedia/audiocapture/audiocaptureservice.h
diff --git a/plugins/audiocapture/audiocaptureserviceplugin.cpp b/plugins/multimedia/audiocapture/audiocaptureserviceplugin.cpp
index 537c414572..537c414572 100644
--- a/plugins/audiocapture/audiocaptureserviceplugin.cpp
+++ b/plugins/multimedia/audiocapture/audiocaptureserviceplugin.cpp
diff --git a/plugins/audiocapture/audiocaptureserviceplugin.h b/plugins/multimedia/audiocapture/audiocaptureserviceplugin.h
index 2a777b82da..2a777b82da 100644
--- a/plugins/audiocapture/audiocaptureserviceplugin.h
+++ b/plugins/multimedia/audiocapture/audiocaptureserviceplugin.h
diff --git a/plugins/audiocapture/audiocapturesession.cpp b/plugins/multimedia/audiocapture/audiocapturesession.cpp
index abd29fe7e1..23ee8fc1f7 100644
--- a/plugins/audiocapture/audiocapturesession.cpp
+++ b/plugins/multimedia/audiocapture/audiocapturesession.cpp
@@ -208,11 +208,9 @@ void AudioCaptureSession::record()
if(m_audioInput) {
if(m_state == QMediaRecorder::StoppedState) {
if(file.open(QIODevice::WriteOnly)) {
- //TODO: write wav header id wavFile true
-
memset(&header,0,sizeof(CombinedHeader));
memcpy(header.riff.descriptor.id,"RIFF",4);
- header.riff.descriptor.size = 0xFFFFFFFF; // This should be updated on stop() TODO! filesize-8
+ header.riff.descriptor.size = 0xFFFFFFFF; // This should be updated on stop(), filesize-8
memcpy(header.riff.type,"WAVE",4);
memcpy(header.wave.descriptor.id,"fmt ",4);
header.wave.descriptor.size = 16;
@@ -223,7 +221,7 @@ void AudioCaptureSession::record()
header.wave.blockAlign = m_format.channels()*m_format.sampleSize()/8;
header.wave.bitsPerSample = m_format.sampleSize();
memcpy(header.data.descriptor.id,"data",4);
- header.data.descriptor.size = 0xFFFFFFFF; // This should be updated on stop() TODO! samples*channels*sampleSize/8
+ header.data.descriptor.size = 0xFFFFFFFF; // This should be updated on stop(),samples*channels*sampleSize/8
file.write((char*)&header,sizeof(CombinedHeader));
m_audioInput->start(qobject_cast<QIODevice*>(&file));
@@ -252,26 +250,14 @@ void AudioCaptureSession::stop()
m_audioInput->stop();
file.close();
- QFile tmpFile("record.tmp");
- tmpFile.open(QIODevice::WriteOnly);
-
qint32 fileSize = file.size()-8;
- if(file.open(QIODevice::ReadOnly)) {
- file.read((char*)&header,sizeof(CombinedHeader));
- header.riff.descriptor.size = fileSize; // filesize-8
- header.data.descriptor.size = fileSize-44; // samples*channels*sampleSize/8
- tmpFile.write((char*)&header,sizeof(CombinedHeader));
- char buf[4096];
- while(!file.atEnd()) {
- int l = file.read(buf,4096);
- if(l > 0)
- tmpFile.write(buf,l);
- }
- tmpFile.close();
- file.close();
- file.remove();
- tmpFile.rename(file.fileName());
- }
+ file.open(QIODevice::ReadWrite | QIODevice::Unbuffered);
+ file.read((char*)&header,sizeof(CombinedHeader));
+ header.riff.descriptor.size = fileSize; // filesize-8
+ header.data.descriptor.size = fileSize-44; // samples*channels*sampleSize/8
+ file.seek(0);
+ file.write((char*)&header,sizeof(CombinedHeader));
+ file.close();
m_position = 0;
}
m_state = QMediaRecorder::StoppedState;
diff --git a/plugins/audiocapture/audiocapturesession.h b/plugins/multimedia/audiocapture/audiocapturesession.h
index 99224852c2..a23d6b5608 100644
--- a/plugins/audiocapture/audiocapturesession.h
+++ b/plugins/multimedia/audiocapture/audiocapturesession.h
@@ -129,7 +129,7 @@ private:
struct DATAHeader
{
chunk descriptor;
- quint8 data[];
+// quint8 data[];
};
struct CombinedHeader
diff --git a/plugins/audiocapture/audiodevicecontrol.cpp b/plugins/multimedia/audiocapture/audiodevicecontrol.cpp
index 8c4fdea287..8c4fdea287 100644
--- a/plugins/audiocapture/audiodevicecontrol.cpp
+++ b/plugins/multimedia/audiocapture/audiodevicecontrol.cpp
diff --git a/plugins/audiocapture/audiodevicecontrol.h b/plugins/multimedia/audiocapture/audiodevicecontrol.h
index bfc3a4fb8b..bfc3a4fb8b 100644
--- a/plugins/audiocapture/audiodevicecontrol.h
+++ b/plugins/multimedia/audiocapture/audiodevicecontrol.h
diff --git a/plugins/audiocapture/audioencodercontrol.cpp b/plugins/multimedia/audiocapture/audioencodercontrol.cpp
index 9e266f6ac4..370c91a7b8 100644
--- a/plugins/audiocapture/audioencodercontrol.cpp
+++ b/plugins/multimedia/audiocapture/audioencodercontrol.cpp
@@ -182,7 +182,7 @@ void AudioEncoderControl::setSampleRate(int sampleRate)
m_session->setFormat(fmt);
}
-QList<int> AudioEncoderControl::supportedSampleRates() const
+QList<int> AudioEncoderControl::supportedSampleRates(const QAudioEncoderSettings &) const
{
return m_session->deviceInfo()->supportedFrequencies();
}
diff --git a/plugins/audiocapture/audioencodercontrol.h b/plugins/multimedia/audiocapture/audioencodercontrol.h
index 7544695551..c1f66d8740 100644
--- a/plugins/audiocapture/audioencodercontrol.h
+++ b/plugins/multimedia/audiocapture/audioencodercontrol.h
@@ -76,7 +76,7 @@ public:
int sampleRate() const;
void setSampleRate(int sampleRate);
- QList<int> supportedSampleRates() const;
+ QList<int> supportedSampleRates(const QAudioEncoderSettings &) const;
int channels() const;
void setChannels(int channels);
diff --git a/plugins/audiocapture/audiomediarecordercontrol.cpp b/plugins/multimedia/audiocapture/audiomediarecordercontrol.cpp
index ac0787eaba..ac0787eaba 100644
--- a/plugins/audiocapture/audiomediarecordercontrol.cpp
+++ b/plugins/multimedia/audiocapture/audiomediarecordercontrol.cpp
diff --git a/plugins/audiocapture/audiomediarecordercontrol.h b/plugins/multimedia/audiocapture/audiomediarecordercontrol.h
index c756a7ef99..c756a7ef99 100644
--- a/plugins/audiocapture/audiomediarecordercontrol.h
+++ b/plugins/multimedia/audiocapture/audiomediarecordercontrol.h
diff --git a/plugins/directshow/camera/camera.pri b/plugins/multimedia/directshow/camera/camera.pri
index 950643ffe1..950643ffe1 100644
--- a/plugins/directshow/camera/camera.pri
+++ b/plugins/multimedia/directshow/camera/camera.pri
diff --git a/plugins/directshow/camera/dscameracontrol.cpp b/plugins/multimedia/directshow/camera/dscameracontrol.cpp
index 6841a0affe..6841a0affe 100644
--- a/plugins/directshow/camera/dscameracontrol.cpp
+++ b/plugins/multimedia/directshow/camera/dscameracontrol.cpp
diff --git a/plugins/directshow/camera/dscameracontrol.h b/plugins/multimedia/directshow/camera/dscameracontrol.h
index cc21b19bed..cc21b19bed 100644
--- a/plugins/directshow/camera/dscameracontrol.h
+++ b/plugins/multimedia/directshow/camera/dscameracontrol.h
diff --git a/plugins/directshow/camera/dscameraservice.cpp b/plugins/multimedia/directshow/camera/dscameraservice.cpp
index 71fa693799..b983746a42 100644
--- a/plugins/directshow/camera/dscameraservice.cpp
+++ b/plugins/multimedia/directshow/camera/dscameraservice.cpp
@@ -26,7 +26,7 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
-* Nokia at qt-info@nokia.com.
+** Nokia at qt-info@nokia.com.
**
**
**
diff --git a/plugins/directshow/camera/dscameraservice.h b/plugins/multimedia/directshow/camera/dscameraservice.h
index c0dda50d1f..c0dda50d1f 100644
--- a/plugins/directshow/camera/dscameraservice.h
+++ b/plugins/multimedia/directshow/camera/dscameraservice.h
diff --git a/plugins/directshow/camera/dscamerasession.cpp b/plugins/multimedia/directshow/camera/dscamerasession.cpp
index f821e488a8..dadcf8eb0e 100644
--- a/plugins/directshow/camera/dscamerasession.cpp
+++ b/plugins/multimedia/directshow/camera/dscamerasession.cpp
@@ -26,7 +26,7 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
-* Nokia at qt-info@nokia.com.
+** Nokia at qt-info@nokia.com.
**
**
**
diff --git a/plugins/directshow/camera/dscamerasession.h b/plugins/multimedia/directshow/camera/dscamerasession.h
index 69c574ad45..1fa864cfad 100644
--- a/plugins/directshow/camera/dscamerasession.h
+++ b/plugins/multimedia/directshow/camera/dscamerasession.h
@@ -26,7 +26,7 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
-* Nokia at qt-info@nokia.com.
+** Nokia at qt-info@nokia.com.
**
**
**
diff --git a/plugins/directshow/camera/dsimagecapturecontrol.cpp b/plugins/multimedia/directshow/camera/dsimagecapturecontrol.cpp
index c5bac9233f..d06db64533 100644
--- a/plugins/directshow/camera/dsimagecapturecontrol.cpp
+++ b/plugins/multimedia/directshow/camera/dsimagecapturecontrol.cpp
@@ -26,7 +26,7 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
-* Nokia at qt-info@nokia.com.
+** Nokia at qt-info@nokia.com.
**
**
**
diff --git a/plugins/directshow/camera/dsimagecapturecontrol.h b/plugins/multimedia/directshow/camera/dsimagecapturecontrol.h
index 230e614fd0..3d8d1da1e2 100644
--- a/plugins/directshow/camera/dsimagecapturecontrol.h
+++ b/plugins/multimedia/directshow/camera/dsimagecapturecontrol.h
@@ -26,7 +26,7 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
-* Nokia at qt-info@nokia.com.
+** Nokia at qt-info@nokia.com.
**
**
**
diff --git a/plugins/directshow/camera/dsvideodevicecontrol.cpp b/plugins/multimedia/directshow/camera/dsvideodevicecontrol.cpp
index ade15ab629..ba421f267a 100644
--- a/plugins/directshow/camera/dsvideodevicecontrol.cpp
+++ b/plugins/multimedia/directshow/camera/dsvideodevicecontrol.cpp
@@ -26,7 +26,7 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
-* Nokia at qt-info@nokia.com.
+** Nokia at qt-info@nokia.com.
**
**
**
diff --git a/plugins/directshow/camera/dsvideodevicecontrol.h b/plugins/multimedia/directshow/camera/dsvideodevicecontrol.h
index f224621009..86db08df18 100644
--- a/plugins/directshow/camera/dsvideodevicecontrol.h
+++ b/plugins/multimedia/directshow/camera/dsvideodevicecontrol.h
@@ -26,7 +26,7 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
-* Nokia at qt-info@nokia.com.
+** Nokia at qt-info@nokia.com.
**
**
**
diff --git a/plugins/directshow/camera/dsvideooutputcontrol.cpp b/plugins/multimedia/directshow/camera/dsvideooutputcontrol.cpp
index 6bb5fe087f..685275cb57 100644
--- a/plugins/directshow/camera/dsvideooutputcontrol.cpp
+++ b/plugins/multimedia/directshow/camera/dsvideooutputcontrol.cpp
@@ -26,7 +26,7 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
-* Nokia at qt-info@nokia.com.
+** Nokia at qt-info@nokia.com.
**
**
**
diff --git a/plugins/directshow/camera/dsvideooutputcontrol.h b/plugins/multimedia/directshow/camera/dsvideooutputcontrol.h
index 81e060ee59..95976b7561 100644
--- a/plugins/directshow/camera/dsvideooutputcontrol.h
+++ b/plugins/multimedia/directshow/camera/dsvideooutputcontrol.h
@@ -26,7 +26,7 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
-* Nokia at qt-info@nokia.com.
+** Nokia at qt-info@nokia.com.
**
**
**
diff --git a/plugins/directshow/camera/dsvideorenderer.cpp b/plugins/multimedia/directshow/camera/dsvideorenderer.cpp
index bb3cb768a7..12981c51db 100644
--- a/plugins/directshow/camera/dsvideorenderer.cpp
+++ b/plugins/multimedia/directshow/camera/dsvideorenderer.cpp
@@ -26,7 +26,7 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
-* Nokia at qt-info@nokia.com.
+** Nokia at qt-info@nokia.com.
**
**
**
diff --git a/plugins/directshow/camera/dsvideorenderer.h b/plugins/multimedia/directshow/camera/dsvideorenderer.h
index b52ed2af1e..ef161470b7 100644
--- a/plugins/directshow/camera/dsvideorenderer.h
+++ b/plugins/multimedia/directshow/camera/dsvideorenderer.h
@@ -26,7 +26,7 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
-* Nokia at qt-info@nokia.com.
+** Nokia at qt-info@nokia.com.
**
**
**
diff --git a/plugins/directshow/directshow.pro b/plugins/multimedia/directshow/directshow.pro
index e5b98f9287..0e7a8d13c2 100644
--- a/plugins/directshow/directshow.pro
+++ b/plugins/multimedia/directshow/directshow.pro
@@ -4,8 +4,8 @@ TARGET = $$qtLibraryTarget(dsengine)
PLUGIN_TYPE = mediaservice
-include (../../common.pri)
-INCLUDEPATH+=../../src/multimedia
+include (../../../common.pri)
+INCLUDEPATH+=../../../src/multimedia
qtAddLibrary(QtMedia)
diff --git a/plugins/directshow/dsserviceplugin.cpp b/plugins/multimedia/directshow/dsserviceplugin.cpp
index 87c6707c70..87c6707c70 100644
--- a/plugins/directshow/dsserviceplugin.cpp
+++ b/plugins/multimedia/directshow/dsserviceplugin.cpp
diff --git a/plugins/directshow/dsserviceplugin.h b/plugins/multimedia/directshow/dsserviceplugin.h
index 23774b8ea0..23774b8ea0 100644
--- a/plugins/directshow/dsserviceplugin.h
+++ b/plugins/multimedia/directshow/dsserviceplugin.h
diff --git a/plugins/gstreamer/gstreamer.pro b/plugins/multimedia/gstreamer/gstreamer.pro
index 6a00100f5e..d95a9aec5e 100644
--- a/plugins/gstreamer/gstreamer.pro
+++ b/plugins/multimedia/gstreamer/gstreamer.pro
@@ -3,8 +3,8 @@ CONFIG += plugin
TARGET = $$qtLibraryTarget(gstengine)
PLUGIN_TYPE=mediaservice
-include(../../common.pri)
-INCLUDEPATH+=../../src/multimedia
+include(../../../common.pri)
+INCLUDEPATH+=../../../src/multimedia
qtAddLibrary(QtMedia)
diff --git a/plugins/gstreamer/mediacapture/mediacapture.pri b/plugins/multimedia/gstreamer/mediacapture/mediacapture.pri
index 816a46c1f8..4ef7c127ce 100644
--- a/plugins/gstreamer/mediacapture/mediacapture.pri
+++ b/plugins/multimedia/gstreamer/mediacapture/mediacapture.pri
@@ -10,7 +10,8 @@ HEADERS += $$PWD/qgstreamercaptureservice.h \
$$PWD/qgstreamermediaformatcontrol.h \
$$PWD/qgstreamercameracontrol.h \
$$PWD/qgstreamercapturemetadatacontrol.h \
- $$PWD/qgstreamerimagecapturecontrol.h
+ $$PWD/qgstreamerimagecapturecontrol.h \
+ $$PWD/qgstreamerimageencode.h
SOURCES += $$PWD/qgstreamercaptureservice.cpp \
$$PWD/qgstreamercapturesession.cpp \
@@ -20,4 +21,5 @@ SOURCES += $$PWD/qgstreamercaptureservice.cpp \
$$PWD/qgstreamermediaformatcontrol.cpp \
$$PWD/qgstreamercameracontrol.cpp \
$$PWD/qgstreamercapturemetadatacontrol.cpp \
- $$PWD/qgstreamerimagecapturecontrol.cpp
+ $$PWD/qgstreamerimagecapturecontrol.cpp \
+ $$PWD/qgstreamerimageencode.cpp
diff --git a/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp b/plugins/multimedia/gstreamer/mediacapture/qgstreameraudioencode.cpp
index a8892183bd..1d66024463 100644
--- a/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreameraudioencode.cpp
@@ -110,7 +110,7 @@ void QGstreamerAudioEncode::setEncodingOption(
m_options[codec][name] = value;
}
-QList<int> QGstreamerAudioEncode::supportedSampleRates() const
+QList<int> QGstreamerAudioEncode::supportedSampleRates(const QAudioEncoderSettings &) const
{
//TODO check element caps to find actual values
diff --git a/plugins/gstreamer/mediacapture/qgstreameraudioencode.h b/plugins/multimedia/gstreamer/mediacapture/qgstreameraudioencode.h
index ebfbc52f15..95ad93809f 100644
--- a/plugins/gstreamer/mediacapture/qgstreameraudioencode.h
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreameraudioencode.h
@@ -70,9 +70,9 @@ public:
QVariant encodingOption(const QString &codec, const QString &name) const;
void setEncodingOption(const QString &codec, const QString &name, const QVariant &value);
- QList<int> supportedSampleRates() const;
- QList<int> supportedChannelCounts() const;
- QList<int> supportedSampleSizes() const;
+ QList<int> supportedSampleRates(const QAudioEncoderSettings &settings = QAudioEncoderSettings()) const;
+ QList<int> supportedChannelCounts(const QAudioEncoderSettings &settings = QAudioEncoderSettings()) const;
+ QList<int> supportedSampleSizes(const QAudioEncoderSettings &settings = QAudioEncoderSettings()) const;
QAudioEncoderSettings audioSettings() const;
void setAudioSettings(const QAudioEncoderSettings&);
diff --git a/plugins/multimedia/gstreamer/mediacapture/qgstreamercameracontrol.cpp b/plugins/multimedia/gstreamer/mediacapture/qgstreamercameracontrol.cpp
new file mode 100644
index 0000000000..c751f3a408
--- /dev/null
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamercameracontrol.cpp
@@ -0,0 +1,319 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qgstreamercameracontrol.h"
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qfile.h>
+
+#include <linux/types.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/poll.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+#include <linux/videodev2.h>
+
+static inline uint qHash(const QSize& key) { return uint(key.width()*256+key.height()); }
+static bool operator<(const QSize &s1, const QSize s2)
+{
+ return s1.width()*s1.height() < s2.width()*s2.height();
+}
+
+QGstreamerCameraControl::QGstreamerCameraControl(QGstreamerCaptureSession *session)
+ :QCameraControl(session), m_session(session), m_state(QCamera::StoppedState)
+{
+ connect(m_session, SIGNAL(stateChanged(QGstreamerCaptureSession::State)),
+ this, SLOT(updateState()));
+}
+
+QGstreamerCameraControl::~QGstreamerCameraControl()
+{
+}
+
+GstElement *QGstreamerCameraControl::buildElement()
+{
+ GstElement *camera = gst_element_factory_make("v4l2src", "camera_source");
+
+ if (camera && !m_device.isEmpty() )
+ g_object_set(G_OBJECT(camera), "device", m_device.constData(), NULL);
+
+ return camera;
+}
+
+void QGstreamerCameraControl::start()
+{
+ if (m_session->state() == QGstreamerCaptureSession::StoppedState)
+ m_session->setState(QGstreamerCaptureSession::PreviewState);
+}
+
+void QGstreamerCameraControl::stop()
+{
+ m_session->setState(QGstreamerCaptureSession::StoppedState);
+}
+
+void QGstreamerCameraControl::setDevice(const QString &device)
+{
+ QByteArray newDevice = device.toLocal8Bit();
+
+ if (m_device != newDevice) {
+ m_device = newDevice;
+ updateSupportedResolutions(device);
+ }
+}
+
+QCamera::State QGstreamerCameraControl::state() const
+{
+ if (m_session->state() == QGstreamerCaptureSession::StoppedState)
+ return QCamera::StoppedState;
+ else
+ return QCamera::ActiveState;
+}
+
+void QGstreamerCameraControl::updateState()
+{
+ QCamera::State newState = state();
+ if (m_state != newState) {
+ m_state = newState;
+ emit stateChanged(m_state);
+ }
+}
+
+
+void QGstreamerCameraControl::updateSupportedResolutions(const QString &device)
+{
+ m_frameRates.clear();
+ m_resolutions.clear();
+ m_ratesByResolution.clear();
+
+ QSet<QSize> allResolutions;
+ QSet<int> allFrameRates;
+
+ QFile f(device);
+
+ if (!f.open(QFile::ReadOnly))
+ return;
+
+ int fd = f.handle();
+
+ //get the list of formats:
+ QList<quint32> supportedFormats;
+
+ {
+ v4l2_fmtdesc fmt;
+ memset(&fmt, 0, sizeof(v4l2_fmtdesc));
+
+ fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ int sanity = 0;
+
+ for (fmt.index = 0;; fmt.index++) {
+ if (sanity++ > 8)
+ break;
+ if( ::ioctl(fd, VIDIOC_ENUM_FMT, &fmt) == -1) {
+ if(errno == EINVAL)
+ break;
+ }
+ supportedFormats.append(fmt.pixelformat);
+ }
+ }
+
+ QList<QSize> commonSizes;
+ commonSizes << QSize(128, 96)
+ <<QSize(160,120)
+ <<QSize(176, 144)
+ <<QSize(320, 240)
+ <<QSize(352, 288)
+ <<QSize(640, 480)
+ <<QSize(1024, 768)
+ <<QSize(1280, 1024)
+ <<QSize(1600, 1200)
+ <<QSize(1920, 1200)
+ <<QSize(2048, 1536)
+ <<QSize(2560, 1600)
+ <<QSize(2580, 1936);
+
+ QList<int> commonRates;
+ commonRates << 05*1000 << 75*1000 << 10*1000 << 15*1000 << 20*1000
+ << 24*1000 << 25*1000 << 30*1000 << 50*1000 << 60*1000;
+
+
+ //get the list of resolutions:
+
+ foreach (quint32 format, supportedFormats) {
+ struct v4l2_frmsizeenum formatSize;
+ memset(&formatSize, 0, sizeof(formatSize));
+ formatSize.pixel_format = format;
+
+ QList<QSize> sizeList;
+
+ if (0) {
+ char formatStr[5];
+ memcpy(formatStr, &format, 4);
+ formatStr[4] = 0;
+ qDebug() << "trying format" << formatStr;
+ }
+
+ for (int i=0;;i++) {
+ formatSize.index = i;
+ if (ioctl (fd, VIDIOC_ENUM_FRAMESIZES, &formatSize) < 0)
+ break;
+
+ if (formatSize.type == V4L2_FRMSIZE_TYPE_DISCRETE) {
+ sizeList.append(QSize(formatSize.discrete.width, formatSize.discrete.height));
+ } else {
+
+ foreach (const QSize& candidate, commonSizes) {
+ if (candidate.width() <= (int)formatSize.stepwise.max_width &&
+ candidate.height() >= (int)formatSize.stepwise.min_width &&
+ candidate.width() % formatSize.stepwise.step_width == 0 &&
+ candidate.height() <= (int)formatSize.stepwise.max_height &&
+ candidate.height() >= (int)formatSize.stepwise.min_height &&
+ candidate.height() % formatSize.stepwise.step_height == 0) {
+ sizeList.append(candidate);
+ }
+ }
+
+ if (!sizeList.contains(QSize(formatSize.stepwise.min_width, formatSize.stepwise.min_height)))
+ sizeList.prepend(QSize(formatSize.stepwise.min_width, formatSize.stepwise.min_height));
+
+ if (!sizeList.contains(QSize(formatSize.stepwise.max_width, formatSize.stepwise.max_height)))
+ sizeList.append(QSize(formatSize.stepwise.max_width, formatSize.stepwise.max_height));
+
+ break; //stepwise values are returned only for index 0
+ }
+
+ }
+
+ //and frameRates for each resolution.
+
+ foreach (const QSize &s, sizeList) {
+ allResolutions.insert(s);
+
+ struct v4l2_frmivalenum formatInterval;
+ memset(&formatInterval, 0, sizeof(formatInterval));
+ formatInterval.pixel_format = format;
+ formatInterval.width = s.width();
+ formatInterval.height = s.height();
+
+ QList<int> frameRates; //in 1/1000 of fps
+
+ for (int i=0; ; i++) {
+ formatInterval.index = i;
+
+ if (ioctl(fd, VIDIOC_ENUM_FRAMEINTERVALS, &formatInterval) < 0)
+ break;
+
+ if (formatInterval.type == V4L2_FRMIVAL_TYPE_DISCRETE) {
+ //converts seconds to fps*1000
+ if (formatInterval.discrete.numerator)
+ frameRates.append(qRound(formatInterval.discrete.denominator*1000.0 / formatInterval.discrete.numerator));
+ } else {
+ if (formatInterval.stepwise.min.numerator == 0 ||
+ formatInterval.stepwise.max.numerator == 0) {
+ qWarning() << "received invalid frame interval";
+ break;
+ }
+
+
+ int minRate = qRound(formatInterval.stepwise.min.denominator*1000.0 /
+ formatInterval.stepwise.min.numerator);
+
+ int maxRate = qRound(formatInterval.stepwise.max.denominator*1000.0 /
+ formatInterval.stepwise.max.numerator);
+
+
+ foreach (int candidate, commonRates) {
+ if (candidate >= minRate && candidate <= maxRate)
+ frameRates.append(candidate);
+ }
+
+ if (!frameRates.contains(minRate))
+ frameRates.prepend(minRate);
+
+ if (!frameRates.contains(maxRate))
+ frameRates.append(maxRate);
+
+ break; //stepwise values are returned only for index 0
+ }
+ }
+ allFrameRates.unite(frameRates.toSet());
+ m_ratesByResolution[s].unite(frameRates.toSet());
+ }
+ }
+
+ f.close();
+
+ foreach(int rate, allFrameRates) {
+ m_frameRates.append(rate/1000.0);
+ }
+
+ qSort(m_frameRates);
+
+ m_resolutions = allResolutions.toList();
+ qSort(m_resolutions);
+
+ //qDebug() << "frame rates:" << m_frameRates;
+ //qDebug() << "resolutions:" << m_resolutions;
+}
+
+
+QList<qreal> QGstreamerCameraControl::supportedFrameRates(const QSize &frameSize) const
+{
+ if (frameSize.isEmpty())
+ return m_frameRates;
+ else {
+ QList<qreal> res;
+ foreach(int rate, m_ratesByResolution[frameSize]) {
+ res.append(rate/1000.0);
+ }
+ return res;
+ }
+}
+
+QList<QSize> QGstreamerCameraControl::supportedResolutions(qreal frameRate) const
+{
+ Q_UNUSED(frameRate);
+ return m_resolutions;
+}
diff --git a/plugins/gstreamer/mediacapture/qgstreamercameracontrol.h b/plugins/multimedia/gstreamer/mediacapture/qgstreamercameracontrol.h
index 1b0a66296f..a1d7248d4a 100644
--- a/plugins/gstreamer/mediacapture/qgstreamercameracontrol.h
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamercameracontrol.h
@@ -46,7 +46,7 @@
#include <experimental/qcameracontrol.h>
#include "qgstreamercapturesession.h"
-class QGstreamerCameraControl : public QCameraControl, public QGstreamerElementFactory
+class QGstreamerCameraControl : public QCameraControl, public QGstreamerVideoInput
{
Q_OBJECT
public:
@@ -62,6 +62,9 @@ public:
void start();
void stop();
+ QList<qreal> supportedFrameRates(const QSize &frameSize = QSize()) const;
+ QList<QSize> supportedResolutions(qreal frameRate = -1) const;
+
public slots:
void setDevice(const QString &device);
@@ -69,6 +72,13 @@ private slots:
void updateState();
private:
+ void updateSupportedResolutions(const QString &device);
+
+ QList<qreal> m_frameRates;
+ QList<QSize> m_resolutions;
+
+ QHash<QSize, QSet<int> > m_ratesByResolution;
+
QGstreamerCaptureSession *m_session;
QByteArray m_device;
QCamera::State m_state;
diff --git a/plugins/gstreamer/mediacapture/qgstreamercapturemetadatacontrol.cpp b/plugins/multimedia/gstreamer/mediacapture/qgstreamercapturemetadatacontrol.cpp
index 5e4f7ba05a..5e4f7ba05a 100644
--- a/plugins/gstreamer/mediacapture/qgstreamercapturemetadatacontrol.cpp
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamercapturemetadatacontrol.cpp
diff --git a/plugins/gstreamer/mediacapture/qgstreamercapturemetadatacontrol.h b/plugins/multimedia/gstreamer/mediacapture/qgstreamercapturemetadatacontrol.h
index 1b9b97c95f..1b9b97c95f 100644
--- a/plugins/gstreamer/mediacapture/qgstreamercapturemetadatacontrol.h
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamercapturemetadatacontrol.h
diff --git a/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp b/plugins/multimedia/gstreamer/mediacapture/qgstreamercaptureservice.cpp
index ceb176aec4..76ce95cb38 100644
--- a/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamercaptureservice.cpp
@@ -45,6 +45,7 @@
#include "qgstreamermediaformatcontrol.h"
#include "qgstreameraudioencode.h"
#include "qgstreamervideoencode.h"
+#include "qgstreamerimageencode.h"
#include "qgstreamerbushelper.h"
#include "qgstreamercameracontrol.h"
#include "qgstreamercapturemetadatacontrol.h"
@@ -233,6 +234,10 @@ QMediaControl *QGstreamerCaptureService::control(const char *name) const
if (qstrcmp(name,QVideoEncoderControl_iid) == 0)
return m_captureSession->videoEncodeControl();
+ if (qstrcmp(name,QImageEncoderControl_iid) == 0)
+ return m_captureSession->imageEncodeControl();
+
+
if (qstrcmp(name,QMediaFormatControl_iid) == 0)
return m_captureSession->mediaFormatControl();
diff --git a/plugins/gstreamer/mediacapture/qgstreamercaptureservice.h b/plugins/multimedia/gstreamer/mediacapture/qgstreamercaptureservice.h
index 424157b3e7..424157b3e7 100644
--- a/plugins/gstreamer/mediacapture/qgstreamercaptureservice.h
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamercaptureservice.h
diff --git a/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp b/plugins/multimedia/gstreamer/mediacapture/qgstreamercapturesession.cpp
index f9145f05fd..86838ae426 100644
--- a/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamercapturesession.cpp
@@ -44,6 +44,7 @@
#include "qgstreamermediaformatcontrol.h"
#include "qgstreameraudioencode.h"
#include "qgstreamervideoencode.h"
+#include "qgstreamerimageencode.h"
#include "qgstreamerbushelper.h"
#include <qmediarecorder.h>
@@ -82,7 +83,8 @@ QGstreamerCaptureSession::QGstreamerCaptureSession(QGstreamerCaptureSession::Cap
m_videoPreview(0),
m_imageCaptureBin(0),
m_encodeBin(0),
- m_passImage(false)
+ m_passImage(false),
+ m_passPrerollImage(false)
{
m_pipeline = gst_pipeline_new("media-capture-pipeline");
gstRef(m_pipeline);
@@ -93,6 +95,7 @@ QGstreamerCaptureSession::QGstreamerCaptureSession(QGstreamerCaptureSession::Cap
connect(m_busHelper, SIGNAL(message(QGstreamerMessage)), SLOT(busMessage(QGstreamerMessage)));
m_audioEncodeControl = new QGstreamerAudioEncode(this);
m_videoEncodeControl = new QGstreamerVideoEncode(this);
+ m_imageEncodeControl = new QGstreamerImageEncode(this);
m_recorderControl = new QGstreamerRecorderControl(this);
m_mediaFormatControl = new QGstreamerMediaFormatControl(this);
@@ -333,8 +336,83 @@ static gboolean passImageFilter(GstElement *element,
Q_UNUSED(buffer);
QGstreamerCaptureSession *session = (QGstreamerCaptureSession *)appdata;
- if (session->m_passImage) {
+ if (session->m_passImage || session->m_passPrerollImage) {
session->m_passImage = false;
+
+ if (session->m_passPrerollImage) {
+ session->m_passPrerollImage = false;
+ return TRUE;
+ }
+ session->m_passPrerollImage = false;
+
+ QImage img;
+
+ GstCaps *caps = gst_buffer_get_caps(buffer);
+ if (caps) {
+ GstStructure *structure = gst_caps_get_structure (caps, 0);
+ gint width = 0;
+ gint height = 0;
+
+ if (structure &&
+ gst_structure_get_int(structure, "width", &width) &&
+ gst_structure_get_int(structure, "height", &height) &&
+ width > 0 && height > 0) {
+ if (qstrcmp(gst_structure_get_name(structure), "video/x-raw-yuv") == 0) {
+ guint32 fourcc = 0;
+ gst_structure_get_fourcc(structure, "format", &fourcc);
+
+ if (fourcc == GST_MAKE_FOURCC('I','4','2','0')) {
+ img = QImage(width/2, height/2, QImage::Format_RGB32);
+
+ const uchar *data = (const uchar *)buffer->data;
+
+ for (int y=0; y<height; y+=2) {
+ const uchar *yLine = data + y*width;
+ const uchar *uLine = data + width*height + y*width/4;
+ const uchar *vLine = data + width*height*5/4 + y*width/4;
+
+ for (int x=0; x<width; x+=2) {
+ const qreal Y = 1.164*(yLine[x]-16);
+ const int U = uLine[x/2]-128;
+ const int V = vLine[x/2]-128;
+
+ int b = qBound(0, int(Y + 2.018*U), 255);
+ int g = qBound(0, int(Y - 0.813*V - 0.391*U), 255);
+ int r = qBound(0, int(Y + 1.596*V), 255);
+
+ img.setPixel(x/2,y/2,qRgb(r,g,b));
+ }
+ }
+ }
+
+ } else if (qstrcmp(gst_structure_get_name(structure), "video/x-raw-rgb") == 0) {
+ QImage::Format format = QImage::Format_Invalid;
+ int bpp = 0;
+ gst_structure_get_int(structure, "bpp", &bpp);
+
+ if (bpp == 24)
+ format = QImage::Format_RGB888;
+ else if (bpp == 32)
+ format = QImage::Format_RGB32;
+
+ if (format != QImage::Format_Invalid) {
+ img = QImage((const uchar *)buffer->data,
+ width,
+ height,
+ format);
+ img.bits(); //detach
+ }
+ }
+ }
+ gst_caps_unref(caps);
+ }
+
+ static int signalIndex = session->metaObject()->indexOfSignal("imageCaptured(QString,QImage)");
+ session->metaObject()->method(signalIndex).invoke(session,
+ Qt::QueuedConnection,
+ Q_ARG(QString,session->m_imageFileName),
+ Q_ARG(QImage,img));
+
return TRUE;
} else {
return FALSE;
@@ -358,11 +436,10 @@ static gboolean saveImageFilter(GstElement *element,
f.write((const char *)buffer->data, buffer->size);
f.close();
- static int signalIndex = session->metaObject()->indexOfSignal("imageCaptured(QString,QImage)");
+ static int signalIndex = session->metaObject()->indexOfSignal("imageSaved(QString)");
session->metaObject()->method(signalIndex).invoke(session,
Qt::QueuedConnection,
- Q_ARG(QString,fileName),
- Q_ARG(QImage,QImage()));
+ Q_ARG(QString,fileName));
}
}
@@ -394,7 +471,8 @@ GstElement *QGstreamerCaptureSession::buildImageCapture()
gst_element_add_pad(GST_ELEMENT(bin), gst_ghost_pad_new("imagesink", pad));
gst_object_unref(GST_OBJECT(pad));
- m_passImage = true;
+ m_passImage = false;
+ m_passPrerollImage = true;
m_imageFileName = QString();
return bin;
@@ -585,7 +663,7 @@ void QGstreamerCaptureSession::setAudioPreview(QGstreamerElementFactory *audioPr
m_audioPreviewFactory = audioPreview;
}
-void QGstreamerCaptureSession::setVideoInput(QGstreamerElementFactory *videoInput)
+void QGstreamerCaptureSession::setVideoInput(QGstreamerVideoInput *videoInput)
{
m_videoInputFactory = videoInput;
}
@@ -838,3 +916,4 @@ void QGstreamerCaptureSession::busMessage(const QGstreamerMessage &message)
}
}
}
+
diff --git a/plugins/gstreamer/mediacapture/qgstreamercapturesession.h b/plugins/multimedia/gstreamer/mediacapture/qgstreamercapturesession.h
index 1f5f1956eb..b85ea28fb9 100644
--- a/plugins/gstreamer/mediacapture/qgstreamercapturesession.h
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamercapturesession.h
@@ -55,6 +55,7 @@ class QGstreamerMessage;
class QGstreamerBusHelper;
class QGstreamerAudioEncode;
class QGstreamerVideoEncode;
+class QGstreamerImageEncode;
class QGstreamerRecorderControl;
class QGstreamerMediaFormatControl;
@@ -65,6 +66,13 @@ public:
virtual void prepareWinId() {}
};
+class QGstreamerVideoInput : public QGstreamerElementFactory
+{
+public:
+ virtual QList<qreal> supportedFrameRates(const QSize &frameSize = QSize()) const = 0;
+ virtual QList<QSize> supportedResolutions(qreal frameRate = -1) const = 0;
+};
+
class QGstreamerCaptureSession : public QObject, public QGstreamerSyncEventFilter
{
Q_OBJECT
@@ -83,13 +91,21 @@ public:
QGstreamerAudioEncode *audioEncodeControl() const { return m_audioEncodeControl; }
QGstreamerVideoEncode *videoEncodeControl() const { return m_videoEncodeControl; }
+ QGstreamerImageEncode *imageEncodeControl() const { return m_imageEncodeControl; }
+
QGstreamerRecorderControl *recorderControl() const { return m_recorderControl; }
QGstreamerMediaFormatControl *mediaFormatControl() const { return m_mediaFormatControl; }
+ QGstreamerElementFactory *audioInput() const { return m_audioInputFactory; }
void setAudioInput(QGstreamerElementFactory *audioInput);
+
+ QGstreamerElementFactory *audioPreview() const { return m_audioPreviewFactory; }
void setAudioPreview(QGstreamerElementFactory *audioPreview);
- void setVideoInput(QGstreamerElementFactory *videoInput);
+ QGstreamerVideoInput *videoInput() const { return m_videoInputFactory; }
+ void setVideoInput(QGstreamerVideoInput *videoInput);
+
+ QGstreamerElementFactory *videoPreview() const { return m_videoPreviewFactory; }
void setVideoPreview(QGstreamerElementFactory *videoPreview);
void captureImage(const QString &fileName);
@@ -139,11 +155,12 @@ private:
QGstreamerElementFactory *m_audioInputFactory;
QGstreamerElementFactory *m_audioPreviewFactory;
- QGstreamerElementFactory *m_videoInputFactory;
+ QGstreamerVideoInput *m_videoInputFactory;
QGstreamerElementFactory *m_videoPreviewFactory;
QGstreamerAudioEncode *m_audioEncodeControl;
QGstreamerVideoEncode *m_videoEncodeControl;
+ QGstreamerImageEncode *m_imageEncodeControl;
QGstreamerRecorderControl *m_recorderControl;
QGstreamerMediaFormatControl *m_mediaFormatControl;
@@ -167,6 +184,7 @@ private:
public:
bool m_passImage;
+ bool m_passPrerollImage;
QString m_imageFileName;
};
diff --git a/plugins/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp b/plugins/multimedia/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp
index d7dc6df482..d7dc6df482 100644
--- a/plugins/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp
diff --git a/plugins/gstreamer/mediacapture/qgstreamerimagecapturecontrol.h b/plugins/multimedia/gstreamer/mediacapture/qgstreamerimagecapturecontrol.h
index 7bd3377fcb..7bd3377fcb 100644
--- a/plugins/gstreamer/mediacapture/qgstreamerimagecapturecontrol.h
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamerimagecapturecontrol.h
diff --git a/plugins/multimedia/gstreamer/mediacapture/qgstreamerimageencode.cpp b/plugins/multimedia/gstreamer/mediacapture/qgstreamerimageencode.cpp
new file mode 100644
index 0000000000..ae7c6e29ca
--- /dev/null
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamerimageencode.cpp
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qgstreamerimageencode.h"
+#include "qgstreamercapturesession.h"
+
+#include <QtCore/qdebug.h>
+
+#include <math.h>
+
+QGstreamerImageEncode::QGstreamerImageEncode(QGstreamerCaptureSession *session)
+ :QImageEncoderControl(session), m_session(session)
+{
+}
+
+QGstreamerImageEncode::~QGstreamerImageEncode()
+{
+}
+
+QSize QGstreamerImageEncode::minimumResolution(const QImageEncoderSettings &) const
+{
+ return QSize(16,16);
+}
+
+QSize QGstreamerImageEncode::maximumResolution(const QImageEncoderSettings &) const
+{
+ return QSize(4096,4096);
+}
+
+QList<QSize> QGstreamerImageEncode::supportedResolutions(const QImageEncoderSettings &) const
+{
+ return m_session->videoInput() ? m_session->videoInput()->supportedResolutions() : QList<QSize>();
+}
+
+QStringList QGstreamerImageEncode::supportedImageCodecs() const
+{
+ return QStringList() << "jpeg";
+}
+
+QString QGstreamerImageEncode::imageCodecDescription(const QString &codecName) const
+{
+ if (codecName == "jpeg")
+ return tr("JPEG image encoder");
+
+ return QString();
+}
+
+QImageEncoderSettings QGstreamerImageEncode::imageSettings() const
+{
+ return m_settings;
+}
+
+void QGstreamerImageEncode::setImageSettings(const QImageEncoderSettings &settings)
+{
+ m_settings = settings;
+}
diff --git a/plugins/multimedia/gstreamer/mediacapture/qgstreamerimageencode.h b/plugins/multimedia/gstreamer/mediacapture/qgstreamerimageencode.h
new file mode 100644
index 0000000000..47f5461abc
--- /dev/null
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamerimageencode.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTREAMERIMAGEENCODE_H
+#define QGSTREAMERIMAGEENCODE_H
+
+class QGstreamerCaptureSession;
+
+#include <qimageencodercontrol.h>
+
+#include <QtCore/qstringlist.h>
+#include <QtCore/qmap.h>
+
+#include <gst/gst.h>
+
+class QGstreamerImageEncode : public QImageEncoderControl
+{
+ Q_OBJECT
+public:
+ QGstreamerImageEncode(QGstreamerCaptureSession *session);
+ virtual ~QGstreamerImageEncode();
+
+ QSize minimumResolution(const QImageEncoderSettings &settings = QImageEncoderSettings()) const;
+ QSize maximumResolution(const QImageEncoderSettings &settings = QImageEncoderSettings()) const;
+ QList<QSize> supportedResolutions(const QImageEncoderSettings &settings = QImageEncoderSettings()) const;
+
+ QStringList supportedImageCodecs() const;
+ QString imageCodecDescription(const QString &codecName) const;
+
+ QImageEncoderSettings imageSettings() const;
+ void setImageSettings(const QImageEncoderSettings &settings);
+
+private:
+ QImageEncoderSettings m_settings;
+
+ QGstreamerCaptureSession *m_session;
+};
+
+#endif
diff --git a/plugins/gstreamer/mediacapture/qgstreamermediaformatcontrol.cpp b/plugins/multimedia/gstreamer/mediacapture/qgstreamermediaformatcontrol.cpp
index fd4f746c4f..fd4f746c4f 100644
--- a/plugins/gstreamer/mediacapture/qgstreamermediaformatcontrol.cpp
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamermediaformatcontrol.cpp
diff --git a/plugins/gstreamer/mediacapture/qgstreamermediaformatcontrol.h b/plugins/multimedia/gstreamer/mediacapture/qgstreamermediaformatcontrol.h
index 6840309e8f..6840309e8f 100644
--- a/plugins/gstreamer/mediacapture/qgstreamermediaformatcontrol.h
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamermediaformatcontrol.h
diff --git a/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp b/plugins/multimedia/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
index 45dbd72221..45dbd72221 100644
--- a/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
diff --git a/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.h b/plugins/multimedia/gstreamer/mediacapture/qgstreamerrecordercontrol.h
index ec9937a008..ec9937a008 100644
--- a/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.h
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamerrecordercontrol.h
diff --git a/plugins/gstreamer/mediacapture/qgstreamervideoencode.cpp b/plugins/multimedia/gstreamer/mediacapture/qgstreamervideoencode.cpp
index f331ac60c6..149c44d14f 100644
--- a/plugins/gstreamer/mediacapture/qgstreamervideoencode.cpp
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamervideoencode.cpp
@@ -46,8 +46,8 @@
#include <math.h>
-QGstreamerVideoEncode::QGstreamerVideoEncode(QObject *parent)
- :QVideoEncoderControl(parent)
+QGstreamerVideoEncode::QGstreamerVideoEncode(QGstreamerCaptureSession *session)
+ :QVideoEncoderControl(session), m_session(session)
{
QList<QByteArray> codecCandidates;
codecCandidates << "video/h264" << "video/xvid" << "video/mpeg4" << "video/mpeg1" << "video/mpeg2" << "video/theora";
@@ -86,44 +86,34 @@ QGstreamerVideoEncode::~QGstreamerVideoEncode()
{
}
-QSize QGstreamerVideoEncode::minimumResolution() const
+QSize QGstreamerVideoEncode::minimumResolution(const QVideoEncoderSettings &) const
{
return QSize(16,16);
}
-QSize QGstreamerVideoEncode::maximumResolution() const
+QSize QGstreamerVideoEncode::maximumResolution(const QVideoEncoderSettings &) const
{
return QSize(4096,4096);
}
-QList<QSize> QGstreamerVideoEncode::supportedResolutions() const
+QList<QSize> QGstreamerVideoEncode::supportedResolutions(const QVideoEncoderSettings &) const
{
- QList<QSize> res;
- res << QSize(160, 120);
- res << QSize(320, 240);
- res << QSize(640, 480);
- res << QSize(800, 600);
- res << QSize(960, 720);
- res << QSize(1600, 1200);
-
- return res;
+ return m_session->videoInput() ? m_session->videoInput()->supportedResolutions() : QList<QSize>();
}
-qreal QGstreamerVideoEncode::minimumFrameRate() const
+qreal QGstreamerVideoEncode::minimumFrameRate(const QVideoEncoderSettings &) const
{
return 1.0;
}
-qreal QGstreamerVideoEncode::maximumFrameRate() const
+qreal QGstreamerVideoEncode::maximumFrameRate(const QVideoEncoderSettings &) const
{
return 30.0;
}
-QList< qreal > QGstreamerVideoEncode::supportedFrameRates() const
+QList< qreal > QGstreamerVideoEncode::supportedFrameRates(const QVideoEncoderSettings &) const
{
- QList<qreal> res;
- res << 30.0 << 25.0 << 15.0 << 10.0 << 5.0;
- return res;
+ return m_session->videoInput() ? m_session->videoInput()->supportedFrameRates() : QList<qreal>();
}
QStringList QGstreamerVideoEncode::supportedVideoCodecs() const
diff --git a/plugins/gstreamer/mediacapture/qgstreamervideoencode.h b/plugins/multimedia/gstreamer/mediacapture/qgstreamervideoencode.h
index 87d66816a4..4d1bbbc8c5 100644
--- a/plugins/gstreamer/mediacapture/qgstreamervideoencode.h
+++ b/plugins/multimedia/gstreamer/mediacapture/qgstreamervideoencode.h
@@ -54,16 +54,16 @@ class QGstreamerVideoEncode : public QVideoEncoderControl
{
Q_OBJECT
public:
- QGstreamerVideoEncode(QObject *parent);
+ QGstreamerVideoEncode(QGstreamerCaptureSession *session);
virtual ~QGstreamerVideoEncode();
- QSize minimumResolution() const;
- QSize maximumResolution() const;
- QList<QSize> supportedResolutions() const;
+ QSize minimumResolution(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
+ QSize maximumResolution(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
+ QList<QSize> supportedResolutions(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
- qreal minimumFrameRate() const;
- qreal maximumFrameRate() const;
- QList< qreal > supportedFrameRates() const;
+ qreal minimumFrameRate(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
+ qreal maximumFrameRate(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
+ QList< qreal > supportedFrameRates(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
QPair<int,int> rateAsRational() const;
@@ -80,6 +80,8 @@ public:
GstElement *createEncoder();
private:
+ QGstreamerCaptureSession *m_session;
+
QStringList m_codecs;
QMap<QString,QString> m_codecDescriptions;
QMap<QString,QByteArray> m_elementNames;
diff --git a/plugins/gstreamer/mediaplayer/mediaplayer.pri b/plugins/multimedia/gstreamer/mediaplayer/mediaplayer.pri
index fcfbd063b9..fcfbd063b9 100644
--- a/plugins/gstreamer/mediaplayer/mediaplayer.pri
+++ b/plugins/multimedia/gstreamer/mediaplayer/mediaplayer.pri
diff --git a/plugins/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp b/plugins/multimedia/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp
index e147d76ec2..e147d76ec2 100644
--- a/plugins/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp
+++ b/plugins/multimedia/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp
diff --git a/plugins/gstreamer/mediaplayer/qgstreamermetadataprovider.h b/plugins/multimedia/gstreamer/mediaplayer/qgstreamermetadataprovider.h
index 0ae9243190..0ae9243190 100644
--- a/plugins/gstreamer/mediaplayer/qgstreamermetadataprovider.h
+++ b/plugins/multimedia/gstreamer/mediaplayer/qgstreamermetadataprovider.h
diff --git a/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp
index 546f9fe24d..546f9fe24d 100644
--- a/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp
+++ b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp
diff --git a/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.h b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayercontrol.h
index 04b8cab089..04b8cab089 100644
--- a/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.h
+++ b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayercontrol.h
diff --git a/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.cpp b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayerservice.cpp
index 0468b8c544..0468b8c544 100644
--- a/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.cpp
+++ b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayerservice.cpp
diff --git a/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.h b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayerservice.h
index c2b2111f3a..c2b2111f3a 100644
--- a/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.h
+++ b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayerservice.h
diff --git a/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.cpp
index 2ef3fd2fc5..2ef3fd2fc5 100644
--- a/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp
+++ b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.cpp
diff --git a/plugins/gstreamer/mediaplayer/qgstreamerplayersession.h b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.h
index fd2c0613ca..fd2c0613ca 100644
--- a/plugins/gstreamer/mediaplayer/qgstreamerplayersession.h
+++ b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.h
diff --git a/plugins/gstreamer/mediaplayer/qgstreamerstreamscontrol.cpp b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerstreamscontrol.cpp
index 22c0b95478..22c0b95478 100644
--- a/plugins/gstreamer/mediaplayer/qgstreamerstreamscontrol.cpp
+++ b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerstreamscontrol.cpp
diff --git a/plugins/gstreamer/mediaplayer/qgstreamerstreamscontrol.h b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerstreamscontrol.h
index c392fce80a..c392fce80a 100644
--- a/plugins/gstreamer/mediaplayer/qgstreamerstreamscontrol.h
+++ b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerstreamscontrol.h
diff --git a/plugins/gstreamer/qgstreameraudioinputdevicecontrol.cpp b/plugins/multimedia/gstreamer/qgstreameraudioinputdevicecontrol.cpp
index b8fa26ac30..b8fa26ac30 100644
--- a/plugins/gstreamer/qgstreameraudioinputdevicecontrol.cpp
+++ b/plugins/multimedia/gstreamer/qgstreameraudioinputdevicecontrol.cpp
diff --git a/plugins/gstreamer/qgstreameraudioinputdevicecontrol.h b/plugins/multimedia/gstreamer/qgstreameraudioinputdevicecontrol.h
index ee97a33cb7..ee97a33cb7 100644
--- a/plugins/gstreamer/qgstreameraudioinputdevicecontrol.h
+++ b/plugins/multimedia/gstreamer/qgstreameraudioinputdevicecontrol.h
diff --git a/plugins/gstreamer/qgstreamerbushelper.cpp b/plugins/multimedia/gstreamer/qgstreamerbushelper.cpp
index 0f09c6b03b..0f09c6b03b 100644
--- a/plugins/gstreamer/qgstreamerbushelper.cpp
+++ b/plugins/multimedia/gstreamer/qgstreamerbushelper.cpp
diff --git a/plugins/gstreamer/qgstreamerbushelper.h b/plugins/multimedia/gstreamer/qgstreamerbushelper.h
index fe384321a9..fe384321a9 100644
--- a/plugins/gstreamer/qgstreamerbushelper.h
+++ b/plugins/multimedia/gstreamer/qgstreamerbushelper.h
diff --git a/plugins/gstreamer/qgstreamermessage.cpp b/plugins/multimedia/gstreamer/qgstreamermessage.cpp
index 19cdfb19fa..19cdfb19fa 100644
--- a/plugins/gstreamer/qgstreamermessage.cpp
+++ b/plugins/multimedia/gstreamer/qgstreamermessage.cpp
diff --git a/plugins/gstreamer/qgstreamermessage.h b/plugins/multimedia/gstreamer/qgstreamermessage.h
index 73028d29e5..73028d29e5 100644
--- a/plugins/gstreamer/qgstreamermessage.h
+++ b/plugins/multimedia/gstreamer/qgstreamermessage.h
diff --git a/plugins/gstreamer/qgstreamerserviceplugin.cpp b/plugins/multimedia/gstreamer/qgstreamerserviceplugin.cpp
index 43b7bc1d03..43b7bc1d03 100644
--- a/plugins/gstreamer/qgstreamerserviceplugin.cpp
+++ b/plugins/multimedia/gstreamer/qgstreamerserviceplugin.cpp
diff --git a/plugins/gstreamer/qgstreamerserviceplugin.h b/plugins/multimedia/gstreamer/qgstreamerserviceplugin.h
index 9b9aef3df7..9b9aef3df7 100644
--- a/plugins/gstreamer/qgstreamerserviceplugin.h
+++ b/plugins/multimedia/gstreamer/qgstreamerserviceplugin.h
diff --git a/plugins/gstreamer/qgstreamervideoinputdevicecontrol.cpp b/plugins/multimedia/gstreamer/qgstreamervideoinputdevicecontrol.cpp
index b0b7667d03..b0b7667d03 100644
--- a/plugins/gstreamer/qgstreamervideoinputdevicecontrol.cpp
+++ b/plugins/multimedia/gstreamer/qgstreamervideoinputdevicecontrol.cpp
diff --git a/plugins/gstreamer/qgstreamervideoinputdevicecontrol.h b/plugins/multimedia/gstreamer/qgstreamervideoinputdevicecontrol.h
index 5c03b07ff0..5c03b07ff0 100644
--- a/plugins/gstreamer/qgstreamervideoinputdevicecontrol.h
+++ b/plugins/multimedia/gstreamer/qgstreamervideoinputdevicecontrol.h
diff --git a/plugins/gstreamer/qgstreamervideooutputcontrol.cpp b/plugins/multimedia/gstreamer/qgstreamervideooutputcontrol.cpp
index 10d446f056..10d446f056 100644
--- a/plugins/gstreamer/qgstreamervideooutputcontrol.cpp
+++ b/plugins/multimedia/gstreamer/qgstreamervideooutputcontrol.cpp
diff --git a/plugins/gstreamer/qgstreamervideooutputcontrol.h b/plugins/multimedia/gstreamer/qgstreamervideooutputcontrol.h
index 36a8288ff1..36a8288ff1 100644
--- a/plugins/gstreamer/qgstreamervideooutputcontrol.h
+++ b/plugins/multimedia/gstreamer/qgstreamervideooutputcontrol.h
diff --git a/plugins/gstreamer/qgstreamervideooverlay.cpp b/plugins/multimedia/gstreamer/qgstreamervideooverlay.cpp
index 8dbe3db988..8dbe3db988 100644
--- a/plugins/gstreamer/qgstreamervideooverlay.cpp
+++ b/plugins/multimedia/gstreamer/qgstreamervideooverlay.cpp
diff --git a/plugins/gstreamer/qgstreamervideooverlay.h b/plugins/multimedia/gstreamer/qgstreamervideooverlay.h
index 05e66a7474..05e66a7474 100644
--- a/plugins/gstreamer/qgstreamervideooverlay.h
+++ b/plugins/multimedia/gstreamer/qgstreamervideooverlay.h
diff --git a/plugins/gstreamer/qgstreamervideorenderer.cpp b/plugins/multimedia/gstreamer/qgstreamervideorenderer.cpp
index 1a3a04e54a..1a3a04e54a 100644
--- a/plugins/gstreamer/qgstreamervideorenderer.cpp
+++ b/plugins/multimedia/gstreamer/qgstreamervideorenderer.cpp
diff --git a/plugins/gstreamer/qgstreamervideorenderer.h b/plugins/multimedia/gstreamer/qgstreamervideorenderer.h
index be1e057ba6..be1e057ba6 100644
--- a/plugins/gstreamer/qgstreamervideorenderer.h
+++ b/plugins/multimedia/gstreamer/qgstreamervideorenderer.h
diff --git a/plugins/gstreamer/qgstreamervideorendererinterface.cpp b/plugins/multimedia/gstreamer/qgstreamervideorendererinterface.cpp
index 57df692e2e..57df692e2e 100644
--- a/plugins/gstreamer/qgstreamervideorendererinterface.cpp
+++ b/plugins/multimedia/gstreamer/qgstreamervideorendererinterface.cpp
diff --git a/plugins/gstreamer/qgstreamervideorendererinterface.h b/plugins/multimedia/gstreamer/qgstreamervideorendererinterface.h
index fd7fba5cad..fd7fba5cad 100644
--- a/plugins/gstreamer/qgstreamervideorendererinterface.h
+++ b/plugins/multimedia/gstreamer/qgstreamervideorendererinterface.h
diff --git a/plugins/gstreamer/qgstreamervideowidget.cpp b/plugins/multimedia/gstreamer/qgstreamervideowidget.cpp
index 7b2ec1457f..7b2ec1457f 100644
--- a/plugins/gstreamer/qgstreamervideowidget.cpp
+++ b/plugins/multimedia/gstreamer/qgstreamervideowidget.cpp
diff --git a/plugins/gstreamer/qgstreamervideowidget.h b/plugins/multimedia/gstreamer/qgstreamervideowidget.h
index f00b785f26..f00b785f26 100644
--- a/plugins/gstreamer/qgstreamervideowidget.h
+++ b/plugins/multimedia/gstreamer/qgstreamervideowidget.h
diff --git a/plugins/gstreamer/qgstvideobuffer.cpp b/plugins/multimedia/gstreamer/qgstvideobuffer.cpp
index 6be6c6aa23..6be6c6aa23 100644
--- a/plugins/gstreamer/qgstvideobuffer.cpp
+++ b/plugins/multimedia/gstreamer/qgstvideobuffer.cpp
diff --git a/plugins/gstreamer/qgstvideobuffer.h b/plugins/multimedia/gstreamer/qgstvideobuffer.h
index a98f8c3848..a98f8c3848 100644
--- a/plugins/gstreamer/qgstvideobuffer.h
+++ b/plugins/multimedia/gstreamer/qgstvideobuffer.h
diff --git a/plugins/gstreamer/qvideosurfacegstsink.cpp b/plugins/multimedia/gstreamer/qvideosurfacegstsink.cpp
index 7c5805cc63..7c5805cc63 100644
--- a/plugins/gstreamer/qvideosurfacegstsink.cpp
+++ b/plugins/multimedia/gstreamer/qvideosurfacegstsink.cpp
diff --git a/plugins/gstreamer/qvideosurfacegstsink.h b/plugins/multimedia/gstreamer/qvideosurfacegstsink.h
index 241b3f7e41..241b3f7e41 100644
--- a/plugins/gstreamer/qvideosurfacegstsink.h
+++ b/plugins/multimedia/gstreamer/qvideosurfacegstsink.h
diff --git a/plugins/gstreamer/qx11videosurface.cpp b/plugins/multimedia/gstreamer/qx11videosurface.cpp
index b700e2d3e7..56c1405a81 100644
--- a/plugins/gstreamer/qx11videosurface.cpp
+++ b/plugins/multimedia/gstreamer/qx11videosurface.cpp
@@ -190,6 +190,8 @@ void QX11VideoSurface::setWinId(WId id)
QAbstractVideoSurface::stop();
}
+
+ emit supportedFormatsChanged();
}
QRect QX11VideoSurface::displayRect() const
diff --git a/plugins/gstreamer/qx11videosurface.h b/plugins/multimedia/gstreamer/qx11videosurface.h
index 303d35fa58..303d35fa58 100644
--- a/plugins/gstreamer/qx11videosurface.h
+++ b/plugins/multimedia/gstreamer/qx11videosurface.h
diff --git a/plugins/m3u/m3u.pro b/plugins/multimedia/m3u/m3u.pro
index 6425bc5eac..3a3bec0894 100644
--- a/plugins/m3u/m3u.pro
+++ b/plugins/multimedia/m3u/m3u.pro
@@ -4,17 +4,21 @@ TARGET = $$qtLibraryTarget(m3u)
PLUGIN_TYPE = playlistformats
-include (../../common.pri)
+include (../../../common.pri)
qtAddLibrary(QtMedia)
DEPENDPATH += .
INCLUDEPATH += . \
- ../../src/multimedia
+ ../../../src/multimedia
HEADERS += qm3uhandler.h
SOURCES += main.cpp \
qm3uhandler.cpp
+symbian {
+ TARGET.CAPABILITY = ALL -TCB
+ TARGET.EPOCALLOWDLLDATA = 1
+}
target.path=$$QT_MOBILITY_PREFIX/plugins/playlistformats
INSTALLS+=target
diff --git a/plugins/m3u/main.cpp b/plugins/multimedia/m3u/main.cpp
index 653b6d2520..653b6d2520 100644
--- a/plugins/m3u/main.cpp
+++ b/plugins/multimedia/m3u/main.cpp
diff --git a/plugins/m3u/qm3uhandler.cpp b/plugins/multimedia/m3u/qm3uhandler.cpp
index 0a99d6aba4..0a99d6aba4 100644
--- a/plugins/m3u/qm3uhandler.cpp
+++ b/plugins/multimedia/m3u/qm3uhandler.cpp
diff --git a/plugins/m3u/qm3uhandler.h b/plugins/multimedia/m3u/qm3uhandler.h
index 13137395ff..13137395ff 100644
--- a/plugins/m3u/qm3uhandler.h
+++ b/plugins/multimedia/m3u/qm3uhandler.h
diff --git a/plugins/multimedia/multimedia.pro b/plugins/multimedia/multimedia.pro
new file mode 100644
index 0000000000..62babe0452
--- /dev/null
+++ b/plugins/multimedia/multimedia.pro
@@ -0,0 +1,37 @@
+######################################################################
+#
+# Mobility API project - multimedia
+#
+######################################################################
+
+TEMPLATE = subdirs
+
+SUBDIRS += m3u
+
+win32:!wince* {
+ TMP_INCLUDE = $$quote($$(INCLUDE))
+ TMP_SEARCHPATHS = $$split(TMP_INCLUDE, ";") $$QMAKE_INCDIR
+ for(p, TMP_SEARCHPATHS): exists($${p}/wmp.h): SUBDIRS *= wmp
+ for(p, TMP_SEARCHPATHS): exists($${p}/dshow.h) {
+ win32-msvc2005: SUBDIRS *= directshow
+ win32-msvc2008: SUBDIRS *= directshow
+ }
+}
+
+unix:!mac:!symbian {
+ TMP_GST_LIBS = \
+ gstreamer-0.10 >= 0.10.19 \
+ gstreamer-base-0.10 >= 0.10.19 \
+ gstreamer-interfaces-0.10 >= 0.10.19 \
+ gstreamer-audio-0.10 >= 0.10.19 \
+ gstreamer-video-0.10 >= 0.10.19
+ system(pkg-config --exists \'$${TMP_GST_LIBS}\' --print-errors): {
+ SUBDIRS += gstreamer v4l
+ } else {
+ contains(QT_CONFIG, multimedia): SUBDIRS += audiocapture v4l
+ }
+
+} else {
+ contains(QT_CONFIG, phonon): SUBDIRS += phonon
+ contains(QT_CONFIG, multimedia): SUBDIRS += audiocapture
+}
diff --git a/plugins/phonon/phonon.pro b/plugins/multimedia/phonon/phonon.pro
index df960cbe1b..3260335bcd 100644
--- a/plugins/phonon/phonon.pro
+++ b/plugins/multimedia/phonon/phonon.pro
@@ -5,11 +5,11 @@ TARGET = $$qtLibraryTarget(phononengine)
PLUGIN_TYPE = mediaservice
-include (../../common.pri)
+include (../../../common.pri)
qtAddLibrary(QtMedia)
-INCLUDEPATH += ../../src/multimedia
+INCLUDEPATH += ../../../src/multimedia
DEPENDPATH += .
@@ -27,5 +27,9 @@ SOURCES += \
qphononserviceplugin.cpp \
qphononmetadataprovider.cpp \
+symbian {
+ TARGET.CAPABILITY = ALL -TCB
+ TARGET.EPOCALLOWDLLDATA = 1
+}
target.path=$$QT_MOBILITY_PREFIX/plugins/mediaservice
INSTALLS+=target
diff --git a/plugins/phonon/qphononmetadataprovider.cpp b/plugins/multimedia/phonon/qphononmetadataprovider.cpp
index 9a7279038d..9a7279038d 100644
--- a/plugins/phonon/qphononmetadataprovider.cpp
+++ b/plugins/multimedia/phonon/qphononmetadataprovider.cpp
diff --git a/plugins/phonon/qphononmetadataprovider.h b/plugins/multimedia/phonon/qphononmetadataprovider.h
index d16ef37277..d16ef37277 100644
--- a/plugins/phonon/qphononmetadataprovider.h
+++ b/plugins/multimedia/phonon/qphononmetadataprovider.h
diff --git a/plugins/phonon/qphononplayercontrol.cpp b/plugins/multimedia/phonon/qphononplayercontrol.cpp
index 490a6adc6c..490a6adc6c 100644
--- a/plugins/phonon/qphononplayercontrol.cpp
+++ b/plugins/multimedia/phonon/qphononplayercontrol.cpp
diff --git a/plugins/phonon/qphononplayercontrol.h b/plugins/multimedia/phonon/qphononplayercontrol.h
index c882f59cce..c882f59cce 100644
--- a/plugins/phonon/qphononplayercontrol.h
+++ b/plugins/multimedia/phonon/qphononplayercontrol.h
diff --git a/plugins/phonon/qphononplayerservice.cpp b/plugins/multimedia/phonon/qphononplayerservice.cpp
index c26de3daec..c26de3daec 100644
--- a/plugins/phonon/qphononplayerservice.cpp
+++ b/plugins/multimedia/phonon/qphononplayerservice.cpp
diff --git a/plugins/phonon/qphononplayerservice.h b/plugins/multimedia/phonon/qphononplayerservice.h
index 0f1ef31b47..0f1ef31b47 100644
--- a/plugins/phonon/qphononplayerservice.h
+++ b/plugins/multimedia/phonon/qphononplayerservice.h
diff --git a/plugins/phonon/qphononserviceplugin.cpp b/plugins/multimedia/phonon/qphononserviceplugin.cpp
index 38f36963bd..38f36963bd 100644
--- a/plugins/phonon/qphononserviceplugin.cpp
+++ b/plugins/multimedia/phonon/qphononserviceplugin.cpp
diff --git a/plugins/phonon/qphononserviceplugin.h b/plugins/multimedia/phonon/qphononserviceplugin.h
index 161e2bd160..161e2bd160 100644
--- a/plugins/phonon/qphononserviceplugin.h
+++ b/plugins/multimedia/phonon/qphononserviceplugin.h
diff --git a/plugins/phonon/qphononvideowidget.cpp b/plugins/multimedia/phonon/qphononvideowidget.cpp
index f9c7bee9cc..f9c7bee9cc 100644
--- a/plugins/phonon/qphononvideowidget.cpp
+++ b/plugins/multimedia/phonon/qphononvideowidget.cpp
diff --git a/plugins/phonon/qphononvideowidget.h b/plugins/multimedia/phonon/qphononvideowidget.h
index 701183d685..701183d685 100644
--- a/plugins/phonon/qphononvideowidget.h
+++ b/plugins/multimedia/phonon/qphononvideowidget.h
diff --git a/plugins/v4l/camera/camera.pri b/plugins/multimedia/v4l/camera/camera.pri
index 2bd6383219..2bd6383219 100644
--- a/plugins/v4l/camera/camera.pri
+++ b/plugins/multimedia/v4l/camera/camera.pri
diff --git a/plugins/v4l/camera/cameraformatconverter.cpp b/plugins/multimedia/v4l/camera/cameraformatconverter.cpp
index 6671d9530a..6671d9530a 100644
--- a/plugins/v4l/camera/cameraformatconverter.cpp
+++ b/plugins/multimedia/v4l/camera/cameraformatconverter.cpp
diff --git a/plugins/v4l/camera/cameraformatconverter.h b/plugins/multimedia/v4l/camera/cameraformatconverter.h
index ea971a09eb..ea971a09eb 100644
--- a/plugins/v4l/camera/cameraformatconverter.h
+++ b/plugins/multimedia/v4l/camera/cameraformatconverter.h
diff --git a/plugins/v4l/camera/v4lcameracontrol.cpp b/plugins/multimedia/v4l/camera/v4lcameracontrol.cpp
index 4126104c03..4126104c03 100644
--- a/plugins/v4l/camera/v4lcameracontrol.cpp
+++ b/plugins/multimedia/v4l/camera/v4lcameracontrol.cpp
diff --git a/plugins/v4l/camera/v4lcameracontrol.h b/plugins/multimedia/v4l/camera/v4lcameracontrol.h
index 04bbc3a3ee..04bbc3a3ee 100644
--- a/plugins/v4l/camera/v4lcameracontrol.h
+++ b/plugins/multimedia/v4l/camera/v4lcameracontrol.h
diff --git a/plugins/v4l/camera/v4lcameraservice.cpp b/plugins/multimedia/v4l/camera/v4lcameraservice.cpp
index 020914115e..020914115e 100644
--- a/plugins/v4l/camera/v4lcameraservice.cpp
+++ b/plugins/multimedia/v4l/camera/v4lcameraservice.cpp
diff --git a/plugins/v4l/camera/v4lcameraservice.h b/plugins/multimedia/v4l/camera/v4lcameraservice.h
index 2160c65354..2160c65354 100644
--- a/plugins/v4l/camera/v4lcameraservice.h
+++ b/plugins/multimedia/v4l/camera/v4lcameraservice.h
diff --git a/plugins/v4l/camera/v4lcamerasession.cpp b/plugins/multimedia/v4l/camera/v4lcamerasession.cpp
index 85b205874c..85b205874c 100644
--- a/plugins/v4l/camera/v4lcamerasession.cpp
+++ b/plugins/multimedia/v4l/camera/v4lcamerasession.cpp
diff --git a/plugins/v4l/camera/v4lcamerasession.h b/plugins/multimedia/v4l/camera/v4lcamerasession.h
index cbd1af2723..cbd1af2723 100644
--- a/plugins/v4l/camera/v4lcamerasession.h
+++ b/plugins/multimedia/v4l/camera/v4lcamerasession.h
diff --git a/plugins/v4l/camera/v4limagecapturecontrol.cpp b/plugins/multimedia/v4l/camera/v4limagecapturecontrol.cpp
index 5d74a27dd1..5d74a27dd1 100644
--- a/plugins/v4l/camera/v4limagecapturecontrol.cpp
+++ b/plugins/multimedia/v4l/camera/v4limagecapturecontrol.cpp
diff --git a/plugins/v4l/camera/v4limagecapturecontrol.h b/plugins/multimedia/v4l/camera/v4limagecapturecontrol.h
index 3b3b70124b..3b3b70124b 100644
--- a/plugins/v4l/camera/v4limagecapturecontrol.h
+++ b/plugins/multimedia/v4l/camera/v4limagecapturecontrol.h
diff --git a/plugins/v4l/camera/v4lmediaformatcontrol.cpp b/plugins/multimedia/v4l/camera/v4lmediaformatcontrol.cpp
index 2d04f2cdd0..2d04f2cdd0 100644
--- a/plugins/v4l/camera/v4lmediaformatcontrol.cpp
+++ b/plugins/multimedia/v4l/camera/v4lmediaformatcontrol.cpp
diff --git a/plugins/v4l/camera/v4lmediaformatcontrol.h b/plugins/multimedia/v4l/camera/v4lmediaformatcontrol.h
index 8d82e4494d..8d82e4494d 100644
--- a/plugins/v4l/camera/v4lmediaformatcontrol.h
+++ b/plugins/multimedia/v4l/camera/v4lmediaformatcontrol.h
diff --git a/plugins/v4l/camera/v4lrecordercontrol.cpp b/plugins/multimedia/v4l/camera/v4lrecordercontrol.cpp
index fab2e2196b..fab2e2196b 100644
--- a/plugins/v4l/camera/v4lrecordercontrol.cpp
+++ b/plugins/multimedia/v4l/camera/v4lrecordercontrol.cpp
diff --git a/plugins/v4l/camera/v4lrecordercontrol.h b/plugins/multimedia/v4l/camera/v4lrecordercontrol.h
index a2b7f58181..a2b7f58181 100644
--- a/plugins/v4l/camera/v4lrecordercontrol.h
+++ b/plugins/multimedia/v4l/camera/v4lrecordercontrol.h
diff --git a/plugins/v4l/camera/v4lvideobuffer.cpp b/plugins/multimedia/v4l/camera/v4lvideobuffer.cpp
index 175d9c5f1d..175d9c5f1d 100644
--- a/plugins/v4l/camera/v4lvideobuffer.cpp
+++ b/plugins/multimedia/v4l/camera/v4lvideobuffer.cpp
diff --git a/plugins/v4l/camera/v4lvideobuffer.h b/plugins/multimedia/v4l/camera/v4lvideobuffer.h
index af17bb69f8..af17bb69f8 100644
--- a/plugins/v4l/camera/v4lvideobuffer.h
+++ b/plugins/multimedia/v4l/camera/v4lvideobuffer.h
diff --git a/plugins/v4l/camera/v4lvideodevicecontrol.cpp b/plugins/multimedia/v4l/camera/v4lvideodevicecontrol.cpp
index 8000310a0a..8000310a0a 100644
--- a/plugins/v4l/camera/v4lvideodevicecontrol.cpp
+++ b/plugins/multimedia/v4l/camera/v4lvideodevicecontrol.cpp
diff --git a/plugins/v4l/camera/v4lvideodevicecontrol.h b/plugins/multimedia/v4l/camera/v4lvideodevicecontrol.h
index 047f701ea8..047f701ea8 100644
--- a/plugins/v4l/camera/v4lvideodevicecontrol.h
+++ b/plugins/multimedia/v4l/camera/v4lvideodevicecontrol.h
diff --git a/plugins/v4l/camera/v4lvideoencode.cpp b/plugins/multimedia/v4l/camera/v4lvideoencode.cpp
index 5a5c0fcd64..3f8abffe96 100644
--- a/plugins/v4l/camera/v4lvideoencode.cpp
+++ b/plugins/multimedia/v4l/camera/v4lvideoencode.cpp
@@ -58,7 +58,7 @@ V4LVideoEncode::~V4LVideoEncode()
{
}
-QSize V4LVideoEncode::minimumResolution() const
+QSize V4LVideoEncode::minimumResolution(const QVideoEncoderSettings &) const
{
if(m_session) {
QSize minimum;
@@ -75,7 +75,7 @@ QSize V4LVideoEncode::minimumResolution() const
return QSize();
}
-QSize V4LVideoEncode::maximumResolution() const
+QSize V4LVideoEncode::maximumResolution(const QVideoEncoderSettings &) const
{
if(m_session) {
QSize maximum;
@@ -92,7 +92,7 @@ QSize V4LVideoEncode::maximumResolution() const
return QSize();
}
-QList<QSize> V4LVideoEncode::supportedResolutions() const
+QList<QSize> V4LVideoEncode::supportedResolutions(const QVideoEncoderSettings &) const
{
if(m_session)
return m_session->supportedResolutions();
@@ -101,17 +101,17 @@ QList<QSize> V4LVideoEncode::supportedResolutions() const
return res;
}
-qreal V4LVideoEncode::minimumFrameRate() const
+qreal V4LVideoEncode::minimumFrameRate(const QVideoEncoderSettings &) const
{
return 12;
}
-qreal V4LVideoEncode::maximumFrameRate() const
+qreal V4LVideoEncode::maximumFrameRate(const QVideoEncoderSettings &) const
{
return 24;
}
-QList< qreal > V4LVideoEncode::supportedFrameRates() const
+QList< qreal > V4LVideoEncode::supportedFrameRates(const QVideoEncoderSettings &) const
{
QList<qreal> res;
res << 24.0 << 12.0;
diff --git a/plugins/v4l/camera/v4lvideoencode.h b/plugins/multimedia/v4l/camera/v4lvideoencode.h
index aeb0a1c4b2..e6a60424e9 100644
--- a/plugins/v4l/camera/v4lvideoencode.h
+++ b/plugins/multimedia/v4l/camera/v4lvideoencode.h
@@ -55,13 +55,13 @@ public:
V4LVideoEncode(QObject *parent);
virtual ~V4LVideoEncode();
- QSize minimumResolution() const;
- QSize maximumResolution() const;
- QList<QSize> supportedResolutions() const;
+ QSize minimumResolution(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
+ QSize maximumResolution(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
+ QList<QSize> supportedResolutions(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
- qreal minimumFrameRate() const;
- qreal maximumFrameRate() const;
- QList< qreal > supportedFrameRates() const;
+ qreal minimumFrameRate(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
+ qreal maximumFrameRate(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
+ QList< qreal > supportedFrameRates(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
QPair<int,int> rateAsRational() const;
diff --git a/plugins/v4l/camera/v4lvideooutputcontrol.cpp b/plugins/multimedia/v4l/camera/v4lvideooutputcontrol.cpp
index 3d197220e9..3d197220e9 100644
--- a/plugins/v4l/camera/v4lvideooutputcontrol.cpp
+++ b/plugins/multimedia/v4l/camera/v4lvideooutputcontrol.cpp
diff --git a/plugins/v4l/camera/v4lvideooutputcontrol.h b/plugins/multimedia/v4l/camera/v4lvideooutputcontrol.h
index 66733e3426..66733e3426 100644
--- a/plugins/v4l/camera/v4lvideooutputcontrol.h
+++ b/plugins/multimedia/v4l/camera/v4lvideooutputcontrol.h
diff --git a/plugins/v4l/camera/v4lvideorenderer.cpp b/plugins/multimedia/v4l/camera/v4lvideorenderer.cpp
index e1531074ce..e1531074ce 100644
--- a/plugins/v4l/camera/v4lvideorenderer.cpp
+++ b/plugins/multimedia/v4l/camera/v4lvideorenderer.cpp
diff --git a/plugins/v4l/camera/v4lvideorenderer.h b/plugins/multimedia/v4l/camera/v4lvideorenderer.h
index b16df7fb53..b16df7fb53 100644
--- a/plugins/v4l/camera/v4lvideorenderer.h
+++ b/plugins/multimedia/v4l/camera/v4lvideorenderer.h
diff --git a/plugins/v4l/radio/radio.pri b/plugins/multimedia/v4l/radio/radio.pri
index ae05b3e53d..ae05b3e53d 100644
--- a/plugins/v4l/radio/radio.pri
+++ b/plugins/multimedia/v4l/radio/radio.pri
diff --git a/plugins/v4l/radio/v4lradiocontrol.cpp b/plugins/multimedia/v4l/radio/v4lradiocontrol.cpp
index f08796e167..04b1215580 100644
--- a/plugins/v4l/radio/v4lradiocontrol.cpp
+++ b/plugins/multimedia/v4l/radio/v4lradiocontrol.cpp
@@ -83,6 +83,11 @@ V4LRadioControl::~V4LRadioControl()
::close(fd);
}
+QRadioTuner::State V4LRadioControl::state() const
+{
+ return fd > 0 ? QRadioTuner::ActiveState : QRadioTuner::StoppedState;
+}
+
QRadioTuner::Band V4LRadioControl::band() const
{
return currentBand;
diff --git a/plugins/v4l/radio/v4lradiocontrol.h b/plugins/multimedia/v4l/radio/v4lradiocontrol.h
index b8d6ef2e53..04f761a70e 100644
--- a/plugins/v4l/radio/v4lradiocontrol.h
+++ b/plugins/multimedia/v4l/radio/v4lradiocontrol.h
@@ -60,6 +60,8 @@ public:
V4LRadioControl(QObject *parent = 0);
~V4LRadioControl();
+ QRadioTuner::State state() const;
+
QRadioTuner::Band band() const;
void setBand(QRadioTuner::Band b);
bool isBandSupported(QRadioTuner::Band b) const;
diff --git a/plugins/v4l/radio/v4lradioservice.cpp b/plugins/multimedia/v4l/radio/v4lradioservice.cpp
index 70fc16d54b..70fc16d54b 100644
--- a/plugins/v4l/radio/v4lradioservice.cpp
+++ b/plugins/multimedia/v4l/radio/v4lradioservice.cpp
diff --git a/plugins/v4l/radio/v4lradioservice.h b/plugins/multimedia/v4l/radio/v4lradioservice.h
index 4b2630f236..4b2630f236 100644
--- a/plugins/v4l/radio/v4lradioservice.h
+++ b/plugins/multimedia/v4l/radio/v4lradioservice.h
diff --git a/plugins/v4l/v4l.pro b/plugins/multimedia/v4l/v4l.pro
index b220085869..665ec1f71f 100644
--- a/plugins/v4l/v4l.pro
+++ b/plugins/multimedia/v4l/v4l.pro
@@ -4,13 +4,13 @@ TARGET = $$qtLibraryTarget(v4lengine)
PLUGIN_TYPE = mediaservice
-include (../../common.pri)
+include (../../../common.pri)
qtAddLibrary(QtMedia)
DEPENDPATH += .
-INCLUDEPATH += ../../src/multimedia
+INCLUDEPATH += ../../../src/multimedia
HEADERS += v4lserviceplugin.h
SOURCES += v4lserviceplugin.cpp
diff --git a/plugins/v4l/v4lserviceplugin.cpp b/plugins/multimedia/v4l/v4lserviceplugin.cpp
index b0b27e4780..b0b27e4780 100644
--- a/plugins/v4l/v4lserviceplugin.cpp
+++ b/plugins/multimedia/v4l/v4lserviceplugin.cpp
diff --git a/plugins/v4l/v4lserviceplugin.h b/plugins/multimedia/v4l/v4lserviceplugin.h
index 3bb8449a34..3bb8449a34 100644
--- a/plugins/v4l/v4lserviceplugin.h
+++ b/plugins/multimedia/v4l/v4lserviceplugin.h
diff --git a/plugins/wmp/qevrvideooverlay.cpp b/plugins/multimedia/wmp/qevrvideooverlay.cpp
index 79684fb86b..79684fb86b 100644
--- a/plugins/wmp/qevrvideooverlay.cpp
+++ b/plugins/multimedia/wmp/qevrvideooverlay.cpp
diff --git a/plugins/wmp/qevrvideooverlay.h b/plugins/multimedia/wmp/qevrvideooverlay.h
index 5a4f0f5d3f..5a4f0f5d3f 100644
--- a/plugins/wmp/qevrvideooverlay.h
+++ b/plugins/multimedia/wmp/qevrvideooverlay.h
diff --git a/plugins/wmp/qmfactivate.cpp b/plugins/multimedia/wmp/qmfactivate.cpp
index 15c3192f60..15c3192f60 100644
--- a/plugins/wmp/qmfactivate.cpp
+++ b/plugins/multimedia/wmp/qmfactivate.cpp
diff --git a/plugins/wmp/qmfactivate.h b/plugins/multimedia/wmp/qmfactivate.h
index c7982a094a..c7982a094a 100644
--- a/plugins/wmp/qmfactivate.h
+++ b/plugins/multimedia/wmp/qmfactivate.h
diff --git a/plugins/wmp/qwmpevents.cpp b/plugins/multimedia/wmp/qwmpevents.cpp
index d2df920286..d2df920286 100644
--- a/plugins/wmp/qwmpevents.cpp
+++ b/plugins/multimedia/wmp/qwmpevents.cpp
diff --git a/plugins/wmp/qwmpevents.h b/plugins/multimedia/wmp/qwmpevents.h
index a200abde9e..a200abde9e 100644
--- a/plugins/wmp/qwmpevents.h
+++ b/plugins/multimedia/wmp/qwmpevents.h
diff --git a/plugins/wmp/qwmpglobal.cpp b/plugins/multimedia/wmp/qwmpglobal.cpp
index ae10c896e1..ae10c896e1 100644
--- a/plugins/wmp/qwmpglobal.cpp
+++ b/plugins/multimedia/wmp/qwmpglobal.cpp
diff --git a/plugins/wmp/qwmpglobal.h b/plugins/multimedia/wmp/qwmpglobal.h
index 8dcef41b39..8dcef41b39 100644
--- a/plugins/wmp/qwmpglobal.h
+++ b/plugins/multimedia/wmp/qwmpglobal.h
diff --git a/plugins/wmp/qwmpmetadata.cpp b/plugins/multimedia/wmp/qwmpmetadata.cpp
index ef01d6ebdc..ef01d6ebdc 100644
--- a/plugins/wmp/qwmpmetadata.cpp
+++ b/plugins/multimedia/wmp/qwmpmetadata.cpp
diff --git a/plugins/wmp/qwmpmetadata.h b/plugins/multimedia/wmp/qwmpmetadata.h
index ab1fee298a..ab1fee298a 100644
--- a/plugins/wmp/qwmpmetadata.h
+++ b/plugins/multimedia/wmp/qwmpmetadata.h
diff --git a/plugins/wmp/qwmpplayercontrol.cpp b/plugins/multimedia/wmp/qwmpplayercontrol.cpp
index 80d39e17bb..80d39e17bb 100644
--- a/plugins/wmp/qwmpplayercontrol.cpp
+++ b/plugins/multimedia/wmp/qwmpplayercontrol.cpp
diff --git a/plugins/wmp/qwmpplayercontrol.h b/plugins/multimedia/wmp/qwmpplayercontrol.h
index 701c5492f6..701c5492f6 100644
--- a/plugins/wmp/qwmpplayercontrol.h
+++ b/plugins/multimedia/wmp/qwmpplayercontrol.h
diff --git a/plugins/wmp/qwmpplayerservice.cpp b/plugins/multimedia/wmp/qwmpplayerservice.cpp
index e2580bd92e..4bc9b3da2a 100644
--- a/plugins/wmp/qwmpplayerservice.cpp
+++ b/plugins/multimedia/wmp/qwmpplayerservice.cpp
@@ -100,9 +100,16 @@ QWmpPlayerService::QWmpPlayerService(EmbedMode mode, QObject *parent)
connect(m_videoOutputControl, SIGNAL(outputChanged(QVideoOutputControl::Output)),
this, SLOT(videoOutputChanged(QVideoOutputControl::Output)));
#ifdef QWMP_EVR
- if (HINSTANCE evrHwnd = LoadLibrary(L"evr")) {
- m_evrVideoOverlay = new QEvrVideoOverlay(evrHwnd);
- } else {
+ IWMPVideoRenderConfig *config = 0;
+ if (m_player->QueryInterface(
+ __uuidof(IWMPVideoRenderConfig), reinterpret_cast<void **>(&config)) == S_OK) {
+ if (HINSTANCE evrHwnd = LoadLibrary(L"evr"))
+ m_evrVideoOverlay = new QEvrVideoOverlay(evrHwnd);
+
+ config->Release();
+ }
+
+ if (!m_evrVideoOverlay) {
#else
{
#endif
diff --git a/plugins/wmp/qwmpplayerservice.h b/plugins/multimedia/wmp/qwmpplayerservice.h
index f87b55ea67..f87b55ea67 100644
--- a/plugins/wmp/qwmpplayerservice.h
+++ b/plugins/multimedia/wmp/qwmpplayerservice.h
diff --git a/plugins/wmp/qwmpplaylist.cpp b/plugins/multimedia/wmp/qwmpplaylist.cpp
index f5a0eff3f0..f5a0eff3f0 100644
--- a/plugins/wmp/qwmpplaylist.cpp
+++ b/plugins/multimedia/wmp/qwmpplaylist.cpp
diff --git a/plugins/wmp/qwmpplaylist.h b/plugins/multimedia/wmp/qwmpplaylist.h
index 60594cbabb..60594cbabb 100644
--- a/plugins/wmp/qwmpplaylist.h
+++ b/plugins/multimedia/wmp/qwmpplaylist.h
diff --git a/plugins/wmp/qwmpplaylistcontrol.cpp b/plugins/multimedia/wmp/qwmpplaylistcontrol.cpp
index 0024f9fc8a..0024f9fc8a 100644
--- a/plugins/wmp/qwmpplaylistcontrol.cpp
+++ b/plugins/multimedia/wmp/qwmpplaylistcontrol.cpp
diff --git a/plugins/wmp/qwmpplaylistcontrol.h b/plugins/multimedia/wmp/qwmpplaylistcontrol.h
index 6a5358f92a..6a5358f92a 100644
--- a/plugins/wmp/qwmpplaylistcontrol.h
+++ b/plugins/multimedia/wmp/qwmpplaylistcontrol.h
diff --git a/plugins/wmp/qwmpserviceprovider.cpp b/plugins/multimedia/wmp/qwmpserviceprovider.cpp
index 9f6038338a..9f6038338a 100644
--- a/plugins/wmp/qwmpserviceprovider.cpp
+++ b/plugins/multimedia/wmp/qwmpserviceprovider.cpp
diff --git a/plugins/wmp/qwmpserviceprovider.h b/plugins/multimedia/wmp/qwmpserviceprovider.h
index e51e8c9fe9..e51e8c9fe9 100644
--- a/plugins/wmp/qwmpserviceprovider.h
+++ b/plugins/multimedia/wmp/qwmpserviceprovider.h
diff --git a/plugins/wmp/qwmpvideooutputcontrol.cpp b/plugins/multimedia/wmp/qwmpvideooutputcontrol.cpp
index c0cd89ecd0..c0cd89ecd0 100644
--- a/plugins/wmp/qwmpvideooutputcontrol.cpp
+++ b/plugins/multimedia/wmp/qwmpvideooutputcontrol.cpp
diff --git a/plugins/wmp/qwmpvideooutputcontrol.h b/plugins/multimedia/wmp/qwmpvideooutputcontrol.h
index cedb1105bb..cedb1105bb 100644
--- a/plugins/wmp/qwmpvideooutputcontrol.h
+++ b/plugins/multimedia/wmp/qwmpvideooutputcontrol.h
diff --git a/plugins/wmp/qwmpvideooverlay.cpp b/plugins/multimedia/wmp/qwmpvideooverlay.cpp
index 2179172fc4..2179172fc4 100644
--- a/plugins/wmp/qwmpvideooverlay.cpp
+++ b/plugins/multimedia/wmp/qwmpvideooverlay.cpp
diff --git a/plugins/wmp/qwmpvideooverlay.h b/plugins/multimedia/wmp/qwmpvideooverlay.h
index 1dbe18579d..1dbe18579d 100644
--- a/plugins/wmp/qwmpvideooverlay.h
+++ b/plugins/multimedia/wmp/qwmpvideooverlay.h
diff --git a/plugins/wmp/wmp.pro b/plugins/multimedia/wmp/wmp.pro
index 58f4740dd3..544d55c3d2 100644
--- a/plugins/wmp/wmp.pro
+++ b/plugins/multimedia/wmp/wmp.pro
@@ -4,8 +4,8 @@ TARGET = $$qtLibraryTarget(qwmp)
PLUGIN_TYPE = mediaservice
-INCLUDEPATH+=../../src/multimedia
-include(../../common.pri)
+INCLUDEPATH+=../../../src/multimedia
+include(../../../common.pri)
TMP_INCLUDE = $$quote($$(INCLUDE))
TMP_SEARCHPATHS = $$split(TMP_INCLUDE, ";") $$QMAKE_INCDIR
diff --git a/plugins/plugins.pro b/plugins/plugins.pro
index a492bbce2d..16eaf1e116 100644
--- a/plugins/plugins.pro
+++ b/plugins/plugins.pro
@@ -5,33 +5,5 @@
######################################################################
TEMPLATE = subdirs
-SUBDIRS += contacts
-SUBDIRS += m3u
+SUBDIRS += contacts multimedia
-win32:!wince* {
- TMP_INCLUDE = $$quote($$(INCLUDE))
- TMP_SEARCHPATHS = $$split(TMP_INCLUDE, ";") $$QMAKE_INCDIR
- for(p, TMP_SEARCHPATHS): exists($${p}/wmp.h): SUBDIRS *= wmp
- for(p, TMP_SEARCHPATHS): exists($${p}/dshow.h) {
- win32-msvc2005: SUBDIRS *= directshow
- win32-msvc2008: SUBDIRS *= directshow
- }
-}
-
-unix:!mac:!symbian {
- TMP_GST_LIBS = \
- gstreamer-0.10 >= 0.10.19 \
- gstreamer-base-0.10 >= 0.10.19 \
- gstreamer-interfaces-0.10 >= 0.10.19 \
- gstreamer-audio-0.10 >= 0.10.19 \
- gstreamer-video-0.10 >= 0.10.19
- system(pkg-config --exists \'$${TMP_GST_LIBS}\' --print-errors): {
- SUBDIRS += gstreamer
- } else {
- contains(QT_CONFIG, multimedia): SUBDIRS += audiocapture v4l
- }
-
-} else {
- contains(QT_CONFIG, phonon): SUBDIRS += phonon
- contains(QT_CONFIG, multimedia): SUBDIRS += audiocapture
-}
diff --git a/src/contacts/qcontactdetaildefinitionfield.cpp b/src/contacts/qcontactdetaildefinitionfield.cpp
index 20a4bac569..ec9185a76d 100644
--- a/src/contacts/qcontactdetaildefinitionfield.cpp
+++ b/src/contacts/qcontactdetaildefinitionfield.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
-** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
@@ -20,18 +21,24 @@
** 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.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
**
-** If you have questions regarding the use of this file, please
-** contact Nokia at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
-
#include "qcontactdetaildefinitionfield.h"
#include "qcontactdetaildefinitionfield_p.h"
diff --git a/src/contacts/qcontactdetaildefinitionfield.h b/src/contacts/qcontactdetaildefinitionfield.h
index 5b87ba1184..173dc26c22 100644
--- a/src/contacts/qcontactdetaildefinitionfield.h
+++ b/src/contacts/qcontactdetaildefinitionfield.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
-** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
@@ -20,13 +21,20 @@
** 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.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
**
-** If you have questions regarding the use of this file, please
-** contact Nokia at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/contacts/qcontactdetaildefinitionfield_p.h b/src/contacts/qcontactdetaildefinitionfield_p.h
index 18d4a3d30a..7babe56263 100644
--- a/src/contacts/qcontactdetaildefinitionfield_p.h
+++ b/src/contacts/qcontactdetaildefinitionfield_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
-** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
@@ -20,18 +21,24 @@
** 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.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
**
-** If you have questions regarding the use of this file, please
-** contact Nokia at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
-
#ifndef QCONTACTDETAILDEFINITIONFIELD_P_H
#define QCONTACTDETAILDEFINITIONFIELD_P_H
diff --git a/src/global/qmobilityglobal.h b/src/global/qmobilityglobal.h
index 3ebe2063e5..f5a0bd2bc2 100644
--- a/src/global/qmobilityglobal.h
+++ b/src/global/qmobilityglobal.h
@@ -66,9 +66,9 @@
# define Q_BEARER_EXPORT Q_DECL_IMPORT
# endif
# if defined(QT_BUILD_CFW_LIB)
-# define Q_CFW_EXPORT Q_DECL_EXPORT
+# define Q_PUBLISHSUBSCRIBE_EXPORT Q_DECL_EXPORT
# else
-# define Q_CFW_EXPORT Q_DECL_IMPORT
+# define Q_PUBLISHSUBSCRIBE_EXPORT Q_DECL_IMPORT
# endif
# if defined(QT_BUILD_CONTACTS_LIB)
# define Q_CONTACTS_EXPORT Q_DECL_EXPORT
@@ -102,7 +102,7 @@
# endif
# elif defined(QT_DLL) /* use a Qt DLL library */
# define Q_BEARER_EXPORT Q_DECL_IMPORT
-# define Q_CFW_EXPORT Q_DECL_IMPORT
+# define Q_PUBLISHSUBSCRIBE_EXPORT Q_DECL_IMPORT
# define Q_CONTACTS_EXPORT Q_DECL_IMPORT
# define Q_LOCATION_EXPORT Q_DECL_IMPORT
# define Q_MEDIA_EXPORT Q_DECL_IMPORT
@@ -115,7 +115,7 @@
# if !defined(Q_SFW_EXPORT)
# if defined(QT_SHARED)
# define Q_BEARER_EXPORT Q_DECL_EXPORT
-# define Q_CFW_EXPORT Q_DECL_EXPORT
+# define Q_PUBLISHSUBSCRIBE_EXPORT Q_DECL_EXPORT
# define Q_CONTACTS_EXPORT Q_DECL_EXPORT
# define Q_LOCATION_EXPORT Q_DECL_EXPORT
# define Q_MEDIA_EXPORT Q_DECL_EXPORT
@@ -124,7 +124,7 @@
# define Q_SYSINFO_EXPORT Q_DECL_EXPORT
# else
# define Q_BEARER_EXPORT
-# define Q_CFW_EXPORT
+# define Q_PUBLISHSUBSCRIBE_EXPORT
# define Q_CONTACTS_EXPORT
# define Q_LOCATION_EXPORT
# define Q_MEDIA_EXPORT
diff --git a/src/messaging/qmessage.cpp b/src/messaging/qmessage.cpp
index 27e0535fcd..81955d884f 100644
--- a/src/messaging/qmessage.cpp
+++ b/src/messaging/qmessage.cpp
@@ -72,10 +72,6 @@ QList<QByteArray> charsets;
QMessage can also be constructed piece by piece using functions such as
setType(), setFrom(), setTo(), setSubject(), setBody() and appendAttachments().
- Alternatively a message can be initialized from raw data using fromTransmissionFormat().
- A message may be serialized to a QDataStream, or returned as a QByteArray using
- toTransmissionFormat().
-
If a message has been modified since it was last constructed isModified() returns true.
A list of attachments identifiers will be returned by attachmentIds() and an identifier for the
@@ -214,48 +210,6 @@ QList<QByteArray> charsets;
*/
/*!
- \fn QMessage::fromTransmissionFormat(Type t, const QByteArray &ba)
-
- Constructs a message of type \a t from the data contained in \a ba.
-
- See the class description for a list of supported message encapsulations.
-
- \sa toTransmissionFormat()
-*/
-
-/*!
- \fn QMessage::fromTransmissionFormatFile(Type t, const QString& fileName)
-
- Constructs a message of type \a t from the data contained in \a fileName.
-
- See the class description for a list of supported message encapsulations.
-
- \sa toTransmissionFormat()
-*/
-
-/*!
- \fn QMessage::toTransmissionFormat() const
-
- Returns the message in a format suitable for transmission.
-
- See the class description for the encapsulations used for each
- message type.
-
- \sa fromTransmissionFormat()
-*/
-
-/*!
- \fn QMessage::toTransmissionFormat(QDataStream& out) const
-
- Writes the message to the output stream \a out.
-
- See the class description for the encapsulations used for each
- message type.
-
- \sa fromTransmissionFormat()
-*/
-
-/*!
\fn QMessage::id() const
Returns the identifier of the message.
@@ -568,7 +522,7 @@ QList<QByteArray> charsets;
Sets the ordered-by-preference list of names of charsets to use when encoding
unicode QString data to a serialized form to \a charsetNames.
- \sa preferredCharsets(), preferredCharsetFor(), toTransmissionFormat(), setBody()
+ \sa preferredCharsets(), preferredCharsetFor(), setBody()
*/
void QMessage::setPreferredCharsets(const QList<QByteArray> &charsetNames)
{
@@ -581,7 +535,7 @@ void QMessage::setPreferredCharsets(const QList<QByteArray> &charsetNames)
Returns an ordered-by-preference list of charset names to use when encoding
unicode QString data to a serialized form.
- \sa setPreferredCharsets(), preferredCharsetFor(), toTransmissionFormat(), setBody()
+ \sa setPreferredCharsets(), preferredCharsetFor(), setBody()
*/
QList<QByteArray> QMessage::preferredCharsets()
{
@@ -592,7 +546,7 @@ QList<QByteArray> QMessage::preferredCharsets()
Returns the first charset from the preferred list that is capable of encoding
the content of \a text.
- \sa preferredCharsets(), toTransmissionFormat(), setBody()
+ \sa preferredCharsets(), setBody()
*/
QByteArray QMessage::preferredCharsetFor(const QString &text)
{
diff --git a/src/messaging/qmessage.h b/src/messaging/qmessage.h
index 66cd9c4112..da608981eb 100644
--- a/src/messaging/qmessage.h
+++ b/src/messaging/qmessage.h
@@ -111,12 +111,6 @@ public:
QMessage& operator=(const QMessage &other);
- static QMessage fromTransmissionFormat(Type t, const QByteArray &ba);
- static QMessage fromTransmissionFormatFile(Type t, const QString &fileName);
-
- QByteArray toTransmissionFormat() const;
- void toTransmissionFormat(QDataStream &out) const;
-
QMessageId id() const;
Type type() const;
diff --git a/src/messaging/qmessage_maemo.cpp b/src/messaging/qmessage_maemo.cpp
index 5e1a160a06..a1bd9debe1 100644
--- a/src/messaging/qmessage_maemo.cpp
+++ b/src/messaging/qmessage_maemo.cpp
@@ -68,30 +68,6 @@ QMessage::~QMessage()
{
}
-QMessage QMessage::fromTransmissionFormat(Type t, const QByteArray &ba)
-{
- Q_UNUSED(t)
- Q_UNUSED(ba)
- return QMessage(); // stub
-}
-
-QMessage QMessage::fromTransmissionFormatFile(Type t, const QString& fileName)
-{
- Q_UNUSED(t)
- Q_UNUSED(fileName)
- return QMessage(); // stub
-}
-
-QByteArray QMessage::toTransmissionFormat() const
-{
- return QByteArray(); // stub
-}
-
-void QMessage::toTransmissionFormat(QDataStream& out) const
-{
- Q_UNUSED(out)
-}
-
QMessageId QMessage::id() const
{
return QMessageId(); // stub
diff --git a/src/messaging/qmessage_qmf.cpp b/src/messaging/qmessage_qmf.cpp
index 61d48dbbaf..15b0c4a00a 100644
--- a/src/messaging/qmessage_qmf.cpp
+++ b/src/messaging/qmessage_qmf.cpp
@@ -262,40 +262,6 @@ QMessage::~QMessage()
delete d_ptr;
}
-QMessage QMessage::fromTransmissionFormat(Type t, const QByteArray &ba)
-{
- QMessage result;
-
- QMailMessage msg = QMailMessage::fromRfc2822(ba);
- msg.setMessageType(convert(t));
- msg.setStatus(QMailMessage::LocalOnly, true);
-
- result.d_ptr->_message = msg;
- return result;
-}
-
-QMessage QMessage::fromTransmissionFormatFile(Type t, const QString& fileName)
-{
- QMessage result;
-
- QMailMessage msg = QMailMessage::fromRfc2822File(fileName);
- msg.setMessageType(convert(t));
- msg.setStatus(QMailMessage::LocalOnly, true);
-
- result.d_ptr->_message = msg;
- return result;
-}
-
-QByteArray QMessage::toTransmissionFormat() const
-{
- return d_ptr->_message.toRfc2822(QMailMessage::TransmissionFormat);
-}
-
-void QMessage::toTransmissionFormat(QDataStream& out) const
-{
- d_ptr->_message.toRfc2822(out, QMailMessage::TransmissionFormat);
-}
-
QMessageId QMessage::id() const
{
return convert(d_ptr->_message.id());
@@ -656,7 +622,8 @@ QMessage QMessage::createResponseMessage(ResponseType type) const
{
// Include the entirety of this message as a nested part
QMailMessageContentType ct("message/rfc822");
- QMailMessagePart part(QMailMessagePart::fromData(toTransmissionFormat(), cd, ct, QMailMessageBody::Base64));
+ QByteArray responseData(d_ptr->_message.toRfc2822(QMailMessage::TransmissionFormat));
+ QMailMessagePart part(QMailMessagePart::fromData(responseData, cd, ct, QMailMessageBody::Base64));
msg->appendPart(part);
}
}
@@ -716,7 +683,7 @@ QMessage QMessage::createResponseMessage(ResponseType type) const
if (!existingText.isEmpty()) {
existingText = existingText.replace("\n", "\n> ");
- QString prefix(qApp->translate("QMessage", "On %1 you wrote:\n"));
+ QString prefix(qApp->translate("QMessage", "On %1 you wrote:\n> "));
prefix = prefix.arg(d_ptr->_message.date().toLocalTime().toString());
response.setBody(prefix + existingText);
}
diff --git a/src/messaging/qmessage_symbian.cpp b/src/messaging/qmessage_symbian.cpp
index 1736240dec..43175fe4ed 100644
--- a/src/messaging/qmessage_symbian.cpp
+++ b/src/messaging/qmessage_symbian.cpp
@@ -103,30 +103,6 @@ QMessage::~QMessage()
delete d_ptr;
}
-QMessage QMessage::fromTransmissionFormat(Type t, const QByteArray &ba)
-{
- Q_UNUSED(t)
- Q_UNUSED(ba)
- return QMessage(); // stub
-}
-
-QMessage QMessage::fromTransmissionFormatFile(Type t, const QString& fileName)
-{
- Q_UNUSED(t)
- Q_UNUSED(fileName)
- return QMessage(); // stub
-}
-
-QByteArray QMessage::toTransmissionFormat() const
-{
- return QByteArray(); // stub
-}
-
-void QMessage::toTransmissionFormat(QDataStream& out) const
-{
- Q_UNUSED(out)
-}
-
QMessageId QMessage::id() const
{
return d_ptr->_id;
diff --git a/src/messaging/qmessage_win.cpp b/src/messaging/qmessage_win.cpp
index 7ede6758ee..5686da8195 100644
--- a/src/messaging/qmessage_win.cpp
+++ b/src/messaging/qmessage_win.cpp
@@ -46,7 +46,10 @@
#include "qmessagecontentcontainer_p.h"
#include "qmessagefolderid_p.h"
#include "winhelpers_p.h"
+#include <QCoreApplication>
#include <QDebug>
+#include <QDir>
+#include <QFile>
QTM_BEGIN_NAMESPACE
@@ -190,30 +193,6 @@ QMessage::~QMessage()
d_ptr = 0;
}
-QMessage QMessage::fromTransmissionFormat(Type t, const QByteArray &ba)
-{
- Q_UNUSED(t)
- Q_UNUSED(ba)
- return QMessage(); // stub
-}
-
-QMessage QMessage::fromTransmissionFormatFile(Type t, const QString& fileName)
-{
- Q_UNUSED(t)
- Q_UNUSED(fileName)
- return QMessage(); // stub
-}
-
-QByteArray QMessage::toTransmissionFormat() const
-{
- return QByteArray(); // stub
-}
-
-void QMessage::toTransmissionFormat(QDataStream& out) const
-{
- Q_UNUSED(out)
-}
-
QMessageId QMessage::id() const
{
return d_ptr->_id;
@@ -244,6 +223,7 @@ void QMessage::setParentAccountId(const QMessageAccountId &accountId)
QMessageFolderId QMessage::parentFolderId() const
{
+ d_ptr->ensurePropertiesPresent(const_cast<QMessage*>(this));
return d_ptr->_parentFolderId;
}
@@ -439,7 +419,7 @@ void QMessage::setBody(const QString &bodyText, const QByteArray &mimeType)
QMessageContentContainerId existingBodyId(bodyId());
if (existingBodyId.isValid()) {
- if (existingBodyId == QMessageContentContainerPrivate::bodyContentId()) {
+ if (existingBodyId == container->bodyContentId()) {
// The body content is in the message itself
container->setContent(bodyText, mainType, subType, charset);
} else {
@@ -451,7 +431,7 @@ void QMessage::setBody(const QString &bodyText, const QByteArray &mimeType)
if (container->_attachments.isEmpty()) {
// Put the content directly into the message
container->setContent(bodyText, mainType, subType, charset);
- d_ptr->_bodyId = QMessageContentContainerPrivate::bodyContentId();
+ d_ptr->_bodyId = container->bodyContentId();
} else {
// Add the body as the first attachment
QMessageContentContainer newBody;
@@ -491,7 +471,7 @@ void QMessage::appendAttachments(const QStringList &fileNames)
if (container->_attachments.isEmpty()) {
QMessageContentContainerId existingBodyId(bodyId());
- if (existingBodyId == QMessageContentContainerPrivate::bodyContentId()) {
+ if (existingBodyId == container->bodyContentId()) {
// The body content is in the message itself - move it to become the first attachment
QMessageContentContainer newBody(*this);
newBody.setDerivedMessage(0);
@@ -536,8 +516,138 @@ bool QMessage::isModified() const
QMessage QMessage::createResponseMessage(ResponseType type) const
{
- Q_UNUSED(type)
- return QMessage(); // stub
+ QMessage response;
+
+ if (type == Forward) {
+ response.setSubject("Fwd:" + subject());
+
+ if (contentType().toLower() == "text") {
+ // Forward the text content inline
+ QStringList addresses;
+ foreach (const QMessageAddress &address, to()) {
+ addresses.append(address.recipient());
+ }
+
+ QString existingText(textContent());
+
+ QString prefix(QString("\r\n----- %1 -----\r\n\r\n").arg(qApp->translate("QMessage", "Forwarded Message")));
+ prefix.append(QString("%1: %2\r\n").arg(qApp->translate("QMessage", "Subject")).arg(subject()));
+ prefix.append(QString("%1: %2\r\n").arg(qApp->translate("QMessage", "Date")).arg(date().toString()));
+ prefix.append(QString("%1: %2\r\n").arg(qApp->translate("QMessage", "From")).arg(from().recipient()));
+ prefix.append(QString("%1: %2\r\n").arg(qApp->translate("QMessage", "To")).arg(addresses.join(",")));
+
+ QString postfix("\r\n\r\n-----------------------------\r\n");
+
+ response.setBody(prefix + existingText + postfix);
+ } else {
+ // Add an empty text body to be composed into
+ response.setBody(QString(), "text/plain");
+
+ // We can only forward the original content if it is a single part
+ if (contentType().toLower() != "multipart") {
+ QByteArray fileName(suggestedFileName());
+ if (!fileName.isEmpty()) {
+ // Write the content to a file that we can attach to our response
+ QString path(QDir::tempPath() + "/qtmobility/messaging/" + fileName);
+ if (QFile::exists(path)) {
+ if (!QFile::remove(path)) {
+ qWarning() << "Unable to remove temporary file:" << path;
+ }
+ }
+
+ QFile out(path);
+ if (!out.open(QFile::WriteOnly)) {
+ qWarning() << "Unable to open temporary file:" << path;
+ } else {
+ out.write(content());
+ out.flush();
+ out.close();
+ }
+
+ response.appendAttachments(QStringList() << path);
+ }
+ }
+ }
+ } else {
+ // Prefer to reply to the trply-to address, if present
+ QString replyTo(headerFieldValue("Reply-To"));
+ if (!replyTo.isEmpty()) {
+ response.setTo(QMessageAddressList() << QMessageAddress(replyTo, QMessageAddress::Email));
+ } else {
+ response.setTo(QMessageAddressList() << from());
+ }
+
+ if (type == ReplyToAll) {
+ response.setCc(to() + cc());
+ }
+
+ response.setSubject("Re:" + subject());
+
+ // Put the existing text into the reply body
+ QString existingText;
+ QMessageContentContainerIdList attachments;
+ if (contentType().toLower() == "text") {
+ existingText = textContent();
+ } else {
+ QMessageContentContainerId textId(bodyId());
+ if (textId.isValid()) {
+ existingText = find(textId).textContent();
+ }
+
+ attachments = attachmentIds();
+ }
+
+ if (!existingText.isEmpty()) {
+ existingText = existingText.replace("\n", "\n> ");
+
+ QString prefix(qApp->translate("QMessage", "On %1 you wrote:\n> "));
+ response.setBody(prefix.arg(date().toLocalTime().toString()) + existingText);
+ }
+
+ // Add any attachment parts as attachments
+ QStringList attachmentPaths;
+ foreach (const QMessageContentContainerId &attachmentId, attachments) {
+ QMessageContentContainer attachment(find(attachmentId));
+
+ QByteArray fileName(attachment.suggestedFileName());
+ if (!fileName.isEmpty()) {
+ QString path(QDir::tempPath() + "/qtmobility/messaging/" + fileName);
+ if (QFile::exists(path)) {
+ if (!QFile::remove(path)) {
+ qWarning() << "Unable to remove temporary file:" << path;
+ }
+ }
+
+ QString partialPath(QDir::tempPath() + "/qtmobility");
+ if (!QFile::exists(partialPath)) {
+ if (!QDir::temp().mkdir("qtmobility")) {
+ qWarning() << "Unable to create temporary directory:" << partialPath;
+ }
+ }
+ partialPath.append("/messaging");
+ if (!QFile::exists(partialPath)) {
+ if (!QDir(QDir::tempPath() + "/qtmobility").mkdir("messaging")) {
+ qWarning() << "Unable to create temporary directory:" << partialPath;
+ }
+ }
+
+ QFile out(path);
+ if (!out.open(QFile::WriteOnly)) {
+ qWarning() << "Unable to open temporary file:" << path;
+ } else {
+ out.write(attachment.content());
+ out.flush();
+ out.close();
+
+ attachmentPaths.append(path);
+ }
+ }
+ }
+
+ response.appendAttachments(attachmentPaths);
+ }
+
+ return response;
}
QTM_END_NAMESPACE
diff --git a/src/messaging/qmessagecontentcontainer_p.h b/src/messaging/qmessagecontentcontainer_p.h
index 2e7ea1ffcc..68190bdea1 100644
--- a/src/messaging/qmessagecontentcontainer_p.h
+++ b/src/messaging/qmessagecontentcontainer_p.h
@@ -51,6 +51,7 @@
#include "qmessage_p.h"
#if defined(Q_OS_WIN)
#include "winhelpers_p.h"
+#include "qmessagecontentcontainerid_p.h"
#endif
#endif
@@ -374,7 +375,7 @@ public:
return _attachments[0].d_ptr->_id;
}
- static QMessageContentContainerId bodyContentId()
+ QMessageContentContainerId bodyContentId() const
{
return QMessageContentContainerId(QString::number(0));
}
diff --git a/src/messaging/qmessagecontentcontainerid.h b/src/messaging/qmessagecontentcontainerid.h
index 53cafcdf08..7f6b1c198c 100644
--- a/src/messaging/qmessagecontentcontainerid.h
+++ b/src/messaging/qmessagecontentcontainerid.h
@@ -55,7 +55,7 @@ class Q_MESSAGING_EXPORT QMessageContentContainerId
public:
QMessageContentContainerId();
QMessageContentContainerId(const QMessageContentContainerId &other);
- QMessageContentContainerId(const QString &id);
+ QMessageContentContainerId(const QString& id);
~QMessageContentContainerId();
QMessageContentContainerId& operator=(const QMessageContentContainerId &other);
diff --git a/src/messaging/qmessagecontentcontainerid_p.h b/src/messaging/qmessagecontentcontainerid_p.h
index 5744cac991..fb94333622 100644
--- a/src/messaging/qmessagecontentcontainerid_p.h
+++ b/src/messaging/qmessagecontentcontainerid_p.h
@@ -40,16 +40,26 @@
****************************************************************************/
#ifndef QMESSAGECONTENTCONTAINERIDPRIVATE_H
#define QMESSAGECONTENTCONTAINERIDPRIVATE_H
+
#include "qmessagecontentcontainerid.h"
+#ifdef Q_OS_WIN
+#include "qmessageid.h"
+#endif
QTM_BEGIN_NAMESPACE
class QMessageContentContainerIdPrivate
{
public:
+#ifdef Q_OS_WIN
+ enum { Invalid = -1, Body = 0 };
+ int _number;
+ QMessageContentContainerIdPrivate() : _number(Invalid) {}
+#else
QMessageContentContainerIdPrivate()
{
}
+#endif
};
QTM_END_NAMESPACE
diff --git a/src/messaging/qmessagecontentcontainerid_win.cpp b/src/messaging/qmessagecontentcontainerid_win.cpp
index c38681453f..b6a667b339 100644
--- a/src/messaging/qmessagecontentcontainerid_win.cpp
+++ b/src/messaging/qmessagecontentcontainerid_win.cpp
@@ -39,19 +39,10 @@
**
****************************************************************************/
#include "qmessagecontentcontainerid.h"
+#include "qmessagecontentcontainerid_p.h"
QTM_BEGIN_NAMESPACE
-class QMessageContentContainerIdPrivate
-{
-public:
- enum { Invalid = -1, Body = 0 };
-
- int _number;
-
- QMessageContentContainerIdPrivate() : _number(Invalid) {}
-};
-
QMessageContentContainerId::QMessageContentContainerId()
: d_ptr(new QMessageContentContainerIdPrivate)
{
diff --git a/src/messaging/qmessagedatacomparator.cpp b/src/messaging/qmessagedatacomparator.cpp
index 75ae4a7916..084cadccb0 100644
--- a/src/messaging/qmessagedatacomparator.cpp
+++ b/src/messaging/qmessagedatacomparator.cpp
@@ -86,6 +86,6 @@
This enum describes additional matching criteria when performing a search.
- \value FullWord The key should only match a complete word
- \value CaseSensitive The key should be case sensitive.
+ \value FullWord The key should only match a complete word. Not supported on Windows and QMF platforms.
+ \value CaseSensitive The key should be case sensitive. Not supported on QMF platform.
*/
diff --git a/src/messaging/qmessagefilter_win.cpp b/src/messaging/qmessagefilter_win.cpp
index 96f367e164..82fd1caa9a 100644
--- a/src/messaging/qmessagefilter_win.cpp
+++ b/src/messaging/qmessagefilter_win.cpp
@@ -1000,7 +1000,7 @@ MapiRestriction::MapiRestriction(const QMessageFilter &aFilter)
case QMessageFilterPrivate::Size: {
_restriction.res.resProperty.ulPropTag = PR_MESSAGE_SIZE;
_keyProp.ulPropTag = PR_MESSAGE_SIZE;
- _keyProp.Value.ul = d_ptr->_value.toInt();
+ _keyProp.Value.l = d_ptr->_value.toInt();
_valid = true;
break;
}
@@ -1021,18 +1021,18 @@ MapiRestriction::MapiRestriction(const QMessageFilter &aFilter)
break;
}
case QMessageFilterPrivate::Priority: {
- _restriction.res.resProperty.ulPropTag = PR_IMPORTANCE;
- _keyProp.ulPropTag = PR_IMPORTANCE;
+ _restriction.res.resProperty.ulPropTag = PR_PRIORITY;
+ _keyProp.ulPropTag = PR_PRIORITY;
QMessage::Priority priority(static_cast<QMessage::Priority>(d_ptr->_value.toInt()));
switch (priority) { // TODO: Double check that priority filtering is working
case QMessage::HighPriority:
- _keyProp.Value.ul = PRIO_URGENT;
+ _keyProp.Value.l = PRIO_URGENT;
break;
case QMessage::NormalPriority:
- _keyProp.Value.ul = PRIO_NORMAL;
+ _keyProp.Value.l = PRIO_NORMAL;
break;
case QMessage::LowPriority:
- _keyProp.Value.ul = PRIO_NONURGENT;
+ _keyProp.Value.l = PRIO_NONURGENT;
break;
default:
qWarning("Unknown priority encountered during filter processing");
@@ -1112,9 +1112,16 @@ MapiRestriction::MapiRestriction(const QMessageFilter &aFilter)
_valid = true;
return;
case QMessage::HasAttachments:
+#ifdef _WIN32_WCE
+ _restriction.rt = RES_EXIST;
+ _restriction.res.resExist.ulReserved1 = 0;
+ _restriction.res.resExist.ulPropTag = PR_HASATTACH;
+ _restriction.res.resExist.ulReserved2 = 0;
+#else
_restriction.res.resBitMask.relBMR = BMR_NEZ;
_restriction.res.resBitMask.ulPropTag = PR_MESSAGE_FLAGS;
- _restriction.res.resBitMask.ulMask = MSGFLAG_HASATTACH; // Found in PR_HASATTACH msdn doc, but not covered in PR_MESSAGE_FLAGS doc
+ _restriction.res.resBitMask.ulMask = MSGFLAG_HASATTACH;
+#endif
_valid = true;
return;
default:
diff --git a/src/messaging/qmessageid_win.cpp b/src/messaging/qmessageid_win.cpp
index 84654a3dac..7e1198b053 100644
--- a/src/messaging/qmessageid_win.cpp
+++ b/src/messaging/qmessageid_win.cpp
@@ -266,8 +266,10 @@ QString QMessageId::toString() const
if (!isValid())
return QString();
+#ifndef _WIN32_WCE
if (d_ptr->_messageRecordKey.isEmpty())
d_ptr->_messageRecordKey = QMessageIdPrivate::messageRecordKey(*this);
+#endif
if (d_ptr->_folderRecordKey.isEmpty())
d_ptr->_folderRecordKey = QMessageIdPrivate::folderRecordKey(*this);
diff --git a/src/messaging/qmessageordering.cpp b/src/messaging/qmessageordering.cpp
index b8e8a5d9d1..e12f48370b 100644
--- a/src/messaging/qmessageordering.cpp
+++ b/src/messaging/qmessageordering.cpp
@@ -78,6 +78,9 @@ QTM_BEGIN_NAMESPACE
non-empty ordering.
The result of combining two empty keys is an empty ordering.
+
+ Windows mobile and desktop platforms do not support ordering bySender() and byRecipients(),
+ additionally the Windows mobile platform does not support ordering byTimeStamp() and bySize().
*/
/*!
@@ -116,6 +119,9 @@ QTM_BEGIN_NAMESPACE
of ordering \a other.
This function determines sorting precedence.
+
+ On the Windows Mobile platform bySubject() and byReceptionTimeStamp() orderings can not
+ be combined with each other.
*/
/*!
@@ -125,6 +131,9 @@ QTM_BEGIN_NAMESPACE
to this ordering.
This function determines sorting precedence.
+
+ On the Windows Mobile platform bySubject() and byReceptionTimeStamp() orderings can not
+ be combined with each other.
*/
/*!
@@ -152,6 +161,8 @@ bool QMessageOrdering::operator!=(const QMessageOrdering& other) const
\fn QMessageOrdering::bySender(Qt::SortOrder order)
Returns an ordering that sorts messages by the address from which they were sent, according to \a order.
+
+ Not supported on the Windows mobile and desktop platforms.
\sa QMessage::from()
*/
@@ -161,6 +172,8 @@ bool QMessageOrdering::operator!=(const QMessageOrdering& other) const
Returns an ordering that sorts messages by the addresses to which they were sent, according to \a order.
+ Not supported on the Windows mobile and desktop platforms.
+
\sa QMessage::to()
*/
@@ -177,7 +190,9 @@ bool QMessageOrdering::operator!=(const QMessageOrdering& other) const
Returns an ordering that sorts messages by their origination timestamp, according to \a order.
- \sa QMessage::date()
+ Not supported on the Windows mobile platform.
+
+ \sa QMessage::date(), byReceptionTimeStamp()
*/
/*!
@@ -209,6 +224,8 @@ bool QMessageOrdering::operator!=(const QMessageOrdering& other) const
Returns an ordering that sorts messages by their size, according to \a order.
+ Not supported on the Windows mobile platform.
+
\sa QMessage::size()
*/
diff --git a/src/messaging/qmessageordering_win.cpp b/src/messaging/qmessageordering_win.cpp
index 11289d9ac0..5e6c1f81b4 100644
--- a/src/messaging/qmessageordering_win.cpp
+++ b/src/messaging/qmessageordering_win.cpp
@@ -80,10 +80,6 @@ bool QMessageOrderingPrivate::lessThan(const QMessageOrdering &ordering, const Q
right = &l;
}
- //TODO: Type and Priority will require multiple filter passes in QMessageStore
- //TODO: Recipients won't be supported
- //TODO: Status may require multiple passes, or may not be implementable with MAPI
-
switch (field)
{
case Type: COMPARE(left->type(), right->type())
@@ -106,7 +102,7 @@ bool QMessageOrderingPrivate::lessThan(const QMessageOrdering &ordering, const Q
case HasAttachments: COMPARE(left->status() & QMessage::HasAttachments, right->status() & QMessage::HasAttachments)
case Incoming: COMPARE(left->status() & QMessage::Incoming, right->status() & QMessage::Incoming)
case Removed: COMPARE(left->status() & QMessage::Removed, right->status() & QMessage::Removed)
- case Priority: COMPARE(left->priority(), right->priority())
+ case Priority: COMPARE(right->priority(), left->priority()) // Low priority comes first
case Size: COMPARE(left->size(), right->size())
}
}
@@ -154,11 +150,7 @@ void QMessageOrderingPrivate::sortTable(QMessageStore::ErrorCode *lastError, con
propTag = PR_SENDER_NAME; // MAPI is limited to sorting by sender name only, sender name + sender address does not appear to be supported
break;
case Size:
-#ifdef _WIN32_WCE
- propTag = PR_CONTENT_LENGTH;
-#else
propTag = PR_MESSAGE_SIZE;
-#endif
break;
case Type:
case Read:
@@ -171,14 +163,13 @@ void QMessageOrderingPrivate::sortTable(QMessageStore::ErrorCode *lastError, con
continue;
default:
qWarning("Unhandled sort criteria");
- propTag = PR_SUBJECT; // TODO handle all cases
+ propTag = PR_MESSAGE_DELIVERY_TIME;
}
multiSort.aSort[i].ulPropTag = propTag;
multiSort.aSort[i].ulOrder = order;
}
- //Note: WinCE does not support multiple sort levels and should return an error if more than 1 level is used
- //TODO: Update doc to reflect this
+ //Note: Windows Mobile does not support multiple sort levels
multiSort.cSorts = qMin<int>(maxSortOrders, fieldOrderList.count());
if (messagesTable->SortTable(reinterpret_cast<SSortOrderSet*>(&multiSort), 0) != S_OK) {
*lastError = QMessageStore::NotYetImplemented;
@@ -240,8 +231,8 @@ QList<QMessageFilter> QMessageOrderingPrivate::normalize(const QList<QMessageFil
QList<QMessageFilter> previous(result);
result.clear();
foreach(QMessageFilter filter, previous) {
- result.append(QMessageFilter::byStatus(QMessage::Read, QMessageDataComparator::Equal) & filter);
- result.append(QMessageFilter::byStatus(QMessage::Read, QMessageDataComparator::NotEqual) & filter);
+ result.append(QMessageFilter::byStatus(QMessage::Read, QMessageDataComparator::Includes) & filter);
+ result.append(QMessageFilter::byStatus(QMessage::Read, QMessageDataComparator::Excludes) & filter);
}
} break;
case HasAttachments:
@@ -249,8 +240,8 @@ QList<QMessageFilter> QMessageOrderingPrivate::normalize(const QList<QMessageFil
QList<QMessageFilter> previous(result);
result.clear();
foreach(QMessageFilter filter, previous) {
- result.append(QMessageFilter::byStatus(QMessage::HasAttachments, QMessageDataComparator::Equal) & filter);
- result.append(QMessageFilter::byStatus(QMessage::HasAttachments, QMessageDataComparator::NotEqual) & filter);
+ result.append(QMessageFilter::byStatus(QMessage::HasAttachments, QMessageDataComparator::Includes) & filter);
+ result.append(QMessageFilter::byStatus(QMessage::HasAttachments, QMessageDataComparator::Excludes) & filter);
}
} break;
case Incoming:
@@ -258,8 +249,8 @@ QList<QMessageFilter> QMessageOrderingPrivate::normalize(const QList<QMessageFil
QList<QMessageFilter> previous(result);
result.clear();
foreach(QMessageFilter filter, previous) {
- result.append(QMessageFilter::byStatus(QMessage::Incoming, QMessageDataComparator::Equal) & filter);
- result.append(QMessageFilter::byStatus(QMessage::Incoming, QMessageDataComparator::NotEqual) & filter);
+ result.append(QMessageFilter::byStatus(QMessage::Incoming, QMessageDataComparator::Includes) & filter);
+ result.append(QMessageFilter::byStatus(QMessage::Incoming, QMessageDataComparator::Excludes) & filter);
}
} break;
case Removed:
@@ -267,8 +258,8 @@ QList<QMessageFilter> QMessageOrderingPrivate::normalize(const QList<QMessageFil
QList<QMessageFilter> previous(result);
result.clear();
foreach(QMessageFilter filter, previous) {
- result.append(QMessageFilter::byStatus(QMessage::Removed, QMessageDataComparator::Equal) & filter);
- result.append(QMessageFilter::byStatus(QMessage::Removed, QMessageDataComparator::NotEqual) & filter);
+ result.append(QMessageFilter::byStatus(QMessage::Removed, QMessageDataComparator::Includes) & filter);
+ result.append(QMessageFilter::byStatus(QMessage::Removed, QMessageDataComparator::Excludes) & filter);
}
} break;
case Priority:
@@ -337,6 +328,8 @@ QMessageOrdering QMessageOrdering::operator+(const QMessageOrdering& other) cons
if (!thisIsFilterType && !otherIsFilterType)
sum.d_ptr->_valid = false;
#endif
+ if (!this->isSupported() || !other.isSupported())
+ sum.d_ptr->_valid = false;
return sum;
}
@@ -352,6 +345,8 @@ QMessageOrdering& QMessageOrdering::operator+=(const QMessageOrdering& other)
if (!thisIsFilterType && !otherIsFilterType)
d_ptr->_valid = false;
#endif;
+ if (!other.isSupported())
+ d_ptr->_valid = false;
return *this;
}
@@ -363,7 +358,6 @@ bool QMessageOrdering::operator==(const QMessageOrdering& other) const
QMessageOrdering QMessageOrdering::byType(Qt::SortOrder order)
{
QMessageOrdering result(QMessageOrderingPrivate::from(QMessageOrderingPrivate::Type, order));
- result.d_ptr->_valid = false; // Not yet implemented
return result;
}
@@ -408,12 +402,16 @@ QMessageOrdering QMessageOrdering::byStatus(QMessage::Status flag, Qt::SortOrder
switch (flag) {
case QMessage::Read:
result = QMessageOrderingPrivate::from(QMessageOrderingPrivate::Read, order);
+ break;
case QMessage::HasAttachments:
result = QMessageOrderingPrivate::from(QMessageOrderingPrivate::HasAttachments, order);
+ break;
case QMessage::Incoming:
result = QMessageOrderingPrivate::from(QMessageOrderingPrivate::Incoming, order);
+ break;
case QMessage::Removed:
result = QMessageOrderingPrivate::from(QMessageOrderingPrivate::Removed, order);
+ break;
}
return result;
}
@@ -426,7 +424,11 @@ QMessageOrdering QMessageOrdering::byPriority(Qt::SortOrder order)
QMessageOrdering QMessageOrdering::bySize(Qt::SortOrder order)
{
- return QMessageOrderingPrivate::from(QMessageOrderingPrivate::Size, order);
+ QMessageOrdering result(QMessageOrderingPrivate::from(QMessageOrderingPrivate::Size, order));
+#ifdef _WIN32_WCE
+ result.d_ptr->_valid = false; // Not supported on WinCE
+#endif
+ return result;
}
QTM_END_NAMESPACE
diff --git a/src/messaging/qmessageserviceaction.cpp b/src/messaging/qmessageserviceaction.cpp
index 254ca695e7..21cb63e169 100644
--- a/src/messaging/qmessageserviceaction.cpp
+++ b/src/messaging/qmessageserviceaction.cpp
@@ -80,9 +80,9 @@ QTM_BEGIN_NAMESPACE
that instance delivers.
Except where noted QMessageServiceActions may initiate network activity. Other functions in
- the mobility messaging API will not initiate network activity, with the exception of MAPI
- based platforms which may initiate network activity during the evaluation of any function
- call.
+ the mobility messaging API will not initiate network activity, with the exception of Windows
+ mobile and desktop platforms which may initiate network activity during the evaluation of any
+ function call.
*/
/*!
@@ -207,6 +207,8 @@ QTM_BEGIN_NAMESPACE
Returns true if the action can be initiated; otherwise returns false.
+ Not implemented on QMF platform.
+
\sa QMessage::type()
*/
@@ -239,9 +241,9 @@ QTM_BEGIN_NAMESPACE
*/
/*!
- \fn QMessageServiceAction::retrieve(const QMessageContentContainerId& id)
+ \fn QMessageServiceAction::retrieve(const QMessageId &messageId, const QMessageContentContainerId& id)
- Retrieve the container identified by \a id, the contents of the container should also be
+ Retrieve the container identified by \a messageId and \a id, the contents of the container should also be
retrieved.
Returns true if the action can be initiated; otherwise returns false.
@@ -258,16 +260,19 @@ QTM_BEGIN_NAMESPACE
Returns true if the action can be initiated; otherwise returns false.
+ Not implemented on QMF platform.
+
\sa QMessageId, QMessage::type()
*/
/*!
\fn QMessageServiceAction::exportUpdates(const QMessageAccountId &id)
- Iniate synchronization with external servers of local changes that have been queued by message store operations.
+ Iniate synchronization with external servers of local changes that have been queued by message store operations,
+ for messages with parent account \a id.
- On MAPI platforms this function performs no operation, as when a connection is available, local changes are
- opportunistically synchronized with external servers.
+ On Windows mobile and desktop platforms this function performs no operation, as when a connection is available,
+ local changes are opportunistically synchronized with external servers.
Returns true if the action can be initiated; otherwise returns false.
diff --git a/src/messaging/qmessageserviceaction.h b/src/messaging/qmessageserviceaction.h
index 6e010afe3f..a1bf4c97d1 100644
--- a/src/messaging/qmessageserviceaction.h
+++ b/src/messaging/qmessageserviceaction.h
@@ -76,7 +76,7 @@ public:
bool compose(const QMessage &message);
bool retrieveHeader(const QMessageId &id);
bool retrieveBody(const QMessageId &id);
- bool retrieve(const QMessageContentContainerId &id);
+ bool retrieve(const QMessageId &messageId, const QMessageContentContainerId &id);
bool show(const QMessageId &id);
bool exportUpdates(const QMessageAccountId &id);
diff --git a/src/messaging/qmessageserviceaction_maemo.cpp b/src/messaging/qmessageserviceaction_maemo.cpp
index c809ef467f..9cc386bf8c 100644
--- a/src/messaging/qmessageserviceaction_maemo.cpp
+++ b/src/messaging/qmessageserviceaction_maemo.cpp
@@ -103,8 +103,9 @@ bool QMessageServiceAction::retrieveBody(const QMessageId& id)
return false; // stub
}
-bool QMessageServiceAction::retrieve(const QMessageContentContainerId& id)
+bool QMessageServiceAction::retrieve(const QMessageId &messageId, const QMessageContentContainerId& id)
{
+ Q_UNUSED(messageId)
Q_UNUSED(id)
return false; // stub
}
diff --git a/src/messaging/qmessageserviceaction_qmf.cpp b/src/messaging/qmessageserviceaction_qmf.cpp
index eaf5af6739..b30e8d083e 100644
--- a/src/messaging/qmessageserviceaction_qmf.cpp
+++ b/src/messaging/qmessageserviceaction_qmf.cpp
@@ -496,8 +496,9 @@ bool QMessageServiceAction::retrieveBody(const QMessageId& id)
return true;
}
-bool QMessageServiceAction::retrieve(const QMessageContentContainerId& id)
+bool QMessageServiceAction::retrieve(const QMessageId &messageId, const QMessageContentContainerId& id)
{
+ Q_UNUSED(messageId)
if (d_ptr->_active && ((d_ptr->_active->activity() == QMailServiceAction::Pending) || (d_ptr->_active->activity() == QMailServiceAction::InProgress))) {
qWarning() << "Action is currently busy";
return false;
diff --git a/src/messaging/qmessageserviceaction_symbian.cpp b/src/messaging/qmessageserviceaction_symbian.cpp
index a81fb0b4c8..2d0846afbf 100644
--- a/src/messaging/qmessageserviceaction_symbian.cpp
+++ b/src/messaging/qmessageserviceaction_symbian.cpp
@@ -212,8 +212,9 @@ bool QMessageServiceAction::retrieveBody(const QMessageId& id)
return d_ptr->retrieveBody(id);
}
-bool QMessageServiceAction::retrieve(const QMessageContentContainerId& id)
+bool QMessageServiceAction::retrieve(const QMessageId &messageId, const QMessageContentContainerId& id)
{
+ Q_UNUSED(messageId)
return d_ptr->retrieve(id);
}
diff --git a/src/messaging/qmessageserviceaction_symbian_p.h b/src/messaging/qmessageserviceaction_symbian_p.h
index af095d83ee..2ba2672755 100644
--- a/src/messaging/qmessageserviceaction_symbian_p.h
+++ b/src/messaging/qmessageserviceaction_symbian_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
-** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
@@ -20,16 +21,24 @@
** 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.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
**
-** If you have questions regarding the use of this file, please
-** contact Nokia at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
+
#include "qmessageserviceaction.h"
diff --git a/src/messaging/qmessageserviceaction_win.cpp b/src/messaging/qmessageserviceaction_win.cpp
index fdd94a4953..b1e0a08007 100644
--- a/src/messaging/qmessageserviceaction_win.cpp
+++ b/src/messaging/qmessageserviceaction_win.cpp
@@ -48,6 +48,7 @@
#include "qmessage_p.h"
#include "qmessagestore_p.h"
#include "qmessagecontentcontainer_p.h"
+#include "qmessagecontentcontainerid_p.h"
#include <QDebug>
#include <QThread>
#include <QTimer>
@@ -603,8 +604,7 @@ public:
// Ensure that this thread has initialized MAPI
WinHelpers::MapiInitializationToken token(WinHelpers::initializeMapi());
- // TODO: body text search
- _parent->_candidateIds = QMessageStore::instance()->queryMessages(_filter, _ordering, _limit, _offset);
+ _parent->_candidateIds = QMessageStore::instance()->queryMessages(_filter, _body, _options, _ordering, _limit, _offset);
_parent->_lastError = QMessageStore::instance()->lastError();
emit completed();
}
@@ -743,7 +743,7 @@ bool QMessageServiceAction::compose(const QMessage &message)
bool QMessageServiceAction::retrieveHeader(const QMessageId& id)
{
- //NO-OP
+ Q_UNUSED(id);
return true;
}
@@ -776,14 +776,30 @@ bool QMessageServiceAction::retrieveBody(const QMessageId& id)
return result;
#else
+ Q_UNUSED(id);
return false;
#endif
}
-bool QMessageServiceAction::retrieve(const QMessageContentContainerId& id)
+bool QMessageServiceAction::retrieve(const QMessageId &aMessageId, const QMessageContentContainerId& id)
{
- //NO-OP
- return true;
+ Q_UNUSED(aMessageId)
+#ifdef _WIN32_WCE
+
+ if(!aMessageId.isValid())
+ return false;
+
+ QMessage message(aMessageId);
+
+ bool isBodyContainer = message.bodyId() == id;
+
+ if(isBodyContainer)
+ return retrieveBody(aMessageId);
+
+ //TODO download message attachment programatically using MAPI impossible?
+#endif
+
+ return false;
}
bool QMessageServiceAction::show(const QMessageId& id)
@@ -809,7 +825,7 @@ bool QMessageServiceAction::show(const QMessageId& id)
bool QMessageServiceAction::exportUpdates(const QMessageAccountId &id)
{
- //NOOP
+ Q_UNUSED(id);
return true;
}
diff --git a/src/messaging/qmessagestore.cpp b/src/messaging/qmessagestore.cpp
index 47e42958d6..56de6e83a9 100644
--- a/src/messaging/qmessagestore.cpp
+++ b/src/messaging/qmessagestore.cpp
@@ -69,9 +69,10 @@ QTM_BEGIN_NAMESPACE
and \l{QMessageServiceAction::queryMessages()}{queryMessages} functions of the
QMessageServiceAction class.
- With the exception of MAPI based platforms, QMessageStore functions should not initiate
- network activity. Instead they are restricted to operating on data already on the device.
- See QMessageServiceAction for functions related to initiating network activity.
+ With the exception of Windows mobile and desktop platforms, QMessageStore functions
+ should not initiate network activity. Instead functions are restricted to operating
+ on data already on the device. See QMessageServiceAction for functions related to
+ initiating network activity.
If a QMessageStore operation fails, the lastError() function will return an error code
value indicating the failure mode encountered. A successful operation will set the
@@ -113,25 +114,6 @@ QTM_BEGIN_NAMESPACE
This type contains a set of values identifying registered message filters.
*/
-/*
- TODO capabilities AtomicBooleanSearch AtomicSlices Sms Mms Email Xmpp Presence AtomicExtendedSearching AtomicBodySearching
- ExtendedServices AtomicCustomSearching CaseInsensitiveSearching FullWordSearching
-
- Maybe capabilities are not necessary.
- Sms, Mms, Email, Xmpp are only enabled if a valid default account exists for that type.
- All other capabilities are searching related, lack of support for them can be detected by a QMailStore::lastError of NotYetImplemented.
-
- Activate/deactive on only adds, deletes or updates? Requires enum,
- enum NotificationType
- {
- Add = 1,
- Removed,
- Changed
- }
-
- MAPI has move and copy signals, QMF does not.
-*/
-
/*!
\enum QMessageStore::ErrorCode
@@ -144,6 +126,7 @@ QTM_BEGIN_NAMESPACE
\value NotYetImplemented The operation failed because the messaging store does not yet implement the operation.
\value FrameworkFault The operation failed because the messaging store encountered an error in performing the operation.
\value WorkingMemoryOverflow The operation failed because the messaging store exhausted all memory available for evaluating queries.
+ \value Busy The operation failed because the messaging store is being used by another thread.
*/
/*!
@@ -272,6 +255,8 @@ QTM_BEGIN_NAMESPACE
To ensure the change is propagated to any affected external server
QMessageServiceAction::exportUpdates() should be subsequently called.
+
+ \a option is ignored on Windows mobile and desktop platforms.
\sa removeMessages(), addMessage(), updateMessage(), QMessageServiceAction::exportUpdates()
*/
@@ -288,7 +273,9 @@ QTM_BEGIN_NAMESPACE
To ensure the change is propagated to any affected external server
QMessageServiceAction::exportUpdates() should be subsequently called.
+ \a option is ignored on Windows mobile and desktop platforms.
+
For example:
To implement a function to remove a list messages identified by QMessageIds
diff --git a/src/messaging/qmessagestore_p.h b/src/messaging/qmessagestore_p.h
index ad75d63b2e..7088830c0b 100644
--- a/src/messaging/qmessagestore_p.h
+++ b/src/messaging/qmessagestore_p.h
@@ -41,6 +41,9 @@
#ifndef QMESSAGESTOREPRIVATE_H
#define QMESSAGESTOREPRIVATE_H
#include "qmessagestore.h"
+#ifdef Q_OS_WIN
+class QMutex;
+#endif
QTM_BEGIN_NAMESPACE
@@ -59,6 +62,11 @@ public:
QMessageStore *q_ptr;
QMessageStorePrivatePlatform *p_ptr;
+
+#ifdef Q_OS_WIN
+ static QMutex* mutex(QMessageStore*);
+#endif
+
};
QTM_END_NAMESPACE
diff --git a/src/messaging/qmessagestore_win.cpp b/src/messaging/qmessagestore_win.cpp
index 07af38a3a9..f64b408528 100644
--- a/src/messaging/qmessagestore_win.cpp
+++ b/src/messaging/qmessagestore_win.cpp
@@ -50,6 +50,7 @@
#include <QCoreApplication>
#include <QMutex>
#include <qdebug.h>
+#include <QThread>
QTM_BEGIN_NAMESPACE
@@ -59,20 +60,28 @@ namespace {
class MutexTryLocker
{
QMutex *_mutex;
+ QString _location;
public:
- MutexTryLocker(QMutex *mutex)
+ MutexTryLocker(QMutex *mutex)
: _mutex(0)
{
if (mutex->tryLock()) {
_mutex = mutex;
}
}
-
+
~MutexTryLocker()
{
if (_mutex) {
+
_mutex->unlock();
+
+ QMessageStore::ErrorCode le = QMessageStore::NoError;
+ MapiSessionPtr p = MapiSession::createSession(&le);
+ if(le == QMessageStore::NoError)
+ p->flushNotifyQueue();
+
}
}
@@ -147,6 +156,13 @@ void QMessageStorePrivate::initialize(QMessageStore *store)
p_ptr = new QMessageStorePrivatePlatform(this, store);
}
+#ifdef Q_OS_WIN
+QMutex* QMessageStorePrivate::mutex(QMessageStore* store)
+{
+ return &(store->d_ptr->p_ptr->mutex);
+}
+#endif
+
Q_GLOBAL_STATIC(QMessageStorePrivate,data);
QMessageStore::QMessageStore(QObject *parent)
@@ -182,6 +198,7 @@ QMessageIdList QMessageStore::queryMessages(const QMessageFilter &filter, const
QMessageIdList result;
MutexTryLocker locker(&d_ptr->p_ptr->mutex);
+
if (!locker) {
d_ptr->p_ptr->lastError = QMessageStore::Busy;
return result;
diff --git a/src/messaging/qmtmengine_symbian.cpp b/src/messaging/qmtmengine_symbian.cpp
index cf44bb2355..9cbd8333e5 100644
--- a/src/messaging/qmtmengine_symbian.cpp
+++ b/src/messaging/qmtmengine_symbian.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
-** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
@@ -20,16 +21,24 @@
** 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.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
**
-** If you have questions regarding the use of this file, please
-** contact Nokia at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
+
#include "qmessagestore_symbian_p.h"
#include "qmtmengine_symbian_p.h"
#include "qmessage_symbian_p.h"
diff --git a/src/messaging/qmtmengine_symbian_p.h b/src/messaging/qmtmengine_symbian_p.h
index f4b4821aaf..f293d4ac22 100644
--- a/src/messaging/qmtmengine_symbian_p.h
+++ b/src/messaging/qmtmengine_symbian_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
-** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
@@ -20,16 +21,24 @@
** 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.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
**
-** If you have questions regarding the use of this file, please
-** contact Nokia at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
+
#ifndef QMTMENGINE_SYMBIAN_H
#define QMTMENGINE_SYMBIAN_H
diff --git a/src/messaging/winhelpers.cpp b/src/messaging/winhelpers.cpp
index 954c69087b..fbf1424575 100644
--- a/src/messaging/winhelpers.cpp
+++ b/src/messaging/winhelpers.cpp
@@ -81,6 +81,7 @@
#include "qmessageaccount_p.h"
#include "qmessageaccountfilter_p.h"
#include "qmessageaccountordering_p.h"
+#include "qmessagestore_p.h"
#include <QCoreApplication>
#include <QDebug>
@@ -88,6 +89,7 @@
#include <QTextCodec>
#include <QThreadStorage>
#include <QTimer>
+#include <QMutexLocker>
#include <shlwapi.h>
#include <shlguid.h>
@@ -1025,20 +1027,56 @@ namespace {
qWarning() << "Unable to set submit time in message.";
*lastError = QMessageStore::FrameworkFault;
} else {
- QStringList headers;
- foreach (const QByteArray &name, source.headerFields()) {
- foreach (const QString &value, source.headerFieldValues(name)) {
- // TODO: Do we need soft line-breaks?
- headers.append(QString("%1: %2").arg(QString(name)).arg(value));
+ QDateTime receivedDate(source.receivedDate());
+ if (receivedDate.isValid()) {
+ if (!setMapiProperty(message, PR_MESSAGE_DELIVERY_TIME, toFileTime(receivedDate))) {
+ qWarning() << "Unable to set delivery time in message.";
+ *lastError = QMessageStore::FrameworkFault;
+ }
+ }
+
+ if (*lastError == QMessageStore::NoError) {
+ // Mark this message as read/unread
+#ifndef _WIN32_WCE
+ LONG flags = (source.status() & QMessage::Read ? 0 : CLEAR_READ_FLAG);
+ HRESULT rv = message->SetReadFlag(flags);
+ if (HR_FAILED(rv)) {
+ qWarning() << "Unable to set flags in message.";
+ *lastError = QMessageStore::FrameworkFault;
}
+#else
+ LONG flags = (source.status() & QMessage::Read ? MSGFLAG_READ : 0);
+ if (!setMapiProperty(message, PR_MESSAGE_FLAGS, flags)) {
+ qWarning() << "Unable to set flags in message.";
+ *lastError = QMessageStore::FrameworkFault;
+ }
+#endif
}
- if (!headers.isEmpty()) {
- QString transportHeaders = headers.join("\r\n").append("\r\n\r\n");
- if (!setMapiProperty(message, PR_TRANSPORT_MESSAGE_HEADERS, transportHeaders)) {
- qWarning() << "Unable to set transport headers in message.";
+
+ if (*lastError == QMessageStore::NoError) {
+ LONG priority = (source.priority() == QMessage::HighPriority ? PRIO_URGENT : (source.priority() == QMessage::NormalPriority ? PRIO_NORMAL : PRIO_NONURGENT));
+ if (!setMapiProperty(message, PR_PRIORITY, priority)) {
+ qWarning() << "Unable to set priority in message.";
*lastError = QMessageStore::FrameworkFault;
}
}
+
+ if (*lastError == QMessageStore::NoError) {
+ QStringList headers;
+ foreach (const QByteArray &name, source.headerFields()) {
+ foreach (const QString &value, source.headerFieldValues(name)) {
+ // TODO: Do we need soft line-breaks?
+ headers.append(QString("%1: %2").arg(QString(name)).arg(value));
+ }
+ }
+ if (!headers.isEmpty()) {
+ QString transportHeaders = headers.join("\r\n").append("\r\n\r\n");
+ if (!setMapiProperty(message, PR_TRANSPORT_MESSAGE_HEADERS, transportHeaders)) {
+ qWarning() << "Unable to set transport headers in message.";
+ *lastError = QMessageStore::FrameworkFault;
+ }
+ }
+ }
}
}
#ifdef _WIN32_WCE
@@ -1528,27 +1566,15 @@ namespace {
}
}
- class NotifyEvent : public QEvent
- {
- public:
- static QEvent::Type eventType();
-
- NotifyEvent(MapiStore *store, const QMessageId &id, MapiSession::NotifyType type);
-
- virtual Type type();
-
- MapiStore *_store;
- QMessageId _id;
- MapiSession::NotifyType _notifyType;
- };
+}
- QEvent::Type NotifyEvent::eventType()
+ QEvent::Type MapiSession::NotifyEvent::eventType()
{
static int result = QEvent::registerEventType();
return static_cast<QEvent::Type>(result);
}
- NotifyEvent::NotifyEvent(MapiStore *store, const QMessageId &id, MapiSession::NotifyType type)
+ MapiSession::NotifyEvent::NotifyEvent(MapiStore *store, const QMessageId &id, MapiSession::NotifyType type)
: QEvent(eventType()),
_store(store),
_id(id),
@@ -1556,11 +1582,10 @@ namespace {
{
}
- QEvent::Type NotifyEvent::type()
+ QEvent::Type MapiSession::NotifyEvent::type()
{
return eventType();
}
-}
namespace WinHelpers {
@@ -3114,7 +3139,7 @@ ULONG MapiStore::AdviseSink::OnNotify(ULONG notificationCount, LPNOTIFICATION no
}
// Create an event to be processed by the UI thread
- QCoreApplication::postEvent(session.data(), new NotifyEvent(_store, messageId, notifyType));
+ QCoreApplication::postEvent(session.data(), new MapiSession::NotifyEvent(_store, messageId, notifyType));
} else {
qWarning() << "Received notification, but no entry ID";
}
@@ -3793,9 +3818,9 @@ bool MapiSession::updateMessageProperties(QMessageStore::ErrorCode *lastError, Q
IMessage *message = openMapiMessage(lastError, msg->id(), &store);
if (*lastError == QMessageStore::NoError) {
#ifndef _WIN32_WCE
- const int np = 14;
+ const int np = 15;
#else
- const int np = 12;
+ const int np = 13;
#endif
SizedSPropTagArray(np, msgCols) = {np, { PR_PARENT_ENTRYID,
PR_MESSAGE_FLAGS,
@@ -3808,13 +3833,12 @@ bool MapiSession::updateMessageProperties(QMessageStore::ErrorCode *lastError, Q
PR_TRANSPORT_MESSAGE_HEADERS,
PR_HASATTACH,
PR_SUBJECT,
+ PR_PRIORITY,
#ifndef _WIN32_WCE
PR_MSG_EDITOR_FORMAT,
PR_RTF_IN_SYNC,
- PR_MESSAGE_SIZE
-#else
- PR_CONTENT_LENGTH
#endif
+ PR_MESSAGE_SIZE
}};
ULONG count = 0;
LPSPropValue properties;
@@ -3884,6 +3908,18 @@ bool MapiSession::updateMessageProperties(QMessageStore::ErrorCode *lastError, Q
break;
case PR_HASATTACH:
msg->d_ptr->_hasAttachments = (prop.Value.b != FALSE);
+ if (prop.Value.b) {
+ flags |= QMessage::HasAttachments;
+ }
+ break;
+ case PR_PRIORITY:
+ if (prop.Value.l == PRIO_URGENT) {
+ msg->setPriority(QMessage::HighPriority);
+ } else if (prop.Value.l == PRIO_NONURGENT) {
+ msg->setPriority(QMessage::LowPriority);
+ } else {
+ msg->setPriority(QMessage::NormalPriority);
+ }
break;
#ifndef _WIN32_WCE
case PR_MSG_EDITOR_FORMAT:
@@ -3892,12 +3928,9 @@ bool MapiSession::updateMessageProperties(QMessageStore::ErrorCode *lastError, Q
case PR_RTF_IN_SYNC:
msg->d_ptr->_rtfInSync = (prop.Value.b != FALSE);;
break;
- case PR_MESSAGE_SIZE:
-#else
- case PR_CONTENT_LENGTH:
#endif
- // Increase the size estimate by a third to allow for transfer encoding
- QMessagePrivate::setSize(*msg, prop.Value.ul * 4 / 3);
+ case PR_MESSAGE_SIZE:
+ QMessagePrivate::setSize(*msg, prop.Value.l);
break;
default:
break;
@@ -3905,6 +3938,7 @@ bool MapiSession::updateMessageProperties(QMessageStore::ErrorCode *lastError, Q
}
msg->setStatus(flags);
+ msg->setParentAccountId(store->id());
if (!senderName.isEmpty() || !senderAddress.isEmpty()) {
msg->setFrom(createAddress(senderName, senderAddress));
@@ -3913,6 +3947,11 @@ bool MapiSession::updateMessageProperties(QMessageStore::ErrorCode *lastError, Q
if (!parentEntryId.isEmpty()) {
QMessagePrivate::setStandardFolder(*msg, store->standardFolder(parentEntryId));
+
+ MapiFolderPtr parentFolder(store->openFolder(lastError, parentEntryId));
+ if (parentFolder) {
+ QMessagePrivate::setParentFolderId(*msg, parentFolder->id());
+ }
}
if (!isModified) {
@@ -4244,7 +4283,7 @@ bool MapiSession::updateMessageBody(QMessageStore::ErrorCode *lastError, QMessag
if (!msg->d_ptr->_hasAttachments) {
// Make the body the entire content of the message
messageContainer->setContent(messageBody, QByteArray("text"), bodySubType, QByteArray("utf-16"));
- msg->d_ptr->_bodyId = QMessageContentContainerPrivate::bodyContentId();
+ msg->d_ptr->_bodyId = messageContainer->bodyContentId();
messageContainer->_available = bodyDownloaded;
} else {
@@ -4645,7 +4684,16 @@ bool MapiSession::event(QEvent *e)
{
if (e->type() == NotifyEvent::eventType()) {
if (NotifyEvent *ne = static_cast<NotifyEvent*>(e)) {
- notify(ne->_store, ne->_id, ne->_notifyType);
+
+ QMutex* storeMutex = QMessageStorePrivate::mutex(QMessageStore::instance());
+
+ if(!storeMutex->tryLock())
+ addToNotifyQueue(*ne);
+ else
+ {
+ notify(ne->_store, ne->_id, ne->_notifyType);
+ storeMutex->unlock();
+ }
return true;
}
}
@@ -4730,6 +4778,23 @@ void MapiSession::dispatchNotifications()
QTimer::singleShot(1000, this, SLOT(dispatchNotifications()));
}
+void MapiSession::processNotifyQueue()
+{
+ foreach(const NotifyEvent& e, _notifyEventQueue)
+ {
+ QMutex* storeMutex = QMessageStorePrivate::mutex(QMessageStore::instance());
+ if(storeMutex->tryLock())
+ {
+ NotifyEvent ne = _notifyEventQueue.dequeue();
+ notify(e._store,e._id,e._notifyType);
+ storeMutex->unlock();
+ }
+ else break;
+ }
+ if(!_notifyEventQueue.isEmpty())
+ qWarning() << QString("Notify queue processing interrupted: pending %1").arg(_notifyEventQueue.length());
+}
+
QMessagePrivate *MapiSession::messageImpl(const QMessage &message)
{
return message.d_ptr;
@@ -4740,6 +4805,19 @@ QMessageContentContainerPrivate *MapiSession::containerImpl(const QMessageConten
return container.d_ptr;
}
+void MapiSession::addToNotifyQueue(const NotifyEvent& e)
+{
+ _notifyEventQueue.enqueue(e);
+ qWarning() << QString("Store busy...adding notify to queue: pending %1").arg(_notifyEventQueue.length());
+}
+
+void MapiSession::flushNotifyQueue()
+{
+ QTimer::singleShot(0, this, SLOT(processNotifyQueue()));
+}
+
+
+
#include "winhelpers.moc"
QTM_END_NAMESPACE
diff --git a/src/messaging/winhelpers_p.h b/src/messaging/winhelpers_p.h
index db1e54ec16..708f8c4090 100644
--- a/src/messaging/winhelpers_p.h
+++ b/src/messaging/winhelpers_p.h
@@ -50,6 +50,8 @@
#include <MAPIUtil.h>
#include <qmessagestore.h>
#include <QVector>
+#include <QQueue>
+#include <QEvent>
// As per http://support.microsoft.com/kb/816477
#ifndef PR_MSG_EDITOR_FORMAT
@@ -346,6 +348,20 @@ class MapiSession : public QObject
public:
enum NotifyType { Added = 1, Removed, Updated };
+ class NotifyEvent : public QEvent
+ {
+ public:
+ static QEvent::Type eventType();
+
+ NotifyEvent(MapiStore *store, const QMessageId &id, MapiSession::NotifyType type);
+
+ virtual Type type();
+
+ MapiStore *_store;
+ QMessageId _id;
+ NotifyType _notifyType;
+ };
+
static MapiSessionPtr createSession(QMessageStore::ErrorCode *lastError);
~MapiSession();
@@ -404,6 +420,9 @@ public:
static QMessagePrivate *messageImpl(const QMessage &message);
static QMessageContentContainerPrivate *containerImpl(const QMessageContentContainer &);
+ void addToNotifyQueue(const NotifyEvent& e);
+ void flushNotifyQueue();
+
signals:
void messageAdded(const QMessageId &id, const QMessageStore::NotificationFilterIdSet &matchingFilterIds);
void messageRemoved(const QMessageId &id, const QMessageStore::NotificationFilterIdSet &matchingFilterIds);
@@ -411,6 +430,7 @@ signals:
public slots:
void dispatchNotifications();
+ void processNotifyQueue();
private:
MapiSession();
@@ -438,6 +458,7 @@ private:
QMessageStore::NotificationFilterId _filterId;
QMap<QMessageStore::NotificationFilterId, QMessageFilter> _filters;
bool _registered;
+ QQueue<NotifyEvent> _notifyEventQueue;
mutable QHash<MapiEntryId, MapiStorePtr> _storeMap;
};
diff --git a/src/multimedia/experimental/qcamera.cpp b/src/multimedia/experimental/qcamera.cpp
index f21ccc5329..8ccd61af56 100644
--- a/src/multimedia/experimental/qcamera.cpp
+++ b/src/multimedia/experimental/qcamera.cpp
@@ -868,6 +868,9 @@ void QCamera::capture(const QString &file)
/*!
\enum QCamera::State
\value ActiveState The camera has been started and can produce data.
+ \value SuspendedState The camera is temporary not available,
+ usually as a result of higher priority client requested
+ the camera device.
\value StoppedState The camera has been stopped.
*/
diff --git a/src/multimedia/experimental/qcamera.h b/src/multimedia/experimental/qcamera.h
index 9980537314..1bd2d0b72e 100644
--- a/src/multimedia/experimental/qcamera.h
+++ b/src/multimedia/experimental/qcamera.h
@@ -69,7 +69,7 @@ class Q_MEDIA_EXPORT QCamera : public QMediaObject
Q_PROPERTY(int isoSensitivity READ isoSensitivity WRITE setManualIsoSensitivity NOTIFY isoSensitivityChanged)
public:
- enum State { ActiveState, StoppedState };
+ enum State { ActiveState, SuspendedState, StoppedState };
enum Error
{
diff --git a/src/multimedia/qaudioencodercontrol.cpp b/src/multimedia/qaudioencodercontrol.cpp
index 97b98ce380..e4eb748c76 100644
--- a/src/multimedia/qaudioencodercontrol.cpp
+++ b/src/multimedia/qaudioencodercontrol.cpp
@@ -51,7 +51,7 @@ QTM_BEGIN_NAMESPACE
\ingroup multimedia-serv
\preliminary
-
+
\brief The QAudioEncoderControl class provides access to the settings of a media service that
performs audio encoding.
@@ -107,9 +107,14 @@ QAudioEncoderControl::~QAudioEncoderControl()
*/
/*!
- \fn QAudioEncoderControl::supportedSampleRates() const
+ \fn QAudioEncoderControl::supportedSampleRates(const QAudioEncoderSettings &settings = QAudioEncoderSettings()) const
Returns the list of supported audio sample rates, if known.
+
+ If non null audio \a settings parameter is passed,
+ the returned list is reduced to sample rates supported with partial settings applied.
+
+ It can be used for example to query the list of sample rates, supported by specific audio codec.
*/
/*!
diff --git a/src/multimedia/qaudioencodercontrol.h b/src/multimedia/qaudioencodercontrol.h
index bbd49c6208..699b089a34 100644
--- a/src/multimedia/qaudioencodercontrol.h
+++ b/src/multimedia/qaudioencodercontrol.h
@@ -63,7 +63,7 @@ public:
virtual QStringList supportedAudioCodecs() const = 0;
virtual QString codecDescription(const QString &codecName) const = 0;
- virtual QList<int> supportedSampleRates() const = 0;
+ virtual QList<int> supportedSampleRates(const QAudioEncoderSettings &settings) const = 0;
virtual QAudioEncoderSettings audioSettings() const = 0;
virtual void setAudioSettings(const QAudioEncoderSettings&) = 0;
diff --git a/src/multimedia/qimageencodercontrol.cpp b/src/multimedia/qimageencodercontrol.cpp
index 550b89e8ed..6bdc607c08 100644
--- a/src/multimedia/qimageencodercontrol.cpp
+++ b/src/multimedia/qimageencodercontrol.cpp
@@ -47,17 +47,21 @@ QTM_BEGIN_NAMESPACE
/*!
\class QImageEncoderControl
\preliminary
+ \ingroup multimedia
+ \ingroup multimedia-serv
+
\brief The QImageEncoderControl class provides access to the settings of a media service that
performs image encoding.
- If a QMediaService supports encoding image data it will implement QImageEncoderControl. This
- control provides functions for setting the image \l {setImageCodec()}{codec}, and the
- \l {setResolution()}{resolution} and \l {setQuality()}{quality} of the encoded image.
+ If a QMediaService supports encoding image data it will implement QImageEncoderControl.
+ This control allows to \l {setImageSettings()}{set image encoding settings} and
+ provides functions for quering supported image \l {supportedImageCodecs()}{codecs} and
+ \l {supportedResolutions()}{resolutions}.
The interface name of QImageEncoderControl is \c com.nokia.Qt.QImageEncoderControl/1.0 as
defined in QImageEncoderControl_iid.
- \sa QMediaService::control()
+ \sa QImageEncoderSettings, QMediaService::control()
*/
/*!
@@ -86,44 +90,39 @@ QImageEncoderControl::~QImageEncoderControl()
}
/*!
- \fn QImageEncoderControl::supportedResolutions() const
+ \fn QImageEncoderControl::supportedResolutions(const QImageEncoderSettings &settings = QImageEncoderSettings()) const
Returns a list of supported resolutions. This will return an empty list if the encoder supports
arbitrary resolutions within the minimum and maximum range.
- \sa resolution(), minimumResolution(), maximumResolution()
+ If non null image \a settings parameter is passed,
+ the returned list is reduced to resolutions supported with partial settings applied.
+ It can be used to query the list of resolutions, supported by specific image codec.
-*/
+ \sa minimumResolution(), maximumResolution()
-/*!
- \fn QImageEncoderControl::resolution() const
-
- Returns the resolution of the encoded image.
*/
/*!
- \fn QImageEncoderControl::minimumResolution() const
+ \fn QImageEncoderControl::minimumResolution(const QImageEncoderSettings &settings = QImageEncoderSettings()) const
Returns the minimum supported resolution.
- \sa resolution()
+ If non null image \a settings parameter is passed,
+ the minimum supported resolution with partial settings applied is returned.
+
+ \sa supportedResolutions()
*/
/*!
- \fn QImageEncoderControl::maximumResolution() const
+ \fn QImageEncoderControl::maximumResolution(const QImageEncoderSettings &settings = QImageEncoderSettings()) const
Returns the maximum supported resolution.
- \sa resolution()
-*/
-
-/*!
- \fn QImageEncoderControl::setResolution(const QSize &resolution)
+ If non null image \a settings parameter is passed,
+ the maximum supported resolution with partial settings applied is returned.
- Sets the \a resolution of the encoded image.
-
- An empty QSize indicates the encoder should make an optimal choice based on what is available
- from the video source and the limitations of the codec.
+ \sa supportedResolutions()
*/
/*!
@@ -133,37 +132,21 @@ QImageEncoderControl::~QImageEncoderControl()
*/
/*!
- \fn QImageEncoderControl::imageCodec() const
-
- Returns the selected image codec.
-*/
-
-/*!
- \fn QImageEncoderControl::setImageCodec(const QString &codec)
-
- Sets the selected image \a codec.
-
- Returns true if the codec was accepted; and false otherwise.
-*/
-
-/*!
\fn QImageEncoderControl::imageCodecDescription(const QString &codec) const
Returns a description of an image \a codec.
*/
/*!
- \fn QImageEncoderControl::quality() const
+ \fn QImageEncoderControl::imageSettings() const
- Returns the image encoding quality.
+ Returns the currently used image encoder settings.
*/
/*!
- \fn QImageEncoderControl::setQuality(QtMedia::EncodingQuality quality)
-
- Sets the image encoding \a quality.
+ \fn QImageEncoderControl::setImageSettings(const QImageEncoderSettings &settings)
- \sa quality()
+ Sets the selected image encoder \a settings.
*/
#include "moc_qimageencodercontrol.cpp"
diff --git a/src/multimedia/qimageencodercontrol.h b/src/multimedia/qimageencodercontrol.h
index 6fd8957370..e500e78b21 100644
--- a/src/multimedia/qimageencodercontrol.h
+++ b/src/multimedia/qimageencodercontrol.h
@@ -60,9 +60,9 @@ class Q_MEDIA_EXPORT QImageEncoderControl : public QMediaControl
public:
virtual ~QImageEncoderControl();
- virtual QSize minimumResolution() const = 0;
- virtual QSize maximumResolution() const = 0;
- virtual QList<QSize> supportedResolutions() const = 0;
+ virtual QSize minimumResolution(const QImageEncoderSettings &settings) const = 0;
+ virtual QSize maximumResolution(const QImageEncoderSettings &settings) const = 0;
+ virtual QList<QSize> supportedResolutions(const QImageEncoderSettings &settings) const = 0;
virtual QStringList supportedImageCodecs() const = 0;
virtual QString imageCodecDescription(const QString &codecName) const = 0;
diff --git a/src/multimedia/qlocalmediaplaylistprovider.cpp b/src/multimedia/qlocalmediaplaylistprovider.cpp
index fb17a538cb..d8b445b35d 100644
--- a/src/multimedia/qlocalmediaplaylistprovider.cpp
+++ b/src/multimedia/qlocalmediaplaylistprovider.cpp
@@ -88,6 +88,23 @@ bool QLocalMediaPlaylistProvider::appendItem(const QMediaContent &content)
return true;
}
+bool QLocalMediaPlaylistProvider::appendItems(const QList<QMediaContent> &items)
+{
+ Q_D(QLocalMediaPlaylistProvider);
+
+ if (items.isEmpty())
+ return true;
+
+ int pos = d->resources.count();
+ int end = pos+items.count()-1;
+
+ emit itemsAboutToBeInserted(pos, end);
+ d->resources.append(items);
+ emit itemsInserted(pos, end);
+
+ return true;
+}
+
bool QLocalMediaPlaylistProvider::insertItem(int pos, const QMediaContent &content)
{
@@ -100,6 +117,23 @@ bool QLocalMediaPlaylistProvider::insertItem(int pos, const QMediaContent &conte
return true;
}
+bool QLocalMediaPlaylistProvider::insertItems(int pos, const QList<QMediaContent> &items)
+{
+ Q_D(QLocalMediaPlaylistProvider);
+
+ if (items.isEmpty())
+ return true;
+
+ const int last = pos+items.count()-1;
+
+ emit itemsAboutToBeInserted(pos, last);
+ for (int i=0; i<items.count(); i++)
+ d->resources.insert(pos+i, items.at(i));
+ emit itemsInserted(pos, last);
+
+ return true;
+}
+
bool QLocalMediaPlaylistProvider::removeItems(int fromPos, int toPos)
{
Q_D(QLocalMediaPlaylistProvider);
diff --git a/src/multimedia/qlocalmediaplaylistprovider.h b/src/multimedia/qlocalmediaplaylistprovider.h
index fadfcb904d..ee86905c86 100644
--- a/src/multimedia/qlocalmediaplaylistprovider.h
+++ b/src/multimedia/qlocalmediaplaylistprovider.h
@@ -60,7 +60,9 @@ public:
virtual bool isReadOnly() const;
virtual bool appendItem(const QMediaContent &content);
+ virtual bool appendItems(const QList<QMediaContent> &items);
virtual bool insertItem(int pos, const QMediaContent &content);
+ virtual bool insertItems(int pos, const QList<QMediaContent> &items);
virtual bool removeItem(int pos);
virtual bool removeItems(int start, int end);
virtual bool clear();
diff --git a/src/multimedia/qmediaobject.cpp b/src/multimedia/qmediaobject.cpp
index 07b811e1a9..aa8906e06c 100644
--- a/src/multimedia/qmediaobject.cpp
+++ b/src/multimedia/qmediaobject.cpp
@@ -53,21 +53,12 @@ void QMediaObjectPrivate::_q_notify()
{
Q_Q(QMediaObject);
- const int len = notifyProperties.length();
-
- for (int i = 0; i < len; ++i) {
- const char *name = notifyProperties.at(i).constData();
-
- const QMetaObject* m = q->metaObject();
-
- int pi = m->indexOfProperty(name);
- if (pi == -1)
- continue;
+ const QMetaObject* m = q->metaObject();
+ foreach (int pi, notifyProperties) {
QMetaProperty p = m->property(pi);
- if (p.hasNotifySignal())
- p.notifySignal().invoke(q, QGenericArgument(QMetaType::typeName(p.userType()),
- p.read(q).data()));
+ p.notifySignal().invoke(
+ q, QGenericArgument(QMetaType::typeName(p.userType()), p.read(q).data()));
}
}
@@ -190,10 +181,16 @@ void QMediaObject::addPropertyWatch(QByteArray const &name)
{
Q_D(QMediaObject);
- d->notifyProperties << name;
+ const QMetaObject* m = metaObject();
+
+ int index = m->indexOfProperty(name.constData());
- if (!d->notifyTimer->isActive())
- d->notifyTimer->start();
+ if (index != -1 && m->property(index).hasNotifySignal()) {
+ d->notifyProperties.insert(index);
+
+ if (!d->notifyTimer->isActive())
+ d->notifyTimer->start();
+ }
}
/*!
@@ -207,10 +204,14 @@ void QMediaObject::removePropertyWatch(QByteArray const &name)
{
Q_D(QMediaObject);
- d->notifyProperties.removeAll(name);
+ int index = metaObject()->indexOfProperty(name.constData());
- if (d->notifyProperties.isEmpty())
- d->notifyTimer->stop();
+ if (index != -1) {
+ d->notifyProperties.remove(index);
+
+ if (d->notifyProperties.isEmpty())
+ d->notifyTimer->stop();
+ }
}
/*!
diff --git a/src/multimedia/qmediaobject_p.h b/src/multimedia/qmediaobject_p.h
index 0e0972f827..ec3cfc5628 100644
--- a/src/multimedia/qmediaobject_p.h
+++ b/src/multimedia/qmediaobject_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qbytearray.h>
-#include <QtCore/qlist.h>
+#include <QtCore/qset.h>
#include <QtCore/qtimer.h>
#include <qmediaobject.h>
@@ -80,7 +80,7 @@ public:
QMediaService *service;
QMetaDataControl *metaDataControl;
QTimer* notifyTimer;
- QList<QByteArray> notifyProperties;
+ QSet<int> notifyProperties;
QMediaObject *q_ptr;
};
diff --git a/src/multimedia/qmediaplaylist.cpp b/src/multimedia/qmediaplaylist.cpp
index 9a60c9e897..cf64eb06d4 100644
--- a/src/multimedia/qmediaplaylist.cpp
+++ b/src/multimedia/qmediaplaylist.cpp
@@ -271,7 +271,7 @@ QMediaContent QMediaPlaylist::media(int position) const
}
/*!
- Append the list of media \a content to the playlist.
+ Append the media \a content to the playlist.
Returns true if the operation is successfull, other wise return false.
*/
@@ -281,6 +281,16 @@ bool QMediaPlaylist::appendItem(const QMediaContent &content)
}
/*!
+ Append multiple media content \a items to the playlist.
+
+ Returns true if the operation is successfull, other wise return false.
+ */
+bool QMediaPlaylist::appendItems(const QList<QMediaContent> &items)
+{
+ return d_func()->control->playlistProvider()->appendItems(items);
+}
+
+/*!
Insert the media \a content to the playlist at position \a pos.
Returns true if the operation is successful, otherwise false.
@@ -292,6 +302,17 @@ bool QMediaPlaylist::insertItem(int pos, const QMediaContent &content)
}
/*!
+ Insert multiple media content \a items to the playlist at position \a pos.
+
+ Returns true if the operation is successful, otherwise false.
+*/
+
+bool QMediaPlaylist::insertItems(int pos, const QList<QMediaContent> &items)
+{
+ return d_func()->playlist()->insertItems(pos, items);
+}
+
+/*!
Remove the item from the playlist at position \a pos.
Returns true if the operation is successfull, other wise return false.
diff --git a/src/multimedia/qmediaplaylist.h b/src/multimedia/qmediaplaylist.h
index 8b83094368..f4a987d9fa 100644
--- a/src/multimedia/qmediaplaylist.h
+++ b/src/multimedia/qmediaplaylist.h
@@ -84,7 +84,9 @@ public:
bool isReadOnly() const;
bool appendItem(const QMediaContent &content);
+ bool appendItems(const QList<QMediaContent> &items);
bool insertItem(int index, const QMediaContent &content);
+ bool insertItems(int index, const QList<QMediaContent> &items);
bool removeItem(int pos);
bool removeItems(int start, int end);
bool clear();
diff --git a/src/multimedia/qmediaplaylistprovider.cpp b/src/multimedia/qmediaplaylistprovider.cpp
index 2df40857c9..d41cb5b78e 100644
--- a/src/multimedia/qmediaplaylistprovider.cpp
+++ b/src/multimedia/qmediaplaylistprovider.cpp
@@ -169,6 +169,21 @@ bool QMediaPlaylistProvider::appendItem(const QMediaContent &media)
}
/*!
+ Append multiple media \a items to a playlist.
+
+ Returns true if the media items were appended; and false otherwise.
+*/
+bool QMediaPlaylistProvider::appendItems(const QList<QMediaContent> &items)
+{
+ foreach(const QMediaContent &item, items) {
+ if (!appendItem(item))
+ return false;
+ }
+
+ return true;
+}
+
+/*!
Inserts \a media into a playlist at \a position.
Returns true if the media was inserted; and false otherwise.
@@ -181,6 +196,22 @@ bool QMediaPlaylistProvider::insertItem(int position, const QMediaContent &media
}
/*!
+ Inserts multiple media items into a playlist at \a position.
+
+ Returns true if the media items were inserted; and false otherwise.
+*/
+bool QMediaPlaylistProvider::insertItems(int position, const QList<QMediaContent> &items)
+{
+ for (int i=0; i<items.count(); i++) {
+ if (!insertItem(position+i,items.at(i)))
+ return false;
+ }
+
+ return true;
+}
+
+
+/*!
Removes the media at \a position from a playlist.
Returns true if the media was removed; and false otherwise.
diff --git a/src/multimedia/qmediaplaylistprovider.h b/src/multimedia/qmediaplaylistprovider.h
index 5ddf14a430..f8425785d1 100644
--- a/src/multimedia/qmediaplaylistprovider.h
+++ b/src/multimedia/qmediaplaylistprovider.h
@@ -70,7 +70,9 @@ public:
virtual bool isReadOnly() const;
virtual bool appendItem(const QMediaContent &content);
+ virtual bool appendItems(const QList<QMediaContent> &contentList);
virtual bool insertItem(int index, const QMediaContent &content);
+ virtual bool insertItems(int index, const QList<QMediaContent> &content);
virtual bool removeItem(int pos);
virtual bool removeItems(int start, int end);
virtual bool clear();
diff --git a/src/multimedia/qmediarecorder.cpp b/src/multimedia/qmediarecorder.cpp
index 44b126cc3a..ada0f76606 100644
--- a/src/multimedia/qmediarecorder.cpp
+++ b/src/multimedia/qmediarecorder.cpp
@@ -74,11 +74,21 @@ QTM_BEGIN_NAMESPACE
recording functions of other media objects, like QRadioTuner,
QCamera or QAudioCaptureSource.
+ If the camera or radio is used as a source, recording
+ is only possible when the source is in appropriate state
+ like QCamera::ActiveState for camera.
+
\code
// Audio only recording
audioSource = new QAudioCaptureSource;
recorder = new QMediaRecorder(audioSource);
+ QAudioEncoderSettings audioSettings;
+ audioSettings.setCodec("audio/vorbis");
+ audioSettings.setQuality(QtMedia::HighQuality);
+
+ recorder->setEncodingSettings(audioSettings);
+
recorder->setOutputLocation(QUrl::fromLocalFile(fileName));
recorder->record();
\endcode
@@ -87,7 +97,10 @@ QTM_BEGIN_NAMESPACE
// Audio/Video recording
camera = new QCamera(deviceName);
recorder = new QMediaRecorder(camera);
+ preview = new QVideoWidget(camera);
+ camera->start();
+ //record with deafult settings after the camera has started
recorder->setOutputLocation(QUrl::fromLocalFile(fileName));
recorder->record();
\endcode
@@ -194,7 +207,7 @@ QMediaRecorder::QMediaRecorder(QMediaObject *mediaObject, QObject *parent):
}
/*!
- Destroys a media object.
+ Destroys a media recorder object.
*/
QMediaRecorder::~QMediaRecorder()
@@ -204,6 +217,10 @@ QMediaRecorder::~QMediaRecorder()
/*!
\property QMediaRecorder::outputLocation
\brief the destination location of media content.
+
+ Setting the location can fail for example when the service supports
+ only local file system locations while the network url was passed,
+ or the service doesn't support media recording.
*/
QUrl QMediaRecorder::outputLocation() const
@@ -211,13 +228,6 @@ QUrl QMediaRecorder::outputLocation() const
return d_func()->control ? d_func()->control->outputLocation() : QUrl();
}
-/*!
- Sets the output \a location and returns true if this operation was successful.
- Setting the location can fail for example when the service supports
- only local file system locations while the network url was passed,
- or the service doesn't support media recording.
-*/
-
bool QMediaRecorder::setOutputLocation(const QUrl &location)
{
Q_D(QMediaRecorder);
@@ -317,83 +327,107 @@ QString QMediaRecorder::audioCodecDescription(const QString &codec) const
/*!
Returns a list of supported audio sample rates.
+
+ If non null audio \a settings parameter is passed,
+ the returned list is reduced to sample rates supported with partial settings applied.
+
+ It can be used for example to query the list of sample rates, supported by specific audio codec.
*/
-QList<int> QMediaRecorder::supportedAudioSampleRates() const
+QList<int> QMediaRecorder::supportedAudioSampleRates(const QAudioEncoderSettings &settings) const
{
return d_func()->audioControl ?
- d_func()->audioControl->supportedSampleRates() : QList<int>();
+ d_func()->audioControl->supportedSampleRates(settings) : QList<int>();
}
/*!
Return the minimum resolution video can be encoded at.
- \sa QVideoEncoderSettings::resolution(), maximumResolution()
+ If non null video \a settings parameter is passed,
+ returns the minimum supported resolution with partial settings applied.
+
+ \sa supportedResolutions(), QVideoEncoderSettings::resolution(), maximumResolution()
*/
-QSize QMediaRecorder::minimumResolution() const
+QSize QMediaRecorder::minimumResolution(const QVideoEncoderSettings &settings) const
{
return d_func()->videoControl ?
- d_func()->videoControl->minimumResolution() : QSize();
+ d_func()->videoControl->minimumResolution(settings) : QSize();
}
/*!
Returns the maximum resolution video can be encoded at.
- \sa QVideoEncoderSettings::resolution(), minimumResolution()
+ If non null video \a settings parameter is passed,
+ returns the maximum supported resolution with partial settings applied.
+
+ \sa supportedResolutions(), QVideoEncoderSettings::resolution(), minimumResolution()
*/
-QSize QMediaRecorder::maximumResolution() const
+QSize QMediaRecorder::maximumResolution(const QVideoEncoderSettings &settings) const
{
return d_func()->videoControl ?
- d_func()->videoControl->maximumResolution() : QSize();
+ d_func()->videoControl->maximumResolution(settings) : QSize();
}
/*!
Returns a list of resolutions video can be encoded at. An empty list is returned if the video
encoder supports arbitrary resolutions within the minimum and maximum range.
+ If non null video \a settings parameter is passed,
+ the returned list is reduced to resolution supported with partial settings like video codec or framerate applied.
+
\sa QVideoEncoderSettings::resolution(), minimumResolution(), maximumResolution()
*/
-QList<QSize> QMediaRecorder::supportedResolutions() const
+QList<QSize> QMediaRecorder::supportedResolutions(const QVideoEncoderSettings &settings) const
{
return d_func()->videoControl ?
- d_func()->videoControl->supportedResolutions() : QList<QSize>();
+ d_func()->videoControl->supportedResolutions(settings) : QList<QSize>();
}
/*!
Returns the minimum frame rate video can encoded at.
+ If non null video \a settings parameter is passed,
+ returns the minimum supported frame rate with partial settings like
+ \l {QVideoEncoderSettings::setResolution()}{video resolution} applied.
+
\sa QVideoEncoderSettings::frameRate(), maximumFrameRate()
*/
-qreal QMediaRecorder::minimumFrameRate()
+qreal QMediaRecorder::minimumFrameRate(const QVideoEncoderSettings &settings)
{
return d_func()->videoControl ?
- d_func()->videoControl->minimumFrameRate() : 0.0;
+ d_func()->videoControl->minimumFrameRate(settings) : 0.0;
}
/*!
Returns the maximum frame rate video can be encoded at.
+ If non null video \a settings parameter is passed,
+ returns the maximum supported frame rate with partial settings like
+ \l {QVideoEncoderSettings::setResolution()}{video resolution} applied.
+
\sa QVideoEncoderSettings::frameRate(), minimumFrameRate()
*/
-qreal QMediaRecorder::maximumFrameRate()
+qreal QMediaRecorder::maximumFrameRate(const QVideoEncoderSettings &settings)
{
return d_func()->videoControl ?
- d_func()->videoControl->maximumFrameRate() : 0.0;
+ d_func()->videoControl->maximumFrameRate(settings) : 0.0;
}
/*!
Returns a list of frame rates video can be encoded at. An empty list is returned if the encoder
supports arbitrary frame rates within the minimum and maximum range.
+ If non null video \a settings parameter is passed,
+ the returned list is reduced to frame rates supported with partial settings like video codec or resolution applied.
+
\sa QVideoEncoderSettings::frameRate(), minimumFrameRate(), maximumFrameRate()
*/
-QList<qreal> QMediaRecorder::supportedFrameRates() const
+QList<qreal> QMediaRecorder::supportedFrameRates(const QVideoEncoderSettings &settings) const
{
return d_func()->videoControl ?
- d_func()->videoControl->supportedFrameRates() : QList<qreal>();
+ d_func()->videoControl->supportedFrameRates(settings) : QList<qreal>();
}
-
/*!
Returns a list of supported video codecs.
*/
@@ -405,6 +439,8 @@ QStringList QMediaRecorder::supportedVideoCodecs() const
/*!
Returns a description of a video \a codec.
+
+ \sa setEncodingSettings()
*/
QString QMediaRecorder::videoCodecDescription(const QString &codec) const
{
@@ -414,6 +450,8 @@ QString QMediaRecorder::videoCodecDescription(const QString &codec) const
/*!
Returns the audio encoder settings being used.
+
+ \sa setEncodingSettings()
*/
QAudioEncoderSettings QMediaRecorder::audioSettings() const
@@ -424,6 +462,8 @@ QAudioEncoderSettings QMediaRecorder::audioSettings() const
/*!
Returns the video encoder settings being used.
+
+ \sa setEncodingSettings()
*/
QVideoEncoderSettings QMediaRecorder::videoSettings() const
@@ -434,6 +474,17 @@ QVideoEncoderSettings QMediaRecorder::videoSettings() const
/*!
Sets the \a audio and \a video encoder settings and container \a format MIME type.
+
+ It's only possible to change setttings when the encoder
+ is in the QMediaEncoder::StoppedState state.
+
+ If some parameters are not specified, or null settings are passed,
+ the encoder choose the default encoding parameters, depending on
+ media source properties.
+ But while setEncodingSettings is optional, the backend can preload
+ encoding pipeline to improve recording startup time.
+
+ \sa audioSettings(), videoSettings(), format()
*/
void QMediaRecorder::setEncodingSettings(const QAudioEncoderSettings &audio,
@@ -458,6 +509,10 @@ void QMediaRecorder::setEncodingSettings(const QAudioEncoderSettings &audio,
/*!
Start recording.
+
+ This is an asynchronous call, with signal
+ stateCahnged(QMediaRecorder::RecordingState) being emited
+ when recording started, otherwise error() signal is emited.
*/
void QMediaRecorder::record()
diff --git a/src/multimedia/qmediarecorder.h b/src/multimedia/qmediarecorder.h
index 8e51dda385..e325e843f5 100644
--- a/src/multimedia/qmediarecorder.h
+++ b/src/multimedia/qmediarecorder.h
@@ -64,8 +64,7 @@ class Q_MEDIA_EXPORT QMediaRecorder : public QMediaObject
{
Q_OBJECT
Q_ENUMS(State)
- Q_ENUMS(Error)
- Q_ENUMS(EncodingQuality)
+ Q_ENUMS(Error)
Q_PROPERTY(qint64 duration READ duration NOTIFY durationChanged)
Q_PROPERTY(QUrl outputLocation READ outputLocation WRITE setOutputLocation)
public:
@@ -103,18 +102,18 @@ public:
QStringList supportedAudioCodecs() const;
QString audioCodecDescription(const QString &codecName) const;
- QList<int> supportedAudioSampleRates() const;
+ QList<int> supportedAudioSampleRates(const QAudioEncoderSettings &settings = QAudioEncoderSettings()) const;
QStringList supportedVideoCodecs() const;
QString videoCodecDescription(const QString &codecName) const;
- QSize minimumResolution() const;
- QSize maximumResolution() const;
- QList<QSize> supportedResolutions() const;
+ QSize minimumResolution(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
+ QSize maximumResolution(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
+ QList<QSize> supportedResolutions(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
- qreal minimumFrameRate();
- qreal maximumFrameRate();
- QList<qreal> supportedFrameRates() const;
+ qreal minimumFrameRate(const QVideoEncoderSettings &settings = QVideoEncoderSettings());
+ qreal maximumFrameRate(const QVideoEncoderSettings &settings = QVideoEncoderSettings());
+ QList<qreal> supportedFrameRates(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const;
QAudioEncoderSettings audioSettings() const;
QVideoEncoderSettings videoSettings() const;
@@ -142,7 +141,10 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_error(int, const QString &))
};
-
QTM_END_NAMESPACE
+Q_DECLARE_METATYPE(QTM_PREPEND_NAMESPACE(QMediaRecorder)::State);
+Q_DECLARE_METATYPE(QTM_PREPEND_NAMESPACE(QMediaRecorder)::Error);
+
+
#endif // QMEDIARECORDER_H
diff --git a/src/multimedia/qpaintervideosurface.cpp b/src/multimedia/qpaintervideosurface.cpp
index e364e641fb..2434c01808 100644
--- a/src/multimedia/qpaintervideosurface.cpp
+++ b/src/multimedia/qpaintervideosurface.cpp
@@ -1322,6 +1322,9 @@ void QPainterVideoSurface::setShaderType(ShaderType type)
setError(ResourceError);
QAbstractVideoSurface::stop();
+ } else {
+ delete m_painter;
+ m_painter = 0;
}
emit supportedFormatsChanged();
}
diff --git a/src/multimedia/qradiotuner.cpp b/src/multimedia/qradiotuner.cpp
index c946cd6018..727668072b 100644
--- a/src/multimedia/qradiotuner.cpp
+++ b/src/multimedia/qradiotuner.cpp
@@ -102,6 +102,7 @@ QRadioTuner::QRadioTuner(QObject *parent, QMediaServiceProvider* provider):
if (d->service != 0) {
d->control = qobject_cast<QRadioTunerControl*>(d->service->control(QRadioTunerControl_iid));
if (d->control != 0) {
+ connect(d->control, SIGNAL(stateChanged(QRadioTuner::State)), SIGNAL(stateChanged(QRadioTuner::State)));
connect(d->control, SIGNAL(bandChanged(QRadioTuner::Band)), SIGNAL(bandChanged(QRadioTuner::Band)));
connect(d->control, SIGNAL(frequencyChanged(int)), SIGNAL(frequencyChanged(int)));
connect(d->control, SIGNAL(stereoStatusChanged(bool)), SIGNAL(stereoStatusChanged(bool)));
@@ -125,6 +126,19 @@ QRadioTuner::~QRadioTuner()
}
/*!
+ \property QRadioTuner::state
+ Return the current radio tuner state.
+
+ \sa QRadioTuner::State
+*/
+
+QRadioTuner::State QRadioTuner::state() const
+{
+ return d_func()->control ?
+ d_func()->control->state() : QRadioTuner::StoppedState;
+}
+
+/*!
\property QRadioTuner::band
\brief the frequency band a radio tuner is tuned to.
@@ -495,6 +509,16 @@ QString QRadioTuner::errorString() const
*/
/*!
+ \enum QRadioTuner::State
+
+ Enumerates radio tuner states.
+
+ \value ActiveState The tuner is started and active.
+ \value StoppedState The tuner device is stopped.
+*/
+
+
+/*!
\enum QRadioTuner::Band
Enumerates radio frequency bands.
diff --git a/src/multimedia/qradiotuner.h b/src/multimedia/qradiotuner.h
index 6bb1c35634..46e243a04b 100644
--- a/src/multimedia/qradiotuner.h
+++ b/src/multimedia/qradiotuner.h
@@ -55,6 +55,7 @@ class QRadioTunerPrivate;
class Q_MEDIA_EXPORT QRadioTuner : public QMediaObject
{
Q_OBJECT
+ Q_PROPERTY(State state READ state NOTIFY stateChanged)
Q_PROPERTY(Band band READ band WRITE setBand NOTIFY bandChanged)
Q_PROPERTY(int frequency READ frequency WRITE setFrequency NOTIFY frequencyChanged)
Q_PROPERTY(bool stereo READ isStereo NOTIFY stereoStatusChanged)
@@ -63,11 +64,13 @@ class Q_MEDIA_EXPORT QRadioTuner : public QMediaObject
Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged)
Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutingChanged)
Q_PROPERTY(bool searching READ isSearching NOTIFY searchingStatusChanged)
+ Q_ENUMS(State)
Q_ENUMS(Band)
Q_ENUMS(Error)
Q_ENUMS(StereoMode)
public:
+ enum State { ActiveState, StoppedState };
enum Band { AM, FM, SW, LW };
enum Error { NoError, ResourceError, OpenError, OutOfRangeError };
enum StereoMode { ForceStereo, ForceMono, Auto };
@@ -75,6 +78,8 @@ public:
QRadioTuner(QObject *parent = 0, QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider());
~QRadioTuner();
+ State state() const;
+
Band band() const;
bool isBandSupported(Band b) const;
@@ -112,6 +117,7 @@ public Q_SLOTS:
void stop();
Q_SIGNALS:
+ void stateChanged(QRadioTuner::State state);
void bandChanged(QRadioTuner::Band band);
void frequencyChanged(int frequency);
void stereoStatusChanged(bool stereo);
@@ -128,4 +134,9 @@ private:
QTM_END_NAMESPACE
+Q_DECLARE_METATYPE(QTM_PREPEND_NAMESPACE(QRadioTuner)::State);
+Q_DECLARE_METATYPE(QTM_PREPEND_NAMESPACE(QRadioTuner)::Band);
+Q_DECLARE_METATYPE(QTM_PREPEND_NAMESPACE(QRadioTuner)::Error);
+Q_DECLARE_METATYPE(QTM_PREPEND_NAMESPACE(QRadioTuner)::StereoMode);
+
#endif // QRADIOPLAYER_H
diff --git a/src/multimedia/qradiotunercontrol.cpp b/src/multimedia/qradiotunercontrol.cpp
index 224e0910e1..39180e5b1a 100644
--- a/src/multimedia/qradiotunercontrol.cpp
+++ b/src/multimedia/qradiotunercontrol.cpp
@@ -97,6 +97,12 @@ QRadioTunerControl::~QRadioTunerControl()
}
/*!
+ \fn QRadioTuner::State QRadioTunerControl::state() const
+
+ Returns the current radio tuner state.
+*/
+
+/*!
\fn QRadioTuner::Band QRadioTunerControl::band() const
Returns the frequency band a radio tuner is tuned to.
@@ -256,6 +262,13 @@ QRadioTunerControl::~QRadioTunerControl()
*/
/*!
+ \fn void QRadioTunerControl::stateChanged(QRadioTuner::State state)
+
+ Signals that the \a state of a radio tuner has changed.
+*/
+
+
+/*!
\fn void QRadioTunerControl::frequencyChanged(int frequency)
Signals that the \a frequency a radio tuner is tuned to has changed.
diff --git a/src/multimedia/qradiotunercontrol.h b/src/multimedia/qradiotunercontrol.h
index 86c3cdf576..3c837030ff 100644
--- a/src/multimedia/qradiotunercontrol.h
+++ b/src/multimedia/qradiotunercontrol.h
@@ -54,6 +54,8 @@ class Q_MEDIA_EXPORT QRadioTunerControl : public QMediaControl
public:
~QRadioTunerControl();
+ virtual QRadioTuner::State state() const = 0;
+
virtual QRadioTuner::Band band() const = 0;
virtual void setBand(QRadioTuner::Band b) = 0;
virtual bool isBandSupported(QRadioTuner::Band b) const = 0;
@@ -88,6 +90,7 @@ public:
virtual QString errorString() const = 0;
Q_SIGNALS:
+ void stateChanged(QRadioTuner::State state);
void bandChanged(QRadioTuner::Band band);
void frequencyChanged(int frequency);
void stereoStatusChanged(bool stereo);
diff --git a/src/multimedia/qvideoencodercontrol.cpp b/src/multimedia/qvideoencodercontrol.cpp
index ea508adefb..06132181fe 100644
--- a/src/multimedia/qvideoencodercontrol.cpp
+++ b/src/multimedia/qvideoencodercontrol.cpp
@@ -48,6 +48,9 @@ QTM_BEGIN_NAMESPACE
/*!
\class QVideoEncoderControl
\preliminary
+ \ingroup multimedia
+ \ingroup multimedia-serv
+
\brief The QVideoEncoderControl class provides access to the settings of a media service that
performs video encoding.
@@ -62,7 +65,7 @@ QTM_BEGIN_NAMESPACE
The interface name of QVideoEncoderControl is \c com.nokia.Qt.QVideoEncoderControl/1.0 as
defined in QVideoEncoderControl_iid.
- \sa QMediaService::control(), QMediaRecorder
+ \sa QMediaRecorder, QVideoEncoderSettings, QMediaService::control()
*/
/*!
@@ -91,34 +94,48 @@ QVideoEncoderControl::~QVideoEncoderControl()
}
/*!
- \fn QVideoEncoderControl::minimumResolution() const
+ \fn QVideoEncoderControl::minimumResolution(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const
Returns the minium resolution a video encoder supports.
+ If non null video \a settings parameter is passed,
+ returns the minimum supported resolution with partial settings applied.
+
\sa QVideoEncoderSettings::resolution()
*/
/*!
- \fn QVideoEncoderControl::maximumResolution() const
+ \fn QVideoEncoderControl::maximumResolution(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const
Returns the maximum resolution a video encoder supports.
+ If non null video \a settings parameter is passed,
+ returns the maximum supported resolution with partial settings applied.
+
\sa QVideoEncoderSettings::resolution()
*/
/*!
- \fn QVideoEncoderControl::minimumFrameRate() const
+ \fn QVideoEncoderControl::minimumFrameRate(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const
Returns the minimum frame rate a video encoder supports.
+ If non null video \a settings parameter is passed,
+ returns the minimum supported frame rate with partial settings like
+ \l {QVideoEncoderSettings::setResolution()}{video resolution} applied.
+
\sa QVideoEncoderSettings::frameRate()
*/
/*!
- \fn QVideoEncoderControl::maximumFrameRate() const
+ \fn QVideoEncoderControl::maximumFrameRate(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const
Returns the maximum frame rate a video encoder supports.
+ If non null video \a settings parameter is passed,
+ returns the maximum supported frame rate with partial settings like
+ \l {QVideoEncoderSettings::setResolution()}{video resolution} applied.
+
\sa QVideoEncoderSettings::frameRate()
*/
@@ -155,20 +172,32 @@ QVideoEncoderControl::~QVideoEncoderControl()
*/
/*!
- \fn QVideoEncoderControl::supportedResolutions() const
+ \fn QVideoEncoderControl::supportedResolutions(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const
Returns a list of supported resolutions. An empty list is returned if the video encoder
supports arbitrary resolutions within the minimum and maximum range.
+ If non null video \a settings parameter is passed,
+ the returned list is reduced to resolution supported with partial settings like
+ \l {QVideoEncoderSettings::setCodec()}{video codec} or
+ \l {QVideoEncoderSettings::setFrameRate()}{frame rate} applied.
+
+
+
\sa QVideoEncoderSettings::resolution(), minimumResolution(), maximumResolution()
*/
/*!
- \fn QVideoEncoderControl::supportedFrameRates() const
+ \fn QVideoEncoderControl::supportedFrameRates(const QVideoEncoderSettings &settings = QVideoEncoderSettings()) const
Returns a list of supported frame rates. An empty list is returned if the encoder supports
arbitrary frame rates within the minimum and maximum range.
+ If non null video \a settings parameter is passed,
+ the returned list is reduced to frame rates supported with partial settings like
+ \l {QVideoEncoderSettings::setCodec()}{video codec} or
+ \l {QVideoEncoderSettings::setResolution()}{video resolution} applied.
+
\sa QVideoEncoderSettings::frameRate(), minimumFrameRate(), maximumFrameRate()
*/
diff --git a/src/multimedia/qvideoencodercontrol.h b/src/multimedia/qvideoencodercontrol.h
index 9a00b12496..3ed406aeb9 100644
--- a/src/multimedia/qvideoencodercontrol.h
+++ b/src/multimedia/qvideoencodercontrol.h
@@ -61,13 +61,13 @@ class Q_MEDIA_EXPORT QVideoEncoderControl : public QMediaControl
public:
virtual ~QVideoEncoderControl();
- virtual QSize minimumResolution() const = 0;
- virtual QSize maximumResolution() const = 0;
- virtual QList<QSize> supportedResolutions() const = 0;
+ virtual QSize minimumResolution(const QVideoEncoderSettings &settings) const = 0;
+ virtual QSize maximumResolution(const QVideoEncoderSettings &settings) const = 0;
+ virtual QList<QSize> supportedResolutions(const QVideoEncoderSettings &settings) const = 0;
- virtual qreal minimumFrameRate() const = 0;
- virtual qreal maximumFrameRate() const = 0;
- virtual QList<qreal> supportedFrameRates() const = 0;
+ virtual qreal minimumFrameRate(const QVideoEncoderSettings &settings) const = 0;
+ virtual qreal maximumFrameRate(const QVideoEncoderSettings &settings) const = 0;
+ virtual QList<qreal> supportedFrameRates(const QVideoEncoderSettings &settings) const = 0;
virtual QStringList supportedVideoCodecs() const = 0;
virtual QString videoCodecDescription(const QString &codecName) const = 0;
diff --git a/src/multimedia/qvideowidget.cpp b/src/multimedia/qvideowidget.cpp
index d953eac131..989d998e55 100644
--- a/src/multimedia/qvideowidget.cpp
+++ b/src/multimedia/qvideowidget.cpp
@@ -58,12 +58,30 @@
#include <qevent.h>
#include <qdialog.h>
#include <qstackedlayout.h>
+#include <QFlags>
+#include <Qt>
+
+using namespace Qt;
+
QTM_BEGIN_NAMESPACE
-QVideoWidgetControlBackend::QVideoWidgetControlBackend(QVideoWidgetControl *control)
+QVideoWidgetControlBackend::QVideoWidgetControlBackend(
+ QVideoWidgetControl *control, QWidget *widget)
: m_widgetControl(control)
{
+ connect(control, SIGNAL(brightnessChanged(int)), widget, SLOT(_q_brightnessChanged(int)));
+ connect(control, SIGNAL(contrastChanged(int)), widget, SLOT(_q_contrastChanged(int)));
+ connect(control, SIGNAL(hueChanged(int)), widget, SLOT(_q_hueChanged(int)));
+ connect(control, SIGNAL(saturationChanged(int)), widget, SLOT(_q_saturationChanged(int)));
+ connect(control, SIGNAL(fullScreenChanged(bool)), widget, SLOT(_q_fullScreenChanged(bool)));
+
+ QBoxLayout *layout = new QVBoxLayout;
+ layout->setMargin(0);
+ layout->setSpacing(0);
+ layout->addWidget(control->videoWidget());
+
+ widget->setLayout(layout);
}
void QVideoWidgetControlBackend::setBrightness(int brightness)
@@ -102,120 +120,136 @@ void QVideoWidgetControlBackend::setAspectRatioMode(QVideoWidget::AspectRatioMod
m_widgetControl->setAspectRatioMode(mode);
}
-QWidget *QVideoWidgetControlBackend::widget()
-{
- return m_widgetControl->videoWidget();
-}
-
#ifndef QT_NO_MULTIMEDIA
-QVideoRendererWidget::QVideoRendererWidget(QVideoRendererControl *control, QWidget *parent)
-#ifndef QT_NO_OPENGL
- : QGLWidget(parent)
-#else
- : QWidget(parent)
-#endif
- , m_rendererControl(control)
+QRendererVideoWidgetBackend::QRendererVideoWidgetBackend(
+ QVideoRendererControl *control, QWidget *widget)
+ : m_rendererControl(control)
+ , m_widget(widget)
, m_surface(new QPainterVideoSurface)
+ , m_aspectRatioMode(QVideoWidget::KeepAspectRatio)
+ , m_updatePaintDevice(true)
{
- connect(m_surface, SIGNAL(frameChanged()), SLOT(update()));
- connect(m_surface, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat)), SLOT(dimensionsChanged()));
-
- QPalette palette;
- palette.setColor(QPalette::Background, Qt::black);
- setPalette(palette);
+ connect(this, SIGNAL(brightnessChanged(int)), m_widget, SLOT(_q_brightnessChanged(int)));
+ connect(this, SIGNAL(contrastChanged(int)), m_widget, SLOT(_q_contrastChanged(int)));
+ connect(this, SIGNAL(hueChanged(int)), m_widget, SLOT(_q_hueChanged(int)));
+ connect(this, SIGNAL(saturationChanged(int)), m_widget, SLOT(_q_saturationChanged(int)));
+ connect(m_surface, SIGNAL(frameChanged()), m_widget, SLOT(update()));
+ connect(m_surface, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat)),
+ m_widget, SLOT(_q_dimensionsChanged()));
m_rendererControl->setSurface(m_surface);
}
-QVideoRendererWidget::~QVideoRendererWidget()
+QRendererVideoWidgetBackend::~QRendererVideoWidgetBackend()
{
delete m_surface;
}
-void QVideoRendererWidget::clearSurface()
+void QRendererVideoWidgetBackend::clearSurface()
{
m_rendererControl->setSurface(0);
}
-void QVideoRendererWidget::setBrightness(int brightness)
+void QRendererVideoWidgetBackend::setBrightness(int brightness)
{
m_surface->setBrightness(brightness);
emit brightnessChanged(brightness);
}
-void QVideoRendererWidget::setContrast(int contrast)
+void QRendererVideoWidgetBackend::setContrast(int contrast)
{
m_surface->setContrast(contrast);
emit contrastChanged(contrast);
}
-void QVideoRendererWidget::setHue(int hue)
+void QRendererVideoWidgetBackend::setHue(int hue)
{
m_surface->setHue(hue);
emit hueChanged(hue);
}
-void QVideoRendererWidget::setSaturation(int saturation)
+void QRendererVideoWidgetBackend::setSaturation(int saturation)
{
m_surface->setSaturation(saturation);
emit saturationChanged(saturation);
}
-QVideoWidget::AspectRatioMode QVideoRendererWidget::aspectRatioMode() const
+QVideoWidget::AspectRatioMode QRendererVideoWidgetBackend::aspectRatioMode() const
{
return m_aspectRatioMode;
}
-void QVideoRendererWidget::setAspectRatioMode(QVideoWidget::AspectRatioMode mode)
+void QRendererVideoWidgetBackend::setAspectRatioMode(QVideoWidget::AspectRatioMode mode)
{
m_aspectRatioMode = mode;
- updateGeometry();
+ m_widget->updateGeometry();
+}
+
+void QRendererVideoWidgetBackend::setFullScreen(bool)
+{
}
-QSize QVideoRendererWidget::sizeHint() const
+QSize QRendererVideoWidgetBackend::sizeHint() const
{
return m_surface->surfaceFormat().sizeHint();
}
+void QRendererVideoWidgetBackend::showEvent(QShowEvent *)
+{
+}
+
+void QRendererVideoWidgetBackend::hideEvent(QHideEvent *)
+{
#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1)
-void QVideoRendererWidget::initializeGL()
+ m_updatePaintDevice = true;
+ m_surface->setGLContext(0);
+#endif
+}
+
+void QRendererVideoWidgetBackend::resizeEvent(QResizeEvent *)
{
- makeCurrent();
+}
- m_surface->setGLContext(const_cast<QGLContext *>(context()));
- if (m_surface->supportedShaderTypes() & QPainterVideoSurface::GlslShader)
- m_surface->setShaderType(QPainterVideoSurface::GlslShader);
- else
- m_surface->setShaderType(QPainterVideoSurface::FragmentProgramShader);
+void QRendererVideoWidgetBackend::moveEvent(QMoveEvent *)
+{
}
-#endif
-void QVideoRendererWidget::paintEvent(QPaintEvent *event)
+void QRendererVideoWidgetBackend::paintEvent(QPaintEvent *event)
{
- QPainter painter(this);
+ QPainter painter(m_widget);
+
if (m_surface->isActive()) {
m_surface->paint(&painter, displayRect());
m_surface->setReady(true);
} else {
- painter.fillRect(event->rect(), palette().background());
- }
-}
+ painter.fillRect(event->rect(), m_widget->palette().background());
-void QVideoRendererWidget::dimensionsChanged()
-{
- updateGeometry();
+ #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1)
+ if (m_updatePaintDevice && (painter.paintEngine()->type() == QPaintEngine::OpenGL
+ || painter.paintEngine()->type() == QPaintEngine::OpenGL2)) {
+ m_updatePaintDevice = false;
+
+ m_surface->setGLContext(const_cast<QGLContext *>(QGLContext::currentContext()));
+ if (m_surface->supportedShaderTypes() & QPainterVideoSurface::GlslShader) {
+ m_surface->setShaderType(QPainterVideoSurface::GlslShader);
+ } else {
+ m_surface->setShaderType(QPainterVideoSurface::FragmentProgramShader);
+ }
+ }
+#endif
+ }
}
-QRect QVideoRendererWidget::displayRect() const
+QRect QRendererVideoWidgetBackend::displayRect() const
{
- QRect displayRect = rect();
+ QRect displayRect = m_widget->rect();
if (m_aspectRatioMode != QVideoWidget::IgnoreAspectRatio) {
QVideoSurfaceFormat format = m_surface->surfaceFormat();
@@ -236,120 +270,104 @@ QRect QVideoRendererWidget::displayRect() const
return displayRect;
}
-void QVideoRendererWidget::setFullScreen(bool fullScreen)
-{
- Q_UNUSED(fullScreen);
-}
-
-QWidget *QVideoRendererWidget::widget()
-{
- return this;
-}
-
#endif
-QVideoWindowWidget::QVideoWindowWidget(QVideoWindowControl *control, QWidget *parent)
- : QWidget(parent)
- , m_windowControl(control)
+QWindowVideoWidgetBackend::QWindowVideoWidgetBackend(QVideoWindowControl *control, QWidget *widget)
+ : m_windowControl(control)
+ , m_widget(widget)
+ , m_aspectRatioMode(QVideoWidget::KeepAspectRatio)
{
+ connect(control, SIGNAL(brightnessChanged(int)), m_widget, SLOT(_q_brightnessChanged(int)));
+ connect(control, SIGNAL(contrastChanged(int)), m_widget, SLOT(_q_contrastChanged(int)));
+ connect(control, SIGNAL(hueChanged(int)), m_widget, SLOT(_q_hueChanged(int)));
+ connect(control, SIGNAL(saturationChanged(int)), m_widget, SLOT(_q_saturationChanged(int)));
+ connect(control, SIGNAL(fullScreenChanged(bool)), m_widget, SLOT(_q_fullScreenChanged(bool)));
+ connect(control, SIGNAL(nativeSizeChanged()), m_widget, SLOT(_q_dimensionsChanged()));
}
-QVideoWindowWidget::~QVideoWindowWidget()
+QWindowVideoWidgetBackend::~QWindowVideoWidgetBackend()
{
}
-void QVideoWindowWidget::setBrightness(int brightness)
+void QWindowVideoWidgetBackend::setBrightness(int brightness)
{
m_windowControl->setBrightness(brightness);
}
-void QVideoWindowWidget::setContrast(int contrast)
+void QWindowVideoWidgetBackend::setContrast(int contrast)
{
m_windowControl->setContrast(contrast);
}
-void QVideoWindowWidget::setHue(int hue)
+void QWindowVideoWidgetBackend::setHue(int hue)
{
m_windowControl->setHue(hue);
}
-void QVideoWindowWidget::setSaturation(int saturation)
+void QWindowVideoWidgetBackend::setSaturation(int saturation)
{
m_windowControl->setSaturation(saturation);
}
-void QVideoWindowWidget::setFullScreen(bool fullScreen)
+void QWindowVideoWidgetBackend::setFullScreen(bool fullScreen)
{
m_windowControl->setFullScreen(fullScreen);
}
-QVideoWidget::AspectRatioMode QVideoWindowWidget::aspectRatioMode() const
+QVideoWidget::AspectRatioMode QWindowVideoWidgetBackend::aspectRatioMode() const
{
return m_windowControl->aspectRatioMode();
}
-void QVideoWindowWidget::setAspectRatioMode(QVideoWidget::AspectRatioMode mode)
+void QWindowVideoWidgetBackend::setAspectRatioMode(QVideoWidget::AspectRatioMode mode)
{
m_windowControl->setAspectRatioMode(mode);
}
-QWidget *QVideoWindowWidget::widget()
-{
- return this;
-}
-
-QSize QVideoWindowWidget::sizeHint() const
+QSize QWindowVideoWidgetBackend::sizeHint() const
{
return m_windowControl->nativeSize();
}
-void QVideoWindowWidget::setVisible(bool visible)
+void QWindowVideoWidgetBackend::showEvent(QShowEvent *)
{
- if (visible)
- m_windowControl->setWinId(winId());
+ m_windowControl->setWinId(m_widget->winId());
- QWidget::setVisible(visible);
+ m_windowControl->setDisplayRect(m_widget->rect());
}
-void QVideoWindowWidget::moveEvent(QMoveEvent *event)
+void QWindowVideoWidgetBackend::hideEvent(QHideEvent *)
{
- QWidget::moveEvent(event);
-
- QRect displayRect = rect();
- displayRect.moveTo(mapTo(nativeParentWidget(), displayRect.topLeft()));
-
- m_windowControl->setDisplayRect(displayRect);
}
-void QVideoWindowWidget::resizeEvent(QResizeEvent *event)
+void QWindowVideoWidgetBackend::moveEvent(QMoveEvent *)
{
- QWidget::resizeEvent(event);
-
- QRect displayRect = rect();
- displayRect.moveTo(mapTo(nativeParentWidget(), displayRect.topLeft()));
+ m_windowControl->setDisplayRect(m_widget->rect());
+}
- m_windowControl->setDisplayRect(displayRect);
+void QWindowVideoWidgetBackend::resizeEvent(QResizeEvent *)
+{
+ m_windowControl->setDisplayRect(m_widget->rect());
}
-void QVideoWindowWidget::paintEvent(QPaintEvent *event)
+void QWindowVideoWidgetBackend::paintEvent(QPaintEvent *event)
{
m_windowControl->repaint();
event->accept();
}
-void QVideoWidgetPrivate::setCurrentBackend(QVideoWidgetBackendInterface *backend)
+void QVideoWidgetPrivate::setCurrentControl(QVideoWidgetControlInterface *control)
{
- if (currentBackend != backend) {
- currentBackend = backend;
+ if (currentControl != control) {
+ currentControl = control;
- currentBackend->setBrightness(brightness);
- currentBackend->setContrast(contrast);
- currentBackend->setHue(hue);
- currentBackend->setSaturation(saturation);
- currentBackend->setAspectRatioMode(aspectRatioMode);
+ currentControl->setBrightness(brightness);
+ currentControl->setContrast(contrast);
+ currentControl->setHue(hue);
+ currentControl->setSaturation(saturation);
+ currentControl->setAspectRatioMode(aspectRatioMode);
}
- layout->setCurrentWidget(currentBackend->widget());
}
void QVideoWidgetPrivate::_q_serviceDestroyed()
@@ -401,6 +419,11 @@ void QVideoWidgetPrivate::_q_fullScreenChanged(bool fullScreen)
q_func()->showNormal();
}
+void QVideoWidgetPrivate::_q_dimensionsChanged()
+{
+ qDebug("Update geometry");
+ q_func()->updateGeometry();
+}
/*!
\class QVideoWidget
@@ -453,7 +476,7 @@ QVideoWidget::QVideoWidget(QMediaObject *object, QWidget *parent)
d->q_ptr = this;
QPalette palette = QWidget::palette();
- palette.setColor(QPalette::Window, Qt::black);
+ palette.setColor(QPalette::Background, Qt::black);
setPalette(palette);
if (object)
@@ -467,60 +490,26 @@ QVideoWidget::QVideoWidget(QMediaObject *object, QWidget *parent)
d->outputControl = qobject_cast<QVideoOutputControl *>(
d->service->control(QVideoOutputControl_iid));
- d->layout = new QStackedLayout;
-
QVideoWidgetControl *widgetControl = qobject_cast<QVideoWidgetControl *>(
d->service->control(QVideoWidgetControl_iid));
if (widgetControl != 0) {
- d->widgetBackend = new QVideoWidgetControlBackend(widgetControl);
-
- QWidget *widget = d->widgetBackend->widget();
-
- d->layout->addWidget(widget);
-
- connect(widgetControl, SIGNAL(brightnessChanged(int)), SLOT(_q_brightnessChanged(int)));
- connect(widgetControl, SIGNAL(contrastChanged(int)), SLOT(_q_contrastChanged(int)));
- connect(widgetControl, SIGNAL(hueChanged(int)), SLOT(_q_hueChanged(int)));
- connect(widgetControl, SIGNAL(saturationChanged(int)), SLOT(_q_saturationChanged(int)));
- connect(widgetControl, SIGNAL(fullScreenChanged(bool)), SLOT(_q_fullScreenChanged(bool)));
+ d->widgetBackend = new QVideoWidgetControlBackend(widgetControl, this);
} else {
QVideoWindowControl *windowControl = qobject_cast<QVideoWindowControl *>(
d->service->control(QVideoWindowControl_iid));
- if (windowControl != 0) {
- d->windowBackend = new QVideoWindowWidget(windowControl);
-
- d->layout->addWidget(d->windowBackend);
+ if (windowControl != 0)
+ d->windowBackend = new QWindowVideoWidgetBackend(windowControl, this);
- connect(windowControl, SIGNAL(brightnessChanged(int)), SLOT(_q_brightnessChanged(int)));
- connect(windowControl, SIGNAL(contrastChanged(int)), SLOT(_q_contrastChanged(int)));
- connect(windowControl, SIGNAL(hueChanged(int)), SLOT(_q_hueChanged(int)));
- connect(windowControl, SIGNAL(saturationChanged(int)), SLOT(_q_saturationChanged(int)));
- connect(windowControl, SIGNAL(fullScreenChanged(bool)),
- SLOT(_q_fullScreenChanged(bool)));
- }
#ifndef QT_NO_MULTIMEDIA
QVideoRendererControl *rendererControl = qobject_cast<QVideoRendererControl *>(
d->service->control(QVideoRendererControl_iid));
- if (rendererControl != 0) {
- d->rendererBackend = new QVideoRendererWidget(rendererControl);
-
- d->layout->addWidget(d->rendererBackend);
-
- connect(d->rendererBackend, SIGNAL(brightnessChanged(int)),
- SLOT(_q_brightnessChanged(int)));
- connect(d->rendererBackend, SIGNAL(contrastChanged(int)),
- SLOT(_q_contrastChanged(int)));
- connect(d->rendererBackend, SIGNAL(hueChanged(int)), SLOT(_q_hueChanged(int)));
- connect(d->rendererBackend, SIGNAL(saturationChanged(int)),
- SLOT(_q_saturationChanged(int)));
- }
+ if (rendererControl != 0)
+ d->rendererBackend = new QRendererVideoWidgetBackend(rendererControl, this);
#endif
}
-
- setLayout(d->layout);
}
/*!
@@ -533,11 +522,12 @@ QVideoWidget::~QVideoWidget()
d_ptr->outputControl->setOutput(QVideoOutputControl::NoOutput);
if (d_ptr->widgetBackend) {
- QWidget *widget = d_ptr->widgetBackend->widget();
-
- d_ptr->layout->removeWidget(widget);
- widget->setParent(0);
+ QLayout *layout = QWidget::layout();
+ for (QLayoutItem *item = layout->takeAt(0); item; item = layout->takeAt(0)) {
+ item->widget()->setParent(0);
+ delete item;
+ }
delete d_ptr->widgetBackend;
}
delete d_ptr->windowBackend;
@@ -566,9 +556,9 @@ void QVideoWidget::setAspectRatioMode(QVideoWidget::AspectRatioMode mode)
{
Q_D(QVideoWidget);
- if (d->currentBackend) {
- d->currentBackend->setAspectRatioMode(mode);
- d->aspectRatioMode = d->currentBackend->aspectRatioMode();
+ if (d->currentControl) {
+ d->currentControl->setAspectRatioMode(mode);
+ d->aspectRatioMode = d->currentControl->aspectRatioMode();
} else {
d->aspectRatioMode = mode;
}
@@ -584,13 +574,13 @@ void QVideoWidget::setFullScreen(bool fullScreen)
Q_D(QVideoWidget);
if (fullScreen) {
-#ifdef Q_WS_MAC
Qt::WindowFlags flags = windowFlags();
- d->nonFullScreenFlags = flags & (Qt::Window | Qt::SubWindow);
- flags |= Qt::Window;
- flags &= ~Qt::SubWindow;
- setWindowFlags(flags);
-#endif
+ if (!(flags & Qt::Window)) {
+ d->nonFullScreenFlags = flags & (Qt::Window | Qt::SubWindow);
+ flags |= Qt::Window;
+ flags ^= Qt::SubWindow;
+ setWindowFlags(flags);
+ }
showFullScreen();
} else {
showNormal();
@@ -623,8 +613,8 @@ void QVideoWidget::setBrightness(int brightness)
int boundedBrightness = qBound(-100, brightness, 100);
- if (d->currentBackend)
- d->currentBackend->setBrightness(boundedBrightness);
+ if (d->currentControl)
+ d->currentControl->setBrightness(boundedBrightness);
else if (d->brightness != boundedBrightness)
emit brightnessChanged(d->brightness = boundedBrightness);
}
@@ -656,8 +646,8 @@ void QVideoWidget::setContrast(int contrast)
int boundedContrast = qBound(-100, contrast, 100);
- if (d->currentBackend)
- d->currentBackend->setContrast(boundedContrast);
+ if (d->currentControl)
+ d->currentControl->setContrast(boundedContrast);
else if (d->contrast != boundedContrast)
emit contrastChanged(d->contrast = boundedContrast);
}
@@ -688,8 +678,8 @@ void QVideoWidget::setHue(int hue)
int boundedHue = qBound(-100, hue, 100);
- if (d->currentBackend)
- d->currentBackend->setHue(boundedHue);
+ if (d->currentControl)
+ d->currentControl->setHue(boundedHue);
else if (d->hue != boundedHue)
emit hueChanged(d->hue = boundedHue);
}
@@ -720,8 +710,8 @@ void QVideoWidget::setSaturation(int saturation)
int boundedSaturation = qBound(-100, saturation, 100);
- if (d->currentBackend)
- d->currentBackend->setSaturation(boundedSaturation);
+ if (d->currentControl)
+ d->currentControl->setSaturation(boundedSaturation);
else if (d->saturation != boundedSaturation)
emit saturationChanged(d->saturation = boundedSaturation);
@@ -735,38 +725,16 @@ void QVideoWidget::setSaturation(int saturation)
\sa saturation
*/
-/*!
- \reimp
- \internal
-*/
-
-void QVideoWidget::setVisible(bool visible)
+QSize QVideoWidget::sizeHint() const
{
- Q_D(QVideoWidget);
+ Q_D(const QVideoWidget);
+
+ if (d->currentBackend)
+ return d->currentBackend->sizeHint();
+ else
+ return QWidget::sizeHint();
- if (d->outputControl != 0) {
- if (visible) {
- if (d->widgetBackend != 0) {
- d->setCurrentBackend(d->widgetBackend);
- d->outputControl->setOutput(QVideoOutputControl::WidgetOutput);
- } else if (d->windowBackend != 0
- && (window() == 0 || !window()->testAttribute(Qt::WA_DontShowOnScreen))) {
- d->setCurrentBackend(d->windowBackend);
- d->outputControl->setOutput(QVideoOutputControl::WindowOutput);
-#ifndef QT_NO_MULTIMEDIA
- } else if (d->rendererBackend != 0) {
- d->setCurrentBackend(d->rendererBackend);
- d->outputControl->setOutput(QVideoOutputControl::RendererOutput);
-#endif
- } else {
- d->outputControl->setOutput(QVideoOutputControl::NoOutput);
- }
- } else {
- d->outputControl->setOutput(QVideoOutputControl::NoOutput);
- }
- }
- QWidget::setVisible(visible);
}
/*!
@@ -782,13 +750,12 @@ bool QVideoWidget::event(QEvent *event)
Qt::WindowFlags flags = windowFlags();
if (windowState() & Qt::WindowFullScreen) {
-#ifndef Q_WS_MAC
- d->nonFullScreenFlags = flags & (Qt::Window | Qt::SubWindow);
- flags |= Qt::Window;
- flags &= ~Qt::SubWindow;
- setWindowFlags(flags);
-#endif
-
+ if (!(flags & Qt::Window)) {
+ d->nonFullScreenFlags = flags & (Qt::Window | Qt::SubWindow);
+ flags |= Qt::Window;
+ flags ^= Qt::SubWindow;
+ setWindowFlags(flags);
+ }
if (!d->wasFullScreen)
emit fullScreenChanged(d->wasFullScreen = true);
@@ -798,9 +765,12 @@ bool QVideoWidget::event(QEvent *event)
if (d->currentBackend)
d->currentBackend->setFullScreen(false);
- flags &= ~(Qt::Window | Qt::SubWindow); //clear the flags...
- flags |= d->nonFullScreenFlags; //then we reset the flags (window and subwindow)
- setWindowFlags(flags);
+ if (isVisible()) {
+ flags ^= Qt::Window;
+ flags ^= Qt::SubWindow;
+ flags |= d->nonFullScreenFlags; //then we reset the flags (window and subwindow)
+ setWindowFlags(flags);
+ }
if (d->wasFullScreen)
emit fullScreenChanged(d->wasFullScreen = false);
@@ -809,6 +779,71 @@ bool QVideoWidget::event(QEvent *event)
return QWidget::event(event);
}
+void QVideoWidget::showEvent(QShowEvent *event)
+{
+ Q_D(QVideoWidget);
+
+ QWidget::showEvent(event);
+
+ if (d->outputControl) {
+ if (d->widgetBackend != 0) {
+ d->setCurrentControl(d->widgetBackend);
+ d->outputControl->setOutput(QVideoOutputControl::WidgetOutput);
+ } else if (d->windowBackend != 0
+ && (window() == 0 || !window()->testAttribute(Qt::WA_DontShowOnScreen))) {
+ d->windowBackend->showEvent(event);
+ d->currentBackend = d->windowBackend;
+ d->setCurrentControl(d->windowBackend);
+ d->outputControl->setOutput(QVideoOutputControl::WindowOutput);
+#ifndef QT_NO_MULTIMEDIA
+ } else if (d->rendererBackend != 0) {
+ d->rendererBackend->showEvent(event);
+ d->currentBackend = d->rendererBackend;
+ d->setCurrentControl(d->rendererBackend);
+ d->outputControl->setOutput(QVideoOutputControl::RendererOutput);
+#endif
+ } else {
+ d->outputControl->setOutput(QVideoOutputControl::NoOutput);
+ }
+ }
+}
+
+void QVideoWidget::hideEvent(QHideEvent *event)
+{
+ Q_D(QVideoWidget);
+
+ if (d->outputControl)
+ d->outputControl->setOutput(QVideoOutputControl::NoOutput);
+
+ QWidget::hideEvent(event);
+}
+
+void QVideoWidget::resizeEvent(QResizeEvent *event)
+{
+ Q_D(QVideoWidget);
+
+ QWidget::resizeEvent(event);
+
+ if (d->currentBackend)
+ d->currentBackend->resizeEvent(event);
+}
+
+void QVideoWidget::moveEvent(QMoveEvent *event)
+{
+ Q_D(QVideoWidget);
+
+ if (d->currentBackend)
+ d->currentBackend->moveEvent(event);
+}
+
+void QVideoWidget::paintEvent(QPaintEvent *event)
+{
+ Q_D(QVideoWidget);
+
+ if (d->currentBackend)
+ d->currentBackend->paintEvent(event);
+}
+
#include "moc_qvideowidget.cpp"
#include "moc_qvideowidget_p.cpp"
QTM_END_NAMESPACE
diff --git a/src/multimedia/qvideowidget.h b/src/multimedia/qvideowidget.h
index 55b75ec533..cd8a97cbbe 100644
--- a/src/multimedia/qvideowidget.h
+++ b/src/multimedia/qvideowidget.h
@@ -79,8 +79,9 @@ public:
int hue() const;
int saturation() const;
+ QSize sizeHint() const;
+
public Q_SLOTS:
- void setVisible(bool visible);
void setFullScreen(bool fullScreen);
void setAspectRatioMode(QVideoWidget::AspectRatioMode mode);
void setBrightness(int brightness);
@@ -97,6 +98,11 @@ Q_SIGNALS:
protected:
bool event(QEvent *event);
+ void showEvent(QShowEvent *event);
+ void hideEvent(QHideEvent *event);
+ void resizeEvent(QResizeEvent *event);
+ void moveEvent(QMoveEvent *event);
+ void paintEvent(QPaintEvent *event);
protected:
QVideoWidgetPrivate *d_ptr;
@@ -109,6 +115,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_hueChanged(int))
Q_PRIVATE_SLOT(d_func(), void _q_saturationChanged(int))
Q_PRIVATE_SLOT(d_func(), void _q_fullScreenChanged(bool))
+ Q_PRIVATE_SLOT(d_func(), void _q_dimensionsChanged());
};
QTM_END_NAMESPACE
diff --git a/src/multimedia/qvideowidget_p.h b/src/multimedia/qvideowidget_p.h
index eeea861990..93456fc703 100644
--- a/src/multimedia/qvideowidget_p.h
+++ b/src/multimedia/qvideowidget_p.h
@@ -53,6 +53,7 @@
// We mean it.
//
+#include <qmobilityglobal.h>
#include <qvideowidget.h>
#ifndef QT_NO_OPENGL
@@ -63,17 +64,12 @@
#include <qpaintervideosurface_p.h>
#endif
-#ifdef Q_MOC_RUN
-# pragma Q_MOC_EXPAND_MACROS
-#endif
-
-class QStackedLayout;
QTM_BEGIN_NAMESPACE
-class QVideoWidgetBackendInterface
+class QVideoWidgetControlInterface
{
public:
- virtual ~QVideoWidgetBackendInterface() {}
+ virtual ~QVideoWidgetControlInterface() {}
virtual void setBrightness(int brightness) = 0;
virtual void setContrast(int contrast) = 0;
@@ -84,17 +80,28 @@ public:
virtual QVideoWidget::AspectRatioMode aspectRatioMode() const = 0;
virtual void setAspectRatioMode(QVideoWidget::AspectRatioMode mode) = 0;
+};
+
+class QVideoWidgetBackend : public QObject, public QVideoWidgetControlInterface
+{
+ Q_OBJECT
+public:
+ virtual QSize sizeHint() const = 0;
- virtual QWidget *widget() = 0;
+ virtual void showEvent(QShowEvent *event) = 0;
+ virtual void hideEvent(QHideEvent *event) = 0;
+ virtual void resizeEvent(QResizeEvent *event) = 0;
+ virtual void moveEvent(QMoveEvent *event) = 0;
+ virtual void paintEvent(QPaintEvent *event) = 0;
};
class QVideoWidgetControl;
-class QVideoWidgetControlBackend : public QObject, public QVideoWidgetBackendInterface
+class QVideoWidgetControlBackend : public QObject, public QVideoWidgetControlInterface
{
Q_OBJECT
public:
- QVideoWidgetControlBackend(QVideoWidgetControl *control);
+ QVideoWidgetControlBackend(QVideoWidgetControl *control, QWidget *widget);
void setBrightness(int brightness);
void setContrast(int contrast);
@@ -105,7 +112,6 @@ public:
QVideoWidget::AspectRatioMode aspectRatioMode() const;
void setAspectRatioMode(QVideoWidget::AspectRatioMode mode);
- QWidget *widget();
private:
QVideoWidgetControl *m_widgetControl;
@@ -115,18 +121,12 @@ private:
class QVideoRendererControl;
-class QVideoRendererWidget
-#ifndef QT_NO_OPENGL
- : public QGLWidget
-#else
- : public QWidget
-#endif
- , public QVideoWidgetBackendInterface
+class QRendererVideoWidgetBackend : public QVideoWidgetBackend
{
Q_OBJECT
public:
- QVideoRendererWidget(QVideoRendererControl *control, QWidget *parent = 0);
- ~QVideoRendererWidget();
+ QRendererVideoWidgetBackend(QVideoRendererControl *control, QWidget *widget);
+ ~QRendererVideoWidgetBackend();
void clearSurface();
@@ -140,44 +140,41 @@ public:
QVideoWidget::AspectRatioMode aspectRatioMode() const;
void setAspectRatioMode(QVideoWidget::AspectRatioMode mode);
- QWidget *widget();
-
QSize sizeHint() const;
+ void showEvent(QShowEvent *event);
+ void hideEvent(QHideEvent *event);
+ void resizeEvent(QResizeEvent *event);
+ void moveEvent(QMoveEvent *event);
+ void paintEvent(QPaintEvent *event);
+
Q_SIGNALS:
+ void fullScreenChanged(bool fullScreen);
void brightnessChanged(int brightness);
void contrastChanged(int contrast);
void hueChanged(int hue);
void saturationChanged(int saturation);
-protected:
-#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1)
- void initializeGL();
-#endif
-
- void paintEvent(QPaintEvent *event);
-
-private Q_SLOTS:
- void dimensionsChanged();
-
private:
QRect displayRect() const;
QVideoRendererControl *m_rendererControl;
+ QWidget *m_widget;
QPainterVideoSurface *m_surface;
QVideoWidget::AspectRatioMode m_aspectRatioMode;
QSize m_aspectRatio;
+ bool m_updatePaintDevice;
};
#endif
class QVideoWindowControl;
-class QVideoWindowWidget : public QWidget, public QVideoWidgetBackendInterface
+class QWindowVideoWidgetBackend : public QVideoWidgetBackend
{
Q_OBJECT
public:
- QVideoWindowWidget(QVideoWindowControl *control, QWidget *parent = 0);
- ~QVideoWindowWidget();
+ QWindowVideoWidgetBackend(QVideoWindowControl *control, QWidget *widget);
+ ~QWindowVideoWidgetBackend();
void setBrightness(int brightness);
void setContrast(int contrast);
@@ -189,21 +186,17 @@ public:
QVideoWidget::AspectRatioMode aspectRatioMode() const;
void setAspectRatioMode(QVideoWidget::AspectRatioMode mode);
- QWidget *widget();
-
QSize sizeHint() const;
-public Q_SLOTS:
- void setVisible(bool visible);
-
-
-protected:
- void moveEvent(QMoveEvent *event);
+ void showEvent(QShowEvent *event);
+ void hideEvent(QHideEvent *event);
void resizeEvent(QResizeEvent *event);
+ void moveEvent(QMoveEvent *event);
void paintEvent(QPaintEvent *event);
private:
QVideoWindowControl *m_windowControl;
+ QWidget *m_widget;
QVideoWidget::AspectRatioMode m_aspectRatioMode;
QSize m_pixelAspectRatio;
};
@@ -217,7 +210,6 @@ class QVideoWidgetPrivate
public:
QVideoWidgetPrivate()
: q_ptr(0)
- , layout(0)
, service(0)
, outputControl(0)
, widgetBackend(0)
@@ -225,6 +217,7 @@ public:
#ifndef QT_NO_MULTIMEDIA
, rendererBackend(0)
#endif
+ , currentControl(0)
, currentBackend(0)
, brightness(0)
, contrast(0)
@@ -237,15 +230,15 @@ public:
}
QVideoWidget *q_ptr;
- QStackedLayout *layout;
QMediaService *service;
QVideoOutputControl *outputControl;
QVideoWidgetControlBackend *widgetBackend;
- QVideoWindowWidget *windowBackend;
+ QWindowVideoWidgetBackend *windowBackend;
#ifndef QT_NO_MULTIMEDIA
- QVideoRendererWidget *rendererBackend;
+ QRendererVideoWidgetBackend *rendererBackend;
#endif
- QVideoWidgetBackendInterface *currentBackend;
+ QVideoWidgetControlInterface *currentControl;
+ QVideoWidgetBackend *currentBackend;
int brightness;
int contrast;
int hue;
@@ -254,7 +247,7 @@ public:
Qt::WindowFlags nonFullScreenFlags;
bool wasFullScreen;
- void setCurrentBackend(QVideoWidgetBackendInterface *backend);
+ void setCurrentControl(QVideoWidgetControlInterface *control);
void _q_serviceDestroyed();
void _q_brightnessChanged(int brightness);
@@ -262,6 +255,7 @@ public:
void _q_hueChanged(int hue);
void _q_saturationChanged(int saturation);
void _q_fullScreenChanged(bool fullScreen);
+ void _q_dimensionsChanged();
};
QTM_END_NAMESPACE
diff --git a/src/publishsubscribe/contextkitlayer.cpp b/src/publishsubscribe/contextkitlayer.cpp
index 8928de5fee..fa34f5c7c7 100644
--- a/src/publishsubscribe/contextkitlayer.cpp
+++ b/src/publishsubscribe/contextkitlayer.cpp
@@ -282,7 +282,7 @@ unsigned int ContextKitLayer::order()
LayerOptions ContextKitLayer::layerOptions () const
{
- return NonPermanentLayer | NonWriteableLayer;
+ return NonPermanentLayer | NonWritableLayer;
}
QAbstractValueSpaceLayer::Handle ContextKitLayer::item (Handle parent, const QString &subPath)
diff --git a/src/publishsubscribe/publishsubscribe.pro b/src/publishsubscribe/publishsubscribe.pro
index 92b918e961..4d9d403403 100644
--- a/src/publishsubscribe/publishsubscribe.pro
+++ b/src/publishsubscribe/publishsubscribe.pro
@@ -48,7 +48,7 @@ unix:!symbian {
qpacketprotocol_p.h
SOURCES += sharedmemorylayer.cpp \
qmallocpool.cpp \
- qsystemreadwritelock.cpp \
+ qsystemreadwritelock_unix.cpp \
qpacketprotocol.cpp
}
}
@@ -56,7 +56,7 @@ unix:!symbian {
win32 {
HEADERS += qsystemreadwritelock_p.h
SOURCES += \
- qsystemreadwritelock.cpp \
+ qsystemreadwritelock_win.cpp \
registrylayer_win.cpp
!wince*:LIBS += -ladvapi32
diff --git a/src/publishsubscribe/qmallocpool_p.h b/src/publishsubscribe/qmallocpool_p.h
index 8229ffc5e7..fb9e522623 100644
--- a/src/publishsubscribe/qmallocpool_p.h
+++ b/src/publishsubscribe/qmallocpool_p.h
@@ -38,6 +38,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
#ifndef QMALLOCPOOL_H
#define QMALLOCPOOL_H
diff --git a/src/publishsubscribe/qpacketprotocol_p.h b/src/publishsubscribe/qpacketprotocol_p.h
index 833916edea..7a0fcca2cd 100644
--- a/src/publishsubscribe/qpacketprotocol_p.h
+++ b/src/publishsubscribe/qpacketprotocol_p.h
@@ -38,6 +38,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
#ifndef QPACKETPROTOCOL_H
#define QPACKETPROTOCOL_H
diff --git a/src/publishsubscribe/qpublishsubscribeglobal.h b/src/publishsubscribe/qpublishsubscribeglobal.h
new file mode 100644
index 0000000000..eaceb44585
--- /dev/null
+++ b/src/publishsubscribe/qpublishsubscribeglobal.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPUBLISHSUBSCRIBEGLOBAL_H
+#define QPUBLISHSUBSCRIBEGLOBAL_H
+
+#if defined(QTM_BUILD_UNITTESTS)
+# include <qconfig.h>
+# if !defined(QT_BUILD_INTERNAL)
+# define QT_BUILD_INTERNAL
+# endif
+#endif
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+# if defined(QT_NODLL)
+# undef QT_MAKEDLL
+# undef QT_DLL
+# elif defined(QT_MAKEDLL)
+# if defined(QT_DLL)
+# undef QT_DLL
+# endif
+# if defined(QT_BUILD_CFW_LIB)
+# define Q_PUBLISHSUBSCRIBE_EXPORT Q_DECL_EXPORT
+# else
+# define Q_PUBLISHSUBSCRIBE_EXPORT Q_DECL_IMPORT
+# endif
+# elif defined(QT_DLL) /* use a Qt DLL library */
+# define Q_PUBLISHSUBSCRIBE_EXPORT Q_DECL_IMPORT
+# endif
+#else
+#endif
+
+#if !defined(Q_PUBLISHSUBSCRIBE_EXPORT)
+# if defined(QT_SHARED)
+# define Q_PUBLISHSUBSCRIBE_EXPORT Q_DECL_EXPORT
+# else
+# define Q_PUBLISHSUBSCRIBE_EXPORT
+# endif
+#endif
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QPUBLISHSUBSCRIBEGLOBAL_H
diff --git a/src/publishsubscribe/qsystemreadwritelock_p.h b/src/publishsubscribe/qsystemreadwritelock_p.h
index eb2d855afa..4350945a63 100644
--- a/src/publishsubscribe/qsystemreadwritelock_p.h
+++ b/src/publishsubscribe/qsystemreadwritelock_p.h
@@ -55,25 +55,26 @@ public:
enum SystemReadWriteLockError{
NoError,
PermissionDenied,
- KeyError,
+ KeyError,//TODO:remove this enum
NotFound,
- LockError,
- OutOfResources,
- FailedToInitialize,
+ LockError,//TODO: remove this enum
+ OutOfResources,
+ FailedToInitialize,//TODO: remove this enum
UnknownError
};
-
+
QSystemReadWriteLock(const QString &key, AccessMode mode = Open);
~QSystemReadWriteLock();
bool lockForRead();
bool lockForWrite();
- bool unlock();
+ void unlock();
- SystemReadWriteLockError error();
- QString errorString();
+ SystemReadWriteLockError error() const;
+ QString errorString() const;
QString key() const;
+
private:
QSystemReadWriteLockPrivate *d;
};
diff --git a/src/publishsubscribe/qsystemreadwritelock_unix.cpp b/src/publishsubscribe/qsystemreadwritelock_unix.cpp
new file mode 100644
index 0000000000..b4e19fd5d7
--- /dev/null
+++ b/src/publishsubscribe/qsystemreadwritelock_unix.cpp
@@ -0,0 +1,545 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qsystemreadwritelock_p.h"
+#include <QFile>
+#include <sys/sem.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <QRegExp>
+#include <QCryptographicHash>
+#include <QDir>
+
+QTM_BEGIN_NAMESPACE
+
+class QSystemReadWriteLockPrivate
+{
+public:
+ enum SemIndex {
+ ActiveReaders = 0,
+ TotalWriters,
+ ActiveWriterSem,
+ NumInstances
+ };
+
+ QSystemReadWriteLockPrivate():id(-1),semId(-1),
+ key(QString()),keyFileName(QString()),
+ error(QSystemReadWriteLock::NoError),
+ errorString(QString()){};
+ void setError(const QString &errorString);
+
+ key_t id;
+ int semId;
+ QString key;
+ QString keyFileName;
+
+ QSystemReadWriteLock::SystemReadWriteLockError error;
+ QString errorString;
+};
+
+void QSystemReadWriteLockPrivate::setError(const QString &_errorString)
+{
+ errorString = _errorString;
+ switch (errno) {
+ case EPERM:
+ case EACCES:
+ error = QSystemReadWriteLock::PermissionDenied;
+ break;
+ case ERANGE:
+ case ENOMEM:
+ case ENOSPC:
+ error = QSystemReadWriteLock::OutOfResources;
+ break;
+ case EIDRM:
+ error = QSystemReadWriteLock::NotFound;
+ break;
+ default:
+ error = QSystemReadWriteLock::UnknownError;
+ }
+}
+
+/*
+ This function is taken from qcore_unix_p.h(qt_safe_open)
+ If/when QSystemReadWriteLock is integrated into Qt,
+ this function defintion may replaced by the sharedmemory
+ definition.
+ */
+static inline int safe_open(const char *pathname, int flags, mode_t mode = 0777)
+{
+#ifdef O_CLOEXEC
+ flags |= O_CLOEXEC;
+#endif
+ register int fd;
+
+ do {
+ fd = ::open(pathname, flags, mode);
+ } while (fd == -1 && errno == EINTR);
+
+ // unknown flags are ignored, so we have no way of verifying if
+ // O_CLOEXEC was accepted
+ if (fd != -1)
+ ::fcntl(fd, F_SETFD, FD_CLOEXEC);
+ return fd;
+}
+
+/*
+ This function is taken from qsharedmemory_unix.cpp.
+ If/when QSystemReadWriteLock is integrated into Qt,
+ this function defintion may replaced by the sharedmemory
+ definition.
+ */
+int createUnixKeyFile(const QString &fileName)
+{
+ if (QFile::exists(fileName)) {
+ return 0;
+ }
+
+ int fd = safe_open(QFile::encodeName(fileName).constData(),
+ O_EXCL | O_CREAT | O_RDWR, 0640);
+
+ if (-1 == fd) {
+ if (errno == EEXIST)
+ return 0;
+ return -1;
+ } else {
+ close(fd);
+ }
+ return 1;
+}
+
+/*
+ This function is taken from qsharedmemory_unix.cpp.
+ If/when QSystemReadWriteLock is integrated into Qt,
+ the function definition may replaced by the sharedmemory
+ definition.
+ */
+QString makePlatformSafeKey(const QString &key,
+ const QString &prefix)
+{
+ if (key.isEmpty())
+ return QString();
+
+ QString result = prefix;
+
+ QString part1 = key;
+ part1.replace(QRegExp(QLatin1String("[^A-Za-z]")), QString());
+ result.append(part1);
+
+ QByteArray hex = QCryptographicHash::hash(key.toUtf8(), QCryptographicHash::Sha1).toHex();
+ result.append(QLatin1String(hex));
+ return QDir::tempPath() + QLatin1Char('/') + result;
+}
+
+/*!
+ \class QSystemReadWriteLock
+
+ \brief The QSystemReadWriteLock class provides read-write locking between
+ processes.
+
+ A read-write lock is a synchronization tool for protecting resources that can
+ be accessed for reading and writing. This type of lock is useful if you want
+ to allow multiple processes/threads to have simultaneous read-only access, but as soon
+ as one thread wants to write to the resource, all other threads must be
+ blocked until the writing is complete.
+
+ QSystemReadWriteLock behaves much like the QReadWriteLock class, but it also
+ works across multiple processes (although it also works perfectly well,
+ albeit slightly less efficiently, in a single process). The system
+ resources are cleaned up when the last QSystemReadWriteLock instance
+ is destroyed.
+
+ The behaviour of QSystemReadWriteLock is such that writers will
+ take precedence over readers. When writers are waiting, any new
+ readers must wait until all writers complete. That is, writers
+ can starve readers.
+ */
+
+/*
+ Implementation Details:
+
+ The QSystemReadWriteLock class uses Linux kernel semaphores to synchronize
+ access between readers and writers.
+
+ 4 semaphores are used in total.
+ activeReaders - number of active readers
+ TotalWriters - number of active and pending writers
+
+ ActiveWriterSem - indicates whether a writer is active
+
+ NumInstances - counts the number of instances of QSystemReadWriteLock
+ objects there for a given key. This is needed
+ to determine whether system resources are
+ safe to clean up during an instance's destruction.
+
+ activeReaders, TotalWriters and NumInstance are used as counters and
+ not in the way typical semaphores are used. e.g.a value of 5 for
+ activeReaders indicates that there are currently 5 readers.
+
+ ActiveWriterSem is used as a typical semaphore. A value of 1
+ means there's an free slot for a writer to become active.
+ */
+
+/*!
+ Construct a system read write lock from the provided \a key.
+
+ The \a mode parameter is only used in Unix systems to handle the case
+ where underlying system resources such as semaphores survive a process
+ crash. In this case, the next process to instatiate a lock will
+ get the resources that survived the crash, and unless \mode is
+ Create, the resources will not be reset.
+ */
+QSystemReadWriteLock::QSystemReadWriteLock(const QString &key, AccessMode mode)
+{
+ d = new QSystemReadWriteLockPrivate;
+ d->key = key;
+ d->keyFileName = makePlatformSafeKey(key, QLatin1String("qipc_systemsem_"));
+
+ int built = createUnixKeyFile(d->keyFileName);
+ if (built == -1) {
+ d->setError(QObject::tr("QSystemReadWriteLock::QSystemReadWriteLock: "
+ "unable to make key file for key: %1(%2)")
+ .arg(key).arg(strerror(errno)));
+ return;
+ }
+
+ // Get the unix key for the created file
+ d->id = ftok(QFile::encodeName(d->keyFileName).constData(), 'Q');
+ if (d->id == -1) {
+ d->setError(QObject::tr("QSystemReadWriteLock::QSystemReadWriteLock: "
+ "ftok failed for key %1(%2)")
+ .arg(key).arg(strerror(errno)));
+ return;
+ }
+
+ d->semId = ::semget(d->id, 4, IPC_CREAT | IPC_EXCL | 0666);
+ bool created = false;
+ if (d->semId == -1) {
+ if (errno == EEXIST) {
+ d->semId = ::semget(d->id, 4,
+ (mode == QSystemReadWriteLock::Create)?IPC_CREAT|0666:0);
+ if (d->semId == -1) {
+ d->setError(QObject::tr("QSystemReadWriteLock::QSystemReadWriteLock: "
+ "Unable to access semaphore set for key %1(%2)")
+ .arg(key).arg(::strerror(errno)));
+ return;
+ }
+ } else {
+ d->setError(QObject::tr("QSystemReadWriteLock:QSystemReadWriteLock: "
+ "Unable to access semaphore set for key %1(%2)")
+ .arg(key).arg(::strerror(errno)));
+ return;
+ }
+ } else {
+ created = true;
+ }
+
+ Q_ASSERT(d->semId != -1);
+ if (created || mode == QSystemReadWriteLock::Create) {
+ typedef union {
+ int val;
+ struct semid_ds *buf;
+ ushort *array;
+ }semun;
+
+ semun counterInitVal; //initial value for a "counter" semaphores
+ counterInitVal.val = 0;
+
+ semun activeWriterInitVal;//initial value for the "active writer" semaphore
+ activeWriterInitVal.val = 1;
+
+ if (-1 == ::semctl(d->semId, QSystemReadWriteLockPrivate::ActiveReaders,
+ SETVAL, counterInitVal) ||
+ -1 == ::semctl(d->semId, QSystemReadWriteLockPrivate::TotalWriters,
+ SETVAL, counterInitVal) ||
+ -1 == ::semctl(d->semId, QSystemReadWriteLockPrivate::ActiveWriterSem,
+ SETVAL, activeWriterInitVal) ||
+ -1 == ::semctl(d->semId, QSystemReadWriteLockPrivate::NumInstances,
+ SETVAL, counterInitVal))
+ {
+ d->setError(QObject::tr("QSystemReadWriteLock::QSystemReadWriteLock: "
+ "Unable to reset semaphore set for key %1(%2)")
+ .arg(key).arg(::strerror(errno)));
+ QFile::remove(d->keyFileName);
+ ::semctl(d->semId, 0, IPC_RMID);
+ d->semId = -1;
+ return;
+ }
+ }
+
+ struct sembuf op;
+ op.sem_num = QSystemReadWriteLockPrivate::NumInstances;
+ op.sem_op = 1;
+ op.sem_flg = SEM_UNDO;
+ int semoprv = ::semop(d->semId, &op, 1);
+ if (semoprv == -1) {
+ d->setError(QObject::tr("QSystemReadWriteLock::QSystemReadWriteLock: "
+ "Unable to increment NumInstances semaphore "
+ "for key%1(%2)").arg(key).arg(::strerror(errno)));
+ d->semId = -1;
+ return;
+ }
+}
+
+/*!
+ Destroy the lock instance. The last QSystemReadWriteLock instance
+ for a particular key will destroy the underlying system resources.
+ */
+QSystemReadWriteLock::~QSystemReadWriteLock()
+{
+ if (d->semId != -1) {
+ //decrement and check that there are 0 instances
+ //be aware these 2 operations occur together atomically
+ struct sembuf ops[2];
+ ops[0].sem_num = QSystemReadWriteLockPrivate::NumInstances;
+ ops[0].sem_op = -1;
+ ops[0].sem_flg = SEM_UNDO | IPC_NOWAIT;
+
+ ops[1].sem_num = QSystemReadWriteLockPrivate::NumInstances;
+ ops[1].sem_op = 0;
+ ops[1].sem_flg = IPC_NOWAIT;
+
+ //if successful, then delete the semaphore set
+ int semoprv = ::semop(d->semId, ops, 2);
+ if (semoprv == 0) {
+ if(::semctl(d->semId, 0, IPC_RMID) == -1) {
+ qWarning(QObject::tr("QSystemReadWriteLock::~QSystemReadWriteLock: "
+ "Unable to remove semaphore %1(%2)")
+ .arg(d->key).arg(::strerror(errno)).toLatin1());
+ }
+ QFile::remove(d->keyFileName);
+ } else {
+ if (errno == EAGAIN) {
+ //wasn't 0 instances so just decrement the NumInstances semaphore
+ if (::semop(d->semId, ops, 1) == -1) {
+ qWarning(QObject::tr("QSystemReadWriteLock::~QSystemReadWriteLock: unable "
+ "to decrement NumInstances semaphore for key %1(%2)")
+ .arg(d->key).arg(::strerror(errno)).toLatin1());
+ }
+ } else {
+ qWarning(QObject::tr("QSystemReadWriteLock::~QSystemReadWriteLock: unable "
+ "to decrement and check NumInstances semaphore for key %1(%2)")
+ .arg(d->key).arg(::strerror(errno)).toLatin1());
+ ::semop(d->semId, ops, 1);//try decrement anyway
+ }
+ }
+
+ }
+
+ Q_ASSERT(d);
+ delete d;
+ d = 0;
+}
+
+/*!
+ Return the key of the lock as passed to the constructor.
+ */
+QString QSystemReadWriteLock::key() const
+{
+ return d->key;
+}
+
+/*!
+ Locks the lock for reading. The function will block if any thread/process
+ has locked for writing.
+ */
+bool QSystemReadWriteLock::lockForRead()
+{
+ if (d->semId == -1) {
+ d->errorString = QObject::tr("QSystemReadWriteLock::lockForRead: unable to lock for read for key %1(%2)")
+ .arg(d->key).arg("Lock had not been correctly initialized");
+ d->error = UnknownError;
+ return false;
+ }
+
+ struct sembuf ops[2];
+
+ ops[0].sem_num = QSystemReadWriteLockPrivate::ActiveReaders;
+ ops[0].sem_op = 1;
+ ops[0].sem_flg = SEM_UNDO;
+
+ ops[1].sem_num = QSystemReadWriteLockPrivate::TotalWriters;
+ ops[1].sem_op = 0;
+ ops[1].sem_flg = 0;
+
+ if (-1 == ::semop(d->semId, ops, 2)) {
+ d->setError(QObject::tr("QSystemReadWriteLock::lockForRead: unable to lock for read for key %1(%2)")
+ .arg(d->key).arg(::strerror(errno)));
+ return false;
+ } else {
+ d->errorString = "";
+ d->error = NoError;
+ return true;
+ }
+}
+
+/*!
+ Locks the lock for writing. This function will block if another thread/process
+ has locked for reading or writing.
+ */
+bool QSystemReadWriteLock::lockForWrite()
+{
+ if (d->semId == -1) {
+ d->errorString = QObject::tr("QSystemReadWriteLock::lockForWrite: "
+ "unable to lock for write for key %1(%2)")
+ .arg(d->key).arg("Lock had not been correctly initialized");
+ d->error = UnknownError;
+ return false;
+ }
+
+ struct sembuf op;
+ op.sem_num = QSystemReadWriteLockPrivate::TotalWriters;
+ op.sem_op = 1;
+ op.sem_flg = SEM_UNDO;
+
+ int semoprv = ::semop(d->semId, &op, 1);
+ if (semoprv == -1) {
+ d->setError(QObject::tr("QSystemReadWriteLock::lockForWrite: "
+ "Could not increment TotalWriters semaphore for key %1(%2)")
+ .arg(d->key).arg(::strerror(errno)));
+ return false;
+ }
+
+ op.sem_num = QSystemReadWriteLockPrivate::ActiveReaders;
+ op.sem_op = 0;
+ op.sem_flg = 0;
+ semoprv = ::semop(d->semId, &op, 1);
+ if (semoprv == -1) {
+ d->setError(QObject::tr("QSystemReadWriteLock::lockForWrite: "
+ "Could not detect if all readers were finished for key %1(%2)")
+ .arg(d->key).arg(::strerror(errno)));
+
+ // Decrement our write lock
+ op.sem_num = QSystemReadWriteLockPrivate::TotalWriters;
+ op.sem_op = -1;
+ op.sem_flg = SEM_UNDO;
+ ::semop(d->semId, &op, 1);
+ return false;
+ } else {
+ op.sem_num = QSystemReadWriteLockPrivate::ActiveWriterSem;
+ op.sem_op = -1;
+ op.sem_flg =SEM_UNDO;
+ semoprv = ::semop(d->semId, &op, 1);
+
+ if (semoprv == -1) {
+ d->setError(QObject::tr("QSystemReadWriteLock::lockForWrite: "
+ "Could not decrement ActiveWriterSem semaphore for key %1(%2)")
+ .arg(d->key).arg(::strerror(errno)));
+
+ op.sem_num = QSystemReadWriteLockPrivate::TotalWriters;
+ op.sem_op = -1;
+ op.sem_flg = 0;
+ ::semop(d->semId, &op, 1);
+ return false;
+ }
+ d->errorString ="";
+ d->error = NoError;
+ return true;
+ }
+}
+
+/*!
+ Release the lock.
+ */
+void QSystemReadWriteLock::unlock()
+{
+ if (d->semId == -1) {
+ d->errorString = QObject::tr("QSystemReadWriteLock::unlock: unable to unlock for key %1(%2)")
+ .arg(d->key).arg("Lock had not been correctly initialized");
+ d->error = UnknownError;
+ return;
+ }
+
+ struct sembuf op;
+ op.sem_num = QSystemReadWriteLockPrivate::ActiveReaders;
+ op.sem_op = -1;
+ op.sem_flg = SEM_UNDO | IPC_NOWAIT;
+ if (::semop(d->semId, &op, 1) == 0) {
+ //do nothing, succeeded in decrementing number of readers
+ } else if (errno == EAGAIN){ //no readers, so check for writers
+ struct sembuf ops[3];
+ ops[0].sem_num = QSystemReadWriteLockPrivate::ActiveWriterSem;
+ ops[0].sem_op = 0;
+ ops[0].sem_flg = IPC_NOWAIT;
+
+ ops[1].sem_num = QSystemReadWriteLockPrivate::ActiveWriterSem;
+ ops[1].sem_op = 1;
+ ops[1].sem_flg = SEM_UNDO;
+
+ ops[2].sem_num = QSystemReadWriteLockPrivate::TotalWriters;
+ ops[2].sem_op = -1;
+ ops[2].sem_flg = SEM_UNDO;
+
+ if (::semop(d->semId, ops, 3) == -1) {
+ if (errno != EAGAIN) {
+ d->setError(QObject::tr("QSystemSemaphoreWriteLock::unlock: unable to check and "
+ "update writer semaphores for key %1(%2)")
+ .arg(d->key).arg(::strerror(errno)));
+ return;
+ } //Note: EAGAIN indicates that ActiveWriterSem is has a non zero value
+ //indicating there is no current writer, so nothing needs to be done
+ }
+ } else {
+ //error in decrementing readers
+ d->setError(QObject::tr("QSystemReadWriteLock::unlock: unable to decrement "
+ "ActiveReaders semaphore for key %1(%2)")
+ .arg(d->key).arg(::strerror(errno)));
+ return;
+ }
+ d->errorString="";
+ d->error = NoError;
+}
+
+/*!
+ Returns the error code of the last encountered error
+ */
+QSystemReadWriteLock::SystemReadWriteLockError QSystemReadWriteLock::error() const {
+ return d->error;
+}
+
+/*!
+ Returns a string describing the last encountered error
+ */
+QString QSystemReadWriteLock::errorString() const
+{
+ return d->errorString;
+}
+
+QTM_END_NAMESPACE
diff --git a/src/publishsubscribe/qsystemreadwritelock.cpp b/src/publishsubscribe/qsystemreadwritelock_win.cpp
index 105e4a57c1..3733d8c7ba 100644
--- a/src/publishsubscribe/qsystemreadwritelock.cpp
+++ b/src/publishsubscribe/qsystemreadwritelock_win.cpp
@@ -255,18 +255,18 @@ bool QSystemReadWriteLock::lockForWrite()
return true;
}
-bool QSystemReadWriteLock::unlock()
+void QSystemReadWriteLock::unlock()
{
if (!d->m_isInitialized) {
d->m_error = QSystemReadWriteLock::FailedToInitialize;
d->m_errorString = QObject::tr("QSystemReadWriteLock::unlock(): cannot peform operation, lock initialization had not been successful");
- return false;
+ return;
}
if(!d->m_counts.lock()) {
d->m_error = d->convertError(d->m_counts.error());
d->m_errorString = QObject::tr("QSystemReadWriteLock::lockForwrite(): cannot perform operation, locking of shared memory was unsuccessful");
- return false;
+ return;
}
Q_ASSERT_X(d->accessCount() != 0, "QSystemReadWriteLock::unlock()", "Cannot unlock an unlocked lock");
@@ -292,7 +292,7 @@ bool QSystemReadWriteLock::unlock()
d->m_error = QSystemReadWriteLock::NoError;
d->m_errorString.clear();
d->m_counts.unlock();
- return true;
+ return;
}
int& QSystemReadWriteLockPrivate::accessCount()
@@ -310,12 +310,12 @@ unsigned int &QSystemReadWriteLockPrivate::waitingWriters()
return *(((unsigned int*)m_counts.data())+2);
}
-QSystemReadWriteLock::SystemReadWriteLockError QSystemReadWriteLock::error()
+QSystemReadWriteLock::SystemReadWriteLockError QSystemReadWriteLock::error() const
{
return d->m_error;
}
-QString QSystemReadWriteLock::errorString()
+QString QSystemReadWriteLock::errorString() const
{
return d->m_errorString;
}
diff --git a/src/publishsubscribe/qvaluespace.cpp b/src/publishsubscribe/qvaluespace.cpp
index abb7355671..68a96ea4d2 100644
--- a/src/publishsubscribe/qvaluespace.cpp
+++ b/src/publishsubscribe/qvaluespace.cpp
@@ -69,30 +69,11 @@ QTM_BEGIN_NAMESPACE
*/
/*!
- \enum QValueSpace::LayerOption
-
- This enum describes the behaviour of the Value Space layer. In addition this enum is used as
- a filter when constructing a QValueSpaceProvider or QValueSpaceSubscriber.
-
- \value UnspecifiedLayer Used as a filter to specify that any layer should be used.
- \value PermanentLayer Indicates that the layer uses a permanent backing store. When used
- as a filter only layers that use a permanent backing store will be
- used.
- \value NonPermanentLayer Indicates that the layer does not use a permanent backing store.
- When used as a filter only layers that do not use permanent backing
- stores will be used.
- \value WriteableLayer Indicates that the layer can update its contents. When used as a
- filter only layers that are writeable will be used.
- \value NonWriteableLayer Indicates that the layer cannot update its contents. When used as
- a filter only layers that are read-only will be used.
-*/
-
-/*!
\macro QVALUESPACE_AUTO_INSTALL_LAYER(className)
\relates QAbstractValueSpaceLayer
- This macro installs new value space layer. \a className is the name of the class implementing
+ This macro installs new Value Space layer. \a className is the name of the class implementing
the new layer.
The method \c {className *className::instance()} must exist and return a pointer to an instance
@@ -107,7 +88,7 @@ QTM_BEGIN_NAMESPACE
\typedef QAbstractValueSpaceLayer::Handle
The Handle type is an opaque, pointer sized contextual handle used to represent paths within
- value space layers. Handles are only ever created by QAbstractValueSpaceLayer::item() and are
+ Value Space layers. Handles are only ever created by QAbstractValueSpaceLayer::item() and are
always released by calls to QAbstractValueSpaceLayer::removeHandle(). The special value,
\c {InvalidHandle} is reserved to represent an invalid handle.
*/
@@ -116,7 +97,7 @@ QTM_BEGIN_NAMESPACE
\enum QAbstractValueSpaceLayer::Type
Value Space layers are initialized in either a "Server" or a "Client" context. There is only
- a single server in the value space architecture, and its layers are always initialized before
+ a single server in the Value Space architecture, and its layers are always initialized before
any clients. This distinction allows layers to implement Client/Server architecture
\i {if required}. If not, layers are free to treat Server and Client contexts identically.
@@ -250,7 +231,7 @@ QTM_BEGIN_NAMESPACE
const QString &subPath, const QVariant &value)
Process calls to QValueSpaceProvider::setAttribute() by setting the value specified by the
- \a subPath under \a handle to \a value. Ownership of the value space item is assigned to
+ \a subPath under \a handle to \a value. Ownership of the Value Space item is assigned to
\a creator.
Returns true on success; otherwise returns false.
@@ -260,7 +241,7 @@ QTM_BEGIN_NAMESPACE
\fn bool QAbstractValueSpaceLayer::removeValue(QValueSpaceProvider *creator, Handle handle,
const QString &subPath)
- Process calls to QValueSpaceProvider::removeAttribute() by removing the value space item
+ Process calls to QValueSpaceProvider::removeAttribute() by removing the Value Space item
identified by \a handle and \a subPath and created by \a creator.
Returns true on success; otherwise returns false.
@@ -318,13 +299,51 @@ void QAbstractValueSpaceLayer::emitAttributeInterestChanged(QValueSpaceProvider
/*!
\namespace QValueSpace
- \brief The QValueSpace namespace provides methods that are useful to Value Space layer
- implementors.
+ \brief The QValueSpace namespace contains miscellaneous identifiers used throughtout the
+ Publish and Subscribe API.
\ingroup publishsubscribe
+*/
+
+/*!
+ \enum QValueSpace::LayerOption
- Value Space layers that are available at link time can be automatically installed using
- QVALUESPACE_AUTO_INSTALL_LAYER() macro. Value Space layers that are only available at run-time
- can be installed using installLayer().
+ This enum describes the behaviour of the Value Space layer. In addition this enum is used as
+ a filter when constructing a QValueSpaceProvider or QValueSpaceSubscriber.
+
+ \value UnspecifiedLayer Used as a filter to specify that any layer should be used.
+ \value PermanentLayer Indicates that the layer uses a permanent backing store. When used
+ as a filter only layers that use a permanent backing store will be
+ used.
+ \br
+ Values stored in a layer with this option will persist with in the
+ layer after the QValueSpaceProvider that published them is
+ destroyed. Whether the value persists in the layer after the
+ server or device is restarted is system dependent.
+ \br
+ This option and the NonPermanentLayer option are mutually
+ exclusive.
+ \value NonPermanentLayer Indicates that the layer does not use a permanent backing store.
+ When used as a filter only layers that do not use permanent backing
+ stores will be used.
+ \br
+ Values stored in a layer with this option will be removed when the
+ QValueSpaceProvider that published them is destroyed.
+ \br
+ This option and the PermanentLayer option are mutually exclusive.
+ \value WritableLayer Indicates that the layer can update its contents. When used as a
+ filter only layers that are writable will be used.
+ \br
+ Applications can use QValueSpaceProvider to publish values to
+ layers that have this option.
+ \br
+ This option and the NonWritableLayer option are mutually
+ exclusive.
+ \value NonWritableLayer Indicates that the layer cannot update its contents. When used as
+ a filter only layers that are read-only will be used.
+ \br
+ Applications can not publish values to layers with this option.
+ \br
+ This option and the WritableLayer option are mutually exclusive.
*/
/*!
@@ -344,12 +363,12 @@ void QAbstractValueSpaceLayer::emitAttributeInterestChanged(QValueSpaceProvider
/*!
\fn QValueSpace::AutoInstall::AutoInstall(LayerCreateFunc func)
- Installs the Value Space layer at construction time by calling the layer creation function
- \a func.
+ Installs the Value Space layer at static construction time by calling the layer creation
+ function \a func.
*/
/*!
- Initialize the value space manager as the server. This method only needs to be called by the
+ Initialize the Value Space manager as the server. This method only needs to be called by the
process acting as the server and should be called before any process in the system uses a value
space class.
*/
@@ -359,7 +378,7 @@ void QValueSpace::initValueSpaceServer()
}
/*!
- Used by value space layer implementations to install themselves into the system. \a layer
+ Used by Value Space layer implementations to install themselves into the system. \a layer
should be a pointer to the layer to install.
\sa QVALUESPACE_AUTO_INSTALL_LAYER()
@@ -384,13 +403,13 @@ void QValueSpace::installLayer(LayerCreateFunc func)
\macro QVALUESPACE_SHAREDMEMORY_LAYER
\relates QValueSpace
- The UUID of the Shared Memory Layer as a QUuid. The actual UUID value is
+ The UUID of the Shared Memory layer as a QUuid. The actual UUID value is
{d81199c1-6f60-4432-934e-0ce4d37ef252}.
- This value can be passed to the constructor of QValueSpaceProvider to force the constructed
- value space provider to publish its values in the Shared Memory Layer.
+ This value can be passed to the constructor of QValueSpaceProvider or QValueSpaceSubscriber to
+ force the constructed object to only access the Shared Memory layer.
- You can test if the Shared Memory Layer is available by checking if the list returned by
+ You can test if the Shared Memory layer is available by checking if the list returned by
QValueSpace::availableLayers() contains this value.
*/
@@ -398,14 +417,14 @@ void QValueSpace::installLayer(LayerCreateFunc func)
\macro QVALUESPACE_VOLATILEREGISTRY_LAYER
\relates QValueSpace
- The UUID of the Volatile Registry Layer as a QUuid. The actual UUID value is
+ The UUID of the Volatile Registry layer as a QUuid. The actual UUID value is
{8ceb5811-4968-470f-8fc2-264767e0bbd9}.
- This value can be passed to the constructor of QValueSpaceProvider to force the constructed
- value space provider to publish its values in the Volatile Registry Layer.
+ This value can be passed to the constructor of QValueSpaceProvider or QValueSpaceSubscriber to
+ force the constructed object to only access the Volatile Registry layer.
- You can test if the Volatile Registry Layer is available by checking if the list returned by
- QValueSpace::availableLayers() contains this value. The Volatile Registry Layer is only
+ You can test if the Volatile Registry layer is available by checking if the list returned by
+ QValueSpace::availableLayers() contains this value. The Volatile Registry layer is only
available on Windows platforms.
*/
@@ -413,14 +432,14 @@ void QValueSpace::installLayer(LayerCreateFunc func)
\macro QVALUESPACE_NONVOLATILEREGISTRY_LAYER
\relates QValueSpace
- The UUID of the Non-Volatile Registry Layer as a QUuid. The actual UUID value is
+ The UUID of the Non-Volatile Registry layer as a QUuid. The actual UUID value is
{8e29561c-a0f0-4e89-ba56-080664abc017}.
- This value can be passed to the constructor of QValueSpaceProvider to force the constructed
- value space provider to publish its values in the Non-Volatile Registry Layer.
+ This value can be passed to the constructor of QValueSpaceProvider or QValueSpaceSubscriber to
+ force the constructed object to only access the Non-Volatile Registry layer.
- You can test if the Non-Volatile Registry Layer is available by checking if the list returned
- by QValueSpace::availableLayers() contains this value. The Non-Volatile Registry Layer is only
+ You can test if the Non-Volatile Registry layer is available by checking if the list returned
+ by QValueSpace::availableLayers() contains this value. The Non-Volatile Registry layer is only
available on Windows platforms.
*/
@@ -428,13 +447,13 @@ void QValueSpace::installLayer(LayerCreateFunc func)
\macro QVALUESPACE_CONTEXTKIT_LAYER
\relates QValueSpace
- The UUID of the ContextKit Layer as a QUuid. The actual UUID values is
+ The UUID of the ContextKit layer as a QUuid. The actual UUID values is
{2c769b9e-d949-4cd1-848f-d32241fe07ff}.
- This values can be passed to the constructor of QValueSpaceProvider to force the constructed
- value space provider to publish its values in the ContextKit Layer.
+ This value can be passed to the constructor of QValueSpaceProvider or QValueSpaceSubscriber to
+ force the constructed object to only access the ContextKit layer.
- You can test if the ContextKit Layer is available by checking if the list returned by
+ You can test if the ContextKit layer is available by checking if the list returned by
QValueSpace::availableLayers() contains this value.
*/
diff --git a/src/publishsubscribe/qvaluespace.h b/src/publishsubscribe/qvaluespace.h
index e7d48e3aa6..8ad6786d6f 100644
--- a/src/publishsubscribe/qvaluespace.h
+++ b/src/publishsubscribe/qvaluespace.h
@@ -58,16 +58,16 @@ namespace QValueSpace {
NonPermanentLayer = 0x0002,
// UnspecifiedLayerPermanence = 0x0000,
// InvalidLayerPermanence = 0x0003,
- WriteableLayer = 0x0004,
- NonWriteableLayer = 0x0008,
+ WritableLayer = 0x0004,
+ NonWritableLayer = 0x0008,
// UnspecifiedLayerWriteability = 0x0000,
// InvalidLayerWriteability = 0x000C,
};
Q_DECLARE_FLAGS(LayerOptions, LayerOption);
- Q_CFW_EXPORT void initValueSpaceServer();
+ Q_PUBLISHSUBSCRIBE_EXPORT void initValueSpaceServer();
- Q_CFW_EXPORT QList<QUuid> availableLayers();
+ Q_PUBLISHSUBSCRIBE_EXPORT QList<QUuid> availableLayers();
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QValueSpace::LayerOptions);
diff --git a/src/publishsubscribe/qvaluespaceprovider.cpp b/src/publishsubscribe/qvaluespaceprovider.cpp
index e6e4b99abc..e35ea638a5 100644
--- a/src/publishsubscribe/qvaluespaceprovider.cpp
+++ b/src/publishsubscribe/qvaluespaceprovider.cpp
@@ -53,17 +53,20 @@ QTM_BEGIN_NAMESPACE
/*!
\class QValueSpaceProvider
- \brief The QValueSpaceProvider class allows applications to add entries to the Value Space.
+ \brief The QValueSpaceProvider class allows applications to publish values in the Value Space.
\ingroup publishsubscribe
- For an overview of the Qt Value Space, please see the QValueSpaceSubscriber documentation.
+ When multiple Value Space layers are available QValueSpaceProvider only publishes values to the
+ layer with the highest order. The layers that QValueSpaceProvider can access can be limited by
+ specifying either a \l {QValueSpace::LayerOption}{filter} or a QUuid at construction time.
- The QValueSpaceProvider class allows applications to write entries into the
- Value Space that are automatically removed when the QValueSpaceProvider is
- destroyed, or the application exits either cleanly or abnormally. All
- applications in the system will have access to the data set through
- QValueSpaceProvider and, if desired, can be notified when the data changes.
+ The lifetime of values published in the Value Space is specified by the particular Value Space
+ layer that the value is published in. For details on the different behaviors see
+ QValueSpace::LayerOption.
+
+ Once a value is published all applications in the system will have read access to it via the
+ QValueSpaceSubscriber class.
Although, logically, the Value Space is a simple collection of
hierarchical paths, these paths can conceptually be visualized as a set of
@@ -91,38 +94,13 @@ QTM_BEGIN_NAMESPACE
BytesReceived, Time} }. The QValueSpaceProvider class encapsulates this
abstraction.
- In the case of two or more applications creating an application object with
- overlapping attributes, only the first is visible to observers in the system.
- The other attributes are not discarded, but are buffered until the first
- releases its hold on the attribute, either by manually removing it, destroying
- the QValueSpaceProvider or by terminating. For example:
-
- \code
- QValueSpaceProvider *object1 = new QValueSpaceProvider("/Device");
- object1->setAttribute("Buttons", 2);
-
- // QValueSpaceSubscriber("/Device/Buttons").value() == QVariant(2)
-
- QValueSpaceProvider *object2 = new QValueSpaceProvider("/Device");
- object2->setAttribute("Buttons", 3);
-
- // QValueSpaceSubscriber("/Device/Buttons").value() == QVariant(2)
-
- object2->removeAttribute("Buttons");
- // QValueSpaceSubscriber("/Device/Buttons").value() == QVariant(3)
- \endcode
-
For performance reasons the setting of and removing of attributes is buffered
internally by the QValueSpaceProvider and applied as a batch sometime later.
Normally this occurs the next time the application enters the Qt event loop,
but this behavior should not be relied upon. If an application must
- synchronize application objects with others, the QValueSpaceProvider::sync()
- method can be used to force the application of changes. This call is
- generally unnecessary, and should be used sparingly to prevent unnecessary
- load on the system.
-
- \i {Note:} The QValueSpaceProvider class is not thread safe and may only be used from
- an application's main thread.
+ synchronize with others, the QValueSpaceProvider::sync() and QValueSpaceProvider::syncAll()
+ functions can be used to force the application of changes. This call is generally unnecessary,
+ and should be used sparingly to prevent unnecessary load on the system.
\sa QValueSpaceSubscriber
*/
@@ -159,8 +137,8 @@ QValueSpaceProviderPrivate::QValueSpaceProviderPrivate(const QString &_path,
if ((filter & QValueSpace::PermanentLayer &&
filter & QValueSpace::NonPermanentLayer) ||
- (filter & QValueSpace::WriteableLayer &&
- filter & QValueSpace::NonWriteableLayer)) {
+ (filter & QValueSpace::WritableLayer &&
+ filter & QValueSpace::NonWritableLayer)) {
return;
}
@@ -198,11 +176,8 @@ QValueSpaceProviderPrivate::QValueSpaceProviderPrivate(const QString &_path, con
}
/*!
- \overload
-
Constructs a QValueSpaceProvider with the specified \a parent that publishes values under
- \a path. This constructor is equivalent to calling
- \c {QValueSpaceSubscriber(path.toUtf8(), parent)}.
+ \a path.
*/
QValueSpaceProvider::QValueSpaceProvider(const QString &path, QObject *parent)
: QObject(parent), d(new QValueSpaceProviderPrivate(path))
@@ -215,7 +190,7 @@ QValueSpaceProvider::QValueSpaceProvider(const QString &path, QObject *parent)
Constructs a QValueSpaceProvider with the specified \a parent that publishes values under
\a path. This constructor is equivalent to calling
- \c {QValueSpaceSubscriber(QString(path), parent)}.
+ \c {QValueSpaceSubscriber(QString::fromLatin1(path), parent)}.
*/
QValueSpaceProvider::QValueSpaceProvider(const char *path, QObject *parent)
: QObject(parent), d(new QValueSpaceProviderPrivate(QString::fromLatin1(path)))
@@ -224,14 +199,11 @@ QValueSpaceProvider::QValueSpaceProvider(const char *path, QObject *parent)
}
/*!
- \overload
-
Constructs a QValueSpaceProvider with the specified \a parent that publishes values under
\a path. The \a filter parameter is used to limit which layer this QValueSpaceProvider will
- access. This constructor is equivalent to calling
- \c {QValueSpaceProvider(path.toUtf8(), filter, parent)}.
+ access.
- The constructed Value Space provier will access the \l {QAbstractValueSpaceLayer}{layer} with
+ The constructed Value Space provider will access the \l {QAbstractValueSpaceLayer}{layer} with
the highest \l {QAbstractValueSpaceLayer::order()}{order} that matches \a filter and for which
\a path is a valid path.
@@ -274,11 +246,8 @@ QValueSpaceProvider::QValueSpaceProvider(const char *path,
}
/*!
- \overload
-
Constructs a QValueSpaceProvider with the specified \a parent that publishes values under
- \a path. Only the layer identified by \a uuid will be accessed by this provider. This
- constructor is equivalent to calling \c {QValueSpaceProvider(path.toUtf8(), uuid, parent)}.
+ \a path. Only the layer identified by \a uuid will be accessed by this provider.
Use of this constructor is not platform agnostic. If possible use one of the constructors that
take a QAbstractValueSpaceLayer::LayerOptions parameter instead.
@@ -300,7 +269,8 @@ QValueSpaceProvider::QValueSpaceProvider(const QString &path, const QUuid &uuid,
Constructs a QValueSpaceProvider with the specified \a parent that publishes values under
\a path. Only the layer identified by \a uuid will be accessed by this provider. This
- constructor is equivalent to calling \c {QValueSpaceProvider(QString(path), uuid, parent)}.
+ constructor is equivalent to calling
+ \c {QValueSpaceProvider(QString::fromLatin1(path), uuid, parent)}.
Use of this constructor is not platform agnostic. If possible use one of the constructors that
take a QAbstractValueSpaceLayer::LayerOptions parameter instead.
@@ -317,7 +287,7 @@ QValueSpaceProvider::QValueSpaceProvider(const char *path, const QUuid &uuid, QO
}
/*!
- Destroys the QValueSpaceProvider. This will remove the values set by this provider in all
+ Destroys the QValueSpaceProvider. This will remove all values published by this provider in
\l {QValueSpace::NonPermanentLayer}{non-permanent} layers.
*/
QValueSpaceProvider::~QValueSpaceProvider()
@@ -353,6 +323,15 @@ bool QValueSpaceProvider::isConnected() const
/*!
Forcibly sync all Value Space providers using the same layer as this provider.
+
+ For performance reasons attribute changes are batched internally by QValueSpaceProvider
+ instances. In cases where the visibility of changes must be synchronized with other processes,
+ calling this function will flush these batches. By the time this function returns, all other
+ processes in the system will be able to see the attribute changes.
+
+ Generally, calling this function is unnecessary.
+
+ \sa syncAll()
*/
void QValueSpaceProvider::sync()
{
@@ -365,13 +344,9 @@ void QValueSpaceProvider::sync()
/*!
Forcibly sync all Value Space providers.
- For performance reasons attribute changes are batched internally by
- QValueSpaceProvider instances. In cases where the visibility of changes must
- be synchronized with other processes, calling QValueSpaceProvider::sync() will
- flush these batches. By the time syncAll() returns, all other processes in the
- system will be able to see the attribute changes.
+ This function is equivalent to calling sync() for all Value Space layers.
- In the common asynchronous case, calling syncAll() is unnecessary.
+ Generally, calling this function is unnecessary.
*/
void QValueSpaceProvider::syncAll()
{
@@ -380,7 +355,7 @@ void QValueSpaceProvider::syncAll()
}
/*!
- Set an \a attribute on the provider to \a data. If attribute is empty, this call will set the
+ Set \a attribute on the provider to \a data. If attribute is empty, this call will set the
value of this providers path.
For example:
@@ -408,7 +383,7 @@ void QValueSpaceProvider::setAttribute(const QString &attribute, const QVariant
\overload
This is a convenience overload and is equivalent to
- \c {setAttribute(QString(attribute), data)}.
+ \c {setAttribute(QString::fromLatin1(attribute), data)}.
*/
void QValueSpaceProvider::setAttribute(const char *attribute, const QVariant &data)
{
@@ -416,7 +391,7 @@ void QValueSpaceProvider::setAttribute(const char *attribute, const QVariant &da
}
/*!
- Removes the proivder \a attribute and all sub-attributes from the system.
+ Removes the provider \a attribute and all sub-attributes from the system.
For example:
\code
@@ -446,7 +421,8 @@ void QValueSpaceProvider::removeAttribute(const QString &attribute)
/*!
\overload
- This is a convenience overload and is equivalent to \c {removeAttribute(QString(attribute))}.
+ This is a convenience overload and is equivalent to
+ \c {removeAttribute(QString::fromLatin1(attribute))}.
*/
void QValueSpaceProvider::removeAttribute(const char *attribute)
{
diff --git a/src/publishsubscribe/qvaluespaceprovider.h b/src/publishsubscribe/qvaluespaceprovider.h
index 86f38754b3..f495ed6f55 100644
--- a/src/publishsubscribe/qvaluespaceprovider.h
+++ b/src/publishsubscribe/qvaluespaceprovider.h
@@ -53,7 +53,7 @@ QT_BEGIN_HEADER
QTM_BEGIN_NAMESPACE
class QValueSpaceProviderPrivate;
-class Q_CFW_EXPORT QValueSpaceProvider : public QObject
+class Q_PUBLISHSUBSCRIBE_EXPORT QValueSpaceProvider : public QObject
{
friend class QAbstractValueSpaceLayer;
diff --git a/src/publishsubscribe/qvaluespacesubscriber.cpp b/src/publishsubscribe/qvaluespacesubscriber.cpp
index 50c90c362b..afbd249f3c 100644
--- a/src/publishsubscribe/qvaluespacesubscriber.cpp
+++ b/src/publishsubscribe/qvaluespacesubscriber.cpp
@@ -54,17 +54,20 @@ QTM_BEGIN_NAMESPACE
/*!
\class QValueSpaceSubscriber
- \brief The QValueSpaceSubscriber class provides access to values stored in the Value Space.
+ \brief The QValueSpaceSubscriber class allows applications to read and subscribe to Value Space
+ paths.
\ingroup publishsubscribe
- The Value Space is an inter-application hierarchy of readable, writable and
- subscribable data. The QValueSpaceSubscriber class allows applications to read
- and subscribe to this data.
+ By default QValueSpaceSubscriber can read values from and report change notifications for all
+ available Value Space layers. Only data from the layer with the highest order and that
+ contains the specific key is returned by this class.
- Conceptually, the Value Space is a hierarchical tree of which each item can
- optionally contain a QVariant value and sub-items. A serialized version of a
- simple example might look like this.
+ The layers that QValueSpaceSubscriber accesses can be limited by specifying either a
+ \l {QValueSpace::LayerOptions}{filter} or a QUuid at construction time.
+
+ Applications subscribe to a particular path in the Value Space. If anything under that path
+ changes the contextChanged() signal is emitted. For example given the schema:
\code
/Device/Buttons = 3
@@ -76,68 +79,25 @@ QTM_BEGIN_NAMESPACE
/Device/Buttons/3/Usable = true
\endcode
- Any application in Qt can read values from the Value Space, or be notified
- asynchronously when they change using the QValueSpaceSubscriber class.
-
- Items in the Value Space can be thought of as representing "objects" adhering
- to a well known schema. This is a conceptual differentiation, not a physical
- one, as internally the Value Space is treated as one large tree. In the
- sample above, the \c {/Device/Buttons} schema can be defined as containing a
- value representing the number of mappable buttons on a device, and a sub-item
- for each. Likewise, the sub-item object schema contains two attributes -
- \c {Name} and \c {Usable}.
-
- Applications may use the QValueSpaceProvider class to create a schema object
- within the Value Space. Objects remain in the Value Space as long as the
- QValueSpaceProvider instance exists - that is, they are not persistent. If
- the object is destroyed, or the application containing it exits (or crashes)
- the items are removed.
-
- Change notification is modeled in a similar way. Applications subscribe to notifications at a
- particular path in the tree. If anything under that path changes, the application is notified.
- This allows, for example, subscription to just the \c {/Device/Buttons} item to receive
- notification when anything "button" related changes.
-
- For example,
-
- \code
- QValueSpaceSubscriber *buttons = new QValueSpaceSubscriber("/Device/Buttons");
- qWarning() << "There are" << buttons->value().toUInt() << "buttons";
- QObject::connect(buttons, SIGNAL(contentsChanged()),
- this, SLOT(buttonInfoChanged()));
- \endcode
-
- will invoke the \c {buttonInfoChanged()} slot whenever any values under
- \c {/Device/Buttons} changes. This includes the value of \c {/Device/Buttons}
- itself, a change of a sub-object such as \c {/Device/Buttons/2/Name} or the
- creation (or removal) of a new sub-object, such as \c {/Device/Buttons/4}.
-
- When a QValueSpaceSubscriber is constructed it will access zero, one or many
- \l {QAbstractValueSpaceLayer}{layers}, depending on the constructor and filter parameters used
- to construct it. Calls to value() will return the value that is stored in the layer with the
- highest \l {QAbstractValueSpaceLayer::order()}{order} of all the accessible layers that contain
- the specified key.
-
- For example,
+ The code:
\code
- QValueSpaceSubscriber *buttons = new QValueSpaceSubscriber("/Device/Buttons",
- QAbstractValueSpaceLayer::NonPermanentLayer);
- qWarning() << "There are" << buttons->value().toUInt() << "buttons";
+ QValueSpaceSubscriber *buttons = new QValueSpaceSubscriber("/Device/Buttons");
+ QObject::connect(buttons, SIGNAL(contentsChanged()), this, SLOT(buttonInfoChanged()));
\endcode
- will print out the number of buttons defined in all non-permanent layers. If the same button
- is defined in multiple non-permanent layers only the values from the layer with the highest
- \l {QAbstractValueSpaceLayer::order()}{order} will be visible.
-
- \i {Note:} The QValueSpaceSubscriber class is not thread safe and may only be used from
- an application's main thread.
+ will invoke the \c {buttonInfoChanged()} slot whenever any value under \c {/Device/Buttons}
+ changes. This includes the value of \c {/Device/Buttons} itself, a change of a subpath such as
+ \c {/Device/Buttons/2/Name} or the creation or removal of a subpath.
*/
/*!
\fn QValueSpaceSubscriber::contentsChanged()
- Emitted whenever any value under this subscriber path changes.
+ Emitted whenever any value under the current path changes.
+
+ \bold {Note:} that if a value changes multiple times in quick succession, only the most recent
+ value may be accessible via the value() function.
*/
/*!
@@ -211,8 +171,8 @@ static LayerList matchLayers(const QString &path, QValueSpace::LayerOptions filt
// Invalid filter combination.
if ((filter & QValueSpace::PermanentLayer &&
filter & QValueSpace::NonPermanentLayer) ||
- (filter & QValueSpace::WriteableLayer &&
- filter & QValueSpace::NonWriteableLayer)) {
+ (filter & QValueSpace::WritableLayer &&
+ filter & QValueSpace::NonWritableLayer)) {
return list;
}
@@ -346,10 +306,7 @@ QValueSpaceSubscriber::QValueSpaceSubscriber(QObject *parent)
}
/*!
- \overload
-
- Constructs a QValueSpaceSubscriber with the specified \a parent that refers to \a path. This
- constructor is equivalent to calling \c {QValueSpaceSubscriber(path.toUtf8(), parent)}.
+ Constructs a QValueSpaceSubscriber with the specified \a parent that refers to \a path.
The constructed Value Space subscriber will access all available
\l {QAbstractValueSpaceLayer}{layers}.
@@ -364,7 +321,8 @@ QValueSpaceSubscriber::QValueSpaceSubscriber(const QString &path, QObject *paren
\overload
Constructs a QValueSpaceSubscriber with the specified \a parent that refers to \a path. This
- constructor is equivalent to calling \c {QValueSpaceSubscriber(QString(path), parent)}.
+ constructor is equivalent to calling
+ \c {QValueSpaceSubscriber(QString::fromLatin1(path), parent)}.
The constructed Value Space subscriber will access all available
\l {QAbstractValueSpaceLayer}{layers}.
@@ -376,11 +334,8 @@ QValueSpaceSubscriber::QValueSpaceSubscriber(const char *path, QObject *parent)
}
/*!
- \overload
-
Constructs a QValueSpaceSubscriber with the specified \a parent that refers to \a path. The
- \a filter parameter is used to limit which layers this QValueSpaceSubscriber will access. This
- constructor is equivalent to calling \c {QValueSpaceSubscriber(path.toUtf8(), filter, parent)}.
+ \a filter parameter is used to limit which layers this QValueSpaceSubscriber will access.
If a layer matching \a filter is not found, the constructed QValueSpaceSubscriber will be
unconnected.
@@ -400,7 +355,8 @@ QValueSpaceSubscriber::QValueSpaceSubscriber(const QString &path,
Constructs a QValueSpaceSubscriber with the specified \a parent that refers to \a path. The
\a filter parameter is used to limit which layers this QValueSpaceSubscriber will access. This
- constructor is equivalent to calling \c {QValueSpaceSubscriber(QString(path), filter, parent)}.
+ constructor is equivalent to calling
+ \c {QValueSpaceSubscriber(QString::fromLatin1(path), filter, parent)}.
If a layer matching \a filter is not found, the constructed QValueSpaceSubscriber will be
unconnected.
@@ -416,11 +372,8 @@ QValueSpaceSubscriber::QValueSpaceSubscriber(const char *path,
}
/*!
- \overload
-
Constructs a QValueSpaceSubscriber with the specified \a parent that refers to \a path. This
- QValueSpaceSubscriber will only use the layer identified by \a uuid. This constructor is
- equivalent to calling \c {QValueSpaceSubscriber(path.toUtf8(), uuid, parent)}.
+ QValueSpaceSubscriber will only use the layer identified by \a uuid.
Use of this constructor is not platform agnostic. If possible use one of the constructors that
take a QAbstractValueSpaceLayer::LayerOptions parameter instead.
@@ -443,7 +396,7 @@ QValueSpaceSubscriber::QValueSpaceSubscriber(const QString &path,
Constructs a QValueSpaceSubscriber with the specified \a parent that refers to \a path. This
QValueSpaceSubscriber will only use the layer identified by \a uuid. This constructor is
- equivalent to calling \c {QValueSpaceSubscriber(QString(path), uuid, parent)}.
+ equivalent to calling \c {QValueSpaceSubscriber(QString::fromLatin1(path), uuid, parent)}.
Use of this constructor is not platform agnostic. If possible use one of the constructors that
take a QAbstractValueSpaceLayer::LayerOptions parameter instead.
@@ -460,7 +413,7 @@ QValueSpaceSubscriber::QValueSpaceSubscriber(const char *path, const QUuid &uuid
}
/*!
- Destroys the QValueSpaceSubscriber
+ Destroys the QValueSpaceSubscriber.
*/
QValueSpaceSubscriber::~QValueSpaceSubscriber()
{
@@ -491,7 +444,7 @@ void QValueSpaceSubscriber::setPath(const QString &path)
Sets the path to the same path as \a subscriber.
Calling this function causes the QValueSpaceSubscriber to disconnect and reconnect to the value
- space with the a path.
+ space with the specified \a path.
Calling this function disconnects all signal/slot connections.
*/
@@ -510,7 +463,8 @@ QString QValueSpaceSubscriber::path() const
}
/*!
- Changes the path to \a path.
+ Changes the path to the absolute path if \a path starts with a '/'; otherwise changes to the
+ sub path of the current path.
*/
void QValueSpaceSubscriber::cd(const QString &path)
{
diff --git a/src/publishsubscribe/qvaluespacesubscriber.h b/src/publishsubscribe/qvaluespacesubscriber.h
index f34f6cb292..fb1a05997a 100644
--- a/src/publishsubscribe/qvaluespacesubscriber.h
+++ b/src/publishsubscribe/qvaluespacesubscriber.h
@@ -56,7 +56,7 @@ QTM_BEGIN_NAMESPACE
class QValueSpaceSubscriberPrivate;
-class Q_CFW_EXPORT QValueSpaceSubscriber : public QObject
+class Q_PUBLISHSUBSCRIBE_EXPORT QValueSpaceSubscriber : public QObject
{
Q_OBJECT
diff --git a/src/publishsubscribe/registrylayer_win.cpp b/src/publishsubscribe/registrylayer_win.cpp
index b90fb870c7..a979d54189 100644
--- a/src/publishsubscribe/registrylayer_win.cpp
+++ b/src/publishsubscribe/registrylayer_win.cpp
@@ -220,7 +220,10 @@ private:
QMap<RegistryHandle *, HKEY> hKeys;
QMultiMap<RegistryHandle *, RegistryHandle *> notifyProxies;
- QMap<HKEY, QPair<::HANDLE, ::HANDLE> > waitHandles;
+ // MinGW complains about QPair<::HANDLE, ::HANDLE>
+ typedef ::HANDLE HandleType;
+ typedef QPair<HandleType, HandleType> HandlePair;
+ QMap<HKEY, HandlePair > waitHandles;
#ifdef Q_OS_WINCE
QWindowsCENotify *notifyThread;
#endif
@@ -337,7 +340,7 @@ unsigned int VolatileRegistryLayer::order()
QValueSpace::LayerOptions VolatileRegistryLayer::layerOptions() const
{
- return QValueSpace::NonPermanentLayer | QValueSpace::WriteableLayer;
+ return QValueSpace::NonPermanentLayer | QValueSpace::WritableLayer;
}
VolatileRegistryLayer *VolatileRegistryLayer::instance()
@@ -373,7 +376,7 @@ unsigned int NonVolatileRegistryLayer::order()
QValueSpace::LayerOptions NonVolatileRegistryLayer::layerOptions() const
{
- return QValueSpace::PermanentLayer | QValueSpace::WriteableLayer;
+ return QValueSpace::PermanentLayer | QValueSpace::WritableLayer;
}
NonVolatileRegistryLayer *NonVolatileRegistryLayer::instance()
@@ -387,8 +390,9 @@ RegistryLayer::RegistryLayer(const QString &basePath, bool volatileKeys, Registr
{
// Ensure that the m_basePath key exists and is non-volatile.
HKEY key;
- RegCreateKeyEx(HKEY_CURRENT_USER, qConvertPath(m_basePath).utf16(),
- 0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &key, 0);
+ RegCreateKeyEx(HKEY_CURRENT_USER,
+ reinterpret_cast<const wchar_t*>(qConvertPath(m_basePath).utf16()),
+ 0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &key, 0);
RegCloseKey(key);
@@ -479,7 +483,8 @@ bool RegistryLayer::value(Handle handle, const QString &subPath, QVariant *data)
HKEY key = hKeys.value(rh);
DWORD regSize = 0;
- long result = RegQueryValueEx(key, value.utf16(), 0, 0, 0, &regSize);
+ long result = RegQueryValueEx(key,
+ reinterpret_cast<const wchar_t*>(value.utf16()), 0, 0, 0, &regSize);
if (result == ERROR_FILE_NOT_FOUND) {
*data = QVariant();
if (createdHandle)
@@ -495,7 +500,9 @@ bool RegistryLayer::value(Handle handle, const QString &subPath, QVariant *data)
BYTE *regData = new BYTE[regSize];
DWORD regType;
- result = RegQueryValueEx(key, value.utf16(), 0, &regType, regData, &regSize);
+ result = RegQueryValueEx(key,
+ reinterpret_cast<const wchar_t*>(value.utf16()),
+ 0, &regType, regData, &regSize);
if (result != ERROR_SUCCESS) {
qDebug() << "real RegQueryValueEx failed with error" << result;
if (createdHandle)
@@ -709,7 +716,8 @@ void RegistryLayer::setProperty(Handle handle, Properties properties)
return;
}
- waitHandles.insert(key, QPair<::HANDLE, ::HANDLE>(event, waitHandle));
+ //waitHandles.insert(key, QPair<::HANDLE, ::HANDLE>(event, waitHandle));
+ waitHandles.insert(key, HandlePair(event, waitHandle));
#endif
}
if (!(properties & QAbstractValueSpaceLayer::Publish)) {
@@ -720,7 +728,8 @@ void RegistryLayer::setProperty(Handle handle, Properties properties)
HKEY key = hKeys.value(rh);
if (waitHandles.contains(key)) {
- QPair<::HANDLE, ::HANDLE> wait = waitHandles.take(key);
+ //QPair<::HANDLE, ::HANDLE> wait = waitHandles.take(key);
+ HandlePair wait = waitHandles.take(key);
#ifdef Q_OS_WINCE
notifyThread->removeHandle(wait.first);
@@ -771,7 +780,8 @@ void RegistryLayer::closeRegistryKey(RegistryHandle *handle)
return;
if (waitHandles.contains(key)) {
- QPair<::HANDLE, ::HANDLE> wait = waitHandles.take(key);
+ //QPair<::HANDLE, ::HANDLE> wait = waitHandles.take(key);
+ HandlePair wait = waitHandles.take(key);
#ifdef Q_OS_WINCE
notifyThread->removeHandle(wait.first);
@@ -870,9 +880,9 @@ bool RegistryLayer::removeRegistryValue(RegistryHandle *handle, const QString &s
HKEY key = hKeys.value(rh);
- long result = RegDeleteValue(key, value.utf16());
+ long result = RegDeleteValue(key, reinterpret_cast<const wchar_t*>(value.utf16()));
if (result == ERROR_FILE_NOT_FOUND) {
- result = qRegDeleteTree(key, value.utf16());
+ result = qRegDeleteTree(key, reinterpret_cast<const wchar_t*>(value.utf16()));
if (result == ERROR_SUCCESS) {
const QString rootPath = rh->path;
@@ -1015,7 +1025,8 @@ bool RegistryLayer::setValue(QValueSpaceProvider *creator, Handle handle, const
}
};
- long result = RegSetValueEx(key, value.utf16(), 0, regType, regData, regSize);
+ long result = RegSetValueEx(key, reinterpret_cast<const wchar_t*>(value.utf16()),
+ 0, regType, regData, regSize);
QString fullPath(rh->path);
if (fullPath != QLatin1String("/"))
@@ -1069,7 +1080,8 @@ void RegistryLayer::emitHandleChanged(void *k)
QList<RegistryHandle *> changedHandles = hKeys.keys(key);
if (changedHandles.isEmpty()) {
if (waitHandles.contains(key)) {
- QPair<::HANDLE, ::HANDLE> wait = waitHandles.take(key);
+ //QPair<::HANDLE, ::HANDLE> wait = waitHandles.take(key);
+ HandlePair wait = waitHandles.take(key);
#ifdef Q_OS_WINCE
notifyThread->removeHandle(wait.first);
@@ -1099,7 +1111,8 @@ void RegistryLayer::emitHandleChanged(void *k)
}
if (waitHandles.contains(key)) {
- QPair<::HANDLE, ::HANDLE> wait = waitHandles.take(key);
+ //QPair<::HANDLE, ::HANDLE> wait = waitHandles.take(key);
+ HandlePair wait = waitHandles.take(key);
::HANDLE event = wait.first;
@@ -1168,7 +1181,8 @@ void RegistryLayer::emitHandleChanged(void *k)
return;
}
- waitHandles.insert(key, QPair<::HANDLE, ::HANDLE>(event, waitHandle));
+ //waitHandles.insert(key, QPair<::HANDLE, ::HANDLE>(event, waitHandle));
+ waitHandles.insert(key, HandlePair(event, waitHandle));
#endif
}
}
@@ -1200,8 +1214,9 @@ void RegistryLayer::openRegistryKey(RegistryHandle *handle)
// Attempt to open registry key path
HKEY key;
- long result = RegOpenKeyEx(HKEY_CURRENT_USER, fullPath.utf16(),
- 0, KEY_ALL_ACCESS, &key);
+ long result = RegOpenKeyEx(HKEY_CURRENT_USER,
+ reinterpret_cast<const wchar_t*>(fullPath.utf16()),
+ 0, KEY_ALL_ACCESS, &key);
if (result == ERROR_SUCCESS) {
hKeys.insert(handle, key);
@@ -1249,7 +1264,8 @@ bool RegistryLayer::createRegistryKey(RegistryHandle *handle)
// Attempt to open registry key path
HKEY key;
DWORD disposition;
- long result = RegCreateKeyEx(HKEY_CURRENT_USER, fullPath.utf16(),
+ long result = RegCreateKeyEx(HKEY_CURRENT_USER,
+ reinterpret_cast<const wchar_t*>(fullPath.utf16()),
0, 0,
(m_volatileKeys ? REG_OPTION_VOLATILE : REG_OPTION_NON_VOLATILE),
KEY_ALL_ACCESS, 0, &key, &disposition);
@@ -1320,7 +1336,7 @@ void RegistryLayer::pruneEmptyKeys(RegistryHandle *handle)
HKEY key = hKeys.value(rh);
- long result = RegDeleteKey(key, value.utf16());
+ long result = RegDeleteKey(key, reinterpret_cast<const wchar_t*>(value.utf16()));
if (result == ERROR_SUCCESS) {
QList<QString> paths = handles.keys();
while (!paths.isEmpty()) {
diff --git a/src/publishsubscribe/sharedmemorylayer.cpp b/src/publishsubscribe/sharedmemorylayer.cpp
index fe59c9ebdf..b7de66809c 100644
--- a/src/publishsubscribe/sharedmemorylayer.cpp
+++ b/src/publishsubscribe/sharedmemorylayer.cpp
@@ -1926,7 +1926,7 @@ bool SharedMemoryLayer::startup(Type type)
//qDebug() << "Reattaching to existing memory";
shm->attach();
}
- lock = new QSystemReadWriteLock(socket(), QSystemReadWriteLock::Create);
+ lock = new QSystemReadWriteLock(socket() + "_lock", QSystemReadWriteLock::Create);
} else {
shm = new QSharedMemory(socket(), this);
shm->attach(QSharedMemory::ReadOnly);
@@ -1937,7 +1937,7 @@ bool SharedMemoryLayer::startup(Type type)
<< subShm->errorString() << subShm->key();
}
- lock = new QSystemReadWriteLock(socket(), QSystemReadWriteLock::Open);
+ lock = new QSystemReadWriteLock(socket() + "_lock", QSystemReadWriteLock::Open);
}
if (shm->error() != QSharedMemory::NoError ||
@@ -2512,7 +2512,7 @@ QSet<QString> SharedMemoryLayer::children(Handle handle)
QValueSpace::LayerOptions SharedMemoryLayer::layerOptions() const
{
- return QValueSpace::NonPermanentLayer | QValueSpace::WriteableLayer;
+ return QValueSpace::NonPermanentLayer | QValueSpace::WritableLayer;
}
SharedMemoryLayer::Handle SharedMemoryLayer::item(Handle parent, const QString &key)
@@ -3301,14 +3301,10 @@ bool SharedMemoryLayer::setValue(QValueSpaceProvider *creator, Handle handle, co
owner.data2 = reinterpret_cast<unsigned long>(creator);
QByteArray fullPath(readHandle->path);
- if (!fullPath.endsWith('/'))
+ if (!fullPath.endsWith('/') && path != QLatin1String("/"))
fullPath.append('/');
- int index = 0;
- while (index < path.length() && path[index] == QLatin1Char('/'))
- ++index;
-
- fullPath.append(path.mid(index));
+ fullPath.append(path.mid(1));
return setItem(owner, fullPath, data);
}
diff --git a/src/src.pro b/src/src.pro
index 2af7908023..90e4f44afa 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -2,8 +2,12 @@ include($$QT_MOBILITY_BUILD_TREE/config.pri)
TEMPLATE = subdirs
SUBDIRS += global serviceframework
-symbian:SUBDIRS += serviceframework/symbian/dll/databasemanagerserver_dll.pro \
- serviceframework/symbian/exe/databasemanagerserver_exe.pro
+symbian {
+ SUBDIRS = serviceframework/symbian/dll/databasemanagerserver_dll.pro \
+ serviceframework/symbian/exe/databasemanagerserver_exe.pro \
+ $$SUBDIRS
+ CONFIG += ordered
+}
SUBDIRS += bearer location contacts multimedia publishsubscribe systeminfo
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 4a6e8afbfd..9198ae0680 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -82,10 +82,6 @@ SUBDIRS += \ #Multimedia
qradiotuner \
qvideowidget
-# This causes X11 to crash in some places.
-# Remove it until it can be debugged manually
-linux*:SUBDIRS -= qvideowidget
-
contains(QT_CONFIG, multimedia) {
SUBDIRS += \
qgraphicsvideoitem \
diff --git a/tests/auto/databasemanager/tst_databasemanager.cpp b/tests/auto/databasemanager/tst_databasemanager.cpp
index ba4e13288a..3b562f7e97 100644
--- a/tests/auto/databasemanager/tst_databasemanager.cpp
+++ b/tests/auto/databasemanager/tst_databasemanager.cpp
@@ -50,7 +50,7 @@
# define TESTDATA_DIR "."
#endif
-class DatabaseManagerUnitTest: public QObject
+class tst_DatabaseManager: public QObject
{
Q_OBJECT
private slots:
@@ -93,14 +93,14 @@ private:
QDir m_testdir;
};
-void DatabaseManagerUnitTest::initTestCase()
+void tst_DatabaseManager::initTestCase()
{
QSfwTestUtil::setupTempUserDb();
QSfwTestUtil::setupTempSystemDb();
m_dbm = new DatabaseManager;
}
-void DatabaseManagerUnitTest::registerService()
+void tst_DatabaseManager::registerService()
{
m_testdir = QDir(TESTDATA_DIR "/testdata");
ServiceMetaData parser("");
@@ -133,7 +133,7 @@ void DatabaseManagerUnitTest::registerService()
}
}
-void DatabaseManagerUnitTest::getInterfaces()
+void tst_DatabaseManager::getInterfaces()
{
QString iface("com.omni.device.accelerometer");
QServiceFilter filter(iface);
@@ -203,7 +203,7 @@ void DatabaseManagerUnitTest::getInterfaces()
QCOMPARE(m_dbm->lastError().code(), DBError::NoError);
}
-void DatabaseManagerUnitTest::getServiceNames()
+void tst_DatabaseManager::getServiceNames()
{
//try getting a lost of service names only in user database
QStringList serviceNames;
@@ -241,7 +241,7 @@ void DatabaseManagerUnitTest::getServiceNames()
QVERIFY(serviceNames.contains(expectedName, Qt::CaseInsensitive));
}
-void DatabaseManagerUnitTest::defaultService()
+void tst_DatabaseManager::defaultService()
{
QServiceInterfaceDescriptor descriptor;
@@ -367,7 +367,7 @@ void DatabaseManagerUnitTest::defaultService()
QCOMPARE(m_dbm->lastError().code(), DBError::NotFound);
}
-void DatabaseManagerUnitTest::unregisterService()
+void tst_DatabaseManager::unregisterService()
{
//try remove a service that only exists in the user database
QServiceFilter filter;
@@ -418,7 +418,7 @@ void DatabaseManagerUnitTest::unregisterService()
clean();
}
-bool DatabaseManagerUnitTest::compareDescriptor(QServiceInterfaceDescriptor interface,
+bool tst_DatabaseManager::compareDescriptor(QServiceInterfaceDescriptor interface,
QString interfaceName, QString serviceName, int majorVersion, int minorVersion)
{
if (interface.d == NULL )
@@ -429,7 +429,7 @@ bool DatabaseManagerUnitTest::compareDescriptor(QServiceInterfaceDescriptor inte
QStringList());
}
-bool DatabaseManagerUnitTest::compareDescriptor(QServiceInterfaceDescriptor interface,
+bool tst_DatabaseManager::compareDescriptor(QServiceInterfaceDescriptor interface,
QString interfaceName, QString serviceName, int majorVersion, int minorVersion,
QStringList capabilities, QString filePath, QString serviceDescription,
QString interfaceDescription)
@@ -505,7 +505,7 @@ bool DatabaseManagerUnitTest::compareDescriptor(QServiceInterfaceDescriptor inte
return true;
}
#ifdef Q_OS_UNIX
-void DatabaseManagerUnitTest::permissions()
+void tst_DatabaseManager::permissions()
{
ServiceMetaDataResults results;
//try create a user scope database with no permissions
@@ -619,7 +619,7 @@ void DatabaseManagerUnitTest::permissions()
clean();
}
-void DatabaseManagerUnitTest::onlyUserDbAvailable()
+void tst_DatabaseManager::onlyUserDbAvailable()
{
QString userNokiaDir = QSfwTestUtil::userDirectory() + "/Nokia/";
QString systemNokiaDir = QSfwTestUtil::systemDirectory() + "/Nokia/";
@@ -747,7 +747,7 @@ void DatabaseManagerUnitTest::onlyUserDbAvailable()
clean();
}
-void DatabaseManagerUnitTest::defaultServiceCornerCases()
+void tst_DatabaseManager::defaultServiceCornerCases()
{
m_dbm = new DatabaseManager;
ServiceMetaData parser("");
@@ -998,7 +998,7 @@ void DatabaseManagerUnitTest::defaultServiceCornerCases()
}
#endif
-void DatabaseManagerUnitTest::nonWritableSystemDb()
+void tst_DatabaseManager::nonWritableSystemDb()
{
m_dbm = new DatabaseManager;
ServiceMetaData parser("");
@@ -1201,7 +1201,7 @@ void DatabaseManagerUnitTest::nonWritableSystemDb()
clean();
}
-void DatabaseManagerUnitTest::CWRTXmlCompatability()
+void tst_DatabaseManager::CWRTXmlCompatability()
{
m_dbm = new DatabaseManager;
ServiceMetaData parser("");
@@ -1247,7 +1247,7 @@ void DatabaseManagerUnitTest::CWRTXmlCompatability()
QVERIFY(compareDescriptor(descriptors[2], "com.nokia.ILocation", "TestService2", 1,2));
}
-void DatabaseManagerUnitTest::modifyPermissionSet(QFile::Permissions &permsSet,
+void tst_DatabaseManager::modifyPermissionSet(QFile::Permissions &permsSet,
int perm)
{
switch(perm) {
@@ -1292,7 +1292,7 @@ void DatabaseManagerUnitTest::modifyPermissionSet(QFile::Permissions &permsSet,
}
}
-void DatabaseManagerUnitTest::clean()
+void tst_DatabaseManager::clean()
{
if (m_dbm != 0 ) {
delete m_dbm;
@@ -1302,12 +1302,12 @@ void DatabaseManagerUnitTest::clean()
QSfwTestUtil::removeDirectory(QSfwTestUtil::tempSettingsPath());
}
-void DatabaseManagerUnitTest::cleanupTestCase()
+void tst_DatabaseManager::cleanupTestCase()
{
clean();
}
-QTEST_MAIN(DatabaseManagerUnitTest)
+QTEST_MAIN(tst_DatabaseManager)
#include "tst_databasemanager.moc"
diff --git a/tests/auto/databasemanager/tst_databasemanager_s60.cpp b/tests/auto/databasemanager/tst_databasemanager_s60.cpp
index 88cf325689..27ee889905 100644
--- a/tests/auto/databasemanager/tst_databasemanager_s60.cpp
+++ b/tests/auto/databasemanager/tst_databasemanager_s60.cpp
@@ -48,7 +48,7 @@
#include "servicemetadata_p.h"
#include "databasemanager_s60_p.h"
-class DatabaseManagerUnitTest: public QObject
+class tst_DatabaseManager: public QObject
{
Q_OBJECT
private slots:
@@ -86,7 +86,7 @@ private:
QDir m_testdir;
};
-void DatabaseManagerUnitTest::initTestCase()
+void tst_DatabaseManager::initTestCase()
{
#if defined(Q_OS_SYMBIAN) && !defined(__WINS__)
QSfwTestUtil::removeDatabases();
@@ -94,7 +94,7 @@ void DatabaseManagerUnitTest::initTestCase()
m_dbm = new DatabaseManager;
}
-void DatabaseManagerUnitTest::registerService()
+void tst_DatabaseManager::registerService()
{
m_testdir = QDir(QDir::currentPath() + "/testdata");
ServiceMetaData parser("");
@@ -128,7 +128,7 @@ void DatabaseManagerUnitTest::registerService()
}
}
-void DatabaseManagerUnitTest::getInterfaces()
+void tst_DatabaseManager::getInterfaces()
{
QString iface("com.omni.device.accelerometer");
QServiceFilter filter(iface);
@@ -198,7 +198,7 @@ void DatabaseManagerUnitTest::getInterfaces()
QCOMPARE(m_dbm->lastError().code(), DBError::NoError);
}
-void DatabaseManagerUnitTest::getServiceNames()
+void tst_DatabaseManager::getServiceNames()
{
//try getting a lost of service names only in user database
QStringList serviceNames;
@@ -236,7 +236,7 @@ void DatabaseManagerUnitTest::getServiceNames()
QVERIFY(serviceNames.contains(expectedName, Qt::CaseInsensitive));
}
-void DatabaseManagerUnitTest::defaultService()
+void tst_DatabaseManager::defaultService()
{
QServiceInterfaceDescriptor descriptor;
@@ -362,7 +362,7 @@ void DatabaseManagerUnitTest::defaultService()
QCOMPARE(m_dbm->lastError().code(), DBError::NotFound);
}
-void DatabaseManagerUnitTest::unregisterService()
+void tst_DatabaseManager::unregisterService()
{
//try remove a service that only exists in the user database
QServiceFilter filter;
@@ -415,7 +415,7 @@ void DatabaseManagerUnitTest::unregisterService()
#endif
}
-bool DatabaseManagerUnitTest::compareDescriptor(QServiceInterfaceDescriptor interface,
+bool tst_DatabaseManager::compareDescriptor(QServiceInterfaceDescriptor interface,
QString interfaceName, QString serviceName, int majorVersion, int minorVersion)
{
@@ -427,7 +427,7 @@ bool DatabaseManagerUnitTest::compareDescriptor(QServiceInterfaceDescriptor inte
QStringList());
}
-bool DatabaseManagerUnitTest::compareDescriptor(QServiceInterfaceDescriptor interface,
+bool tst_DatabaseManager::compareDescriptor(QServiceInterfaceDescriptor interface,
QString interfaceName, QString serviceName, int majorVersion, int minorVersion,
QStringList capabilities, QString filePath, QString serviceDescription,
QString interfaceDescription)
@@ -503,7 +503,7 @@ bool DatabaseManagerUnitTest::compareDescriptor(QServiceInterfaceDescriptor inte
return true;
}
-void DatabaseManagerUnitTest::CWRTXmlCompatability()
+void tst_DatabaseManager::CWRTXmlCompatability()
{
if (m_dbm != 0 ) {
delete m_dbm;
@@ -554,7 +554,7 @@ void DatabaseManagerUnitTest::CWRTXmlCompatability()
}
-void DatabaseManagerUnitTest::modifyPermissionSet(QFile::Permissions &permsSet,
+void tst_DatabaseManager::modifyPermissionSet(QFile::Permissions &permsSet,
int perm)
{
@@ -600,14 +600,14 @@ void DatabaseManagerUnitTest::modifyPermissionSet(QFile::Permissions &permsSet,
}
}
-void DatabaseManagerUnitTest::cleanupTestCase()
+void tst_DatabaseManager::cleanupTestCase()
{
#if defined(Q_OS_SYMBIAN) && !defined(__WINS__)
QSfwTestUtil::removeDatabases();
#endif
}
-QTEST_MAIN(DatabaseManagerUnitTest)
+QTEST_MAIN(tst_DatabaseManager)
#include "tst_databasemanager_s60.moc"
diff --git a/tests/auto/qaudiocapturesource/tst_qaudiocapturesource.cpp b/tests/auto/qaudiocapturesource/tst_qaudiocapturesource.cpp
index 0bdb9e126c..3e59193796 100644
--- a/tests/auto/qaudiocapturesource/tst_qaudiocapturesource.cpp
+++ b/tests/auto/qaudiocapturesource/tst_qaudiocapturesource.cpp
@@ -76,8 +76,8 @@ public:
QVariant encodingOption(const QString &, const QString &) const { return m_optionValue; }
void setEncodingOption(const QString &, const QString &, const QVariant &value) { m_optionValue = value; }
- QList<int> supportedSampleRates() const { return m_freqs; }
- QList<int> supportedChannelCounts() const { QList<int> list; list << 1 << 2; return list; }
+ QList<int> supportedSampleRates(const QAudioEncoderSettings & = QAudioEncoderSettings()) const { return m_freqs; }
+ QList<int> supportedChannelCounts(const QAudioEncoderSettings & = QAudioEncoderSettings()) const { QList<int> list; list << 1 << 2; return list; }
QAudioEncoderSettings audioSettings() const { return m_audioSettings; }
void setAudioSettings(const QAudioEncoderSettings &settings) { m_audioSettings = settings;}
diff --git a/tests/auto/qcamera/tst_qcamera.cpp b/tests/auto/qcamera/tst_qcamera.cpp
index bfe71f3be4..1eff7e8544 100644
--- a/tests/auto/qcamera/tst_qcamera.cpp
+++ b/tests/auto/qcamera/tst_qcamera.cpp
@@ -94,7 +94,7 @@ public:
emit imageCaptured(fileName, QImage());
else
m_cameraControl->error(QCamera::NotReadyToCaptureError,
- QLatin1String("Cou;d not capture in stopped state"));
+ QLatin1String("Could not capture in stopped state"));
}
MockCameraControl *m_cameraControl;
@@ -435,11 +435,23 @@ public:
{
}
- QSize minimumResolution() const { return m_minimumResolution; }
+ QSize minimumResolution(const QImageEncoderSettings & = QImageEncoderSettings()) const
+ {
+ return m_minimumResolution;
+ }
void setMinimumResolution(const QSize &resolution) { m_minimumResolution = resolution; }
- QSize maximumResolution() const { return m_maximumResolution; }
+
+ QSize maximumResolution(const QImageEncoderSettings & = QImageEncoderSettings()) const
+ {
+ return m_maximumResolution;
+ }
void setMaximumResolution(const QSize &resolution) { m_maximumResolution = resolution; }
- QList<QSize> supportedResolutions() const { return m_supportedResolutions; }
+
+ QList<QSize> supportedResolutions(const QImageEncoderSettings & = QImageEncoderSettings()) const
+ {
+ return m_supportedResolutions;
+ }
+
void setSupportedResolutions(const QList<QSize> &resolutions) {
m_supportedResolutions = resolutions; }
diff --git a/tests/auto/qmediaimageviewer/qmediaimageviewer.pro b/tests/auto/qmediaimageviewer/qmediaimageviewer.pro
index 91cfc4e8d0..c523af2204 100644
--- a/tests/auto/qmediaimageviewer/qmediaimageviewer.pro
+++ b/tests/auto/qmediaimageviewer/qmediaimageviewer.pro
@@ -11,7 +11,6 @@ qtAddLibrary(QtMedia)
!contains(QT_CONFIG, no-jpeg):DEFINES += QTEST_HAVE_JPEG
-
wince*|symbian {
addFiles.sources = images/*
addFiles.path = tst_qmediaimageviewer_images
@@ -20,6 +19,7 @@ wince*|symbian {
wince* {
DEFINES += TESTDATA_DIR=\\\"./tst_qmediaimageviewer_images\\\"
+ !contains(QT_CONFIG, no-jpeg): DEPLOYMENT_PLUGIN += qjpeg
} else: !symbian {
DEFINES += TESTDATA_DIR=\\\"$$PWD/images\\\"
}
diff --git a/tests/auto/qmediaplayer/tst_qmediaplayer.cpp b/tests/auto/qmediaplayer/tst_qmediaplayer.cpp
index 4f5579c6d3..98cde51496 100644
--- a/tests/auto/qmediaplayer/tst_qmediaplayer.cpp
+++ b/tests/auto/qmediaplayer/tst_qmediaplayer.cpp
@@ -745,6 +745,8 @@ void tst_QMediaPlayer::testMediaStatus()
QFETCH_GLOBAL(int, bufferStatus);
int bufferSignals = 0;
+ player->setNotifyInterval(10);
+
mockService->setMediaStatus(QMediaPlayer::NoMedia);
mockService->setBufferStatus(bufferStatus);
diff --git a/tests/auto/qmediaplaylist/qmediaplaylist.pro b/tests/auto/qmediaplaylist/qmediaplaylist.pro
index 5209bcf78c..f066e099b9 100644
--- a/tests/auto/qmediaplaylist/qmediaplaylist.pro
+++ b/tests/auto/qmediaplaylist/qmediaplaylist.pro
@@ -5,13 +5,13 @@ CONFIG += testcase
include (../../../common.pri)
HEADERS += \
- $$SOURCE_DIR/plugins/m3u/qm3uhandler.h
+ $$SOURCE_DIR/plugins/multimedia/m3u/qm3uhandler.h
SOURCES += \
tst_qmediaplaylist.cpp \
- $$QT_MOBILITY_SOURCE_TREE/plugins/m3u/qm3uhandler.cpp
+ $$QT_MOBILITY_SOURCE_TREE/plugins/multimedia/m3u/qm3uhandler.cpp
-INCLUDEPATH += $$QT_MOBILITY_SOURCE_TREE/plugins/m3u
+INCLUDEPATH += $$QT_MOBILITY_SOURCE_TREE/plugins/multimedia/m3u
qtAddLibrary(QtMedia)
diff --git a/tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp b/tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp
index 730ebb25ce..ab4e8423ac 100644
--- a/tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp
+++ b/tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp
@@ -197,9 +197,45 @@ void tst_QMediaPlaylist::append()
QCOMPARE(playlist.size(), 1);
QCOMPARE(playlist.media(0), content1);
+ QSignalSpy aboutToBeInsertedSignalSpy(&playlist, SIGNAL(itemsAboutToBeInserted(int,int)));
+ QSignalSpy insertedSignalSpy(&playlist, SIGNAL(itemsInserted(int,int)));
playlist.appendItem(content2);
QCOMPARE(playlist.size(), 2);
QCOMPARE(playlist.media(1), content2);
+
+ QCOMPARE(aboutToBeInsertedSignalSpy.count(), 1);
+ QCOMPARE(aboutToBeInsertedSignalSpy.first()[0].toInt(), 1);
+ QCOMPARE(aboutToBeInsertedSignalSpy.first()[1].toInt(), 1);
+
+ QCOMPARE(insertedSignalSpy.count(), 1);
+ QCOMPARE(insertedSignalSpy.first()[0].toInt(), 1);
+ QCOMPARE(insertedSignalSpy.first()[1].toInt(), 1);
+
+ aboutToBeInsertedSignalSpy.clear();
+ insertedSignalSpy.clear();
+
+ QMediaContent content4(QUrl(QLatin1String("file:///4")));
+ QMediaContent content5(QUrl(QLatin1String("file:///5")));
+ playlist.appendItems(QList<QMediaContent>() << content3 << content4 << content5);
+ QCOMPARE(playlist.size(), 5);
+ QCOMPARE(playlist.media(2), content3);
+ QCOMPARE(playlist.media(3), content4);
+ QCOMPARE(playlist.media(4), content5);
+
+ QCOMPARE(aboutToBeInsertedSignalSpy.count(), 1);
+ QCOMPARE(aboutToBeInsertedSignalSpy[0][0].toInt(), 2);
+ QCOMPARE(aboutToBeInsertedSignalSpy[0][1].toInt(), 4);
+
+ QCOMPARE(insertedSignalSpy.count(), 1);
+ QCOMPARE(insertedSignalSpy[0][0].toInt(), 2);
+ QCOMPARE(insertedSignalSpy[0][1].toInt(), 4);
+
+ aboutToBeInsertedSignalSpy.clear();
+ insertedSignalSpy.clear();
+
+ playlist.appendItems(QList<QMediaContent>());
+ QCOMPARE(aboutToBeInsertedSignalSpy.count(), 0);
+ QCOMPARE(insertedSignalSpy.count(), 0);
}
void tst_QMediaPlaylist::insert()
@@ -231,6 +267,33 @@ void tst_QMediaPlaylist::insert()
QCOMPARE(insertedSignalSpy.count(), 1);
QCOMPARE(insertedSignalSpy.first()[0].toInt(), 1);
QCOMPARE(insertedSignalSpy.first()[1].toInt(), 1);
+
+ aboutToBeInsertedSignalSpy.clear();
+ insertedSignalSpy.clear();
+
+ QMediaContent content4(QUrl(QLatin1String("file:///4")));
+ QMediaContent content5(QUrl(QLatin1String("file:///5")));
+ playlist.insertItems(1, QList<QMediaContent>() << content4 << content5);
+
+ QCOMPARE(playlist.media(0), content1);
+ QCOMPARE(playlist.media(1), content4);
+ QCOMPARE(playlist.media(2), content5);
+ QCOMPARE(playlist.media(3), content3);
+ QCOMPARE(playlist.media(4), content2);
+ QCOMPARE(aboutToBeInsertedSignalSpy.count(), 1);
+ QCOMPARE(aboutToBeInsertedSignalSpy[0][0].toInt(), 1);
+ QCOMPARE(aboutToBeInsertedSignalSpy[0][1].toInt(), 2);
+
+ QCOMPARE(insertedSignalSpy.count(), 1);
+ QCOMPARE(insertedSignalSpy[0][0].toInt(), 1);
+ QCOMPARE(insertedSignalSpy[0][1].toInt(), 2);
+
+ aboutToBeInsertedSignalSpy.clear();
+ insertedSignalSpy.clear();
+
+ playlist.insertItems(1, QList<QMediaContent>());
+ QCOMPARE(aboutToBeInsertedSignalSpy.count(), 0);
+ QCOMPARE(insertedSignalSpy.count(), 0);
}
@@ -483,8 +546,12 @@ void tst_QMediaPlaylist::readOnlyPlaylist()
//it's a read only playlist, so all the modification should fail
QVERIFY(!playlist.appendItem(content1));
QCOMPARE(playlist.size(), 3);
+ QVERIFY(!playlist.appendItems(QList<QMediaContent>() << content1 << content2));
+ QCOMPARE(playlist.size(), 3);
QVERIFY(!playlist.insertItem(1, content1));
QCOMPARE(playlist.size(), 3);
+ QVERIFY(!playlist.insertItems(1, QList<QMediaContent>() << content1 << content2));
+ QCOMPARE(playlist.size(), 3);
QVERIFY(!playlist.removeItem(1));
QCOMPARE(playlist.size(), 3);
QVERIFY(!playlist.removeItems(0,2));
@@ -492,6 +559,10 @@ void tst_QMediaPlaylist::readOnlyPlaylist()
QVERIFY(!playlist.clear());
QCOMPARE(playlist.size(), 3);
+ //but it is still allowed to append/insert an empty list
+ QVERIFY(playlist.appendItems(QList<QMediaContent>()));
+ QVERIFY(playlist.insertItems(1, QList<QMediaContent>()));
+
playlist.shuffle();
//it's still the same
QCOMPARE(playlist.media(0), content1);
diff --git a/tests/auto/qmediapluginloader/qmediapluginloader.pro b/tests/auto/qmediapluginloader/qmediapluginloader.pro
index 5d7863779e..b6a8064fd1 100644
--- a/tests/auto/qmediapluginloader/qmediapluginloader.pro
+++ b/tests/auto/qmediapluginloader/qmediapluginloader.pro
@@ -8,3 +8,9 @@ include (../../../common.pri)
qtAddLibrary(QtMedia)
+wince* {
+ PLUGIN_DEPLOY.sources = $$OUTPUT_DIR/plugins/mediaservice/*.dll
+ PLUGIN_DEPLOY.path = mediaservice
+ DEPLOYMENT += PLUGIN_DEPLOY
+}
+
diff --git a/tests/auto/qmediarecorder/tst_qmediarecorder.cpp b/tests/auto/qmediarecorder/tst_qmediarecorder.cpp
index 17218d0e32..9c7d79a20c 100644
--- a/tests/auto/qmediarecorder/tst_qmediarecorder.cpp
+++ b/tests/auto/qmediarecorder/tst_qmediarecorder.cpp
@@ -120,14 +120,14 @@ public:
QVideoEncoderSettings videoSettings() const { return m_videoSettings; }
void setVideoSettings(const QVideoEncoderSettings &settings) { m_videoSettings = settings; };
- QSize minimumResolution() const { return QSize(320,240); }
- QSize maximumResolution() const { return QSize(640,480); }
- QList<QSize> supportedResolutions() const { return m_sizes; }
+ QSize minimumResolution(const QVideoEncoderSettings & = QVideoEncoderSettings()) const { return QSize(320,240); }
+ QSize maximumResolution(const QVideoEncoderSettings & = QVideoEncoderSettings()) const { return QSize(640,480); }
+ QList<QSize> supportedResolutions(const QVideoEncoderSettings & = QVideoEncoderSettings()) const { return m_sizes; }
- qreal minimumFrameRate() const { return 1.0; }
- qreal maximumFrameRate() const { return 30.0; }
- QList<qreal> supportedFrameRates() const { return m_framerates; }
+ qreal minimumFrameRate(const QVideoEncoderSettings & = QVideoEncoderSettings()) const { return 1.0; }
+ qreal maximumFrameRate(const QVideoEncoderSettings & = QVideoEncoderSettings()) const { return 30.0; }
+ QList<qreal> supportedFrameRates(const QVideoEncoderSettings & = QVideoEncoderSettings()) const { return m_framerates; }
QStringList supportedVideoCodecs() const { return m_videoCodecs; }
QString videoCodecDescription(const QString &codecName) const { return codecName; }
@@ -177,7 +177,7 @@ public:
QAudioEncoderSettings audioSettings() const { return m_audioSettings; }
void setAudioSettings(const QAudioEncoderSettings &settings) { m_audioSettings = settings; }
- QList<int> supportedSampleRates() const { return QList<int>() << 44100; }
+ QList<int> supportedSampleRates(const QAudioEncoderSettings & = QAudioEncoderSettings()) const { return QList<int>() << 44100; }
QStringList supportedAudioCodecs() const
{
@@ -427,8 +427,6 @@ private:
QVideoEncoderControl* videoEncode;
};
-Q_DECLARE_METATYPE(QMediaRecorder::Error);
-
void tst_QMediaRecorder::initTestCase()
{
qRegisterMetaType<QMediaRecorder::State>("QMediaRecorder::State");
@@ -438,6 +436,7 @@ void tst_QMediaRecorder::initTestCase()
service = new MockService(this, mock);
object = new MockObject(this, service);
capture = new QMediaRecorder(object);
+ capture->setNotifyInterval(100);
audio = qobject_cast<QAudioDeviceControl*>(capture->service()->control(QAudioDeviceControl_iid));
encode = qobject_cast<QAudioEncoderControl*>(capture->service()->control(QAudioEncoderControl_iid));
@@ -574,22 +573,22 @@ void tst_QMediaRecorder::testRecord()
QSignalSpy stateSignal(capture,SIGNAL(stateChanged(QMediaRecorder::State)));
QSignalSpy progressSignal(capture, SIGNAL(durationChanged(qint64)));
capture->record();
- QVERIFY(capture->state() == QMediaRecorder::RecordingState);
- QVERIFY(capture->error() == QMediaRecorder::NoError);
- QVERIFY(capture->errorString() == QString());
+ QCOMPARE(capture->state(), QMediaRecorder::RecordingState);
+ QCOMPARE(capture->error(), QMediaRecorder::NoError);
+ QCOMPARE(capture->errorString(), QString());
QTestEventLoop::instance().enterLoop(1);
- QVERIFY(stateSignal.count() == 1);
- QVERIFY(progressSignal.count() == 1);
+ QCOMPARE(stateSignal.count(), 1);
+ QVERIFY(progressSignal.count() > 0);
capture->pause();
- QVERIFY(capture->state() == QMediaRecorder::PausedState);
+ QCOMPARE(capture->state(), QMediaRecorder::PausedState);
QTestEventLoop::instance().enterLoop(1);
- QVERIFY(stateSignal.count() == 2);
+ QCOMPARE(stateSignal.count(), 2);
capture->stop();
- QVERIFY(capture->state() == QMediaRecorder::StoppedState);
+ QCOMPARE(capture->state(), QMediaRecorder::StoppedState);
QTestEventLoop::instance().enterLoop(1);
- QVERIFY(stateSignal.count() == 3);
+ QCOMPARE(stateSignal.count(), 3);
mock->stop();
- QVERIFY(stateSignal.count() == 3);
+ QCOMPARE(stateSignal.count(), 3);
}
diff --git a/tests/auto/qmessage/tst_qmessage.cpp b/tests/auto/qmessage/tst_qmessage.cpp
index a32e90ba1f..efc30d5676 100644
--- a/tests/auto/qmessage/tst_qmessage.cpp
+++ b/tests/auto/qmessage/tst_qmessage.cpp
@@ -92,15 +92,6 @@ private slots:
void cleanup();
void cleanupTestCase();
-#if !defined(Q_OS_WIN)
- // Transmission format not handled yet
- void testFromTransmissionFormat_data();
- void testFromTransmissionFormat();
-#endif
-
- void testToTransmissionFormat_simple();
- void testToTransmissionFormat_multipart();
-
void testType();
void testParentAccountId();
void testFrom();
@@ -163,527 +154,6 @@ void tst_QMessage::cleanupTestCase()
{
}
-#if !defined(Q_OS_WIN)
-Q_DECLARE_METATYPE(QList<QByteArray>)
-
-void tst_QMessage::testFromTransmissionFormat_data()
-{
- QTest::addColumn<QString>("fileName");
- QTest::addColumn<QString>("to");
- QTest::addColumn<QString>("from");
- QTest::addColumn<QString>("date");
- QTest::addColumn<QString>("subject");
- QTest::addColumn<int>("parts");
- QTest::addColumn<QByteArray>("type");
- QTest::addColumn<QByteArray>("subtype");
- QTest::addColumn<QByteArray>("charset");
- QTest::addColumn<QString>("text");
- QTest::addColumn<QList<QByteArray> >("headerFields");
- QTest::addColumn<QStringList>("headerFieldValues");
-
- // A simple message
- QTest::newRow("1")
- << "1.txt"
- << "bbb@zzz.test"
- << "bbb@ddd.example (John X. Doe)"
- << "2001-05-04T18:05:44Z" // Convert the time in the message to UTC
- << "This is a test message"
- << 0
- << QByteArray("text")
- << QByteArray("plain")
- << QByteArray("us-ascii")
- << "\
-\n\
-Hi,\n\
-\n\
-Do you like this message?\n\
-\n\
--Me\n\
-"
- << ( QList<QByteArray>() << "Return-Path"
- << "Delivered-To"
- << "Received"
- << "MIME-Version"
- << "Content-Type"
- << "Content-Transfer-Encoding"
- << "Message-ID"
- << "From"
- << "To"
- << "Subject"
- << "Date" )
- << ( QStringList() << "<bbb@zzz.test>"
- << "bbb@zzz.test"
- << "by mail.zzz.test (Postfix, from userid 889)\tid 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT)"
- << "1.0"
- << "text/plain; charset=us-ascii"
- << "7bit"
- << "<15090.61304.110929.45684@aaa.zzz.test>"
- << "bbb@ddd.example (John X. Doe)"
- << "bbb@zzz.test"
- << "This is a test message"
- << "Fri, 4 May 2001 14:05:44 -0400" );
-
- // A multipart message
- QTest::newRow("2")
- << "2.txt"
- << "barry@python.test"
- << "barry@python.test (Barry A. Krakow)"
- << "2001-09-11T04:05:05Z"
- << "a simple multipart"
- << 2
- << QByteArray("multipart")
- << QByteArray("mixed")
- << QByteArray()
- << QString()
- << ( QList<QByteArray>() << "Return-Path"
- << "Delivered-To"
- << "Received"
- << "MIME-Version"
- << "Content-Type"
- << "Content-Transfer-Encoding"
- << "Message-ID"
- << "From"
- << "To"
- << "Subject"
- << "Date"
- << "X-Mailer"
- << "X-Attribution"
- << "X-Oblique-Strategy" )
- << ( QStringList() << "<barry@python.test>"
- << "barry@python.test"
- << "by mail.python.test (Postfix, from userid 889)\tid C2BF0D37C6; Tue, 11 Sep 2001 00:05:05 -0400 (EDT)"
- << "1.0"
- << "multipart/mixed; boundary=\"h90VIIIKmx\""
- << "7bit"
- << "<15261.36209.358846.118674@anthem.python.test>"
- << "barry@python.test (Barry A. Krakow)"
- << "barry@python.test"
- << "a simple multipart"
- << "Tue, 11 Sep 2001 00:05:05 -0400"
- << "VM 6.95 under 21.4 (patch 4) \"Artificial Intelligence\" XEmacs Lucid"
- << "BAW"
- << "Make a door into a window" );
-
- // A nested multipart message
- QTest::newRow("3")
- << "3.txt"
- << "Dingus Lovers <cravindogs@cravindogs.test>"
- << "Barry <barry@example.com>"
- << "2001-04-20T23:35:02Z"
- << "Here is your dingus fish"
- << 2
- << QByteArray("multipart")
- << QByteArray("mixed")
- << QByteArray()
- << QString()
- << ( QList<QByteArray>() << "MIME-Version"
- << "From"
- << "To"
- << "Subject"
- << "Date"
- << "Content-Type" )
- << ( QStringList() << "1.0"
- << "Barry <barry@example.com>"
- << "Dingus Lovers <cravindogs@cravindogs.test>"
- << "Here is your dingus fish"
- << "Fri, 20 Apr 2001 19:35:02 -0400"
- << "multipart/mixed; boundary=\"OUTER\"" );
-}
-
-void tst_QMessage::testFromTransmissionFormat()
-{
- QFETCH(QString, fileName);
- QFETCH(QString, to);
- QFETCH(QString, from);
- QFETCH(QString, date);
- QFETCH(QString, subject);
- QFETCH(int, parts);
- QFETCH(QByteArray, type);
- QFETCH(QByteArray, subtype);
- QFETCH(QByteArray, charset);
- QFETCH(QString, text);
- QFETCH(QList<QByteArray>, headerFields);
- QFETCH(QStringList, headerFieldValues);
-
- QString path(TESTDATA_DIR "/testdata/" + fileName);
- QMessage message(QMessage::fromTransmissionFormatFile(QMessage::Email, path));
-
- QCOMPARE(message.to().first().recipient(), to);
- QCOMPARE(message.from().recipient(), from);
- QCOMPARE(message.date(), QDateTime::fromString(date, Qt::ISODate).toLocalTime());
- QCOMPARE(message.subject(), subject);
-
- QCOMPARE(message.contentIds().count(), parts);
-
- QCOMPARE(message.contentType().toLower(), type);
- QCOMPARE(message.contentSubType().toLower(), subtype);
- QCOMPARE(message.contentCharset().toLower(), charset);
-
- if (!text.isEmpty()) {
- QMessageContentContainerId bodyId(message.bodyId());
- QVERIFY(bodyId.isValid());
-
- QMessageContentContainer body(message.find(bodyId));
- QCOMPARE(body.contentType().toLower(), type);
- QCOMPARE(body.contentSubType().toLower(), subtype);
- QCOMPARE(body.contentCharset().toLower(), charset);
- QCOMPARE(body.isContentAvailable(), true);
- QCOMPARE(body.textContent(), text);
- }
-
- QCOMPARE(message.headerFields(), headerFields);
-
- QStringList::const_iterator it = headerFieldValues.begin(), end = headerFieldValues.end();
- foreach (const QByteArray &field, headerFields) {
- QVERIFY(it != end);
- QCOMPARE(message.headerFieldValue(field), *it);
-
- foreach (const QString &value, message.headerFieldValues(field)) {
- QVERIFY(it != end);
- QCOMPARE(value, *it);
- ++it;
- }
- }
-}
-#endif
-
-void tst_QMessage::testToTransmissionFormat_simple()
-{
- const QString from("Alice <alice@example.com>");
- const QString to("Bob <bob@example.com>");
- const QString cc("Charlie <charlie@example.com>");
- const QString bcc("Dave <dave@example.com>");
- const QDateTime date(QDateTime::fromString(QDateTime::currentDateTime().toString(Qt::ISODate), Qt::ISODate)); // Strip unrepresentable elements
- const QString subject("This is a simple message");
- const QByteArray contentType("text");
- const QByteArray contentSubType("plain");
- const QByteArray contentCharset(defaultCharset);
- const QString contentText(QString("This is the happy face:").append(QChar(0x263a)));
-
- QMessage m1;
-
- m1.setType(QMessage::Email);
- m1.setFrom(QMessageAddress(from, QMessageAddress::Email));
- m1.setTo(QMessageAddressList() << QMessageAddress(to, QMessageAddress::Email));
- m1.setCc(QMessageAddressList() << QMessageAddress(cc, QMessageAddress::Email));
- m1.setBcc(QMessageAddressList() << QMessageAddress(bcc, QMessageAddress::Email));
- m1.setSubject(subject);
- m1.setDate(date);
-
- {
- // Set body text using stream (for coverage testing only)
- QTextStream is(const_cast<QString*>(&contentText), QIODevice::ReadOnly);
-
- QByteArray mimeType(contentType + "/" + contentSubType + "; charset=" + contentCharset);
- m1.setBody(is, mimeType);
- }
-
-#if !defined(Q_OS_WIN)
- QByteArray serialized;
- {
- // Serialize using stream (for coverage testing only)
- QDataStream os(&serialized, QIODevice::WriteOnly);
- m1.toTransmissionFormat(os);
- }
-#endif
-
- QCOMPARE(m1.from().recipient(), from);
- QCOMPARE(m1.to().first().recipient(), to);
- QCOMPARE(m1.cc().first().recipient(), cc);
- QCOMPARE(m1.bcc().first().recipient(), bcc);
- QCOMPARE(m1.subject(), subject);
- QCOMPARE(m1.date(), date);
- QAPPROXIMATECOMPARE(m1.size(), 2048u, 1024u);
-
- QCOMPARE(m1.contentType().toLower(), contentType.toLower());
- QCOMPARE(m1.contentSubType().toLower(), contentSubType.toLower());
- QCOMPARE(m1.contentCharset().toLower(), contentCharset.toLower());
- QCOMPARE(m1.textContent(), contentText);
-
-#if !defined(Q_OS_WIN)
- QMessage m2(QMessage::fromTransmissionFormat(QMessage::Email, serialized));
-
- QCOMPARE(m2.from().recipient(), from);
- QCOMPARE(m2.to().first().recipient(), to);
- QCOMPARE(m2.cc().first().recipient(), cc);
- QCOMPARE(m2.bcc().count(), 0);
- QCOMPARE(m2.date(), date);
- QAPPROXIMATECOMPARE(m2.size(), 2048u, 1024u);
-
- QCOMPARE(m2.contentType().toLower(), contentType.toLower());
- QCOMPARE(m2.contentSubType().toLower(), contentSubType.toLower());
- QCOMPARE(m2.contentCharset().toLower(), contentCharset.toLower());
- QCOMPARE(m2.textContent(), contentText);
-#endif
-}
-
-void tst_QMessage::testToTransmissionFormat_multipart()
-{
- const QString from("Alice <alice@example.com>");
- const QString to("Bob <bob@example.com>");
- const QString subject("This is a multipart message");
- const QByteArray contentType("multipart");
- const QByteArray contentSubType("mixed");
- const unsigned messageSize(6244u);
- const unsigned messageVariance(3072u);
-
- const QByteArray p1ContentType("text");
- const QByteArray p1ContentSubType("plain");
- const QByteArray p1ContentCharset(defaultCharset);
- const QString p1ContentText(QString("This is the happy face:").append(QChar(0x263a)));
- const unsigned p1Size(48u);
- const unsigned p1Variance(24u);
-
- const QByteArray p2FileName("1.txt");
- const QByteArray p2ContentType("text");
- const QByteArray p2ContentSubType("plain");
- const QByteArray p2ContentCharset("");
- const QString p2ContentText("\
-Return-Path: <bbb@zzz.test>\r\n\
-Delivered-To: bbb@zzz.test\r\n\
-Received: by mail.zzz.test (Postfix, from userid 889)\r\n\
-\tid 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT)\r\n\
-MIME-Version: 1.0\r\n\
-Content-Type: text/plain; charset=us-ascii\r\n\
-Content-Transfer-Encoding: 7bit\r\n\
-Message-ID: <15090.61304.110929.45684@aaa.zzz.test>\r\n\
-From: bbb@ddd.example (John X. Doe)\r\n\
-To: bbb@zzz.test\r\n\
-Subject: This is a test message\r\n\
-Date: Fri, 4 May 2001 14:05:44 -0400\r\n\
-\r\n\
-\r\n\
-Hi,\r\n\
-\r\n\
-Do you like this message?\r\n\
-\r\n\
--Me\r\n\
-");
- const unsigned p2Size(512u);
- const unsigned p2Variance(256u);
-
- const QByteArray p3FileName("qtlogo.png");
- const QByteArray p3ContentType("image");
- const QByteArray p3ContentSubType("png");
- const QByteArray p3ContentCharset("");
- const unsigned p3Size(4096u);
- const unsigned p3Variance(2048u);
-
- const QByteArray p4FileName("pointless.sh");
- const QByteArray p4ContentType("application");
-#ifdef Q_OS_WIN
- const QByteArray p4ContentSubType("octet-stream");
-#else
- const QByteArray p4ContentSubType("x-sh");
-#endif
- const QByteArray p4ContentCharset("");
- const QByteArray p4ContentData("\
-#!/bin/sh\n\
-# This script does nothing\n\
-exit 0\n");
- const unsigned p4Size(64u);
- const unsigned p4Variance(32u);
-
- const QByteArray p5FileName("datafile");
- const QByteArray p5ContentType("application");
- const QByteArray p5ContentSubType("octet-stream");
- const QByteArray p5ContentCharset("");
- const QByteArray p5ContentData("abcdefghijklmnopqrstuvwxyz");
- const unsigned p5Size(48u);
- const unsigned p5Variance(24u);
-
- QMessage m1;
-
- m1.setType(QMessage::Email);
- m1.setFrom(QMessageAddress(from, QMessageAddress::Email));
- m1.setTo(QMessageAddressList() << QMessageAddress(to, QMessageAddress::Email));
- m1.setSubject(subject);
-
- QByteArray mimeType(p1ContentType + "/" + p1ContentSubType);
- m1.setBody(p1ContentText, mimeType);
-
- QStringList attachments;
- foreach (const QString &file, ( QStringList() << p2FileName << p3FileName << p4FileName << p5FileName)) {
- attachments.append(TESTDATA_DIR "/testdata/" + file);
- }
- m1.appendAttachments(attachments);
-
- QByteArray serialized(m1.toTransmissionFormat());
-
- {
- QCOMPARE(m1.from().recipient(), from);
- QCOMPARE(m1.to().first().recipient(), to);
- QCOMPARE(m1.subject(), subject);
- QAPPROXIMATECOMPARE(m1.size(), messageSize, messageVariance);
-
- QCOMPARE(m1.contentType().toLower(), contentType.toLower());
- QCOMPARE(m1.contentSubType().toLower(), contentSubType.toLower());
- QCOMPARE(m1.isContentAvailable(), true);
- QCOMPARE(m1.contentIds().count(), 5);
- QCOMPARE(m1.attachmentIds().count(), 4);
-
- QMessageContentContainerId bodyId(m1.bodyId());
- QMessageContentContainerIdList ids(m1.contentIds());
-
- QCOMPARE(bodyId, ids.first());
- QCOMPARE(bodyId.isValid(), true);
- QCOMPARE(bodyId != QMessageContentContainerId(), true);
- QCOMPARE(QMessageContentContainerId(bodyId.toString()), bodyId);
-
- QMessageContentContainerId attachmentId(ids.at(0));
- QCOMPARE(attachmentId.isValid(), true);
- QCOMPARE(attachmentId != QMessageContentContainerId(), true);
- QCOMPARE(QMessageContentContainerId(attachmentId.toString()), bodyId);
-
- QMessageContentContainer p1(m1.find(attachmentId));
-
- QCOMPARE(p1.contentType().toLower(), p1ContentType.toLower());
- QCOMPARE(p1.contentSubType().toLower(), p1ContentSubType.toLower());
- QCOMPARE(p1.contentCharset().toLower(), p1ContentCharset.toLower());
- QCOMPARE(p1.isContentAvailable(), true);
- QCOMPARE(p1.contentIds().count(), 0);
- QCOMPARE(p1.textContent(), p1ContentText);
- QAPPROXIMATECOMPARE(p1.size(), p1Size, p1Variance);
-
- attachmentId = ids.at(1);
- QCOMPARE(attachmentId.isValid(), true);
- QCOMPARE(attachmentId != QMessageContentContainerId(), true);
- QCOMPARE(QMessageContentContainerId(attachmentId.toString()), attachmentId);
-
- QMessageContentContainer p2(m1.find(attachmentId));
-
- QCOMPARE(p2.contentType().toLower(), p2ContentType.toLower());
- QCOMPARE(p2.contentSubType().toLower(), p2ContentSubType.toLower());
- QCOMPARE(p2.contentCharset().toLower(), p2ContentCharset.toLower());
- QCOMPARE(p2.isContentAvailable(), true);
- QCOMPARE(p2.contentIds().count(), 0);
- QCOMPARE(p2.textContent(), p2ContentText);
- QAPPROXIMATECOMPARE(p2.size(), p2Size, p2Variance);
-
- attachmentId = ids.at(2);
- QCOMPARE(attachmentId.isValid(), true);
- QCOMPARE(attachmentId != QMessageContentContainerId(), true);
- QCOMPARE(QMessageContentContainerId(attachmentId.toString()), attachmentId);
-
- QMessageContentContainer p3(m1.find(attachmentId));
-
- QCOMPARE(p3.contentType().toLower(), p3ContentType.toLower());
- QCOMPARE(p3.contentSubType().toLower(), p3ContentSubType.toLower());
- QCOMPARE(p3.contentCharset().toLower(), p3ContentCharset.toLower());
- QCOMPARE(p3.isContentAvailable(), true);
- QCOMPARE(p3.contentIds().count(), 0);
- QCOMPARE(p3.content().length(), 4075);
- QAPPROXIMATECOMPARE(p3.size(), p3Size, p3Variance);
-
- attachmentId = ids.at(3);
- QCOMPARE(attachmentId.isValid(), true);
- QCOMPARE(attachmentId != QMessageContentContainerId(), true);
- QCOMPARE(QMessageContentContainerId(attachmentId.toString()), attachmentId);
-
- QMessageContentContainer p4(m1.find(attachmentId));
-
- QCOMPARE(p4.contentType().toLower(), p4ContentType.toLower());
- QCOMPARE(p4.contentSubType().toLower(), p4ContentSubType.toLower());
- QCOMPARE(p4.contentCharset().toLower(), p4ContentCharset.toLower());
- QCOMPARE(p4.isContentAvailable(), true);
- QCOMPARE(p4.contentIds().count(), 0);
- QCOMPARE(p4.content(), p4ContentData);
- QAPPROXIMATECOMPARE(p4.size(), p4Size, p4Variance);
-
- attachmentId = ids.at(4);
- QCOMPARE(attachmentId.isValid(), true);
- QCOMPARE(attachmentId != QMessageContentContainerId(), true);
- QCOMPARE(QMessageContentContainerId(attachmentId.toString()), attachmentId);
-
- QMessageContentContainer p5(m1.find(attachmentId));
-
- QCOMPARE(p5.contentType().toLower(), p5ContentType.toLower());
- QCOMPARE(p5.contentSubType().toLower(), p5ContentSubType.toLower());
- QCOMPARE(p5.contentCharset().toLower(), p5ContentCharset.toLower());
- QCOMPARE(p5.isContentAvailable(), true);
- QCOMPARE(p5.contentIds().count(), 0);
- QCOMPARE(p5.content(), p5ContentData);
- QAPPROXIMATECOMPARE(p5.size(), p5Size, p5Variance);
- }
-
- // Verify that attachments can be removed
- m1.clearAttachments();
- QCOMPARE(m1.attachmentIds(), QMessageContentContainerIdList());
-
-#if !defined(Q_OS_WIN)
- QMessage m2(QMessage::fromTransmissionFormat(QMessage::Email, serialized));
-
- {
- QCOMPARE(m2.from().recipient(), from);
- QCOMPARE(m2.to().first().recipient(), to);
- QCOMPARE(m2.subject(), subject);
- QAPPROXIMATECOMPARE(m2.size(), messageSize, messageVariance);
-
- QCOMPARE(m2.contentType().toLower(), contentType.toLower());
- QCOMPARE(m2.contentSubType().toLower(), contentSubType.toLower());
- QCOMPARE(m2.isContentAvailable(), true);
- QCOMPARE(m2.contentIds().count(), 5);
- QCOMPARE(m2.attachmentIds().count(), 4);
-
- QMessageContentContainerId bodyId(m2.bodyId());
- QMessageContentContainerIdList ids(m2.contentIds());
-
- QCOMPARE(bodyId, ids.first());
-
- QMessageContentContainer p1(m2.find(ids.at(0)));
-
- QCOMPARE(p1.contentType().toLower(), p1ContentType.toLower());
- QCOMPARE(p1.contentSubType().toLower(), p1ContentSubType.toLower());
- QCOMPARE(p1.contentCharset().toLower(), p1ContentCharset.toLower());
- QCOMPARE(p1.isContentAvailable(), true);
- QCOMPARE(p1.contentIds().count(), 0);
- QCOMPARE(p1.textContent(), p1ContentText);
- QAPPROXIMATECOMPARE(p1.size(), p1Size, p1Variance);
-
- QMessageContentContainer p2(m2.find(ids.at(1)));
-
- QCOMPARE(p2.contentType().toLower(), p2ContentType.toLower());
- QCOMPARE(p2.contentSubType().toLower(), p2ContentSubType.toLower());
- QCOMPARE(p2.contentCharset().toLower(), p2ContentCharset.toLower());
- QCOMPARE(p2.isContentAvailable(), true);
- QCOMPARE(p2.contentIds().count(), 0);
- // This text has had the '\r' stripped out...
- QCOMPARE(p2.textContent(), QString(p2ContentText).replace("\r\n", "\n"));
- QAPPROXIMATECOMPARE(p2.size(), p2Size, p2Variance);
-
- QMessageContentContainer p3(m2.find(ids.at(2)));
-
- QCOMPARE(p3.contentType().toLower(), p3ContentType.toLower());
- QCOMPARE(p3.contentSubType().toLower(), p3ContentSubType.toLower());
- QCOMPARE(p3.contentCharset().toLower(), p3ContentCharset.toLower());
- QCOMPARE(p3.isContentAvailable(), true);
- QCOMPARE(p3.contentIds().count(), 0);
- QCOMPARE(p3.content().length(), 4075);
- QAPPROXIMATECOMPARE(p3.size(), p3Size, p3Variance);
-
- QMessageContentContainer p4(m2.find(ids.at(3)));
-
- QCOMPARE(p4.contentType().toLower(), p4ContentType.toLower());
- QCOMPARE(p4.contentSubType().toLower(), p4ContentSubType.toLower());
- QCOMPARE(p4.contentCharset().toLower(), p4ContentCharset.toLower());
- QCOMPARE(p4.isContentAvailable(), true);
- QCOMPARE(p4.contentIds().count(), 0);
- QCOMPARE(p4.content(), p4ContentData);
- QAPPROXIMATECOMPARE(p4.size(), p4Size, p4Variance);
-
- QMessageContentContainer p5(m2.find(ids.at(4)));
-
- QCOMPARE(p5.contentType().toLower(), p5ContentType.toLower());
- QCOMPARE(p5.contentSubType().toLower(), p5ContentSubType.toLower());
- QCOMPARE(p5.contentCharset().toLower(), p5ContentCharset.toLower());
- QCOMPARE(p5.isContentAvailable(), true);
- QCOMPARE(p5.contentIds().count(), 0);
- QCOMPARE(p5.content(), p5ContentData);
- QAPPROXIMATECOMPARE(p5.size(), p5Size, p5Variance);
- }
-#endif
-}
-
void tst_QMessage::testType()
{
QMessage msg;
diff --git a/tests/auto/qmessagestore/tst_qmessagestore.cpp b/tests/auto/qmessagestore/tst_qmessagestore.cpp
index 4cdd428b78..27b967c003 100644
--- a/tests/auto/qmessagestore/tst_qmessagestore.cpp
+++ b/tests/auto/qmessagestore/tst_qmessagestore.cpp
@@ -207,6 +207,8 @@ void tst_QMessageStore::testAccount()
QMessageAccountIdList accountIds(QMessageStore::instance()->queryAccounts());
QVERIFY(accountIds.contains(accountId));
+
+ QVERIFY(QMessageAccount::defaultAccount(QMessage::Email).isValid());
}
void tst_QMessageStore::testFolder_data()
@@ -284,6 +286,7 @@ void tst_QMessageStore::testMessage_data()
{
QTest::addColumn<QString>("to");
QTest::addColumn<QString>("from");
+ QTest::addColumn<QString>("cc");
QTest::addColumn<QString>("date");
QTest::addColumn<QString>("subject");
QTest::addColumn<QByteArray>("messageType");
@@ -306,11 +309,16 @@ void tst_QMessageStore::testMessage_data()
QTest::newRow("1")
<< "alice@example.com"
<< "bob@example.com"
+ << ""
<< "1999-12-31T23:59:59Z"
<< "Last message..."
<< QByteArray("text")
<< QByteArray("plain")
- << 1536u
+#if defined(Q_OS_WIN) && defined(_WIN32_WCE)
+ << 32u
+#else
+ << 1400u
+#endif
<< "...before Y2K"
<< QByteArray("text")
<< QByteArray("plain")
@@ -324,11 +332,16 @@ void tst_QMessageStore::testMessage_data()
QTest::newRow("2")
<< "alice@example.com"
<< "bob@example.com"
+ << "charlie@example.com, donald@example.com"
<< "1999-12-31T23:59:59Z"
<< "Last HTML message..."
<< QByteArray("text")
<< QByteArray("html")
+#if defined(Q_OS_WIN) && defined(_WIN32_WCE)
+ << 64u
+#else
<< 1536u
+#endif
<< "<html><p>...before <b>Y2K</b></p></html>"
<< QByteArray("text")
<< QByteArray("html")
@@ -342,11 +355,16 @@ void tst_QMessageStore::testMessage_data()
QTest::newRow("3")
<< "alice@example.com"
<< "bob@example.com"
+ << ""
<< "1999-12-31T23:59:59Z"
<< "Last message..."
<< QByteArray("multipart")
<< QByteArray("mixed")
+#if defined(Q_OS_WIN) && defined(_WIN32_WCE)
+ << 512u
+#else
<< 1536u
+#endif
<< "...before Y2K"
<< QByteArray("text")
<< QByteArray("plain")
@@ -360,6 +378,7 @@ void tst_QMessageStore::testMessage_data()
QTest::newRow("4")
<< "alice@example.com"
<< "bob@example.com"
+ << ""
<< "1999-12-31T23:59:59Z"
<< "Last HTML message..."
<< QByteArray("multipart")
@@ -426,6 +445,7 @@ void tst_QMessageStore::testMessage()
QFETCH(QString, to);
QFETCH(QString, from);
+ QFETCH(QString, cc);
QFETCH(QString, date);
QFETCH(QString, subject);
QFETCH(QByteArray, messageType);
@@ -444,6 +464,7 @@ void tst_QMessageStore::testMessage()
Support::Parameters p;
p.insert("to", to);
p.insert("from", from);
+ p.insert("cc", cc);
p.insert("date", date);
p.insert("subject", subject);
p.insert("mimeType", bodyType + '/' + bodySubType);
@@ -462,6 +483,7 @@ void tst_QMessageStore::testMessage()
int originalCount = QMessageStore::instance()->countMessages();
+ // Test message addition
QMessageId messageId(Support::addMessage(p));
QVERIFY(messageId.isValid());
QVERIFY(messageId != QMessageId());
@@ -479,6 +501,7 @@ void tst_QMessageStore::testMessage()
QCOMPARE(catcher.added.first().second.count(), 2);
QCOMPARE(catcher.added.first().second, QSet<QMessageStore::NotificationFilterId>() << filter2->id << filter3->id);
+ // Test message retrieval
QMessage message(messageId);
QCOMPARE(message.id(), messageId);
QCOMPARE(message.isModified(), false);
@@ -486,6 +509,7 @@ void tst_QMessageStore::testMessage()
QMessageAddress toAddress;
toAddress.setRecipient(to);
toAddress.setType(QMessageAddress::Email);
+ QVERIFY(!message.to().isEmpty());
QCOMPARE(message.to().first(), toAddress);
QCOMPARE(message.to().first().recipient(), to);
@@ -495,18 +519,32 @@ void tst_QMessageStore::testMessage()
QCOMPARE(message.from(), fromAddress);
QCOMPARE(message.from().recipient(), from);
+ QList<QMessageAddress> ccAddresses;
+ foreach (const QString &element, cc.split(",", QString::SkipEmptyParts)) {
+ QMessageAddress addr;
+ addr.setRecipient(element.trimmed());
+ addr.setType(QMessageAddress::Email);
+ ccAddresses.append(addr);
+ }
+ QCOMPARE(message.cc(), ccAddresses);
+
QCOMPARE(message.date(), QDateTime::fromString(date, Qt::ISODate));
QCOMPARE(message.subject(), subject);
QCOMPARE(message.contentType().toLower(), messageType.toLower());
QCOMPARE(message.contentSubType().toLower(), messageSubType.toLower());
+ QCOMPARE(message.parentAccountId(), testAccountId);
+ QCOMPARE(message.parentFolderId(), testFolderId);
+ QCOMPARE(message.standardFolder(), QMessage::InboxFolder);
+
QAPPROXIMATECOMPARE(message.size(), messageSize, (messageSize / 2));
QMessageContentContainerId bodyId(message.bodyId());
QCOMPARE(bodyId.isValid(), true);
QCOMPARE(bodyId != QMessageContentContainerId(), true);
QCOMPARE(QMessageContentContainerId(bodyId.toString()), bodyId);
+ QVERIFY(message.contains(bodyId));
QMessageContentContainer body(message.find(bodyId));
@@ -525,6 +563,7 @@ void tst_QMessageStore::testMessage()
QCOMPARE(attachmentId.isValid(), true);
QCOMPARE(attachmentId != QMessageContentContainerId(), true);
QCOMPARE(QMessageContentContainerId(attachmentId.toString()), attachmentId);
+ QVERIFY(message.contains(attachmentId));
// With MAPI, attachment order is not preserved
QMessageContentContainer attachment(message.find(attachmentId));
@@ -577,6 +616,7 @@ void tst_QMessageStore::testMessage()
QCOMPARE(bodyId.isValid(), true);
QCOMPARE(bodyId != QMessageContentContainerId(), true);
QCOMPARE(QMessageContentContainerId(bodyId.toString()), bodyId);
+ QVERIFY(updated.contains(bodyId));
body = updated.find(bodyId);
QCOMPARE(body.contentType().toLower(), QByteArray("text"));
@@ -589,6 +629,24 @@ void tst_QMessageStore::testMessage()
QCOMPARE(body.textContent(), replacementText);
QAPPROXIMATECOMPARE(body.size(), 72u, 36u);
+ // Test response message properties
+ QMessage reply(updated.createResponseMessage(QMessage::ReplyToSender));
+ QCOMPARE(reply.subject(), updated.subject().prepend("Re:"));
+ QCOMPARE(reply.to(), QList<QMessageAddress>() << updated.from());
+ QCOMPARE(reply.cc(), QList<QMessageAddress>());
+ QVERIFY(reply.bodyId().isValid());
+
+ QMessage replyToAll(updated.createResponseMessage(QMessage::ReplyToAll));
+ QCOMPARE(replyToAll.subject(), updated.subject().prepend("Re:"));
+ QCOMPARE(replyToAll.to(), QList<QMessageAddress>() << updated.from());
+ QCOMPARE(replyToAll.cc(), QList<QMessageAddress>() << updated.to() << updated.cc());
+ QVERIFY(replyToAll.bodyId().isValid());
+
+ QMessage forward(updated.createResponseMessage(QMessage::Forward));
+ QCOMPARE(forward.subject(), updated.subject().prepend("Fwd:"));
+ QVERIFY(forward.bodyId().isValid());
+
+ // Test message removal
QMessageStore::instance()->removeMessage(message.id());
QCOMPARE(QMessageStore::instance()->lastError(), QMessageStore::NoError);
QCOMPARE(QMessageStore::instance()->countMessages(), originalCount);
diff --git a/tests/auto/qmessagestorekeys/qmessagestorekeys.pro b/tests/auto/qmessagestorekeys/qmessagestorekeys.pro
index e8ffa19983..6ea00bed3f 100644
--- a/tests/auto/qmessagestorekeys/qmessagestorekeys.pro
+++ b/tests/auto/qmessagestorekeys/qmessagestorekeys.pro
@@ -16,6 +16,18 @@ symbian|win32 {
LIBS += -L $$(QMF_LIBDIR) -lqtopiamail
}
+wince*|symbian*: {
+ addFiles.sources = testdata/*
+ addFiles.path = testdata
+ DEPLOYMENT += addFiles
+}
+
+wince* {
+ DEFINES += TEADATA_DIR=\\\".\\\"
+} !symbian {
+ DEFINES += TESTDATA_DIR=\\\"$$PWD/\\\"
+}
+
SOURCES += \
tst_qmessagestorekeys.cpp
diff --git a/tests/auto/qmessagestorekeys/testdata/1.txt b/tests/auto/qmessagestorekeys/testdata/1.txt
new file mode 100644
index 0000000000..8c7bf4e0a9
--- /dev/null
+++ b/tests/auto/qmessagestorekeys/testdata/1.txt
@@ -0,0 +1,19 @@
+Return-Path: <bbb@zzz.test>
+Delivered-To: bbb@zzz.test
+Received: by mail.zzz.test (Postfix, from userid 889)
+ id 27CEAD38CC; Fri, 4 May 2001 14:05:44 -0400 (EDT)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Transfer-Encoding: 7bit
+Message-ID: <15090.61304.110929.45684@aaa.zzz.test>
+From: bbb@ddd.example (John X. Doe)
+To: bbb@zzz.test
+Subject: This is a test message
+Date: Fri, 4 May 2001 14:05:44 -0400
+
+
+Hi,
+
+Do you like this message?
+
+-Me
diff --git a/tests/auto/qmessagestorekeys/tst_qmessagestorekeys.cpp b/tests/auto/qmessagestorekeys/tst_qmessagestorekeys.cpp
index 66bbb12ddf..bba1896b79 100644
--- a/tests/auto/qmessagestorekeys/tst_qmessagestorekeys.cpp
+++ b/tests/auto/qmessagestorekeys/tst_qmessagestorekeys.cpp
@@ -45,6 +45,13 @@
#include "qtmessaging.h"
#include "../support/support.h"
+#if (defined(Q_OS_SYMBIAN) || defined(Q_OS_WIN) && defined(_WIN32_WCE))
+# if defined(TESTDATA_DIR)
+# undef TESTDATA_DIR
+# endif
+# define TESTDATA_DIR "."
+#endif
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -94,6 +101,8 @@ private:
QMessageFilter existingAccountsFilter;
QMessageIdList messageIds;
+ QList<int> messageSizes;
+
uint unsupportedCount;
};
@@ -218,6 +227,9 @@ void tst_QMessageStoreKeys::initTestCase()
existingMessageIds = QMessageStore::instance()->queryMessages(~existingAccountsFilter).toSet();
+ // For windows at least, we can't have HasAttachments set without a real attachment
+ const char *attachmentPaths = TESTDATA_DIR "/testdata/1.txt";
+
QList<Support::Parameters> messageParams;
messageParams << Params()("parentAccountName", "Alter Ego")
("parentFolderPath", "My messages")
@@ -229,6 +241,7 @@ void tst_QMessageStoreKeys::initTestCase()
("to", "SuperMegaLightningBabe")
("from", "Frozone")
("subject", "Ice to meet you")
+ ("text", "Shall I compare thee to a summers day")
("date", "2000-01-01T12:00:00Z")
("receivedDate", "2000-01-01T12:01:00Z")
("priority", "")
@@ -246,6 +259,7 @@ void tst_QMessageStoreKeys::initTestCase()
("priority", "High")
("size", "10240")
("status-hasAttachments", "true")
+ ("attachments", attachmentPaths)
("custom-spam", "filter:no")
("custom-flagged", "true")
<< Params()("parentAccountName", "Work")
@@ -254,11 +268,13 @@ void tst_QMessageStoreKeys::initTestCase()
("to", "Important.Person@example.com,Minion@example.com")
("from", "Big.Boss@example.com")
("subject", "Motivational message")
+ ("text", "School's out for summer")
("date", "2000-01-01T13:00:00Z")
("receivedDate", "2000-01-01T13:05:00Z")
("priority", "High")
("size", "20480")
("status-hasAttachments", "true")
+ ("attachments", attachmentPaths)
("custom-spam", "filter:no")
<< Params()("parentAccountName", "Work")
("parentFolderPath", "Innbox/X-Announce")
@@ -284,11 +300,16 @@ void tst_QMessageStoreKeys::initTestCase()
("size", "4096")
("status-read", "true")
("status-hasAttachments", "true")
+ ("attachments", attachmentPaths)
("custom-spam", "filter:yes");
foreach (const Support::Parameters &params, messageParams) {
messageIds.append(Support::addMessage(params));
QVERIFY(messageIds.last().isValid());
+
+ // Use the resultant message sizes in testing - the configured sizes aren't honoured by MAPI
+ QMessage m(messageIds.last());
+ messageSizes.append(m.size());
}
}
@@ -546,6 +567,20 @@ void tst_QMessageStoreKeys::testAccountFilter_data()
QMessageAccountFilter::byName("Personal", QMessageDataComparator::NotEqual) )
<< ( QMessageAccountIdList() << accountIds[0] << accountIds[2] )
<< ( QMessageAccountIdList() << accountIds[1] );
+
+ QMessageAccountFilter andEquals(QMessageAccountFilter::byId(accountIds[0], QMessageDataComparator::NotEqual));
+ andEquals &= QMessageAccountFilter::byName("Personal", QMessageDataComparator::Equal);
+ QTest::newRow("id inequality AND name equality")
+ << andEquals
+ << ( QMessageAccountIdList() << accountIds[1] )
+ << ( QMessageAccountIdList() << accountIds[0] << accountIds[2] );
+
+ QMessageAccountFilter orEquals(QMessageAccountFilter::byId(accountIds[0], QMessageDataComparator::Equal));
+ orEquals |= QMessageAccountFilter::byName("Personal", QMessageDataComparator::NotEqual);
+ QTest::newRow("id equality OR name inequality")
+ << orEquals
+ << ( QMessageAccountIdList() << accountIds[0] << accountIds[2] )
+ << ( QMessageAccountIdList() << accountIds[1] );
}
void tst_QMessageStoreKeys::testAccountFilter()
@@ -1188,6 +1223,20 @@ void tst_QMessageStoreKeys::testFolderFilter_data()
QMessageFolderFilter::byDisplayName("X-Announce", QMessageDataComparator::Equal) )
<< ( QMessageFolderIdList() << folderIds[0] << folderIds[2] )
<< ( QMessageFolderIdList() << folderIds[1] << folderIds[3] );
+
+ QMessageFolderFilter andEquals(QMessageFolderFilter::byId(folderIds[0], QMessageDataComparator::NotEqual));
+ andEquals &= QMessageFolderFilter::byDisplayName("X-A", QMessageDataComparator::Includes);
+ QTest::newRow("QMessageFolderFilter::operator&=")
+ << andEquals
+ << ( QMessageFolderIdList() << folderIds[2] << folderIds[3] )
+ << ( QMessageFolderIdList() << folderIds[0] << folderIds[1] );
+
+ QMessageFolderFilter orEquals(QMessageFolderFilter::byId(folderIds[0], QMessageDataComparator::Equal));
+ orEquals |= QMessageFolderFilter::byDisplayName("X-Announce", QMessageDataComparator::Equal);
+ QTest::newRow("QMessageFolderFilter::operator|=")
+ << orEquals
+ << ( QMessageFolderIdList() << folderIds[0] << folderIds[2] )
+ << ( QMessageFolderIdList() << folderIds[1] << folderIds[3] );
}
void tst_QMessageStoreKeys::testFolderFilter()
@@ -1255,1026 +1304,1284 @@ void tst_QMessageStoreKeys::testFolderOrdering()
}
}
-#ifdef Q_OS_WIN
-// No support for setting
-#define NO_SET_SUPPORT
-#endif
-
void tst_QMessageStoreKeys::testMessageFilter_data()
{
QTest::addColumn<QMessageFilter>("filter");
QTest::addColumn<QMessageIdList>("ids");
QTest::addColumn<QMessageIdList>("negatedIds");
+ QTest::addColumn<QString>("body");
QTest::newRow("empty filter")
<< QMessageFilter()
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("id equality 1")
<< QMessageFilter::byId(messageIds[0], QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("id equality 2")
<< QMessageFilter::byId(messageIds[1], QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[1] )
- << ( QMessageIdList() << messageIds[0] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("id equality invalid")
<< QMessageFilter::byId(QMessageId(), QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("id inequality 1")
<< QMessageFilter::byId(messageIds[0], QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
+ << "";
QTest::newRow("id inequality 2")
<< QMessageFilter::byId(messageIds[1], QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[1] );
+ << ( QMessageIdList() << messageIds[1] )
+ << "";
QTest::newRow("id inequality invalid")
<< QMessageFilter::byId(QMessageId(), QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("id list inclusion 1")
<< QMessageFilter::byId(QMessageIdList() << messageIds[0], QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("id list inclusion 2")
<< QMessageFilter::byId(QMessageIdList() << messageIds[1], QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[1] )
- << ( QMessageIdList() << messageIds[0] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("id list inclusion 3")
<< QMessageFilter::byId(QMessageIdList() << messageIds[0] << messageIds[1], QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] )
- << ( QMessageIdList() << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("id list inclusion empty")
<< QMessageFilter::byId(QMessageIdList(), QMessageDataComparator::Includes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("id list exclusion 1")
<< QMessageFilter::byId(QMessageIdList() << messageIds[0], QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
+ << "";
QTest::newRow("id list exclusion 2")
<< QMessageFilter::byId(QMessageIdList() << messageIds[1], QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[0] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[1] );
+ << ( QMessageIdList() << messageIds[1] )
+ << "";
QTest::newRow("id list exclusion 3")
<< QMessageFilter::byId(QMessageIdList() << messageIds[0] << messageIds[1], QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] )
+ << "";
QTest::newRow("id list exclusion empty")
<< QMessageFilter::byId(QMessageIdList(), QMessageDataComparator::Excludes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
+
+ QTest::newRow("id filter inclusion empty")
+ << QMessageFilter::byId(QMessageFilter(), QMessageDataComparator::Includes)
+ << messageIds
+ << QMessageIdList()
+ << "";
+
+ QTest::newRow("id filter inclusion non matching")
+ << QMessageFilter::byId(~QMessageFilter(), QMessageDataComparator::Includes)
+ << QMessageIdList()
+ << messageIds
+ << "";
+
+ QTest::newRow("id filter inclusion 1")
+ << QMessageFilter::byId(QMessageFilter::bySubject("Free beer", QMessageDataComparator::Equal),
+ QMessageDataComparator::Includes)
+ << ( QMessageIdList() << messageIds[4] )
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
+ << "";
QTest::newRow("type equality 1")
<< QMessageFilter::byType(QMessage::Sms, QMessageDataComparator::Equal)
#ifdef Q_OS_WIN
<< QMessageIdList()
- << messageIds;
+ << messageIds
#else
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
#endif
+ << "";
QTest::newRow("type equality 2")
<< QMessageFilter::byType(QMessage::Email, QMessageDataComparator::Equal)
#ifdef Q_OS_WIN
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
#else
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
#endif
+ << "";
QTest::newRow("type equality invalid")
<< QMessageFilter::byType(QMessage::NoType, QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("type inequality 1")
<< QMessageFilter::byType(QMessage::Sms, QMessageDataComparator::NotEqual)
#ifdef Q_OS_WIN
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
#else
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
#endif
+ << "";
QTest::newRow("type inequality 2")
<< QMessageFilter::byType(QMessage::Email, QMessageDataComparator::NotEqual)
#ifdef Q_OS_WIN
<< QMessageIdList()
- << messageIds;
+ << messageIds
#else
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
#endif
+ << "";
QTest::newRow("type inequality invalid")
<< QMessageFilter::byType(QMessage::NoType, QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("type mask inclusion 1")
<< QMessageFilter::byType(QMessage::Sms, QMessageDataComparator::Includes)
#ifdef Q_OS_WIN
<< QMessageIdList()
- << messageIds;
+ << messageIds
#else
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
#endif
+ << "";
QTest::newRow("type mask inclusion 2")
<< QMessageFilter::byType(QMessage::Email, QMessageDataComparator::Includes)
#ifdef Q_OS_WIN
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
#else
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
#endif
+ << "";
QTest::newRow("type mask inclusion 3")
<< QMessageFilter::byType(QMessage::Sms | QMessage::Email, QMessageDataComparator::Includes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("type mask inclusion empty")
<< QMessageFilter::byType(QMessage::NoType, QMessageDataComparator::Includes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("type mask exclusion 1")
<< QMessageFilter::byType(QMessage::Sms, QMessageDataComparator::Excludes)
#ifdef Q_OS_WIN
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
#else
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
#endif
+ << "";
QTest::newRow("type mask exclusion 2")
<< QMessageFilter::byType(QMessage::Email, QMessageDataComparator::Excludes)
#ifdef Q_OS_WIN
<< QMessageIdList()
- << messageIds;
+ << messageIds
#else
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
#endif
+ << "";
QTest::newRow("type mask exclusion 3")
<< QMessageFilter::byType(QMessage::Sms | QMessage::Email, QMessageDataComparator::Excludes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("type mask exclusion empty")
<< QMessageFilter::byType(QMessage::NoType, QMessageDataComparator::Excludes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("sender equality 1")
<< QMessageFilter::bySender("Esteemed.Colleague@example.com", QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[1] )
- << ( QMessageIdList() << messageIds[0] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("sender equality 2")
<< QMessageFilter::bySender("sysadmin@example.com", QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[3] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[4] )
+ << "";
QTest::newRow("sender equality non-matching")
<< QMessageFilter::bySender("Nonesuch", QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("sender equality empty")
<< QMessageFilter::bySender(QString(), QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("sender equality zero-length")
<< QMessageFilter::bySender("", QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("sender inequality 1")
<< QMessageFilter::bySender("Esteemed.Colleague@example.com", QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[1] );
+ << ( QMessageIdList() << messageIds[1] )
+ << "";
QTest::newRow("sender inequality 2")
<< QMessageFilter::bySender("sysadmin@example.com", QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[4] )
- << ( QMessageIdList() << messageIds[3] );
+ << ( QMessageIdList() << messageIds[3] )
+ << "";
QTest::newRow("sender inequality non-matching")
<< QMessageFilter::bySender("Nonesuch", QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("sender inequality empty")
<< QMessageFilter::bySender(QString(), QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("sender inequality zero-length")
<< QMessageFilter::bySender("", QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("sender inclusion 1")
<< QMessageFilter::bySender("example", QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
+ << "";
QTest::newRow("sender inclusion 2")
<< QMessageFilter::bySender("ozone", QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("sender inclusion non-matching")
<< QMessageFilter::bySender("Nonesuch", QMessageDataComparator::Includes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("sender inclusion empty")
<< QMessageFilter::bySender(QString(), QMessageDataComparator::Includes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("sender inclusion zero-length")
<< QMessageFilter::bySender("", QMessageDataComparator::Includes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("sender exclusion 1")
<< QMessageFilter::bySender("example", QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("sender exclusion 2")
<< QMessageFilter::bySender("ozone", QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
+ << "";
QTest::newRow("sender exclusion non-matching")
<< QMessageFilter::bySender("Nonesuch", QMessageDataComparator::Excludes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("sender exclusion empty")
<< QMessageFilter::bySender(QString(), QMessageDataComparator::Excludes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("sender exclusion zero-length")
<< QMessageFilter::bySender("", QMessageDataComparator::Excludes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("recipients inclusion 1")
<< QMessageFilter::byRecipients("example", QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
+ << "";
QTest::newRow("recipients inclusion 2")
<< QMessageFilter::byRecipients("Mega", QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("recipients inclusion non-matching")
<< QMessageFilter::byRecipients("Nonesuch", QMessageDataComparator::Includes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("recipients inclusion empty")
<< QMessageFilter::byRecipients(QString(), QMessageDataComparator::Includes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("recipients inclusion zero-length")
<< QMessageFilter::byRecipients("", QMessageDataComparator::Includes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("recipients exclusion 1")
<< QMessageFilter::byRecipients("example", QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("recipients exclusion 2")
<< QMessageFilter::byRecipients("Mega", QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
+ << "";
QTest::newRow("recipients exclusion non-matching")
<< QMessageFilter::byRecipients("Nonesuch", QMessageDataComparator::Excludes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("recipients exclusion empty")
<< QMessageFilter::byRecipients(QString(), QMessageDataComparator::Excludes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("recipients exclusion zero-length")
<< QMessageFilter::byRecipients("", QMessageDataComparator::Excludes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("subject equality 1")
<< QMessageFilter::bySubject("Free beer", QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
+ << "";
QTest::newRow("subject equality 2")
<< QMessageFilter::bySubject("Scheduled maintenance", QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[3] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[4] )
+ << "";
QTest::newRow("subject equality non-matching")
<< QMessageFilter::bySubject("Nonesuch", QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("subject equality empty")
<< QMessageFilter::bySubject(QString(), QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("subject equality zero-length")
<< QMessageFilter::bySubject("", QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("subject inequality 1")
<< QMessageFilter::bySubject("Free beer", QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
- << ( QMessageIdList() << messageIds[4] );
+ << ( QMessageIdList() << messageIds[4] )
+ << "";
QTest::newRow("subject inequality 2")
<< QMessageFilter::bySubject("Scheduled maintenance", QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[4] )
- << ( QMessageIdList() << messageIds[3] );
+ << ( QMessageIdList() << messageIds[3] )
+ << "";
QTest::newRow("subject inequality non-matching")
<< QMessageFilter::bySubject("Nonesuch", QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("subject inequality empty")
<< QMessageFilter::bySubject(QString(), QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("subject inequality zero-length")
<< QMessageFilter::bySubject("", QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("subject inclusion 1")
<< QMessageFilter::bySubject("vation", QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[2] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("subject inclusion 2")
<< QMessageFilter::bySubject(" ", QMessageDataComparator::Includes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("subject inclusion non-matching")
<< QMessageFilter::bySubject("Nonesuch", QMessageDataComparator::Includes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("subject inclusion empty")
<< QMessageFilter::bySubject(QString(), QMessageDataComparator::Includes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("subject inclusion zero-length")
<< QMessageFilter::bySubject("", QMessageDataComparator::Includes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("subject exclusion 1")
<< QMessageFilter::bySubject("vation", QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[2] );
+ << ( QMessageIdList() << messageIds[2] )
+ << "";
QTest::newRow("subject exclusion 2")
<< QMessageFilter::bySubject(" ", QMessageDataComparator::Excludes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("subject exclusion non-matching")
<< QMessageFilter::bySubject("Nonesuch", QMessageDataComparator::Excludes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("subject exclusion empty")
<< QMessageFilter::bySubject(QString(), QMessageDataComparator::Excludes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("subject exclusion zero-length")
<< QMessageFilter::bySubject("", QMessageDataComparator::Excludes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("timeStamp equality 1")
<< QMessageFilter::byTimeStamp(QDateTime::fromString("1999-04-01T10:30:00Z", Qt::ISODate), QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
+ << "";
QTest::newRow("timeStamp equality 2")
<< QMessageFilter::byTimeStamp(QDateTime::fromString("2000-01-01T13:00:00Z", Qt::ISODate), QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[3] << messageIds[2] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[4] )
+ << "";
QTest::newRow("timeStamp equality non-matching")
<< QMessageFilter::byTimeStamp(QDateTime::fromString("1990-01-01T01:00:00Z", Qt::ISODate), QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("timeStamp equality empty")
<< QMessageFilter::byTimeStamp(QDateTime(), QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("timeStamp inequality 1")
<< QMessageFilter::byTimeStamp(QDateTime::fromString("1999-04-01T10:30:00Z", Qt::ISODate), QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
- << ( QMessageIdList() << messageIds[4] );
+ << ( QMessageIdList() << messageIds[4] )
+ << "";
QTest::newRow("timeStamp inequality 2")
<< QMessageFilter::byTimeStamp(QDateTime::fromString("2000-01-01T13:00:00Z", Qt::ISODate), QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[4] )
- << ( QMessageIdList() << messageIds[3] << messageIds[2] );
+ << ( QMessageIdList() << messageIds[3] << messageIds[2] )
+ << "";
QTest::newRow("timeStamp inequality non-matching")
<< QMessageFilter::byTimeStamp(QDateTime::fromString("1990-01-01T01:00:00Z", Qt::ISODate), QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("timeStamp inequality empty")
<< QMessageFilter::byTimeStamp(QDateTime(), QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QDateTime epoch(QDateTime::fromString("2000-01-01T12:00:00Z", Qt::ISODate));
QTest::newRow("timeStamp less than")
<< QMessageFilter::byTimeStamp(epoch, QMessageDataComparator::LessThan)
<< ( QMessageIdList() << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
+ << "";
QTest::newRow("timeStamp less than equal")
<< QMessageFilter::byTimeStamp(epoch, QMessageDataComparator::LessThanEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[4] )
- << ( QMessageIdList() << messageIds[2] << messageIds[3] );
+ << ( QMessageIdList() << messageIds[2] << messageIds[3] )
+ << "";
QTest::newRow("timeStamp greater than")
<< QMessageFilter::byTimeStamp(epoch, QMessageDataComparator::GreaterThan)
<< ( QMessageIdList() << messageIds[2] << messageIds[3] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[4] )
+ << "";
QTest::newRow("timeStamp greater than equal")
<< QMessageFilter::byTimeStamp(epoch, QMessageDataComparator::GreaterThanEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
- << ( QMessageIdList() << messageIds[4] );
+ << ( QMessageIdList() << messageIds[4] )
+ << "";
-#ifndef NO_SET_SUPPORT
QTest::newRow("receptionTimeStamp equality 1")
<< QMessageFilter::byReceptionTimeStamp(QDateTime::fromString("1999-04-01T10:31:00Z", Qt::ISODate), QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
+ << "";
QTest::newRow("receptionTimeStamp equality 2")
<< QMessageFilter::byReceptionTimeStamp(QDateTime::fromString("2000-01-01T13:05:00Z", Qt::ISODate), QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[2] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("receptionTimeStamp equality non-matching")
<< QMessageFilter::byReceptionTimeStamp(QDateTime::fromString("1990-01-01T01:00:00Z", Qt::ISODate), QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("receptionTimeStamp equality empty")
<< QMessageFilter::byReceptionTimeStamp(QDateTime(), QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("receptionTimeStamp inequality 1")
<< QMessageFilter::byReceptionTimeStamp(QDateTime::fromString("1999-04-01T10:31:00Z", Qt::ISODate), QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
- << ( QMessageIdList() << messageIds[4] );
+ << ( QMessageIdList() << messageIds[4] )
+ << "";
QTest::newRow("receptionTimeStamp inequality 2")
<< QMessageFilter::byReceptionTimeStamp(QDateTime::fromString("2000-01-01T13:05:00Z", Qt::ISODate), QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[2] );
+ << ( QMessageIdList() << messageIds[2] )
+ << "";
QTest::newRow("receptionTimeStamp inequality non-matching")
<< QMessageFilter::byReceptionTimeStamp(QDateTime::fromString("1990-01-01T01:00:00Z", Qt::ISODate), QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("receptionTimeStamp inequality empty")
<< QMessageFilter::byReceptionTimeStamp(QDateTime(), QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("receptionTimeStamp less than")
<< QMessageFilter::byReceptionTimeStamp(epoch, QMessageDataComparator::LessThan)
<< ( QMessageIdList() << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
+ << "";
QTest::newRow("receptionTimeStamp less than equal")
<< QMessageFilter::byReceptionTimeStamp(epoch, QMessageDataComparator::LessThanEqual)
<< ( QMessageIdList() << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
+ << "";
QTest::newRow("receptionTimeStamp greater than")
<< QMessageFilter::byReceptionTimeStamp(epoch, QMessageDataComparator::GreaterThan)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
- << ( QMessageIdList() << messageIds[4] );
+ << ( QMessageIdList() << messageIds[4] )
+ << "";
QTest::newRow("receptionTimeStamp greater than equal")
<< QMessageFilter::byReceptionTimeStamp(epoch, QMessageDataComparator::GreaterThanEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
- << ( QMessageIdList() << messageIds[4] );
+ << ( QMessageIdList() << messageIds[4] )
+ << "";
QTest::newRow("status equality 1")
<< QMessageFilter::byStatus(QMessage::Read, QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] )
+ << "";
QTest::newRow("status equality 2")
<< QMessageFilter::byStatus(QMessage::HasAttachments, QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[3] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[3] )
+ << "";
QTest::newRow("status equality 3")
<< QMessageFilter::byStatus(QMessage::Removed, QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("status inequality 1")
<< QMessageFilter::byStatus(QMessage::Read, QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] )
- << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("status inequality 2")
<< QMessageFilter::byStatus(QMessage::HasAttachments, QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[3] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[4] )
+ << "";
QTest::newRow("status inequality 3")
<< QMessageFilter::byStatus(QMessage::Removed, QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("status mask inclusion 1")
<< QMessageFilter::byStatus(QMessage::Read, QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] )
+ << "";
QTest::newRow("status mask inclusion 2")
<< QMessageFilter::byStatus(QMessage::Read | QMessage::HasAttachments, QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
+ << "";
QTest::newRow("status mask inclusion 3")
<< QMessageFilter::byStatus(QMessage::Read | QMessage::Removed, QMessageDataComparator::Includes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("status mask inclusion empty")
<< QMessageFilter::byStatus(static_cast<QMessage::StatusFlags>(0), QMessageDataComparator::Includes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("status mask exclusion 1")
<< QMessageFilter::byStatus(QMessage::Read, QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] )
- << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("status mask exclusion 2")
<< QMessageFilter::byStatus(QMessage::Read | QMessage::HasAttachments, QMessageDataComparator::Excludes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("status mask exclusion 3")
<< QMessageFilter::byStatus(QMessage::Read | QMessage::Removed, QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] )
- << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("status mask exclusion empty")
<< QMessageFilter::byStatus(static_cast<QMessage::StatusFlags>(0), QMessageDataComparator::Excludes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("priority equality 1")
<< QMessageFilter::byPriority(QMessage::HighPriority, QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] )
- << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("priority equality 2")
<< QMessageFilter::byPriority(QMessage::LowPriority, QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
+ << "";
QTest::newRow("priority equality 3")
<< QMessageFilter::byPriority(QMessage::NormalPriority, QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[0] << messageIds[3] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[4] )
+ << "";
QTest::newRow("priority inequality 1")
<< QMessageFilter::byPriority(QMessage::HighPriority, QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] )
+ << "";
QTest::newRow("priority inequality 2")
<< QMessageFilter::byPriority(QMessage::LowPriority, QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
- << ( QMessageIdList() << messageIds[4] );
+ << ( QMessageIdList() << messageIds[4] )
+ << "";
QTest::newRow("priority inequality 3")
<< QMessageFilter::byPriority(QMessage::NormalPriority, QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[3] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[3] )
+ << "";
QTest::newRow("size equality 1")
- << QMessageFilter::bySize(1056, QMessageDataComparator::Equal)
+ << QMessageFilter::bySize(messageSizes[3], QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[3] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[4] )
+ << "";
QTest::newRow("size equality 2")
- << QMessageFilter::bySize(20480, QMessageDataComparator::Equal)
+ << QMessageFilter::bySize(messageSizes[2], QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[2] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("size equality non-matching")
<< QMessageFilter::bySize(13, QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("size equality zero")
<< QMessageFilter::bySize(0, QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("size inequality 1")
- << QMessageFilter::bySize(1056, QMessageDataComparator::NotEqual)
+ << QMessageFilter::bySize(messageSizes[3], QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[4] )
- << ( QMessageIdList() << messageIds[3] );
+ << ( QMessageIdList() << messageIds[3] )
+ << "";
QTest::newRow("size inequality 2")
- << QMessageFilter::bySize(20480, QMessageDataComparator::NotEqual)
+ << QMessageFilter::bySize(messageSizes[2], QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[2] );
+ << ( QMessageIdList() << messageIds[2] )
+ << "";
QTest::newRow("size inequality non-matching")
<< QMessageFilter::bySize(13, QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("size inequality empty")
<< QMessageFilter::bySize(0, QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
- uint discriminator(10240);
+#if defined(Q_OS_WIN) && defined(_WIN32_WCE)
+ // Sizes are ordered differently on CE
+ uint discriminator(messageSizes[2]);
+#else
+ uint discriminator(messageSizes[1]);
+#endif
QTest::newRow("size less than")
<< QMessageFilter::bySize(discriminator, QMessageDataComparator::LessThan)
+#if defined(Q_OS_WIN) && defined(_WIN32_WCE)
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[4] )
+ << ( QMessageIdList() << messageIds[2] << messageIds[3] )
+#else
<< ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] )
+#endif
+ << "";
QTest::newRow("size less than equal")
<< QMessageFilter::bySize(discriminator, QMessageDataComparator::LessThanEqual)
+#if defined(Q_OS_WIN) && defined(_WIN32_WCE)
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[4] )
+ << ( QMessageIdList() << messageIds[3] )
+#else
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[2] );
+ << ( QMessageIdList() << messageIds[2] )
+#endif
+ << "";
QTest::newRow("size greater than")
<< QMessageFilter::bySize(discriminator, QMessageDataComparator::GreaterThan)
+#if defined(Q_OS_WIN) && defined(_WIN32_WCE)
+ << ( QMessageIdList() << messageIds[3] )
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[4] )
+#else
<< ( QMessageIdList() << messageIds[2] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] )
+#endif
+ << "";
QTest::newRow("size greater than equal")
<< QMessageFilter::bySize(discriminator, QMessageDataComparator::GreaterThanEqual)
+#if defined(Q_OS_WIN) && defined(_WIN32_WCE)
+ << ( QMessageIdList() << messageIds[2] << messageIds[3] )
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[4] )
+#else
<< ( QMessageIdList() << messageIds[1] << messageIds[2] )
- << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] );
-#endif // NO_SET_SUPPORT
+ << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
+#endif
+ << "";
QTest::newRow("parentAccountId equality 1")
<< QMessageFilter::byParentAccountId(accountIds[0], QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
+ << "";
QTest::newRow("parentAccountId equality 2")
<< QMessageFilter::byParentAccountId(accountIds[2], QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("parentAccountId equality invalid")
<< QMessageFilter::byParentAccountId(QMessageAccountId(), QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("parentAccountId inequality 1")
<< QMessageFilter::byParentAccountId(accountIds[0], QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("parentAccountId inequality 2")
<< QMessageFilter::byParentAccountId(accountIds[2], QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
+ << "";
QTest::newRow("parentAccountId inequality invalid")
<< QMessageFilter::byParentAccountId(QMessageAccountId(), QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("parentAccountId filter inclusion 1")
<< QMessageFilter::byParentAccountId(QMessageAccountFilter::byName("Alter Ego", QMessageDataComparator::Equal), QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("parentAccountId filter inclusion 2")
<< QMessageFilter::byParentAccountId(QMessageAccountFilter::byName("Work", QMessageDataComparator::Equal), QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
+ << "";
QTest::newRow("parentAccountId filter inclusion 3")
<< QMessageFilter::byParentAccountId(QMessageAccountFilter::byName("o", QMessageDataComparator::Includes), QMessageDataComparator::Includes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("parentAccountId filter inclusion empty")
<< QMessageFilter::byParentAccountId(QMessageAccountFilter(), QMessageDataComparator::Includes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("parentAccountId filter inclusion non-matching")
<< QMessageFilter::byParentAccountId(QMessageAccountFilter::byName("NoneSuch"), QMessageDataComparator::Includes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("parentAccountId filter exclusion 1")
<< QMessageFilter::byParentAccountId(QMessageAccountFilter::byName("Alter Ego", QMessageDataComparator::Equal), QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
+ << "";
QTest::newRow("parentAccountId filter exclusion 2")
<< QMessageFilter::byParentAccountId(QMessageAccountFilter::byName("Work", QMessageDataComparator::Equal), QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("parentAccountId filter exclusion 3")
<< QMessageFilter::byParentAccountId(QMessageAccountFilter::byName("o", QMessageDataComparator::Includes), QMessageDataComparator::Excludes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("parentAccountId filter exclusion empty")
<< QMessageFilter::byParentAccountId(QMessageAccountFilter(), QMessageDataComparator::Excludes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("parentAccountId filter exclusion non-matching")
<< QMessageFilter::byParentAccountId(QMessageAccountFilter::byName("NoneSuch"), QMessageDataComparator::Excludes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
- /* TODO: determine the correct results...
QTest::newRow("standardFolder equality 1")
- << QMessageFilter::byStandardFolder(QMessage::InnboxFolder, QMessageDataComparator::Equal)
+ << QMessageFilter::byStandardFolder(QMessage::InboxFolder, QMessageDataComparator::Equal)
+ << messageIds
<< ( QMessageIdList() )
- << ( QMessageIdList() );
+ << "";
QTest::newRow("standardFolder equality 2")
<< QMessageFilter::byStandardFolder(QMessage::TrashFolder, QMessageDataComparator::Equal)
<< ( QMessageIdList() )
- << ( QMessageIdList() );
+ << messageIds
+ << "";
QTest::newRow("standardFolder inequality 1")
- << QMessageFilter::byStandardFolder(QMessage::InnboxFolder, QMessageDataComparator::NotEqual)
+ << QMessageFilter::byStandardFolder(QMessage::InboxFolder, QMessageDataComparator::NotEqual)
<< ( QMessageIdList() )
- << ( QMessageIdList() );
+ << messageIds
+ << "";
QTest::newRow("standardFolder inequality 2")
<< QMessageFilter::byStandardFolder(QMessage::TrashFolder, QMessageDataComparator::NotEqual)
+ << messageIds
<< ( QMessageIdList() )
- << ( QMessageIdList() );
- */
+ << "";
QTest::newRow("parentFolderId equality 1")
<< QMessageFilter::byParentFolderId(folderIds[0], QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("parentFolderId equality 2")
<< QMessageFilter::byParentFolderId(folderIds[1], QMessageDataComparator::Equal)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] )
- << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("parentFolderId equality invalid")
<< QMessageFilter::byParentFolderId(QMessageFolderId(), QMessageDataComparator::Equal)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("parentFolderId inequality 1")
<< QMessageFilter::byParentFolderId(folderIds[0], QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
+ << "";
QTest::newRow("parentFolderId inequality 2")
<< QMessageFilter::byParentFolderId(folderIds[1], QMessageDataComparator::NotEqual)
<< ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] )
+ << "";
QTest::newRow("parentFolderId inequality invalid")
<< QMessageFilter::byParentFolderId(QMessageFolderId(), QMessageDataComparator::NotEqual)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("parentFolderId filter inclusion 1")
<< QMessageFilter::byParentFolderId(QMessageFolderFilter::byPath("My messages", QMessageDataComparator::Equal), QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("parentFolderId filter inclusion 2")
<< QMessageFilter::byParentFolderId(QMessageFolderFilter::byPath("Innbox", QMessageDataComparator::Equal), QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] )
- << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("parentFolderId filter inclusion 3")
<< QMessageFilter::byParentFolderId(QMessageFolderFilter::byPath("Innbox", QMessageDataComparator::Includes), QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
+ << "";
QTest::newRow("parentFolderId filter inclusion empty")
<< QMessageFilter::byParentFolderId(QMessageFolderFilter(), QMessageDataComparator::Includes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("parentFolderId filter inclusion non-matching")
<< QMessageFilter::byParentFolderId(QMessageFolderFilter::byPath("NoneSuch"), QMessageDataComparator::Includes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("parentFolderId filter exclusion 1")
<< QMessageFilter::byParentFolderId(QMessageFolderFilter::byPath("My messages", QMessageDataComparator::Equal), QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] );
+ << ( QMessageIdList() << messageIds[0] )
+ << "";
QTest::newRow("parentFolderId filter exclusion 2")
<< QMessageFilter::byParentFolderId(QMessageFolderFilter::byPath("Innbox", QMessageDataComparator::Equal), QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] )
+ << "";
QTest::newRow("parentFolderId filter exclusion 3")
<< QMessageFilter::byParentFolderId(QMessageFolderFilter::byPath("Innbox", QMessageDataComparator::Includes), QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[0] )
- << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("parentFolderId filter exclusion empty")
<< QMessageFilter::byParentFolderId(QMessageFolderFilter(), QMessageDataComparator::Excludes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("parentFolderId filter exclusion non-matching")
<< QMessageFilter::byParentFolderId(QMessageFolderFilter::byPath("NoneSuch"), QMessageDataComparator::Excludes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("ancestorFolderIds inclusion 1")
<< QMessageFilter::byAncestorFolderIds(folderIds[1], QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] )
+ << "";
QTest::newRow("ancestorFolderIds inclusion 2")
<< QMessageFilter::byAncestorFolderIds(folderIds[2], QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
+ << "";
QTest::newRow("ancestorFolderIds inclusion invalid")
<< QMessageFilter::byAncestorFolderIds(QMessageFolderId(), QMessageDataComparator::Includes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("ancestorFolderIds exclusion 1")
<< QMessageFilter::byAncestorFolderIds(folderIds[1], QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] )
- << ( QMessageIdList() << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("ancestorFolderIds exclusion 2")
<< QMessageFilter::byAncestorFolderIds(folderIds[2], QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
- << ( QMessageIdList() << messageIds[4] );
+ << ( QMessageIdList() << messageIds[4] )
+ << "";
QTest::newRow("ancestorFolderIds exclusion invalid")
<< QMessageFilter::byAncestorFolderIds(QMessageFolderId(), QMessageDataComparator::Excludes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
QTest::newRow("ancestorFolderIds filter inclusion 1")
<< QMessageFilter::byAncestorFolderIds(QMessageFolderFilter::byDisplayName("Innbox", QMessageDataComparator::Equal), QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] )
+ << "";
QTest::newRow("ancestorFolderIds filter inclusion 2")
<< QMessageFilter::byAncestorFolderIds(QMessageFolderFilter::byDisplayName("X-Announce", QMessageDataComparator::Equal), QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
+ << "";
QTest::newRow("ancestorFolderIds filter inclusion 3")
<< QMessageFilter::byAncestorFolderIds(QMessageFolderFilter::byPath("Innbox", QMessageDataComparator::Includes), QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] )
+ << "";
QTest::newRow("ancestorFolderIds filter inclusion empty")
<< QMessageFilter::byAncestorFolderIds(QMessageFolderFilter(), QMessageDataComparator::Includes)
<< ( QMessageIdList() << messageIds[3] << messageIds[4] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] )
+ << "";
QTest::newRow("ancestorFolderIds filter inclusion non-matching")
<< QMessageFilter::byAncestorFolderIds(QMessageFolderFilter::byPath("NoneSuch"), QMessageDataComparator::Includes)
<< QMessageIdList()
- << messageIds;
+ << messageIds
+ << "";
QTest::newRow("ancestorFolderIds filter exclusion 1")
<< QMessageFilter::byAncestorFolderIds(QMessageFolderFilter::byDisplayName("Innbox", QMessageDataComparator::Equal), QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] )
- << ( QMessageIdList() << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("ancestorFolderIds filter exclusion 2")
<< QMessageFilter::byAncestorFolderIds(QMessageFolderFilter::byDisplayName("X-Announce", QMessageDataComparator::Equal), QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
- << ( QMessageIdList() << messageIds[4] );
+ << ( QMessageIdList() << messageIds[4] )
+ << "";
QTest::newRow("ancestorFolderIds filter exclusion 3")
<< QMessageFilter::byAncestorFolderIds(QMessageFolderFilter::byPath("Innbox", QMessageDataComparator::Includes), QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] )
- << ( QMessageIdList() << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("ancestorFolderIds filter exclusion empty")
<< QMessageFilter::byAncestorFolderIds(QMessageFolderFilter(), QMessageDataComparator::Excludes)
<< ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] )
- << ( QMessageIdList() << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("ancestorFolderIds filter exclusion non-matching")
<< QMessageFilter::byAncestorFolderIds(QMessageFolderFilter::byPath("NoneSuch"), QMessageDataComparator::Excludes)
<< messageIds
- << QMessageIdList();
+ << QMessageIdList()
+ << "";
-#ifndef NO_SET_SUPPORT
// Test some basic combinations
QTest::newRow("status mask inclusion AND timeStamp greater than")
<< ( QMessageFilter::byStatus(QMessage::Read, QMessageDataComparator::Includes) &
QMessageFilter::byTimeStamp(epoch, QMessageDataComparator::GreaterThan) )
<< ( QMessageIdList() << messageIds[3] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[4] )
+ << "";
QTest::newRow("size greater than equal OR timeStamp greater than")
<< ( QMessageFilter::bySize(discriminator, QMessageDataComparator::GreaterThanEqual) |
QMessageFilter::byTimeStamp(epoch, QMessageDataComparator::GreaterThan) )
+#if defined(Q_OS_WIN) && defined(_WIN32_WCE)
+ << ( QMessageIdList() << messageIds[2] << messageIds[3] )
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[4] )
+#else
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] )
- << ( QMessageIdList() << messageIds[0] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[4] )
#endif
+ << "";
QTest::newRow("sender inclusion AND timeStamp greater than")
<< ( QMessageFilter::bySender("Boss", QMessageDataComparator::Includes) &
QMessageFilter::byTimeStamp(epoch, QMessageDataComparator::GreaterThan) )
<< ( QMessageIdList() << messageIds[2] )
- << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] )
+ << "";
QTest::newRow("subject inclusion OR subject exclusion")
<< ( QMessageFilter::bySubject("agenda", QMessageDataComparator::Includes) |
QMessageFilter::bySubject("ee", QMessageDataComparator::Excludes) )
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] )
- << ( QMessageIdList() << messageIds[0] << messageIds[4] );
+ << ( QMessageIdList() << messageIds[0] << messageIds[4] )
+ << "";
+
+ QMessageFilter andEquals(QMessageFilter::bySender("Boss", QMessageDataComparator::Includes));
+ andEquals &= QMessageFilter::byTimeStamp(epoch, QMessageDataComparator::GreaterThan);
+ QTest::newRow("QMessageFilter::operator&=")
+ << andEquals
+ << ( QMessageIdList() << messageIds[2] )
+ << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[3] << messageIds[4] )
+ << "";
+
+ QMessageFilter orEquals(QMessageFilter::bySubject("agenda", QMessageDataComparator::Includes));
+ orEquals |= QMessageFilter::bySubject("ee", QMessageDataComparator::Excludes);
+ QTest::newRow("QMessageFilter::operator|=")
+ << orEquals
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] )
+ << ( QMessageIdList() << messageIds[0] << messageIds[4] )
+ << "";
+
+ QTest::newRow("body")
+ << QMessageFilter()
+ << ( QMessageIdList() << messageIds[0] << messageIds[2] )
+ << QMessageIdList() // contains body but does not match filter
+ << "summer";
+
+ QTest::newRow("body and subject")
+ << QMessageFilter::bySubject("message", QMessageDataComparator::Includes)
+ << ( QMessageIdList() << messageIds[2] )
+ << ( QMessageIdList() << messageIds[0] ) // contains body but does not match filter
+ << "summer";
}
void tst_QMessageStoreKeys::testMessageFilter()
@@ -2282,14 +2589,20 @@ void tst_QMessageStoreKeys::testMessageFilter()
QFETCH(QMessageFilter, filter);
QFETCH(QMessageIdList, ids);
QFETCH(QMessageIdList, negatedIds);
+ QFETCH(QString, body);
if (filter.isSupported()) {
QVERIFY(filter == filter);
QCOMPARE(filter != QMessageFilter(), !filter.isEmpty());
-
+
// Order is irrelevant for filtering
- QCOMPARE(QMessageStore::instance()->queryMessages(filter&~existingAccountsFilter).toSet().subtract(existingMessageIds), ids.toSet());
- QCOMPARE(QMessageStore::instance()->queryMessages(~filter&~existingAccountsFilter).toSet().subtract(existingMessageIds), negatedIds.toSet());
+ if (body.isEmpty()) {
+ QCOMPARE(QMessageStore::instance()->queryMessages(filter&~existingAccountsFilter).toSet().subtract(existingMessageIds), ids.toSet());
+ QCOMPARE(QMessageStore::instance()->queryMessages(~filter&~existingAccountsFilter).toSet().subtract(existingMessageIds), negatedIds.toSet());
+ } else {
+ QCOMPARE(QMessageStore::instance()->queryMessages(filter&~existingAccountsFilter, body).toSet().subtract(existingMessageIds), ids.toSet());
+ QCOMPARE(QMessageStore::instance()->queryMessages(~filter&~existingAccountsFilter, body).toSet().subtract(existingMessageIds), negatedIds.toSet());
+ }
} else {
++unsupportedCount;
}
@@ -2300,14 +2613,20 @@ void tst_QMessageStoreKeys::testMessageOrdering_data()
QTest::addColumn<QMessageOrdering>("ordering");
QTest::addColumn<MessageListList>("ids");
-#ifndef NO_SET_SUPPORT // setting type not supported on WIN
QTest::newRow("type ascending")
<< QMessageOrdering::byType(Qt::AscendingOrder)
+#ifdef Q_OS_WIN
+ << ( MessageListList() << messageIds ); // All messages are Email type
+#else
<< ( MessageListList() << ( QMessageIdList() << messageIds[0] )
<< ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] ) );
+#endif
QTest::newRow("type descending")
<< QMessageOrdering::byType(Qt::DescendingOrder)
+#ifdef Q_OS_WIN
+ << ( MessageListList() << messageIds ); // All messages are Email type
+#else
<< ( MessageListList() << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[3] << messageIds[4] )
<< ( QMessageIdList() << messageIds[0] ) );
#endif
@@ -2365,8 +2684,8 @@ void tst_QMessageStoreKeys::testMessageOrdering_data()
<< ( MessageListList() << ( QMessageIdList() << messageIds[2] << messageIds[3] )
<< ( QMessageIdList() << messageIds[0] << messageIds[1] )
<< ( QMessageIdList() << messageIds[4] ) );
-#ifndef NO_SET_SUPPORT // setting receptionTimeStamp, priority and size and type not supported on WIN
- QTest::newRow("receptionTimeStamp ascending")
+
+ QTest::newRow("receptionTimeStamp ascending")
<< QMessageOrdering::byReceptionTimeStamp(Qt::AscendingOrder)
<< ( MessageListList() << ( QMessageIdList() << messageIds[4] )
<< ( QMessageIdList() << messageIds[0] )
@@ -2397,8 +2716,13 @@ void tst_QMessageStoreKeys::testMessageOrdering_data()
QTest::newRow("size ascending")
<< QMessageOrdering::bySize(Qt::AscendingOrder)
<< ( MessageListList() << ( QMessageIdList() << messageIds[0] )
+#if defined(Q_OS_WIN)
+ << ( QMessageIdList() << messageIds[4] )
+ << ( QMessageIdList() << messageIds[3] )
+#else
<< ( QMessageIdList() << messageIds[3] )
<< ( QMessageIdList() << messageIds[4] )
+#endif
<< ( QMessageIdList() << messageIds[1] )
<< ( QMessageIdList() << messageIds[2] ) );
@@ -2406,10 +2730,35 @@ void tst_QMessageStoreKeys::testMessageOrdering_data()
<< QMessageOrdering::bySize(Qt::DescendingOrder)
<< ( MessageListList() << ( QMessageIdList() << messageIds[2] )
<< ( QMessageIdList() << messageIds[1] )
+#if defined(Q_OS_WIN)
+ << ( QMessageIdList() << messageIds[3] )
+ << ( QMessageIdList() << messageIds[4] )
+#else
<< ( QMessageIdList() << messageIds[4] )
<< ( QMessageIdList() << messageIds[3] )
+#endif
<< ( QMessageIdList() << messageIds[0] ) );
+ QTest::newRow("status:HasAttachments ascending")
+ << QMessageOrdering::byStatus(QMessage::HasAttachments, Qt::AscendingOrder)
+ << ( MessageListList() << ( QMessageIdList() << messageIds[0] << messageIds[3] )
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[4] ) );
+
+ QTest::newRow("status:HasAttachments descending")
+ << QMessageOrdering::byStatus(QMessage::HasAttachments, Qt::DescendingOrder)
+ << ( MessageListList() << ( QMessageIdList() << messageIds[1] << messageIds[2] << messageIds[4] )
+ << ( QMessageIdList() << messageIds[0] << messageIds[3] ) );
+
+ QTest::newRow("status:Read ascending")
+ << QMessageOrdering::byStatus(QMessage::Read, Qt::AscendingOrder)
+ << ( MessageListList() << ( QMessageIdList() << messageIds[1] << messageIds[2] )
+ << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] ) );
+
+ QTest::newRow("status:Read descending")
+ << QMessageOrdering::byStatus(QMessage::Read, Qt::DescendingOrder)
+ << ( MessageListList() << ( QMessageIdList() << messageIds[0] << messageIds[3] << messageIds[4] )
+ << ( QMessageIdList() << messageIds[1] << messageIds[2] ) );
+
QTest::newRow("type ascending, priority ascending, size ascending")
<< QMessageOrdering::byType(Qt::AscendingOrder) + QMessageOrdering::byPriority(Qt::AscendingOrder) + QMessageOrdering::bySize(Qt::AscendingOrder)
<< ( MessageListList() << ( QMessageIdList() << messageIds[0] )
@@ -2473,7 +2822,6 @@ void tst_QMessageStoreKeys::testMessageOrdering_data()
<< ( QMessageIdList() << messageIds[3] )
<< ( QMessageIdList() << messageIds[4] )
<< ( QMessageIdList() << messageIds[0] ) );
-#endif
}
void tst_QMessageStoreKeys::testMessageOrdering()
diff --git a/tests/auto/qradiotuner/tst_qradiotuner.cpp b/tests/auto/qradiotuner/tst_qradiotuner.cpp
index c940860648..0151465c2f 100644
--- a/tests/auto/qradiotuner/tst_qradiotuner.cpp
+++ b/tests/auto/qradiotuner/tst_qradiotuner.cpp
@@ -56,10 +56,16 @@ class MockControl : public QRadioTunerControl
public:
MockControl(QObject *parent):
QRadioTunerControl(parent),
+ m_active(false),
m_searching(false),m_muted(false),m_stereo(true),
m_volume(100),m_signal(0),m_frequency(0),
m_band(QRadioTuner::FM) {}
+ QRadioTuner::State state() const
+ {
+ return m_active ? QRadioTuner::ActiveState : QRadioTuner::StoppedState;
+ }
+
QRadioTuner::Band band() const
{
return m_band;
@@ -182,13 +188,22 @@ public:
void start()
{
+ if (!m_active) {
+ m_active = true;
+ emit stateChanged(state());
+ }
}
void stop()
{
+ if (m_active) {
+ m_active = false;
+ emit stateChanged(state());
+ }
}
public:
+ bool m_active;
bool m_searching;
bool m_muted;
bool m_stereo;
@@ -257,14 +272,23 @@ private:
void tst_QRadioTuner::initTestCase()
{
- qRegisterMetaType<QRadioTuner::Band>("QRadioTuner::Band");
+ qRegisterMetaType<QRadioTuner::State>();
+ qRegisterMetaType<QRadioTuner::Band>();
mock = new MockControl(this);
service = new MockService(this, mock);
provider = new MockProvider(service);
radio = new QRadioTuner(0,provider);
QVERIFY(radio->service() != 0);
+
+ QSignalSpy stateSpy(radio, SIGNAL(stateChanged(QRadioTuner::State)));
+
+ QCOMPARE(radio->state(), QRadioTuner::StoppedState);
radio->start();
+ QCOMPARE(radio->state(), QRadioTuner::ActiveState);
+
+ QCOMPARE(stateSpy.count(), 1);
+ QCOMPARE(stateSpy.first()[0].value<QRadioTuner::State>(), QRadioTuner::ActiveState);
}
void tst_QRadioTuner::cleanupTestCase()
@@ -272,7 +296,13 @@ void tst_QRadioTuner::cleanupTestCase()
QVERIFY(radio->error() == QRadioTuner::NoError);
QVERIFY(radio->errorString().isEmpty());
+ QSignalSpy stateSpy(radio, SIGNAL(stateChanged(QRadioTuner::State)));
+
radio->stop();
+ QCOMPARE(radio->state(), QRadioTuner::StoppedState);
+ QCOMPARE(stateSpy.count(), 1);
+ QCOMPARE(stateSpy.first()[0].value<QRadioTuner::State>(), QRadioTuner::StoppedState);
+
delete radio;
delete service;
delete provider;
diff --git a/tests/auto/qsystemreadwritelock/tst_qsystemreadwritelock.cpp b/tests/auto/qsystemreadwritelock/tst_qsystemreadwritelock.cpp
index 4c2cf95857..474478ad15 100644
--- a/tests/auto/qsystemreadwritelock/tst_qsystemreadwritelock.cpp
+++ b/tests/auto/qsystemreadwritelock/tst_qsystemreadwritelock.cpp
@@ -236,10 +236,12 @@ public:
QSystemReadWriteLock testRwLock("Viper");
t.start();
while (t.elapsed() < runTime) {
+ if (print) qDebug() << "About to lock for write";
testRwLock.lockForWrite();
- if (print) printf(".");
+ if (print) qDebug() << "Locked for Write";
if (holdTime) msleep(holdTime);
testRwLock.unlock();
+ if (print) qDebug() << "unlocked";
if (waitTime) msleep(waitTime);
}
}
@@ -515,7 +517,7 @@ void tst_QSystemReadWriteLock::multipleReadersLoop()
ReadLockLoopThread *threads[numthreads];
int i;
for (i=0; i < numthreads; ++i)
- threads[i] = new ReadLockLoopThread(time, hold, wait,true);
+ threads[i] = new ReadLockLoopThread(time, hold, wait,false);
for (i=0; i<numthreads; ++i)
threads[i]->start();
for (i=0; i<numthreads; ++i)
diff --git a/tests/auto/qsystemreadwritelock_oop/tst_qsystemreadwritelock_oop.cpp b/tests/auto/qsystemreadwritelock_oop/tst_qsystemreadwritelock_oop.cpp
index 7b2dc73e29..5b36f8eab3 100644
--- a/tests/auto/qsystemreadwritelock_oop/tst_qsystemreadwritelock_oop.cpp
+++ b/tests/auto/qsystemreadwritelock_oop/tst_qsystemreadwritelock_oop.cpp
@@ -91,7 +91,7 @@ void tst_QSystemReadWriteLock_oop::readLockBlockRelease()
reader.start("./lackey", args);
QVERIFY(reader.waitForStarted());
- QVERIFY(server.waitForNewConnection(-1));
+ QVERIFY(server.waitForNewConnection(5000));
QLocalSocket *oopSocket = server.nextPendingConnection();
QVERIFY(waitForLine(oopSocket, Lackey::BeforeLockForRead,print));
@@ -132,7 +132,7 @@ void tst_QSystemReadWriteLock_oop::writeLockBlockRelease()
writer.start("./lackey", args);
QVERIFY(writer.waitForStarted());
- QVERIFY(server.waitForNewConnection(-1));
+ QVERIFY(server.waitForNewConnection(5000));
QLocalSocket *oopSocket = server.nextPendingConnection();
QVERIFY(waitForLine(oopSocket, Lackey::BeforeLockForWrite,print));
@@ -177,7 +177,7 @@ void tst_QSystemReadWriteLock_oop::multipleReadersBlockRelease()
readers[i].start("./lackey", args);
QVERIFY(readers[i].waitForStarted());
- QVERIFY(readerServers[i].waitForNewConnection(-1));
+ QVERIFY(readerServers[i].waitForNewConnection(5000));
readerSockets[i] = readerServers[i].nextPendingConnection();
QVERIFY(waitForLine(readerSockets[i], Lackey::BeforeLockForRead, print));
@@ -198,7 +198,7 @@ void tst_QSystemReadWriteLock_oop::multipleReadersBlockRelease()
writer.start("./lackey", args);
QVERIFY(writer.waitForStarted());
- QVERIFY(server.waitForNewConnection(-1));
+ QVERIFY(server.waitForNewConnection(5000));
QLocalSocket *writerSocket = server.nextPendingConnection();
QVERIFY(waitForLine(writerSocket, Lackey::BeforeLockForWrite, print));
@@ -385,8 +385,9 @@ void tst_QSystemReadWriteLock_oop::writerPrecedence()
readers[i].setReadChannel(QProcess::StandardError);
readers[i].start("./lackey", args);
+ QVERIFY(readers[i].waitForStarted());
- QVERIFY(readerServers[i].waitForNewConnection(-1));
+ QVERIFY(readerServers[i].waitForNewConnection(5000));
readerSockets[i] = readerServers[i].nextPendingConnection();
QVERIFY(waitForLine(readerSockets[i], Lackey::BeforeLockForRead, print));
@@ -406,7 +407,7 @@ void tst_QSystemReadWriteLock_oop::writerPrecedence()
args << "WriteLockReleaseable";
writer.start("./lackey", args);
- QVERIFY(server.waitForNewConnection(-1));
+ QVERIFY(server.waitForNewConnection(5000));
QLocalSocket *writerSocket = server.nextPendingConnection();
QVERIFY(waitForLine(writerSocket, Lackey::BeforeLockForWrite, print));
diff --git a/tests/auto/qvaluespaceprovider/tst_qvaluespaceprovider.cpp b/tests/auto/qvaluespaceprovider/tst_qvaluespaceprovider.cpp
index 634a743a35..7f0b1e8826 100644
--- a/tests/auto/qvaluespaceprovider/tst_qvaluespaceprovider.cpp
+++ b/tests/auto/qvaluespaceprovider/tst_qvaluespaceprovider.cpp
@@ -294,7 +294,7 @@ void tst_QValueSpaceProvider::testFilterConstructor_data()
ADD(QValueSpace::PermanentLayer | QValueSpace::NonPermanentLayer,
false);
- ADD(QValueSpace::WriteableLayer | QValueSpace::NonWriteableLayer,
+ ADD(QValueSpace::WritableLayer | QValueSpace::NonWritableLayer,
false);
}
diff --git a/tests/auto/qvaluespacesubscriber/tst_qvaluespacesubscribershared.cpp b/tests/auto/qvaluespacesubscriber/tst_qvaluespacesubscribershared.cpp
index 882d3c0d57..ebf63d0e48 100644
--- a/tests/auto/qvaluespacesubscriber/tst_qvaluespacesubscribershared.cpp
+++ b/tests/auto/qvaluespacesubscriber/tst_qvaluespacesubscribershared.cpp
@@ -474,9 +474,9 @@ void tst_QValueSpaceSubscriber::testFilterConstructor_data()
ADD(QValueSpace::PermanentLayer, true);
ADD(QValueSpace::NonPermanentLayer, true);
ADD(QValueSpace::PermanentLayer | QValueSpace::NonPermanentLayer, false);
- ADD(QValueSpace::WriteableLayer, true);
- ADD(QValueSpace::NonWriteableLayer, true);
- ADD(QValueSpace::WriteableLayer | QValueSpace::NonWriteableLayer, false);
+ ADD(QValueSpace::WritableLayer, true);
+ ADD(QValueSpace::NonWritableLayer, true);
+ ADD(QValueSpace::WritableLayer | QValueSpace::NonWritableLayer, false);
}
void tst_QValueSpaceSubscriber::testFilterConstructor()
@@ -722,7 +722,8 @@ void tst_QValueSpaceSubscriber::contentsChanged()
QTRY_COMPARE(spy->count(), should_emit_signal);
QCOMPARE(subscriber.value(value_path,!old_value).toBool(), new_value);
- disconnect(&subscriber, SIGNAL(contentsChanged()), listener, SIGNAL(baseChanged()));
+ if (listener)
+ disconnect(&subscriber, SIGNAL(contentsChanged()), listener, SIGNAL(baseChanged()));
delete spy;
delete listener;
diff --git a/tests/auto/qvideowidget/tst_qvideowidget.cpp b/tests/auto/qvideowidget/tst_qvideowidget.cpp
index 554ef2000b..c71e97656d 100644
--- a/tests/auto/qvideowidget/tst_qvideowidget.cpp
+++ b/tests/auto/qvideowidget/tst_qvideowidget.cpp
@@ -237,7 +237,7 @@ private:
{
public:
QSize sizeHint() const { return m_sizeHint; }
- void setSizeHint(const QSize &size) { m_sizeHint = size; }
+ void setSizeHint(const QSize &size) { m_sizeHint = size; updateGeometry(); }
private:
QSize m_sizeHint;
} m_widget;
@@ -725,11 +725,12 @@ void tst_QVideoWidget::sizeHintWindowControl()
QtTestVideoObject object(new QtTestWindowControl, 0, 0);
QVideoWidget widget(&object);
widget.setWindowFlags(Qt::X11BypassWindowManagerHint);
+ widget.show();
+ QTest::qWaitForWindowShown(&widget);
QVERIFY(widget.sizeHint().isEmpty());
object.testService->windowControl->setNativeSize(size);
-
QCOMPARE(widget.sizeHint(), size);
}
@@ -740,11 +741,12 @@ void tst_QVideoWidget::sizeHintWidgetControl()
QtTestVideoObject object(0, new QtTestWidgetControl, 0);
QVideoWidget widget(&object);
widget.setWindowFlags(Qt::X11BypassWindowManagerHint);
+ widget.show();
+ QTest::qWaitForWindowShown(&widget);
QVERIFY(widget.sizeHint().isEmpty());
object.testService->widgetControl->setSizeHint(size);
-
QCOMPARE(widget.sizeHint(), size);
}
diff --git a/tests/auto/support/support_qmf.cpp b/tests/auto/support/support_qmf.cpp
index 3f9c0d5814..5095e02c71 100644
--- a/tests/auto/support/support_qmf.cpp
+++ b/tests/auto/support/support_qmf.cpp
@@ -72,6 +72,7 @@ QMessageAccountId addAccount(const Parameters &params)
QMailAccount account;
account.setName(name);
account.setStatus(QMailAccount::Enabled, true);
+ account.setStatus(QMailAccount::CanTransmit, true);
account.setMessageType(QMailMessage::Email);
if (!fromAddress.isEmpty()) {
@@ -145,6 +146,7 @@ QMessageId addMessage(const Parameters &params)
QString parentFolderPath(params["parentFolderPath"]);
QString to(params["to"]);
QString from(params["from"]);
+ QString cc(params["cc"]);
QString date(params["date"]);
QString receivedDate(params["receivedDate"]);
QString subject(params["subject"]);
@@ -169,12 +171,21 @@ QMessageId addMessage(const Parameters &params)
QMailMessage message;
message.setStatus(QMailMessage::LocalOnly, true);
+ message.setStatus(QMailMessage::Incoming, true);
message.setParentAccountId(accountIds.first());
message.setParentFolderId(folderIds.first());
- message.setTo(QMailAddress::fromStringList(to));
- message.setFrom(QMailAddress(from));
+ if (!to.isEmpty()) {
+ message.setTo(QMailAddress::fromStringList(to));
+ }
+ if (!from.isEmpty()) {
+ message.setFrom(QMailAddress(from));
+ }
+ if (!cc.isEmpty()) {
+ message.setCc(QMailAddress::fromStringList(cc));
+ }
+
message.setSubject(subject);
QDateTime dt(QDateTime::fromString(date, Qt::ISODate));
diff --git a/tests/auto/support/support_win.cpp b/tests/auto/support/support_win.cpp
index 0c9d4fd21a..6c55021b36 100644
--- a/tests/auto/support/support_win.cpp
+++ b/tests/auto/support/support_win.cpp
@@ -1293,6 +1293,7 @@ public:
QString parentAccountName(params["parentAccountName"]);
QString parentFolderPath(params["parentFolderPath"]);
QString to(params["to"]);
+ QString cc(params["cc"]);
QString from(params["from"]);
QString date(params["date"]);
QString receivedDate(params["receivedDate"]);
@@ -1321,10 +1322,19 @@ public:
message.d_ptr->_parentFolderId = folderIds.first();
QList<QMessageAddress> toList;
- foreach (const QString &addr, to.split(",")) {
+ foreach (const QString &addr, to.split(",", QString::SkipEmptyParts)) {
toList.append(QMessageAddress(addr.trimmed(), QMessageAddress::Email));
}
message.setTo(toList);
+
+ QList<QMessageAddress> ccList;
+ foreach (const QString &addr, cc.split(",", QString::SkipEmptyParts)) {
+ ccList.append(QMessageAddress(addr.trimmed(), QMessageAddress::Email));
+ }
+ if (!ccList.isEmpty()) {
+ message.setCc(ccList);
+ }
+
message.setFrom(QMessageAddress(from, QMessageAddress::Email));
message.setSubject(subject);
diff --git a/tools/qcrmlgen/qcrmlgen.cpp b/tools/qcrmlgen/qcrmlgen.cpp
index dd6bd2fadd..b391428d72 100644
--- a/tools/qcrmlgen/qcrmlgen.cpp
+++ b/tools/qcrmlgen/qcrmlgen.cpp
@@ -147,9 +147,6 @@ QWidget *PathDelegate::createEditor(QWidget *parent,
editor->setText(item->text());
}
- QRegExpValidator *validator = new QRegExpValidator(QRegExp("^/.*"), editor);
- editor->setValidator(validator);
-
return editor;
}
@@ -242,9 +239,11 @@ void EditorWidget::addRow()
QTableWidgetItem *item;
item = new QTableWidgetItem;
+ item->setToolTip("Must be a hexidecimal number no longer than 8 digits");
m_tableWidget->setItem(row, EditorWidget::KeyId, item);
item = new QTableWidgetItem("/");
+ item->setToolTip("Must not be empty and must start with a /");
m_tableWidget->setItem(row, EditorWidget::Path, item);
#ifdef INCL_TYPE
@@ -436,7 +435,7 @@ bool EditorWidget::verifyContents()
path = m_tableWidget->item(i, EditorWidget::Path)->text();
if (path.isEmpty() || !path.startsWith("/")) {
QMessageBox::warning(this, tr("Invalid Path"),
- tr("The Path field is invalid, it must not be empty and start with a /"));
+ tr("The Key Path field is invalid, it must not be empty and start with a /"));
m_tableWidget->setCurrentCell(i, EditorWidget::Path);
m_tableWidget->setFocus();
return false;
diff --git a/tools/tools.pro b/tools/tools.pro
index 740010f115..b274e1d747 100644
--- a/tools/tools.pro
+++ b/tools/tools.pro
@@ -1,5 +1,3 @@
TEMPLATE = subdirs
-#remove service xml gen for now -> breaks the build
-#SUBDIRS += servicefw servicexmlgen #SFW API
-SUBDIRS += servicefw #SFW API
+SUBDIRS += servicefw servicexmlgen #SFW API
SUBDIRS += vsexplorer qcrmlgen #P&S API