[meego-commits] 11354: Changes to devel:qt-mtf:qt-mobility:1.2/qt-mobility
tsunil
no_reply at build.meego.com
Fri Dec 31 04:24:11 UTC 2010
Hi,
I have made the following changes to qt-mobility in project devel:qt-mtf:qt-mobility:1.2. Please review and accept ASAP.
Thank You,
tsunil
[This message was auto-generated]
---
Request #11354:
submit: home:tsunil:branches:devel:qt-mtf:qt-mobility:1.2/qt-mobility(r3)(cleanup) -> devel:qt-mtf:qt-mobility:1.2/qt-mobility
Message:
* Fri Dec 31 2010 Sunil Thaha <sunil.thaha at nokia.com> - 1.1.0+git2727
- Updated version to Qt Mobility 1.1.0+git2727
- Switched the codebase to mobility/master at gd33fdd4
- Added QtSparql to PkgConfigBr for location config.test to pass
- Corrected rpmlint error: txt and qmldir files have the execute bit set
- Patches removed:
add_location_api_meego_implementation_using_geoclue.patch - merged upstream
State: new 2010-12-30T20:24:03 tsunil
Comment: None
changes files:
--------------
--- qt-mobility.changes
+++ qt-mobility.changes
@@ -0,0 +1,8 @@
+* Fri Dec 31 2010 Sunil Thaha <sunil.thaha at nokia.com> - 1.1.0+git2727
+- Updated version to Qt Mobility 1.1.0+git2727
+- Switched the codebase to mobility/master at gd33fdd4
+- Added QtSparql to PkgConfigBr for location config.test to pass
+- Corrected rpmlint error: txt and qmldir files have the execute bit set
+- Patches removed:
+ add_location_api_meego_implementation_using_geoclue.patch - merged upstream
+
old:
----
add_location_api_meego_implementation_using_geoclue.patch
qt-mobility-opensource-src-1.1.0+git2581.tar.gz
new:
----
qt-mobility-opensource-src-1.1.0+git2727.tar.gz
spec files:
-----------
--- qt-mobility.spec
+++ qt-mobility.spec
@@ -7,7 +7,7 @@
Name: qt-mobility
Summary: APIs for mobile device functionality
-Version: 1.1.0+git2581
+Version: 1.1.0+git2727
Release: 1
Group: System/Libraries
License: LGPLv2.1 with exception or GPLv3
@@ -17,8 +17,7 @@
Patch0: no_rpath.patch
Patch1: fix_translations_install_path.patch
Patch2: enable_pkgconfig_support.patch
-Patch3: add_location_api_meego_implementation_using_geoclue.patch
-Patch4: enable_camerabin_with_meego_target.patch
+Patch3: enable_camerabin_with_meego_target.patch
Requires: libqtconnectivity1 = %{version}
Requires: libqtcontacts1 = %{version}
Requires: libqtfeedback1 = %{version}
@@ -35,6 +34,7 @@
Requires: libqtversitorganizer1 = %{version}
BuildRequires: pkgconfig(QtGui)
BuildRequires: pkgconfig(QtOpenGL)
+BuildRequires: pkgconfig(QtSparql)
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(blkid)
BuildRequires: pkgconfig(bluez)
@@ -444,10 +444,8 @@
%patch1 -p1
# enable_pkgconfig_support.patch
%patch2 -p1
-# add_location_api_meego_implementation_using_geoclue.patch
-%patch3 -p1
# enable_camerabin_with_meego_target.patch
-%patch4 -p1
+%patch3 -p1
# >> setup
# << setup
@@ -489,6 +487,8 @@
find %{buildroot}%{_libdir}/qtmobility -type f -perm /u+x,g+x,o+x \( -false \
-o -name \*.qml \
-o -name \*.sci \
+-o -name qmldir \
+-o -name \*.txt \
\) | xargs chmod -x
# Fix duplicate files
%fdupes %{buildroot}%{_includedir}
other changes:
--------------
++++++ qt-mobility-opensource-src-1.1.0+git2581.tar.gz -> qt-mobility-opensource-src-1.1.0+git2727.tar.gz
--- common.pri
+++ common.pri
@@ -140,6 +140,9 @@
maemo5 {
DEFINES+= Q_WS_MAEMO_5
}
+meego {
+ DEFINES+= Q_WS_MEEGO
+}
wince* {
### Bearer Management
--- config.tests/blkid/main.cpp
+++ config.tests/blkid/main.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include <blkid/blkid.h>
int main(int, char**)
--- config.tests/geoclue-master
+++ config.tests/geoclue-master
+(directory)
--- config.tests/geoclue-master/geoclue-master.pro
+++ config.tests/geoclue-master/geoclue-master.pro
+TEMPLATE = app
+TARGET =
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+SOURCES += main.cpp
+QT+=core
+
+CONFIG += link_pkgconfig qdbus
+PKGCONFIG += geoclue gconf-2.0 glib-2.0
--- config.tests/geoclue-master/main.cpp
+++ config.tests/geoclue-master/main.cpp
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <geoclue/geoclue-master.h>
+#include <gconf/gconf-client.h>
+
+int main(int, char**)
+{
+ GeoclueMaster *master(0);
+ GConfClient* client(0);
+ GError *error(0);
+ g_type_init ();
+ return 0;
+}
--- config.tests/gypsy
+++ config.tests/gypsy
+(directory)
--- config.tests/gypsy/gypsy.pro
+++ config.tests/gypsy/gypsy.pro
+TEMPLATE = app
+TARGET =
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+SOURCES += main.cpp
+QT+=core
+
+CONFIG += link_pkgconfig qdbus
+PKGCONFIG += gypsy gconf-2.0 glib-2.0
--- config.tests/gypsy/main.cpp
+++ config.tests/gypsy/main.cpp
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <gypsy/gypsy-satellite.h>
+#include <gypsy/gypsy-control.h>
+#include <gconf/gconf-client.h>
+
+int main(int, char**)
+{
+ GConfClient* client(0);
+ GypsyControl *control(0);
+ GypsyDevice *device(0);
+ g_type_init ();
+ return 0;
+}
--- config.tests/udev/main.cpp
+++ config.tests/udev/main.cpp
@@ -1,5 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include <libudev.h>
-
+
int main(int, char**)
{
return 0;
--- configure
+++ configure
@@ -578,8 +578,12 @@
if [ "$LINUX_TARGET" = meego ]; then
compileTest connman connman
+ compileTest "Location GeoClue master provider" geoclue-master
+ compileTest "Location Gypsy provider" gypsy
+ else
+ echo "geoclue-master_enabled = no" >> "$CONFIG_IN"
+ echo "gypsy_enabled = no" >> "$CONFIG_IN"
fi
-
else
echo "Skipping configure tests"
echo "Loading ... features/platformconfig/$PLATFORM_CONFIG.pri"
--- dist/changes-1.2.0-tp1
+++ dist/changes-1.2.0-tp1
@@ -18,108 +18,7 @@
New features
------
- -
-
-
-****************************************************************************
-* Important Behavior Changes *
-****************************************************************************
-
- -
-
-
-****************************************************************************
-* Library *
-****************************************************************************
-
-QtBearer
-------
- -
-
-QtContacts
-------
- -
-
-QtGallery
-------
- -
-
-QtLocation
-------
- -
-
-QtMessaging
-------
- -
-
-QtMultimediaKit
-------
- -
-
-QtOrganizer
-------
- -
-
-QtPublishSubscribe
-------
- -
-
-QtSensors
-------
- -
-
-QtServiceFramework
-------
- -
-
-QtSystemInfo
-------
- -
-
-QtVersit
------
- -
-
-QtFeedback
-------
- -
-
-Qt Mobility Plugins
-------
- -
-
-
-****************************************************************************
-* Platform Specific Changes *
-****************************************************************************
-
-Qt Mobility for Embedded Linux
-------
-
- -
-
-Qt Mobility for Unix (X11 and Mac OS X)
-------
-
- -
-
-Qt Mobility for Linux/X11
-------
-
- -
-
-Qt Mobility for Windows
-------
-
- -
-
-Qt Mobility for Mac OS X
-------
-
- -
-
-Qt Mobility for Windows CE
-------
-
- -
-
+ - Connectivity
+ - Bluetooth http://bugreports.qt.nokia.com/browse/QTMOBILITY-633
+ - NFC (Near Field Communication)
+ http://bugreports.qt.nokia.com/browse/QTMOBILITY-634
--- doc/src/connectivity.qdoc
+++ doc/src/connectivity.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** 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 Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
@@ -49,9 +49,7 @@
\section2 NFC
Unfortunately there currently are no functional backends for real hardware. An emulator backend is
-available, however, which is used by both the unit tests and the Qt Simulator backend. To use the
-Qt Simulator backend a modified version of the Qt Simulator is required, which can be obtained from
-http://qt.gitorious.org/?????.
+available, however, which is used by both the unit tests and the Qt Simulator backend. Use the \i {master} branch of Qt Simulator at \l {http://qt.gitorious.org/qt-labs/simulator}.
The \l {Qt Mobility Examples#Connectivity}{Connectivity examples} demonstrate how to use NFC
functionality in your application.
@@ -86,12 +84,6 @@
\endlist
\endlist
-\section1 Main Classes
-
-\section2 NFC Classes
-
-\annotatedlist connectivity-nfc
-
\section2 Bluetooth
The Bluetooth API is under development and subject to change between the tech
@@ -103,7 +95,7 @@
You should be able to discover devices and services, open an Rfcomm socket, or accept
an Rfcomm connection, and transfer a file to a device using Object Push Protocol.
-Classes that shoudl work:
+Classes that should work:
\list
\o QBluetoothAddress
\o QBluetoothDeviceDiscoveryAgent
@@ -111,19 +103,28 @@
\o QBluetoothDeviceInfo
\o QBluetoothServiceInfo
\o QBluetoothSocket
- \o QBluetoothTransferManager::put
+ \o \l {QBluetoothTransferManager::put}
\o QBluetoothUuid
\o QBluetoothRfcommServer
\o QBluetoothRfcommSocket
\endlist
-What is know \bold NOT to work:
+What is known \bold NOT to work:
\list
\o Symbian, Windows, Mac
\o QL2capServer and QL2capSocket
\o QBluetoothLocalDevice Pairing functions
\o QBluetoothLocalDevice power control and state functions
\o QBluetoothServiceDiscoveryAgent errorString
+\endlist
+
+\section1 Main Classes
+
+\section2 NFC Classes
+
+\annotatedlist connectivity-nfc
+
+\section2 Bluetooth Classes
\annotatedlist connectivity-bluetooth
--- doc/src/contacts.qdoc
+++ doc/src/contacts.qdoc
@@ -63,7 +63,7 @@
entirely opaque from the perspective of Qt-based, cross-platform client
applications.
-\section1 Overview
+\section1 Overview
The QtMobility APIs are placed into the \i{QtMobility} namespace. This is done
to facilitate the future migration of Mobility APIs into Qt. See the
@@ -386,7 +386,7 @@
\endlist
See also: \l{Contacts API Usage}
-\section1 QML support
+\section1 QML Elements
For details on the QML support provided for the Contacts API see the documentation for the \l {Contacts QML Plugin}.
*/
--- doc/src/examples/annotatedurl.qdoc
+++ doc/src/examples/annotatedurl.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** 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 Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
--- doc/src/feedback.qdoc
+++ doc/src/feedback.qdoc
@@ -168,7 +168,7 @@
\o \l{hapticsplayer}{Haptics Player}
\endlist
-\section1 QML support
+\section1 QML Elements
For details on the QML support provided for the Feedback API see the documentation for the \l {Feedback QML Plugin}.
--- doc/src/location.qdoc
+++ doc/src/location.qdoc
@@ -551,7 +551,7 @@
\annotatedlist maps-impl-tiled
-\section1 QML support
+\section1 QML Elements
For details on the QML support provided for the Location API see the documentation for the \l {Location QML Plugin}.
--- doc/src/multimedia.qdoc
+++ doc/src/multimedia.qdoc
@@ -36,7 +36,7 @@
\page multimedia.html
\title Multimedia
-\brief Provides a set of APIs to play and record media, and manage a
+\brief Provides a set of APIs to play and record media, and manage a
collection of media content.
\ingroup mobility
@@ -53,7 +53,7 @@
\section1 Overview
-This API delivers an easy to use interface to multimedia functions. The
+This API delivers an easy to use interface to multimedia functions. The
developer can use the API to display an image, or a video, record sound or play a
multimedia stream.
@@ -413,7 +413,7 @@
\annotatedlist multimedia-serv
-\section2 QML multimedia elements
+\section2 QML Multimedia Elements
\list
\o \l {SoundEffect}{SoundEffect: Low Latency Sound Effects}
\o \l {Audio}{Audio: Music playback}
--- doc/src/organizer.qdoc
+++ doc/src/organizer.qdoc
@@ -347,7 +347,7 @@
\o \l{CalendarDemo}{Example Calendar Application}
\endlist
-\section1 QML support
+\section1 QML Elements
For details on the QML support provided for the Organizer API see the documentation for the \l {Organizer QML Plugin}.
--- doc/src/sensors.qdoc
+++ doc/src/sensors.qdoc
@@ -338,13 +338,13 @@
See \l Sensors for more information about the Sensors API.
-\section1 Sensor Elements
+\section1 QML Sensor Elements
These elements represent specific types of sensors.
\annotatedlist qml-sensors_type
-\section1 Reading Elements
+\section1 QML Reading Elements
The data from a sensor comes through a reading class.
--- doc/src/sf.qdoc
+++ doc/src/sf.qdoc
@@ -80,7 +80,7 @@
addition services themselves may also act as clients to the service
framework by requesting other services installed on the system.
-Service provider are implemented via plug-ins. QServicePluginInterface
+Service provider are implemented via plug-ins. QServicePluginInterface
defines the main interface for each plug-in.
In order to avoid that clients have to link against service specific
libraries each service object must be derived from QObject. Therefore the
@@ -92,12 +92,12 @@
(see Q_INVOKABLE macro for more details).
Each service plug-in implements one service only but can provide multiple
-implementations for multiple interfaces.
+implementations for multiple interfaces.
Therefore a service (plug-in) can retain a certain level of backwards
compatibility even if the main service interface breaks in such a way that
a new interface name has to be used. Existing clients can still use the
previous version of service interface whereas new clients can utilize the
-new interface.
+new interface.
Services can also include remote processes. By registering with the
service manager processes can communicate via signals, slots,
@@ -111,7 +111,7 @@
This section assumes that the user wants to access the \i FileStorage
service which offers an implementation for the \i com.nokia.qt.examples.FileStorage
interface The service framework enables multiple ways of accessing those
-implementations.
+implementations.
QServiceManager is the main class to lookup and instantiate services.
Services can be found by constraining the search via service meta data or
@@ -119,7 +119,7 @@
\section2 Verbose Lookup
-The client code has precise knowledge of the service and its interfaces.
+The client code has precise knowledge of the service and its interfaces.
\code
QServiceManager manager;
@@ -250,7 +250,7 @@
\section2 XML Format
Services are installed via an XML file which describes the meta data and
-location of the service. The XML file can be described via the following
+location of the service. The XML file can be described via the following
DTD:
\code
@@ -277,13 +277,13 @@
\row
\o SFW
\o
- \o The service framework XML version tag that encapsulates the service XML. Must provide the
+ \o The service framework XML version tag that encapsulates the service XML. Must provide the
version attribute that follows the \i major.minor notation and must equate to supported
Qt Service Framework versions. This means the minimum version is 1.0 however users are
recommended to always specify the highest available version.
\row
\o service
- \o
+ \o
\o The \i service tag can contain an arbitrary number of \i interface tags and one description tag.
\row
\o "
@@ -300,7 +300,7 @@
parts such as the suffix ".dll" and ".so" or plugin prefix "lib"
should be removed to enable cross platform resolution. QLibrary
is used to determine the platform specific parts of the plugin.
- \row
+ \row
\o "
\o ipcaddress
\o The socket name or path that the inter-process service will be published
@@ -329,8 +329,8 @@
\o "
\o version
\o This property contains the interface and implementation version.
- The version tag follows the \i major.minor notation. The major
- version indicates the interface version the minor version the
+ The version tag follows the \i major.minor notation. The major
+ version indicates the interface version the minor version the
implementation version.
The version number \bold must be greater than 1.0. The version
@@ -347,7 +347,7 @@
\o customproperty
\o An implementation specific key value pair which can be used for
filtering or as description.
-
+
\endtable
@@ -379,17 +379,17 @@
<description>Interface that provides system information support</description>
<customproperty key="key1">value1</customproperty>
<customproperty key="key2">value2</customproperty>
- </interface>
+ </interface>
</service>
</SFW>
\endcode
\section1 Tools for XML Generation
-The framework includes a GUI tool under \tt tools/servicexmlgen for
+The framework includes a GUI tool under \tt tools/servicexmlgen for
generating and inspecting service XML files. This makes it easy to enter
service metadata and interface details and generate the appropriate XML to
-describe the plugin or IPC based service. It can also be used to load and
+describe the plugin or IPC based service. It can also be used to load and
inspect existing service XML files.
Note that the tool will default to the highest known existing Qt Service Framework
@@ -416,7 +416,7 @@
Each implementation is identified by a service name, an interface name and
its version. This information is encapsulated by
QServiceInterfaceDescriptor which can be used to request references to
-service objects.
+service objects.
QServiceFilter simplifies the lookup of already installed services.
Developers specifies the criteria used during the meta data lookup.
@@ -463,29 +463,29 @@
\section1 Out of Process Services
Qt Service Framework provides a mechanism for out of process services
-so that clients can remotely load interfaces. These inter-process
+so that clients can remotely load interfaces. These inter-process
services are deployed similarly to local services, using the IPC address
tag from the XML description and calling QRemoteServiceRegister::publishEntries()
to add the service to the remote services manager. Clients access services
-via the metaobject similarly to in-process services and each remote service
-is represented as a QRemoteServiceRegister::Entry by using
-QRemoteServiceRegister::createEntry(). The \l{Echo Client Example} demonstrates
+via the metaobject similarly to in-process services and each remote service
+is represented as a QRemoteServiceRegister::Entry by using
+QRemoteServiceRegister::createEntry(). The \l{Echo Client Example} demonstrates
how remote services can be instantiated and used.
Inter-process services are deployed using a variety of different IPC mechanisms
available on the current platform and as such may inherit several limitations. For
-Symbian, IPC is handled by the Symbian Client-Server Framework whereas for other
-environments services are published using QtDBus if it is available otherwise
+Symbian, IPC is handled by the Symbian Client-Server Framework whereas for other
+environments services are published using QtDBus if it is available otherwise
falls back on QLocalSocket for inter-process communication.
\section2 D-Bus Services
-The QtDBus module is used to provide IPC in correspondance to the Qt Service
+The QtDBus module is used to provide IPC in correspondance to the Qt Service
Framework architecture and provides access to signals, slots, invokable methods
and properties.
-The D-Bus protocol requires concept identifiers that represent D-Bus objects:
-service names, object paths, and interfaces. D-Bus objects are registered using
+The D-Bus protocol requires concept identifiers that represent D-Bus objects:
+service names, object paths, and interfaces. D-Bus objects are registered using
a combination of the service description supplied in the service XML file. An
example of this, using the previous sample XML description, is provided below.
@@ -510,10 +510,10 @@
\section3 Service Autostart
D-Bus services inherit automatic start support by providing .service files to the
-D-Bus daemon search paths. Aside from producing these files manually, the
+D-Bus daemon search paths. Aside from producing these files manually, the
servicefw tool provides an option to generate the corresponding files inside
the local user D-Bus folder for convenience. This will allow all client
-requests to automatically startup the service if it isn't already running.
+requests to automatically startup the service if it isn't already running.
Consequently, once every client has closed its service instance the service will
be automatically terminated after invoking any slots connected to notification signals.
@@ -524,14 +524,14 @@
\endcode
The .service files will typically be generated in the $home/.local/share/dbus-1/services
-directory unless the $$XDG_DATA_HOME environment variable is set. If the --system
-option is used the tool will generate the file inside /usr/share/dbus-1/services if
+directory unless the $$XDG_DATA_HOME environment variable is set. If the --system
+option is used the tool will generate the file inside /usr/share/dbus-1/services if
the user permissions are met.
-Note that in order for the autostart feature to function correctly, the service
+Note that in order for the autostart feature to function correctly, the service
needs to be either pre-registered or registered at run-time so that clients can use
-a QServiceManager to discover the IPC interfaces that invoke the D-Bus service files.
-This is usually done on deployment by adding services through the servicefw tool.
+a QServiceManager to discover the IPC interfaces that invoke the D-Bus service files.
+This is usually done on deployment by adding services through the servicefw tool.
\section2 Symbian Client-Server Framework
@@ -641,7 +641,7 @@
\section2 Local Socket
On platforms that do not provide D-Bus or the Symbian Client-Server Framework, the
-underlying IPC mechanism utilized is a local socket based protocol.
+underlying IPC mechanism utilized is a local socket based protocol.
\section3 Limitations
Similar to the other IPC mechanisms, passing object pointers or typedefs will not
@@ -711,9 +711,9 @@
\annotatedlist servicefw
-\section1 QML Classes
+\section1 QML Elements
The Qt Service Framework offers discovery and selection of services through declarative
-UI by providing service and service list elements. Detailed information can be found
+UI by providing service and service list elements. Detailed information can be found
at \l{QML Service Framework Plugin}.
\annotatedlist qml-serviceframework
@@ -727,8 +727,8 @@
\o \l{Notes Manager Plugin Example}
\o \l{Notes Manager Example}
\o \l{Echo Client Example}
- \o \l{declarative-sfw-notes}{Declarative Notes Manager}
- \o \l{declarative-sfw-dialer}{Declarative Serviceframework Dialer}
+ \o \l{declarative-sfw-notes}{Declarative Notes Manager}
+ \o \l{declarative-sfw-dialer}{Declarative Serviceframework Dialer}
\endlist
*/
--- doc/src/si.qdoc
+++ doc/src/si.qdoc
@@ -114,7 +114,7 @@
qmake BACKEND=NetworkManager
\endcode
-The backend selection is expected to disappear once the API is integrated into Qt.
+The backend selection is expected to disappear once the API is integrated into Qt.
@@ -122,7 +122,7 @@
\annotatedlist systeminfo
-\section1 QML Classes
+\section1 QML Elements
The Qt SystemInfo offers access to system information through declarative
UI by providing systeminfo elements. Detailed information can be found
at \l{QML System Information Plugin}.
--- doc/src/tutorials.qdoc
+++ doc/src/tutorials.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** 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 Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
--- doc/src/tutorials/mapsnavigator.qdoc
+++ doc/src/tutorials/mapsnavigator.qdoc
@@ -7,11 +7,11 @@
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
+** 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 Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
--- examples/declarative-systeminfo/battery2/battery2.qml
+++ examples/declarative-systeminfo/battery2/battery2.qml
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at nokia.com)
+**
+** This file is part of the examples of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
import Qt 4.7
import QtMobility.systeminfo 1.1
--- examples/sensors/arrowkeys/main.cpp
+++ examples/sensors/arrowkeys/main.cpp
@@ -79,6 +79,10 @@
qWarning("No Accelerometer available!");
return EXIT_FAILURE;
}
+
+ const char* alwaysOn = "alwaysOn";
+ sensor.setProperty(alwaysOn, true);
+
AccelerometerFilter filter;
sensor.addFilter(&filter);
--- examples/sensors/metadata2/main.cpp
+++ examples/sensors/metadata2/main.cpp
@@ -48,6 +48,7 @@
#include <qrotationsensor.h>
#include <qtapsensor.h>
#include <QFile>
+#include <QDebug>
QTM_USE_NAMESPACE
@@ -68,12 +69,12 @@
for( int i = 0; i < sen_datarates.size(); ++i )
{
- datarates.append("[");
- QString num;
- datarates.append(num.setNum(sen_datarates[i].first));
- datarates.append("..");
- datarates.append(num.setNum(sen_datarates[i].second));
- datarates.append("] ");
+ datarates.append("[");
+ QString num;
+ datarates.append(num.setNum(sen_datarates[i].first));
+ datarates.append("..");
+ datarates.append(num.setNum(sen_datarates[i].second));
+ datarates.append("] ");
}
@@ -108,12 +109,8 @@
int main( int argc, char **argv )
{
QCoreApplication app(argc, argv);
-
QStringList args = app.arguments();
QString fileName = args.size()>1?args.at(1):"metadata.csv";
- QTextStream out2(stdout);
- out2<<fileName;
-
QFile file(fileName);
bool result = true;
@@ -122,35 +119,25 @@
QTextStream out(&file);
+ out <<"Identifier,Type,Description,OutputRanges,DataRates"<<endl;
-// QTextStream out(stdout);
-
- QSensor *sensors[8];
- sensors[0] = new QAccelerometer;
- sensors[1] = new QAmbientLightSensor;
- sensors[2] = new QCompass;
- sensors[3] = new QMagnetometer;
- sensors[4] = new QOrientationSensor;
- sensors[5] = new QProximitySensor;
- sensors[6] = new QRotationSensor;
- sensors[7] = new QTapSensor;
-
+ QList<QByteArray> types = QSensor::sensorTypes();
+ for (int j=0, l= types.size();j<l; j++ ){
- out <<"Identifier,Type,Description,OutputRanges,DataRates"<<endl;
+ const QByteArray type = types.at(j);
+ QList<QByteArray> ids = QSensor::sensorsForType(type);
- for( int i = 0; i < 8; ++i )
- {
- if( ! sensors[i] )
- {
- out << "sensor number " << i << " unavailable" << endl;
- continue;
- }
- if( ! sensors[i]->connectToBackend() )
+ for( int i = 0, ll=ids.size(); i < ll; ++i )
{
- out << "connectToBackend failed" << endl;
- result = false;
- } else {
- out << checkSensor(sensors[i] );
+ QSensor sensor(type);
+ sensor.setIdentifier(ids.at(i));
+ if( ! sensor.connectToBackend() )
+ {
+ qDebug() << "connectToBackend failed" << ids.at(i) <<endl;
+ result = false;
+ } else {
+ out << checkSensor(&sensor);
+ }
}
}
--- examples/sensors/panorama/gyroscopecontroller.cpp
+++ examples/sensors/panorama/gyroscopecontroller.cpp
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "inputcontroller.h"
+#include "gyroscopecontroller.h"
+
+GyroscopeController::GyroscopeController(): InputController(){
+ m_gyroscope.connectToBackend();
+ m_gyroscope.start();
+ connect(&m_gyroscope, SIGNAL(readingChanged()), this, SLOT(update()));
+}
+
+GyroscopeController::~GyroscopeController(){
+ m_gyroscope.stop();
+ disconnect(&m_gyroscope);
+}
+
+
+void GyroscopeController::update()
+{
+ qreal x = m_gyroscope.reading()->x();
+ qreal y= m_gyroscope.reading()->y();
+ m_dx = x;
+ m_dy= y;
+ updateCoordinates();
+
+}
+
+
+void GyroscopeController::updateCoordinates(){
+ m_x +=m_dx;
+ m_y +=m_dy;
+
+}
+
+
--- examples/sensors/panorama/gyroscopecontroller.h
+++ examples/sensors/panorama/gyroscopecontroller.h
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at nokia.com)
+**
+** This file is part of the examples of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GYROSCOPECONTROLLER_H
+#define GYROSCOPECONTROLLER_H
+
+#include "inputcontroller.h"
+#include <qgyroscope.h>
+
+QTM_USE_NAMESPACE
+
+class GyroscopeController : public InputController
+{
+ Q_OBJECT
+
+public:
+ GyroscopeController();
+ virtual ~GyroscopeController();
+ virtual void updateCoordinates();
+
+private slots:
+ void update();
+
+private:
+ QGyroscope m_gyroscope;
+ int m_dx, m_dy;
+
+};
+
+#endif // GYROSCOPECONTROLLER_H
--- examples/sensors/panorama/inputcontroller.cpp
+++ examples/sensors/panorama/inputcontroller.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info at nokia.com)
**
-** This file is part of the examples of the Qt Mobility Components.
+** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
@@ -40,6 +40,7 @@
#include "inputcontroller.h"
#include "view.h"
+const QString InputController::QGYROSCOPE = "QGyroscope";
const QString InputController::QACCELEROMETER="QAccelerometer";
const QString InputController::QORIENTATIONSENSOR = "QOrientationSensor";
const QString InputController::QMAGNETOMETER = "QMagnetometer";
--- examples/sensors/panorama/inputcontroller.h
+++ examples/sensors/panorama/inputcontroller.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info at nokia.com)
**
-** This file is part of the examples of the Qt Mobility Components.
+** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
@@ -59,7 +59,7 @@
virtual void keyPressEvent(QKeyEvent *e);
- static const QString QACCELEROMETER,
+ static const QString QGYROSCOPE, QACCELEROMETER,
QORIENTATIONSENSOR, QROTATIONSENSOR,
QMAGNETOMETER, QTAPSENSOR, QCOMPASS, QKEYS;
--- examples/sensors/panorama/panorama.pro
+++ examples/sensors/panorama/panorama.pro
@@ -13,7 +13,8 @@
magnetometercontroller.h \
orientationcontroller.h \
rotationcontroller.h \
- tapcontroller.h
+ tapcontroller.h \
+ gyroscopecontroller.h
SOURCES += main.cpp \
inputcontroller.cpp \
keycontroller.cpp \
@@ -24,6 +25,7 @@
magnetometercontroller.cpp \
orientationcontroller.cpp \
rotationcontroller.cpp \
- tapcontroller.cpp
+ tapcontroller.cpp \
+ gyroscopecontroller.cpp
RESOURCES += panorama.qrc
TARGET = panorama
--- examples/sensors/panorama/view.cpp
+++ examples/sensors/panorama/view.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info at nokia.com)
**
-** This file is part of the examples of the Qt Mobility Components.
+** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
@@ -46,6 +46,7 @@
#include "orientationcontroller.h"
#include "compasscontroller.h"
#include "tapcontroller.h"
+#include "gyroscopecontroller.h"
int View::m_imageWidth;
int View::m_imageHeight;
@@ -71,6 +72,7 @@
setSceneRect(0, y, width(), h);
+ m_sensors.append(InputController::QGYROSCOPE);
m_sensors.append(InputController::QACCELEROMETER);
m_sensors.append(InputController::QORIENTATIONSENSOR);
m_sensors.append(InputController::QMAGNETOMETER);
@@ -82,7 +84,8 @@
m_menu = new QMenu(this);
createActions();
- handleAction(NULL,InputController::QACCELEROMETER);
+// handleAction(NULL,InputController::QACCELEROMETER);
+ handleAction(NULL,InputController::QGYROSCOPE);
m_timer.setSingleShot(false);
m_timer.start(m_delay);
@@ -147,6 +150,10 @@
const QString sensor = m_sensors.at(i);
do{
+ if (sensor==InputController::QGYROSCOPE){
+ connect(tmp, SIGNAL(triggered()), this, SLOT(startGyroscope()));
+ break;
+ }
if (sensor==InputController::QACCELEROMETER){
connect(tmp, SIGNAL(triggered()), this, SLOT(startAccelerometer()));
break;
@@ -185,6 +192,12 @@
handleAction(m_currentSensor, InputController::QACCELEROMETER);
}
+
+void View::startGyroscope(){
+ handleAction(m_currentSensor, InputController::QGYROSCOPE);
+}
+
+
void View::startOrientationSensor(){
handleAction(m_currentSensor, InputController::QORIENTATIONSENSOR);
}
@@ -256,6 +269,10 @@
return;
}
+ if (sensor==InputController::QGYROSCOPE){
+ m_controller = new GyroscopeController();
+ return;
+ }
}
--- examples/sensors/panorama/view.h
+++ examples/sensors/panorama/view.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info at nokia.com)
**
-** This file is part of the examples of the Qt Mobility Components.
+** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
@@ -80,6 +80,7 @@
private slots:
void startAccelerometer();
+ void startGyroscope();
void startTapSensor();
void startMagnetometer();
void startRotationSensor();
--- examples/sensors/show_gyroscope
+++ examples/sensors/show_gyroscope
+(directory)
--- examples/sensors/show_gyroscope/main.cpp
+++ examples/sensors/show_gyroscope/main.cpp
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore>
+#include <qgyroscope.h>
+
+QTM_USE_NAMESPACE
+
+class GyroscopeFilter : public QGyroscopeFilter
+{
+public:
+ bool filter(QGyroscopeReading *reading)
+ {
+ int diff = ( reading->timestamp() - stamp );
+ stamp = reading->timestamp();
+ QTextStream out(stdout);
+ out << QString("Angular velocity: %1 x").arg(reading->x(), 5, 'f', 1)
+ << QString(" %1 y").arg(reading->y(), 5, 'f', 1)
+ << QString(" %1 z deg/s").arg(reading->z(), 5, 'f', 1)
+ << QString(" (%1 ms since last, %2 Hz)").arg(diff / 1000, 4).arg( 1000000.0 / diff, 5, 'f', 1) << endl;
+ return false; // don't store the reading in the sensor
+ }
+private:
+ qtimestamp stamp;
+};
+
+int main(int argc, char **argv)
+{
+ QCoreApplication app(argc, argv);
+ QStringList args = app.arguments();
+ int rate_place = args.indexOf("-r");
+ int rate_val = 0;
+ if (rate_place != -1)
+ rate_val = args.at(rate_place + 1).toInt();
+
+ QGyroscope sensor;
+ sensor.connectToBackend();
+
+ if (rate_val > 0) {
+ sensor.setDataRate(rate_val);
+ }
+ GyroscopeFilter filter;
+ sensor.addFilter(&filter);
+ sensor.start();
+ if (!sensor.isActive()) {
+ qWarning("Gyroscopesensor didn't start!");
+ return 1;
+ }
+
+ return app.exec();
+}
--- examples/sensors/show_gyroscope/show_gyroscope.pro
+++ examples/sensors/show_gyroscope/show_gyroscope.pro
+include(../sensors.pri)
+SOURCES = main.cpp
+TARGET = show_gyroscope
+
--- plugins/sensors/maemo6/maemo6.pri
+++ plugins/sensors/maemo6/maemo6.pri
@@ -2,6 +2,7 @@
maemo6accelerometer.h \
maemo6als.h \
maemo6compass.h \
+ maemo6gyroscope.h \
maemo6magnetometer.h \
maemo6orientationsensor.h \
maemo6proximitysensor.h \
@@ -12,6 +13,7 @@
maemo6accelerometer.cpp \
maemo6als.cpp \
maemo6compass.cpp \
+ maemo6gyroscope.cpp \
maemo6magnetometer.cpp \
maemo6orientationsensor.cpp \
maemo6proximitysensor.cpp \
--- plugins/sensors/maemo6/maemo6gyroscope.cpp
+++ plugins/sensors/maemo6/maemo6gyroscope.cpp
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "maemo6gyroscope.h"
+
+char const * const maemo6gyroscope::id("maemo6.gyroscope");
+const float maemo6gyroscope::MILLI = 0.001;
+bool maemo6gyroscope::m_initDone = false;
+
+maemo6gyroscope::maemo6gyroscope(QSensor *sensor)
+ : maemo6sensorbase(sensor)
+{
+ const QString sensorName = "gyroscopesensor";
+// initSensor<GyroscopeSensorChannelInterface>(sensorName, m_initDone);
+ setDescription(QLatin1String("angular velocity in "));
+ setRanges(MILLI);
+
+ if (m_sensorInterface){
+ if (!(QObject::connect(m_sensorInterface, SIGNAL(dataAvailable(const XYZ&)),
+ this, SLOT(slotDataAvailable(const XYZ&)))))
+ qWarning() << "Unable to connect "<< sensorName;
+ }
+ else
+ qWarning() << "Unable to initialize "<<sensorName;
+ setReading<QGyroscopeReading>(&m_reading);
+}
+
+void maemo6gyroscope::slotDataAvailable(const XYZ& data)
+{
+ m_reading.setX((qreal)(data.x()*MILLI));
+ m_reading.setY((qreal)(data.y()*MILLI));
+ m_reading.setZ((qreal)(data.z()*MILLI));
+ m_reading.setTimestamp(data.XYZData().timestamp_);
+ newReadingAvailable();
+}
+
--- plugins/sensors/maemo6/maemo6gyroscope.h
+++ plugins/sensors/maemo6/maemo6gyroscope.h
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAEMO6GYROSCOPE_H
+#define MAEMO6GYROSCOPE_H
+
+#include "maemo6sensorbase.h"
+#include <qgyroscope.h>
+#include <datatypes/xyz.h>
+//#include <gyroscopesensor_i.h>
+
+
+QTM_USE_NAMESPACE
+
+class maemo6gyroscope : public maemo6sensorbase
+{
+ Q_OBJECT
+
+public:
+ static char const * const id;
+ maemo6gyroscope(QSensor *sensor);
+
+private:
+ QGyroscopeReading m_reading;
+ static bool m_initDone;
+ static const float MILLI;
+private slots:
+ void slotDataAvailable(const XYZ& data);
+};
+
+
+#endif // MAEMO6GYROSCOPE_H
--- plugins/sensors/maemo6/maemo6sensorbase.cpp
+++ plugins/sensors/maemo6/maemo6sensorbase.cpp
@@ -47,9 +47,11 @@
const float maemo6sensorbase::GRAVITY_EARTH = 9.80665;
const float maemo6sensorbase::GRAVITY_EARTH_THOUSANDTH = 0.00980665;
+const int maemo6sensorbase::KErrNotFound=-1;
+const char* maemo6sensorbase::ALWAYS_ON = "alwaysOn";
maemo6sensorbase::maemo6sensorbase(QSensor *sensor)
- : QSensorBackend(sensor), m_sensorInterface(0)
+ : QSensorBackend(sensor), m_sensorInterface(0), m_prevOutputRange(-1)
{
if (!m_remoteSensorManager)
m_remoteSensorManager = &SensorManagerInterface::instance();
@@ -92,6 +94,14 @@
m_prevOutputRange = currentRange;
}
+
+ // TODO: always on
+ QVariant alwaysOn = sensor()->property(ALWAYS_ON);
+ alwaysOn.isValid()?
+ m_sensorInterface->setStandbyOverride(alwaysOn.toBool()):
+ m_sensorInterface->setStandbyOverride(false);
+
+
// TODO: buffer, if changed between starts
int returnCode = m_sensorInterface->start().error().type();
@@ -108,6 +118,7 @@
}
void maemo6sensorbase::setRanges(qreal correctionFactor){
+ if (!m_sensorInterface) return;
QList<DataRange> ranges = m_sensorInterface->getAvailableDataRanges();
--- plugins/sensors/maemo6/maemo6sensorbase.h
+++ plugins/sensors/maemo6/maemo6sensorbase.h
@@ -59,9 +59,11 @@
virtual void start();
virtual void stop();
AbstractSensorChannelInterface* m_sensorInterface;
+ static const char* ALWAYS_ON;
static const float GRAVITY_EARTH;
static const float GRAVITY_EARTH_THOUSANDTH; //for speed
+ static const int KErrNotFound;
void setRanges(qreal correctionFactor=1);
@@ -70,7 +72,10 @@
{
if (!initDone) {
- m_remoteSensorManager->loadPlugin(sensorName);
+ if (!m_remoteSensorManager->loadPlugin(sensorName)){
+ sensorError(KErrNotFound);
+ return;
+ }
m_remoteSensorManager->registerSensorInterface<T>(sensorName);
}
m_sensorInterface = T::controlInterface(sensorName);
@@ -78,6 +83,7 @@
m_sensorInterface = const_cast<T*>(T::listenInterface(sensorName));
}
if (!m_sensorInterface) {
+ sensorError(KErrNotFound);
return;
}
@@ -111,6 +117,7 @@
if (sensorName=="alssensor") return; // SensorFW returns lux values, plugin enumerated values
if (sensorName=="accelerometersensor") return; // SensorFW returns milliGs, plugin m/s^2
if (sensorName=="magnetometersensor") return; // SensorFW returns nanoTeslas, plugin Teslas
+ if (sensorName=="gyroscopesensor") return; // SensorFW returns DSPs, plugin milliDSPs
setDescription(m_sensorInterface->property("description").toString());
@@ -121,6 +128,7 @@
private:
static SensorManagerInterface* m_remoteSensorManager;
int m_prevOutputRange;
+
};
#endif
--- plugins/sensors/maemo6/main.cpp
+++ plugins/sensors/maemo6/main.cpp
@@ -47,6 +47,8 @@
#include "maemo6proximitysensor.h"
#include "maemo6rotationsensor.h"
#include "maemo6tapsensor.h"
+#include "maemo6gyroscope.h"
+
#include <qsensorplugin.h>
#include <qsensorbackend.h>
#include <qsensormanager.h>
@@ -67,6 +69,7 @@
QSensorManager::registerBackend(QProximitySensor::type, maemo6proximitysensor::id, this);
QSensorManager::registerBackend(QRotationSensor::type, maemo6rotationsensor::id, this);
QSensorManager::registerBackend(QTapSensor::type, maemo6tapsensor::id, this);
+ QSensorManager::registerBackend(QGyroscope::type, maemo6gyroscope::id, this);
qDebug() << "Loaded the Maemo 6 sensor plugin";
}
@@ -88,7 +91,8 @@
return new maemo6rotationsensor(sensor);
else if (sensor->identifier() == maemo6tapsensor::id)
return new maemo6tapsensor(sensor);
-
+ else if (sensor->identifier() == maemo6gyroscope::id)
+ return new maemo6gyroscope(sensor);
return 0;
}
};
--- src/contacts/details/qcontactaddress.h
+++ src/contacts/details/qcontactaddress.h
@@ -99,6 +99,9 @@
void setSubTypes(const QStringList& subTypes) {setValue(FieldSubTypes, subTypes);}
void setSubTypes(const QString& subType) {setValue(FieldSubTypes, QStringList(subType));}
QStringList subTypes() const {return value<QStringList>(FieldSubTypes);}
+
+ // Convenience filter
+ static QContactFilter match(const QString& subString);
};
QTM_END_NAMESPACE
--- src/contacts/details/qcontactdetails.cpp
+++ src/contacts/details/qcontactdetails.cpp
@@ -258,6 +258,21 @@
Sets the index of the favorite contact to \a index.
*/
+/*!
+ Returns a filter suitable for finding contacts which are marked
+ as favorite contacts.
+*/
+QContactFilter QContactFavorite::match()
+{
+ QContactDetailFilter f;
+ f.setDetailDefinitionName(QContactFavorite::DefinitionName,
+ QContactFavorite::FieldFavorite);
+ f.setValue(true);
+ f.setMatchFlags(QContactFilter::MatchExactly);
+
+ return f;
+}
+
/* ==================== QContactAnniversary ======================= */
/*!
@@ -682,6 +697,51 @@
Returns the list of subtypes that this detail implements.
*/
+/*!
+ Returns a filter suitable for finding contacts with an address which
+ contains the given \a subString in any of its fields.
+*/
+QContactFilter QContactAddress::match(const QString &subString)
+{
+ QContactDetailFilter f1;
+ f1.setDetailDefinitionName(QContactAddress::DefinitionName,
+ QContactAddress::FieldStreet);
+ f1.setValue(subString);
+ f1.setMatchFlags(QContactFilter::MatchContains);
+
+ QContactDetailFilter f2;
+ f2.setDetailDefinitionName(QContactAddress::DefinitionName,
+ QContactAddress::FieldLocality);
+ f2.setValue(subString);
+ f2.setMatchFlags(QContactFilter::MatchContains);
+
+ QContactDetailFilter f3;
+ f3.setDetailDefinitionName(QContactAddress::DefinitionName,
+ QContactAddress::FieldRegion);
+ f3.setValue(subString);
+ f3.setMatchFlags(QContactFilter::MatchContains);
+
+ QContactDetailFilter f4;
+ f4.setDetailDefinitionName(QContactAddress::DefinitionName,
+ QContactAddress::FieldPostcode);
+ f4.setValue(subString);
+ f4.setMatchFlags(QContactFilter::MatchContains);
+
+ QContactDetailFilter f5;
+ f5.setDetailDefinitionName(QContactAddress::DefinitionName,
+ QContactAddress::FieldCountry);
+ f5.setValue(subString);
+ f5.setMatchFlags(QContactFilter::MatchContains);
+
+ QContactDetailFilter f6;
+ f6.setDetailDefinitionName(QContactAddress::DefinitionName,
+ QContactAddress::FieldPostOfficeBox);
+ f6.setValue(subString);
+ f6.setMatchFlags(QContactFilter::MatchContains);
+
+ return (f1 | f2 | f3 | f4 | f5 | f6);
+}
+
/* ==================== QContactUrl ======================= */
/*!
@@ -1607,6 +1667,21 @@
Returns the tag associated with a contact which is stored in this detail.
*/
+/*!
+ Returns a filter suitable for finding contacts which have a tag which
+ contains the specified \a subString.
+*/
+QContactFilter QContactTag::match(const QString &subString)
+{
+ QContactDetailFilter f;
+ f.setDetailDefinitionName(QContactTag::DefinitionName,
+ QContactTag::FieldTag);
+ f.setValue(subString);
+ f.setMatchFlags(QContactFilter::MatchContains);
+
+ return f;
+}
+
/* ==================== QContactThumbnail ======================= */
/*!
@@ -1871,6 +1946,14 @@
Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::FieldServiceProvider, "ServiceProvider");
/*!
+ \variable QContactOnlineAccount::FieldProtocol
+
+ The field key constant for the account service provider name.
+ \sa protocol(), setProtocol()
+ */
+Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::FieldProtocol, "Protocol");
+
+/*!
\variable QContactOnlineAccount::FieldSubTypes
The field key constant for the field that stores the sub types of a QContactOnlineAccount.
@@ -1915,76 +1998,76 @@
Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::SubTypeVideoShare, "VideoShare");
/*!
- \variable QContactOnlineAccount::ServiceAim
+ \variable QContactOnlineAccount::ProtocolAim
- The predefined string constant for a service provider value,
+ The predefined string constant for a protocol value,
indicating this online account is for the AIM protocol.
- \sa serviceProvider(), setServiceProvider()
+ \sa protocol(), setProtocol()
*/
-Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ServiceAim, "Aim");
+Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ProtocolAim, "Aim");
/*!
- \variable QContactOnlineAccount::ServiceIcq
+ \variable QContactOnlineAccount::ProtocolIcq
- The predefined string constant for a service provider value,
+ The predefined string constant for a protocol value,
indicating this online account is for the ICQ protocol.
- \sa serviceProvider(), setServiceProvider()
+ \sa protocol(), setProtocol()
*/
-Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ServiceIcq, "Icq");
+Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ProtocolIcq, "Icq");
/*!
- \variable QContactOnlineAccount::ServiceIrc
+ \variable QContactOnlineAccount::ProtocolIrc
- The predefined string constant for a service provider value,
+ The predefined string constant for a protocol value,
indicating this online account is for the IRC protocol.
- \sa serviceProvider(), setServiceProvider()
+ \sa protocol(), setProtocol()
*/
-Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ServiceIrc, "Irc");
+Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ProtocolIrc, "Irc");
/*!
- \variable QContactOnlineAccount::ServiceJabber
+ \variable QContactOnlineAccount::ProtocolJabber
- The predefined string constant for a service provider value,
+ The predefined string constant for a protocol value,
indicating this online account is for the Jabber protocol.
- \sa serviceProvider(), setServiceProvider()
+ \sa protocol(), setProtocol()
*/
-Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ServiceJabber, "Jabber");
+Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ProtocolJabber, "Jabber");
/*!
- \variable QContactOnlineAccount::ServiceMsn
+ \variable QContactOnlineAccount::ProtocolMsn
- The predefined string constant for a service provider value,
+ The predefined string constant for a protocol value,
indicating this online account is for the MSN protocol.
- \sa serviceProvider(), setServiceProvider()
+ \sa protocol(), setProtocol()
*/
-Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ServiceMsn, "Msn");
+Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ProtocolMsn, "Msn");
/*!
- \variable QContactOnlineAccount::ServiceQq
+ \variable QContactOnlineAccount::ProtocolQq
- The predefined string constant for a service provider value,
+ The predefined string constant for a protocol value,
indicating this online account is for the Tecent QQ protocol.
- \sa serviceProvider(), setServiceProvider()
+ \sa protocol(), setProtocol()
*/
-Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ServiceQq, "Qq");
+Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ProtocolQq, "Qq");
/*!
- \variable QContactOnlineAccount::ServiceSkype
+ \variable QContactOnlineAccount::ProtocolSkype
- The predefined string constant for a service provider value,
+ The predefined string constant for a protocol value,
indicating this online account is for the Skype protocol.
- \sa serviceProvider(), setServiceProvider()
+ \sa protocol(), setProtocol()
*/
-Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ServiceSkype, "Skype");
+Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ProtocolSkype, "Skype");
/*!
- \variable QContactOnlineAccount::ServiceYahoo
+ \variable QContactOnlineAccount::ProtocolYahoo
- The predefined string constant for a service provider value,
+ The predefined string constant for a protocol value,
indicating this online account is for the Yahoo chat protocol.
- \sa serviceProvider(), setServiceProvider()
+ \sa protocol(), setProtocol()
*/
-Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ServiceYahoo, "Yahoo");
+Q_DEFINE_LATIN1_CONSTANT(QContactOnlineAccount::ProtocolYahoo, "Yahoo");
/*!
@@ -2605,6 +2688,21 @@
Returns the last-known status image url of the contact.
*/
+/*!
+ Returns a filter which matches any contact whose global presence state
+ is listed as \a state.
+ */
+QContactFilter QContactGlobalPresence::match(QContactPresence::PresenceState state)
+{
+ QContactDetailFilter f;
+ f.setDetailDefinitionName(QContactGlobalPresence::DefinitionName,
+ QContactGlobalPresence::FieldPresenceState);
+ f.setValue(state);
+ f.setMatchFlags(QContactFilter::MatchExactly);
+
+ return f;
+}
+
--- src/contacts/details/qcontactfavorite.h
+++ src/contacts/details/qcontactfavorite.h
@@ -67,6 +67,9 @@
bool isFavorite() const {return variantValue(FieldFavorite).toBool();}
void setIndex(int index) {setValue(FieldIndex, index);}
int index() const {return variantValue(FieldIndex).toInt();}
+
+ // Convenience filter
+ static QContactFilter match();
};
QTM_END_NAMESPACE
--- src/contacts/details/qcontactglobalpresence.h
+++ src/contacts/details/qcontactglobalpresence.h
@@ -87,6 +87,9 @@
QUrl presenceStateImageUrl() const {return value<QUrl>(FieldPresenceStateImageUrl);}
void setCustomMessage(const QString& customMessage) {setValue(FieldCustomMessage, customMessage);}
QString customMessage() const {return value(FieldCustomMessage);}
+
+ // convenience filtering functions
+ static QContactFilter match(QContactPresence::PresenceState state);
};
QTM_END_NAMESPACE
--- src/contacts/details/qcontactonlineaccount.h
+++ src/contacts/details/qcontactonlineaccount.h
@@ -59,6 +59,7 @@
static const QLatin1Constant DefinitionName;
static const QLatin1Constant FieldAccountUri;
static const QLatin1Constant FieldServiceProvider;
+ static const QLatin1Constant FieldProtocol;
static const QLatin1Constant FieldCapabilities;
static const QLatin1Constant FieldSubTypes;
static const QLatin1Constant SubTypeSip;
@@ -77,6 +78,7 @@
Q_DECLARE_CUSTOM_CONTACT_DETAIL(QContactOnlineAccount, "OnlineAccount")
Q_DECLARE_LATIN1_CONSTANT(FieldAccountUri, "AccountUri");
Q_DECLARE_LATIN1_CONSTANT(FieldServiceProvider, "ServiceProvider");
+ Q_DECLARE_LATIN1_CONSTANT(FieldProtocol, "Protocol");
Q_DECLARE_LATIN1_CONSTANT(FieldCapabilities, "Capabilities");
Q_DECLARE_LATIN1_CONSTANT(FieldSubTypes, "SubTypes");
Q_DECLARE_LATIN1_CONSTANT(SubTypeSip, "Sip");
@@ -86,14 +88,14 @@
// These strings are taken from
// http://telepathy.freedesktop.org/spec/Connection_Manager.html#Protocol
- Q_DECLARE_LATIN1_CONSTANT(ServiceAim, "Aim");
- Q_DECLARE_LATIN1_CONSTANT(ServiceIcq, "Icq");
- Q_DECLARE_LATIN1_CONSTANT(ServiceIrc, "Irc");
- Q_DECLARE_LATIN1_CONSTANT(ServiceJabber, "Jabber");
- Q_DECLARE_LATIN1_CONSTANT(ServiceMsn, "Msn");
- Q_DECLARE_LATIN1_CONSTANT(ServiceQq, "Qq");
- Q_DECLARE_LATIN1_CONSTANT(ServiceSkype, "Skype");
- Q_DECLARE_LATIN1_CONSTANT(ServiceYahoo, "Yahoo");
+ Q_DECLARE_LATIN1_CONSTANT(ProtocolAim, "Aim");
+ Q_DECLARE_LATIN1_CONSTANT(ProtocolIcq, "Icq");
+ Q_DECLARE_LATIN1_CONSTANT(ProtocolIrc, "Irc");
+ Q_DECLARE_LATIN1_CONSTANT(ProtocolJabber, "Jabber");
+ Q_DECLARE_LATIN1_CONSTANT(ProtocolMsn, "Msn");
+ Q_DECLARE_LATIN1_CONSTANT(ProtocolQq, "Qq");
+ Q_DECLARE_LATIN1_CONSTANT(ProtocolSkype, "Skype");
+ Q_DECLARE_LATIN1_CONSTANT(ProtocolYahoo, "Yahoo");
#endif
void setAccountUri(const QString& accountUri) {setValue(FieldAccountUri, accountUri);}
@@ -102,6 +104,9 @@
void setServiceProvider(const QString& serviceProvider) {setValue(FieldServiceProvider, serviceProvider);}
QString serviceProvider() const {return value(FieldServiceProvider);}
+ void setProtocol(const QString& protocol) {setValue(FieldProtocol, protocol);}
+ QString protocol() const {return value(FieldProtocol);}
+
void setCapabilities(const QStringList& capabilities) {setValue(FieldCapabilities, capabilities);}
QStringList capabilities() const {return value<QStringList>(FieldCapabilities);}
--- src/contacts/details/qcontacttag.h
+++ src/contacts/details/qcontacttag.h
@@ -64,6 +64,9 @@
void setTag(const QString& tag) {setValue(FieldTag, tag);}
QString tag() const {return value(FieldTag);}
+
+ // Convenience filter
+ static QContactFilter match(const QString& subString);
};
QTM_END_NAMESPACE
--- src/contacts/qcontactfilter.cpp
+++ src/contacts/qcontactfilter.cpp
@@ -48,8 +48,6 @@
#include "qcontactmanager.h"
-
-
/*!
\class QContactFilter
\brief The QContactFilter class is used to select contacts made available
--- src/contacts/qcontactmanager.cpp
+++ src/contacts/qcontactmanager.cpp
@@ -411,6 +411,7 @@
\value LimitReachedError The most recent operation failed because the limit for that type of object has been reached
\value NotSupportedError The most recent operation failed because the requested operation is not supported in the specified store
\value BadArgumentError The most recent operation failed because one or more of the parameters to the operation were invalid
+ \value TimeoutError The most recent operation failed because it took longer than expected. It may be possible to try again.
\value UnspecifiedError The most recent operation failed for an undocumented reason
*/
@@ -624,8 +625,7 @@
if all contacts were saved successfully.
For each newly saved contact that was successful, the id of the contact
- in the \a contacts list will be updated with the new value. If a failure occurs
- when saving a new contact, the id will be cleared.
+ in the \a contacts list will be updated with the new value.
\sa QContactManager::saveContact()
*/
@@ -661,8 +661,7 @@
if all contacts were saved successfully.
For each newly saved contact that was successful, the id of the contact
- in the \a contacts list will be updated with the new value. If a failure occurs
- when saving a new contact, the id will be cleared.
+ in the \a contacts list will be updated with the new value.
\sa QContactManager::saveContact()
*/
@@ -760,10 +759,9 @@
void QContactManager::contactsUpdated(const QList<QContactLocalId>& ids)
{
foreach (QContactLocalId id, ids) {
- QHash<QContactLocalId, QContactObserver*>::iterator it = d->m_observerForContact.find(id);
- while (it != d->m_observerForContact.end()) {
- (*it)->emitContactChanged();
- it++;
+ QList<QContactObserver*> observers = d->m_observerForContact.values(id);
+ foreach (QContactObserver* observer, observers) {
+ observer->emitContactChanged();
}
}
}
@@ -771,10 +769,9 @@
void QContactManager::contactsDeleted(const QList<QContactLocalId>& ids)
{
foreach (QContactLocalId id, ids) {
- QHash<QContactLocalId, QContactObserver*>::iterator it = d->m_observerForContact.find(id);
- while (it != d->m_observerForContact.end()) {
- (*it)->emitContactRemoved();
- it++;
+ QList<QContactObserver*> observers = d->m_observerForContact.values(id);
+ foreach (QContactObserver* observer, observers) {
+ observer->emitContactRemoved();
}
}
}
--- src/contacts/qcontactmanager.h
+++ src/contacts/qcontactmanager.h
@@ -103,7 +103,6 @@
static bool parseUri(const QString& uri, QString* managerName, QMap<QString, QString>* params);
static QString buildUri(const QString& managerName, const QMap<QString, QString>& params, int implementationVersion = -1);
- /* The values of the Error enum are still to be decided! */
enum Error {
NoError = 0,
DoesNotExistError,
@@ -119,7 +118,8 @@
UnspecifiedError,
VersionMismatchError,
LimitReachedError,
- InvalidContactTypeError
+ InvalidContactTypeError,
+ TimeoutError
};
/* Error reporting */
--- src/contacts/qcontactmanagerengine.cpp
+++ src/contacts/qcontactmanagerengine.cpp
@@ -1009,6 +1009,7 @@
f.setDataType(QVariant::String);
fields.insert(QContactOnlineAccount::FieldAccountUri, f);
fields.insert(QContactOnlineAccount::FieldServiceProvider, f);
+ fields.insert(QContactOnlineAccount::FieldProtocol, f);
f.setDataType(QVariant::StringList);
f.setAllowableValues(contexts);
fields.insert(QContactDetail::FieldContext, f);
--- src/gallery/maemo5/qgallerytrackerlistcolumn.cpp
+++ src/gallery/maemo5/qgallerytrackerlistcolumn.cpp
@@ -135,6 +135,4 @@
return new QGalleryTrackerFilePathColumn;
}
-#include "moc_qgallerytrackerlistcolumn_p.cpp"
-
QTM_END_NAMESPACE
--- src/gallery/maemo5/qgallerytrackerlistcolumn_p.h
+++ src/gallery/maemo5/qgallerytrackerlistcolumn_p.h
@@ -79,29 +79,6 @@
virtual QVariant value(QVector<QVariant>::const_iterator row) const = 0;
};
-class QM_AUTOTEST_EXPORT QGalleryTrackerImageColumn : public QObject
-{
- Q_OBJECT
-public:
- QGalleryTrackerImageColumn(QObject *parent = 0) : QObject(parent), m_offset(0) {}
-
- void moveOffset(int offset) { m_offset = offset; }
-
- QVariant image(int index) const { return m_images.at(index); }
-
- virtual void insertImages(
- int index, int count, QVector<QVariant>::const_iterator begin, int tableWidth) = 0;
-
- virtual void removeImages(int index, int count) = 0;
-
-Q_SIGNALS:
- void imagesChanged(int index, int count, const QList<int> &keys);
-
-protected:
- int m_offset;
- QVector<QVariant> m_images;
-};
-
class QGalleryTrackerStringColumn : public QGalleryTrackerValueColumn
{
public:
--- src/gallery/maemo5/qgallerytrackerresultset.cpp
+++ src/gallery/maemo5/qgallerytrackerresultset.cpp
@@ -43,7 +43,6 @@
#include "qgallerytrackermetadataedit_p.h"
-#include <QtCore/qtconcurrentrun.h>
#include <QtCore/qdatetime.h>
#include <QtDBus/qdbusreply.h>
@@ -55,6 +54,55 @@
QTM_BEGIN_NAMESPACE
+class QGalleryTrackerResultSetParser
+{
+public:
+ QGalleryTrackerResultSetParser(
+ QVector<QVariant> &values,
+ const QVector<QGalleryTrackerValueColumn *> &valueColumns,
+ int valueOffset,
+ int tableWidth)
+ : values(values)
+ , valueColumns(valueColumns)
+ , valueOffset(valueOffset)
+ , tableWidth(tableWidth)
+ {
+ }
+
+ QVector<QVariant> &values;
+ const QVector<QGalleryTrackerValueColumn *> &valueColumns;
+ const int valueOffset;
+ const int tableWidth;
+};
+
+const QDBusArgument &operator >>(
+ const QDBusArgument &argument, QGalleryTrackerResultSetParser &parser)
+{
+ QString string;
+ const QVariant variant;
+
+ argument.beginArray();
+ while (!argument.atEnd()) {
+ argument.beginArray();
+
+ int i = 0;
+ for (; !argument.atEnd() && i < parser.valueOffset; ++i) {
+ argument >> string;
+ parser.values.append(QVariant(string));
+ }
+ for (; !argument.atEnd() && i < parser.tableWidth; ++i) {
+ argument >> string;
+ parser.values.append(parser.valueColumns.at(i - parser.valueOffset)->toVariant(string));
+ }
+ for (; i < parser.tableWidth; ++i)
+ parser.values.append(variant);
+ argument.endArray();
+ }
+ argument.endArray();
+
+ return argument;
+}
+
void QGalleryTrackerResultSetPrivate::update()
{
flags &= ~UpdateRequested;
@@ -135,64 +183,47 @@
q_func()->QGalleryAbstractResponse::cancel();
} else {
- const int limit = queryLimit < 1 ? 1023 : queryLimit - iCache.count;
- const bool reset = flags & Reset;
+ parserLimit = queryLimit < 1 ? 1023 : queryLimit - iCache.count;
+ parserReset = flags & Reset;
+ queryReply = call.reply().arguments().at(0).value<QDBusArgument>();
flags &= ~Reset;
- parseWatcher.setFuture(QtConcurrent::run(
- this, &QGalleryTrackerResultSetPrivate::parseRows, call, limit, reset));
+ parserThread.start(QThread::LowPriority);
emit q_func()->progressChanged(progressMaximum - 1, progressMaximum);
}
}
-bool QGalleryTrackerResultSetPrivate::parseRows(
- const QDBusPendingCall &call, int limit, bool reset)
+void QGalleryTrackerResultSetPrivate::run()
{
- QDBusReply<QVector<QStringList> > reply(call);
-
- typedef QVector<QStringList>::const_iterator iterator;
-
- const QVector<QStringList> resultSet = reply.value();
-
- QVector<QVariant> &values = iCache.values;
-
- if (reset) {
- values.clear();
+ if (parserReset) {
+ iCache.values.clear();
iCache.count = 0;
}
- iCache.count += resultSet.count();
+ const int previousCount = iCache.count;
- values.reserve(iCache.count * tableWidth);
+ QGalleryTrackerResultSetParser parser(iCache.values, valueColumns, valueOffset, tableWidth);
- for (iterator it = resultSet.begin(), end = resultSet.end(); it != end; ++it) {
- for (int i = 0, count = qMin(valueOffset, it->count()); i < count; ++i)
- values.append(it->at(i));
+ queryReply >> parser;
- for (int i = valueOffset, count = qMin(tableWidth, it->count()); i < count; ++i)
- values.append(valueColumns.at(i - valueOffset)->toVariant(it->at(i)));
+ iCache.count += iCache.values.count() / tableWidth;
- // The rows should all have a count equal to tableWidth, but check just in case.
- for (int i = qMin(tableWidth, it->count()); i < tableWidth; ++i)
- values.append(QVariant());
- }
-
- if (resultSet.count() <= limit) {
- if (!values.isEmpty() && !sortCriteria.isEmpty()) {
+ if (previousCount - iCache.count <= parserLimit) {
+ if (!iCache.values.isEmpty() && !sortCriteria.isEmpty()) {
correctRows(
- row_iterator(values.begin(), tableWidth),
- row_iterator(values.end(), tableWidth),
+ row_iterator(iCache.values.begin(), tableWidth),
+ row_iterator(iCache.values.end(), tableWidth),
sortCriteria.constBegin(),
sortCriteria.constEnd());
}
synchronize();
- return true;
+ parserReset = true;
} else {
- return false;
+ parserReset = false;
}
}
@@ -519,7 +550,9 @@
{
processSyncEvents();
- if (parseWatcher.result()) {
+ queryReply = QDBusArgument();
+
+ if (parserReset) {
Q_ASSERT(rCache.offset == rCache.count);
Q_ASSERT(iCache.cutoff == iCache.count);
@@ -585,7 +618,7 @@
{
Q_D(QGalleryTrackerResultSet);
- connect(&d->parseWatcher, SIGNAL(finished()), this, SLOT(_q_parseFinished()));
+ connect(&d->parserThread, SIGNAL(finished()), this, SLOT(_q_parseFinished()));
d_func()->query();
}
@@ -597,7 +630,7 @@
{
Q_D(QGalleryTrackerResultSet);
- connect(&d->parseWatcher, SIGNAL(finished()), this, SLOT(_q_parseFinished()));
+ connect(&d->parserThread, SIGNAL(finished()), this, SLOT(_q_parseFinished()));
d_func()->query();
}
@@ -610,7 +643,7 @@
for (iterator it = d->edits.begin(), end = d->edits.end(); it != end; ++it)
(*it)->commit();
- d->parseWatcher.waitForFinished();
+ d->parserThread.wait();
}
QStringList QGalleryTrackerResultSet::propertyNames() const
@@ -776,7 +809,7 @@
return true;
} else if (d->flags & QGalleryTrackerResultSetPrivate::Active) {
if (d->waitForSyncFinish(msecs)) {
- d->parseWatcher.waitForFinished();
+ d->parserThread.wait();
d->_q_parseFinished();
--- src/gallery/maemo5/qgallerytrackerresultset_p_p.h
+++ src/gallery/maemo5/qgallerytrackerresultset_p_p.h
@@ -64,13 +64,27 @@
#include <QtCore/qcoreapplication.h>
#include <QtCore/qbasictimer.h>
#include <QtCore/qcoreevent.h>
-#include <QtCore/qfuturewatcher.h>
+#include <QtCore/qmutex.h>
#include <QtCore/qqueue.h>
+#include <QtCore/qrunnable.h>
+#include <QtCore/qthread.h>
#include <QtCore/qwaitcondition.h>
+#include <QtDBus/qdbusargument.h>
QTM_BEGIN_NAMESPACE
-class QGalleryTrackerResultSetPrivate : public QGalleryResultSetPrivate
+class QGalleryTrackerResultSetThread : public QThread
+{
+public:
+ QGalleryTrackerResultSetThread(QRunnable *runnable) : runnable(runnable) {}
+
+ void run() { runnable->run(); }
+
+private:
+ QRunnable *runnable;
+};
+
+class QGalleryTrackerResultSetPrivate : public QGalleryResultSetPrivate, public QRunnable
{
Q_DECLARE_PUBLIC(QGalleryTrackerResultSet)
public:
@@ -272,6 +286,8 @@
, currentIndex(-1)
, rowCount(0)
, progressMaximum(0)
+ , parserLimit(0)
+ , parserReset(false)
, queryInterface(arguments->queryInterface)
, queryMethod(arguments->queryMethod)
, queryArguments(arguments->queryArguments)
@@ -283,6 +299,7 @@
, aliasColumns(arguments->aliasColumns)
, sortCriteria(arguments->sortCriteria)
, resourceKeys(arguments->resourceKeys)
+ , parserThread(this)
{
arguments->clear();
@@ -314,6 +331,8 @@
int currentIndex;
int rowCount;
int progressMaximum;
+ int parserLimit;
+ bool parserReset;
const QGalleryDBusInterfacePointer queryInterface;
const QString queryMethod;
const QVariantList queryArguments;
@@ -330,7 +349,8 @@
Cache iCache; // Insert cache.
QScopedPointer<QDBusPendingCallWatcher> queryWatcher;
- QFutureWatcher<bool> parseWatcher;
+ QDBusArgument queryReply;
+ QGalleryTrackerResultSetThread parserThread;
QList<QGalleryTrackerMetaDataEdit *> edits;
QBasicTimer updateTimer;
SyncEventQueue syncEvents;
@@ -352,7 +372,7 @@
void query();
void queryFinished(const QDBusPendingCall &call);
- bool parseRows(const QDBusPendingCall &call, int limit, bool reset);
+ void run();
void correctRows(
row_iterator begin,
row_iterator end,
--- src/gallery/maemo6/qdocumentgallery_maemo6.cpp
+++ src/gallery/maemo6/qdocumentgallery_maemo6.cpp
@@ -106,8 +106,6 @@
QGalleryAbstractResponse *createItemListResponse(
QGalleryTrackerResultSetArguments *arguments,
- int offset,
- int limit,
bool isItemType,
bool autoUpdate,
QGalleryTrackerChangeNotifier* notifier);
@@ -216,8 +214,6 @@
} else {
return createItemListResponse(
&arguments,
- 0,
- 1,
schema.isItemType(),
request->autoUpdate(),
getChangeNotifier(schema.itemType()));
@@ -275,20 +271,13 @@
QGalleryAbstractResponse *QDocumentGalleryPrivate::createItemListResponse(
QGalleryTrackerResultSetArguments *arguments,
- int offset,
- int limit,
bool isItemType,
bool autoUpdate,
QGalleryTrackerChangeNotifier* notifier)
{
- QGalleryTrackerResultSet *response = 0;
-
- if (isItemType) {
- response = new QGalleryTrackerEditableResultSet(
- arguments, metaDataInterface(), autoUpdate, offset, limit);
- } else {
- response = new QGalleryTrackerResultSet(arguments, autoUpdate, offset, limit);
- }
+ QGalleryTrackerResultSet *response = isItemType
+ ? new QGalleryTrackerEditableResultSet(arguments, metaDataInterface(), autoUpdate)
+ : new QGalleryTrackerResultSet(arguments, autoUpdate);
if (autoUpdate) {
if (notifier) {
@@ -318,15 +307,15 @@
request->rootItem().toString(),
request->filter(),
request->propertyNames(),
- request->sortPropertyNames());
+ request->sortPropertyNames(),
+ request->offset(),
+ request->limit());
if (error != QDocumentGallery::NoError) {
return new QGalleryAbstractResponse(error);
} else {
return createItemListResponse(
&arguments,
- request->offset(),
- request->limit(),
schema.isItemType(),
request->autoUpdate(),
getChangeNotifier(request->rootType()) );
--- src/gallery/maemo6/qgallerytrackereditableresultset.cpp
+++ src/gallery/maemo6/qgallerytrackereditableresultset.cpp
@@ -58,10 +58,8 @@
QGalleryTrackerEditableResultSetPrivate(
QGalleryTrackerResultSetArguments *arguments,
const QGalleryDBusInterfacePointer &metaDataInterface,
- bool autoUpdate,
- int cursorPosition,
- int minimumPagedItems)
- : QGalleryTrackerResultSetPrivate(arguments, autoUpdate, cursorPosition, minimumPagedItems)
+ bool autoUpdate)
+ : QGalleryTrackerResultSetPrivate(arguments, autoUpdate)
, metaDataInterface(metaDataInterface)
, fieldNames(arguments->fieldNames)
{
@@ -75,12 +73,9 @@
QGalleryTrackerResultSetArguments *arguments,
const QGalleryDBusInterfacePointer &metaDataInterface,
bool autoUpdate,
- int cursorPosition,
- int minimumPagedItems,
QObject *parent)
: QGalleryTrackerResultSet(
- *new QGalleryTrackerEditableResultSetPrivate(
- arguments, metaDataInterface, autoUpdate, cursorPosition, minimumPagedItems),
+ *new QGalleryTrackerEditableResultSetPrivate(arguments, metaDataInterface, autoUpdate),
parent)
{
}
--- src/gallery/maemo6/qgallerytrackereditableresultset_p.h
+++ src/gallery/maemo6/qgallerytrackereditableresultset_p.h
@@ -69,8 +69,6 @@
QGalleryTrackerResultSetArguments *arguments,
const QGalleryDBusInterfacePointer &metaDataInterface,
bool autoUpdate,
- int cursorPosition,
- int minimumPagedItems,
QObject *parent = 0);
~QGalleryTrackerEditableResultSet();
--- src/gallery/maemo6/qgallerytrackerlistcolumn.cpp
+++ src/gallery/maemo6/qgallerytrackerlistcolumn.cpp
@@ -135,6 +135,4 @@
return new QGalleryTrackerFilePathColumn;
}
-#include "moc_qgallerytrackerlistcolumn_p.cpp"
-
QTM_END_NAMESPACE
--- src/gallery/maemo6/qgallerytrackerlistcolumn_p.h
+++ src/gallery/maemo6/qgallerytrackerlistcolumn_p.h
@@ -79,29 +79,6 @@
virtual QVariant value(QVector<QVariant>::const_iterator row) const = 0;
};
-class QM_AUTOTEST_EXPORT QGalleryTrackerImageColumn : public QObject
-{
- Q_OBJECT
-public:
- QGalleryTrackerImageColumn(QObject *parent = 0) : QObject(parent), m_offset(0) {}
-
- void moveOffset(int offset) { m_offset = offset; }
-
- QVariant image(int index) const { return m_images.at(index); }
-
- virtual void insertImages(
- int index, int count, QVector<QVariant>::const_iterator begin, int tableWidth) = 0;
-
- virtual void removeImages(int index, int count) = 0;
-
-Q_SIGNALS:
- void imagesChanged(int index, int count, const QList<int> &keys);
-
-protected:
- int m_offset;
- QVector<QVariant> m_images;
-};
-
class QGalleryTrackerStringColumn : public QGalleryTrackerValueColumn
{
public:
--- src/gallery/maemo6/qgallerytrackerresultset.cpp
+++ src/gallery/maemo6/qgallerytrackerresultset.cpp
@@ -43,19 +43,59 @@
#include "qgallerytrackermetadataedit_p.h"
-#include <QtCore/qtconcurrentrun.h>
#include <QtCore/qdatetime.h>
#include <QtDBus/qdbusreply.h>
#include <qdocumentgallery.h>
#include <qgalleryresource.h>
+#include <QtCore/qdebug.h>
Q_DECLARE_METATYPE(QVector<QStringList>)
QTM_BEGIN_NAMESPACE
-#define TRACKER_QUERY_MAX_LIMIT 1024
+class QGalleryTrackerResultSetParser
+{
+public:
+ QGalleryTrackerResultSetParser(
+ QVector<QVariant> &values,
+ const QVector<QGalleryTrackerValueColumn *> &valueColumns,
+ int tableWidth)
+ : values(values)
+ , valueColumns(valueColumns)
+ , tableWidth(tableWidth)
+ {
+ }
+
+ QVector<QVariant> &values;
+ const QVector<QGalleryTrackerValueColumn *> &valueColumns;
+ const int tableWidth;
+};
+
+const QDBusArgument &operator >>(
+ const QDBusArgument &argument, QGalleryTrackerResultSetParser &parser)
+{
+ QString string;
+ const QVariant variant;
+
+ argument.beginArray();
+ while (!argument.atEnd()) {
+ argument.beginArray();
+
+ int i = 0;
+ for (; !argument.atEnd() && i < parser.tableWidth; ++i) {
+ argument >> string;
+ parser.values.append(parser.valueColumns.at(i)->toVariant(string));
+ }
+ for (; i < parser.tableWidth; ++i)
+ parser.values.append(variant);
+ argument.endArray();
+ }
+ argument.endArray();
+
+ return argument;
+}
void QGalleryTrackerResultSetPrivate::update()
{
@@ -79,7 +119,6 @@
{
flags &= ~(Refresh | SyncFinished);
flags |= Active;
- flags |= Reset;
updateTimer.stop();
@@ -90,22 +129,9 @@
iCache.cutoff = 0;
qSwap(rCache.values, iCache.values);
- const int limit = queryLimit < 1 || queryLimit > TRACKER_QUERY_MAX_LIMIT
- ? TRACKER_QUERY_MAX_LIMIT
- : queryLimit;
- QString sparqlStatement = queryArguments.at( 0 ).toString();
- sparqlStatement += " LIMIT " + QString::number(limit);
- if (queryOffset > 0) {
- sparqlStatement += (queryOffset > 0
- ? QLatin1String(" OFFSET ") + QString::number(queryOffset)
- : QLatin1String(""));
- }
-
- QVariantList arguments(queryArguments);
- arguments.replace(0, sparqlStatement);
QDBusPendingCall call = queryInterface->asyncCallWithArgumentList(
- queryMethod, arguments);
+ QLatin1String("SparqlQuery"), QVariantList() << sparql);
if (call.isFinished()) {
queryFinished(call);
@@ -148,116 +174,25 @@
q_func()->QGalleryAbstractResponse::cancel();
} else {
- const int limit = queryLimit < 1 ? TRACKER_QUERY_MAX_LIMIT-1 : queryLimit - iCache.count;
- const bool reset = flags & Reset;
-
- flags &= ~Reset;
+ queryReply = call.reply().arguments().at(0).value<QDBusArgument>();
- parseWatcher.setFuture(QtConcurrent::run(
- this, &QGalleryTrackerResultSetPrivate::parseRows, call, limit, reset));
+ parserThread.start(QThread::LowPriority);
emit q_func()->progressChanged(progressMaximum - 1, progressMaximum);
}
}
-bool QGalleryTrackerResultSetPrivate::parseRows(
- const QDBusPendingCall &call, int limit, bool reset)
+void QGalleryTrackerResultSetPrivate::run()
{
- QDBusReply<QVector<QStringList> > reply(call);
-
- typedef QVector<QStringList>::const_iterator iterator;
-
- const QVector<QStringList> resultSet = reply.value();
-
- QVector<QVariant> &values = iCache.values;
-
- if (reset) {
- values.clear();
- iCache.count = 0;
- }
-
- iCache.count += resultSet.count();
+ iCache.values.clear();
- values.reserve(iCache.count * tableWidth);
+ QGalleryTrackerResultSetParser parser(iCache.values, valueColumns, tableWidth);
- for (iterator it = resultSet.begin(), end = resultSet.end(); it != end; ++it) {
- for (int i = 0, count = qMin(valueOffset, it->count()); i < count; ++i)
- values.append(it->at(i));
+ queryReply >> parser;
- for (int i = valueOffset, count = qMin(tableWidth, it->count()); i < count; ++i)
- values.append(valueColumns.at(i - valueOffset)->toVariant(it->at(i)));
+ iCache.count = iCache.values.count() / tableWidth;
- // The rows should all have a count equal to tableWidth, but check just in case.
- for (int i = qMin(tableWidth, it->count()); i < tableWidth; ++i)
- values.append(QVariant());
- }
-
- if (resultSet.count() <= limit) {
- if (!values.isEmpty() && !sortCriteria.isEmpty()) {
- correctRows(
- row_iterator(values.begin(), tableWidth),
- row_iterator(values.end(), tableWidth),
- sortCriteria.constBegin(),
- sortCriteria.constEnd());
- }
-
- synchronize();
-
- return true;
- } else {
- return false;
- }
-}
-
-void QGalleryTrackerResultSetPrivate::correctRows(
- row_iterator begin,
- row_iterator end,
- sort_iterator sortCriteria,
- sort_iterator sortEnd,
- bool reversed) const
-{
- int column = sortCriteria->column;
-
- const int sortFlags = sortCriteria->flags;
-
- if (sortFlags & QGalleryTrackerSortCriteria::Sorted) {
- if (reversed) {
- QAlgorithmsPrivate::qReverse(begin, end);
-
- reversed = false;
-
- if (++sortCriteria == sortEnd)
- return;
- } else do {
- column = sortCriteria->column;
-
- if (++sortCriteria == sortEnd)
- return;
- } while(sortCriteria->flags & QGalleryTrackerSortCriteria::Sorted);
- } else if (sortFlags & QGalleryTrackerSortCriteria::ReverseSorted) {
- if (!reversed) {
- QAlgorithmsPrivate::qReverse(begin, end);
-
- reversed = true;
-
- if (++sortCriteria == sortEnd)
- return;
- } else do {
- column = sortCriteria->column;
-
- if (++sortCriteria == sortEnd)
- return;
- } while(sortCriteria->flags & QGalleryTrackerSortCriteria::ReverseSorted);
- }
-
- for (row_iterator upper, lower = begin; lower != end; lower = upper) {
- int count = 1;
-
- for (upper = lower + 1; upper != end && lower[column] == upper[column]; ++upper, ++count) {}
-
- if (count > 1)
- correctRows(lower, upper, sortCriteria, sortEnd, reversed);
- }
+ synchronize();
}
void QGalleryTrackerResultSetPrivate::synchronize()
@@ -532,57 +467,22 @@
{
processSyncEvents();
- if (parseWatcher.result()) {
- Q_ASSERT(rCache.offset == rCache.count);
- Q_ASSERT(iCache.cutoff == iCache.count);
-
- rCache.values.clear();
- rCache.count = 0;
-
- flags &= ~Active;
-
- if (flags & Refresh)
- update();
- else
- emit q_func()->progressChanged(progressMaximum, progressMaximum);
-
- q_func()->finish(flags & Live);
- } else if (flags & Cancelled) {
- iCache.count = 0;
-
- flags &= ~Active;
-
- q_func()->QGalleryAbstractResponse::cancel();
- } else {
- const int offset = queryOffset + iCache.count;
- const int limit = queryLimit < 1 || queryLimit - iCache.count > TRACKER_QUERY_MAX_LIMIT
- ? TRACKER_QUERY_MAX_LIMIT
- : queryLimit - iCache.count;
-
- QString sparqlStatement = queryArguments.at( 0 ).toString();
- sparqlStatement += QLatin1String(" LIMIT ") + QString::number(limit);
- sparqlStatement += QLatin1String(" OFFSET ") + QString::number(offset);
+ queryReply = QDBusArgument();
- QVariantList arguments( queryArguments );
- arguments.replace( 0, sparqlStatement );
+ Q_ASSERT(rCache.offset == rCache.count);
+ Q_ASSERT(iCache.cutoff == iCache.count);
- QDBusPendingCall call = queryInterface->asyncCallWithArgumentList(
- queryMethod, arguments);
+ rCache.values.clear();
+ rCache.count = 0;
- if (call.isFinished()) {
- queryFinished(call);
- } else {
- queryWatcher.reset(new QDBusPendingCallWatcher(call));
-
- QObject::connect(
- queryWatcher.data(), SIGNAL(finished(QDBusPendingCallWatcher*)),
- q_func(), SLOT(_q_queryFinished(QDBusPendingCallWatcher*)));
+ flags &= ~Active;
- progressMaximum += 2;
+ if (flags & Refresh)
+ update();
+ else
+ emit q_func()->progressChanged(progressMaximum, progressMaximum);
- emit q_func()->progressChanged(progressMaximum - 2, progressMaximum);
- }
- }
+ q_func()->finish(flags & Live);
}
void QGalleryTrackerResultSetPrivate::_q_editFinished(QGalleryTrackerMetaDataEdit *edit)
@@ -593,19 +493,12 @@
}
QGalleryTrackerResultSet::QGalleryTrackerResultSet(
- QGalleryTrackerResultSetArguments *arguments,
- bool autoUpdate,
- int cursorPosition,
- int minimumPagedItems,
- QObject *parent)
- : QGalleryResultSet(
- *new QGalleryTrackerResultSetPrivate(
- arguments, autoUpdate, cursorPosition, minimumPagedItems),
- parent)
+ QGalleryTrackerResultSetArguments *arguments, bool autoUpdate, QObject *parent)
+ : QGalleryResultSet(*new QGalleryTrackerResultSetPrivate(arguments, autoUpdate), parent)
{
Q_D(QGalleryTrackerResultSet);
- connect(&d->parseWatcher, SIGNAL(finished()), this, SLOT(_q_parseFinished()));
+ connect(&d->parserThread, SIGNAL(finished()), this, SLOT(_q_parseFinished()));
d_func()->query();
}
@@ -617,7 +510,7 @@
{
Q_D(QGalleryTrackerResultSet);
- connect(&d->parseWatcher, SIGNAL(finished()), this, SLOT(_q_parseFinished()));
+ connect(&d->parserThread, SIGNAL(finished()), this, SLOT(_q_parseFinished()));
d_func()->query();
}
@@ -630,7 +523,7 @@
for (iterator it = d->edits.begin(), end = d->edits.end(); it != end; ++it)
(*it)->commit();
- d->parseWatcher.waitForFinished();
+ d->parserThread.wait();
}
QStringList QGalleryTrackerResultSet::propertyNames() const
@@ -796,7 +689,7 @@
return true;
} else if (d->flags & QGalleryTrackerResultSetPrivate::Active) {
if (d->waitForSyncFinish(msecs)) {
- d->parseWatcher.waitForFinished();
+ d->parserThread.wait();
d->_q_parseFinished();
--- src/gallery/maemo6/qgallerytrackerresultset_p.h
+++ src/gallery/maemo6/qgallerytrackerresultset_p.h
@@ -68,23 +68,6 @@
class QGalleryTrackerImageColumn;
class QGalleryTrackerSchema;
-struct QGalleryTrackerSortCriteria
-{
- enum Flag
- {
- Sorted = 0x01,
- ReverseSorted = 0x02,
- Ascending = 0x04,
- Descending = 0x08
- };
-
- QGalleryTrackerSortCriteria() : column(0), flags(0) {}
- QGalleryTrackerSortCriteria(short column, short flags) : column(column), flags(flags) {}
-
- short column;
- short flags;
-};
-
class QGalleryTrackerResultSetPrivate;
struct QGalleryTrackerResultSetArguments
@@ -122,8 +105,7 @@
int valueOffset;
int compositeOffset;
QGalleryDBusInterfacePointer queryInterface;
- QString queryMethod;
- QVariantList queryArguments;
+ QString sparql;
QStringList propertyNames;
QStringList fieldNames;
QVector<QGalleryProperty::Attributes> propertyAttributes;
@@ -131,7 +113,6 @@
QVector<QGalleryTrackerValueColumn *> valueColumns;
QVector<QGalleryTrackerCompositeColumn *> compositeColumns;
QVector<int> aliasColumns;
- QVector<QGalleryTrackerSortCriteria> sortCriteria;
QVector<int> resourceKeys;
QString service;
};
@@ -141,11 +122,7 @@
Q_OBJECT
public:
QGalleryTrackerResultSet(
- QGalleryTrackerResultSetArguments *arguments,
- bool autoUpdate,
- int cursorPosition,
- int minimumPagedItems,
- QObject *parent = 0);
+ QGalleryTrackerResultSetArguments *arguments, bool autoUpdate, QObject *parent = 0);
~QGalleryTrackerResultSet();
QStringList propertyNames() const;
--- src/gallery/maemo6/qgallerytrackerresultset_p_p.h
+++ src/gallery/maemo6/qgallerytrackerresultset_p_p.h
@@ -64,13 +64,27 @@
#include <QtCore/qcoreapplication.h>
#include <QtCore/qbasictimer.h>
#include <QtCore/qcoreevent.h>
-#include <QtCore/qfuturewatcher.h>
+#include <QtCore/qmutex.h>
#include <QtCore/qqueue.h>
+#include <QtCore/qrunnable.h>
+#include <QtCore/qthread.h>
#include <QtCore/qwaitcondition.h>
+#include <QtDBus/qdbusargument.h>
QTM_BEGIN_NAMESPACE
-class QGalleryTrackerResultSetPrivate : public QGalleryResultSetPrivate
+class QGalleryTrackerResultSetThread : public QThread
+{
+public:
+ QGalleryTrackerResultSetThread(QRunnable *runnable) : runnable(runnable) {}
+
+ void run() { runnable->run(); }
+
+private:
+ QRunnable *runnable;
+};
+
+class QGalleryTrackerResultSetPrivate : public QGalleryResultSetPrivate, public QRunnable
{
Q_DECLARE_PUBLIC(QGalleryTrackerResultSet)
public:
@@ -236,14 +250,11 @@
QVector<QVariant> values;
};
- typedef QVector<QGalleryTrackerSortCriteria>::const_iterator sort_iterator;
-
enum Flag
{
Cancelled = 0x01,
Live = 0x02,
Refresh = 0x04,
- Reset = 0x08,
UpdateRequested = 0x10,
Active = 0x20,
SyncFinished = 0x40
@@ -251,11 +262,7 @@
Q_DECLARE_FLAGS(Flags, Flag)
- QGalleryTrackerResultSetPrivate(
- QGalleryTrackerResultSetArguments *arguments,
- bool autoUpdate,
- int offset,
- int limit)
+ QGalleryTrackerResultSetPrivate(QGalleryTrackerResultSetArguments *arguments, bool autoUpdate)
: m_service( arguments->service )
, idColumn(arguments->idColumn.take())
, urlColumn(arguments->urlColumn.take())
@@ -267,23 +274,20 @@
, compositeOffset(arguments->compositeOffset)
, aliasOffset(compositeOffset + arguments->compositeColumns.count())
, columnCount(aliasOffset + arguments->aliasColumns.count())
- , queryOffset(offset)
- , queryLimit(limit)
, currentRow(0)
, currentIndex(-1)
, rowCount(0)
, progressMaximum(0)
, queryInterface(arguments->queryInterface)
- , queryMethod(arguments->queryMethod)
- , queryArguments(arguments->queryArguments)
+ , sparql(arguments->sparql)
, propertyNames(arguments->propertyNames)
, propertyAttributes(arguments->propertyAttributes)
, propertyTypes(arguments->propertyTypes)
, valueColumns(arguments->valueColumns)
, compositeColumns(arguments->compositeColumns)
, aliasColumns(arguments->aliasColumns)
- , sortCriteria(arguments->sortCriteria)
, resourceKeys(arguments->resourceKeys)
+ , parserThread(this)
{
arguments->clear();
@@ -311,15 +315,12 @@
const int compositeOffset;
const int aliasOffset;
const int columnCount;
- const int queryOffset;
- const int queryLimit;
QVector<QVariant>::const_iterator currentRow;
int currentIndex;
int rowCount;
int progressMaximum;
const QGalleryDBusInterfacePointer queryInterface;
- const QString queryMethod;
- const QVariantList queryArguments;
+ const QString sparql;
const QStringList propertyNames;
const QList<int> propertyKeys;
const QVector<QGalleryProperty::Attributes> propertyAttributes;
@@ -327,13 +328,13 @@
const QVector<QGalleryTrackerValueColumn *> valueColumns;
const QVector<QGalleryTrackerCompositeColumn *> compositeColumns;
const QVector<int> aliasColumns;
- const QVector<QGalleryTrackerSortCriteria> sortCriteria;
const QVector<int> resourceKeys;
Cache rCache; // Remove cache.
Cache iCache; // Insert cache.
QScopedPointer<QDBusPendingCallWatcher> queryWatcher;
- QFutureWatcher<bool> parseWatcher;
+ QDBusArgument queryReply;
+ QGalleryTrackerResultSetThread parserThread;
QList<QGalleryTrackerMetaDataEdit *> edits;
QBasicTimer updateTimer;
SyncEventQueue syncEvents;
@@ -355,13 +356,7 @@
void query();
void queryFinished(const QDBusPendingCall &call);
- bool parseRows(const QDBusPendingCall &call, int limit, bool reset);
- void correctRows(
- row_iterator begin,
- row_iterator end,
- const sort_iterator sortBegin,
- const sort_iterator sortEnd,
- bool reversed = false) const;
+ void run();
void synchronize();
--- src/gallery/maemo6/qgallerytrackerschema.cpp
+++ src/gallery/maemo6/qgallerytrackerschema.cpp
@@ -279,28 +279,6 @@
IsResource = 0x100,
PropertyMask = 0xFF
};
-
- class QGalleryReorderLessThan
- {
- public:
- QGalleryReorderLessThan(const QStringList &sortOrder)
- : m_sortOrder(QStringList(sortOrder)
- .replaceInStrings(QLatin1String("+"), QString())
- .replaceInStrings(QLatin1String("-"), QString()))
- {
- }
-
- bool operator ()(const QString &property1, const QString &property2) const
- {
- uint index1 = m_sortOrder.indexOf(property1);
- uint index2 = m_sortOrder.indexOf(property2);
-
- return index1 < index2;
- }
-
- private:
- QStringList m_sortOrder;
- };
}
#define QT_GALLERY_ITEM_PROPERTY(PropertyName, Field, Type, Attr) \
@@ -422,32 +400,26 @@
return qt_writeConditionHelper( error, query, filter.filters(), properties, composites, "||" );
}
-static QString qt_writePropertyFunctions( const QStringList &fields, const QString &variable )
+static void qt_write_comparison(
+ const QLatin1String &field, const QString &value, const char *op, QString *query)
{
- QString result;
- foreach ( const QString &field, fields )
- {
-
- int parenthesisCount = field.count('(');
- result += field;
- result += "(?";
- result += variable;
- result += ") ";
- while ( parenthesisCount-- > 0 )
- result += ") ";
- }
-
- return result.trimmed();
-}
-
-static void qt_write_comparison( const QString &field, const QString &value, const QString &op, const QString &variable_name, QString *query )
-{
- *query += "(" + qt_writePropertyFunctions( QStringList() << field, variable_name ) + op + "'" + value + "')";
-}
-
-static void qt_write_function( const QString &function, const QString &field, const QString &value, const QString &variable_name, QString *query )
-{
- *query += function + "(" + qt_writePropertyFunctions( QStringList() << field, variable_name ) + ",\"" + value + "\")";
+ *query += QLatin1String("(")
+ + field
+ + QLatin1String(op)
+ + QLatin1String("'")
+ + value
+ + QLatin1String("')");
+}
+
+static void qt_write_function(
+ const char *function, const QString &field, const QString &value, QString *query)
+{
+ *query += QLatin1String(function)
+ + QLatin1String("(")
+ + field
+ + QLatin1String(",\"")
+ + value
+ + QLatin1String("\")");
}
static bool qt_writeCondition(
@@ -465,37 +437,40 @@
int index;
if ((index = properties.indexOfProperty(propertyName)) != -1) {
-
switch (filter.comparator()) {
case QGalleryFilter::Equals:
- qt_write_comparison( properties[index].field, filter.value().toString(), "=", "x", query);
+ qt_write_comparison(properties[index].field, filter.value().toString(), "=", query);
break;
case QGalleryFilter::LessThan:
- qt_write_comparison( properties[index].field, filter.value().toString(), "<", "x", query);
+ qt_write_comparison(properties[index].field, filter.value().toString(), "<", query);
break;
case QGalleryFilter::GreaterThan:
- qt_write_comparison( properties[index].field, filter.value().toString(), ">", "x", query);
+ qt_write_comparison(properties[index].field, filter.value().toString(), ">", query);
break;
case QGalleryFilter::LessThanEquals:
- qt_write_comparison( properties[index].field, filter.value().toString(), "<=", "x", query);
+ qt_write_comparison(properties[index].field, filter.value().toString(), "<=", query);
break;
case QGalleryFilter::GreaterThanEquals:
- qt_write_comparison( properties[index].field, filter.value().toString(), ">=", "x", query);
+ qt_write_comparison(properties[index].field, filter.value().toString(), ">=", query);
break;
case QGalleryFilter::Contains:
- qt_write_function( "fn:contains", properties[index].field, filter.value().toString(), "x", query );
+ qt_write_function(
+ "fn:contains", properties[index].field, filter.value().toString(), query);
break;
case QGalleryFilter::StartsWith:
- qt_write_function( "fn:starts-with", properties[index].field, filter.value().toString(), "x", query );
+ qt_write_function(
+ "fn:starts-with", properties[index].field, filter.value().toString(), query);
break;
case QGalleryFilter::EndsWith:
- qt_write_function( "fn:ends-with", properties[index].field, filter.value().toString(), "x", query );
+ qt_write_function(
+ "fn:ends-with", properties[index].field, filter.value().toString(), query);
break;
case QGalleryFilter::Wildcard:
- qt_write_function( "fn:contains", properties[index].field, "*", "x", query );
+ qt_write_function(
+ "fn:contains", properties[index].field, "*", query);
break;
case QGalleryFilter::RegExp:
- qt_write_function( "REGEX", properties[index].field, filter.value().toString(), "x", query );
+ qt_write_function("REGEX", properties[index].field, filter.value().toString(), query);
break;
default:
*error = QDocumentGallery::FilterError;
@@ -521,26 +496,12 @@
{
switch (filter.type()) {
case QGalleryFilter::Intersection:
- {
- bool ret = qt_writeCondition(error, query, filter.toIntersectionFilter(), properties, composites);
- if (!ret)
- *query = "";
- return ret;
- }
+ return qt_writeCondition(
+ error, query, filter.toIntersectionFilter(), properties, composites);
case QGalleryFilter::Union:
- {
- bool ret = qt_writeCondition(error, query, filter.toUnionFilter(), properties, composites);
- if (!ret)
- *query = "";
- return ret;
- }
+ return qt_writeCondition(error, query, filter.toUnionFilter(), properties, composites);
case QGalleryFilter::MetaData:
- {
- bool ret = qt_writeCondition(error, query, filter.toMetaDataFilter(), properties, composites);
- if (!ret)
- *query = "";
- return ret;
- }
+ return qt_writeCondition(error, query, filter.toMetaDataFilter(), properties, composites);
default:
Q_ASSERT(filter.type() != QGalleryFilter::Invalid);
*error = QDocumentGallery::FilterError;
@@ -559,8 +520,8 @@
return false;
} else {
QString encodedValue(QUrl::fromLocalFile(filter.value().toString()).toEncoded());
- encodedValue.replace('\'',"\\\'");
- *query += "( nie:url(?x) ='" + encodedValue + "')";
+ encodedValue.replace(QLatin1Char('\''), QLatin1String("\\\'"));
+ *query += QLatin1String("( nie:url(?x) ='") + encodedValue + QLatin1String("')");
return true;
}
}
@@ -570,46 +531,25 @@
///////
#define QT_GALLERY_FILE_MIMETYPE_PROPERTY \
- QT_GALLERY_ITEM_PROPERTY("mimeType" , "nie:mimeType" , String, CanRead | CanSort | CanFilter | IsResource)
+ QT_GALLERY_ITEM_PROPERTY("mimeType" , "nie:mimeType(?x)" , String, CanRead | CanSort | CanFilter | IsResource)
// These are repeated in a few lists.
#define QT_GALLERY_FILE_PROPERTIES \
QT_GALLERY_FILE_MIMETYPE_PROPERTY, \
- QT_GALLERY_ITEM_PROPERTY("url" , "nie:url" , String , CanRead | CanSort | CanFilter), \
- QT_GALLERY_ITEM_PROPERTY("fileName" , "nfo:fileName" , String , CanRead | CanSort | CanFilter), \
- QT_GALLERY_ITEM_PROPERTY("fileSize" , "nfo:fileSize" , Int , QGalleryProperty::Attributes()), \
- QT_GALLERY_ITEM_PROPERTY("copyright" , "nie:copyright" , String , CanRead | CanWrite | CanSort | CanFilter), \
- QT_GALLERY_ITEM_PROPERTY("lastModified", "nfo:fileLastModified", DateTime, CanRead | CanSort | CanFilter), \
- QT_GALLERY_ITEM_PROPERTY("lastAccessed", "nfo:fileLastAccessed", DateTime, CanRead | CanSort | CanFilter)
- /*QT_GALLERY_ITEM_PROPERTY("" , "File:License" , String , QGalleryProperty::Attributes()),*/ \
- /*QT_GALLERY_ITEM_PROPERTY("path" , "File:Path" , String , CanRead | CanSort | CanFilter),*/ \
- /*QT_GALLERY_ITEM_PROPERTY("" , "File:Contents" , String , QGalleryProperty::Attributes()),*/ \
- /*QT_GALLERY_ITEM_PROPERTY("" , "File:Link" , String , QGalleryProperty::Attributes()),*/ \
- /*QT_GALLERY_ITEM_PROPERTY("" , "File:Added" , DateTime, QGalleryProperty::Attributes()),*/ \
- /*QT_GALLERY_ITEM_PROPERTY("" , "File:Other" , String , QGalleryProperty::Attributes()),*/ \
- /*QT_GALLERY_ITEM_PROPERTY("language" , "File:Language" , String , CanRead | CanSort | CanFilter) */
+ QT_GALLERY_ITEM_PROPERTY("url" , "nie:url(?x)" , String , CanRead | CanSort | CanFilter), \
+ QT_GALLERY_ITEM_PROPERTY("fileName" , "nfo:fileName(?x)" , String , CanRead | CanSort | CanFilter), \
+ QT_GALLERY_ITEM_PROPERTY("fileSize" , "nfo:fileSize(?x)" , Int , QGalleryProperty::Attributes()), \
+ QT_GALLERY_ITEM_PROPERTY("copyright" , "nie:copyright(?x)" , String , CanRead | CanWrite | CanSort | CanFilter), \
+ QT_GALLERY_ITEM_PROPERTY("lastModified", "nfo:fileLastModified(?x)", DateTime, CanRead | CanSort | CanFilter), \
+ QT_GALLERY_ITEM_PROPERTY("lastAccessed", "nfo:fileLastAccessed(?x)", DateTime, CanRead | CanSort | CanFilter)
static const QGalleryItemProperty qt_galleryFilePropertyList[] =
{
QT_GALLERY_FILE_PROPERTIES,
- QT_GALLERY_ITEM_PROPERTY("description", "nie:description", String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("subject" , "nie:subject" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("title" , "nie:title" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("keywords" , "nie:keyword" , StringList, CanRead | CanWrite | CanFilter)
-// QT_GALLERY_ITEM_PROPERTY("" , "DC:Contributor", String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "DC:Coverage" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("author" , "DC:Creator" , String , CanRead | CanWrite | CanSort | CanFilter),
-// QT_GALLERY_ITEM_PROPERTY("" , "DC:Date" , DateTime , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "DC:Format" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "DC:Identifier" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "DC:Language" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "DC:Publisher" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "DC:Relation" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "DC:Rights" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "DC:Source" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "DC:Keywords" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "DC:Type" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("rating" , "User:Rank" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("description", "nie:description(?x)", String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("subject" , "nie:subject(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("title" , "nie:title(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("keywords" , "nie:keyword(?x)" , StringList, CanRead | CanWrite | CanFilter)
};
#define QT_GALLERY_FILE_COMPOSITE_PROPERTIES \
@@ -626,36 +566,27 @@
////////
#define QT_GALLERY_AUDIO_ALBUMTITLE_PROPERTY \
- QT_GALLERY_ITEM_PROPERTY("albumTitle", "nmm:albumTitle(nmm:musicAlbum", String, CanRead | CanWrite | CanSort | CanFilter)
+ QT_GALLERY_ITEM_PROPERTY("albumTitle", "nmm:albumTitle(nmm:musicAlbum(?x))", String, CanRead | CanWrite | CanSort | CanFilter)
#define QT_GALLERY_AUDIO_ALBUMARTIST_PROPERTY \
- QT_GALLERY_ITEM_PROPERTY("albumArtist", "nmm:artistName(nmm:albumArtist(nmm:musicAlbum", String, CanRead | CanWrite | CanSort | CanFilter)
+ QT_GALLERY_ITEM_PROPERTY("albumArtist", "nmm:artistName(nmm:albumArtist(nmm:musicAlbum(?x)))", String, CanRead | CanWrite | CanSort | CanFilter)
static const QGalleryItemProperty qt_galleryAudioPropertyList[] =
{
QT_GALLERY_FILE_PROPERTIES,
QT_GALLERY_AUDIO_ALBUMTITLE_PROPERTY,
QT_GALLERY_AUDIO_ALBUMARTIST_PROPERTY,
- QT_GALLERY_ITEM_PROPERTY("title" , "nie:title" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("genre" , "nfo:genre" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("duration" , "nfo:duration" , Int , CanRead | CanSort | CanFilter | IsResource),
- QT_GALLERY_ITEM_PROPERTY("trackNumber" , "nmm:trackNumber" , Int , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("description" , "nie:description" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("audioCodec" , "nfo:codec" , String , CanRead | CanSort | CanFilter | IsResource),
- QT_GALLERY_ITEM_PROPERTY("sampleRate" , "nfo:sampleRate" , Int , CanRead | CanWrite | CanSort | CanFilter | IsResource),
- QT_GALLERY_ITEM_PROPERTY("audioBitRate", "nfo:averageAudioBitrate" , Int , CanRead | CanSort | CanFilter | IsResource),
- QT_GALLERY_ITEM_PROPERTY("channelCount", "nfo:channels" , Int , CanRead | CanSort | CanFilter | IsResource),
- QT_GALLERY_ITEM_PROPERTY("playCount" , "nie:usageCounter" , Int , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("lyrics" , "nmm:lyrics" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("artist" , "nmm:artistName(nmm:performer", String, CanRead | CanFilter | CanSort )
-// QT_GALLERY_ITEM_PROPERTY("" , "Audio:ReleaseDate" , DateTime , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("discNumber", "Audio:DiscNo" , Int , CanRead | CanWrite | CanSort | CanFilter),
-// QT_GALLERY_ITEM_PROPERTY("performer" , "Audio:Performer" , String , CanRead | CanWrite | CanSort | CanFilter),
-// QT_GALLERY_ITEM_PROPERTY("" , "Audio:TrackGain" , Double , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "Audio:AlbumGain" , Double , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "Audio:AlbumPeakGain", Double , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "Audio:CodecVersion" , String , CanRead | CanSort | CanFilter | IsResource),
-// QT_GALLERY_ITEM_PROPERTY("lastPlayed", "Audio:LastPlay" , DateTime , CanRead | CanWrite | CanSort | CanFilter),
-// QT_GALLERY_ITEM_PROPERTY("" , "Audio:DateAdded" , DateTime , QGalleryProperty::Attributes()),
+ QT_GALLERY_ITEM_PROPERTY("title" , "nie:title(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("genre" , "nfo:genre(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("duration" , "nfo:duration(?x)" , Int , CanRead | CanSort | CanFilter | IsResource),
+ QT_GALLERY_ITEM_PROPERTY("trackNumber" , "nmm:trackNumber(?x)" , Int , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("description" , "nie:description(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("audioCodec" , "nfo:codec(?x)" , String , CanRead | CanSort | CanFilter | IsResource),
+ QT_GALLERY_ITEM_PROPERTY("sampleRate" , "nfo:sampleRate(?x)" , Int , CanRead | CanWrite | CanSort | CanFilter | IsResource),
+ QT_GALLERY_ITEM_PROPERTY("audioBitRate", "nfo:averageAudioBitrate(?x)" , Int , CanRead | CanSort | CanFilter | IsResource),
+ QT_GALLERY_ITEM_PROPERTY("channelCount", "nfo:channels(?x)" , Int , CanRead | CanSort | CanFilter | IsResource),
+ QT_GALLERY_ITEM_PROPERTY("playCount" , "nie:usageCounter(?x)" , Int , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("lyrics" , "nmm:lyrics(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("artist" , "nmm:artistName(nmm:performer(?x))", String, CanRead | CanFilter | CanSort )
};
static const QGalleryCompositeProperty qt_galleryAudioCompositePropertyList[] =
@@ -670,10 +601,8 @@
static const QGalleryItemProperty qt_galleryPlaylistPropertyList[] =
{
QT_GALLERY_FILE_PROPERTIES,
- QT_GALLERY_ITEM_PROPERTY("duration" , "nfo:listDuration" , Int, CanRead | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("trackCount", "nfo:entryCounter" , Int, CanRead | CanSort | CanFilter)
-// QT_GALLERY_ITEM_PROPERTY("" , "Playlist:Name" , String, QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "Playlist:ValidDuration", String, QGalleryProperty::Attributes())
+ QT_GALLERY_ITEM_PROPERTY("duration" , "nfo:listDuration(?x)" , Int, CanRead | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("trackCount", "nfo:entryCounter(?x)" , Int, CanRead | CanSort | CanFilter)
};
static const QGalleryCompositeProperty qt_galleryPlaylistCompositePropertyList[] =
@@ -688,33 +617,18 @@
static const QGalleryItemProperty qt_galleryImagePropertyList[] =
{
QT_GALLERY_FILE_PROPERTIES,
- QT_GALLERY_ITEM_PROPERTY("height" , "nfo:height" , Int , CanRead | CanSort | CanFilter | IsResource),
- QT_GALLERY_ITEM_PROPERTY("width" , "nfo:width" , Int , CanRead | CanSort | CanFilter | IsResource),
- QT_GALLERY_ITEM_PROPERTY("author" , "dc:creator" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("comment" , "nie:comment" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("cameraModel" , "nmm:camera" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("orientation" , "nfo:orientation" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("exposureTime", "nmm:exposureTime", String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("fNumber" , "nmm:fnumber" , Int , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("flashEnabled", "nmm:flash" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("focalLength" , "nmm:focalLength" , Double , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("meteringMode", "nmm:meteringMode", String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("whiteBalance", "nmm:whiteBalance", Double , CanRead | CanWrite | CanSort | CanFilter),
-// QT_GALLERY_ITEM_PROPERTY("title" , "Image:Title" , String , CanRead | CanWrite | CanSort | CanFilter),
-// QT_GALLERY_ITEM_PROPERTY("keywords" , "Image:Keywords" , StringList, CanRead | CanWrite | CanFilter),
-// QT_GALLERY_ITEM_PROPERTY("" , "Image:Album" , String , CanRead | CanWrite | CanSort | CanFilter),
-// QT_GALLERY_ITEM_PROPERTY("dateTaken" , "Image:Date" , DateTime , CanRead | CanWrite | CanSort | CanFilter),
-// QT_GALLERY_ITEM_PROPERTY("description" , "Image:Description" , String , CanRead | CanWrite | CanSort | CanFilter),
-// QT_GALLERY_ITEM_PROPERTY("" , "Image:Software" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("cameraManufacturer", "Image:CameraMake" , String , CanRead | CanWrite | CanSort | CanFilter),
-// QT_GALLERY_ITEM_PROPERTY("exposureProgram" , "Image:ExposureProgram", String , CanRead | CanWrite | CanSort | CanFilter),
-// QT_GALLERY_ITEM_PROPERTY("" , "Image:ISOSpeed" , Double , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("rating" , "Image:Rating" , Int , CanRead | CanWrite | CanSort | CanFilter),
-// QT_GALLERY_ITEM_PROPERTY("" , "Image:Location" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "Image:Sublocation" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "Image:Country" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "Image:City" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "Image:HasKeywords" , String , QGalleryProperty::Attributes())
+ QT_GALLERY_ITEM_PROPERTY("height" , "nfo:height(?x)" , Int , CanRead | CanSort | CanFilter | IsResource),
+ QT_GALLERY_ITEM_PROPERTY("width" , "nfo:width(?x)" , Int , CanRead | CanSort | CanFilter | IsResource),
+ QT_GALLERY_ITEM_PROPERTY("author" , "dc:creator(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("comment" , "nie:comment(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("cameraModel" , "nmm:camera(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("orientation" , "nfo:orientation(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("exposureTime", "nmm:exposureTime(?x)", String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("fNumber" , "nmm:fnumber(?x)" , Int , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("flashEnabled", "nmm:flash(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("focalLength" , "nmm:focalLength(?x)" , Double , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("meteringMode", "nmm:meteringMode(?x)", String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("whiteBalance", "nmm:whiteBalance(?x)", Double , CanRead | CanWrite | CanSort | CanFilter),
};
static const QGalleryCompositeProperty qt_galleryImageCompositePropertyList[] =
@@ -729,18 +643,16 @@
static const QGalleryItemProperty qt_galleryVideoPropertyList[] =
{
QT_GALLERY_FILE_PROPERTIES,
- QT_GALLERY_ITEM_PROPERTY("author" , "dc:creator" , String, CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("height" , "nfo:height" , Int , CanRead | CanSort | CanFilter | IsResource),
- QT_GALLERY_ITEM_PROPERTY("width" , "nfo:width" , Int , CanRead | CanSort | CanFilter | IsResource),
- QT_GALLERY_ITEM_PROPERTY("duration" , "nfo:duration" , Int , CanRead | CanSort | CanFilter | IsResource),
- QT_GALLERY_ITEM_PROPERTY("comment" , "nie:comment" , String, CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("frameRate" , "nfo:frameRate" , Double, CanRead | CanSort | CanFilter | IsResource),
- QT_GALLERY_ITEM_PROPERTY("videoCodec" , "nfo:codec" , String, CanRead | CanSort | CanFilter | IsResource),
- QT_GALLERY_ITEM_PROPERTY("videoBitRate" , "nfo:averageBitrate" , Int , CanRead | CanSort | CanFilter | IsResource),
- QT_GALLERY_ITEM_PROPERTY("playCount" , "nie:usageCounter" , Int , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("resumePosition", "nfo:streamPosition" , Int , CanRead | CanWrite | CanSort | CanFilter)
-// QT_GALLERY_ITEM_PROPERTY("" , "Video:LastPlayedFrame", Int , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "Video:Source" , String, QGalleryProperty::Attributes())
+ QT_GALLERY_ITEM_PROPERTY("author" , "dc:creator(?x)" , String, CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("height" , "nfo:height(?x)" , Int , CanRead | CanSort | CanFilter | IsResource),
+ QT_GALLERY_ITEM_PROPERTY("width" , "nfo:width(?x)" , Int , CanRead | CanSort | CanFilter | IsResource),
+ QT_GALLERY_ITEM_PROPERTY("duration" , "nfo:duration(?x)" , Int , CanRead | CanSort | CanFilter | IsResource),
+ QT_GALLERY_ITEM_PROPERTY("comment" , "nie:comment(?x)" , String, CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("frameRate" , "nfo:frameRate(?x)" , Double, CanRead | CanSort | CanFilter | IsResource),
+ QT_GALLERY_ITEM_PROPERTY("videoCodec" , "nfo:codec(?x)" , String, CanRead | CanSort | CanFilter | IsResource),
+ QT_GALLERY_ITEM_PROPERTY("videoBitRate" , "nfo:averageBitrate(?x)" , Int , CanRead | CanSort | CanFilter | IsResource),
+ QT_GALLERY_ITEM_PROPERTY("playCount" , "nie:usageCounter(?x)" , Int , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("resumePosition", "nfo:streamPosition(?x)" , Int , CanRead | CanWrite | CanSort | CanFilter)
};
static const QGalleryCompositeProperty qt_galleryVideoCompositePropertyList[] =
@@ -755,14 +667,12 @@
static const QGalleryItemProperty qt_galleryDocumentPropertyList[] =
{
QT_GALLERY_FILE_PROPERTIES,
- QT_GALLERY_ITEM_PROPERTY("subject" , "nie:subject" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("author" , "dc:creator" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("keywords" , "nie:keyword" , StringList, CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("comment" , "nie:comment" , String , CanRead | CanWrite | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("pageCount", "nfo:pageCount", Int , CanRead | CanSort | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("wordCount", "nfo:wordCount", Int , CanRead | CanSort | CanFilter)
-// QT_GALLERY_ITEM_PROPERTY("" , "Doc:Creator" , String , QGalleryProperty::Attributes()),
-// QT_GALLERY_ITEM_PROPERTY("" , "Doc:URL" , String , QGalleryProperty::Attributes())
+ QT_GALLERY_ITEM_PROPERTY("subject" , "nie:subject(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("author" , "dc:creator(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("keywords" , "nie:keyword(?x)" , StringList, CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("comment" , "nie:comment(?x)" , String , CanRead | CanWrite | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("pageCount", "nfo:pageCount(?x)", Int , CanRead | CanSort | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("wordCount", "nfo:wordCount(?x)", Int , CanRead | CanSort | CanFilter)
};
static const QGalleryCompositeProperty qt_galleryDocumentCompositePropertyList[] =
@@ -770,40 +680,27 @@
QT_GALLERY_FILE_COMPOSITE_PROPERTIES
};
-
-static const QGalleryItemProperty qt_galleryAlbumIdentity[] =
-{
- QT_GALLERY_ITEM_PROPERTY("artist", "Audio:AlbumArtist", String, CanRead | CanFilter | CanSort),
- QT_GALLERY_ITEM_PROPERTY("title" , "Audio:Album" , String, CanRead | CanFilter | CanSort)
-};
-
static const QGalleryItemProperty qt_galleryAlbumPropertyList[] =
{
- QT_GALLERY_ITEM_PROPERTY("title" , "nmm:albumTitle" , String, CanRead | CanFilter | CanSort),
- QT_GALLERY_ITEM_PROPERTY("albumTitle" , "nmm:albumTitle" , String, CanRead | CanFilter | CanSort),
- QT_GALLERY_ITEM_PROPERTY("artist" , "nmm:artistName(nmm:albumArtist", String, CanRead | CanFilter | CanSort),
- QT_GALLERY_ITEM_PROPERTY("albumArtist", "nmm:artistName(nmm:albumArtist", String, CanRead | CanFilter | CanSort),
- QT_GALLERY_ITEM_PROPERTY("trackCount" , "nmm:albumTrackCount", Int , CanRead | CanFilter | CanSort),
- QT_GALLERY_ITEM_PROPERTY("duration" , "nmm:albumDuration" , Int , CanRead | CanFilter | CanSort)
+ QT_GALLERY_ITEM_PROPERTY("title" , "nmm:albumTitle(?x)" , String, CanRead | CanFilter | CanSort),
+ QT_GALLERY_ITEM_PROPERTY("albumTitle" , "nmm:albumTitle(?x)" , String, CanRead | CanFilter | CanSort),
+ QT_GALLERY_ITEM_PROPERTY("artist" , "nmm:artistName(nmm:albumArtist(?x))", String, CanRead | CanFilter | CanSort),
+ QT_GALLERY_ITEM_PROPERTY("albumArtist", "nmm:artistName(nmm:albumArtist(?x))", String, CanRead | CanFilter | CanSort),
+ QT_GALLERY_ITEM_PROPERTY("trackCount" , "nmm:albumTrackCount(?x)", Int , CanRead | CanFilter | CanSort),
+ QT_GALLERY_ITEM_PROPERTY("duration" , "nmm:albumDuration(?x)" , Int , CanRead | CanFilter | CanSort)
};
static const QGalleryItemProperty qt_galleryArtistPropertyList[] =
{
- QT_GALLERY_ITEM_PROPERTY("artist", "nmm:artistName", String, CanRead | CanFilter | CanSort),
- QT_GALLERY_ITEM_PROPERTY("title" , "nmm:artistName", String, CanRead | CanFilter | CanSort)
+ QT_GALLERY_ITEM_PROPERTY("artist", "nmm:artistName(?x)", String, CanRead | CanFilter | CanSort),
+ QT_GALLERY_ITEM_PROPERTY("title" , "nmm:artistName(?x)", String, CanRead | CanFilter | CanSort)
};
-//static const QGalleryAggregateProperty qt_galleryArtistAggregateList[] =
-//{
-// QT_GALLERY_AGGREGATE_PROPERTY("duration" , "Audio:Duration", "SUM" , Int),
-// QT_GALLERY_AGGREGATE_PROPERTY("trackCount", "*" , "COUNT", Int),
-//};
-
static const QGalleryItemProperty qt_galleryPhotoAlbumPropertyList[] =
{
- QT_GALLERY_ITEM_PROPERTY("title", "nie:title", String, CanRead | CanFilter | CanSort),
- QT_GALLERY_ITEM_PROPERTY("count", "nfo:entryCounter", String, CanRead | CanFilter | CanSort),
- QT_GALLERY_ITEM_PROPERTY("trackCount", "nfo:entryCounter", String, CanRead | CanFilter | CanSort)
+ QT_GALLERY_ITEM_PROPERTY("title" , "nie:title(?x)" , String, CanRead | CanFilter | CanSort),
+ QT_GALLERY_ITEM_PROPERTY("count" , "nfo:entryCounter(?x)", String, CanRead | CanFilter | CanSort),
+ QT_GALLERY_ITEM_PROPERTY("trackCount", "nfo:entryCounter(?x)", String, CanRead | CanFilter | CanSort)
};
/////////////
@@ -832,13 +729,13 @@
static const QGalleryItemProperty qt_galleryAudioGenreIdentity[] =
{
- QT_GALLERY_ITEM_PROPERTY("title", "nfo:genre", String, CanRead | CanFilter)
+ QT_GALLERY_ITEM_PROPERTY("title", "nfo:genre(?x)", String, CanRead | CanFilter)
};
static const QGalleryItemProperty qt_galleryAudioGenrePropertyList[] =
{
-// QT_GALLERY_ITEM_PROPERTY("genre", "nfo:genre", String, CanRead | CanFilter),
- QT_GALLERY_ITEM_PROPERTY("title", "nfo:genre", String, CanRead | CanFilter)
+// QT_GALLERY_ITEM_PROPERTY("genre", "nfo:genre(?x)", String, CanRead | CanFilter),
+ QT_GALLERY_ITEM_PROPERTY("title", "nfo:genre(?x)", String, CanRead | CanFilter)
};
static const QGalleryAggregateProperty qt_galleryAudioGenreAggregateList[] =
@@ -872,11 +769,19 @@
QVariant value(QVector<QVariant>::const_iterator row) const;
};
+class QGalleryTrackerServiceIndexColumn : public QGalleryTrackerValueColumn
+{
+public:
+ QGalleryTrackerServiceIndexColumn() {}
+
+ QVariant toVariant(const QString &string) const;
+};
+
QVariant QGalleryTrackerServicePrefixColumn::value(QVector<QVariant>::const_iterator row) const
{
QGalleryItemTypeList itemTypes(qt_galleryItemTypeList);
- const int index = itemTypes.indexOfRdfTypes((row + 2)->toString().split(QLatin1Char(',')));
+ const int index = (row + 2)->toInt();
return index != -1
? QVariant(itemTypes[index].prefix + row->toString())
@@ -887,12 +792,18 @@
{
QGalleryItemTypeList itemTypes(qt_galleryItemTypeList);
- const int index = itemTypes.indexOfRdfTypes((row + 2)->toString().split(QLatin1Char(',')));
+ const int index = (row + 2)->toInt();
return index != -1
? QVariant(itemTypes[index].itemType)
: QVariant(QLatin1String("File"));
+}
+
+QVariant QGalleryTrackerServiceIndexColumn::toVariant(const QString &string) const
+{
+ QGalleryItemTypeList itemTypes(qt_galleryItemTypeList);
+ return itemTypes.indexOfRdfTypes(string.split(QLatin1Char(',')));
}
QGalleryTrackerSchema::QGalleryTrackerSchema(const QString &itemType)
@@ -1012,19 +923,22 @@
const QStringList &propertyNames) const
{
if (m_itemIndex >= 0) {
- QString query( "FILTER(?x=<" + qt_galleryItemTypeList[m_itemIndex].prefix.strip( itemId ).toString() + ">)" );
- populateItemArguments(arguments, dbus, query, propertyNames, QStringList());
+ QString query
+ = QLatin1String("FILTER(?x=<")
+ + qt_galleryItemTypeList[m_itemIndex].prefix.strip(itemId).toString()
+ + QLatin1String(">)");
+ populateItemArguments(arguments, dbus, query, propertyNames, QStringList(), 0, 0);
return QDocumentGallery::NoError;
} else if (m_aggregateIndex >= 0) {
- Q_ASSERT( qt_galleryAggregateTypeList[m_aggregateIndex].identity.count == 1 );
- QString query( "FILTER(xsd:string("
- + qt_galleryAggregateTypeList[m_aggregateIndex].identity[0].field
- + "(?x))=\""
- + qt_galleryAggregateTypeList[m_aggregateIndex].prefix.strip(itemId) .toString()
- + "\")"
- );
- populateAggregateArguments(arguments, dbus, query, propertyNames, QStringList());
+ Q_ASSERT(qt_galleryAggregateTypeList[m_aggregateIndex].identity.count == 1);
+ QString query
+ = QLatin1String("FILTER(xsd:string(")
+ + qt_galleryAggregateTypeList[m_aggregateIndex].identity[0].field
+ + QLatin1String("=\"")
+ + qt_galleryAggregateTypeList[m_aggregateIndex].prefix.strip(itemId) .toString()
+ + QLatin1String("\")");
+ populateAggregateArguments(arguments, dbus, query, propertyNames, QStringList(), 0, 0);
return QDocumentGallery::NoError;
}
@@ -1039,7 +953,9 @@
const QString &rootItemId,
const QGalleryFilter &filter,
const QStringList &propertyNames,
- const QStringList &sortPropertyNames) const
+ const QStringList &sortPropertyNames,
+ int offset,
+ int limit) const
{
QString query;
@@ -1048,11 +964,13 @@
if (error != QDocumentGallery::NoError) {
return error;
} else if (m_itemIndex >= 0) {
- populateItemArguments(arguments, dbus, query, propertyNames, sortPropertyNames);
+ populateItemArguments(
+ arguments, dbus, query, propertyNames, sortPropertyNames, offset, limit);
return QDocumentGallery::NoError;
} else if (m_aggregateIndex >= 0) {
- populateAggregateArguments(arguments, dbus, query, propertyNames, sortPropertyNames);
+ populateAggregateArguments(
+ arguments, dbus, query, propertyNames, sortPropertyNames, offset, limit);
return QDocumentGallery::NoError;
} else {
@@ -1093,10 +1011,9 @@
arguments->queryMethod = QLatin1String("SparqlQuery");
if (type.service == "nfo:Media") {
- arguments->queryArguments = QVariantList()
- << QLatin1String(
- "SELECT COUNT(DISTINCT ?x) "
- "WHERE {?urn rdf:type nfo:Media. ?urn nfo:genre ?x}");
+ arguments->queryArguments = QVariantList() << QLatin1String(
+ "SELECT COUNT(DISTINCT ?x) "
+ "WHERE {?urn rdf:type nfo:Media. ?urn nfo:genre ?x}");
}
return QDocumentGallery::NoError;
@@ -1129,20 +1046,17 @@
if (itemTypes[index].itemType == QDocumentGallery::Artist) {
if (m_itemIndex >= 0) {
QString property;
- QString variable;
if (qt_galleryItemTypeList[m_itemIndex].itemType == QDocumentGallery::Album) {
rootItemStatement = QLatin1String("{?track nie:isLogicalPartOf ?x}");
- property = QLatin1String("nmm:performer");
- variable = QLatin1String("track");
+ property = QLatin1String("nmm:performer(?track)");
} else if (qt_galleryItemTypeList[m_itemIndex].itemType == QDocumentGallery::Audio) {
- property = QLatin1String("nmm:performer");
- variable = QLatin1String("x");
+ property = QLatin1String("nmm:performer(?x)");
}
if (!property.isEmpty()) {
if (!filterStatement.isEmpty())
filterStatement += QLatin1String(" && ");
filterStatement
- += qt_writePropertyFunctions(QStringList(property),variable)
+ += property
+ QLatin1String("=<")
+ itemTypes[index].prefix.strip(rootItemId).toString()
+ QLatin1String(">");
@@ -1154,15 +1068,15 @@
QString property;
if (m_itemIndex >= 0) {
if (qt_galleryItemTypeList[m_itemIndex].itemType == QDocumentGallery::Audio)
- property = QLatin1String("nmm:albumArtist(nmm:musicAlbum");
+ property = QLatin1String("nmm:albumArtist(nmm:musicAlbum(?x))");
else if (qt_galleryItemTypeList[m_itemIndex].itemType == QDocumentGallery::Album)
- property = QLatin1String("nmm:albumArtist");
+ property = QLatin1String("nmm:albumArtist(?x)");
}
if (!property.isEmpty()) {
if (!filterStatement.isEmpty())
filterStatement += QLatin1String(" && ");
filterStatement
- += qt_writePropertyFunctions( QStringList(property), QLatin1String("x"))
+ += property
+ QLatin1String("=<")
+ itemTypes[index].prefix.strip(rootItemId).toString()
+ QLatin1String(">");
@@ -1175,14 +1089,14 @@
QString property;
if (qt_galleryItemTypeList[m_itemIndex].updateMask & FileMask) {
if (scope == QGalleryQueryRequest::DirectDescendants) {
- property = QLatin1String("nfo:belongsToContainer");
+ property = QLatin1String("nfo:belongsToContainer(?x)");
if (!filterStatement.isEmpty())
filterStatement += QLatin1String(" && ");
filterStatement
- += qt_writePropertyFunctions( QStringList(property), QLatin1String("x"))
+ += property
+ QLatin1String("=<")
+ rootUrn
- +QLatin1String(">");
+ + QLatin1String(">");
} else {
if (!filterStatement.isEmpty())
filterStatement += QLatin1String(" && ");
@@ -1203,13 +1117,12 @@
}
} else if (itemTypes[index].itemType == QDocumentGallery::Album) {
if (m_itemIndex) {
- if (qt_galleryItemTypeList[m_itemIndex].itemType == QDocumentGallery::Audio)
- {
- QString property = QLatin1String("nie:isLogicalPartOf");
+ if (qt_galleryItemTypeList[m_itemIndex].itemType == QDocumentGallery::Audio) {
+ QString property = QLatin1String("nie:isLogicalPartOf(?x)");
if (!filterStatement.isEmpty())
filterStatement += QLatin1String(" && ");
filterStatement
- += qt_writePropertyFunctions( QStringList(property), QLatin1String("x"))
+ += property
+ QLatin1String("=\"")
+ itemTypes[index].prefix.strip(rootItemId).toString()
+QLatin1String("\"");
@@ -1222,11 +1135,11 @@
} else if (itemTypes[index].itemType == QDocumentGallery::PhotoAlbum) {
if (m_itemIndex) {
if (qt_galleryItemTypeList[m_itemIndex].itemType == QDocumentGallery::Image) {
- QString property = QLatin1String("nie:isLogicalPartOf");
+ QString property = QLatin1String("nie:isLogicalPartOf(?x)");
if (!filterStatement.isEmpty())
filterStatement += QLatin1String(" && ");
filterStatement
- += qt_writePropertyFunctions( QStringList(property), QLatin1String("x"))
+ += property
+ QLatin1String("=\"")
+ itemTypes[index].prefix.strip(rootItemId).toString()
+QLatin1String("\"");
@@ -1240,30 +1153,30 @@
if (m_itemIndex >= 0) {
QString property;
if (qt_galleryItemTypeList[m_itemIndex].itemType == QDocumentGallery::Audio) {
- property = QLatin1String("nfo:genre");
+ property = QLatin1String("nfo:genre(?x)");
if (!filterStatement.isEmpty())
filterStatement += QLatin1String(" && ");
filterStatement
- += qt_writePropertyFunctions(QStringList(property),"x")
+ += property
+ QLatin1String("=\"")
+ aggregateTypes[index].prefix.strip(rootItemId).toString()
+ QLatin1String("\"");
} else if (qt_galleryItemTypeList[m_itemIndex].itemType == QDocumentGallery::Album) {
rootItemStatement = QLatin1String("{?track nie:isLogicalPartOf ?x}");
- property = QLatin1String("nfo:genre");
+ property = QLatin1String("nfo:genre(?track)");
if (!filterStatement.isEmpty())
filterStatement += QLatin1String(" && ");
filterStatement
- += qt_writePropertyFunctions(QStringList(property),"track")
+ += property
+ QLatin1String("=\"")
+ aggregateTypes[index].prefix.strip(rootItemId).toString()
+ QLatin1String("\"");
} else if (qt_galleryItemTypeList[m_itemIndex].itemType == QDocumentGallery::Artist) {
- property = QLatin1String("nfo:genre");
+ property = QLatin1String("nfo:genre(?y)");
if (!filterStatement.isEmpty())
filterStatement += QLatin1String(" && ");
filterStatement
- += qt_writePropertyFunctions(QStringList(property),"y")
+ += property
+ QLatin1String("=\"")
+ aggregateTypes[index].prefix.strip(rootItemId).toString()
+ QLatin1String("\"");
@@ -1340,23 +1253,39 @@
}
static QString qt_writeSorting(
- const QStringList &x, const QVector<QGalleryTrackerSortCriteria> &sortCriteria)
+ const QStringList &propertyNames, const QGalleryItemPropertyList &properties)
{
- int count = x.size();
- if (count > 0) {
- QString result(QLatin1String(" ORDER BY "));
- for (int i = 0; i < count; ++i) {
- if (sortCriteria[i].flags & QGalleryTrackerSortCriteria::Ascending ) {
- result += qt_writePropertyFunctions(QStringList()
- << QLatin1String(" ASC(") + x[i], QLatin1String("x"));
- } else {
- result += qt_writePropertyFunctions(QStringList()
- << QLatin1String(" DESC(") +x[i], QLatin1String("x"));
+ QString sortExpression;
+
+ for (QStringList::const_iterator it = propertyNames.constBegin();
+ it != propertyNames.constEnd();
+ ++it) {
+ if (it->startsWith(QLatin1Char('-'))) {
+ const int propertyIndex = properties.indexOfProperty(it->mid(1));
+
+ if (propertyIndex != -1) {
+ sortExpression
+ += QLatin1String(" DESC(")
+ + properties[propertyIndex].field
+ + QLatin1String(")");
+ }
+ } else {
+ const int propertyIndex = it->startsWith(QLatin1Char('+'))
+ ? properties.indexOfProperty(it->mid(1))
+ : properties.indexOfProperty(*it);
+
+ if (propertyIndex != -1) {
+ sortExpression
+ += QLatin1String(" ASC(")
+ + properties[propertyIndex].field
+ + QLatin1String(")");
}
}
- return result;
}
- return QLatin1String("");
+
+ return !sortExpression.isEmpty()
+ ? QLatin1String(" ORDER BY") + sortExpression
+ : sortExpression;
}
void QGalleryTrackerSchema::populateItemArguments(
@@ -1364,17 +1293,15 @@
QGalleryDBusInterfaceFactory *dbus,
const QString &query,
const QStringList &propertyNames,
- const QStringList &sortPropertyNames) const
+ const QStringList &sortPropertyNames,
+ int offset,
+ int limit) const
{
const QString service = qt_galleryItemTypeList[m_itemIndex].service;
- const QString searchText;
- const QStringList keywords;
- const bool sortByService = false;
QStringList valueNames;
QStringList aliasNames;
QStringList compositeNames;
- QStringList sortFieldNames;
QVector<QGalleryProperty::Attributes> valueAttributes;
QVector<QGalleryProperty::Attributes> aliasAttributes;
QVector<QGalleryProperty::Attributes> compositeAttributes;
@@ -1451,57 +1378,6 @@
}
}
- bool descending = false;
-
- for (QStringList::const_iterator it = sortPropertyNames.constBegin();
- it != sortPropertyNames.constEnd();
- ++it) {
- int sortFlags = QGalleryTrackerSortCriteria::Ascending;
-
- QString propertyName = *it;
-
- if (propertyName.startsWith(QLatin1Char('-'))) {
- propertyName = propertyName.mid(1);
- sortFlags = QGalleryTrackerSortCriteria::Descending;
-
- if (arguments->sortCriteria.isEmpty())
- descending = true;
-
- sortFlags |= descending
- ? QGalleryTrackerSortCriteria::Sorted
- : QGalleryTrackerSortCriteria::ReverseSorted;
- } else {
- if (propertyName.startsWith(QLatin1Char('+')))
- propertyName = propertyName.mid(1);
-
- if (arguments->sortCriteria.isEmpty())
- descending = false;
-
- sortFlags |= descending
- ? QGalleryTrackerSortCriteria::ReverseSorted
- : QGalleryTrackerSortCriteria::Sorted;
- }
-
- const int propertyIndex = itemProperties.indexOfProperty(propertyName);
-
- if (propertyIndex >= 0
- && itemProperties[propertyIndex].attributes & QGalleryProperty::CanSort) {
- const QString field = itemProperties[propertyIndex].field;
-
- int fieldIndex = arguments->fieldNames.indexOf(field);
-
- if (fieldIndex < 0) {
- fieldIndex = arguments->fieldNames.count();
- arguments->fieldNames.append(field);
- extendedValueTypes.append(itemProperties[propertyIndex].type);
- }
-
- sortFieldNames.append(field);
- arguments->sortCriteria.append(QGalleryTrackerSortCriteria(fieldIndex + 2, sortFlags));
- }
- }
-
- Q_UNUSED( sortByService );
arguments->service = qt_galleryItemTypeList[m_itemIndex].service;
arguments->updateMask = qt_galleryItemTypeList[m_itemIndex].updateMask;
arguments->identityWidth = 1;
@@ -1509,15 +1385,19 @@
arguments->tableWidth = arguments->valueOffset + arguments->fieldNames.count();
arguments->compositeOffset = arguments->valueOffset + valueNames.count();
arguments->queryInterface = dbus->metaDataInterface();
- arguments->queryMethod = QLatin1String("SparqlQuery");
- arguments->queryArguments = QVariantList()
- << QLatin1String("SELECT DISTINCT ?x nie:url(?x) rdf:type(?x) ")
- + qt_writePropertyFunctions(arguments->fieldNames, QLatin1String("x"))
+ arguments->sparql
+ = QLatin1String("SELECT DISTINCT ?x nie:url(?x) rdf:type(?x) ")
+ + arguments->fieldNames.join(QLatin1String(" "))
+ QLatin1String(" WHERE {")
+ qt_galleryItemTypeList[m_itemIndex].typeFragment
+ query
+ QLatin1String("}")
- + qt_writeSorting(sortFieldNames, arguments->sortCriteria);
+ + qt_writeSorting(sortPropertyNames, itemProperties);
+
+ if (offset > 0)
+ arguments->sparql += QString::fromLatin1(" OFFSET %1").arg(offset);
+ if (limit > 0)
+ arguments->sparql += QString::fromLatin1(" LIMIT %1").arg(limit);
arguments->urlColumn.reset(new QGalleryTrackerFileUrlColumn(QGALLERYTRACKERFILEURLCOLUMN_DEFAULT_COL));
if (qt_galleryItemTypeList[m_itemIndex].updateId & FileMask) {
@@ -1529,7 +1409,11 @@
arguments->typeColumn.reset(
new QGalleryTrackerStaticColumn(qt_galleryItemTypeList[m_itemIndex].itemType));
}
- arguments->valueColumns = qt_createValueColumns(valueTypes + extendedValueTypes);
+ arguments->valueColumns = QVector<QGalleryTrackerValueColumn *>()
+ << new QGalleryTrackerStringColumn
+ << new QGalleryTrackerStringColumn
+ << new QGalleryTrackerServiceIndexColumn
+ << qt_createValueColumns(valueTypes + extendedValueTypes);
arguments->propertyNames = valueNames + compositeNames + aliasNames;
arguments->propertyAttributes = valueAttributes + compositeAttributes + aliasAttributes;
arguments->propertyTypes = valueTypes + compositeTypes + aliasTypes;
@@ -1546,7 +1430,9 @@
QGalleryDBusInterfaceFactory *dbus,
const QString &query,
const QStringList &propertyNames,
- const QStringList &sortPropertyNames) const
+ const QStringList &sortPropertyNames,
+ int offset,
+ int limit) const
{
QStringList identityFields;
QStringList aggregateFields;
@@ -1573,8 +1459,6 @@
for (int i = 0; i < type.identity.count; ++i)
identityNames.append(type.identity[i].name);
- qSort(identityNames.begin(), identityNames.end(), QGalleryReorderLessThan(sortPropertyNames));
-
for (int i = 0; i < type.identity.count; ++i)
identityColumns.append(identityNames.indexOf(type.identity[i].name));
@@ -1646,49 +1530,6 @@
}
}
- bool descending = false;
-
- for (QStringList::const_iterator it = sortPropertyNames.begin();
- it != sortPropertyNames.end();
- ++it) {
- int sortFlags = QGalleryTrackerSortCriteria::Ascending;
-
- QString propertyName = *it;
-
- if (propertyName.startsWith(QLatin1Char('-'))) {
- propertyName = propertyName.mid(1);
- sortFlags = QGalleryTrackerSortCriteria::Descending;
-
- if (arguments->sortCriteria.isEmpty())
- descending = true;
-
- sortFlags |= descending
- ? QGalleryTrackerSortCriteria::Sorted
- : QGalleryTrackerSortCriteria::ReverseSorted;
- } else {
- if (propertyName.startsWith(QLatin1Char('+')))
- propertyName = propertyName.mid(1);
-
- if (arguments->sortCriteria.isEmpty())
- descending = false;
-
- sortFlags |= descending
- ? QGalleryTrackerSortCriteria::ReverseSorted
- : QGalleryTrackerSortCriteria::Sorted;
- }
-
- const int propertyIndex = properties.indexOfProperty(propertyName);
- if (propertyIndex >= 0) {
- const QString field = properties[propertyIndex].field;
-
- const int fieldIndex = identityFields.indexOf(field);
- Q_ASSERT(fieldIndex != -1);
-
- arguments->sortCriteria.append(QGalleryTrackerSortCriteria(fieldIndex, sortFlags));
- }
- }
-
- Q_UNUSED( query );
arguments->service = type.service;
arguments->updateMask = qt_galleryAggregateTypeList[m_aggregateIndex].updateMask;
arguments->identityWidth = identityColumns.count();
@@ -1696,13 +1537,18 @@
arguments->tableWidth = identityColumns.count() + aggregates.count();
arguments->compositeOffset = arguments->tableWidth;
arguments->queryInterface = dbus->metaDataInterface();
- arguments->queryMethod = QLatin1String("SparqlQuery");
- arguments->queryArguments = QVariantList()
- << QLatin1String("SELECT DISTINCT ")
- + qt_writePropertyFunctions(identityFields, QLatin1String("x"))
+ arguments->sparql
+ = QLatin1String("SELECT DISTINCT ")
+ + identityFields.join(QLatin1String(" "))
+ QLatin1String(" WHERE{ ?x rdf:type ") + type.service + QLatin1String(" ")
+ query
- + QLatin1String("}");
+ + QLatin1String("}")
+ + qt_writeSorting(sortPropertyNames, properties);
+
+ if (offset > 0)
+ arguments->sparql += QString::fromLatin1(" OFFSET %1").arg(offset);
+ if (limit > 0)
+ arguments->sparql += QString::fromLatin1(" LIMIT %1").arg(limit);
if (type.identity.count == 1)
arguments->idColumn.reset(new QGalleryTrackerPrefixColumn(0, type.prefix));
--- src/gallery/maemo6/qgallerytrackerschema_p.h
+++ src/gallery/maemo6/qgallerytrackerschema_p.h
@@ -84,8 +84,6 @@
QString itemType() const;
-// static QString uriFromItemId(QDocumentGallery::Error *error, const QVariant &itemId);
-
static int serviceUpdateId(const QString &service);
static QString serviceForType( const QString &galleryType );
@@ -105,7 +103,9 @@
const QString &rootItem,
const QGalleryFilter &filter,
const QStringList &propertyNames,
- const QStringList &sortPropertyNames) const;
+ const QStringList &sortPropertyNames,
+ int offset,
+ int limit) const;
QDocumentGallery::Error prepareTypeResponse(
QGalleryTrackerTypeResultSetArguments *arguments,
@@ -126,13 +126,17 @@
QGalleryDBusInterfaceFactory *dbus,
const QString &query,
const QStringList &propertyNames,
- const QStringList &sortPropertyNames) const;
+ const QStringList &sortPropertyNames,
+ int offset,
+ int limit) const;
void populateAggregateArguments(
QGalleryTrackerResultSetArguments *arguments,
QGalleryDBusInterfaceFactory *dbus,
const QString &query,
const QStringList &propertyNames,
- const QStringList &sortPropertyNames) const;
+ const QStringList &sortPropertyNames,
+ int offset,
+ int limit) const;
const int m_itemIndex;
const int m_aggregateIndex;
--- src/location/location.pro
+++ src/location/location.pro
@@ -113,6 +113,37 @@
pkgconfig.path = $$QT_MOBILITY_LIB/pkgconfig
pkgconfig.files = QtLocation.pc
}
+
+meego {
+ contains (geoclue-master_enabled, yes) {
+ message("Building location with GeoClue master support.")
+ SOURCES += qgeopositioninfosource_geocluemaster.cpp
+ HEADERS += qgeopositioninfosource_geocluemaster_p.h
+ DEFINES += GEOCLUE_MASTER_AVAILABLE=1
+ PKGCONFIG += geoclue
+ QMAKE_PKGCONFIG_REQUIRES += geoclue
+ } else {
+ message("Building location without GeoClue master support.")
+ }
+ contains (gypsy_enabled, yes) {
+ message("Building location with Gypsy support.")
+ SOURCES += qgeosatelliteinfosource_gypsy.cpp
+ HEADERS += qgeosatelliteinfosource_gypsy_p.h
+ DEFINES += GYPSY_AVAILABLE=1
+ PKGCONFIG += gypsy
+ QMAKE_PKGCONFIG_REQUIRES += gypsy
+ } else {
+ message("Building location without Gypsy support.")
+ }
+ if (contains(gypsy_enabled, yes) || contains (geoclue-master_enabled, yes)) {
+ CONFIG += qdbus link_pkgconfig
+ PKGCONFIG += gconf-2.0 glib-2.0
+ QMAKE_PKGCONFIG_REQUIRES += glib-2.0 gconf-2.0
+ pkgconfig.path = $$QT_MOBILITY_LIB/pkgconfig
+ pkgconfig.files = QtLocation.pc
+ }
+}
+
HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS
SOURCES += \
--- src/location/maps/qgeomapdata.cpp
+++ src/location/maps/qgeomapdata.cpp
@@ -364,6 +364,7 @@
QList<QGeoMapObject*> results;
QGeoCoordinate coord = screenPositionToCoordinate(screenPosition);
+
int childObjectCount = d_ptr->containerObject->childObjects().count();
for (int i = 0; i < childObjectCount; ++i) {
QGeoMapObject *object = d_ptr->containerObject->childObjects().at(i);
--- src/location/maps/tiled/qgeotiledmapdata.cpp
+++ src/location/maps/tiled/qgeotiledmapdata.cpp
@@ -187,25 +187,37 @@
{
Q_D(const QGeoTiledMapData);
- qreal offsetX = ((d->windowSize.width() * d->zoomFactor) - d->worldReferenceViewportRect.width()) / 2.0;
+ QPoint worldRef = d->screenPositionToWorldReferencePosition(screenPosition);
+
+ if (worldRef.isNull())
+ return QGeoCoordinate();
+
+ return worldReferencePositionToCoordinate(worldRef);
+}
+
+// this belongs to QGeoTiledMapDataPrivate in order to avoid
+// breaking B.C.
+QPoint QGeoTiledMapDataPrivate::screenPositionToWorldReferencePosition(const QPointF &screenPosition) const
+{
+ qreal offsetX = ((windowSize.width() * zoomFactor) - worldReferenceViewportRect.width()) / 2.0;
if (offsetX < 0.0)
offsetX = 0.0;
- offsetX /= d->zoomFactor;
- qreal offsetY = ((d->windowSize.height() * d->zoomFactor) - d->worldReferenceViewportRect.height()) / 2.0;
+ offsetX /= zoomFactor;
+ qreal offsetY = ((windowSize.height() * zoomFactor) - worldReferenceViewportRect.height()) / 2.0;
if (offsetY < 0.0)
offsetY = 0.0;
- offsetY /= d->zoomFactor;
+ offsetY /= zoomFactor;
QPointF pos(screenPosition.x() - offsetX, screenPosition.y() - offsetY);
- QRectF bounds = QRectF(QPointF(0.0, 0.0), d->windowSize);
+ QRectF bounds = QRectF(QPointF(0.0, 0.0), windowSize);
if (!bounds.contains(pos))
- return QGeoCoordinate();
+ return QPoint();
- int worldX = int(d->worldReferenceViewportRect.left() + pos.x() * d->zoomFactor) % d->worldReferenceSize.width();
- int worldY = int(d->worldReferenceViewportRect.top() + pos.y() * d->zoomFactor) % d->worldReferenceSize.height();
+ int worldX = int(worldReferenceViewportRect.left() + pos.x() * zoomFactor + 0.5) % worldReferenceSize.width();
+ int worldY = int(worldReferenceViewportRect.top() + pos.y() * zoomFactor + 0.5) % worldReferenceSize.height();
- return worldReferencePositionToCoordinate(QPoint(worldX, worldY));
+ return QPoint(worldX, worldY);
}
/*!
@@ -227,8 +239,8 @@
lat = qMax(0.0, lat);
lat = qMin(1.0, lat);
- return QPoint(int(lng * d->worldReferenceSize.width()),
- int(lat * d->worldReferenceSize.height()));
+ return QPoint(int(lng * d->worldReferenceSize.width() + 0.5),
+ int(lat * d->worldReferenceSize.height() + 0.5));
}
qreal rmod(const qreal a, const qreal b)
@@ -742,6 +754,11 @@
qWarning() << errorString;
}
+static bool zComparator(const QGraphicsItem *a, const QGraphicsItem *b)
+{
+ return a->zValue() < b->zValue();
+}
+
/*!
\reimp
*/
@@ -750,21 +767,43 @@
Q_D(const QGeoTiledMapData);
QGeoCoordinate coord = screenPositionToCoordinate(screenPosition);
+ QGeoCoordinate coordLow(coord.latitude(), coord.longitude() + 360.0);
+ QGeoCoordinate coordHigh(coord.latitude(), coord.longitude() - 360.0);
- QRectF rect(d->worldReferenceViewportRect.x() + (screenPosition.x() - 1) * d->zoomFactor,
- d->worldReferenceViewportRect.y() + (screenPosition.y() - 1) * d->zoomFactor,
- 2 * d->zoomFactor,
- 2 * d->zoomFactor);
+ QList<QGraphicsItem*> items;
- QList<QGraphicsItem*> items = d->scene->items(rect, Qt::IntersectsItemShape, Qt::AscendingOrder);
+ QPointF topLeft = d->screenPositionToWorldReferencePosition(screenPosition - QPointF(1.5,1.5));
+ QPointF bottomRight = d->screenPositionToWorldReferencePosition(screenPosition + QPointF(1.5,1.5));
+ if (bottomRight.x() < topLeft.x()) {
+ // wrapped around
+ QRectF rect(topLeft, QSizeF(3*d->zoomFactor, 3*d->zoomFactor));
+ items.append(d->scene->items(rect, Qt::IntersectsItemShape, Qt::AscendingOrder));
+ QRectF rect2(QPointF(0, topLeft.y()), bottomRight);
+ items.append(d->scene->items(rect2, Qt::IntersectsItemShape, Qt::AscendingOrder));
+
+ qStableSort(items.begin(), items.end(), zComparator);
+ QList<QGraphicsItem*> uniq;
+
+ Q_FOREACH (QGraphicsItem *item, items)
+ if (!uniq.contains(item))
+ uniq.append(item);
+
+ items = uniq;
+
+ } else {
+ QRectF rect(topLeft, bottomRight);
+ items.append(d->scene->items(rect, Qt::IntersectsItemShape, Qt::AscendingOrder));
+ }
QList<QGeoMapObject*> results;
- for (int i = 0; i < items.size(); ++i) {
- if (!d->itemMap.contains(items.at(i)))
+ Q_FOREACH (QGraphicsItem* item, items) {
+ if (!d->itemMap.contains(item))
continue;
- QGeoMapObject *result = d->itemMap.value(items.at(i));
- if (result->contains(coord))
+ QGeoMapObject *result = d->itemMap.value(item);
+ if (result->isVisible() && (result->contains(coord) ||
+ result->contains(coordLow) ||
+ result->contains(coordHigh)))
results.append(result);
}
--- src/location/maps/tiled/qgeotiledmapdata_p.h
+++ src/location/maps/tiled/qgeotiledmapdata_p.h
@@ -101,6 +101,8 @@
void addObjectInfo(QGeoTiledMapObjectInfo* object);
+ QPoint screenPositionToWorldReferencePosition(const QPointF &screenPosition) const;
+
int zoomFactor;
QPoint worldReferenceViewportCenter;
--- src/location/qgeoareamonitor_polling.cpp
+++ src/location/qgeoareamonitor_polling.cpp
@@ -95,8 +95,8 @@
{
if (!location) return;
- if (QObject::receivers(SIGNAL(areaEntered(QGeoPositionInfo))) > 0 &&
- QObject::receivers(SIGNAL(areaExited(QGeoPositionInfo))) > 0 &&
+ if ((QObject::receivers(SIGNAL(areaEntered(QGeoPositionInfo))) > 0 ||
+ QObject::receivers(SIGNAL(areaExited(QGeoPositionInfo))) > 0) &&
QGeoAreaMonitor::center().isValid() &&
QGeoAreaMonitor::radius() > qreal(0.0)) {
location->startUpdates();
--- src/location/qgeopositioninfosource.cpp
+++ src/location/qgeopositioninfosource.cpp
@@ -50,6 +50,8 @@
# include "qgeopositioninfosource_maemo_p.h"
#elif defined(Q_WS_MAEMO_5)
# include "qgeopositioninfosource_maemo5_p.h"
+#elif defined(Q_WS_MEEGO) && (defined(GEOCLUE_MASTER_AVAILABLE))
+# include "qgeopositioninfosource_geocluemaster_p.h"
#endif
QTM_BEGIN_NAMESPACE
@@ -221,9 +223,17 @@
delete source;
return 0;
}
-
+ return source;
+#elif (defined(Q_WS_MEEGO)) && (defined(GEOCLUE_MASTER_AVAILABLE))
+ QGeoPositionInfoSourceGeoclueMaster *source = new QGeoPositionInfoSourceGeoclueMaster(parent);
+ int status = source->init();
+ if (status == -1) {
+ delete source;
+ return 0;
+ }
return source;
#else
+ qWarning("no default source");
Q_UNUSED(parent);
return 0;
#endif
--- src/location/qgeopositioninfosource_geocluemaster.cpp
+++ src/location/qgeopositioninfosource_geocluemaster.cpp
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore>
+
+#ifdef Q_LOCATION_GEOCLUE_DEBUG
+#include <QDebug>
+#endif
+
+#include "qgeopositioninfosource_geocluemaster_p.h"
+
+QTM_BEGIN_NAMESPACE
+
+#define MINIMUM_UPDATE_INTERVAL 1000
+#define UPDATE_TIMEOUT_COLD_START 120000
+
+// Helper function to convert data into a QGeoPositionInfo
+static QGeoPositionInfo geoclueToPositionInfo(GeocluePositionFields fields,
+ int timestamp,
+ double latitude,
+ double longitude,
+ double altitude)
+{
+ QGeoCoordinate coordinate(latitude, longitude);
+ QDateTime dateTime = QDateTime();
+ dateTime.setTime_t(timestamp);
+ if (fields & GEOCLUE_POSITION_FIELDS_ALTITUDE) {
+ coordinate.setAltitude(altitude);
+ }
+ return QGeoPositionInfo(coordinate, dateTime);
+}
+
+// Callback for position-changed -signal
+static void position_changed (GeocluePosition *position,
+ GeocluePositionFields fields,
+ int timestamp,
+ double latitude,
+ double longitude,
+ double altitude,
+ GeoclueAccuracy *accuracy,
+ gpointer userdata) // Ptr to this
+{
+ Q_UNUSED(position);
+ Q_UNUSED(accuracy);
+ if (!(fields & GEOCLUE_POSITION_FIELDS_LATITUDE &&
+ fields & GEOCLUE_POSITION_FIELDS_LONGITUDE)) {
+ static_cast<QGeoPositionInfoSourceGeoclueMaster*>(userdata)->regularUpdateFailed();
+ } else {
+ static_cast<QGeoPositionInfoSourceGeoclueMaster*>(userdata)->regularUpdateSucceeded(
+ geoclueToPositionInfo(fields, timestamp, latitude, longitude, altitude));
+ }
+}
+
+// Callback for velocity-changed -signal
+static void velocity_changed (GeoclueVelocity *velocity,
+ GeoclueVelocityFields fields,
+ int timestamp,
+ double speed,
+ double direction,
+ double climb,
+ gpointer userdata) // Ptr to this
+{
+ Q_UNUSED(velocity)
+ Q_UNUSED(timestamp)
+ Q_UNUSED(direction)
+ Q_UNUSED(climb)
+ if (!(fields & GEOCLUE_VELOCITY_FIELDS_SPEED)) {
+ static_cast<QGeoPositionInfoSourceGeoclueMaster*>(userdata)->velocityUpdateFailed();
+ return;
+ }
+ static_cast<QGeoPositionInfoSourceGeoclueMaster*>(userdata)->velocityUpdateSucceeded(speed);
+}
+
+// Callback for single async update
+static void position_callback (GeocluePosition *pos,
+ GeocluePositionFields fields,
+ int timestamp,
+ double latitude,
+ double longitude,
+ double altitude,
+ GeoclueAccuracy *accuracy,
+ GError *error,
+ gpointer userdata)
+{
+ Q_UNUSED(pos);
+ Q_UNUSED(accuracy);
+ if (error || !(fields & GEOCLUE_POSITION_FIELDS_LATITUDE &&
+ fields & GEOCLUE_POSITION_FIELDS_LONGITUDE)) {
+ static_cast<QGeoPositionInfoSourceGeoclueMaster*>(userdata)->singleUpdateFailed();
+ if (error)
+ g_error_free (error);
+ } else {
+ static_cast<QGeoPositionInfoSourceGeoclueMaster*>(userdata)->singleUpdateSucceeded(
+ geoclueToPositionInfo(fields, timestamp, latitude, longitude, altitude));
+ }
+}
+
+QGeoPositionInfoSourceGeoclueMaster::QGeoPositionInfoSourceGeoclueMaster(QObject *parent)
+ : QGeoPositionInfoSource(parent), m_updateInterval(0), m_preferredResources(GEOCLUE_RESOURCE_ALL),
+ m_client(0), m_pos(0), m_vel(0), m_lastPositionIsFresh(false), m_lastVelocityIsFresh(false),
+ m_lastVelocity(0)
+{
+ m_requestTimer.setSingleShot(true);
+ QObject::connect(&m_requestTimer, SIGNAL(timeout()), this, SLOT(requestUpdateTimeout()));
+ QObject::connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(startUpdatesTimeout()));
+}
+
+QGeoPositionInfoSourceGeoclueMaster::~QGeoPositionInfoSourceGeoclueMaster()
+{
+ if (m_pos)
+ g_object_unref (m_pos);
+ if (m_vel)
+ g_object_unref(m_vel);
+ if (m_client)
+ g_object_unref (m_client);
+}
+
+void QGeoPositionInfoSourceGeoclueMaster::velocityUpdateFailed()
+{
+#ifdef Q_LOCATION_GEOCLUE_DEBUG
+ qDebug() << "QGeoPositionInfoSourceGeoclueMaster velocity update failed.";
+#endif
+ // Set the velocitydata non-fresh.
+ m_lastVelocityIsFresh = false;
+}
+
+void QGeoPositionInfoSourceGeoclueMaster::velocityUpdateSucceeded(double speed)
+{
+#ifdef Q_LOCATION_GEOCLUE_DEBUG
+ qDebug() << "QGeoPositionInfoSourceGeoclueMaster velocity update succeeded, speed: " << speed;
+#endif
+ // Store the velocity and mark it as fresh. Simple but hopefully adequate.
+ m_lastVelocity = speed;
+ m_lastVelocityIsFresh = true;
+}
+
+void QGeoPositionInfoSourceGeoclueMaster::singleUpdateFailed()
+{
+#ifdef Q_LOCATION_GEOCLUE_DEBUG
+ qDebug() << "QGeoPositionInfoSourceGeoclueMaster single update failed (requestUpdate)";
+#endif
+ if (m_requestTimer.isActive())
+ m_requestTimer.stop();
+ // Send timeout even if time wasn't up yet, because we are not trying again
+ emit updateTimeout();
+}
+
+void QGeoPositionInfoSourceGeoclueMaster::singleUpdateSucceeded(QGeoPositionInfo info)
+{
+ if (m_requestTimer.isActive())
+ m_requestTimer.stop();
+ if (m_lastVelocityIsFresh)
+ info.setAttribute(QGeoPositionInfo::GroundSpeed, m_lastVelocity); // assume groundspeed
+#ifdef Q_LOCATION_GEOCLUE_DEBUG
+ qDebug() << "QGeoPositionInfoSourceGeoclueMaster single update succeeded: ";
+ qDebug() << "Lat, lon, alt, speed:" << info.coordinate().latitude() << info.coordinate().longitude() << info.coordinate().altitude() << info.attribute(QGeoPositionInfo::GroundSpeed);
+#endif
+ emit positionUpdated(info);
+}
+
+void QGeoPositionInfoSourceGeoclueMaster::regularUpdateFailed()
+{
+#ifdef Q_LOCATION_GEOCLUE_DEBUG
+ qDebug() << "QGeoPositionInfoSourceGeoclueMaster regular update failed.";
+#endif
+ // Emit timeout and keep on listening in case error condition clears.
+ // Currently this is emitted each time an error occurs, and thereby it assumes
+ // that there does not come many erroneous updates from position source.
+ // This assumption may be invalid.
+ m_lastVelocityIsFresh = false;
+ m_lastPositionIsFresh = false;
+ emit updateTimeout();
+}
+
+void QGeoPositionInfoSourceGeoclueMaster::regularUpdateSucceeded(QGeoPositionInfo info)
+{
+ m_lastPosition = info;
+ m_lastPositionIsFresh = true;
+ if (m_lastVelocityIsFresh) {
+ info.setAttribute(QGeoPositionInfo::GroundSpeed, m_lastVelocity); // assume groundspeed
+ m_lastVelocityIsFresh = false;
+ }
+ // If a non-intervalled startUpdates has been issued, send an update.
+ if (!m_updateTimer.isActive()) {
+ m_lastPositionIsFresh = false;
+ emit positionUpdated(info);
+ }
+#ifdef Q_LOCATION_GEOCLUE_DEBUG
+ qDebug() << "QGeoPositionInfoSourceGeoclueMaster regular update succeeded: ";
+ qDebug() << "Lat, lon, alt, speed:" << info.coordinate().latitude() << info.coordinate().longitude() << info.coordinate().altitude() << info.attribute(QGeoPositionInfo::GroundSpeed);
+#endif
+}
+
+int QGeoPositionInfoSourceGeoclueMaster::init()
+{
+ g_type_init ();
+ return configurePositionSource();
+}
+
+int QGeoPositionInfoSourceGeoclueMaster::configurePositionSource()
+{
+ GeoclueMaster *master(0);
+ GError *error = 0;
+
+ master = geoclue_master_get_default ();
+ if (!master) {
+ qCritical ("QGeoPositionInfoSourceGeoclueMaster error creating GeoclueMaster");
+ return -1;
+ }
+ // Free potential previous sources, because new requirements can't be set for the client
+ // (creating a position object after changing requirements seems to fail).
+ if (m_client) {
+ g_object_unref (m_client);
+ m_client = 0;
+ }
+ if (m_pos) {
+ g_object_unref(m_pos);
+ m_client = 0;
+ }
+ if (m_vel) {
+ g_object_unref(m_vel);
+ m_vel = 0;
+ }
+ m_client = geoclue_master_create_client (master, NULL, &error);
+ g_object_unref (master);
+
+ if (!m_client) {
+ qCritical ("QGeoPositionInfoSourceGeoclueMaster error creating GeoclueMasterClient.");
+ if (error) {
+ qCritical (error->message);
+ g_error_free (error);
+ }
+ return -1;
+ }
+
+ if (!geoclue_master_client_set_requirements (m_client,
+ GEOCLUE_ACCURACY_LEVEL_NONE, // min_accuracy
+ 0, // min_time
+ TRUE, // require_updates (signals)
+ m_preferredResources,
+ &error)){
+ qCritical ("QGeoPositionInfoSourceGeoclueMaster geoclue set_requirements failed.");
+ if (error) {
+ qCritical (error->message);
+ g_error_free (error);
+ }
+ g_object_unref (m_client);
+ m_client = 0;
+ return -1;
+ }
+ m_pos = geoclue_master_client_create_position (m_client, NULL);
+ if (!m_pos) {
+ qCritical("QGeoPositionInfoSourceGeoclueMaster failed to get a position object");
+ g_object_unref (m_client);
+ m_client = 0;
+ return -1;
+ }
+ // Succeeding velocity is not mandatory. Master does not provide abstraction
+ // for velocity provider, hence request Gypsy provider directly.
+ m_vel = geoclue_velocity_new("org.freedesktop.Geoclue.Providers.Gypsy",
+ "/org/freedesktop/Geoclue/Providers/Gypsy");
+#ifdef Q_LOCATION_GEOCLUE_DEBUG
+ if (m_vel == NULL)
+ qDebug("QGeoPositionInfoSourceGeoclueMaster velocity provider (Gypsy) not available.");
+#endif
+ return 0;
+}
+
+void QGeoPositionInfoSourceGeoclueMaster::setUpdateInterval(int msec)
+{
+ msec = (((msec > 0) && (msec < minimumUpdateInterval())) || msec < 0)? minimumUpdateInterval() : msec;
+ QGeoPositionInfoSource::setUpdateInterval(msec);
+ m_updateInterval = msec;
+ // If update timer is running, set the new interval
+ if (m_updateTimer.isActive()) {
+ m_updateTimer.setInterval(msec);
+ }
+}
+
+void QGeoPositionInfoSourceGeoclueMaster::setPreferredPositioningMethods(PositioningMethods methods)
+{
+ switch (methods) {
+ case SatellitePositioningMethods:
+ m_preferredResources = GEOCLUE_RESOURCE_GPS;
+ break;
+ case NonSatellitePositioningMethods:
+ m_preferredResources = (GeoclueResourceFlags)(GEOCLUE_RESOURCE_CELL | GEOCLUE_RESOURCE_NETWORK);
+ break;
+ case AllPositioningMethods:
+ m_preferredResources = GEOCLUE_RESOURCE_ALL;
+ break;
+ default:
+ qWarning("GeoPositionInfoSourceGeoClueMaster unknown preferred method.");
+ break;
+ }
+ QGeoPositionInfoSource::setPreferredPositioningMethods(methods);
+#ifdef Q_LOCATION_GEOCLUE_DEBUG
+ qDebug() << "QGeoPositionInfoSourceGeoclueMaster requested to set methods to, and set them to: " << methods << m_preferredResources;
+#endif
+ configurePositionSource();
+}
+
+QGeoPositionInfo QGeoPositionInfoSourceGeoclueMaster::lastKnownPosition(bool /*fromSatellitePositioningMethodsOnly*/) const
+{
+ return m_lastPosition;
+}
+
+QGeoPositionInfoSourceGeoclueMaster::PositioningMethods QGeoPositionInfoSourceGeoclueMaster::supportedPositioningMethods() const
+{
+ return AllPositioningMethods;
+}
+
+void QGeoPositionInfoSourceGeoclueMaster::startUpdates()
+{
+ if (m_updateTimer.isActive())
+ return;
+ if (m_updateInterval > 0) {
+#ifdef Q_LOCATION_GEOCLUE_DEBUG
+ qDebug() << "QGeoPositionInfoSourceGeoclueMaster startUpdates with interval: " << m_updateInterval;
+#endif
+ m_updateTimer.start(m_updateInterval);
+ }
+ g_signal_connect (G_OBJECT (m_pos), "position-changed",
+ G_CALLBACK (position_changed),this);
+ if (m_vel) {
+ g_signal_connect (G_OBJECT (m_vel), "velocity-changed",
+ G_CALLBACK (velocity_changed),this);
+ }
+}
+
+int QGeoPositionInfoSourceGeoclueMaster::minimumUpdateInterval() const {
+ return MINIMUM_UPDATE_INTERVAL;
+}
+
+void QGeoPositionInfoSourceGeoclueMaster::stopUpdates()
+{
+ g_signal_handlers_disconnect_by_func(G_OBJECT(m_pos), (void*)position_changed, this);
+ g_signal_handlers_disconnect_by_func(G_OBJECT(m_vel), (void*)velocity_changed, this);
+ if (m_updateTimer.isActive())
+ m_updateTimer.stop();
+}
+
+void QGeoPositionInfoSourceGeoclueMaster::requestUpdate(int timeout)
+{
+ if (timeout < minimumUpdateInterval() && timeout != 0) {
+ emit updateTimeout();
+ return;
+ }
+ if (m_requestTimer.isActive()) {
+ return;
+ }
+ // Create better logic for timeout value (specs leave it impl dependant).
+ // Especially if there are active updates ongoing, there is no point of waiting
+ // for whole cold start time.
+ if (timeout == 0)
+ m_requestTimer.start(UPDATE_TIMEOUT_COLD_START);
+ else
+ m_requestTimer.start(timeout);
+ geoclue_position_get_position_async (m_pos, (GeocluePositionCallback)position_callback,this);
+}
+
+void QGeoPositionInfoSourceGeoclueMaster::requestUpdateTimeout()
+{
+#ifdef Q_LOCATION_GEOCLUE_DEBUG
+ qDebug() << "QGeoPositionInfoSourceGeoclueMaster requestUpdate timeout occurred.";
+#endif
+ // If we end up here, there has not been valid position update.
+ emit updateTimeout();
+}
+
+void QGeoPositionInfoSourceGeoclueMaster::startUpdatesTimeout()
+{
+#ifdef Q_LOCATION_GEOCLUE_DEBUG
+ qDebug() << "QGeoPositionInfoSourceGeoclueMaster startUpdates timeout occurred.";
+#endif
+ // Check if there are position updates since last positionUpdated().
+ // Do not however send timeout, that's reserved for signaling errors.
+ if (m_lastPositionIsFresh) {
+ emit positionUpdated(m_lastPosition);
+ m_lastPositionIsFresh = false;
+ m_lastVelocityIsFresh = false;
+ }
+}
+
+#include "moc_qgeopositioninfosource_geocluemaster_p.cpp"
+QTM_END_NAMESPACE
--- src/location/qgeopositioninfosource_geocluemaster_p.h
+++ src/location/qgeopositioninfosource_geocluemaster_p.h
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGEOPOSITIONINFOSOURCE_GEOCLUEMASTER_H
+#define QGEOPOSITIONINFOSOURCE_GEOCLUEMASTER_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <qgeopositioninfosource.h>
+#include <geoclue/geoclue-master.h>
+#include <geoclue/geoclue-velocity.h>
+#include <QTimer>
+
+#define Q_LOCATION_GEOCLUE_DEBUG
+
+QTM_BEGIN_NAMESPACE
+
+class QGeoPositionInfoSourceGeoclueMaster : public QGeoPositionInfoSource
+{
+ Q_OBJECT
+public:
+ void positionChanged(GeocluePosition *position,
+ GeocluePositionFields fields,
+ int timestamp,
+ double latitude,
+ double longitude,
+ double altitude,
+ GeoclueAccuracy *accuracy);
+ QGeoPositionInfoSourceGeoclueMaster(QObject *parent = 0);
+ ~QGeoPositionInfoSourceGeoclueMaster();
+
+ // From QGeoPositionInfoSource
+ void setUpdateInterval(int msec);
+ QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const;
+ PositioningMethods supportedPositioningMethods() const;
+ void setPreferredPositioningMethods(PositioningMethods methods);
+ int minimumUpdateInterval() const;
+ int init();
+
+ void singleUpdateFailed();
+ void singleUpdateSucceeded(QGeoPositionInfo info);
+ void regularUpdateFailed();
+ void regularUpdateSucceeded(QGeoPositionInfo info);
+ void velocityUpdateFailed();
+ void velocityUpdateSucceeded(double speed);
+
+public slots:
+ virtual void startUpdates();
+ virtual void stopUpdates();
+ virtual void requestUpdate(int timeout = 5000);
+
+private slots:
+ void requestUpdateTimeout();
+ void startUpdatesTimeout();
+
+private:
+ int configurePositionSource();
+
+private:
+ int m_updateInterval;
+ GeoclueResourceFlags m_preferredResources;
+ GeoclueMasterClient *m_client;
+ GeocluePosition *m_pos;
+ GeoclueVelocity* m_vel;
+ QTimer m_updateTimer;
+ QTimer m_requestTimer;
+ bool m_lastPositionIsFresh;
+ bool m_lastVelocityIsFresh;
+ double m_lastVelocity;
+ QGeoPositionInfo m_lastPosition;
+};
+
+QTM_END_NAMESPACE
+
+#endif // QGEOPOSITIONINFOSOURCE_GEOCLUEMASTER_H
--- src/location/qgeosatelliteinfosource.cpp
+++ src/location/qgeosatelliteinfosource.cpp
@@ -50,6 +50,8 @@
# include "qgeosatelliteinfosource_maemo_p.h"
#elif defined(Q_WS_MAEMO_5)
# include "qgeosatelliteinfosource_maemo5_p.h"
+#elif (defined(Q_WS_MEEGO)) && (defined(GYPSY_AVAILABLE))
+# include "qgeosatelliteinfosource_gypsy_p.h"
#endif
QTM_BEGIN_NAMESPACE
@@ -112,7 +114,16 @@
return source;
#elif defined(QT_SIMULATOR)
return new QGeoSatelliteInfoSourceSimulator(parent);
+#elif (defined(Q_WS_MEEGO)) && (defined(GYPSY_AVAILABLE))
+ QGeoSatelliteInfoSourceGypsy *source = new QGeoSatelliteInfoSourceGypsy(parent);
+ int status = source->init();
+ if (status == -1) {
+ delete source;
+ return 0;
+ }
+ return source;
#else
+ qWarning("QGeoSatellitePositionInfoSource: no default source available.");
Q_UNUSED(parent);
return 0;
#endif
--- src/location/qgeosatelliteinfosource_gypsy.cpp
+++ src/location/qgeosatelliteinfosource_gypsy.cpp
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qgeosatelliteinfosource_gypsy_p.h"
+
+#ifdef Q_LOCATION_GYPSY_DEBUG
+#include <QDebug>
+#endif
+
+QTM_BEGIN_NAMESPACE
+
+#define UPDATE_TIMEOUT_COLD_START 120000
+
+
+// Callback function for 'satellites-changed' -signal
+static void satellites_changed (GypsySatellite *satellite,
+ GPtrArray *satellites,
+ gpointer userdata)
+{
+#ifdef Q_LOCATION_GYPSY_DEBUG
+ qDebug() << "QGeoSatelliteInfoSourceGypsy Gypsy satellites-changed -signal received.";
+#endif
+ ((QGeoSatelliteInfoSourceGypsy*)userdata)->satellitesChanged(satellite, satellites);
+}
+
+SatelliteGypsyEngine::SatelliteGypsyEngine(QGeoSatelliteInfoSource* parent) :
+ m_owner(parent)
+{
+}
+SatelliteGypsyEngine::~SatelliteGypsyEngine()
+{
+}
+
+// Glib symbols
+gulong SatelliteGypsyEngine::eng_g_signal_connect(gpointer instance,
+ const gchar* detailed_signal,
+ GCallback c_handler,
+ gpointer data)
+{
+ return ::g_signal_connect(instance, detailed_signal, c_handler, data);
+}
+guint SatelliteGypsyEngine::eng_g_signal_handlers_disconnect_by_func (gpointer instance,
+ gpointer func,
+ gpointer data)
+{
+ return ::g_signal_handlers_disconnect_by_func(instance, func, data);
+}
+
+// Gypsy symbols
+GypsyControl* SatelliteGypsyEngine::eng_gypsy_control_get_default (void)
+{
+ return ::gypsy_control_get_default();
+}
+char *SatelliteGypsyEngine::eng_gypsy_control_create (GypsyControl *control, const char*device_name, GError **error)
+{
+ return ::gypsy_control_create(control, device_name, error);
+}
+GypsyDevice *SatelliteGypsyEngine::eng_gypsy_device_new (const char *object_path)
+{
+ return ::gypsy_device_new(object_path);
+}
+GypsySatellite *SatelliteGypsyEngine::eng_gypsy_satellite_new (const char *object_path)
+{
+ return ::gypsy_satellite_new (object_path);
+}
+gboolean SatelliteGypsyEngine::eng_gypsy_device_start (GypsyDevice *device, GError **error)
+{
+ return ::gypsy_device_start(device, error);
+}
+gboolean SatelliteGypsyEngine::eng_gypsy_device_stop (GypsyDevice *device, GError **error)
+{
+ return ::gypsy_device_stop (device, error);
+}
+GypsyDeviceFixStatus SatelliteGypsyEngine::eng_gypsy_device_get_fix_status (GypsyDevice *device, GError **error)
+{
+ return ::gypsy_device_get_fix_status (device, error);
+}
+GPtrArray *SatelliteGypsyEngine::eng_gypsy_satellite_get_satellites (GypsySatellite *satellite, GError **error)
+{
+ return ::gypsy_satellite_get_satellites (satellite, error);
+}
+void SatelliteGypsyEngine::eng_gypsy_satellite_free_satellite_array (GPtrArray *satellites)
+{
+ return ::gypsy_satellite_free_satellite_array(satellites);
+}
+// GConf symbols (mockability due to X11 requirement)
+GConfClient* SatelliteGypsyEngine::eng_gconf_client_get_default(void)
+{
+ return ::gconf_client_get_default();
+}
+gchar* SatelliteGypsyEngine::eng_gconf_client_get_string(GConfClient* client, const gchar* key, GError** err)
+{
+ return ::gconf_client_get_string(client, key, err);
+}
+
+QGeoSatelliteInfoSourceGypsy::QGeoSatelliteInfoSourceGypsy(QObject *parent) : QGeoSatelliteInfoSource(parent),
+ m_engine(0), m_satellite(0), m_device(0), m_updatesOngoing(false), m_requestOngoing(false)
+{
+ m_requestTimer.setSingleShot(true);
+ QObject::connect(&m_requestTimer, SIGNAL(timeout()), this, SLOT(requestUpdateTimeout()));
+}
+
+void QGeoSatelliteInfoSourceGypsy::createEngine()
+{
+ if (m_engine)
+ delete m_engine;
+ m_engine = new SatelliteGypsyEngine(this);
+}
+
+QGeoSatelliteInfoSourceGypsy::~QGeoSatelliteInfoSourceGypsy()
+{
+ GError* error = NULL;
+ m_engine->eng_gypsy_device_stop (m_device, &error);
+ if (error != NULL) {
+ g_warning ("Error stopping the device: %s", error->message);
+ g_object_unref(m_device);
+ g_error_free (error);
+ }
+ if (m_engine)
+ delete m_engine;
+}
+
+void QGeoSatelliteInfoSourceGypsy::satellitesChanged(GypsySatellite* satellite,
+ GPtrArray* satellites)
+{
+ if (!satellite || !satellites)
+ return;
+ // We have satellite data and assume it is valid.
+ // If a single updateRequest was active, send signals right away.
+ // If a periodic timer was running (meaning that the client wishes
+ // to have updates at defined intervals), store the data for later sending.
+ QList<QtMobility::QGeoSatelliteInfo> lastSatellitesInView;
+ QList<QtMobility::QGeoSatelliteInfo> lastSatellitesInUse;
+
+ unsigned int i;
+ for (i = 0; i < satellites->len; i++) {
+ GypsySatelliteDetails *details = (GypsySatelliteDetails*)satellites->pdata[i];
+ QGeoSatelliteInfo info;
+ info.setAttribute(QGeoSatelliteInfo::Elevation, details->elevation);
+ info.setAttribute(QGeoSatelliteInfo::Azimuth, details->azimuth);
+ info.setPrnNumber(details->satellite_id);
+ info.setSignalStrength(details->snr);
+ if (details->in_use)
+ lastSatellitesInUse.append(info);
+ lastSatellitesInView.append(info);
+ }
+ bool sendUpdates(false);
+ // If a single updateRequest() has been issued:
+ if (m_requestOngoing) {
+ sendUpdates = true;
+ m_requestTimer.stop();
+ m_requestOngoing = false;
+ // If there is no regular updates ongoing, disconnect now.
+ if (!m_updatesOngoing) {
+ m_engine->eng_g_signal_handlers_disconnect_by_func(G_OBJECT(m_satellite), (void*)satellites_changed, this);
+ }
+ }
+ // If regular updates are to be delivered as they come:
+ if (m_updatesOngoing)
+ sendUpdates = true;
+
+ if (sendUpdates) {
+ emit satellitesInUseUpdated(lastSatellitesInUse);
+ emit satellitesInViewUpdated(lastSatellitesInView);
+ }
+}
+
+int QGeoSatelliteInfoSourceGypsy::init()
+{
+ GError *error = NULL;
+ char *path;
+
+ GConfClient* client;
+ gchar* device_name;
+
+ g_type_init ();
+ createEngine();
+
+ client = m_engine->eng_gconf_client_get_default();
+ device_name = m_engine->eng_gconf_client_get_string(client, "/apps/geoclue/master/org.freedesktop.Geoclue.GPSDevice", NULL);
+
+ GypsyControl *control = NULL;
+ control = m_engine->eng_gypsy_control_get_default();
+ // (path is the DBus path)
+ path = m_engine->eng_gypsy_control_create (control, device_name, &error);
+ if (path == NULL) {
+ g_warning ("QGeoSatelliteInfoSourceGypsy error creating client for %s: %s", device_name,
+ error->message);
+ g_error_free (error);
+ g_object_unref(control);
+ return -1;
+ }
+ m_device = m_engine->eng_gypsy_device_new (path);
+ m_satellite = m_engine->eng_gypsy_satellite_new (path);
+ m_engine->eng_gypsy_device_start (m_device, &error);
+ if (error != NULL) {
+ g_warning ("QGeoSatelliteInfoSourceGypsy error starting %s: %s", device_name,
+ error->message);
+ g_object_unref(control);
+ g_error_free (error);
+ return -1;
+ }
+ g_object_unref(control);
+ return 0;
+}
+
+
+void QGeoSatelliteInfoSourceGypsy::startUpdates()
+{
+ if (m_updatesOngoing)
+ return;
+ // If there is a request timer ongoing, we've connected to the signal already
+ if (!m_requestTimer.isActive()) {
+ m_engine->eng_g_signal_connect (m_satellite, "satellites-changed",
+ G_CALLBACK (satellites_changed), this);
+ }
+ m_updatesOngoing = true;
+}
+
+void QGeoSatelliteInfoSourceGypsy::stopUpdates()
+{
+ if (!m_updatesOngoing)
+ return;
+ m_updatesOngoing = false;
+ // Disconnect only if there is no single update request ongoing. Once single update request
+ // is completed and it notices that there is no active update ongoing, it will disconnect
+ // the signal.
+ if (!m_requestTimer.isActive())
+ m_engine->eng_g_signal_handlers_disconnect_by_func(G_OBJECT(m_satellite), (void*)satellites_changed, this);
+}
+
+void QGeoSatelliteInfoSourceGypsy::requestUpdate(int timeout)
+{
+ if (m_requestOngoing)
+ return;
+ if (timeout < 0) {
+ emit requestTimeout();
+ return;
+ }
+ m_requestOngoing = true;
+ GError *error = 0;
+ // If GPS has a fix a already, request current data.
+ GypsyDeviceFixStatus fixStatus = m_engine->eng_gypsy_device_get_fix_status(m_device, &error);
+ if (!error && (fixStatus != GYPSY_DEVICE_FIX_STATUS_INVALID &&
+ fixStatus != GYPSY_DEVICE_FIX_STATUS_NONE)) {
+#ifdef Q_LOCATION_GYPSY_DEBUG
+ qDebug() << "QGeoSatelliteInfoSourceGypsy fix available, requesting current satellite data";
+#endif
+ GPtrArray* satelliteData = m_engine->eng_gypsy_satellite_get_satellites(m_satellite, &error);
+ if (!error) {
+ // The fix was available and we have satellite data to deliver right away.
+ satellitesChanged(m_satellite, satelliteData);
+ m_engine->eng_gypsy_satellite_free_satellite_array(satelliteData);
+ return;
+ }
+ }
+ // No fix is available. If updates are not ongoing already, start them.
+ m_requestTimer.setInterval(timeout == 0? UPDATE_TIMEOUT_COLD_START: timeout);
+ if (!m_updatesOngoing) {
+ m_engine->eng_g_signal_connect (m_satellite, "satellites-changed",
+ G_CALLBACK (satellites_changed), this);
+ }
+ m_requestTimer.start();
+ if (error) {
+#ifdef Q_LOCATION_GYPSY_DEBUG
+ qDebug() << "QGeoSatelliteInfoSourceGypsy error asking fix status or satellite data: " << error->message;
+#endif
+ g_error_free(error);
+ }
+}
+
+void QGeoSatelliteInfoSourceGypsy::requestUpdateTimeout()
+{
+#ifdef Q_LOCATION_GYPSY_DEBUG
+ qDebug("QGeoSatelliteInfoSourceGypsy request update timeout occurred.");
+#endif
+ // If we end up here, there has not been valid satellite update.
+ // Emit timeout and disconnect from signal if regular updates are not
+ // ongoing (as we were listening just for one single requestUpdate).
+ if (!m_updatesOngoing) {
+ m_engine->eng_g_signal_handlers_disconnect_by_func(G_OBJECT(m_satellite), (void*)satellites_changed, this);
+ }
+ m_requestOngoing = false;
+ emit requestTimeout();
+}
+
+#include "moc_qgeosatelliteinfosource_gypsy_p.cpp"
+QTM_END_NAMESPACE
--- src/location/qgeosatelliteinfosource_gypsy_p.h
+++ src/location/qgeosatelliteinfosource_gypsy_p.h
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGEOSATELLITEINFOSOURCE_GYPSY_H
+#define QGEOSATELLITEINFOSOURCE_GYPSY_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qgeosatelliteinfosource.h"
+#include "qgeosatelliteinfo.h"
+#include <gypsy/gypsy-satellite.h>
+#include <gypsy/gypsy-control.h>
+#include <gypsy/gypsy-device.h>
+#include <gconf/gconf-client.h>
+#include <QTimer>
+
+#define Q_LOCATION_GYPSY_DEBUG
+
+QTM_BEGIN_NAMESPACE
+
+// An engine that encapsulates all symbols we want
+// to be able to mock (for unit/autotest purposes).
+class SatelliteGypsyEngine
+{
+public:
+ SatelliteGypsyEngine(QGeoSatelliteInfoSource* parent = 0);
+ virtual ~SatelliteGypsyEngine();
+ // Glib symbols
+ virtual gulong eng_g_signal_connect(gpointer instance,
+ const gchar* detailed_signal,
+ GCallback c_handler,
+ gpointer data);
+ virtual guint eng_g_signal_handlers_disconnect_by_func (gpointer instance,
+ gpointer func,
+ gpointer data);
+ // Gypsy symbols
+ virtual GypsyControl* eng_gypsy_control_get_default (void);
+ virtual char *eng_gypsy_control_create (GypsyControl *control, const char*device_name, GError **error);
+ virtual GypsyDevice *eng_gypsy_device_new (const char *object_path);
+ virtual GypsySatellite *eng_gypsy_satellite_new (const char *object_path);
+ virtual gboolean eng_gypsy_device_start (GypsyDevice *device, GError **error);
+ virtual gboolean eng_gypsy_device_stop (GypsyDevice *device, GError **error);
+ virtual GypsyDeviceFixStatus eng_gypsy_device_get_fix_status (GypsyDevice *device, GError **error);
+ virtual GPtrArray *eng_gypsy_satellite_get_satellites (GypsySatellite *satellite, GError **error);
+ virtual void eng_gypsy_satellite_free_satellite_array (GPtrArray *satellites);
+ // GConf symbols (mockability due to X11 requirement)
+ virtual GConfClient* eng_gconf_client_get_default(void);
+ virtual gchar* eng_gconf_client_get_string(GConfClient* client, const gchar* key, GError** err);
+protected:
+ QGeoSatelliteInfoSource* m_owner;
+};
+
+class QGeoSatelliteInfoSourceGypsy : public QGeoSatelliteInfoSource
+ {
+ Q_OBJECT
+
+public:
+ explicit QGeoSatelliteInfoSourceGypsy(QObject *parent = 0);
+ ~QGeoSatelliteInfoSourceGypsy();
+ int init();
+
+public slots:
+ virtual void startUpdates();
+ void stopUpdates();
+ void requestUpdate(int timeout = 5000);
+ void satellitesChanged(GypsySatellite* satellite, GPtrArray* satellites);
+
+signals:
+ void satellitesInViewUpdated(const QList<QGeoSatelliteInfo> &satellites);
+ void satellitesInUseUpdated(const QList<QGeoSatelliteInfo> &satellites);
+
+private slots:
+ void requestUpdateTimeout();
+
+protected:
+ // Creates an engine which encapsulates all used symbols
+ // that we want to be also able to mock.
+ virtual void createEngine();
+ SatelliteGypsyEngine* m_engine;
+
+private:
+ Q_DISABLE_COPY(QGeoSatelliteInfoSourceGypsy)
+ GypsySatellite* m_satellite;
+ GypsyDevice* m_device;
+ QTimer m_requestTimer;
+ bool m_updatesOngoing;
+ bool m_requestOngoing;
+ };
+
+QTM_END_NAMESPACE
+
+#endif // QGEOSATELLITEINFOSOURCE_GYPSY_H
--- src/meegoinstalls
+++ src/meegoinstalls
+(directory)
--- src/meegoinstalls/Makefile
+++ src/meegoinstalls/Makefile
+PKG_NAME := qt-mobility
+SPECFILE = $(addsuffix .spec, $(PKG_NAME))
+YAMLFILE = $(addsuffix .yaml, $(PKG_NAME))
+
+include /usr/share/meego-packaging-tools/Makefile.common
+
--- src/meegoinstalls/README
+++ src/meegoinstalls/README
+This directory contains the MeeGo.com packaging metadata for Qt Mobility,
+for use with the MeeGo.com OpenSuSE Build Service (OBS).
+
+Please see http://build.meego.com/ for more information.
+
+PATCHES
+=======
+
+At the time of writing, there are some MeeGo-specific patches hosted
+on the MeeGo OBS. These patches are unable to be hosted in the Mobility
+git repository at this time.
+
+In order to successfully build Mobility for MeeGo, you must also obtain
+these patches.
+
+Please do not add any more patches.
--- src/meegoinstalls/qt-mobility.spec
+++ src/meegoinstalls/qt-mobility.spec
+#
+# Do NOT Edit the Auto-generated Part!
+# Generated by: spectacle version 0.21
+#
+# >> macros
+# << macros
+
+Name: qt-mobility
+Summary: APIs for mobile device functionality
+Version: 1.1.0+git2438
+Release: 1
+Group: System/Libraries
+License: LGPLv2.1 with exception or GPLv3
+URL: http://qt.gitorious.org/qt-mobility
+Source0: http://get.qt.nokia.com/qt/add-ons/%{name}-opensource-src-%{version}.tar.gz
+Source100: qt-mobility.yaml
+Patch0: no_rpath.patch
+Patch1: fix_translations_install_path.patch
+Patch2: enable_pkgconfig_support.patch
+Patch3: enable_camerabin_with_meego_target.patch
+Requires: libqtconnectivity1 = %{version}
+Requires: libqtcontacts1 = %{version}
+Requires: libqtfeedback1 = %{version}
+Requires: libqtgallery1 = %{version}
+Requires: libqtlocation1 = %{version}
+Requires: libqtmessaging1 = %{version}
+Requires: libqtmultimediakit1 = %{version}
+Requires: libqtorganizer1 = %{version}
+Requires: libqtpublishsubscribe1 = %{version}
+Requires: libqtsensors1 = %{version}
+Requires: libqtserviceframework1 = %{version}
+Requires: libqtsysteminfo1 = %{version}
+Requires: libqtversit1 = %{version}
+Requires: libqtversitorganizer1 = %{version}
+BuildRequires: pkgconfig(QtGui)
+BuildRequires: pkgconfig(QtOpenGL)
+BuildRequires: pkgconfig(alsa)
+BuildRequires: pkgconfig(blkid)
+BuildRequires: pkgconfig(bluez)
+BuildRequires: pkgconfig(connman)
+BuildRequires: pkgconfig(contextsubscriber-1.0)
+BuildRequires: pkgconfig(gconf-2.0)
+BuildRequires: pkgconfig(geoclue)
+BuildRequires: pkgconfig(gstreamer-plugins-bad-free-0.10)
+BuildRequires: pkgconfig(gstreamer-plugins-base-0.10)
+BuildRequires: pkgconfig(gypsy)
+BuildRequires: pkgconfig(libpulse)
+BuildRequires: pkgconfig(qttracker)
+BuildRequires: pkgconfig(qmfclient)
+BuildRequires: pkgconfig(sensord)
+BuildRequires: pkgconfig(udev)
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(xext)
+BuildRequires: pkgconfig(xrandr)
+BuildRequires: pkgconfig(xrender)
+BuildRequires: pkgconfig(xv)
+BuildRequires: qt-devel-tools
+BuildRequires: fdupes
+
+
+%description
+Qt Mobility delivers a set of new APIs for mobile device functionality. These
+APIs allow the developer to use these features with ease from one framework and
+apply them to phones, netbooks and non-mobile personal computers.
+
+
+
+%package devel
+Summary: APIs for mobile device functionality - development files
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: servicefw
+
+%description devel
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the development files needed to build Qt applications
+using Qt Mobility libraries.
+
+
+%package -n libqtconnectivity1
+Summary: Qt Mobility Connectivity module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtconnectivity1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Connectivity API. It provides APIs for working with
+local devices.
+
+
+%package -n libqtcontacts1
+Summary: Qt Mobility Contacts module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtcontacts1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains an API enabling clients to request contact data from
+local or remote backends.
+
+
+%package -n libqtfeedback1
+Summary: Qt Mobility Feedback module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtfeedback1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Feedback API. It enables a client to control
+the vibration of the device or the piezo feedback from the screen.
+
+
+%package -n libqtgallery1
+Summary: Qt Mobility Document Gallery module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtgallery1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains an API for accessing collections of documents and media
+and their meta-data.
+
+
+%package -n libqtlocation1
+Summary: Qt Mobility Location module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtlocation1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Location API. It provides a library for distributing
+and receiving location data using arbitrary data sources.
+
+
+%package -n libqtmessaging1
+Summary: Qt Mobility Messaging module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtmessaging1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Messaging API. It is a common interface for handling
+SMS, MMS, MIME Email and TNEF Email messages.
+
+
+%package -n libqtmultimediakit1
+Summary: Qt Mobility MultimediaKit module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtmultimediakit1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains a set of APIs to play and record media, and manage a
+collection of media content.
+
+
+%package -n libqtorganizer1
+Summary: Qt Mobility Organizer module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtorganizer1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains an API for management of calendar, scheduling and
+personal data from local or remote backends. It includes the ability to create,
+edit, list, delete and lookup organizer information whether it is stored
+locally or remotely.
+
+
+%package -n libqtpublishsubscribe1
+Summary: Qt Mobility Publish and Subscribe module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtpublishsubscribe1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Publish and Subscribe API (containing Value Space).
+It enables applications to read item values, navigate through and subscribe to
+change notifications.
+
+
+%package -n libqtsensors1
+Summary: Qt Mobility Sensors module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: libqtsql4-sqlite
+Requires: sensorfw
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtsensors1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Sensors API. It provides access to sensors.
+
+
+%package -n libqtserviceframework1
+Summary: Qt Mobility Service Framework module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtserviceframework1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains a set of APIs to that allows clients to discover and
+instantiate arbitrary services.
+
+
+%package -n libqtsysteminfo1
+Summary: Qt Mobility System Information module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtsysteminfo1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains a set of APIs to discover system related information and
+capabilities.
+
+
+%package -n libqtversit1
+Summary: Qt Mobility Versit (vCard) module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtversit1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains an API to manage Versit documents, such as vCards.
+
+
+%package -n libqtversitorganizer1
+Summary: Qt Mobility Versit (Organizer) module
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libqtversitorganizer1
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains an API to manage Versit documents, such as iCalendar
+documents. It interfaces the Organizer API and uses the same framework as for
+vCards.
+
+
+%package -n libdeclarative-contacts
+Summary: Qt Mobility Contacts QML plugin
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n libdeclarative-contacts
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Contacts QML plugin for QtDeclarative.
+
+
+%package -n libdeclarative-feedback
+Summary: Qt Mobility Feedback QML plugin
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n libdeclarative-feedback
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Feedback QML plugin for QtDeclarative.
+
+
+%package -n libdeclarative-gallery
+Summary: Qt Mobility Document Gallery QML plugin
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n libdeclarative-gallery
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Document Gallery QML plugin for QtDeclarative.
+
+
+%package -n libdeclarative-location
+Summary: Qt Mobility Location QML plugin
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n libdeclarative-location
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Location QML plugin for QtDeclarative.
+
+
+%package -n libdeclarative-messaging
+Summary: Qt Mobility Messaging QML plugin
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n libdeclarative-messaging
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Messaging QML plugin for QtDeclarative.
+
+
+%package -n libdeclarative-multimedia
+Summary: Qt Mobility Multimedia QML plugin
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n libdeclarative-multimedia
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Multimedia QML plugin for QtDeclarative.
+
+
+%package -n libdeclarative-organizer
+Summary: Qt Mobility Organizer QML plugin
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n libdeclarative-organizer
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Organizer QML plugin for QtDeclarative.
+
+
+%package -n libdeclarative-publishsubscribe
+Summary: Qt Mobility Publish and Subscribe QML plugin
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n libdeclarative-publishsubscribe
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Publish and Subscribe QML plugin for QtDeclarative.
+
+
+%package -n libdeclarative-sensors
+Summary: Qt Mobility Sensors Framework QML plugin
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n libdeclarative-sensors
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Sensors QML plugin for QtDeclarative.
+
+
+%package -n libdeclarative-serviceframework
+Summary: Qt Mobility Service Framework QML plugin
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n libdeclarative-serviceframework
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Service Framework QML plugin for QtDeclarative.
+
+
+%package -n libdeclarative-systeminfo
+Summary: Qt Mobility System Information QML plugin
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n libdeclarative-systeminfo
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the System Information QML plugin for QtDeclarative.
+
+
+%package -n servicefw
+Summary: Qt Mobility Service Framework tool
+Group: Development/Tools
+Requires: %{name} = %{version}-%{release}
+
+%description -n servicefw
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains the Service Framework tool (servicefw). It allows
+to register services and make them available over the Service Framework.
+
+
+%package examples
+Summary: Qt Mobility examples
+Group: System/X11
+Requires: %{name} = %{version}-%{release}
+
+%description examples
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains Qt Mobility examples.
+
+
+%package l10n
+Summary: APIs for mobile device functionality - localization files
+Group: System/I18n
+Requires: %{name} = %{version}-%{release}
+
+%description l10n
+Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+This package contains Qt Mobility translations.
+
+
+
+%prep
+%setup -q -n %{name}-opensource-src-%{version}
+
+# no_rpath.patch
+%patch0 -p1
+# fix_translations_install_path.patch
+%patch1 -p1
+# enable_pkgconfig_support.patch
+%patch2 -p1
+# enable_camerabin_with_meego_target.patch
+%patch3 -p1
+# >> setup
+# << setup
+
+%build
+# >> build pre
+# QMF environment variables should be set
+export QMF_INCLUDEDIR=%{_includedir}/qmfclient
+export QMF_LIBDIR=%{_libdir}
+./configure \
+-prefix "%{_prefix}" \
+-headerdir "%{_includedir}" \
+-libdir "%{_libdir}" \
+-bindir "%{_bindir}" \
+-plugindir "%{_libdir}/qt4/plugins" \
+-demosdir "%{_libdir}/qtmobility/demos" \
+-examplesdir "%{_libdir}/qtmobility/examples" \
+-examples \
+-demos \
+-modules "location contacts multimedia publishsubscribe versit messaging systeminfo serviceframework sensors gallery organizer feedback connectivity" \
+-meego
+make %{?_smp_mflags}
+# << build pre
+
+
+
+# >> build post
+# << build post
+%install
+rm -rf %{buildroot}
+# >> install pre
+# << install pre
+
+# >> install post
+%qmake_install
+# Fix wrong path in pkgconfig files
+find %{buildroot}%{_libdir}/pkgconfig -type f -name '*.pc' \
+-exec perl -pi -e "s, -L%{_builddir}/%{name}-opensource-src-\Q%{version}\E/?\S+,,g" {} \;
+# Fix executable permissions
+find %{buildroot}%{_libdir}/qtmobility -type f -perm /u+x,g+x,o+x \( -false \
+-o -name \*.qml \
+-o -name \*.sci \
+\) | xargs chmod -x
+# Fix duplicate files
+%fdupes %{buildroot}%{_includedir}
+%fdupes %{buildroot}%{_libdir}/qtmobility
+# << install post
+%fdupes %{buildroot}/%{_datadir}/qtmobility/translations
+
+
+
+
+
+
+
+
+
+
+%post -n libqtconnectivity1 -p /sbin/ldconfig
+
+%postun -n libqtconnectivity1 -p /sbin/ldconfig
+
+
+%post -n libqtcontacts1 -p /sbin/ldconfig
+
+%postun -n libqtcontacts1 -p /sbin/ldconfig
+
+
+%post -n libqtfeedback1 -p /sbin/ldconfig
+
+%postun -n libqtfeedback1 -p /sbin/ldconfig
+
+
+%post -n libqtgallery1 -p /sbin/ldconfig
+
+%postun -n libqtgallery1 -p /sbin/ldconfig
+
+
+%post -n libqtlocation1 -p /sbin/ldconfig
+
+%postun -n libqtlocation1 -p /sbin/ldconfig
+
+
+%post -n libqtmessaging1 -p /sbin/ldconfig
+
+%postun -n libqtmessaging1 -p /sbin/ldconfig
+
+
+%post -n libqtmultimediakit1 -p /sbin/ldconfig
+
+%postun -n libqtmultimediakit1 -p /sbin/ldconfig
+
+
+%post -n libqtorganizer1 -p /sbin/ldconfig
+
+%postun -n libqtorganizer1 -p /sbin/ldconfig
+
+
+%post -n libqtpublishsubscribe1 -p /sbin/ldconfig
+
+%postun -n libqtpublishsubscribe1 -p /sbin/ldconfig
+
+
+%post -n libqtsensors1 -p /sbin/ldconfig
+
+%postun -n libqtsensors1 -p /sbin/ldconfig
+
+
+%post -n libqtserviceframework1 -p /sbin/ldconfig
+
+%postun -n libqtserviceframework1 -p /sbin/ldconfig
+
+
+%post -n libqtsysteminfo1 -p /sbin/ldconfig
+
+%postun -n libqtsysteminfo1 -p /sbin/ldconfig
+
+
+%post -n libqtversit1 -p /sbin/ldconfig
+
+%postun -n libqtversit1 -p /sbin/ldconfig
+
+
+%post -n libqtversitorganizer1 -p /sbin/ldconfig
+
+%postun -n libqtversitorganizer1 -p /sbin/ldconfig
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+%files
+%defattr(-,root,root,-)
+# >> files
+# << files
+
+
+%files devel
+%defattr(-,root,root,-)
+# >> files devel
+%{_bindir}/icheck
+%{_bindir}/qcrmlgen
+%{_bindir}/servicedbgen
+%{_bindir}/servicexmlgen
+%{_bindir}/vsexplorer
+%{_includedir}/QtContacts/*.h
+%{_includedir}/QtContacts/QContact
+%{_includedir}/QtContacts/QContactAbstractRequest
+%{_includedir}/QtContacts/QContactAction
+%{_includedir}/QtContacts/QContactActionDescriptor
+%{_includedir}/QtContacts/QContactActionFactory
+%{_includedir}/QtContacts/QContactActionFilter
+%{_includedir}/QtContacts/QContactActionTarget
+%{_includedir}/QtContacts/QContactAddress
+%{_includedir}/QtContacts/QContactAnniversary
+%{_includedir}/QtContacts/QContactAvatar
+%{_includedir}/QtContacts/QContactBirthday
+%{_includedir}/QtContacts/QContactChangeLogFilter
+%{_includedir}/QtContacts/QContactChangeSet
+%{_includedir}/QtContacts/QContactDetail
+%{_includedir}/QtContacts/QContactDetailDefinition
+%{_includedir}/QtContacts/QContactDetailDefinitionFetchRequest
+%{_includedir}/QtContacts/QContactDetailDefinitionRemoveRequest
+%{_includedir}/QtContacts/QContactDetailDefinitionSaveRequest
+%{_includedir}/QtContacts/QContactDetailFieldDefinition
+%{_includedir}/QtContacts/QContactDetailFilter
+%{_includedir}/QtContacts/QContactDetailRangeFilter
+%{_includedir}/QtContacts/QContactDisplayLabel
+%{_includedir}/QtContacts/QContactEmailAddress
+%{_includedir}/QtContacts/QContactFamily
+%{_includedir}/QtContacts/QContactFavorite
+%{_includedir}/QtContacts/QContactFetchByIdRequest
+%{_includedir}/QtContacts/QContactFetchHint
+%{_includedir}/QtContacts/QContactFetchRequest
+%{_includedir}/QtContacts/QContactFilter
+%{_includedir}/QtContacts/QContactGender
+%{_includedir}/QtContacts/QContactGeoLocation
+%{_includedir}/QtContacts/QContactGlobalPresence
+%{_includedir}/QtContacts/QContactGuid
+%{_includedir}/QtContacts/QContactHobby
+%{_includedir}/QtContacts/QContactId
+%{_includedir}/QtContacts/QContactIntersectionFilter
+%{_includedir}/QtContacts/QContactInvalidFilter
+%{_includedir}/QtContacts/QContactLocalIdFetchRequest
+%{_includedir}/QtContacts/QContactLocalIdFilter
+%{_includedir}/QtContacts/QContactManager
+%{_includedir}/QtContacts/QContactManagerEngine
+%{_includedir}/QtContacts/QContactManagerEngineFactory
+%{_includedir}/QtContacts/QContactManagerEngineV2
+%{_includedir}/QtContacts/QContactName
+%{_includedir}/QtContacts/QContactNickname
+%{_includedir}/QtContacts/QContactNote
+%{_includedir}/QtContacts/QContactObserver
+%{_includedir}/QtContacts/QContactOnlineAccount
+%{_includedir}/QtContacts/QContactOrganization
+%{_includedir}/QtContacts/QContactPhoneNumber
+%{_includedir}/QtContacts/QContactPresence
+%{_includedir}/QtContacts/QContactRelationship
+%{_includedir}/QtContacts/QContactRelationshipFetchRequest
+%{_includedir}/QtContacts/QContactRelationshipFilter
+%{_includedir}/QtContacts/QContactRelationshipRemoveRequest
+%{_includedir}/QtContacts/QContactRelationshipSaveRequest
+%{_includedir}/QtContacts/QContactRemoveRequest
+%{_includedir}/QtContacts/QContactRingtone
+%{_includedir}/QtContacts/QContactSaveRequest
+%{_includedir}/QtContacts/QContactSortOrder
+%{_includedir}/QtContacts/QContactSyncTarget
+%{_includedir}/QtContacts/QContactTag
+%{_includedir}/QtContacts/QContactThumbnail
+%{_includedir}/QtContacts/QContactTimestamp
+%{_includedir}/QtContacts/QContactType
+%{_includedir}/QtContacts/QContactUnionFilter
+%{_includedir}/QtContacts/QContactUrl
+%{_includedir}/QtFeedback/*.h
+%{_includedir}/QtFeedback/QFeedbackActuator
+%{_includedir}/QtFeedback/QFeedbackEffect
+%{_includedir}/QtFeedback/QFeedbackFileEffect
+%{_includedir}/QtFeedback/QFeedbackFileInterface
+%{_includedir}/QtFeedback/QFeedbackHapticsEffect
+%{_includedir}/QtFeedback/QFeedbackHapticsInterface
+%{_includedir}/QtFeedback/QFeedbackInterface
+%{_includedir}/QtFeedback/QFeedbackThemeInterface
+%{_includedir}/QtGallery/*.h
+%{_includedir}/QtGallery/QAbstractGallery
+%{_includedir}/QtGallery/QDocumentGallery
+%{_includedir}/QtGallery/QGalleryAbstractRequest
+%{_includedir}/QtGallery/QGalleryAbstractResponse
+%{_includedir}/QtGallery/QGalleryFilter
+%{_includedir}/QtGallery/QGalleryIntersectionFilter
+%{_includedir}/QtGallery/QGalleryItemRequest
+%{_includedir}/QtGallery/QGalleryMetaDataFilter
+%{_includedir}/QtGallery/QGalleryQueryModel
+%{_includedir}/QtGallery/QGalleryQueryRequest
+%{_includedir}/QtGallery/QGalleryResource
+%{_includedir}/QtGallery/QGalleryResultSet
+%{_includedir}/QtGallery/QGalleryTypeRequest
+%{_includedir}/QtGallery/QGalleryUnionFilter
+%{_includedir}/QtLocation/*.h
+%{_includedir}/QtLocation/QGeoAddress
+%{_includedir}/QtLocation/QGeoAreaMonitor
+%{_includedir}/QtLocation/QGeoBoundingArea
+%{_includedir}/QtLocation/QGeoBoundingBox
+%{_includedir}/QtLocation/QGeoBoundingCircle
+%{_includedir}/QtLocation/QGeoCoordinate
+%{_includedir}/QtLocation/QGeoManeuver
+%{_includedir}/QtLocation/QGeoMapCircleObject
+%{_includedir}/QtLocation/QGeoMapData
+%{_includedir}/QtLocation/QGeoMapGroupObject
+%{_includedir}/QtLocation/QGeoMapObject
+%{_includedir}/QtLocation/QGeoMapObjectInfo
+%{_includedir}/QtLocation/QGeoMapOverlay
+%{_includedir}/QtLocation/QGeoMapPixmapObject
+%{_includedir}/QtLocation/QGeoMapPolygonObject
+%{_includedir}/QtLocation/QGeoMapPolylineObject
+%{_includedir}/QtLocation/QGeoMapRectangleObject
+%{_includedir}/QtLocation/QGeoMapRouteObject
+%{_includedir}/QtLocation/QGeoMapTextObject
+%{_includedir}/QtLocation/QGeoMappingManager
+%{_includedir}/QtLocation/QGeoMappingManagerEngine
+%{_includedir}/QtLocation/QGeoPlace
+%{_includedir}/QtLocation/QGeoPositionInfo
+%{_includedir}/QtLocation/QGeoPositionInfoSource
+%{_includedir}/QtLocation/QGeoRoute
+%{_includedir}/QtLocation/QGeoRouteReply
+%{_includedir}/QtLocation/QGeoRouteRequest
+%{_includedir}/QtLocation/QGeoRouteSegment
+%{_includedir}/QtLocation/QGeoRoutingManager
+%{_includedir}/QtLocation/QGeoRoutingManagerEngine
+%{_includedir}/QtLocation/QGeoSatelliteInfo
+%{_includedir}/QtLocation/QGeoSatelliteInfoSource
+%{_includedir}/QtLocation/QGeoSearchManager
+%{_includedir}/QtLocation/QGeoSearchManagerEngine
+%{_includedir}/QtLocation/QGeoSearchReply
+%{_includedir}/QtLocation/QGeoServiceProvider
+%{_includedir}/QtLocation/QGeoServiceProviderFactory
+%{_includedir}/QtLocation/QGeoTiledMapData
+%{_includedir}/QtLocation/QGeoTiledMapReply
+%{_includedir}/QtLocation/QGeoTiledMapRequest
+%{_includedir}/QtLocation/QGeoTiledMappingManagerEngine
+%{_includedir}/QtLocation/QGraphicsGeoMap
+%{_includedir}/QtLocation/QLandmark
+%{_includedir}/QtLocation/QLandmarkAbstractRequest
+%{_includedir}/QtLocation/QLandmarkAttributeFilter
+%{_includedir}/QtLocation/QLandmarkBoxFilter
+%{_includedir}/QtLocation/QLandmarkCategory
+%{_includedir}/QtLocation/QLandmarkCategoryFetchByIdRequest
+%{_includedir}/QtLocation/QLandmarkCategoryFetchRequest
+%{_includedir}/QtLocation/QLandmarkCategoryFilter
+%{_includedir}/QtLocation/QLandmarkCategoryId
+%{_includedir}/QtLocation/QLandmarkCategoryIdFetchRequest
+%{_includedir}/QtLocation/QLandmarkCategoryRemoveRequest
+%{_includedir}/QtLocation/QLandmarkCategorySaveRequest
+%{_includedir}/QtLocation/QLandmarkExportRequest
+%{_includedir}/QtLocation/QLandmarkFetchByIdRequest
+%{_includedir}/QtLocation/QLandmarkFetchRequest
+%{_includedir}/QtLocation/QLandmarkFilter
+%{_includedir}/QtLocation/QLandmarkId
+%{_includedir}/QtLocation/QLandmarkIdFetchRequest
+%{_includedir}/QtLocation/QLandmarkIdFilter
+%{_includedir}/QtLocation/QLandmarkImportRequest
+%{_includedir}/QtLocation/QLandmarkIntersectionFilter
+%{_includedir}/QtLocation/QLandmarkManager
+%{_includedir}/QtLocation/QLandmarkManagerEngine
+%{_includedir}/QtLocation/QLandmarkManagerEngineFactory
+%{_includedir}/QtLocation/QLandmarkNameFilter
+%{_includedir}/QtLocation/QLandmarkNameSort
+%{_includedir}/QtLocation/QLandmarkProximityFilter
+%{_includedir}/QtLocation/QLandmarkRemoveRequest
+%{_includedir}/QtLocation/QLandmarkSaveRequest
+%{_includedir}/QtLocation/QLandmarkSortOrder
+%{_includedir}/QtLocation/QLandmarkUnionFilter
+%{_includedir}/QtLocation/QNmeaPositionInfoSource
+%{_includedir}/QtMessaging/*.h
+%{_includedir}/QtMessaging/QMessage
+%{_includedir}/QtMessaging/QMessageAccount
+%{_includedir}/QtMessaging/QMessageAccountFilter
+%{_includedir}/QtMessaging/QMessageAccountId
+%{_includedir}/QtMessaging/QMessageAccountSortOrder
+%{_includedir}/QtMessaging/QMessageAddress
+%{_includedir}/QtMessaging/QMessageContentContainer
+%{_includedir}/QtMessaging/QMessageContentContainerId
+%{_includedir}/QtMessaging/QMessageDataComparator
+%{_includedir}/QtMessaging/QMessageFilter
+%{_includedir}/QtMessaging/QMessageFolder
+%{_includedir}/QtMessaging/QMessageFolderFilter
+%{_includedir}/QtMessaging/QMessageFolderId
+%{_includedir}/QtMessaging/QMessageFolderSortOrder
+%{_includedir}/QtMessaging/QMessageId
+%{_includedir}/QtMessaging/QMessageManager
+%{_includedir}/QtMessaging/QMessageService
+%{_includedir}/QtMessaging/QMessageSortOrder
+%{_includedir}/QtMessaging/QMessageStore
+%{_includedir}/QtMobility/*.h
+%{_includedir}/QtMobility/QLatin1Constant
+%{_includedir}/QtMultimediaKit/*.h
+%{_includedir}/QtMultimediaKit/QAbstractAudioDeviceInfo
+%{_includedir}/QtMultimediaKit/QAbstractAudioInput
+%{_includedir}/QtMultimediaKit/QAbstractAudioOutput
+%{_includedir}/QtMultimediaKit/QAbstractVideoBuffer
+%{_includedir}/QtMultimediaKit/QAbstractVideoSurface
+%{_includedir}/QtMultimediaKit/QAudio
+%{_includedir}/QtMultimediaKit/QAudioCaptureSource
+%{_includedir}/QtMultimediaKit/QAudioDeviceInfo
+%{_includedir}/QtMultimediaKit/QAudioEncoderControl
+%{_includedir}/QtMultimediaKit/QAudioEncoderSettings
+%{_includedir}/QtMultimediaKit/QAudioEndpointSelector
+%{_includedir}/QtMultimediaKit/QAudioFormat
+%{_includedir}/QtMultimediaKit/QAudioInput
+%{_includedir}/QtMultimediaKit/QAudioOutput
+%{_includedir}/QtMultimediaKit/QAudioSystemPlugin
+%{_includedir}/QtMultimediaKit/QCamera
+%{_includedir}/QtMultimediaKit/QCameraControl
+%{_includedir}/QtMultimediaKit/QCameraExposure
+%{_includedir}/QtMultimediaKit/QCameraExposureControl
+%{_includedir}/QtMultimediaKit/QCameraFlashControl
+%{_includedir}/QtMultimediaKit/QCameraFocus
+%{_includedir}/QtMultimediaKit/QCameraFocusControl
+%{_includedir}/QtMultimediaKit/QCameraFocusZone
+%{_includedir}/QtMultimediaKit/QCameraImageCapture
+%{_includedir}/QtMultimediaKit/QCameraImageCaptureControl
+%{_includedir}/QtMultimediaKit/QCameraImageProcessing
+%{_includedir}/QtMultimediaKit/QCameraImageProcessingControl
+%{_includedir}/QtMultimediaKit/QCameraLocksControl
+%{_includedir}/QtMultimediaKit/QCameraViewfinder
+%{_includedir}/QtMultimediaKit/QGraphicsVideoItem
+%{_includedir}/QtMultimediaKit/QImageEncoderControl
+%{_includedir}/QtMultimediaKit/QImageEncoderSettings
+%{_includedir}/QtMultimediaKit/QLocalMediaPlaylistProvider
+%{_includedir}/QtMultimediaKit/QMediaBindableInterface
+%{_includedir}/QtMultimediaKit/QMediaContainerControl
+%{_includedir}/QtMultimediaKit/QMediaContent
+%{_includedir}/QtMultimediaKit/QMediaControl
+%{_includedir}/QtMultimediaKit/QMediaImageViewer
+%{_includedir}/QtMultimediaKit/QMediaObject
+%{_includedir}/QtMultimediaKit/QMediaPlayer
+%{_includedir}/QtMultimediaKit/QMediaPlayerControl
+%{_includedir}/QtMultimediaKit/QMediaPlaylist
+%{_includedir}/QtMultimediaKit/QMediaPlaylistControl
+%{_includedir}/QtMultimediaKit/QMediaPlaylistIOPlugin
+%{_includedir}/QtMultimediaKit/QMediaPlaylistNavigator
+%{_includedir}/QtMultimediaKit/QMediaPlaylistProvider
+%{_includedir}/QtMultimediaKit/QMediaPlaylistReader
+%{_includedir}/QtMultimediaKit/QMediaPlaylistSourceControl
+%{_includedir}/QtMultimediaKit/QMediaPlaylistWriter
+%{_includedir}/QtMultimediaKit/QMediaRecorder
+%{_includedir}/QtMultimediaKit/QMediaRecorderControl
+%{_includedir}/QtMultimediaKit/QMediaResource
+%{_includedir}/QtMultimediaKit/QMediaService
+%{_includedir}/QtMultimediaKit/QMediaServiceProvider
+%{_includedir}/QtMultimediaKit/QMediaServiceProviderHint
+%{_includedir}/QtMultimediaKit/QMediaServiceProviderPlugin
+%{_includedir}/QtMultimediaKit/QMediaStreamsControl
+%{_includedir}/QtMultimediaKit/QMediaTimeInterval
+%{_includedir}/QtMultimediaKit/QMediaTimeRange
+%{_includedir}/QtMultimediaKit/QMetaDataReaderControl
+%{_includedir}/QtMultimediaKit/QMetaDataWriterControl
+%{_includedir}/QtMultimediaKit/QRadioTuner
+%{_includedir}/QtMultimediaKit/QRadioTunerControl
+%{_includedir}/QtMultimediaKit/QVideoDeviceControl
+%{_includedir}/QtMultimediaKit/QVideoEncoderControl
+%{_includedir}/QtMultimediaKit/QVideoEncoderSettings
+%{_includedir}/QtMultimediaKit/QVideoFrame
+%{_includedir}/QtMultimediaKit/QVideoRendererControl
+%{_includedir}/QtMultimediaKit/QVideoSurfaceFormat
+%{_includedir}/QtMultimediaKit/QVideoWidget
+%{_includedir}/QtMultimediaKit/QVideoWidgetControl
+%{_includedir}/QtMultimediaKit/QVideoWindowControl
+%{_includedir}/QtOrganizer/*.h
+%{_includedir}/QtOrganizer/QOrganizerAbstractRequest
+%{_includedir}/QtOrganizer/QOrganizerCollection
+%{_includedir}/QtOrganizer/QOrganizerCollectionChangeSet
+%{_includedir}/QtOrganizer/QOrganizerCollectionEngineId
+%{_includedir}/QtOrganizer/QOrganizerCollectionFetchRequest
+%{_includedir}/QtOrganizer/QOrganizerCollectionId
+%{_includedir}/QtOrganizer/QOrganizerCollectionRemoveRequest
+%{_includedir}/QtOrganizer/QOrganizerCollectionSaveRequest
+%{_includedir}/QtOrganizer/QOrganizerEvent
+%{_includedir}/QtOrganizer/QOrganizerEventAttendee
+%{_includedir}/QtOrganizer/QOrganizerEventOccurrence
+%{_includedir}/QtOrganizer/QOrganizerEventRsvp
+%{_includedir}/QtOrganizer/QOrganizerEventTime
+%{_includedir}/QtOrganizer/QOrganizerItem
+%{_includedir}/QtOrganizer/QOrganizerItemAttachment
+%{_includedir}/QtOrganizer/QOrganizerItemAudibleReminder
+%{_includedir}/QtOrganizer/QOrganizerItemChangeLogFilter
+%{_includedir}/QtOrganizer/QOrganizerItemChangeSet
+%{_includedir}/QtOrganizer/QOrganizerItemCollectionFilter
+%{_includedir}/QtOrganizer/QOrganizerItemComment
+%{_includedir}/QtOrganizer/QOrganizerItemDescription
+%{_includedir}/QtOrganizer/QOrganizerItemDetail
+%{_includedir}/QtOrganizer/QOrganizerItemDetailDefinition
+%{_includedir}/QtOrganizer/QOrganizerItemDetailDefinitionFetchRequest
+%{_includedir}/QtOrganizer/QOrganizerItemDetailDefinitionRemoveRequest
+%{_includedir}/QtOrganizer/QOrganizerItemDetailDefinitionSaveRequest
+%{_includedir}/QtOrganizer/QOrganizerItemDetailFieldDefinition
+%{_includedir}/QtOrganizer/QOrganizerItemDetailFilter
+%{_includedir}/QtOrganizer/QOrganizerItemDetailRangeFilter
+%{_includedir}/QtOrganizer/QOrganizerItemDisplayLabel
+%{_includedir}/QtOrganizer/QOrganizerItemEmailReminder
+%{_includedir}/QtOrganizer/QOrganizerItemEngineId
+%{_includedir}/QtOrganizer/QOrganizerItemFetchByIdRequest
+%{_includedir}/QtOrganizer/QOrganizerItemFetchForExportRequest
+%{_includedir}/QtOrganizer/QOrganizerItemFetchHint
+%{_includedir}/QtOrganizer/QOrganizerItemFetchRequest
+%{_includedir}/QtOrganizer/QOrganizerItemFilter
+%{_includedir}/QtOrganizer/QOrganizerItemGuid
+%{_includedir}/QtOrganizer/QOrganizerItemId
+%{_includedir}/QtOrganizer/QOrganizerItemIdFetchRequest
+%{_includedir}/QtOrganizer/QOrganizerItemIdFilter
+%{_includedir}/QtOrganizer/QOrganizerItemIntersectionFilter
+%{_includedir}/QtOrganizer/QOrganizerItemInvalidFilter
+%{_includedir}/QtOrganizer/QOrganizerItemLocation
+%{_includedir}/QtOrganizer/QOrganizerItemObserver
+%{_includedir}/QtOrganizer/QOrganizerItemOccurrenceFetchRequest
+%{_includedir}/QtOrganizer/QOrganizerItemParent
+%{_includedir}/QtOrganizer/QOrganizerItemPriority
+%{_includedir}/QtOrganizer/QOrganizerItemRecurrence
+%{_includedir}/QtOrganizer/QOrganizerItemReminder
+%{_includedir}/QtOrganizer/QOrganizerItemRemoveRequest
+%{_includedir}/QtOrganizer/QOrganizerItemSaveRequest
+%{_includedir}/QtOrganizer/QOrganizerItemSortOrder
+%{_includedir}/QtOrganizer/QOrganizerItemTag
+%{_includedir}/QtOrganizer/QOrganizerItemTimestamp
+%{_includedir}/QtOrganizer/QOrganizerItemType
+%{_includedir}/QtOrganizer/QOrganizerItemUnionFilter
+%{_includedir}/QtOrganizer/QOrganizerItemVisualReminder
+%{_includedir}/QtOrganizer/QOrganizerJournal
+%{_includedir}/QtOrganizer/QOrganizerJournalTime
+%{_includedir}/QtOrganizer/QOrganizerManager
+%{_includedir}/QtOrganizer/QOrganizerManagerEngine
+%{_includedir}/QtOrganizer/QOrganizerManagerEngineFactory
+%{_includedir}/QtOrganizer/QOrganizerManagerEngineV2
+%{_includedir}/QtOrganizer/QOrganizerNote
+%{_includedir}/QtOrganizer/QOrganizerRecurrenceRule
+%{_includedir}/QtOrganizer/QOrganizerTodo
+%{_includedir}/QtOrganizer/QOrganizerTodoOccurrence
+%{_includedir}/QtOrganizer/QOrganizerTodoProgress
+%{_includedir}/QtOrganizer/QOrganizerTodoTime
+%{_includedir}/QtPublishSubscribe/*.h
+%{_includedir}/QtPublishSubscribe/QValueSpace
+%{_includedir}/QtPublishSubscribe/QValueSpacePublisher
+%{_includedir}/QtPublishSubscribe/QValueSpaceSubscriber
+%{_includedir}/QtSensors/*.h
+%{_includedir}/QtSensors/QAccelerometer
+%{_includedir}/QtSensors/QAccelerometerFilter
+%{_includedir}/QtSensors/QAccelerometerReading
+%{_includedir}/QtSensors/QAmbientLightFilter
+%{_includedir}/QtSensors/QAmbientLightReading
+%{_includedir}/QtSensors/QAmbientLightSensor
+%{_includedir}/QtSensors/QCompass
+%{_includedir}/QtSensors/QCompassFilter
+%{_includedir}/QtSensors/QCompassReading
+%{_includedir}/QtSensors/QGyroscope
+%{_includedir}/QtSensors/QGyroscopeFilter
+%{_includedir}/QtSensors/QGyroscopeReading
+%{_includedir}/QtSensors/QLightFilter
+%{_includedir}/QtSensors/QLightReading
+%{_includedir}/QtSensors/QLightSensor
+%{_includedir}/QtSensors/QMagnetometer
+%{_includedir}/QtSensors/QMagnetometerFilter
+%{_includedir}/QtSensors/QMagnetometerReading
+%{_includedir}/QtSensors/QOrientationFilter
+%{_includedir}/QtSensors/QOrientationReading
+%{_includedir}/QtSensors/QOrientationSensor
+%{_includedir}/QtSensors/QProximityFilter
+%{_includedir}/QtSensors/QProximityReading
+%{_includedir}/QtSensors/QProximitySensor
+%{_includedir}/QtSensors/QRotationFilter
+%{_includedir}/QtSensors/QRotationReading
+%{_includedir}/QtSensors/QRotationSensor
+%{_includedir}/QtSensors/QSensor
+%{_includedir}/QtSensors/QSensorBackend
+%{_includedir}/QtSensors/QSensorBackendFactory
+%{_includedir}/QtSensors/QSensorChangesInterface
+%{_includedir}/QtSensors/QSensorFilter
+%{_includedir}/QtSensors/QSensorManager
+%{_includedir}/QtSensors/QSensorPluginInterface
+%{_includedir}/QtSensors/QSensorReading
+%{_includedir}/QtSensors/QTapFilter
+%{_includedir}/QtSensors/QTapReading
+%{_includedir}/QtSensors/QTapSensor
+%{_includedir}/QtSensors/qtimestamp
+%{_includedir}/QtServiceFramework/*.h
+%{_includedir}/QtServiceFramework/Entry
+%{_includedir}/QtServiceFramework/QAbstractSecuritySession
+%{_includedir}/QtServiceFramework/QRemoteServiceRegister
+%{_includedir}/QtServiceFramework/QService
+%{_includedir}/QtServiceFramework/QServiceContext
+%{_includedir}/QtServiceFramework/QServiceFilter
+%{_includedir}/QtServiceFramework/QServiceInterfaceDescriptor
+%{_includedir}/QtServiceFramework/QServiceManager
+%{_includedir}/QtServiceFramework/QServicePluginInterface
+%{_includedir}/QtSystemInfo/*.h
+%{_includedir}/QtSystemInfo/QSystemBatteryInfo
+%{_includedir}/QtSystemInfo/QSystemDeviceInfo
+%{_includedir}/QtSystemInfo/QSystemDisplayInfo
+%{_includedir}/QtSystemInfo/QSystemInfo
+%{_includedir}/QtSystemInfo/QSystemNetworkInfo
+%{_includedir}/QtSystemInfo/QSystemScreenSaver
+%{_includedir}/QtSystemInfo/QSystemStorageInfo
+%{_includedir}/QtVersit/*.h
+%{_includedir}/QtVersit/QVersitContactExporter
+%{_includedir}/QtVersit/QVersitContactExporterDetailHandler
+%{_includedir}/QtVersit/QVersitContactExporterDetailHandlerV2
+%{_includedir}/QtVersit/QVersitContactHandler
+%{_includedir}/QtVersit/QVersitContactHandlerFactory
+%{_includedir}/QtVersit/QVersitContactImporter
+%{_includedir}/QtVersit/QVersitContactImporterPropertyHandler
+%{_includedir}/QtVersit/QVersitContactImporterPropertyHandlerV2
+%{_includedir}/QtVersit/QVersitDefaultResourceHandler
+%{_includedir}/QtVersit/QVersitDocument
+%{_includedir}/QtVersit/QVersitProperty
+%{_includedir}/QtVersit/QVersitReader
+%{_includedir}/QtVersit/QVersitResourceHandler
+%{_includedir}/QtVersit/QVersitWriter
+%{_includedir}/QtVersitOrganizer/*.h
+%{_includedir}/QtVersitOrganizer/QVersitOrganizerExporter
+%{_includedir}/QtVersitOrganizer/QVersitOrganizerExporterDetailHandler
+%{_includedir}/QtVersitOrganizer/QVersitOrganizerHandler
+%{_includedir}/QtVersitOrganizer/QVersitOrganizerHandlerFactory
+%{_includedir}/QtVersitOrganizer/QVersitOrganizerImporter
+%{_includedir}/QtVersitOrganizer/QVersitOrganizerImporterPropertyHandler
+%{_includedir}/QtVersitOrganizer/QVersitTimeZoneHandler
+%{_libdir}/libQtConnectivity.prl
+%{_libdir}/libQtConnectivity.so
+%{_libdir}/libQtContacts.prl
+%{_libdir}/libQtContacts.so
+%{_libdir}/libQtFeedback.prl
+%{_libdir}/libQtFeedback.so
+%{_libdir}/libQtGallery.prl
+%{_libdir}/libQtGallery.so
+%{_libdir}/libQtLocation.prl
+%{_libdir}/libQtLocation.so
+%{_libdir}/libQtMessaging.prl
+%{_libdir}/libQtMessaging.so
+%{_libdir}/libQtMultimediaKit.prl
+%{_libdir}/libQtMultimediaKit.so
+%{_libdir}/libQtOrganizer.prl
+%{_libdir}/libQtOrganizer.so
+%{_libdir}/libQtPublishSubscribe.prl
+%{_libdir}/libQtPublishSubscribe.so
+%{_libdir}/libQtSensors.prl
+%{_libdir}/libQtSensors.so
+%{_libdir}/libQtServiceFramework.prl
+%{_libdir}/libQtServiceFramework.so
+%{_libdir}/libQtSystemInfo.prl
+%{_libdir}/libQtSystemInfo.so
+%{_libdir}/libQtVersit.prl
+%{_libdir}/libQtVersit.so
+%{_libdir}/libQtVersitOrganizer.prl
+%{_libdir}/libQtVersitOrganizer.so
+%{_libdir}/pkgconfig/QtContacts.pc
+%{_libdir}/pkgconfig/QtLocation.pc
+%{_libdir}/pkgconfig/QtVersit.pc
+%{_libdir}/pkgconfig/QtVersitOrganizer.pc
+%{_datadir}/qt4/mkspecs/features/mobility.prf
+%{_datadir}/qt4/mkspecs/features/mobilityconfig.prf
+# << files devel
+
+%files -n libqtconnectivity1
+%defattr(-,root,root,-)
+# >> files libqtconnectivity1
+%{_libdir}/libQtConnectivity.so.*
+# << files libqtconnectivity1
+
+%files -n libqtcontacts1
+%defattr(-,root,root,-)
+# >> files libqtcontacts1
+%{_libdir}/libQtContacts.so.*
+%{_libdir}/qt4/plugins/contacts/libqtcontacts_serviceactionmanager.so
+# << files libqtcontacts1
+
+%files -n libqtfeedback1
+%defattr(-,root,root,-)
+# >> files libqtfeedback1
+%{_libdir}/libQtFeedback.so.*
+%{_libdir}/qt4/plugins/feedback/libqtfeedback_mmk.so
+# << files libqtfeedback1
+
+%files -n libqtgallery1
+%defattr(-,root,root,-)
+# >> files libqtgallery1
+%{_libdir}/libQtGallery.so.*
+# << files libqtgallery1
+
+%files -n libqtlocation1
+%defattr(-,root,root,-)
+# >> files libqtlocation1
+%{_libdir}/libQtLocation.so.*
+%{_libdir}/qt4/plugins/geoservices/libqtgeoservices_nokia.so
+%{_libdir}/qt4/plugins/landmarks/libqtlandmarks_sqlite.so
+# << files libqtlocation1
+
+%files -n libqtmessaging1
+%defattr(-,root,root,-)
+# >> files libqtmessaging1
+%{_libdir}/libQtMessaging.so.*
+# << files libqtmessaging1
+
+%files -n libqtmultimediakit1
+%defattr(-,root,root,-)
+# >> files libqtmultimediakit1
+%{_libdir}/libQtMultimediaKit.so.*
+%{_libdir}/qt4/plugins/mediaservice/libqgstengine.so
+%{_libdir}/qt4/plugins/mediaservice/libqtmedia_v4lengine.so
+%{_libdir}/qt4/plugins/playlistformats/libqtmultimediakit_m3u.so
+%{_libdir}/qt4/plugins/audio/libqtmedia_pulse.so
+# << files libqtmultimediakit1
+
+%files -n libqtorganizer1
+%defattr(-,root,root,-)
+# >> files libqtorganizer1
+%{_libdir}/libQtOrganizer.so.*
+%{_libdir}/qt4/plugins/organizer/libqtorganizer_skeleton.so
+# << files libqtorganizer1
+
+%files -n libqtpublishsubscribe1
+%defattr(-,root,root,-)
+# >> files libqtpublishsubscribe1
+%{_libdir}/libQtPublishSubscribe.so.*
+# << files libqtpublishsubscribe1
+
+%files -n libqtsensors1
+%defattr(-,root,root,-)
+# >> files libqtsensors1
+%config %{_sysconfdir}/xdg/Nokia/Sensors.conf
+%{_libdir}/libQtSensors.so.*
+%{_libdir}/qt4/plugins/sensors/libqtsensors_generic.so
+%{_libdir}/qt4/plugins/sensors/libqtsensors_maemo6.so
+# << files libqtsensors1
+
+%files -n libqtserviceframework1
+%defattr(-,root,root,-)
+# >> files libqtserviceframework1
+%{_libdir}/libQtServiceFramework.so.*
+# << files libqtserviceframework1
+
+%files -n libqtsysteminfo1
+%defattr(-,root,root,-)
+# >> files libqtsysteminfo1
+%{_libdir}/libQtSystemInfo.so.*
+# << files libqtsysteminfo1
+
+%files -n libqtversit1
+%defattr(-,root,root,-)
+# >> files libqtversit1
+%{_libdir}/libQtVersit.so.*
+%{_libdir}/qt4/plugins/versit/libqtversit_backuphandler.so
+%{_libdir}/qt4/plugins/versit/libqtversit_vcardpreserver.so
+# << files libqtversit1
+
+%files -n libqtversitorganizer1
+%defattr(-,root,root,-)
+# >> files libqtversitorganizer1
+%{_libdir}/libQtVersitOrganizer.so.*
+# << files libqtversitorganizer1
+
+%files -n libdeclarative-contacts
+%defattr(-,root,root,-)
+# >> files libdeclarative-contacts
+%{_libdir}/qt4/imports/QtMobility/contacts/libdeclarative_contacts.so
+%{_libdir}/qt4/imports/QtMobility/contacts/qmldir
+# << files libdeclarative-contacts
+
+%files -n libdeclarative-feedback
+%defattr(-,root,root,-)
+# >> files libdeclarative-feedback
+%{_libdir}/qt4/imports/QtMobility/feedback/libdeclarative_feedback.so
+%{_libdir}/qt4/imports/QtMobility/feedback/qmldir
+# << files libdeclarative-feedback
+
+%files -n libdeclarative-gallery
+%defattr(-,root,root,-)
+# >> files libdeclarative-gallery
+%{_libdir}/qt4/imports/QtMobility/gallery/libdeclarative_gallery.so
+%{_libdir}/qt4/imports/QtMobility/gallery/qmldir
+# << files libdeclarative-gallery
+
+%files -n libdeclarative-location
+%defattr(-,root,root,-)
+# >> files libdeclarative-location
+%{_libdir}/qt4/imports/QtMobility/location/libdeclarative_location.so
+%{_libdir}/qt4/imports/QtMobility/location/qmldir
+# << files libdeclarative-location
+
+%files -n libdeclarative-messaging
+%defattr(-,root,root,-)
+# >> files libdeclarative-messaging
+%{_libdir}/qt4/imports/QtMobility/messaging/libdeclarative_messaging.so
+%{_libdir}/qt4/imports/QtMobility/messaging/qmldir
+# << files libdeclarative-messaging
+
+%files -n libdeclarative-multimedia
+%defattr(-,root,root,-)
+# >> files libdeclarative-multimedia
+%{_libdir}/qt4/imports/QtMultimediaKit/libdeclarative_multimedia.so
+%{_libdir}/qt4/imports/QtMultimediaKit/qmldir
+# << files libdeclarative-multimedia
+
+%files -n libdeclarative-organizer
+%defattr(-,root,root,-)
+# >> files libdeclarative-organizer
+%{_libdir}/qt4/imports/QtMobility/organizer/libdeclarative_organizer.so
+%{_libdir}/qt4/imports/QtMobility/organizer/qmldir
+# << files libdeclarative-organizer
+
+%files -n libdeclarative-publishsubscribe
+%defattr(-,root,root,-)
+# >> files libdeclarative-publishsubscribe
+%{_libdir}/qt4/imports/QtMobility/publishsubscribe/libdeclarative_publishsubscribe.so
+%{_libdir}/qt4/imports/QtMobility/publishsubscribe/qmldir
+# << files libdeclarative-publishsubscribe
+
+%files -n libdeclarative-sensors
+%defattr(-,root,root,-)
+# >> files libdeclarative-sensors
+%{_libdir}/qt4/imports/QtMobility/sensors/libdeclarative_sensors.so
+%{_libdir}/qt4/imports/QtMobility/sensors/qmldir
+# << files libdeclarative-sensors
+
+%files -n libdeclarative-serviceframework
+%defattr(-,root,root,-)
+# >> files libdeclarative-serviceframework
+%{_libdir}/qt4/imports/QtMobility/serviceframework/libdeclarative_serviceframework.so
+%{_libdir}/qt4/imports/QtMobility/serviceframework/qmldir
+# << files libdeclarative-serviceframework
+
+%files -n libdeclarative-systeminfo
+%defattr(-,root,root,-)
+# >> files libdeclarative-systeminfo
+%{_libdir}/qt4/imports/QtMobility/systeminfo/libdeclarative_systeminfo.so
+%{_libdir}/qt4/imports/QtMobility/systeminfo/qmldir
+# << files libdeclarative-systeminfo
+
+%files -n servicefw
+%defattr(-,root,root,-)
+# >> files servicefw
+%{_bindir}/servicefw
+# << files servicefw
+
+%files examples
+%defattr(-,root,root,-)
+# >> files examples
+%{_libdir}/qt4/plugins/sensors/libqtsensors_grueplugin.so
+%{_libdir}/qt4/plugins/serviceframework/libserviceframework_bluetoothtransferplugin.so
+%{_libdir}/qt4/plugins/serviceframework/libserviceframework_filemanagerplugin.so
+%{_libdir}/qt4/plugins/serviceframework/libserviceframework_landlinedialerservice.so
+%{_libdir}/qt4/plugins/serviceframework/libserviceframework_notesmanagerplugin.so
+%{_libdir}/qt4/plugins/serviceframework/libserviceframework_voipdialerservice.so
+%{_libdir}/qtmobility/demos/
+%{_libdir}/qtmobility/examples/
+# << files examples
+
+%files l10n
+%defattr(-,root,root,-)
+# >> files l10n
+%{_datadir}/qtmobility/translations/qtmobility_ar.qm
+%{_datadir}/qtmobility/translations/qtmobility_cs.qm
+%{_datadir}/qtmobility/translations/qtmobility_da.qm
+%{_datadir}/qtmobility/translations/qtmobility_de.qm
+%{_datadir}/qtmobility/translations/qtmobility_es.qm
+%{_datadir}/qtmobility/translations/qtmobility_fr.qm
+%{_datadir}/qtmobility/translations/qtmobility_he.qm
+%{_datadir}/qtmobility/translations/qtmobility_hu.qm
+%{_datadir}/qtmobility/translations/qtmobility_ja.qm
+%{_datadir}/qtmobility/translations/qtmobility_pl.qm
+%{_datadir}/qtmobility/translations/qtmobility_pt.qm
+%{_datadir}/qtmobility/translations/qtmobility_ru.qm
+%{_datadir}/qtmobility/translations/qtmobility_sk.qm
+%{_datadir}/qtmobility/translations/qtmobility_sl.qm
+%{_datadir}/qtmobility/translations/qtmobility_sv.qm
+#%{_datadir}/qtmobility/translations/qtmobility_uk.qm
+%{_datadir}/qtmobility/translations/qtmobility_zh_CN.qm
+%{_datadir}/qtmobility/translations/qtmobility_zh_TW.qm
+# << files l10n
+
--- src/meegoinstalls/qt-mobility.yaml
+++ src/meegoinstalls/qt-mobility.yaml
+Name: qt-mobility
+Summary: APIs for mobile device functionality
+Version: 1.1.0+git2438
+Release: 1
+Group: System/Libraries
+License: LGPLv2.1 with exception or GPLv3
+URL: http://qt.gitorious.org/qt-mobility
+Sources:
+ - http://get.qt.nokia.com/qt/add-ons/%{name}-opensource-src-%{version}.tar.gz
+SourcePrefix: "%{name}-opensource-src-%{version}"
+Patches:
+ - no_rpath.patch
+ - fix_translations_install_path.patch
+ - enable_pkgconfig_support.patch
+ - enable_camerabin_with_meego_target.patch
+Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality. These
+ APIs allow the developer to use these features with ease from one framework and
+ apply them to phones, netbooks and non-mobile personal computers.
+Requires:
+ - libqtconnectivity1 = %{version}
+ - libqtcontacts1 = %{version}
+ - libqtfeedback1 = %{version}
+ - libqtgallery1 = %{version}
+ - libqtlocation1 = %{version}
+ - libqtmessaging1 = %{version}
+ - libqtmultimediakit1 = %{version}
+ - libqtorganizer1 = %{version}
+ - libqtpublishsubscribe1 = %{version}
+ - libqtsensors1 = %{version}
+ - libqtserviceframework1 = %{version}
+ - libqtsysteminfo1 = %{version}
+ - libqtversit1 = %{version}
+ - libqtversitorganizer1 = %{version}
+PkgConfigBR:
+ - QtGui
+ - QtOpenGL
+ - alsa
+ - blkid
+ - bluez
+ - connman
+ - contextsubscriber-1.0
+ - gconf-2.0
+ - geoclue
+ - gstreamer-plugins-bad-free-0.10
+ - gstreamer-plugins-base-0.10
+ - gypsy
+ - libpulse
+ - qttracker
+ - qmfclient
+ - sensord
+ - udev
+ - x11
+ - xext
+ - xrandr
+ - xrender
+ - xv
+PkgBR:
+ - qt-devel-tools
+Configure: none
+Builder: none
+RunFdupes: "%{_datadir}/qtmobility/translations"
+SubPackages:
+ - Name: devel
+ Summary: APIs for mobile device functionality - development files
+ Group: Development/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the development files needed to build Qt applications
+ using Qt Mobility libraries.
+ Requires:
+ - servicefw
+
+ - Name: libqtconnectivity1
+ AsWholeName: yes
+ Summary: Qt Mobility Connectivity module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Connectivity API. It provides APIs for working with
+ local devices.
+
+ - Name: libqtcontacts1
+ AsWholeName: yes
+ Summary: Qt Mobility Contacts module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains an API enabling clients to request contact data from
+ local or remote backends.
+
+ - Name: libqtfeedback1
+ AsWholeName: yes
+ Summary: Qt Mobility Feedback module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Feedback API. It enables a client to control
+ the vibration of the device or the piezo feedback from the screen.
+
+ - Name: libqtgallery1
+ AsWholeName: yes
+ Summary: Qt Mobility Document Gallery module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains an API for accessing collections of documents and media
+ and their meta-data.
+
+ - Name: libqtlocation1
+ AsWholeName: yes
+ Summary: Qt Mobility Location module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Location API. It provides a library for distributing
+ and receiving location data using arbitrary data sources.
+
+ - Name: libqtmessaging1
+ AsWholeName: yes
+ Summary: Qt Mobility Messaging module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Messaging API. It is a common interface for handling
+ SMS, MMS, MIME Email and TNEF Email messages.
+
+ - Name: libqtmultimediakit1
+ AsWholeName: yes
+ Summary: Qt Mobility MultimediaKit module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains a set of APIs to play and record media, and manage a
+ collection of media content.
+
+ - Name: libqtorganizer1
+ AsWholeName: yes
+ Summary: Qt Mobility Organizer module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains an API for management of calendar, scheduling and
+ personal data from local or remote backends. It includes the ability to create,
+ edit, list, delete and lookup organizer information whether it is stored
+ locally or remotely.
+
+ - Name: libqtpublishsubscribe1
+ AsWholeName: yes
+ Summary: Qt Mobility Publish and Subscribe module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Publish and Subscribe API (containing Value Space).
+ It enables applications to read item values, navigate through and subscribe to
+ change notifications.
+
+ - Name: libqtsensors1
+ AsWholeName: yes
+ Summary: Qt Mobility Sensors module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Sensors API. It provides access to sensors.
+ Requires:
+ - libqtsql4-sqlite
+ - sensorfw
+
+ - Name: libqtserviceframework1
+ AsWholeName: yes
+ Summary: Qt Mobility Service Framework module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains a set of APIs to that allows clients to discover and
+ instantiate arbitrary services.
+
+ - Name: libqtsysteminfo1
+ AsWholeName: yes
+ Summary: Qt Mobility System Information module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains a set of APIs to discover system related information and
+ capabilities.
+
+ - Name: libqtversit1
+ AsWholeName: yes
+ Summary: Qt Mobility Versit (vCard) module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains an API to manage Versit documents, such as vCards.
+
+ - Name: libqtversitorganizer1
+ AsWholeName: yes
+ Summary: Qt Mobility Versit (Organizer) module
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains an API to manage Versit documents, such as iCalendar
+ documents. It interfaces the Organizer API and uses the same framework as for
+ vCards.
+
+ - Name: libdeclarative-contacts
+ AsWholeName: yes
+ Summary: Qt Mobility Contacts QML plugin
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Contacts QML plugin for QtDeclarative.
+
+ - Name: libdeclarative-feedback
+ AsWholeName: yes
+ Summary: Qt Mobility Feedback QML plugin
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Feedback QML plugin for QtDeclarative.
+
+ - Name: libdeclarative-gallery
+ AsWholeName: yes
+ Summary: Qt Mobility Document Gallery QML plugin
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Document Gallery QML plugin for QtDeclarative.
+
+ - Name: libdeclarative-location
+ AsWholeName: yes
+ Summary: Qt Mobility Location QML plugin
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Location QML plugin for QtDeclarative.
+
+ - Name: libdeclarative-messaging
+ AsWholeName: yes
+ Summary: Qt Mobility Messaging QML plugin
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Messaging QML plugin for QtDeclarative.
+
+ - Name: libdeclarative-multimedia
+ AsWholeName: yes
+ Summary: Qt Mobility Multimedia QML plugin
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Multimedia QML plugin for QtDeclarative.
+
+ - Name: libdeclarative-organizer
+ AsWholeName: yes
+ Summary: Qt Mobility Organizer QML plugin
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Organizer QML plugin for QtDeclarative.
+
+ - Name: libdeclarative-publishsubscribe
+ AsWholeName: yes
+ Summary: Qt Mobility Publish and Subscribe QML plugin
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Publish and Subscribe QML plugin for QtDeclarative.
+
+ - Name: libdeclarative-sensors
+ AsWholeName: yes
+ Summary: Qt Mobility Sensors Framework QML plugin
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Sensors QML plugin for QtDeclarative.
+
+ - Name: libdeclarative-serviceframework
+ AsWholeName: yes
+ Summary: Qt Mobility Service Framework QML plugin
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Service Framework QML plugin for QtDeclarative.
+
+ - Name: libdeclarative-systeminfo
+ AsWholeName: yes
+ Summary: Qt Mobility System Information QML plugin
+ Group: System/Libraries
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the System Information QML plugin for QtDeclarative.
+
+ - Name: servicefw
+ AsWholeName: yes
+ Summary: Qt Mobility Service Framework tool
+ Group: Development/Tools
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains the Service Framework tool (servicefw). It allows
+ to register services and make them available over the Service Framework.
+
+ - Name: examples
+ Summary: Qt Mobility examples
+ Group: System/X11
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains Qt Mobility examples.
+
+ - Name: l10n
+ Summary: APIs for mobile device functionality - localization files
+ Group: System/I18n
+ Description: |
+ Qt Mobility delivers a set of new APIs for mobile device functionality.
+
+ This package contains Qt Mobility translations.
--- src/messaging/messagingutil.cpp
+++ src/messaging/messagingutil.cpp
@@ -226,6 +226,46 @@
return prefix;
}
+ // Needs to support escaping, and to be unit tested :P
+ bool globMatch(const QString &pattern, const QString &haystack) {
+ QString::const_iterator patIt(pattern.begin());
+ QString::const_iterator hayIt(haystack.begin());
+
+ for ( ; hayIt != haystack.end() && *patIt != '%' ; ++hayIt, ++patIt) {
+ if ((patIt->toLower() != hayIt->toLower())
+ && (*patIt != '_')) {
+ return false;
+ }
+ }
+
+ QString::const_iterator tPatIt(pattern.end());
+ QString::const_iterator tHayIt(haystack.end());
+
+ while (patIt != pattern.end() && hayIt != haystack.end()) {
+ if (*patIt == '%') {
+ if (++patIt == pattern.end())
+ return true;
+
+ tPatIt = patIt;
+ tHayIt = hayIt + 1;
+ } else if (patIt->toLower() == hayIt->toLower() || (*patIt != '_')) {
+ patIt++;
+ hayIt++;
+ } else {
+ patIt = tPatIt;
+ hayIt = tHayIt++;
+ }
+ }
+
+ // eat trailing %
+ while (patIt != pattern.end() && *patIt == '%') {
+ patIt++;
+ }
+
+ return hayIt == haystack.end() && patIt == pattern.end();
+ }
+
+
}
QTM_END_NAMESPACE
--- src/messaging/messagingutil_p.h
+++ src/messaging/messagingutil_p.h
@@ -83,6 +83,7 @@
QString addIdPrefix(const QString& id);
QString stripIdPrefix(const QString& id);
QString idPrefix();
+ bool globMatch(const QString &pattern, const QString &value);
}
QTM_END_NAMESPACE
--- src/messaging/qmessageaccountfilter.cpp
+++ src/messaging/qmessageaccountfilter.cpp
@@ -40,6 +40,10 @@
****************************************************************************/
#include "qmessageaccountfilter.h"
#include "qmessageaccountfilter_p.h"
+#include "qmessageaccount.h"
+#include "qmessagemanager.h"
+#include "messagingutil_p.h"
+#include <QRegExp>
QTM_BEGIN_NAMESPACE
@@ -116,7 +120,7 @@
An empty filter matches all accounts.
- The result of combining an empty filter with a non-empty filter using an AND operation is the
+ The result of combining an empty filtter with a non-empty filter using an AND operation is the
original non-empty filter.
The result of combining an empty filter with a non-empty filter using an OR operation is the
@@ -207,6 +211,14 @@
*/
/*!
+ \fn QMessageAccountFilter::byName(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+
+ Returns a filter matching accounts who name matches \a pattern, according to \a cmp.
+
+ \sa QMessageAccount::name()
+*/
+
+/*!
\fn QMessageAccountFilter::byName(const QString &value, QMessageDataComparator::EqualityComparator cmp)
Returns a filter matching accounts whose name matches \a value, according to \a cmp.
@@ -222,4 +234,19 @@
\sa QMessageAccount::name()
*/
+QMessageAccountFilter QMessageAccountFilter::byName(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+{
+ QMessageAccountIdList ids;
+ foreach (QMessageAccountId const& id, QMessageManager().queryAccounts()) {
+ bool matched(MessagingUtil::globMatch(pattern, QMessageAccount(id).name()));
+ if ((matched && cmp == QMessageDataComparator::Like)
+ || (!matched && cmp == QMessageDataComparator::NotLike)) {
+ ids.push_back(id);
+ }
+ }
+
+ return QMessageAccountFilter::byId(ids);
+}
+
+
QTM_END_NAMESPACE
--- src/messaging/qmessageaccountfilter.h
+++ src/messaging/qmessageaccountfilter.h
@@ -78,6 +78,7 @@
static QMessageAccountFilter byId(const QMessageAccountIdList &ids, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
static QMessageAccountFilter byId(const QMessageAccountFilter &filter, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
+ static QMessageAccountFilter byName(const QString &pattern, QMessageDataComparator::LikeComparator cmp);
static QMessageAccountFilter byName(const QString &value, QMessageDataComparator::EqualityComparator cmp);
static QMessageAccountFilter byName(const QString &value, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
--- src/messaging/qmessagedatacomparator.h
+++ src/messaging/qmessagedatacomparator.h
@@ -68,6 +68,12 @@
GreaterThanEqual
};
+ enum LikeComparator
+ {
+ Like,
+ NotLike
+ };
+
enum MatchFlag
{
MatchCaseSensitive = Qt::MatchCaseSensitive,
--- src/messaging/qmessagefilter.cpp
+++ src/messaging/qmessagefilter.cpp
@@ -40,6 +40,9 @@
****************************************************************************/
#include "qmessagefilter.h"
#include "qmessagefilter_p.h"
+#include "qmessageid.h"
+#include "messagingutil_p.h"
+#include "qmessagemanager.h"
QTM_BEGIN_NAMESPACE
@@ -174,7 +177,13 @@
/*!
\fn QMessageFilter::operator|=(const QMessageFilter& other)
-
+ foreach(QMessageAccount const& id, QMessageManager().queryMessages()) {
+ if (MessagingUtil::globMatch(pattern, QMessageAccount(id).name())) {
+ ids.push_back(id);
+ }
+ }
+
+ return QMessageAccountFilter::byId(ids);
Performs a logical OR with this filter and the filter \a other and assigns the result
to this filter.
*/
@@ -233,6 +242,14 @@
*/
/*!
+ \fn QMessageFilter::bySender(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+
+ Returns a filter matching messages whose sender matches \a value, according to \a cmp.
+
+ \sa QMessage::from()
+*/
+
+/*!
\fn QMessageFilter::bySender(const QString &value, QMessageDataComparator::EqualityComparator cmp)
Returns a filter matching messages whose sender matches \a value, according to \a cmp.
@@ -249,18 +266,45 @@
*/
/*!
+ \fn QMessageFilter::byRecipients(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+
+ Returns a filter matching messages whose recipients include the substring \a pattern,
+ according to \a cmp.
+
+ \sa QMessage::to(), QMessage::cc(), QMessage::bcc()
+*/
+
+/*!
\fn QMessageFilter::byRecipients(const QString &value, QMessageDataComparator::InclusionComparator cmp)
-
- Returns a filter matching messages whose recipients include the substring \a value,
+
+ Returns a filter matching messages whose recipients include the substring \a value,
+ according to \a cmp.
+
+ \sa QMessage::to(), QMessage::cc(), QMessage::bcc()
+*/
+
+/*!
+ \fn QMessageFilter::byRecipients(const QString &value, QMessageDataComparator::EqualityComparator cmp)
+
+ Returns a filter matching messages whose recipients include the substring \a value,
according to \a cmp.
\sa QMessage::to(), QMessage::cc(), QMessage::bcc()
*/
/*!
- \fn QMessageFilter::bySubject(const QString &value, QMessageDataComparator::EqualityComparator cmp)
+ \fn QMessageFilter::bySubject(const QString &pattern, QMessageDataComparator::EqualityComparator cmp)
- Returns a filter matching messages whose subject matches \a value, according to \a cmp.
+ Returns a filter matching messages whose subject matches \a pattern, according to \a cmp.
+
+ \sa QMessage::subject()
+*/
+
+/*!
+ \fn QMessageFilter::bySubject(const QString &value, QMessageDataComparator::InclusionComparator cmp)
+
+ Returns a filter matching messages whose subject matches the
+ substring \a value, according to \a cmp.
\sa QMessage::subject()
*/
@@ -405,4 +449,212 @@
\sa QMessage::parentFolderId()
*/
+/*!
+ \fn QMessageFilter::byTo(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+
+ Returns a filter matching messages whose recipients include the substring \a pattern,
+ according to \a cmp.
+
+ \sa QMessage::to(), QMessage::cc(), QMessage::bcc()
+*/
+
+/*!
+ \fn QMessageFilter::byTo(const QString &value, QMessageDataComparator::InclusionComparator cmp)
+
+ Returns a filter matching messages whose recipients include the substring \a value,
+ according to \a cmp.
+
+ \sa QMessage::to(), QMessage::cc(), QMessage::bcc()
+*/
+
+/*!
+ \fn QMessageFilter::byTo(const QString &value, QMessageDataComparator::EqualityComparator cmp)
+
+ Returns a filter matching messages whose recipients include the substring \a value,
+ according to \a cmp.
+
+ \sa QMessage::to(), QMessage::cc(), QMessage::bcc()
+*/
+
+/*!
+ \fn QMessageFilter::byCc(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+
+ Returns a filter matching messages whose recipients include the substring \a pattern,
+ according to \a cmp.
+
+ \sa QMessage::to(), QMessage::cc(), QMessage::bcc()
+*/
+
+/*!
+ \fn QMessageFilter::byCc(const QString &value, QMessageDataComparator::InclusionComparator cmp)
+
+ Returns a filter matching messages whose recipients include the substring \a value,
+ according to \a cmp.
+
+ \sa QMessage::to(), QMessage::cc(), QMessage::bcc()
+*/
+
+/*!
+ \fn QMessageFilter::byCc(const QString &value, QMessageDataComparator::EqualityComparator cmp)
+
+ Returns a filter matching messages whose recipients include the substring \a value,
+ according to \a cmp.
+
+ \sa QMessage::to(), QMessage::cc(), QMessage::bcc()
+*/
+
+/*!
+ \fn QMessageFilter::byBcc(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+
+ Returns a filter matching messages whose recipients include the substring \a pattern,
+ according to \a cmp.
+
+ \sa QMessage::to(), QMessage::cc(), QMessage::bcc()
+*/
+
+/*!
+ \fn QMessageFilter::byBcc(const QString &value, QMessageDataComparator::InclusionComparator cmp)
+
+ Returns a filter matching messages whose recipients include the substring \a value,
+ according to \a cmp.
+
+ \sa QMessage::to(), QMessage::cc(), QMessage::bcc()
+*/
+
+/*!
+ \fn QMessageFilter::byBcc(const QString &value, QMessageDataComparator::EqualityComparator cmp)
+
+ Returns a filter matching messages whose recipients include the substring \a value,
+ according to \a cmp.
+
+ \sa QMessage::to(), QMessage::cc(), QMessage::bcc()
+*/
+
+
+QMessageFilter QMessageFilter::bySender(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+{
+ QMessageIdList ids;
+ foreach (QMessageId const& id, QMessageManager().queryMessages()) {
+ bool matched(MessagingUtil::globMatch(pattern, QMessage(id).from().addressee()));
+ if ((matched && cmp == QMessageDataComparator::Like)
+ || (!matched && cmp == QMessageDataComparator::NotLike)) {
+ ids.push_back(id);
+ }
+ }
+
+ return QMessageFilter::byId(ids);
+}
+
+QMessageFilter QMessageFilter::byRecipients(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+{
+ QMessageIdList ids;
+
+ foreach (QMessageId const& id, QMessageManager().queryMessages()) {
+ QMessage msg(id);
+ QMessageAddressList addressList(msg.to());
+ addressList.append(msg.cc());
+ addressList.append(msg.bcc());
+
+ bool matched(false);
+
+ foreach (QMessageAddress const& addr, addressList) {
+ if (MessagingUtil::globMatch(pattern, addr.addressee())) {
+ matched = true;
+ break;
+ }
+ }
+
+ if ((matched && cmp == QMessageDataComparator::Like)
+ || (!matched && cmp == QMessageDataComparator::NotLike)) {
+ ids.push_back(id);
+ }
+ }
+
+ return QMessageFilter::byId(ids);
+}
+
+QMessageFilter QMessageFilter::bySubject(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+{
+ QMessageIdList ids;
+ foreach (QMessageId const& id, QMessageManager().queryMessages()) {
+ bool matched(MessagingUtil::globMatch(pattern, QMessage(id).subject()));
+ if ((matched && cmp == QMessageDataComparator::Like)
+ || (!matched && cmp == QMessageDataComparator::NotLike)) {
+ ids.push_back(id);
+ }
+ }
+
+ return QMessageFilter::byId(ids);
+}
+
+QMessageFilter QMessageFilter::byTo(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+{
+ QMessageIdList ids;
+
+ foreach (QMessageId const& id, QMessageManager().queryMessages()) {
+ bool matched(false);
+ foreach (QMessageAddress const& addr, QMessage(id).to()) {
+ if (MessagingUtil::globMatch(pattern, addr.addressee())) {
+ matched = true;
+ break;
+ }
+ }
+
+ if ((matched && cmp == QMessageDataComparator::Like)
+ || (!matched && cmp == QMessageDataComparator::NotLike)) {
+ ids.push_back(id);
+ }
+ }
+
+ return QMessageFilter::byId(ids);
+}
+
+QMessageFilter QMessageFilter::byCc(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+{
+ QMessageIdList ids;
+
+ foreach (QMessageId const& id, QMessageManager().queryMessages()) {
+ bool matched(false);
+ foreach (QMessageAddress const& addr, QMessage(id).cc()) {
+ if (MessagingUtil::globMatch(pattern, addr.addressee())) {
+ matched = true;
+ break;
+ }
+ }
+
+ if ((matched && cmp == QMessageDataComparator::Like)
+ || (!matched && cmp == QMessageDataComparator::NotLike)) {
+ ids.push_back(id);
+ }
+
+ }
+
+ return QMessageFilter::byId(ids);
+}
+
+QMessageFilter QMessageFilter::byBcc(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+{
+ QMessageIdList ids;
+
+ foreach (QMessageId const& id, QMessageManager().queryMessages()) {
+ bool matched(false);
+ foreach (QMessageAddress const& addr, QMessage(id).bcc()) {
+ if (MessagingUtil::globMatch(pattern, addr.addressee())) {
+ matched = true;
+ break;
+ }
+ }
+
+ if ((matched && cmp == QMessageDataComparator::Like)
+ || (!matched && cmp == QMessageDataComparator::NotLike)) {
+ ids.push_back(id);
+ }
+
+ }
+
+ return QMessageFilter::byId(ids);
+}
+
+
+
QTM_END_NAMESPACE
--- src/messaging/qmessagefilter.h
+++ src/messaging/qmessagefilter.h
@@ -87,11 +87,15 @@
static QMessageFilter byType(QMessage::Type type, QMessageDataComparator::EqualityComparator cmp = QMessageDataComparator::Equal);
static QMessageFilter byType(QMessage::TypeFlags type, QMessageDataComparator::InclusionComparator cmp);
+ static QMessageFilter bySender(const QString &pattern, QMessageDataComparator::LikeComparator cmp);
static QMessageFilter bySender(const QString &value, QMessageDataComparator::EqualityComparator cmp);
static QMessageFilter bySender(const QString &value, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
+ static QMessageFilter byRecipients(const QString &pattern, QMessageDataComparator::LikeComparator cmp);
+ static QMessageFilter byRecipients(const QString &value, QMessageDataComparator::EqualityComparator cmp);
static QMessageFilter byRecipients(const QString &value, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
+ static QMessageFilter bySubject(const QString &pattern, QMessageDataComparator::LikeComparator cmp);
static QMessageFilter bySubject(const QString &value, QMessageDataComparator::EqualityComparator cmp);
static QMessageFilter bySubject(const QString &value, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
@@ -120,6 +124,18 @@
static QMessageFilter byAncestorFolderIds(const QMessageFolderId &id, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
static QMessageFilter byAncestorFolderIds(const QMessageFolderFilter &filter, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
+ static QMessageFilter byTo(const QString &pattern, QMessageDataComparator::LikeComparator cmp);
+ static QMessageFilter byTo(const QString &value, QMessageDataComparator::EqualityComparator cmp);
+ static QMessageFilter byTo(const QString &value, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
+
+ static QMessageFilter byCc(const QString &pattern, QMessageDataComparator::LikeComparator cmp);
+ static QMessageFilter byCc(const QString &value, QMessageDataComparator::EqualityComparator cmp);
+ static QMessageFilter byCc(const QString &value, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
+
+ static QMessageFilter byBcc(const QString &pattern, QMessageDataComparator::LikeComparator cmp);
+ static QMessageFilter byBcc(const QString &value, QMessageDataComparator::EqualityComparator cmp);
+ static QMessageFilter byBcc(const QString &value, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
+
private:
QMessageFilterPrivate *d_ptr;
};
--- src/messaging/qmessagefolderfilter.cpp
+++ src/messaging/qmessagefolderfilter.cpp
@@ -40,6 +40,9 @@
****************************************************************************/
#include "qmessagefolderfilter.h"
#include "qmessagefolderfilter_p.h"
+#include "messagingutil_p.h"
+#include "qmessagefolder.h"
+#include "qmessagemanager.h"
QTM_BEGIN_NAMESPACE
@@ -207,6 +210,14 @@
*/
/*!
+ \fn QMessageFolderFilter::byName(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+
+ Returns a filter matching folders whose display name matches \a value, according to \a cmp.
+
+ \sa QMessageFolder::name()
+*/
+
+/*!
\fn QMessageFolderFilter::byName(const QString &value, QMessageDataComparator::EqualityComparator cmp)
Returns a filter matching folders whose display name matches \a value, according to \a cmp.
@@ -223,6 +234,14 @@
*/
/*!
+ \fn QMessageFolderFilter::byPath(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+
+ Returns a filter matching folders whose path matches \a value, according to \a cmp.
+
+ \sa QMessageFolder::path()
+*/
+
+/*!
\fn QMessageFolderFilter::byPath(const QString &value, QMessageDataComparator::EqualityComparator cmp)
Returns a filter matching folders whose path matches \a value, according to \a cmp.
@@ -286,4 +305,29 @@
\sa QMessageFolder::id()
*/
+QMessageFolderFilter QMessageFolderFilter::byName(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+{
+ QMessageFolderIdList ids;
+ foreach(QMessageFolderId const& id, QMessageManager().queryFolders()) {
+ if (MessagingUtil::globMatch(pattern, QMessageFolder(id).name())) {
+ ids.push_back(id);
+ }
+ }
+
+ return QMessageFolderFilter::byId(ids);
+}
+
+QMessageFolderFilter QMessageFolderFilter::byPath(const QString &pattern, QMessageDataComparator::LikeComparator cmp)
+{
+ QMessageFolderIdList ids;
+ foreach(QMessageFolderId const& id, QMessageManager().queryFolders()) {
+ if (MessagingUtil::globMatch(pattern, QMessageFolder(id).path())) {
+ ids.push_back(id);
+ }
+ }
+
+ return QMessageFolderFilter::byId(ids);
+}
+
+
QTM_END_NAMESPACE
--- src/messaging/qmessagefolderfilter.h
+++ src/messaging/qmessagefolderfilter.h
@@ -81,9 +81,11 @@
static QMessageFolderFilter byId(const QMessageFolderIdList &ids, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
static QMessageFolderFilter byId(const QMessageFolderFilter &filter, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
+ static QMessageFolderFilter byName(const QString &pattern, QMessageDataComparator::LikeComparator cmp);
static QMessageFolderFilter byName(const QString &value, QMessageDataComparator::EqualityComparator cmp);
static QMessageFolderFilter byName(const QString &value, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
+ static QMessageFolderFilter byPath(const QString &pattern, QMessageDataComparator::LikeComparator cmp);
static QMessageFolderFilter byPath(const QString &value, QMessageDataComparator::EqualityComparator cmp);
static QMessageFolderFilter byPath(const QString &value, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes);
--- src/messaging/qmessagemanager.cpp
+++ src/messaging/qmessagemanager.cpp
@@ -148,6 +148,8 @@
connect(store, SIGNAL(messageAdded(QMessageId, QMessageManager::NotificationFilterIdSet)), this, SIGNAL(messageAdded(QMessageId, QMessageManager::NotificationFilterIdSet)));
connect(store, SIGNAL(messageRemoved(QMessageId, QMessageManager::NotificationFilterIdSet)), this, SIGNAL(messageRemoved(QMessageId, QMessageManager::NotificationFilterIdSet)));
connect(store, SIGNAL(messageUpdated(QMessageId, QMessageManager::NotificationFilterIdSet)), this, SIGNAL(messageUpdated(QMessageId, QMessageManager::NotificationFilterIdSet)));
+
+ connect(store, SIGNAL(accountRemoved(QMessageAccountId)), this, SIGNAL(accountRemoved(QMessageAccountId)));
}
/*!
@@ -468,6 +470,18 @@
return store->removeMessages(filter, option);
}
+
+/*!
+ \fn QMessageManager::removeAccount(const QMessageAccountId &id)
+
+ Remove account \a id and all associated information (folders, messages etc.)
+
+*/
+bool QMessageManager::removeAccount(const QMessageAccountId &id)
+{
+ return store->removeAccount(id);
+}
+
/*!
\fn QMessageManager::addMessage(QMessage *message)
--- src/messaging/qmessagemanager.h
+++ src/messaging/qmessagemanager.h
@@ -113,6 +113,8 @@
bool removeMessage(const QMessageId &id, RemovalOption option = RemoveOnOriginatingServer);
bool removeMessages(const QMessageFilter &filter, RemovalOption option = RemoveOnOriginatingServer);
+ bool removeAccount(const QMessageAccountId &id);
+
QMessage message(const QMessageId &id) const;
QMessageFolder folder(const QMessageFolderId &id) const;
QMessageAccount account(const QMessageAccountId &id) const;
@@ -125,6 +127,8 @@
void messageRemoved(const QMessageId &id, const QMessageManager::NotificationFilterIdSet &matchingFilterIds);
void messageUpdated(const QMessageId &id, const QMessageManager::NotificationFilterIdSet &matchingFilterIds);
+ void accountRemoved(const QMessageAccountId &id);
+
private:
QMessageStore *store;
};
--- src/messaging/qmessageservice.cpp
+++ src/messaging/qmessageservice.cpp
@@ -301,6 +301,16 @@
\sa QMessageManager::addMessage(), QMessageManager::updateMessage(), QMessageManager::removeMessage(), QMessageManager::removeMessages()
*/
+
+/*!
+ \fn QMessageService::moveMessages(const QMessageIdList &messageIds, const QMessageFolderId &toFolderId)
+
+ Initiate a request to move messages \a messageIds to the folder \toFolderId
+
+ The folder must be in the same account as the message. This will move the message on the external server, as well as locally.
+
+ Returns true if the operation can be initiated; otherwise returns false.
+*/
/*!
\fn QMessageService::state() const
--- src/messaging/qmessageservice.h
+++ src/messaging/qmessageservice.h
@@ -80,6 +80,9 @@
bool show(const QMessageId &id);
bool exportUpdates(const QMessageAccountId &id);
+ bool moveMessages(const QMessageIdList &messageIds, const QMessageFolderId &toFolderId);
+ bool synchronize(const QMessageAccountId &id);
+
State state() const;
QMessageManager::Error error() const;
--- src/messaging/qmessageservice_qmf.cpp
+++ src/messaging/qmessageservice_qmf.cpp
@@ -83,6 +83,7 @@
QMailTransmitAction _transmit;
QMailRetrievalAction _retrieval;
+ QMailStorageAction _storage;
QMailServiceAction *_active;
QMessageManager::Error _error;
bool _activeStoreAction;
@@ -108,6 +109,7 @@
protected slots:
void transmitActivityChanged(QMailServiceAction::Activity a);
void retrievalActivityChanged(QMailServiceAction::Activity a);
+ void storageActivityChanged(QMailServiceAction::Activity a);
void statusChanged(const QMailServiceAction::Status &s);
void completed();
void reportMatchingIds();
@@ -132,6 +134,9 @@
connect(&_retrieval, SIGNAL(activityChanged(QMailServiceAction::Activity)), this, SLOT(retrievalActivityChanged(QMailServiceAction::Activity)));
connect(&_retrieval, SIGNAL(statusChanged(QMailServiceAction::Status)), this, SLOT(statusChanged(QMailServiceAction::Status)));
+
+ connect(&_storage, SIGNAL(activityChanged(QMailServiceAction::Activity)), this, SLOT(storageActivityChanged(QMailServiceAction::Activity)));
+ connect(&_storage, SIGNAL(statusChanged(QMailServiceAction::Status)), this, SLOT(statusChanged(QMailServiceAction::Status)));
}
bool QMessageServicePrivate::isBusy() const
@@ -202,6 +207,7 @@
emit stateChanged(convert(a));
}
+
void QMessageServicePrivate::completed()
{
_activeStoreAction = false;
@@ -580,6 +586,40 @@
return true;
}
+void QMessageServicePrivate::storageActivityChanged(QMailServiceAction::Activity a)
+{
+ if ((a == QMailServiceAction::Failed) && (_error == QMessageManager::NoError)) {
+ _error = QMessageManager::RequestIncomplete;
+ }
+
+ emit stateChanged(convert(a));
+}
+
+bool QMessageService::moveMessages(const QMessageIdList &messageIds, const QMessageFolderId &toFolderId)
+{
+ if (d_ptr->isBusy()) {
+ return false;
+ }
+ d_ptr->_active = 0;
+ d_ptr->_error = QMessageManager::NoError;
+ d_ptr->_active = &d_ptr->_storage;
+ d_ptr->_storage.moveMessages(convert(messageIds), convert(toFolderId));
+ return true;
+}
+
+bool QMessageService::synchronize(const QMessageAccountId &id)
+{
+ if (d_ptr->isBusy()) {
+ return false;
+ }
+
+ d_ptr->_active = 0;
+ d_ptr->_error = QMessageManager::NoError;
+ d_ptr->_active = &d_ptr->_retrieval;
+ d_ptr->_retrieval.synchronize(convert(id), 0);
+ return true;
+}
+
QMessageService::State QMessageService::state() const
{
if (d_ptr->_active) {
--- src/messaging/qmessagestore.h
+++ src/messaging/qmessagestore.h
@@ -84,6 +84,8 @@
bool removeMessage(const QMessageId &id, QMessageManager::RemovalOption option = QMessageManager::RemoveOnOriginatingServer);
bool removeMessages(const QMessageFilter &filter, QMessageManager::RemovalOption option = QMessageManager::RemoveOnOriginatingServer);
+ bool removeAccount(const QMessageAccountId &id);
+
QMessage message(const QMessageId &id) const;
QMessageFolder folder(const QMessageFolderId &id) const;
QMessageAccount account(const QMessageAccountId &id) const;
@@ -98,6 +100,7 @@
void messageRemoved(const QMessageId &id, const QMessageManager::NotificationFilterIdSet &matchingFilterIds);
void messageUpdated(const QMessageId &id, const QMessageManager::NotificationFilterIdSet &matchingFilterIds);
+ void accountRemoved(const QMessageAccountId &id);
private:
friend class QGlobalStaticDeleter<QMessageStore>;
QMessageStore(QObject *parent = 0);
--- src/messaging/qmessagestore_maemo.cpp
+++ src/messaging/qmessagestore_maemo.cpp
@@ -290,6 +290,12 @@
return true;
}
+bool QMessageStore::removeAccount(const QMessageAccountId &id)
+{
+#warning TODO: implement
+ return false;
+}
+
bool QMessageStore::addMessage(QMessage *m)
{
bool retVal = true;
--- src/messaging/qmessagestore_maemo6.cpp
+++ src/messaging/qmessagestore_maemo6.cpp
@@ -336,6 +336,14 @@
return noErrors;
}
+bool QMessageStore::removeAccount(const QMessageAccountId &id)
+{
+ d_ptr->error = QMessageManager::NoError;
+
+ return QMFStore::instance()->removeAccount(id, d_ptr->error);
+}
+
+
bool QMessageStore::addMessage(QMessage *m)
{
bool retVal = true;
--- src/messaging/qmessagestore_qmf.cpp
+++ src/messaging/qmessagestore_qmf.cpp
@@ -251,6 +251,12 @@
return d_ptr->_store->removeMessages(convert(filter), convert(option));
}
+bool QMessageStore::removeAccount(const QMessageAccountId &id)
+{
+ d_ptr->_error = QMessageManager::NoError;
+ return d_ptr->_store->removeAccount(convert(id));
+}
+
bool QMessageStore::addMessage(QMessage *m)
{
// Ensure that the size estimate is updated if necessary
--- src/messaging/qmessagestore_stub.cpp
+++ src/messaging/qmessagestore_stub.cpp
@@ -170,6 +170,11 @@
return true; // stub
}
+bool QMessageStore::removeAccount(const QMessageAccountId &)
+{
+ return true; // stub
+}
+
bool QMessageStore::addMessage(QMessage *m)
{
Q_UNUSED(m)
--- src/messaging/qmessagestore_symbian.cpp
+++ src/messaging/qmessagestore_symbian.cpp
@@ -290,6 +290,12 @@
return retVal;
}
+bool QMessageStorePrivate::removeAccount(const QMessageAccountId &id)
+{
+#warning TODO: implementation
+ return false;
+}
+
QMessage QMessageStorePrivate::message(const QMessageId& id) const
{
switch (idType(id)) {
@@ -428,6 +434,11 @@
return messageStorePrivate()->removeMessages(filter, option);
}
+bool QMessageStore::removeAccount(const QMessageAccountId &id)
+{
+ return messageStorePrivate()->removeAccount(id);
+}
+
bool QMessageStore::addMessage(QMessage *m)
{
return messageStorePrivate()->addMessage(m);
--- src/messaging/qmessagestore_symbian_p.h
+++ src/messaging/qmessagestore_symbian_p.h
@@ -85,6 +85,8 @@
bool updateMessage(QMessage *m);
bool removeMessage(const QMessageId &id, QMessageManager::RemovalOption option);
bool removeMessages(const QMessageFilter &filter, QMessageManager::RemovalOption option);
+
+ bool removeAccount(const QMessageAccountId &id);
QMessage message(const QMessageId& id) const;
--- src/messaging/qmessagestore_win.cpp
+++ src/messaging/qmessagestore_win.cpp
@@ -363,6 +363,12 @@
return result;
}
+bool QMessageStore::removeAccount(const QMessageAccountId &id)
+{
+ // TODO: implement
+ return false;
+}
+
bool QMessageStore::addMessage(QMessage *message)
{
bool result(false);
--- src/messaging/qmfstore_maemo6.cpp
+++ src/messaging/qmfstore_maemo6.cpp
@@ -269,6 +269,12 @@
return d_ptr->_store->removeMessages(convert(filter), convert(option));
}
+bool QMFStore::removeAccount(const QMessageAccountId &id, QMessageManager::Error &error)
+{
+ error = QMessageManager::NoError;
+ return d_ptr->_store->removeAccount(convert(id));
+}
+
struct TextPartLocator
{
QMailMessagePart::Location _location;
--- src/messaging/qmfstore_maemo6_p.h
+++ src/messaging/qmfstore_maemo6_p.h
@@ -75,6 +75,8 @@
bool removeMessage(const QMessageId &id, QMessageManager::RemovalOption option, QMessageManager::Error &error);
bool removeMessages(const QMessageFilter &filter, QMessageManager::RemovalOption option, QMessageManager::Error &error);
+ bool removeAccount(const QMessageAccountId &id, QMessageManager::Error &error);
+
QMessage message(const QMessageId &id, QMessageManager::Error &error) const;
QMessageFolder folder(const QMessageFolderId &id, QMessageManager::Error &error) const;
QMessageAccount account(const QMessageAccountId &id, QMessageManager::Error &error) const;
--- src/organizer/qorganizermanager.cpp
+++ src/organizer/qorganizermanager.cpp
@@ -332,6 +332,7 @@
\value InvalidItemTypeError The most recent operation failed because the item given was of an invalid type for the operation
\value InvalidCollectionError The most recent operation failed because the collection is invalid
\value InvalidOccurrenceError The most recent operation failed because it was an attempt to save an occurrence without a correct InstanceOrigin detail
+ \value TimeoutError The most recent operation failed because it took longer than expected. It may be possible to try again.
*/
/*! Return the error code of the most recent operation */
@@ -589,8 +590,8 @@
/*!
Adds the list of organizer items given by \a items list to the database.
Each item in the list will be saved in the collection whose
- id is reported by calling item->collectionId() if the specified collection exists,
- or if no collectionId is specified in the item, or the collectionId is the default
+ id is reported by calling item->collectionId() if the specified collection exists.
+ If no collectionId is specified in the item, or if the collectionId is the default
collection id, it will be saved in the collection in which the item is currently
saved (if it is not a new item) or in the default collection (if it is a new item).
As such, an item may be moved between collections with this save operation.
@@ -601,8 +602,7 @@
if all organizer items were saved successfully.
For each newly saved organizer item that was successful, the id of the organizer item
- in the \a items list will be updated with the new value. If a failure occurs
- when saving a new item, the id will be cleared.
+ in the \a items list will be updated with the new value.
\sa QOrganizerManager::saveItem()
*/
@@ -619,6 +619,41 @@
}
/*!
+ Adds the list of organizer items given by \a items list to the database.
+ Each item in the list will be saved in the collection whose
+ id is reported by calling item->collectionId() if the specified collection exists.
+ If no collectionId is specified in the item, or if the collectionId is the default
+ collection id, it will be saved in the collection in which the item is currently
+ saved (if it is not a new item) or in the default collection (if it is a new item).
+ As such, an item may be moved between collections with this save operation.
+ Returns true if the organizer items were saved successfully, otherwise false.
+
+ This function accepts a \a definitionMask, which specifies which details of
+ the items should be updated. Details with definition names not included in
+ the definitionMask will not be updated or added.
+
+ Calling \l errorMap() will return the per-input errors for the latest batch function.
+ The \l QOrganizerManager::error() function will only return \c QOrganizerManager::NoError
+ if all organizer items were saved successfully.
+
+ For each newly saved organizer item that was successful, the id of the organizer item
+ in the \a items list will be updated with the new value.
+
+ \sa QOrganizerManager::saveItem()
+ */
+bool QOrganizerManager::saveItems(QList<QOrganizerItem>* items, const QStringList& definitionMask)
+{
+ d->m_errorMap.clear();
+ if (!items) {
+ d->m_error = QOrganizerManager::BadArgumentError;
+ return false;
+ }
+
+ d->m_error = QOrganizerManager::NoError;
+ return d->m_engine->saveItems(items, definitionMask, &d->m_errorMap, &d->m_error);
+}
+
+/*!
Remove every organizer item whose id is contained in the list of organizer item ids
\a organizeritemIds. Returns true if all organizer items were removed successfully,
otherwise false.
--- src/organizer/qorganizermanager.h
+++ src/organizer/qorganizermanager.h
@@ -106,7 +106,8 @@
LimitReachedError,
InvalidItemTypeError,
InvalidCollectionError,
- InvalidOccurrenceError
+ InvalidOccurrenceError,
+ TimeoutError
};
/* Error reporting */
@@ -128,6 +129,7 @@
bool saveItem(QOrganizerItem* item);
bool saveItems(QList<QOrganizerItem>* items);
+ bool saveItems(QList<QOrganizerItem>* items, const QStringList& definitionMask);
bool removeItem(const QOrganizerItemId& itemId);
bool removeItems(const QList<QOrganizerItemId>& itemIds);
--- src/organizer/qorganizermanagerengine.cpp
+++ src/organizer/qorganizermanagerengine.cpp
@@ -2024,8 +2024,7 @@
if all organizer items were saved successfully.
For each newly saved item that was successful, the id of the item
- in the \a items list will be updated with the new value. If a failure occurs
- when saving a new item, the id will be cleared.
+ in the \a items list will be updated with the new value.
Each item in the given list \a items will be added to the collection
identified in the item (accessible via item->collectionId()) if it exists, and if
@@ -3275,8 +3274,7 @@
items were saved successfully.
For each newly saved item that was successful, the id of the item in the \a items list
- will be updated with the new value. If a failure occurs when saving a new item, the id will be
- cleared.
+ will be updated with the new value.
Any errors encountered during this operation should be stored to \a error.
*/
--- src/organizer/qorganizermanagerenginev2wrapper_p.cpp
+++ src/organizer/qorganizermanagerenginev2wrapper_p.cpp
@@ -232,22 +232,20 @@
void QOrganizerManagerEngineV2Wrapper::itemsUpdated(const QList<QOrganizerItemId>& ids)
{
- foreach (QOrganizerItemId id, ids) {
- QHash<QOrganizerItemId, QOrganizerItemObserver*>::iterator it = m_observerForItem.find(id);
- while (it != m_observerForItem.end()) {
- (*it)->emitItemChanged();
- it++;
+ foreach (const QOrganizerItemId& id, ids) {
+ QList<QOrganizerItemObserver*> observers = m_observerForItem.values(id);
+ foreach (QOrganizerItemObserver* observer, observers) {
+ observer->emitItemChanged();
}
}
}
void QOrganizerManagerEngineV2Wrapper::itemsDeleted(const QList<QOrganizerItemId>& ids)
{
- foreach (QOrganizerItemId id, ids) {
- QHash<QOrganizerItemId, QOrganizerItemObserver*>::iterator it = m_observerForItem.find(id);
- while (it != m_observerForItem.end()) {
- (*it)->emitItemRemoved();
- it++;
+ foreach (const QOrganizerItemId& id, ids) {
+ QList<QOrganizerItemObserver*> observers = m_observerForItem.values(id);
+ foreach (QOrganizerItemObserver* observer, observers) {
+ observer->emitItemRemoved();
}
}
}
--- src/s60installs/bwins/QtContactsu.def
+++ src/s60installs/bwins/QtContactsu.def
@@ -1196,41 +1196,48 @@
??6QtMobility@@YAAAVQDebug@@V1 at ABVQContactActionDescriptor@0@@Z @ 1195 NONAME ; class QDebug & QtMobility::operator<<(class QDebug, class QtMobility::QContactActionDescriptor const &)
?setCalendarId at QContactBirthday@QtMobility@@QAEXABVQString@@@Z @ 1196 NONAME ; void QtMobility::QContactBirthday::setCalendarId(class QString const &)
??0QContactObserver at QtMobility@@AAE at PAVQObject@@@Z @ 1197 NONAME ; QtMobility::QContactObserver::QContactObserver(class QObject *)
- ??1QContactTag at QtMobility@@QAE at XZ @ 1198 NONAME ; QtMobility::QContactTag::~QContactTag(void)
- ?getStaticMetaObject at QContactObserver@QtMobility@@SAABUQMetaObject@@XZ @ 1199 NONAME ; struct QMetaObject const & QtMobility::QContactObserver::getStaticMetaObject(void)
- ?trUtf8 at QContactObserver@QtMobility@@SA?AVQString@@PBD0H at Z @ 1200 NONAME ; class QString QtMobility::QContactObserver::trUtf8(char const *, char const *, int)
- ?contactChanged at QContactObserver@QtMobility@@IAEXXZ @ 1201 NONAME ; void QtMobility::QContactObserver::contactChanged(void)
- ?ServiceJabber at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$06 at 2@B @ 1202 NONAME ; struct QtMobility::QLatin1Constant<7> const QtMobility::QContactOnlineAccount::ServiceJabber
- ?metaObject at QContactObserver@QtMobility@@UBEPBUQMetaObject@@XZ @ 1203 NONAME ; struct QMetaObject const * QtMobility::QContactObserver::metaObject(void) const
- ??_EQContactObserver at QtMobility@@UAE at I@Z @ 1204 NONAME ; QtMobility::QContactObserver::~QContactObserver(unsigned int)
- ?ServiceIrc at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$03 at 2@B @ 1205 NONAME ; struct QtMobility::QLatin1Constant<4> const QtMobility::QContactOnlineAccount::ServiceIrc
- ?qt_metacall at QContactObserver@QtMobility@@UAEHW4Call at QMetaObject@@HPAPAX at Z @ 1206 NONAME ; int QtMobility::QContactObserver::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?emitContactChanged at QContactObserver@QtMobility@@QAEXXZ @ 1207 NONAME ; void QtMobility::QContactObserver::emitContactChanged(void)
- ?addTag at QContact@QtMobility@@QAEXABVQString@@@Z @ 1208 NONAME ; void QtMobility::QContact::addTag(class QString const &)
- ?observeContact at QContactManager@QtMobility@@QAE?AV?$QSharedPointer at VQContactObserver@QtMobility@@@@I at Z @ 1209 NONAME ; class QSharedPointer<class QtMobility::QContactObserver> QtMobility::QContactManager::observeContact(unsigned int)
- ?contactsDeleted at QContactManager@QtMobility@@AAEXABV?$QList at I@@@Z @ 1210 NONAME ; void QtMobility::QContactManager::contactsDeleted(class QList<unsigned int> const &)
- ?tr at QContactObserver@QtMobility@@SA?AVQString@@PBD0 at Z @ 1211 NONAME ; class QString QtMobility::QContactObserver::tr(char const *, char const *)
- ?ServiceMsn at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$03 at 2@B @ 1212 NONAME ; struct QtMobility::QLatin1Constant<4> const QtMobility::QContactOnlineAccount::ServiceMsn
- ?tr at QContactObserver@QtMobility@@SA?AVQString@@PBD0H at Z @ 1213 NONAME ; class QString QtMobility::QContactObserver::tr(char const *, char const *, int)
- ??1QContactObserver at QtMobility@@UAE at XZ @ 1214 NONAME ; QtMobility::QContactObserver::~QContactObserver(void)
- ?observerDestroyed at QContactManager@QtMobility@@AAEXPAVQObject@@@Z @ 1215 NONAME ; void QtMobility::QContactManager::observerDestroyed(class QObject *)
- ??0QContactTag at QtMobility@@QAE at ABV01@@Z @ 1216 NONAME ; QtMobility::QContactTag::QContactTag(class QtMobility::QContactTag const &)
- ?tags at QContact@QtMobility@@QBE?AVQStringList@@XZ @ 1217 NONAME ; class QStringList QtMobility::QContact::tags(void) const
- ?staticMetaObject at QContactObserver@QtMobility@@2UQMetaObject@@B @ 1218 NONAME ; struct QMetaObject const QtMobility::QContactObserver::staticMetaObject
- ?contactsUpdated at QContactManager@QtMobility@@AAEXABV?$QList at I@@@Z @ 1219 NONAME ; void QtMobility::QContactManager::contactsUpdated(class QList<unsigned int> const &)
- ?ServiceAim at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$03 at 2@B @ 1220 NONAME ; struct QtMobility::QLatin1Constant<4> const QtMobility::QContactOnlineAccount::ServiceAim
- ?setMaxCount at QContactFetchHint@QtMobility@@QAEXH at Z @ 1221 NONAME ; void QtMobility::QContactFetchHint::setMaxCount(int)
- ?setTags at QContact@QtMobility@@QAEXABVQStringList@@@Z @ 1222 NONAME ; void QtMobility::QContact::setTags(class QStringList const &)
- ?ServiceQq at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$02 at 2@B @ 1223 NONAME ; struct QtMobility::QLatin1Constant<3> const QtMobility::QContactOnlineAccount::ServiceQq
- ?maxCount at QContactFetchHint@QtMobility@@QBEHXZ @ 1224 NONAME ; int QtMobility::QContactFetchHint::maxCount(void) const
- ?trUtf8 at QContactObserver@QtMobility@@SA?AVQString@@PBD0 at Z @ 1225 NONAME ; class QString QtMobility::QContactObserver::trUtf8(char const *, char const *)
- ?contactRemoved at QContactObserver@QtMobility@@IAEXXZ @ 1226 NONAME ; void QtMobility::QContactObserver::contactRemoved(void)
- ?ServiceYahoo at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$05 at 2@B @ 1227 NONAME ; struct QtMobility::QLatin1Constant<6> const QtMobility::QContactOnlineAccount::ServiceYahoo
- ?clearTags at QContact@QtMobility@@QAEXXZ @ 1228 NONAME ; void QtMobility::QContact::clearTags(void)
- ?ServiceIcq at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$03 at 2@B @ 1229 NONAME ; struct QtMobility::QLatin1Constant<4> const QtMobility::QContactOnlineAccount::ServiceIcq
- ?setUrl at QContactUrl@QtMobility@@QAEXABVQUrl@@@Z @ 1230 NONAME ; void QtMobility::QContactUrl::setUrl(class QUrl const &)
- ?emitContactRemoved at QContactObserver@QtMobility@@QAEXXZ @ 1231 NONAME ; void QtMobility::QContactObserver::emitContactRemoved(void)
- ?ServiceSkype at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$05 at 2@B @ 1232 NONAME ; struct QtMobility::QLatin1Constant<6> const QtMobility::QContactOnlineAccount::ServiceSkype
- ?qt_metacast at QContactObserver@QtMobility@@UAEPAXPBD at Z @ 1233 NONAME ; void * QtMobility::QContactObserver::qt_metacast(char const *)
- ??_EQContactTag at QtMobility@@QAE at I@Z @ 1234 NONAME ; QtMobility::QContactTag::~QContactTag(unsigned int)
+ ?match at QContactAddress@QtMobility@@SA?AVQContactFilter at 2@ABVQString@@@Z @ 1198 NONAME ; class QtMobility::QContactFilter QtMobility::QContactAddress::match(class QString const &)
+ ??1QContactTag at QtMobility@@QAE at XZ @ 1199 NONAME ; QtMobility::QContactTag::~QContactTag(void)
+ ?getStaticMetaObject at QContactObserver@QtMobility@@SAABUQMetaObject@@XZ @ 1200 NONAME ; struct QMetaObject const & QtMobility::QContactObserver::getStaticMetaObject(void)
+ ?trUtf8 at QContactObserver@QtMobility@@SA?AVQString@@PBD0H at Z @ 1201 NONAME ; class QString QtMobility::QContactObserver::trUtf8(char const *, char const *, int)
+ ?contactChanged at QContactObserver@QtMobility@@IAEXXZ @ 1202 NONAME ; void QtMobility::QContactObserver::contactChanged(void)
+ ?ProtocolQq at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$02 at 2@B @ 1203 NONAME ; struct QtMobility::QLatin1Constant<3> const QtMobility::QContactOnlineAccount::ProtocolQq
+ ?ProtocolIcq at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$03 at 2@B @ 1204 NONAME ; struct QtMobility::QLatin1Constant<4> const QtMobility::QContactOnlineAccount::ProtocolIcq
+ ?metaObject at QContactObserver@QtMobility@@UBEPBUQMetaObject@@XZ @ 1205 NONAME ; struct QMetaObject const * QtMobility::QContactObserver::metaObject(void) const
+ ??_EQContactObserver at QtMobility@@UAE at I@Z @ 1206 NONAME ; QtMobility::QContactObserver::~QContactObserver(unsigned int)
+ ?qt_metacall at QContactObserver@QtMobility@@UAEHW4Call at QMetaObject@@HPAPAX at Z @ 1207 NONAME ; int QtMobility::QContactObserver::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?emitContactChanged at QContactObserver@QtMobility@@QAEXXZ @ 1208 NONAME ; void QtMobility::QContactObserver::emitContactChanged(void)
+ ?setProtocol at QContactOnlineAccount@QtMobility@@QAEXABVQString@@@Z @ 1209 NONAME ; void QtMobility::QContactOnlineAccount::setProtocol(class QString const &)
+ ?addTag at QContact@QtMobility@@QAEXABVQString@@@Z @ 1210 NONAME ; void QtMobility::QContact::addTag(class QString const &)
+ ?observeContact at QContactManager@QtMobility@@QAE?AV?$QSharedPointer at VQContactObserver@QtMobility@@@@I at Z @ 1211 NONAME ; class QSharedPointer<class QtMobility::QContactObserver> QtMobility::QContactManager::observeContact(unsigned int)
+ ?contactsDeleted at QContactManager@QtMobility@@AAEXABV?$QList at I@@@Z @ 1212 NONAME ; void QtMobility::QContactManager::contactsDeleted(class QList<unsigned int> const &)
+ ?tr at QContactObserver@QtMobility@@SA?AVQString@@PBD0 at Z @ 1213 NONAME ; class QString QtMobility::QContactObserver::tr(char const *, char const *)
+ ?tr at QContactObserver@QtMobility@@SA?AVQString@@PBD0H at Z @ 1214 NONAME ; class QString QtMobility::QContactObserver::tr(char const *, char const *, int)
+ ??1QContactObserver at QtMobility@@UAE at XZ @ 1215 NONAME ; QtMobility::QContactObserver::~QContactObserver(void)
+ ?observerDestroyed at QContactManager@QtMobility@@AAEXPAVQObject@@@Z @ 1216 NONAME ; void QtMobility::QContactManager::observerDestroyed(class QObject *)
+ ?ProtocolIrc at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$03 at 2@B @ 1217 NONAME ; struct QtMobility::QLatin1Constant<4> const QtMobility::QContactOnlineAccount::ProtocolIrc
+ ?match at QContactFavorite@QtMobility@@SA?AVQContactFilter at 2@XZ @ 1218 NONAME ; class QtMobility::QContactFilter QtMobility::QContactFavorite::match(void)
+ ??0QContactTag at QtMobility@@QAE at ABV01@@Z @ 1219 NONAME ; QtMobility::QContactTag::QContactTag(class QtMobility::QContactTag const &)
+ ?tags at QContact@QtMobility@@QBE?AVQStringList@@XZ @ 1220 NONAME ; class QStringList QtMobility::QContact::tags(void) const
+ ?staticMetaObject at QContactObserver@QtMobility@@2UQMetaObject@@B @ 1221 NONAME ; struct QMetaObject const QtMobility::QContactObserver::staticMetaObject
+ ?contactsUpdated at QContactManager@QtMobility@@AAEXABV?$QList at I@@@Z @ 1222 NONAME ; void QtMobility::QContactManager::contactsUpdated(class QList<unsigned int> const &)
+ ?match at QContactTag@QtMobility@@SA?AVQContactFilter at 2@ABVQString@@@Z @ 1223 NONAME ; class QtMobility::QContactFilter QtMobility::QContactTag::match(class QString const &)
+ ?ProtocolMsn at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$03 at 2@B @ 1224 NONAME ; struct QtMobility::QLatin1Constant<4> const QtMobility::QContactOnlineAccount::ProtocolMsn
+ ?setMaxCount at QContactFetchHint@QtMobility@@QAEXH at Z @ 1225 NONAME ; void QtMobility::QContactFetchHint::setMaxCount(int)
+ ?setTags at QContact@QtMobility@@QAEXABVQStringList@@@Z @ 1226 NONAME ; void QtMobility::QContact::setTags(class QStringList const &)
+ ?FieldProtocol at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$08 at 2@B @ 1227 NONAME ; struct QtMobility::QLatin1Constant<9> const QtMobility::QContactOnlineAccount::FieldProtocol
+ ?ProtocolYahoo at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$05 at 2@B @ 1228 NONAME ; struct QtMobility::QLatin1Constant<6> const QtMobility::QContactOnlineAccount::ProtocolYahoo
+ ?maxCount at QContactFetchHint@QtMobility@@QBEHXZ @ 1229 NONAME ; int QtMobility::QContactFetchHint::maxCount(void) const
+ ?match at QContactGlobalPresence@QtMobility@@SA?AVQContactFilter at 2@W4PresenceState at QContactPresence@2@@Z @ 1230 NONAME ; class QtMobility::QContactFilter QtMobility::QContactGlobalPresence::match(enum QtMobility::QContactPresence::PresenceState)
+ ?trUtf8 at QContactObserver@QtMobility@@SA?AVQString@@PBD0 at Z @ 1231 NONAME ; class QString QtMobility::QContactObserver::trUtf8(char const *, char const *)
+ ?contactRemoved at QContactObserver@QtMobility@@IAEXXZ @ 1232 NONAME ; void QtMobility::QContactObserver::contactRemoved(void)
+ ?ProtocolSkype at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$05 at 2@B @ 1233 NONAME ; struct QtMobility::QLatin1Constant<6> const QtMobility::QContactOnlineAccount::ProtocolSkype
+ ?clearTags at QContact@QtMobility@@QAEXXZ @ 1234 NONAME ; void QtMobility::QContact::clearTags(void)
+ ?ProtocolJabber at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$06 at 2@B @ 1235 NONAME ; struct QtMobility::QLatin1Constant<7> const QtMobility::QContactOnlineAccount::ProtocolJabber
+ ?setUrl at QContactUrl@QtMobility@@QAEXABVQUrl@@@Z @ 1236 NONAME ; void QtMobility::QContactUrl::setUrl(class QUrl const &)
+ ?ProtocolAim at QContactOnlineAccount@QtMobility@@2U?$QLatin1Constant@$03 at 2@B @ 1237 NONAME ; struct QtMobility::QLatin1Constant<4> const QtMobility::QContactOnlineAccount::ProtocolAim
+ ?emitContactRemoved at QContactObserver@QtMobility@@QAEXXZ @ 1238 NONAME ; void QtMobility::QContactObserver::emitContactRemoved(void)
+ ?protocol at QContactOnlineAccount@QtMobility@@QBE?AVQString@@XZ @ 1239 NONAME ; class QString QtMobility::QContactOnlineAccount::protocol(void) const
+ ?qt_metacast at QContactObserver@QtMobility@@UAEPAXPBD at Z @ 1240 NONAME ; void * QtMobility::QContactObserver::qt_metacast(char const *)
+ ??_EQContactTag at QtMobility@@QAE at I@Z @ 1241 NONAME ; QtMobility::QContactTag::~QContactTag(unsigned int)
--- src/s60installs/bwins/QtMessagingu.def
+++ src/s60installs/bwins/QtMessagingu.def
@@ -342,4 +342,18 @@
??0QMessageAddress at QtMobility@@QAE at W4Type@01 at ABVQString@@@Z @ 341 NONAME ; QtMobility::QMessageAddress::QMessageAddress(enum QtMobility::QMessageAddress::Type, class QString const &)
?byName at QMessageFolderFilter@QtMobility@@SA?AV12 at ABVQString@@W4InclusionComparator at QMessageDataComparator@2@@Z @ 342 NONAME ; class QtMobility::QMessageFolderFilter QtMobility::QMessageFolderFilter::byName(class QString const &, enum QtMobility::QMessageDataComparator::InclusionComparator)
??1QMessageAccountSortOrder at QtMobility@@UAE at XZ @ 343 NONAME ; QtMobility::QMessageAccountSortOrder::~QMessageAccountSortOrder(void)
+ ??_EQMessageId at QtMobility@@QAE at I@Z @ 344 NONAME ; QtMobility::QMessageId::~QMessageId(unsigned int)
+ ?byPath at QMessageFolderFilter@QtMobility@@SA?AV12 at ABVQString@@W4LikeComparator at QMessageDataComparator@2@@Z @ 345 NONAME ; class QtMobility::QMessageFolderFilter QtMobility::QMessageFolderFilter::byPath(class QString const &, enum QtMobility::QMessageDataComparator::LikeComparator)
+ ?byTo at QMessageFilter@QtMobility@@SA?AV12 at ABVQString@@W4LikeComparator at QMessageDataComparator@2@@Z @ 346 NONAME ; class QtMobility::QMessageFilter QtMobility::QMessageFilter::byTo(class QString const &, enum QtMobility::QMessageDataComparator::LikeComparator)
+ ?byCc at QMessageFilter@QtMobility@@SA?AV12 at ABVQString@@W4LikeComparator at QMessageDataComparator@2@@Z @ 347 NONAME ; class QtMobility::QMessageFilter QtMobility::QMessageFilter::byCc(class QString const &, enum QtMobility::QMessageDataComparator::LikeComparator)
+ ?bySubject at QMessageFilter@QtMobility@@SA?AV12 at ABVQString@@W4LikeComparator at QMessageDataComparator@2@@Z @ 348 NONAME ; class QtMobility::QMessageFilter QtMobility::QMessageFilter::bySubject(class QString const &, enum QtMobility::QMessageDataComparator::LikeComparator)
+ ?bySender at QMessageFilter@QtMobility@@SA?AV12 at ABVQString@@W4LikeComparator at QMessageDataComparator@2@@Z @ 349 NONAME ; class QtMobility::QMessageFilter QtMobility::QMessageFilter::bySender(class QString const &, enum QtMobility::QMessageDataComparator::LikeComparator)
+ ?byName at QMessageFolderFilter@QtMobility@@SA?AV12 at ABVQString@@W4LikeComparator at QMessageDataComparator@2@@Z @ 350 NONAME ; class QtMobility::QMessageFolderFilter QtMobility::QMessageFolderFilter::byName(class QString const &, enum QtMobility::QMessageDataComparator::LikeComparator)
+ ?byName at QMessageAccountFilter@QtMobility@@SA?AV12 at ABVQString@@W4LikeComparator at QMessageDataComparator@2@@Z @ 351 NONAME ; class QtMobility::QMessageAccountFilter QtMobility::QMessageAccountFilter::byName(class QString const &, enum QtMobility::QMessageDataComparator::LikeComparator)
+ ?byBcc at QMessageFilter@QtMobility@@SA?AV12 at ABVQString@@W4LikeComparator at QMessageDataComparator@2@@Z @ 352 NONAME ; class QtMobility::QMessageFilter QtMobility::QMessageFilter::byBcc(class QString const &, enum QtMobility::QMessageDataComparator::LikeComparator)
+ ??_EQMessageAccountId at QtMobility@@QAE at I@Z @ 353 NONAME ; QtMobility::QMessageAccountId::~QMessageAccountId(unsigned int)
+ ??_EQMessageContentContainerId at QtMobility@@QAE at I@Z @ 354 NONAME ; QtMobility::QMessageContentContainerId::~QMessageContentContainerId(unsigned int)
+ ??_EQMessageFolderId at QtMobility@@QAE at I@Z @ 355 NONAME ; QtMobility::QMessageFolderId::~QMessageFolderId(unsigned int)
+ ?byRecipients at QMessageFilter@QtMobility@@SA?AV12 at ABVQString@@W4LikeComparator at QMessageDataComparator@2@@Z @ 356 NONAME ; class QtMobility::QMessageFilter QtMobility::QMessageFilter::byRecipients(class QString const &, enum QtMobility::QMessageDataComparator::LikeComparator)
+ ?removeAccount at QMessageManager@QtMobility@@QAE_NABVQMessageAccountId at 2@@Z @ 357 NONAME ; bool QtMobility::QMessageManager::removeAccount(class QtMobility::QMessageAccountId const &)
--- src/s60installs/bwins/QtOrganizeru.def
+++ src/s60installs/bwins/QtOrganizeru.def
@@ -1219,4 +1219,5 @@
?participationRole at QOrganizerEventAttendee@QtMobility@@QBE?AW4ParticipationRole at 12@XZ @ 1218 NONAME ; enum QtMobility::QOrganizerEventAttendee::ParticipationRole QtMobility::QOrganizerEventAttendee::participationRole(void) const
??0QOrganizerItemTag at QtMobility@@QAE at ABV01@@Z @ 1219 NONAME ; QtMobility::QOrganizerItemTag::QOrganizerItemTag(class QtMobility::QOrganizerItemTag const &)
?errorMap at QOrganizerItemFetchByIdRequest@QtMobility@@QBE?AV?$QMap at HW4Error@QOrganizerManager at QtMobility@@@@XZ @ 1220 NONAME ; class QMap<int, enum QtMobility::QOrganizerManager::Error> QtMobility::QOrganizerItemFetchByIdRequest::errorMap(void) const
+ ?saveItems at QOrganizerManager@QtMobility@@QAE_NPAV?$QList at VQOrganizerItem@QtMobility@@@@ABVQStringList@@@Z @ 1221 NONAME ; bool QtMobility::QOrganizerManager::saveItems(class QList<class QtMobility::QOrganizerItem> *, class QStringList const &)
--- src/s60installs/eabi/QtContactsu.def
+++ src/s60installs/eabi/QtContactsu.def
@@ -927,35 +927,40 @@
_ZN10QtMobilitylsE6QDebugRKNS_24QContactActionDescriptorE @ 926 NONAME
_ZN10QtMobilitylsER11QDataStreamRKNS_20QContactActionTargetE @ 927 NONAME
_ZN10QtMobilityrsER11QDataStreamRNS_20QContactActionTargetE @ 928 NONAME
- _ZN10QtMobility15QContactManager14observeContactEj @ 929 NONAME
- _ZN10QtMobility15QContactManager15contactsDeletedERK5QListIjE @ 930 NONAME
- _ZN10QtMobility15QContactManager15contactsUpdatedERK5QListIjE @ 931 NONAME
- _ZN10QtMobility15QContactManager17observerDestroyedEP7QObject @ 932 NONAME
- _ZN10QtMobility16QContactObserver11qt_metacallEN11QMetaObject4CallEiPPv @ 933 NONAME
- _ZN10QtMobility16QContactObserver11qt_metacastEPKc @ 934 NONAME
- _ZN10QtMobility16QContactObserver14contactChangedEv @ 935 NONAME
- _ZN10QtMobility16QContactObserver14contactRemovedEv @ 936 NONAME
- _ZN10QtMobility16QContactObserver16staticMetaObjectE @ 937 NONAME DATA 16
- _ZN10QtMobility16QContactObserver18emitContactChangedEv @ 938 NONAME
- _ZN10QtMobility16QContactObserver18emitContactRemovedEv @ 939 NONAME
- _ZN10QtMobility16QContactObserver19getStaticMetaObjectEv @ 940 NONAME
- _ZN10QtMobility16QContactObserverC1EP7QObject @ 941 NONAME
- _ZN10QtMobility16QContactObserverC2EP7QObject @ 942 NONAME
- _ZN10QtMobility17QContactFetchHint11setMaxCountEi @ 943 NONAME
- _ZN10QtMobility21QContactOnlineAccount10ServiceAimE @ 944 NONAME DATA 4
- _ZN10QtMobility21QContactOnlineAccount10ServiceIcqE @ 945 NONAME DATA 4
- _ZN10QtMobility21QContactOnlineAccount10ServiceIrcE @ 946 NONAME DATA 4
- _ZN10QtMobility21QContactOnlineAccount10ServiceMsnE @ 947 NONAME DATA 4
- _ZN10QtMobility21QContactOnlineAccount12ServiceSkypeE @ 948 NONAME DATA 6
- _ZN10QtMobility21QContactOnlineAccount12ServiceYahooE @ 949 NONAME DATA 6
- _ZN10QtMobility21QContactOnlineAccount13ServiceJabberE @ 950 NONAME DATA 7
- _ZN10QtMobility21QContactOnlineAccount9ServiceQqE @ 951 NONAME DATA 3
- _ZN10QtMobility8QContact6addTagERK7QString @ 952 NONAME
- _ZN10QtMobility8QContact7setTagsERK11QStringList @ 953 NONAME
- _ZN10QtMobility8QContact9clearTagsEv @ 954 NONAME
- _ZNK10QtMobility16QContactObserver10metaObjectEv @ 955 NONAME
- _ZNK10QtMobility17QContactFetchHint8maxCountEv @ 956 NONAME
- _ZNK10QtMobility8QContact4tagsEv @ 957 NONAME
- _ZTIN10QtMobility16QContactObserverE @ 958 NONAME
- _ZTVN10QtMobility16QContactObserverE @ 959 NONAME
+ _ZN10QtMobility11QContactTag5matchERK7QString @ 929 NONAME
+ _ZN10QtMobility15QContactAddress5matchERK7QString @ 930 NONAME
+ _ZN10QtMobility15QContactManager14observeContactEj @ 931 NONAME
+ _ZN10QtMobility15QContactManager15contactsDeletedERK5QListIjE @ 932 NONAME
+ _ZN10QtMobility15QContactManager15contactsUpdatedERK5QListIjE @ 933 NONAME
+ _ZN10QtMobility15QContactManager17observerDestroyedEP7QObject @ 934 NONAME
+ _ZN10QtMobility16QContactFavorite5matchEv @ 935 NONAME
+ _ZN10QtMobility16QContactObserver11qt_metacallEN11QMetaObject4CallEiPPv @ 936 NONAME
+ _ZN10QtMobility16QContactObserver11qt_metacastEPKc @ 937 NONAME
+ _ZN10QtMobility16QContactObserver14contactChangedEv @ 938 NONAME
+ _ZN10QtMobility16QContactObserver14contactRemovedEv @ 939 NONAME
+ _ZN10QtMobility16QContactObserver16staticMetaObjectE @ 940 NONAME DATA 16
+ _ZN10QtMobility16QContactObserver18emitContactChangedEv @ 941 NONAME
+ _ZN10QtMobility16QContactObserver18emitContactRemovedEv @ 942 NONAME
+ _ZN10QtMobility16QContactObserver19getStaticMetaObjectEv @ 943 NONAME
+ _ZN10QtMobility16QContactObserverC1EP7QObject @ 944 NONAME
+ _ZN10QtMobility16QContactObserverC2EP7QObject @ 945 NONAME
+ _ZN10QtMobility17QContactFetchHint11setMaxCountEi @ 946 NONAME
+ _ZN10QtMobility21QContactOnlineAccount10ProtocolQqE @ 947 NONAME DATA 3
+ _ZN10QtMobility21QContactOnlineAccount11ProtocolAimE @ 948 NONAME DATA 4
+ _ZN10QtMobility21QContactOnlineAccount11ProtocolIcqE @ 949 NONAME DATA 4
+ _ZN10QtMobility21QContactOnlineAccount11ProtocolIrcE @ 950 NONAME DATA 4
+ _ZN10QtMobility21QContactOnlineAccount11ProtocolMsnE @ 951 NONAME DATA 4
+ _ZN10QtMobility21QContactOnlineAccount13FieldProtocolE @ 952 NONAME DATA 9
+ _ZN10QtMobility21QContactOnlineAccount13ProtocolSkypeE @ 953 NONAME DATA 6
+ _ZN10QtMobility21QContactOnlineAccount13ProtocolYahooE @ 954 NONAME DATA 6
+ _ZN10QtMobility21QContactOnlineAccount14ProtocolJabberE @ 955 NONAME DATA 7
+ _ZN10QtMobility22QContactGlobalPresence5matchENS_16QContactPresence13PresenceStateE @ 956 NONAME
+ _ZN10QtMobility8QContact6addTagERK7QString @ 957 NONAME
+ _ZN10QtMobility8QContact7setTagsERK11QStringList @ 958 NONAME
+ _ZN10QtMobility8QContact9clearTagsEv @ 959 NONAME
+ _ZNK10QtMobility16QContactObserver10metaObjectEv @ 960 NONAME
+ _ZNK10QtMobility17QContactFetchHint8maxCountEv @ 961 NONAME
+ _ZNK10QtMobility8QContact4tagsEv @ 962 NONAME
+ _ZTIN10QtMobility16QContactObserverE @ 963 NONAME
+ _ZTVN10QtMobility16QContactObserverE @ 964 NONAME
--- src/s60installs/eabi/QtMessagingu.def
+++ src/s60installs/eabi/QtMessagingu.def
@@ -417,4 +417,14 @@
_ZTVN10QtMobility24QMessageAccountSortOrderE @ 416 NONAME
_ZTVN10QtMobility24QMessageContentContainerE @ 417 NONAME
_ZTVN10QtMobility8QMessageE @ 418 NONAME
+ _ZN10QtMobility14QMessageFilter12byRecipientsERK7QStringNS_22QMessageDataComparator14LikeComparatorE @ 419 NONAME
+ _ZN10QtMobility14QMessageFilter4byCcERK7QStringNS_22QMessageDataComparator14LikeComparatorE @ 420 NONAME
+ _ZN10QtMobility14QMessageFilter4byToERK7QStringNS_22QMessageDataComparator14LikeComparatorE @ 421 NONAME
+ _ZN10QtMobility14QMessageFilter5byBccERK7QStringNS_22QMessageDataComparator14LikeComparatorE @ 422 NONAME
+ _ZN10QtMobility14QMessageFilter8bySenderERK7QStringNS_22QMessageDataComparator14LikeComparatorE @ 423 NONAME
+ _ZN10QtMobility14QMessageFilter9bySubjectERK7QStringNS_22QMessageDataComparator14LikeComparatorE @ 424 NONAME
+ _ZN10QtMobility15QMessageManager13removeAccountERKNS_17QMessageAccountIdE @ 425 NONAME
+ _ZN10QtMobility20QMessageFolderFilter6byNameERK7QStringNS_22QMessageDataComparator14LikeComparatorE @ 426 NONAME
+ _ZN10QtMobility20QMessageFolderFilter6byPathERK7QStringNS_22QMessageDataComparator14LikeComparatorE @ 427 NONAME
+ _ZN10QtMobility21QMessageAccountFilter6byNameERK7QStringNS_22QMessageDataComparator14LikeComparatorE @ 428 NONAME
--- src/s60installs/eabi/QtOrganizeru.def
+++ src/s60installs/eabi/QtOrganizeru.def
@@ -1006,4 +1006,5 @@
_ZTIN10QtMobility30QOrganizerItemFetchByIdRequestE @ 1005 NONAME
_ZTVN10QtMobility22QOrganizerItemObserverE @ 1006 NONAME
_ZTVN10QtMobility30QOrganizerItemFetchByIdRequestE @ 1007 NONAME
+ _ZN10QtMobility17QOrganizerManager9saveItemsEP5QListINS_14QOrganizerItemEERK11QStringList @ 1008 NONAME
--- src/versit/qversitcontactexporter_p.cpp
+++ src/versit/qversitcontactexporter_p.cpp
@@ -702,23 +702,23 @@
{
QContactOnlineAccount onlineAccount = static_cast<QContactOnlineAccount>(detail);
QStringList subTypes = onlineAccount.subTypes();
- QString serviceProvider = onlineAccount.serviceProvider();
+ QString protocol = onlineAccount.protocol();
QString propertyName;
- if (serviceProvider == QContactOnlineAccount::ServiceJabber) {
+ if (protocol == QContactOnlineAccount::ProtocolJabber) {
propertyName = QLatin1String("X-JABBER");
- } else if (serviceProvider == QContactOnlineAccount::ServiceAim) {
+ } else if (protocol == QContactOnlineAccount::ProtocolAim) {
propertyName = QLatin1String("X-AIM");
- } else if (serviceProvider == QContactOnlineAccount::ServiceIcq) {
+ } else if (protocol == QContactOnlineAccount::ProtocolIcq) {
propertyName = QLatin1String("X-ICQ");
- } else if (serviceProvider == QContactOnlineAccount::ServiceMsn) {
+ } else if (protocol == QContactOnlineAccount::ProtocolMsn) {
propertyName = QLatin1String("X-MSN");
- } else if (serviceProvider == QContactOnlineAccount::ServiceQq) {
+ } else if (protocol == QContactOnlineAccount::ProtocolQq) {
propertyName = QLatin1String("X-QQ");
- } else if (serviceProvider == QContactOnlineAccount::ServiceYahoo) {
+ } else if (protocol == QContactOnlineAccount::ProtocolYahoo) {
propertyName = QLatin1String("X-YAHOO");
- } else if (serviceProvider == QContactOnlineAccount::ServiceSkype) {
+ } else if (protocol == QContactOnlineAccount::ProtocolSkype) {
propertyName = QLatin1String("X-SKYPE");
} else if (subTypes.contains(QContactOnlineAccount::SubTypeSip) ||
subTypes.contains(QContactOnlineAccount::SubTypeSipVoip) ||
--- src/versit/qversitcontactimporter_p.cpp
+++ src/versit/qversitcontactimporter_p.cpp
@@ -582,20 +582,20 @@
onlineAccount.setSubTypes(QContactOnlineAccount::SubTypeImpp);
} else if (property.name() == QLatin1String("X-JABBER")) {
onlineAccount.setSubTypes(QContactOnlineAccount::SubTypeImpp);
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceJabber);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolJabber);
} else if (property.name() == QLatin1String("X-AIM")) {
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceAim);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolAim);
} else if (property.name() == QLatin1String("X-ICQ")) {
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceIcq);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolIcq);
} else if (property.name() == QLatin1String("X-MSN")) {
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceMsn);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolMsn);
} else if (property.name() == QLatin1String("X-QQ")) {
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceQq);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolQq);
} else if (property.name() == QLatin1String("X-YAHOO")) {
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceYahoo);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolYahoo);
} else if (property.name() == QLatin1String("X-SKYPE") ||
property.name() == QLatin1String("X-SKYPE-USERNAME")) {
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceSkype);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolSkype);
}
saveDetailWithContext(updatedDetails, onlineAccount, extractContexts(property));
--- tests/auto/contacts.pro
+++ tests/auto/contacts.pro
@@ -10,6 +10,7 @@
qcontactdetails \
qcontactfilter \
qcontactmanager \
+ qcontactmanagerdetails \
qcontactmanagerplugins \
qcontactrelationship \
qlatin1constant
--- tests/auto/location.pro
+++ tests/auto/location.pro
@@ -7,6 +7,7 @@
SUBDIRS += qgeocoordinate \
qgeoboundingbox \
qgeotiledmappingmanagerengine \
+ qgeotiledmapdata \
qgeopositioninfo \
qgeosatelliteinfo \
qgeosatelliteinfosource \
@@ -42,7 +43,8 @@
geoservicesgeomapplugin \
geoservicesgeomap \
geoservicesgeotiledmapplugin \
- geoservicesgeotiledmap
+ geoservicesgeotiledmap \
+ pixelindex
!symbian{
--- tests/auto/pixelindex
+++ tests/auto/pixelindex
+(directory)
--- tests/auto/pixelindex/pixelindex.pro
+++ tests/auto/pixelindex/pixelindex.pro
+TEMPLATE = lib
+CONFIG += plugin testplugin
+TARGET = $$qtLibraryTarget(qtgeoservices_pixelindexplugin)
+PLUGIN_TYPE=geoservices
+
+include(../../../common.pri)
+
+CONFIG += mobility
+MOBILITY = location
+
+HEADERS += pixelindexengine.h
+
+SOURCES += pixelindexengine.cpp \
+ plugin.cpp
+
+
+INCLUDEPATH += ../../../src/location \
+ ../../../src/location/maps \
+ ../../../src/location/maps/tiled
+
+
+symbian {
+ TARGET.EPOCALLOWDLLDATA = 1
+ TARGET.CAPABILITY = ALL -TCB
+ pluginDep.sources = $${TARGET}.dll
+ pluginDep.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_TYPE}
+ DEPLOYMENT += pluginDep
+}
--- tests/auto/pixelindex/pixelindexengine.cpp
+++ tests/auto/pixelindex/pixelindexengine.cpp
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "pixelindexengine.h"
+#include <QBuffer>
+#include <QByteArray>
+
+TilePixelValue::TilePixelValue()
+ : data_(0) {}
+
+TilePixelValue::TilePixelValue(QRgb rgb)
+ : data_(0)
+{
+ setRgb(rgb);
+}
+
+TilePixelValue::TilePixelValue(unsigned int zoom, unsigned int px, unsigned int py)
+ : data_(0)
+{
+ setZoom(zoom);
+ setPx(px);
+ setPy(py);
+}
+
+TilePixelValue::~TilePixelValue() {}
+
+void TilePixelValue::setRgb(QRgb rgb)
+{
+ data_ = static_cast<unsigned int>(rgb);
+}
+
+QRgb TilePixelValue::rgb() const
+{
+ return static_cast<QRgb>(data_);
+}
+
+void TilePixelValue::setZoom(unsigned int zoom)
+{
+ data_ = (data_ & 0xFFFFFFF0) + (zoom & 0x0000000F);
+}
+
+unsigned int TilePixelValue::zoom() const
+{
+ return (data_ & 0x0000000F);
+}
+
+void TilePixelValue::setPx(unsigned int px)
+{
+ data_ = (data_ & 0xFFFFC00F) + ((px & 0x000003FF) << 4);
+}
+
+unsigned int TilePixelValue::px() const
+{
+ return (data_ & 0x00003FF0) >> 4;
+}
+
+void TilePixelValue::setPy(unsigned int py)
+{
+ data_ = (data_ & 0xFF003FFF) + ((py & 0x000003FF) << 14);
+}
+
+unsigned int TilePixelValue::py() const
+{
+ return (data_ & 0x00FFC000) >> 14;
+}
+
+PixmapTiledMapReply::PixmapTiledMapReply(QPixmap &pixmap, const QGeoTiledMapRequest &request, QObject *parent) :
+ QGeoTiledMapReply(request, parent),
+ m_pixmap(pixmap)
+{
+ QByteArray ba;
+ QBuffer buff(&ba);
+ buff.open(QIODevice::WriteOnly);
+ pixmap.save(&buff, "PNG");
+
+ setMapImageData(ba);
+ setMapImageFormat("PNG");
+ setFinished(true);
+}
+
+PixelIndexEngine::PixelIndexEngine(const QMap<QString, QVariant> ¶meters, QObject *parent) :
+ QGeoTiledMappingManagerEngine(parameters, parent)
+{
+ // might want to parametrise these for future use
+ setTileSize(QSize(128,128));
+ setMinimumZoomLevel(0.00);
+ setMaximumZoomLevel(3.0);
+
+ QList<QGraphicsGeoMap::MapType> types;
+ types << QGraphicsGeoMap::StreetMap;
+ types << QGraphicsGeoMap::TerrainMap;
+ setSupportedMapTypes(types);
+
+ QList<QGraphicsGeoMap::ConnectivityMode> modes;
+ modes << QGraphicsGeoMap::OfflineMode;
+ setSupportedConnectivityModes(modes);
+}
+
+WhiteTileEngine::WhiteTileEngine(const QMap<QString, QVariant> ¶meters, QObject *parent) :
+ QGeoTiledMappingManagerEngine(parameters, parent)
+{
+ setTileSize(QSize(128,128));
+ setMinimumZoomLevel(0.0);
+ setMaximumZoomLevel(3.0);
+
+ QList<QGraphicsGeoMap::MapType> types;
+ types << QGraphicsGeoMap::StreetMap;
+ types << QGraphicsGeoMap::TerrainMap;
+ setSupportedMapTypes(types);
+
+ QList<QGraphicsGeoMap::ConnectivityMode> modes;
+ modes << QGraphicsGeoMap::OfflineMode;
+ setSupportedConnectivityModes(modes);
+}
+
+QPixmap indexedPixmap(int width, int height)
+{
+ QImage im(width, height, QImage::Format_RGB888);
+ im.fill(0);
+
+ for (int y = 0; y < height; y++) {
+ for (int x = 0; x < width; x++) {
+ TilePixelValue tpv;
+ tpv.setPy(y);
+ tpv.setPx(x);
+ tpv.setZoom(1);
+ im.setPixel(x, y, tpv.rgb());
+ }
+ }
+ return QPixmap::fromImage(im);
+}
+
+QGeoTiledMapReply *PixelIndexEngine::getTileImage(const QGeoTiledMapRequest &request)
+{
+ QImage im(128, 128, QImage::Format_RGB888);
+ im.fill(0);
+
+ for (int y = 0; y < im.height(); y++) {
+ for (int x = 0; x < im.width(); x++) {
+ TilePixelValue tpv;
+ tpv.setPy(request.row()*128 + y);
+ tpv.setPx(request.column()*128 + x);
+ tpv.setZoom(request.zoomLevel());
+ im.setPixel(x, y, tpv.rgb());
+ }
+ }
+
+ QPixmap pm = QPixmap::fromImage(im);
+ return new PixmapTiledMapReply(pm, request);
+}
+
+QGeoTiledMapReply *WhiteTileEngine::getTileImage(const QGeoTiledMapRequest &request)
+{
+ QImage im(128, 128, QImage::Format_RGB888);
+ im.fill(0xffffffff);
+
+ QPixmap pm = QPixmap::fromImage(im);
+ return new PixmapTiledMapReply(pm, request);
+}
--- tests/auto/pixelindex/pixelindexengine.h
+++ tests/auto/pixelindex/pixelindexengine.h
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PIXELINDEXENGINE_H
+#define PIXELINDEXENGINE_H
+
+#include <QtGui/QApplication>
+#include <QDebug>
+#include <QtGui>
+
+#include <qgeocoordinate.h>
+#include <qgraphicsgeomap.h>
+#include <qgeomapdata.h>
+#include <qgeotiledmapdata.h>
+#include <qgeotiledmaprequest.h>
+#include <qgeotiledmapreply.h>
+#include <qgeotiledmappingmanagerengine.h>
+
+QTM_USE_NAMESPACE
+
+/*
+typedef union {
+ QRgb rgb;
+ struct {
+ unsigned int zoom:4;
+ unsigned int px:10;
+ unsigned int py:10;
+ };
+} TilePixelValue;
+*/
+class TilePixelValue {
+
+public:
+ TilePixelValue();
+ TilePixelValue(QRgb rgb);
+ TilePixelValue(unsigned int zoom, unsigned int px, unsigned int py);
+ ~TilePixelValue();
+
+ void setRgb(QRgb rgb);
+ QRgb rgb() const;
+
+ void setZoom(unsigned int zoom);
+ unsigned int zoom() const;
+
+ void setPx(unsigned int px);
+ unsigned int px() const;
+
+ void setPy(unsigned int py);
+ unsigned int py() const;
+
+private:
+ quint32 data_;
+};
+
+QPixmap indexedPixmap(int width, int height);
+
+/*!
+ A tiled map reply subclass that is constructed already finished, with
+ a given QPixmap as its content (saved in PNG format).
+ */
+class PixmapTiledMapReply : public QGeoTiledMapReply
+{
+ Q_OBJECT
+public:
+ PixmapTiledMapReply(QPixmap &pixmap, const QGeoTiledMapRequest &request,
+ QObject *parent=0);
+
+private:
+ QPixmap m_pixmap;
+};
+
+/*!
+ Tiled map engine that returns tiles made up of pixels with their color set
+ to a TilePixelValue for that pixel's location and zoom level. Used for testing
+ the map rendering code.
+ */
+class PixelIndexEngine : public QGeoTiledMappingManagerEngine
+{
+ Q_OBJECT
+public:
+ PixelIndexEngine(const QMap<QString, QVariant> ¶meters,
+ QObject *parent=0);
+
+ QGeoTiledMapReply *getTileImage(const QGeoTiledMapRequest &request);
+
+};
+
+/*!
+ Returns pure white tiles.
+ */
+class WhiteTileEngine : public QGeoTiledMappingManagerEngine
+{
+ Q_OBJECT
+public:
+ WhiteTileEngine(const QMap<QString, QVariant> ¶meters,
+ QObject *parent=0);
+
+ QGeoTiledMapReply *getTileImage(const QGeoTiledMapRequest &request);
+};
+
+#endif // PIXELINDEXENGINE_H
--- tests/auto/pixelindex/plugin.cpp
+++ tests/auto/pixelindex/plugin.cpp
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "pixelindexengine.h"
+#include <qgeoserviceproviderfactory.h>
+#include <QObject>
+
+#include <QtPlugin>
+
+class PixelIndexPlugin: public QObject, public QGeoServiceProviderFactory
+{
+ Q_OBJECT
+ Q_INTERFACES(QtMobility::QGeoServiceProviderFactory)
+public:
+ PixelIndexPlugin();
+ ~PixelIndexPlugin();
+
+ QString providerName() const;
+ int providerVersion() const;
+
+ QGeoMappingManagerEngine* createMappingManagerEngine(const QMap<QString, QVariant> ¶meters,
+ QGeoServiceProvider::Error *error, QString *errorString) const;
+
+};
+
+PixelIndexPlugin::PixelIndexPlugin()
+{}
+
+PixelIndexPlugin::~PixelIndexPlugin()
+{}
+
+QString PixelIndexPlugin::providerName() const
+{
+ return "pixelindex.plugin";
+}
+
+int PixelIndexPlugin::providerVersion() const
+{
+ return 1;
+}
+
+QGeoMappingManagerEngine* PixelIndexPlugin::createMappingManagerEngine(const QMap<QString, QVariant> ¶meters,
+ QGeoServiceProvider::Error *error, QString *errorString) const
+{
+ Q_UNUSED(error);
+ Q_UNUSED(errorString);
+ return new PixelIndexEngine(parameters);
+}
+
+Q_EXPORT_PLUGIN2(qtgeoservices_pixelindexplugin, PixelIndexPlugin)
+
+#include "plugin.moc"
--- tests/auto/qcontactdetails/tst_qcontactdetails.cpp
+++ tests/auto/qcontactdetails/tst_qcontactdetails.cpp
@@ -689,6 +689,8 @@
o1.setAccountUri("test at nokia.com");
QCOMPARE(o1.accountUri(), QString("test at nokia.com"));
QCOMPARE(o1.value(QContactOnlineAccount::FieldAccountUri), QString("test at nokia.com"));
+ o1.setProtocol(QContactOnlineAccount::ProtocolJabber);
+ QCOMPARE(o1.protocol(), QLatin1String(QContactOnlineAccount::ProtocolJabber));
// Sub types
o1.setSubTypes(QContactOnlineAccount::SubTypeSip);
--- tests/auto/qcontactmanager/tst_qcontactmanager.cpp
+++ tests/auto/qcontactmanager/tst_qcontactmanager.cpp
@@ -2200,11 +2200,16 @@
QVERIFY(arg.count() == 1);
QCOMPARE(QContactLocalId(arg.at(0)), cid);
+ QSharedPointer<QContactObserver> c1Observer = m1->observeContact(cid);
+ QScopedPointer<QSignalSpy> spyCOM1(new QSignalSpy(c1Observer.data(), SIGNAL(contactChanged())));
+ QScopedPointer<QSignalSpy> spyCOR1(new QSignalSpy(c1Observer.data(), SIGNAL(contactRemoved())));
+
// verify save modified emits signal changed
saveContactName(&c, nameDef, &nc, "Citizen");
QVERIFY(m1->saveContact(&c));
modSigCount += 1;
QTRY_COMPARE(spyCM.count(), modSigCount);
+ QTRY_COMPARE(spyCOM1->count(), 1);
args = spyCM.takeFirst();
modSigCount -= 1;
arg = args.first().value<QList<quint32> >();
@@ -2215,6 +2220,7 @@
m1->removeContact(c.id().localId());
remSigCount += 1;
QTRY_COMPARE(spyCR.count(), remSigCount);
+ QTRY_COMPARE(spyCOR1->count(), 1);
args = spyCR.takeFirst();
remSigCount -= 1;
arg = args.first().value<QList<quint32> >();
@@ -2240,6 +2246,15 @@
QTRY_COMPARE(spyCM.count(), modSigCount);
QTRY_COMPARE(spyCA.count(), addSigCount);
+ spyCOM1->clear();
+ spyCOR1->clear();
+ QSharedPointer<QContactObserver> c2Observer = m1->observeContact(c2.localId());
+ QSharedPointer<QContactObserver> c3Observer = m1->observeContact(c3.localId());
+ QScopedPointer<QSignalSpy> spyCOM2(new QSignalSpy(c2Observer.data(), SIGNAL(contactChanged())));
+ QScopedPointer<QSignalSpy> spyCOM3(new QSignalSpy(c3Observer.data(), SIGNAL(contactChanged())));
+ QScopedPointer<QSignalSpy> spyCOR2(new QSignalSpy(c2Observer.data(), SIGNAL(contactRemoved())));
+ QScopedPointer<QSignalSpy> spyCOR3(new QSignalSpy(c3Observer.data(), SIGNAL(contactRemoved())));
+
// verify multiple modifies works as advertised
saveContactName(&c2, nameDef, &nc2, "M.");
QVERIFY(m1->saveContact(&c2));
@@ -2251,6 +2266,9 @@
QVERIFY(m1->saveContact(&c3));
modSigCount += 1;
QTRY_COMPARE(spyCM.count(), modSigCount);
+ QTRY_COMPARE(spyCOM2->count(), 2);
+ QTRY_COMPARE(spyCOM3->count(), 1);
+ QCOMPARE(spyCOM1->count(), 0);
// verify multiple removes works as advertised
m1->removeContact(c3.id().localId());
@@ -2258,6 +2276,9 @@
m1->removeContact(c2.id().localId());
remSigCount += 1;
QTRY_COMPARE(spyCR.count(), remSigCount);
+ QTRY_COMPARE(spyCOR2->count(), 1);
+ QTRY_COMPARE(spyCOR3->count(), 1);
+ QCOMPARE(spyCOR1->count(), 0);
QVERIFY(!m1->removeContact(c.id().localId())); // not saved.
@@ -2284,6 +2305,16 @@
QTRY_WAIT( while(spyCA.size() > 0) {sigids += spyCA.takeFirst().at(0).value<QList<QContactLocalId> >(); }, sigids.contains(c.localId()) && sigids.contains(c2.localId()) && sigids.contains(c3.localId()));
QTRY_COMPARE(spyCM.count(), 0);
+
+ c1Observer = m1->observeContact(c.localId());
+ c2Observer = m1->observeContact(c2.localId());
+ c3Observer = m1->observeContact(c3.localId());
+ spyCOM1.reset(new QSignalSpy(c1Observer.data(), SIGNAL(contactChanged())));
+ spyCOM2.reset(new QSignalSpy(c2Observer.data(), SIGNAL(contactChanged())));
+ spyCOM3.reset(new QSignalSpy(c3Observer.data(), SIGNAL(contactChanged())));
+ spyCOR1.reset(new QSignalSpy(c1Observer.data(), SIGNAL(contactRemoved())));
+ spyCOR2.reset(new QSignalSpy(c2Observer.data(), SIGNAL(contactRemoved())));
+ spyCOR3.reset(new QSignalSpy(c3Observer.data(), SIGNAL(contactRemoved())));
QTRY_COMPARE(spyCR.count(), 0);
/* Batch modifies */
@@ -2300,6 +2331,9 @@
sigids.clear();
QTRY_WAIT( while(spyCM.size() > 0) {sigids += spyCM.takeFirst().at(0).value<QList<QContactLocalId> >(); }, sigids.contains(c.localId()) && sigids.contains(c2.localId()) && sigids.contains(c3.localId()));
+ QTRY_COMPARE(spyCOM1->count(), 1);
+ QTRY_COMPARE(spyCOM2->count(), 1);
+ QTRY_COMPARE(spyCOM3->count(), 1);
/* Batch removes */
batchRemove << c.id().localId() << c2.id().localId() << c3.id().localId();
@@ -2307,6 +2341,9 @@
sigids.clear();
QTRY_WAIT( while(spyCR.size() > 0) {sigids += spyCR.takeFirst().at(0).value<QList<QContactLocalId> >(); }, sigids.contains(c.localId()) && sigids.contains(c2.localId()) && sigids.contains(c3.localId()));
+ QTRY_COMPARE(spyCOR1->count(), 1);
+ QTRY_COMPARE(spyCOR2->count(), 1);
+ QTRY_COMPARE(spyCOR3->count(), 1);
QTRY_COMPARE(spyCA.count(), 0);
QTRY_COMPARE(spyCM.count(), 0);
--- tests/auto/qcontactmanagerdetails
+++ tests/auto/qcontactmanagerdetails
+(directory)
--- tests/auto/qcontactmanagerdetails/qcontactmanagerdetails.pro
+++ tests/auto/qcontactmanagerdetails/qcontactmanagerdetails.pro
+QT += testlib
+TEMPLATE=app
+TARGET=tst_qcontactmanagerdetails
+CONFIG+=testcase
+
+include(../../../common.pri)
+
+INCLUDEPATH += ../../../src/contacts \
+ ../../../src/contacts/details \
+ ../../../src/contacts/requests \
+ ../../../src/contacts/filters \
+ ../../../src/global
+INCLUDEPATH += ../
+
+CONFIG += mobility
+MOBILITY = contacts
+
+HEADERS += ../qcontactmanagerdataholder.h
+
+SOURCES += tst_qcontactmanagerdetails.cpp
+
+symbian: {
+ TARGET.CAPABILITY = ReadUserData \
+ WriteUserData
+
+ contains(S60_VERSION,3.1) {
+ DEFINES += SYMBIAN_BACKEND_S60_VERSION_31
+ LIBS += -lcntmodel
+ }
+ contains(S60_VERSION,3.2) {
+ DEFINES += SYMBIAN_BACKEND_S60_VERSION_32
+ LIBS += -lcntmodel
+ }
+ contains(S60_VERSION,5.0) {
+ DEFINES += SYMBIAN_BACKEND_S60_VERSION_50
+ LIBS += -lcntmodel
+ }
+}
--- tests/auto/qcontactmanagerdetails/tst_qcontactmanagerdetails.cpp
+++ tests/auto/qcontactmanagerdetails/tst_qcontactmanagerdetails.cpp
+/****************************************************************************
+**
+** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QDateTime>
+#include "qtcontacts.h"
+#include "qcontactmanagerdataholder.h"
+
+QTM_USE_NAMESPACE
+
+// to get QFETCH to work with the template expression...
+typedef QMap<QString,QString> tst_QContactManagerDetails_QStringMap;
+Q_DECLARE_METATYPE(tst_QContactManagerDetails_QStringMap)
+Q_DECLARE_METATYPE(QList<QContactLocalId>)
+
+
+class tst_QContactManagerDetails : public QObject
+{
+Q_OBJECT
+
+public:
+ tst_QContactManagerDetails();
+ virtual ~tst_QContactManagerDetails();
+
+private:
+ void addManagers();
+
+ template <typename T>
+ void removeDetail( QContact& contact )
+ {
+ T detail = contact.detail<T>();
+ contact.removeDetail( &detail );
+ }
+
+ bool saveAndLoadContact( QContactManager *cm, QContact &original, QContact &loaded );
+ void saveAndVerifyContact( QContactManager *cm, QContact &original );
+
+ QScopedPointer<QContactManagerDataHolder> managerDataHolder;
+
+private slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+ void testAddress();
+ void testAddress_data() {addManagers();}
+ void testAnniversary();
+ void testAnniversary_data() {addManagers();}
+ void testAvatar();
+ void testAvatar_data() {addManagers();}
+ void testBirthday();
+ void testBirthday_data() {addManagers();}
+ void testEmailAddress();
+ void testEmailAddress_data() {addManagers();}
+ void testName();
+ void testName_data() {addManagers();}
+ void testNickName();
+ void testNickName_data() {addManagers();}
+ void testOrganisation();
+ void testOrganisation_data() {addManagers();}
+ void testOnlineAccount();
+ void testOnlineAccount_data() {addManagers();}
+ void testPhoneNumber();
+ void testPhoneNumber_data() {addManagers();}
+ void testUrl();
+ void testUrl_data() {addManagers();}
+ void testRingtone();
+ void testRingtone_data() {addManagers();}
+
+private slots:
+
+};
+
+tst_QContactManagerDetails::tst_QContactManagerDetails()
+{
+}
+
+tst_QContactManagerDetails::~tst_QContactManagerDetails()
+{
+}
+
+void tst_QContactManagerDetails::addManagers()
+{
+ QTest::addColumn<QString>("uri");
+
+ QStringList managers = QContactManager::availableManagers();
+
+ /* Known one that will not pass */
+ managers.removeAll("invalid");
+ managers.removeAll("testdummy");
+ managers.removeAll("teststaticdummy");
+ managers.removeAll("maliciousplugin");
+
+ foreach(QString mgr, managers) {
+ QMap<QString, QString> params;
+ QTest::newRow(QString("mgr='%1'").arg(mgr).toLatin1().constData()) << QContactManager::buildUri(mgr, params);
+ }
+}
+
+void tst_QContactManagerDetails::initTestCase()
+{
+ managerDataHolder.reset(new QContactManagerDataHolder());
+}
+
+void tst_QContactManagerDetails::cleanupTestCase()
+{
+ managerDataHolder.reset(0);
+}
+
+bool tst_QContactManagerDetails::saveAndLoadContact( QContactManager *cm, QContact &original, QContact &loaded )
+{
+ // Save contact
+ if( cm->saveContact(&original) == false )
+ return false;
+
+ // Check the id
+ if( original.localId() == 0 )
+ return false;
+
+ // Load same contact from database
+ loaded = cm->contact( original.localId() );
+ if( cm->error() )
+ return false;
+
+ // Ignore some details which are not relevant and will mess
+ // up direct comparison between two contacts.
+ removeDetail<QContactDisplayLabel>(original);
+ removeDetail<QContactDisplayLabel>(loaded);
+ removeDetail<QContactGuid>(original);
+ removeDetail<QContactGuid>(loaded);
+ removeDetail<QContactTimestamp>(original);
+ removeDetail<QContactTimestamp>(loaded);
+
+ return true;
+}
+
+void tst_QContactManagerDetails::saveAndVerifyContact( QContactManager *cm, QContact &original )
+{
+ QContact loaded;
+ QVERIFY( saveAndLoadContact( cm, original, loaded ) );
+ if (original != loaded) {
+ qDebug() << "expected: " << original;
+ qDebug() << "loaded: " << loaded;
+ QCOMPARE( loaded.details().count(), original.details().count() );
+ QCOMPARE( loaded, original );
+ }
+}
+
+void tst_QContactManagerDetails::testAddress()
+{
+ QFETCH(QString, uri);
+ QScopedPointer<QContactManager> cm(QContactManager::fromUri(uri));
+
+ QContactDetailDefinition def = cm->detailDefinition(QContactAddress::DefinitionName);
+ if (def.isEmpty()
+ || !def.fields().contains(QContactAddress::FieldStreet)
+ || !def.fields().contains(QContactAddress::FieldLocality)
+ || !def.fields().contains(QContactAddress::FieldRegion)
+ || !def.fields().contains(QContactAddress::FieldPostcode)
+ || !def.fields().contains(QContactAddress::FieldCountry)
+ || !def.fields().contains(QContactAddress::FieldPostOfficeBox))
+ QSKIP("This backend does not support the required detail!", SkipSingle);
+
+ // general address
+ {
+ QContact c;
+
+ QContactAddress a;
+ a.setStreet("street");
+ a.setLocality("locality");
+ a.setRegion("region");
+ a.setPostcode("postcode");
+ a.setCountry("country");
+ a.setPostOfficeBox("POBox");
+ c.saveDetail( &a );
+
+ saveAndVerifyContact( cm.data(), c );
+ }
+
+ if (def.isUnique())
+ QSKIP("This backend does not support more than one of this detail", SkipSingle);
+
+ // general address *2
+ {
+ QContact c1;
+
+ QContactAddress a1;
+ a1.setStreet("street1");
+ a1.setLocality("locality1");
+ a1.setRegion("region1");
+ a1.setPostcode("postcode1");
+ a1.setCountry("country1");
+ a1.setPostOfficeBox("POBox1");
+ c1.saveDetail( &a1 );
+
+ QContactAddress a2;
+ a2.setStreet("street2");
+ a2.setLocality("locality2");
+ a2.setRegion("region2");
+ a2.setPostcode("postcode2");
+ a2.setCountry("country2");
+ a2.setPostOfficeBox("POBox2");
+ c1.saveDetail( &a2 );
+
+ QContact c2;
+ saveAndLoadContact( cm.data(), c1, c2 );
+
+ QList<QContactAddress> addresses = c2.details<QContactAddress>();
+ QVERIFY( addresses.count() == 2 );
+ QVERIFY( a1 == addresses[0] );
+ QVERIFY( a2 == addresses[1] );
+ }
+
+ if (!def.fields().contains(QContactDetail::FieldContext)) {
+ QSKIP("This backend does not support contexts", SkipSingle);
+ }
+
+ // general + home + work address
+ {
+ QContact c;
+
+ // General address
+ QContactAddress a1;
+ a1.setStreet("street1");
+ c.saveDetail( &a1 );
+
+ // home address
+ QContactAddress a2;
+ a2.setStreet("street2");
+ a2.setContexts( QContactDetail::ContextHome );
+ c.saveDetail( &a2 );
+
+ // work address
+ QContactAddress a3;
+ a3.setStreet("street3");
+ a3.setContexts( QContactDetail::ContextWork );
+ c.saveDetail( &a3 );
+
+ saveAndVerifyContact( cm.data(), c );
+ }
+}
+void tst_QContactManagerDetails::testAnniversary()
+{
+ QFETCH(QString, uri);
+ QScopedPointer<QContactManager> cm(QContactManager::fromUri(uri));
+
+ if (cm->detailDefinition(QContactAnniversary::DefinitionName).isEmpty())
+ QSKIP("This backend does not support the required detail!", SkipSingle);
+
+ QContact c;
+
+ QContactAnniversary a;
+ a.setOriginalDate( QDate(2009,9,9) );
+ c.saveDetail( &a );
+
+ saveAndVerifyContact( cm.data(), c );
+}
+
+void tst_QContactManagerDetails::testAvatar()
+{
+ QFETCH(QString, uri);
+ QScopedPointer<QContactManager> cm(QContactManager::fromUri(uri));
+
+ if (cm->detailDefinition(QContactAvatar::DefinitionName).isEmpty())
+ QSKIP("This backend does not support the required detail!", SkipSingle);
+
+ QContact c;
+
+ QContactAvatar a;
+ a.setImageUrl( QUrl::fromLocalFile("c:\\foo\\bar.jpeg") );
+ c.saveDetail( &a );
+
+ saveAndVerifyContact( cm.data(), c );
+}
+
+void tst_QContactManagerDetails::testBirthday()
+{
+ QFETCH(QString, uri);
+ QScopedPointer<QContactManager> cm(QContactManager::fromUri(uri));
+
+ if (cm->detailDefinition(QContactBirthday::DefinitionName).isEmpty())
+ QSKIP("This backend does not support the required detail!", SkipSingle);
+
+ QContact c;
+
+ QContactBirthday b;
+ b.setDate( QDate(2001,1,1) );
+ c.saveDetail( &b );
+
+ saveAndVerifyContact( cm.data(), c );
+}
+
+void tst_QContactManagerDetails::testEmailAddress()
+{
+ QFETCH(QString, uri);
+ QScopedPointer<QContactManager> cm(QContactManager::fromUri(uri));
+
+ if (cm->detailDefinition(QContactEmailAddress::DefinitionName).isEmpty())
+ QSKIP("This backend does not support the required detail!", SkipSingle);
+
+ QContact c;
+
+ QContactEmailAddress e;
+ e.setEmailAddress( "foo at bar.com" );
+ c.saveDetail( &e );
+
+ saveAndVerifyContact( cm.data(), c );
+}
+
+void tst_QContactManagerDetails::testName()
+{
+ QFETCH(QString, uri);
+ QScopedPointer<QContactManager> cm(QContactManager::fromUri(uri));
+ QContact c;
+
+ QContactDetailDefinition def = cm->detailDefinition(QContactName::DefinitionName);
+ if (def.isEmpty()
+ || !def.fields().contains(QContactName::FieldPrefix)
+ || !def.fields().contains(QContactName::FieldFirstName)
+ || !def.fields().contains(QContactName::FieldMiddleName)
+ || !def.fields().contains(QContactName::FieldLastName)
+ || !def.fields().contains(QContactName::FieldSuffix))
+ QSKIP("This backend does not support the required detail!", SkipSingle);
+
+ QContactName n;
+ n.setPrefix( "prefix" );
+ n.setFirstName( "first" );
+ n.setMiddleName( "middle" );
+ n.setLastName( "last" );
+ n.setSuffix( "suffix" );
+ c.saveDetail( &n );
+
+ saveAndVerifyContact( cm.data(), c );
+}
+
+void tst_QContactManagerDetails::testNickName()
+{
+ QFETCH(QString, uri);
+ QScopedPointer<QContactManager> cm(QContactManager::fromUri(uri));
+
+ if (cm->detailDefinition(QContactNickname::DefinitionName).isEmpty())
+ QSKIP("This backend does not support the required detail!", SkipSingle);
+
+ QContact c;
+
+ QContactNickname n1;
+ n1.setNickname("nickname1");
+ c.saveDetail( &n1 );
+
+ saveAndVerifyContact( cm.data(), c );
+
+ QContactNickname n2;
+ n2.setNickname("nickname2");
+ c.saveDetail( &n2 );
+
+ saveAndVerifyContact( cm.data(), c );
+}
+
+void tst_QContactManagerDetails::testOrganisation()
+{
+ QFETCH(QString, uri);
+ QScopedPointer<QContactManager> cm(QContactManager::fromUri(uri));
+
+ if (cm->detailDefinition(QContactOrganization::DefinitionName).isEmpty())
+ QSKIP("This backend does not support the required detail!", SkipSingle);
+
+ QContact c;
+
+ QContactOrganization o;
+ o.setName( "Foreign legion" );
+ o.setTitle( "Bicycle mechanic" );
+ c.saveDetail( &o );
+
+ saveAndVerifyContact( cm.data(), c );
+}
+
+void tst_QContactManagerDetails::testOnlineAccount()
+{
+ QFETCH(QString, uri);
+ QScopedPointer<QContactManager> cm(QContactManager::fromUri(uri));
+
+ QContactDetailDefinition def = cm->detailDefinition(QContactOnlineAccount::DefinitionName);
+ if (def.isEmpty())
+ QSKIP("This backend does not support the required detail!", SkipSingle);
+
+ QContact c;
+
+ QContactOnlineAccount o;
+ o.setAccountUri( "john at example.com" );
+
+ if (def.fields().contains(QContactOnlineAccount::FieldProtocol))
+ o.setProtocol(QContactOnlineAccount::ProtocolJabber);
+ else
+ qDebug() << "Manager doesn't support Protocol";
+
+ c.saveDetail( &o );
+
+ saveAndVerifyContact( cm.data(), c );
+}
+
+void tst_QContactManagerDetails::testPhoneNumber()
+{
+ QFETCH(QString, uri);
+ QScopedPointer<QContactManager> cm(QContactManager::fromUri(uri));
+
+ QContactDetailDefinition def = cm->detailDefinition(QContactPhoneNumber::DefinitionName);
+
+ // general landline number
+ {
+ QContact c;
+
+ // General landline number
+ QContactPhoneNumber n2;
+ n2.setNumber( "2" );
+ n2.setSubTypes( QContactPhoneNumber::SubTypeLandline );
+ c.saveDetail( &n2 );
+
+ saveAndVerifyContact( cm.data(), c );
+ }
+
+ if (def.isUnique()
+ || !def.fields().contains(QContactPhoneNumber::FieldSubTypes)
+ || !def.fields().contains(QContactDetail::FieldContext))
+ QSKIP("This backend does not support multiple, subtyped or contexted phone numbers", SkipSingle);
+
+ // home mobile number + work landline number
+ {
+ QContact c;
+
+ // home mobile number
+ QContactPhoneNumber n1;
+ n1.setNumber( "1" );
+ n1.setSubTypes( QContactPhoneNumber::SubTypeMobile );
+ n1.setContexts( QContactDetail::ContextHome );
+ c.saveDetail( &n1 );
+
+ // work landline number
+ QContactPhoneNumber n2;
+ n2.setNumber( "2" );
+ n2.setSubTypes( QContactPhoneNumber::SubTypeLandline );
+ n2.setContexts( QContactDetail::ContextWork );
+ c.saveDetail( &n2 );
+
+ saveAndVerifyContact( cm.data(), c );
+ }
+}
+
+void tst_QContactManagerDetails::testUrl()
+{
+ QFETCH(QString, uri);
+ QScopedPointer<QContactManager> cm(QContactManager::fromUri(uri));
+
+ QContactDetailDefinition def = cm->detailDefinition(QContactUrl::DefinitionName);
+
+ if (cm->detailDefinition(QContactUrl::DefinitionName).isEmpty())
+ QSKIP("This backend does not support the required detail!", SkipSingle);
+
+ QContact c;
+
+ QContactUrl u;
+ u.setUrl("http://failblog.org");
+ if (def.fields().value(QContactUrl::FieldSubType).allowableValues()
+ .contains(QLatin1String(QContactUrl::SubTypeHomePage))) {
+ u.setSubType(QContactUrl::SubTypeHomePage);
+ }
+ c.saveDetail( &u );
+
+ saveAndVerifyContact( cm.data(), c );
+}
+
+void tst_QContactManagerDetails::testRingtone()
+{
+ QFETCH(QString, uri);
+ QScopedPointer<QContactManager> cm(QContactManager::fromUri(uri));
+
+ if (cm->detailDefinition(QContactRingtone::DefinitionName).isEmpty())
+ QSKIP("This backend does not support the required detail!", SkipSingle);
+
+#if defined(Q_OS_SYMBIAN)
+ QUrl rtUrl(QUrl::fromLocalFile("C:\\data\\Sounds\\sample1.wav"));
+#else
+ QUrl rtUrl(QUrl::fromLocalFile("/home/user/sample.wav"));
+#endif
+
+ QContact c;
+ QContactRingtone rt;
+ rt.setAudioRingtoneUrl(rtUrl);
+ c.saveDetail(&rt);
+
+ saveAndVerifyContact( cm.data(), c );
+}
+QTEST_MAIN(tst_QContactManagerDetails)
+#include "tst_qcontactmanagerdetails.moc"
--- tests/auto/qcontactmanagerfiltering/unittest/tst_qcontactmanagerfiltering.cpp
+++ tests/auto/qcontactmanagerfiltering/unittest/tst_qcontactmanagerfiltering.cpp
@@ -100,7 +100,7 @@
QPair<QString, QString> definitionAndField(QContactManager *cm, QVariant::Type type, bool *nativelyFilterable);
QList<QContactLocalId> prepareModel(QContactManager* cm); // add the standard contacts
- QString convertIds(QList<QContactLocalId> allIds, QList<QContactLocalId> ids); // convert back to "abcd"
+ QString convertIds(QList<QContactLocalId> allIds, QList<QContactLocalId> ids, QChar minimumContact = 'a', QChar maximumContact = 'z'); // convert back to "abcd"
QContact createContact(QContactManager* cm, QString type, QString name);
QMap<QContactManager*, QMap<QString, QPair<QString, QString> > > defAndFieldNamesForTypePerManager;
@@ -147,6 +147,9 @@
void idListFiltering();
void idListFiltering_data();
+ void convenienceFiltering();
+ void convenienceFiltering_data();
+
void sorting(); // XXX should take all managers
void sorting_data();
@@ -271,13 +274,17 @@
}
}
-QString tst_QContactManagerFiltering::convertIds(QList<QContactLocalId> allIds, QList<QContactLocalId> ids)
+QString tst_QContactManagerFiltering::convertIds(QList<QContactLocalId> allIds, QList<QContactLocalId> ids, QChar minimumContact, QChar maximumContact)
{
QString ret;
/* Expected is of the form "abcd".. it's possible that there are some extra contacts */
for (int i = 0; i < ids.size(); i++) {
- if (allIds.indexOf(ids.at(i)) >= 0)
- ret += ('a' + allIds.indexOf(ids.at(i)));
+ if (allIds.indexOf(ids.at(i)) >= 0) {
+ QChar curr = ('a' + allIds.indexOf(ids.at(i)));
+ if (curr >= minimumContact && curr <= maximumContact) {
+ ret += curr;
+ }
+ }
}
return ret;
@@ -434,7 +441,7 @@
ids = cm->contactIds(df);
- QString output = convertIds(contacts, ids);
+ QString output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
QEXPECT_FAIL("integer == 20", "Not sure if this should pass or fail", Continue);
QCOMPARE_UNSORTED(output, expected);
}
@@ -551,7 +558,7 @@
ids = cm->contactIds(df);
- QString output = convertIds(contacts, ids);
+ QString output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
//QSKIP("TODO: fix default implementation of phone number matching!", SkipSingle);
QCOMPARE_UNSORTED(output, expected);
}
@@ -819,7 +826,7 @@
ids = cm->contactIds(df);
- QString output = convertIds(contacts, ids);
+ QString output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
QCOMPARE_UNSORTED(output, expected);
}
@@ -984,7 +991,7 @@
}
ids = cm->contactIds(drf);
- QString output = convertIds(contacts, ids);
+ QString output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
QCOMPARE_UNSORTED(output, expected);
}
@@ -1423,7 +1430,7 @@
ids = cm->contactIds(resultFilter);
- QString output = convertIds(contacts, ids);
+ QString output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
QCOMPARE_UNSORTED(output, expected);
delete x;
@@ -1866,7 +1873,7 @@
ids = cm->contactIds(resultFilter);
- QString output = convertIds(contacts, ids);
+ QString output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
QCOMPARE_UNSORTED(output, expected);
delete x;
@@ -2016,7 +2023,7 @@
contacts.append(contactA.localId());
contacts.append(contactB.localId());
QList<QContactLocalId> ids = cm->contactIds(crf);
- QString output = convertIds(contacts, ids);
+ QString output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
// 5. Remove the created relationship and contacts
if(succeeded) {
@@ -2138,7 +2145,7 @@
s.setCaseSensitivity(casesensitivity);
ids = cm->contactIds(s);
- QString output = convertIds(contacts, ids);
+ QString output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
// It's possible to get some contacts back in an arbitrary order (since we single sort)
if (unstable.length() > 1) {
@@ -2183,7 +2190,7 @@
ids = cm->contactIds(presenceName, s);
- output = convertIds(contacts, ids);
+ output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
// It's possible to get some contacts back in an arbitrary order (since we single sort)
if (unstable.length() > 1) {
@@ -2352,7 +2359,7 @@
sortOrders.append(ss);
QList<QContactLocalId> ids = cm->contactIds(sortOrders);
- QString output = convertIds(contacts, ids);
+ QString output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
// Remove the display label tests
output.remove('h');
@@ -2485,7 +2492,7 @@
qDebug() << " actionName =" << actionName;
- QString output = convertIds(contacts, ids);
+ QString output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
QCOMPARE_UNSORTED(output, expected);
}
}
@@ -2548,10 +2555,190 @@
/* Retrieve contacts matching the filter, and compare (unsorted) output */
ids = cm->contactIds(idf);
- QString output = convertIds(contacts, ids);
+ QString output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
QCOMPARE_UNSORTED(output, expected);
}
+void tst_QContactManagerFiltering::convenienceFiltering_data()
+{
+ QTest::addColumn<QContactManager *>("cm");
+ QTest::addColumn<QString>("addressSubString");
+ QTest::addColumn<bool>("addressEnabled");
+ QTest::addColumn<QString>("emailAddressSubString");
+ QTest::addColumn<bool>("emailEnabled");
+ QTest::addColumn<QString>("phoneSubString");
+ QTest::addColumn<bool>("phoneEnabled");
+ QTest::addColumn<QString>("displayLabelSubString");
+ QTest::addColumn<bool>("displayLabelEnabled");
+ QTest::addColumn<QString>("nameSubString");
+ QTest::addColumn<bool>("nameEnabled");
+ QTest::addColumn<bool>("favoriteEnabled");
+ QTest::addColumn<QString>("tagSubString");
+ QTest::addColumn<bool>("tagEnabled");
+ QTest::addColumn<QString>("expected");
+
+ QString es; // empty string
+
+ for (int i = 0; i < managers.size(); i++) {
+ QContactManager *manager = managers.at(i);
+ QMap<QString, QContactDetailDefinition> allDefs = manager->detailDefinitions();
+ if (allDefs.contains(QContactAddress::DefinitionName)) {
+ newMRow("address matching only", manager) << manager
+ << "streetstring" << true
+ << es << false
+ << es << false
+ << es << false
+ << es << false
+ << false // Favorite has no substring associated.
+ << es << false
+ << "l";
+ }
+ if (allDefs.contains(QContactEmailAddress::DefinitionName)) {
+ newMRow("emailAddress matching only", manager) << manager
+ << es << false
+ << "@test.com" << true
+ << es << false
+ << es << false
+ << es << false
+ << false
+ << es << false
+ << "m";
+ }
+ if (allDefs.contains(QContactPhoneNumber::DefinitionName)) {
+ newMRow("phone matching only", manager) << manager
+ << es << false
+ << es << false
+ << "12345" << true
+ << es << false
+ << es << false
+ << false
+ << es << false
+ << "n";
+ }
+ if (allDefs.contains(QContactDisplayLabel::DefinitionName)) {
+ newMRow("displayLabel matching only", manager) << manager
+ << es << false
+ << es << false
+ << es << false
+ << "Freddy" << true
+ << es << false
+ << false
+ << es << false
+ << "o";
+ }
+ if (allDefs.contains(QContactName::DefinitionName)) {
+ newMRow("name matching only", manager) << manager
+ << es << false
+ << es << false
+ << es << false
+ << es << false
+ << "Frederic" << true
+ << false
+ << es << false
+ << "p";
+ }
+ if (allDefs.contains(QContactFavorite::DefinitionName)) {
+ newMRow("favorite matching only", manager) << manager
+ << es << false
+ << es << false
+ << es << false
+ << es << false
+ << es << false
+ << true
+ << es << false
+ << "q";
+ }
+ if (allDefs.contains(QContactTag::DefinitionName)) {
+ newMRow("tag matching only", manager) << manager
+ << es << false
+ << es << false
+ << es << false
+ << es << false
+ << es << false
+ << false
+ << "Football" << true
+ << "r";
+ }
+ if (allDefs.contains(QContactAddress::DefinitionName) &&
+ allDefs.contains(QContactPhoneNumber::DefinitionName)) {
+ newMRow("address or phone matching", manager) << manager
+ << "streetstring" << true
+ << es << false
+ << "12345" << true
+ << es << false
+ << es << false
+ << false
+ << es << false
+ << "ln";
+ }
+ if (allDefs.contains(QContactFavorite::DefinitionName)
+ && allDefs.contains(QContactTag::DefinitionName)) {
+ newMRow("favorite or tag matching", manager) << manager
+ << es << false
+ << es << false
+ << es << false
+ << es << false
+ << es << false
+ << true
+ << "Football" << true
+ << "qr";
+ }
+ }
+}
+
+void tst_QContactManagerFiltering::convenienceFiltering()
+{
+ QFETCH(QContactManager*, cm);
+ QFETCH(QString, addressSubString);
+ QFETCH(bool, addressEnabled);
+ QFETCH(QString, emailAddressSubString);
+ QFETCH(bool, emailEnabled);
+ QFETCH(QString, phoneSubString);
+ QFETCH(bool, phoneEnabled);
+ QFETCH(QString, displayLabelSubString);
+ QFETCH(bool, displayLabelEnabled);
+ QFETCH(QString, nameSubString);
+ QFETCH(bool, nameEnabled);
+ QFETCH(bool, favoriteEnabled);
+ QFETCH(QString, tagSubString);
+ QFETCH(bool, tagEnabled);
+ QFETCH(QString, expected);
+
+ QContactFilter af = QContactAddress::match(addressSubString);
+ QContactFilter ef = QContactEmailAddress::match(emailAddressSubString);
+ QContactFilter pf = QContactPhoneNumber::match(phoneSubString);
+ QContactFilter df = QContactDisplayLabel::match(displayLabelSubString);
+ QContactFilter nf = QContactName::match(nameSubString);
+ QContactFilter ff = QContactFavorite::match();
+ QContactFilter tf = QContactTag::match(tagSubString);
+
+ QList<QContactFilter> convenienceFilters;
+ if (addressEnabled) convenienceFilters << af;
+ if (emailEnabled) convenienceFilters << ef;
+ if (phoneEnabled) convenienceFilters << pf;
+ if (displayLabelEnabled) convenienceFilters << df;
+ if (nameEnabled) convenienceFilters << nf;
+ if (favoriteEnabled) convenienceFilters << ff;
+ if (tagEnabled) convenienceFilters << tf;
+
+ QContactFilter finalFilter;
+ finalFilter = convenienceFilters.at(0);
+ if (convenienceFilters.size() > 1) {
+ for (int i = 1; i < convenienceFilters.size(); ++i) {
+ // if more than one filter, we union them.
+ finalFilter = (finalFilter | convenienceFilters.at(i));
+ }
+ }
+
+ /* Retrieve contacts matching the filter, and ensure that the results are expected */
+ QList<QContactLocalId> ids = cm->contactIds(finalFilter);
+
+ // build a string containing letters corresponding to the ids we retrieved.
+ QList<QContactLocalId> contacts = contactsAddedToManagers.values(cm);
+ QString resultString = convertIds(contacts, ids, 'l', 'r'); // just the convenience filtering contacts (L->R)
+ QCOMPARE(resultString, expected);
+}
+
void tst_QContactManagerFiltering::invalidFiltering_data()
{
QTest::addColumn<QContactManager*>("cm");
@@ -2597,17 +2784,17 @@
QContactFilter f; // default = permissive
QList<QContactLocalId> ids = cm->contactIds(f);
QVERIFY(ids.count() == contacts.size());
- QString output = convertIds(contacts, ids);
- QString expected = convertIds(contacts, contacts); // :)
+ QString output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
+ QString expected = convertIds(contacts, contacts, 'a', 'k'); // :)
QCOMPARE_UNSORTED(output, expected);
// Try unions/intersections of defaults
ids = cm->contactIds(f | f);
- output = convertIds(contacts, ids);
+ output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
QCOMPARE_UNSORTED(output, expected);
ids = cm->contactIds(f & f);
- output = convertIds(contacts, ids);
+ output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
QCOMPARE_UNSORTED(output, expected);
}
@@ -2696,7 +2883,7 @@
ids = cm->contactIds(clf);
- QString output = convertIds(contacts, ids);
+ QString output = convertIds(contacts, ids, 'a', 'k'); // don't include the convenience filtering contacts
QCOMPARE(output, expected); // unsorted? or sorted?
} else {
QSKIP("Changelogs not supported by this manager.", SkipSingle);
@@ -2974,7 +3161,7 @@
defAndFieldNames.second = QString();
/* Add some contacts */
- QContact a, b, c, d;
+ QContact contactA, contactB, contactC, contactD;
QContactName name;
QContactPhoneNumber number;
QContactDetail string(definitionDetails.value("String").first);
@@ -3010,24 +3197,24 @@
date.setValue(definitionDetails.value("Date").second, QDate(1988, 1, 26));
time.setValue(definitionDetails.value("Time").second, QTime(16,52,23,0));
- a.saveDetail(&name);
- a.saveDetail(&nick);
- a.saveDetail(&emailAddr);
- a.saveDetail(&number);
+ contactA.saveDetail(&name);
+ contactA.saveDetail(&nick);
+ contactA.saveDetail(&emailAddr);
+ contactA.saveDetail(&number);
if (!definitionDetails.value("String").first.isEmpty() && !definitionDetails.value("String").second.isEmpty())
- a.saveDetail(&string);
+ contactA.saveDetail(&string);
if (!definitionDetails.value("Integer").first.isEmpty() && !definitionDetails.value("Integer").second.isEmpty())
- a.saveDetail(&integer);
+ contactA.saveDetail(&integer);
if (!definitionDetails.value("DateTime").first.isEmpty() && !definitionDetails.value("DateTime").second.isEmpty())
- a.saveDetail(&datetime);
+ contactA.saveDetail(&datetime);
if (!definitionDetails.value("Bool").first.isEmpty() && !definitionDetails.value("Bool").second.isEmpty())
- a.saveDetail(&boool);
+ contactA.saveDetail(&boool);
if (!definitionDetails.value("ULongLong").first.isEmpty() && !definitionDetails.value("ULongLong").second.isEmpty())
- a.saveDetail(&ullong);
+ contactA.saveDetail(&ullong);
if (!definitionDetails.value("Date").first.isEmpty() && !definitionDetails.value("Date").second.isEmpty())
- a.saveDetail(&date);
+ contactA.saveDetail(&date);
if (!definitionDetails.value("Time").first.isEmpty() && !definitionDetails.value("Time").second.isEmpty())
- a.saveDetail(&time);
+ contactA.saveDetail(&time);
name = QContactName();
name.setFirstName("Bob");
@@ -3044,27 +3231,27 @@
time.setValue(definitionDetails.value("Time").second, QTime(15,52,23,0));
charr.setValue(definitionDetails.value("Char").second, QVariant(QChar('b')));
- b.saveDetail(&name);
- b.saveDetail(&nick);
- b.saveDetail(&number);
+ contactB.saveDetail(&name);
+ contactB.saveDetail(&nick);
+ contactB.saveDetail(&number);
if (!definitionDetails.value("String").first.isEmpty() && !definitionDetails.value("String").second.isEmpty())
- b.saveDetail(&string);
+ contactB.saveDetail(&string);
if (!definitionDetails.value("Integer").first.isEmpty() && !definitionDetails.value("Integer").second.isEmpty())
- b.saveDetail(&integer);
+ contactB.saveDetail(&integer);
if (!definitionDetails.value("Double").first.isEmpty() && !definitionDetails.value("Double").second.isEmpty())
- b.saveDetail(&dubble);
+ contactB.saveDetail(&dubble);
if (!definitionDetails.value("Bool").first.isEmpty() && !definitionDetails.value("Bool").second.isEmpty())
- b.saveDetail(&boool);
+ contactB.saveDetail(&boool);
if (!definitionDetails.value("ULongLong").first.isEmpty() && !definitionDetails.value("ULongLong").second.isEmpty())
- b.saveDetail(&ullong);
+ contactB.saveDetail(&ullong);
if (!definitionDetails.value("UInt").first.isEmpty() && !definitionDetails.value("UInt").second.isEmpty())
- b.saveDetail(&uintt);
+ contactB.saveDetail(&uintt);
if (!definitionDetails.value("Date").first.isEmpty() && !definitionDetails.value("Date").second.isEmpty())
- b.saveDetail(&date);
+ contactB.saveDetail(&date);
if (!definitionDetails.value("Time").first.isEmpty() && !definitionDetails.value("Time").second.isEmpty())
- b.saveDetail(&time);
+ contactB.saveDetail(&time);
if (!definitionDetails.value("Char").first.isEmpty() && !definitionDetails.value("Char").second.isEmpty())
- b.saveDetail(&charr);
+ contactB.saveDetail(&charr);
name.setFirstName("Boris");
name.setLastName("Aaronsun");
@@ -3074,23 +3261,23 @@
llong.setValue(definitionDetails.value("LongLong").second, (qlonglong)8000000000LL); // 8B
charr.setValue(definitionDetails.value("Char").second, QVariant(QChar('c')));
- c.saveDetail(&name);
+ contactC.saveDetail(&name);
if (!definitionDetails.value("String").first.isEmpty() && !definitionDetails.value("String").second.isEmpty())
- c.saveDetail(&string);
+ contactC.saveDetail(&string);
if (!definitionDetails.value("Integer").first.isEmpty() && !definitionDetails.value("Integer").second.isEmpty())
- c.saveDetail(&integer);
+ contactC.saveDetail(&integer);
if (!definitionDetails.value("DateTime").first.isEmpty() && !definitionDetails.value("DateTime").second.isEmpty())
- c.saveDetail(&datetime);
+ contactC.saveDetail(&datetime);
if (!definitionDetails.value("Double").first.isEmpty() && !definitionDetails.value("Double").second.isEmpty())
- c.saveDetail(&dubble);
+ contactC.saveDetail(&dubble);
if (!definitionDetails.value("Bool").first.isEmpty() && !definitionDetails.value("Bool").second.isEmpty())
- c.saveDetail(&boool);
+ contactC.saveDetail(&boool);
if (!definitionDetails.value("LongLong").first.isEmpty() && !definitionDetails.value("LongLong").second.isEmpty())
- c.saveDetail(&llong);
+ contactC.saveDetail(&llong);
if (!definitionDetails.value("ULongLong").first.isEmpty() && !definitionDetails.value("ULongLong").second.isEmpty())
- c.saveDetail(&ullong);
+ contactC.saveDetail(&ullong);
if (!definitionDetails.value("Char").first.isEmpty() && !definitionDetails.value("Char").second.isEmpty())
- c.saveDetail(&charr);
+ contactC.saveDetail(&charr);
name.setFirstName("Dennis");
name.setLastName("FitzMacintyre");
@@ -3100,155 +3287,417 @@
uintt.setValue(definitionDetails.value("UInt").second, 3000000000u); // 3B
date.setValue(definitionDetails.value("Date").second, QDate(2770, 10, 1));
- d.saveDetail(&name);
+ contactD.saveDetail(&name);
if (!definitionDetails.value("String").first.isEmpty() && !definitionDetails.value("String").second.isEmpty())
- d.saveDetail(&string);
+ contactD.saveDetail(&string);
if (!definitionDetails.value("Double").first.isEmpty() && !definitionDetails.value("Double").second.isEmpty())
- d.saveDetail(&dubble);
+ contactD.saveDetail(&dubble);
if (!definitionDetails.value("LongLong").first.isEmpty() && !definitionDetails.value("LongLong").second.isEmpty())
- d.saveDetail(&llong);
+ contactD.saveDetail(&llong);
if (!definitionDetails.value("UInt").first.isEmpty() && !definitionDetails.value("UInt").second.isEmpty())
- d.saveDetail(&uintt);
+ contactD.saveDetail(&uintt);
if (!definitionDetails.value("Date").first.isEmpty() && !definitionDetails.value("Date").second.isEmpty())
- d.saveDetail(&date);
+ contactD.saveDetail(&date);
qDebug() << "Generating contacts with different timestamps, please wait..";
int originalContactCount = cm->contactIds().count();
- bool successfulSave = cm->saveContact(&a);
+ bool successfulSave = cm->saveContact(&contactA);
Q_ASSERT(successfulSave);
QTest::qSleep(napTime);
- successfulSave = cm->saveContact(&b);
+ successfulSave = cm->saveContact(&contactB);
Q_ASSERT(successfulSave);
QTest::qSleep(napTime);
- successfulSave = cm->saveContact(&c);
+ successfulSave = cm->saveContact(&contactC);
Q_ASSERT(successfulSave);
QTest::qSleep(napTime);
- successfulSave = cm->saveContact(&d);
+ successfulSave = cm->saveContact(&contactD);
Q_ASSERT(successfulSave);
QTest::qSleep(napTime);
/* Now add some contacts specifically for multisorting */
- QContact e,f,g;
+ QContact contactE,contactF,contactG;
QContactName n;
n.setFirstName("John");
n.setLastName("Smithee");
string.setValue(definitionDetails.value("String").second, "");
if (!definitionDetails.value("String").first.isEmpty() && !definitionDetails.value("String").second.isEmpty())
- e.saveDetail(&string);
- e.saveDetail(&n);
+ contactE.saveDetail(&string);
+ contactE.saveDetail(&n);
n = QContactName();
n.setFirstName("John");
n.setLastName("Smithey");
- f.saveDetail(&n);
+ contactF.saveDetail(&n);
n = QContactName();
n.setFirstName("John");
n.setLastName("Smithy");
string.setValue(definitionDetails.value("String").second, "zzz");
if (!definitionDetails.value("String").first.isEmpty() && !definitionDetails.value("String").second.isEmpty())
- g.saveDetail(&string);
- g.saveDetail(&n);
- successfulSave = cm->saveContact(&e);
+ contactG.saveDetail(&string);
+ contactG.saveDetail(&n);
+ successfulSave = cm->saveContact(&contactE);
Q_ASSERT(successfulSave);
- successfulSave = cm->saveContact(&f);
+ successfulSave = cm->saveContact(&contactF);
Q_ASSERT(successfulSave);
- successfulSave = cm->saveContact(&g);
+ successfulSave = cm->saveContact(&contactG);
Q_ASSERT(successfulSave);
originalContactCount += 7;
Q_ASSERT(cm->contactIds().count() == originalContactCount);
/* Now some for the locale aware sorting */
- QContact h, i, j, k;
+ QContact contactH, contactI, contactJ, contactK;
QContactName n2;
n2.setFirstName("xander");
n2.setCustomLabel("xander");
- h.saveDetail(&n2);
+ contactH.saveDetail(&n2);
n2.setFirstName("Xander");
n2.setCustomLabel("Xander");
- i.saveDetail(&n2);
+ contactI.saveDetail(&n2);
n2.setFirstName("xAnder");
n2.setCustomLabel("xAnder");
- j.saveDetail(&n2);
+ contactJ.saveDetail(&n2);
n2.setFirstName("Yarrow");
n2.setCustomLabel("Yarrow");
- k.saveDetail(&n2);
+ contactK.saveDetail(&n2);
// XXX add äaut; or âum; etc to test those sort orders
- h = cm->compatibleContact(h);
- i = cm->compatibleContact(i);
- j = cm->compatibleContact(j);
- k = cm->compatibleContact(k);
- Q_ASSERT(cm->saveContact(&h));
- Q_ASSERT(cm->saveContact(&i));
- Q_ASSERT(cm->saveContact(&j));
- Q_ASSERT(cm->saveContact(&k));
+ contactH = cm->compatibleContact(contactH);
+ contactI = cm->compatibleContact(contactI);
+ contactJ = cm->compatibleContact(contactJ);
+ contactK = cm->compatibleContact(contactK);
+ Q_ASSERT(cm->saveContact(&contactH));
+ Q_ASSERT(cm->saveContact(&contactI));
+ Q_ASSERT(cm->saveContact(&contactJ));
+ Q_ASSERT(cm->saveContact(&contactK));
/* Ensure the last modified times are different */
QTest::qSleep(napTime);
- QContactName modifiedName = c.detail(QContactName::DefinitionName);
+ QContactName modifiedName = contactC.detail(QContactName::DefinitionName);
modifiedName.setCustomLabel("Clarence");
- c.saveDetail(&modifiedName);
- cm->saveContact(&c);
+ contactC.saveDetail(&modifiedName);
+ cm->saveContact(&contactC);
QTest::qSleep(napTime);
- modifiedName = b.detail(QContactName::DefinitionName);
+ modifiedName = contactB.detail(QContactName::DefinitionName);
modifiedName.setCustomLabel("Boris");
- b.saveDetail(&modifiedName);
- cm->saveContact(&b);
+ contactB.saveDetail(&modifiedName);
+ cm->saveContact(&contactB);
QTest::qSleep(napTime);
- modifiedName = a.detail(QContactName::DefinitionName);
+ modifiedName = contactA.detail(QContactName::DefinitionName);
modifiedName.setCustomLabel("Albert");
- a.saveDetail(&modifiedName);
- cm->saveContact(&a);
+ contactA.saveDetail(&modifiedName);
+ cm->saveContact(&contactA);
QTest::qSleep(napTime);
+ /* Now some for convenience filtering */
+ QMap<QString, QContactDetailDefinition> allDefs = cm->detailDefinitions();
+ // Contact L ----------------------------------------
+ QContact contactL;
+ if (allDefs.contains(QContactAddress::DefinitionName)) {
+ QContactAddress ladr;
+ ladr.setStreet("streetstring road"); // Contact L matches streetstring.
+ ladr.setLocality("testplace");
+ ladr.setRegion("somewhere");
+ contactL.saveDetail(&ladr);
+ }
+ if (allDefs.contains(QContactEmailAddress::DefinitionName)) {
+ QContactEmailAddress led;
+ led.setEmailAddress("frad at test.domain");
+ contactL.saveDetail(&led);
+ }
+ if (allDefs.contains(QContactPhoneNumber::DefinitionName)) {
+ QContactPhoneNumber lp;
+ lp.setNumber("11111");
+ contactL.saveDetail(&lp);
+ }
+ if (allDefs.contains(QContactName::DefinitionName)) {
+ QContactName ln;
+ ln.setFirstName("Fradarick");
+ ln.setLastName("Gumboots");
+ contactL.saveDetail(&ln);
+ }
+ if (allDefs.contains(QContactTag::DefinitionName)) {
+ QContactTag lt;
+ lt.setTag("Soccer");
+ contactL.saveDetail(<);
+ }
+ // Contact M ----------------------------------------
+ QContact contactM;
+ if (allDefs.contains(QContactAddress::DefinitionName)) {
+ QContactAddress madr;
+ madr.setStreet("some road");
+ madr.setLocality("testplace");
+ madr.setRegion("somewhere");
+ contactM.saveDetail(&madr);
+ }
+ if (allDefs.contains(QContactEmailAddress::DefinitionName)) {
+ QContactEmailAddress med;
+ med.setEmailAddress("frbd at test.com"); // Contact M matches @test.com
+ contactM.saveDetail(&med);
+ }
+ if (allDefs.contains(QContactPhoneNumber::DefinitionName)) {
+ QContactPhoneNumber mp;
+ mp.setNumber("22222");
+ contactM.saveDetail(&mp);
+ }
+ if (allDefs.contains(QContactName::DefinitionName)) {
+ QContactName mn;
+ mn.setFirstName("Frbdbrick");
+ mn.setLastName("Gumboots");
+ contactM.saveDetail(&mn);
+ }
+ if (allDefs.contains(QContactTag::DefinitionName)) {
+ QContactTag mt;
+ mt.setTag("Soccer");
+ contactM.saveDetail(&mt);
+ }
+ // Contact N ----------------------------------------
+ QContact contactN;
+ if (allDefs.contains(QContactAddress::DefinitionName)) {
+ QContactAddress nadr;
+ nadr.setStreet("some road");
+ nadr.setLocality("testplace");
+ nadr.setRegion("somewhere");
+ contactN.saveDetail(&nadr);
+ }
+ if (allDefs.contains(QContactEmailAddress::DefinitionName)) {
+ QContactEmailAddress ned;
+ ned.setEmailAddress("frcd at test.domain");
+ contactN.saveDetail(&ned);
+ }
+ if (allDefs.contains(QContactPhoneNumber::DefinitionName)) {
+ QContactPhoneNumber np;
+ np.setNumber("12345"); // Contact N matches 12345
+ contactN.saveDetail(&np);
+ }
+ if (allDefs.contains(QContactName::DefinitionName)) {
+ QContactName nn;
+ nn.setFirstName("Frcdcrick");
+ nn.setLastName("Gumboots");
+ contactN.saveDetail(&nn);
+ }
+ if (allDefs.contains(QContactTag::DefinitionName)) {
+ QContactTag nt;
+ nt.setTag("Soccer");
+ contactN.saveDetail(&nt);
+ }
+ // Contact O ----------------------------------------
+ QContact contactO;
+ if (allDefs.contains(QContactAddress::DefinitionName)) {
+ QContactAddress oadr;
+ oadr.setStreet("some road");
+ oadr.setLocality("testplace");
+ oadr.setRegion("somewhere");
+ contactO.saveDetail(&oadr);
+ }
+ if (allDefs.contains(QContactEmailAddress::DefinitionName)) {
+ QContactEmailAddress oed;
+ oed.setEmailAddress("frdd at test.domain");
+ contactO.saveDetail(&oed);
+ }
+ if (allDefs.contains(QContactPhoneNumber::DefinitionName)) {
+ QContactPhoneNumber op;
+ op.setNumber("44444");
+ contactO.saveDetail(&op);
+ }
+ if (allDefs.contains(QContactName::DefinitionName)) {
+ QContactName on;
+ on.setFirstName("Freddy"); // Contact O matches Freddy
+ on.setLastName("Gumboots");
+ contactO.saveDetail(&on);
+ }
+ if (allDefs.contains(QContactTag::DefinitionName)) {
+ QContactTag ot;
+ ot.setTag("Soccer");
+ contactO.saveDetail(&ot);
+ }
+ // Contact P ----------------------------------------
+ QContact contactP;
+ if (allDefs.contains(QContactAddress::DefinitionName)) {
+ QContactAddress padr;
+ padr.setStreet("some road");
+ padr.setLocality("testplace");
+ padr.setRegion("somewhere");
+ contactP.saveDetail(&padr);
+ }
+ if (allDefs.contains(QContactEmailAddress::DefinitionName)) {
+ QContactEmailAddress ped;
+ ped.setEmailAddress("fred at test.domain");
+ contactP.saveDetail(&ped);
+ }
+ if (allDefs.contains(QContactPhoneNumber::DefinitionName)) {
+ QContactPhoneNumber pp;
+ pp.setNumber("55555");
+ contactP.saveDetail(&pp);
+ }
+ if (allDefs.contains(QContactName::DefinitionName)) {
+ QContactName pn;
+ pn.setFirstName("Frederick"); // Contact P matches Frederic (contains).
+ pn.setLastName("Gumboots");
+ contactP.saveDetail(&pn);
+ }
+ if (allDefs.contains(QContactTag::DefinitionName)) {
+ QContactTag pt;
+ pt.setTag("Soccer");
+ contactP.saveDetail(&pt);
+ }
+ // Contact Q ----------------------------------------
+ QContact contactQ;
+ if (allDefs.contains(QContactAddress::DefinitionName)) {
+ QContactAddress qadr;
+ qadr.setStreet("some road");
+ qadr.setLocality("testplace");
+ qadr.setRegion("somewhere");
+ contactQ.saveDetail(&qadr);
+ }
+ if (allDefs.contains(QContactEmailAddress::DefinitionName)) {
+ QContactEmailAddress qed;
+ qed.setEmailAddress("frfd at test.domain");
+ contactQ.saveDetail(&qed);
+ }
+ if (allDefs.contains(QContactPhoneNumber::DefinitionName)) {
+ QContactPhoneNumber qp;
+ qp.setNumber("66666");
+ contactQ.saveDetail(&qp);
+ }
+ if (allDefs.contains(QContactName::DefinitionName)) {
+ QContactName qn;
+ qn.setFirstName("Frfdfrick");
+ qn.setLastName("Gumboots");
+ contactQ.saveDetail(&qn);
+ }
+ if (allDefs.contains(QContactTag::DefinitionName)) {
+ QContactTag qt;
+ qt.setTag("Soccer");
+ contactQ.saveDetail(&qt);
+ }
+ if (allDefs.contains(QContactFavorite::DefinitionName)) {
+ QContactFavorite qf;
+ qf.setFavorite(true); // Contact Q matches favorite = true
+ contactQ.saveDetail(&qf);
+ }
+ // Contact R ----------------------------------------
+ QContact contactR;
+ if (allDefs.contains(QContactAddress::DefinitionName)) {
+ QContactAddress radr;
+ radr.setStreet("some road");
+ radr.setLocality("testplace");
+ radr.setRegion("somewhere");
+ contactR.saveDetail(&radr);
+ }
+ if (allDefs.contains(QContactEmailAddress::DefinitionName)) {
+ QContactEmailAddress red;
+ red.setEmailAddress("frgd at test.domain");
+ contactR.saveDetail(&red);
+ }
+ if (allDefs.contains(QContactPhoneNumber::DefinitionName)) {
+ QContactPhoneNumber rp;
+ rp.setNumber("77777");
+ contactR.saveDetail(&rp);
+ }
+ if (allDefs.contains(QContactName::DefinitionName)) {
+ QContactName rn;
+ rn.setFirstName("Frgdgrick");
+ rn.setLastName("Gumboots");
+ contactR.saveDetail(&rn);
+ }
+ if (allDefs.contains(QContactTag::DefinitionName)) {
+ QContactTag rt;
+ rt.setTag("Football"); // Contact R matches Football
+ contactR.saveDetail(&rt);
+ }
+ // --------------------- save.
+ contactL = cm->compatibleContact(contactL);
+ contactM = cm->compatibleContact(contactM);
+ contactN = cm->compatibleContact(contactN);
+ contactO = cm->compatibleContact(contactO);
+ contactP = cm->compatibleContact(contactP);
+ contactQ = cm->compatibleContact(contactQ);
+ contactR = cm->compatibleContact(contactR);
+ Q_ASSERT(cm->saveContact(&contactL));
+ Q_ASSERT(cm->saveContact(&contactM));
+ Q_ASSERT(cm->saveContact(&contactN));
+ Q_ASSERT(cm->saveContact(&contactO));
+ Q_ASSERT(cm->saveContact(&contactP));
+ Q_ASSERT(cm->saveContact(&contactQ));
+ Q_ASSERT(cm->saveContact(&contactR));
+ // --------------------- end.
+
/* Add our newly saved contacts to our internal list of added contacts */
- contactsAddedToManagers.insert(cm, k.id().localId());
- contactsAddedToManagers.insert(cm, j.id().localId());
- contactsAddedToManagers.insert(cm, i.id().localId());
- contactsAddedToManagers.insert(cm, h.id().localId());
- contactsAddedToManagers.insert(cm, g.id().localId());
- contactsAddedToManagers.insert(cm, f.id().localId());
- contactsAddedToManagers.insert(cm, e.id().localId());
- contactsAddedToManagers.insert(cm, d.id().localId());
- contactsAddedToManagers.insert(cm, c.id().localId());
- contactsAddedToManagers.insert(cm, b.id().localId());
- contactsAddedToManagers.insert(cm, a.id().localId());
+ contactsAddedToManagers.insert(cm, contactR.id().localId());
+ contactsAddedToManagers.insert(cm, contactQ.id().localId());
+ contactsAddedToManagers.insert(cm, contactP.id().localId());
+ contactsAddedToManagers.insert(cm, contactO.id().localId());
+ contactsAddedToManagers.insert(cm, contactN.id().localId());
+ contactsAddedToManagers.insert(cm, contactM.id().localId());
+ contactsAddedToManagers.insert(cm, contactL.id().localId());
+ contactsAddedToManagers.insert(cm, contactK.id().localId());
+ contactsAddedToManagers.insert(cm, contactJ.id().localId());
+ contactsAddedToManagers.insert(cm, contactI.id().localId());
+ contactsAddedToManagers.insert(cm, contactH.id().localId());
+ contactsAddedToManagers.insert(cm, contactG.id().localId());
+ contactsAddedToManagers.insert(cm, contactF.id().localId());
+ contactsAddedToManagers.insert(cm, contactE.id().localId());
+ contactsAddedToManagers.insert(cm, contactD.id().localId());
+ contactsAddedToManagers.insert(cm, contactC.id().localId());
+ contactsAddedToManagers.insert(cm, contactB.id().localId());
+ contactsAddedToManagers.insert(cm, contactA.id().localId());
/* Reload the contacts to pick up any changes */
- a = cm->contact(a.id().localId());
- b = cm->contact(b.id().localId());
- c = cm->contact(c.id().localId());
- d = cm->contact(d.id().localId());
- e = cm->contact(e.id().localId());
- f = cm->contact(f.id().localId());
- g = cm->contact(g.id().localId());
- h = cm->contact(h.id().localId());
- i = cm->contact(i.id().localId());
- j = cm->contact(j.id().localId());
- k = cm->contact(k.id().localId());
+ contactA = cm->contact(contactA.id().localId());
+ contactB = cm->contact(contactB.id().localId());
+ contactC = cm->contact(contactC.id().localId());
+ contactD = cm->contact(contactD.id().localId());
+ contactE = cm->contact(contactE.id().localId());
+ contactF = cm->contact(contactF.id().localId());
+ contactG = cm->contact(contactG.id().localId());
+ contactH = cm->contact(contactH.id().localId());
+ contactI = cm->contact(contactI.id().localId());
+ contactJ = cm->contact(contactJ.id().localId());
+ contactK = cm->contact(contactK.id().localId());
+ contactL = cm->contact(contactL.id().localId());
+ contactM = cm->contact(contactM.id().localId());
+ contactN = cm->contact(contactN.id().localId());
+ contactO = cm->contact(contactO.id().localId());
+ contactP = cm->contact(contactP.id().localId());
+ contactQ = cm->contact(contactQ.id().localId());
+ contactR = cm->contact(contactR.id().localId());
QList<QContactLocalId> list;
- if (!a.isEmpty())
- list << a.id().localId();
- if (!b.isEmpty())
- list << b.id().localId();
- if (!c.isEmpty())
- list << c.id().localId();
- if (!d.isEmpty())
- list << d.id().localId();
- if (!e.isEmpty())
- list << e.id().localId();
- if (!f.isEmpty())
- list << f.id().localId();
- if (!g.isEmpty())
- list << g.id().localId();
- if (!h.isEmpty())
- list << h.id().localId();
- if (!i.isEmpty())
- list << i.id().localId();
- if (!j.isEmpty())
- list << j.id().localId();
- if (!k.isEmpty())
- list << k.id().localId();
+ if (!contactA.isEmpty())
+ list << contactA.id().localId();
+ if (!contactB.isEmpty())
+ list << contactB.id().localId();
+ if (!contactC.isEmpty())
+ list << contactC.id().localId();
+ if (!contactD.isEmpty())
+ list << contactD.id().localId();
+ if (!contactE.isEmpty())
+ list << contactE.id().localId();
+ if (!contactF.isEmpty())
+ list << contactF.id().localId();
+ if (!contactG.isEmpty())
+ list << contactG.id().localId();
+ if (!contactH.isEmpty())
+ list << contactH.id().localId();
+ if (!contactI.isEmpty())
+ list << contactI.id().localId();
+ if (!contactJ.isEmpty())
+ list << contactJ.id().localId();
+ if (!contactK.isEmpty())
+ list << contactK.id().localId();
+ if (!contactL.isEmpty())
+ list << contactL.id().localId();
+ if (!contactM.isEmpty())
+ list << contactM.id().localId();
+ if (!contactN.isEmpty())
+ list << contactN.id().localId();
+ if (!contactO.isEmpty())
+ list << contactO.id().localId();
+ if (!contactP.isEmpty())
+ list << contactP.id().localId();
+ if (!contactQ.isEmpty())
+ list << contactQ.id().localId();
+ if (!contactR.isEmpty())
+ list << contactR.id().localId();
return list;
}
--- tests/auto/qgallerytrackerschema_maemo6/tst_qgallerytrackerschema.cpp
+++ tests/auto/qgallerytrackerschema_maemo6/tst_qgallerytrackerschema.cpp
@@ -62,7 +62,6 @@
Q_DECLARE_METATYPE(QVector<QGalleryProperty::Attributes>)
Q_DECLARE_METATYPE(QVector<int>)
Q_DECLARE_METATYPE(QGalleryFilter)
-Q_DECLARE_METATYPE(QVector<QGalleryTrackerSortCriteria>)
#define QT_FILE_QUERY_ARGUMENTS_COUNT 9
#define QT_FILE_QUERY_SERVICE_POSITION 1
@@ -72,12 +71,6 @@
#define QT_AGGREGATE_QUERY_SERVICE_POSITION 0
#define QT_AGGREGATE_QUERY_STRING_POSITION 2
-
-bool operator ==(const QGalleryTrackerSortCriteria &left, const QGalleryTrackerSortCriteria &right)
-{
- return left.column == right.column && left.flags == right.flags;
-}
-
class tst_QGalleryTrackerSchema : public QObject, public QGalleryDBusInterfaceFactory
{
Q_OBJECT
@@ -157,7 +150,6 @@
qRegisterMetaType<QVector<QGalleryProperty::Attributes> >();
qRegisterMetaType<QVector<int> >();
qRegisterMetaType<QGalleryFilter>();
- qRegisterMetaType<QVector<QGalleryTrackerSortCriteria> >();
// Initialize dbus interfaces of some sort here.
}
--- tests/auto/qgeomapcircleobject/tst_qgeomapcircleobject.cpp
+++ tests/auto/qgeomapcircleobject/tst_qgeomapcircleobject.cpp
@@ -461,6 +461,8 @@
QCOMPARE(map->mapObjectsAtScreenPosition(point).size(),3);
+ QVERIFY(map->mapObjectsAtScreenPosition(point).at(0)!=object2);
+ QVERIFY(map->mapObjectsAtScreenPosition(point).at(0)!=object3);
QVERIFY(map->mapObjectsAtScreenPosition(point).at(0)==object1);
QVERIFY(map->mapObjectsAtScreenPosition(point).at(1)==object2);
QVERIFY(map->mapObjectsAtScreenPosition(point).at(2)==object3);
--- tests/auto/qgeomapgroupobject/poimarker.png
+++ tests/auto/qgeomapgroupobject/poimarker.png
+PNG
+
+
IHDR Äé
c sRGB ®Î
é bKGD ? cÏ)0 pHYs tIMEÚ ÎÁÊ lIDATHÇÍ]h
UßÙÙÙÌdwvmC¶4kLÈJbQJ(¦ÖæJ)õª¢¹Ðlã
"Z{á¢`Ej+Åø¶K &Ým76Ýf³Í6ÝÙ9»3ÇÅÚhÒzÑs}^ï;ï÷s»ð0ñx<<00à[]ÏeUU㢠| ףãÖZ[[Ȳ¼OÅþ-7ËÎÍåþ×Lb±Ø¶¶¶ýËBŰ?8ºwtÔ¿g-ÉdkGGÇë<Ïû
ÇA½^$IÛEQ|Àó è
9}àÀã¯ggg]Û¶iµZ¥eÑ|>OO<Y
>@¾íL;ÖÖH¼7888üÕ/?áw#_Ö
»;ú£ÑèQBÈ}gÎ9àê²bV©»ß÷ö
úò
Ì¢Ê m¨(¢Uoíz¦V6ÇÇÇ?J§Ó/(¬¥ºØþþþDOOÏgCCC<sêM\]2ÁÉXÅ+[àV¸o§Rmã£Ñhßü+Ã4O;S[ÒÞÞ.ÇãñCñ-ñ÷DçsF¦h×Á-p
V±Á4Ù@iòÐÒ<Ôs¯Ç¥teÙ-
ÇýZ.µ¿@B¡§ªêêªN´´´
t©ëëîîÆ§s3Ðz#úO.l
î[òÂÕ¼X)¸H[°°°À0Ó`(ÄqË`0eùp Øëe®¢WP.¡«a#mÇu°QLÀnH:
èºJ)J¥$IÚêø_¡Í(Ié:ÎÛIÏÏÃ0 ±+>ÕEPÛ?éü
˲À0Á ,ËZÔ´juréæsEw©XLÇ6løBày+
+=Àqxd¥epÕð î«yA+(ñVDPÍgB!ÙlöâüüÕ§OÔëõå-«vuu}_«Õ~dYvl£_a¯úª¨t ÎÁ-Ip5/\Mj ¡`³Å¥ëÌOOO?eÆw UK8Í"
ÏJ%øwn
DÆÖQ¾A÷¦áÁj/Þ3k³HgÒz*úØuÝ ìÿ¹\ʲ<GajòdÿbÊ&\_¨ÃZáu[±ÓN¼ßéÏcvv¦R©)Ã0 ø}Í
½½½{Eù06ïØ±ÉdªªÂ4MÌÌÌàìÙ³Èf³4ÉüÏç_r]÷ d] Lggç¶H$ò9Dz¼ ÀãñÀu]B`Ë];µ¼|ã5Jé
[Ö D"p_¢ï
±I¯eYðù|(2̳ãL¨üÛ¸_Óf4M³ÚÔÔtIÅç½iÎäóùýa_-úÛZ¿
BaÎç÷Ç
Çé.
+GNÝñ²ZeÏw577?ʲ¬z×ý£þ ö ,ÁI IEND®B`--- tests/auto/qgeomapgroupobject/qgeomapgroupobject.pro
+++ tests/auto/qgeomapgroupobject/qgeomapgroupobject.pro
@@ -22,3 +22,5 @@
TARGET.CAPABILITY = ALL -TCB
}
+RESOURCES += \
+ resources.qrc
--- tests/auto/qgeomapgroupobject/resources.qrc
+++ tests/auto/qgeomapgroupobject/resources.qrc
+<RCC>
+ <qresource prefix="/">
+ <file>poimarker.png</file>
+ </qresource>
+</RCC>
--- tests/auto/qgeomapgroupobject/tst_qgeomapgroupobject.cpp
+++ tests/auto/qgeomapgroupobject/tst_qgeomapgroupobject.cpp
@@ -92,6 +92,7 @@
void zvalue();
void isSelected();
void isVisible();
+ void removeFromMap();
private:
TestHelper *m_helper;
@@ -636,6 +637,78 @@
}
+void tst_QGeoMapGroupObject::removeFromMap()
+{
+ QPixmap pm(20, 20);
+ pm.fill(Qt::blue);
+
+ QPixmap pm2(":/poimarker.png");
+
+ QPointer<QGeoMapPixmapObject> pixmap = new QGeoMapPixmapObject(
+ QGeoCoordinate(0,0), QPoint(10,10), pm);
+ pixmap->setZValue(1);
+
+ QPointer<QGeoMapPixmapObject> pixmap2 = new QGeoMapPixmapObject(
+ QGeoCoordinate(0,0), QPoint(10,10), pm2);
+ pixmap->setZValue(0);
+
+ QPointer<QGeoMapCircleObject> circle = new QGeoMapCircleObject(
+ QGeoCoordinate(0,0), 1000);
+ circle->setZValue(2);
+ circle->setPen(QPen((QColor(255, 0, 0, 90))));
+ circle->setBrush(QBrush(QColor(255, 0, 0, 90)));
+
+ QPointer<QGeoMapRectangleObject> rect = new QGeoMapRectangleObject(
+ QGeoCoordinate(0,0), QGeoCoordinate(10,10));
+ rect->setZValue(3);
+
+ QPointer<QGeoMapGroupObject> group = new QGeoMapGroupObject();
+ group->addChildObject(pixmap);
+ group->addChildObject(pixmap2);
+ group->addChildObject(circle);
+ group->addChildObject(rect);
+
+ QPointer<QGraphicsGeoMap> map = m_helper->map();
+ map->setCenter(QGeoCoordinate(0,0));
+ map->addMapObject(group);
+
+ QTest::qWait(500);
+
+ QVERIFY(map->mapObjects().size() == 1);
+ QVERIFY(map->mapObjects().contains(group));
+ QVERIFY(map->mapObjectsInViewport().size() > 0);
+
+ map->clearMapObjects();
+
+ QVERIFY(!group);
+ QVERIFY(!circle);
+ QVERIFY(!rect);
+ QVERIFY(map->mapObjects().size() == 0);
+ QVERIFY(map->mapObjectsInViewport().size() == 0);
+
+ pixmap = new QGeoMapPixmapObject(QGeoCoordinate(0,0), QPoint(10,10), pm2);
+ pixmap->setZValue(1);
+ group = new QGeoMapGroupObject();
+ group->addChildObject(pixmap);
+
+ map->addMapObject(group);
+
+ QTest::qWait(500);
+
+ QVERIFY(map->mapObjects().size() == 1);
+ QVERIFY(map->mapObjects().contains(group));
+
+ map->removeMapObject(group);
+
+ QVERIFY(group);
+ QVERIFY(pixmap);
+ QVERIFY(map->mapObjects().size() == 0);
+
+ delete group;
+ QVERIFY(!group);
+ QVERIFY(!pixmap);
+}
+
void tst_QGeoMapGroupObject::boundingBox_data()
{
#if 0
--- tests/auto/qgeopositioninfosource/data
+++ tests/auto/qgeopositioninfosource/data
+(directory)
--- tests/auto/qgeopositioninfosource/data/gcmock_basic_vel_pos.journal
+++ tests/auto/qgeopositioninfosource/data/gcmock_basic_vel_pos.journal
+#--------------------------------------------------------------
+# For position updates the values are space separated list:
+# repeats(i) timeout(i) timestamp(i) fields(i) latitude(d) longitude(d) altitude(d)
+# For velocity updates the values are space separated list:
+# repeats(i) timeout(i) fields(i) speed(d)
+# The keywords are:
+# REGULAR_POS_UPDATE // delivered to app as long as registered for the callback/signal
+# SINGLE_POS_UPDATE // delivered to app once per-request
+# VELOCITY_UPDATE // delivered to app as long as registered for the callback/signal
+#--------------------------------------------------------------
+
+SINGLE_POS_UPDATE
+1 500 99998 3 21 31 5.1
+REGULAR_POS_UPDATE
+2 500 99999 3 20 30 2.1
+VELOCITY_UPDATE
+1 200 1 12.1
+REGULAR_POS_UPDATE
+2 500 99999 3 20 30 2.1
+VELOCITY_UPDATE
+1 200 1 12.2
+REGULAR_POS_UPDATE
+3 1000 99999 3 20 30 2.1
+VELOCITY_UPDATE
+1 200 1 13.3
+REGULAR_POS_UPDATE
+3 1000 99999 3 20 30 2.1
+REGULAR_POS_UPDATE
+500 800 99999 3 20 30 2.1
--- tests/auto/qgeopositioninfosource/geoclue_mock_data.qrc
+++ tests/auto/qgeopositioninfosource/geoclue_mock_data.qrc
+<!DOCTYPE RCC>
+<RCC version="1.0">
+<qresource>
+ <file>data/gcmock_basic_vel_pos.journal</file>
+</qresource>
+</RCC>
--- tests/auto/qgeopositioninfosource/geocluemock.cpp
+++ tests/auto/qgeopositioninfosource/geocluemock.cpp
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "geocluemock.h"
+#include "qgeopositioninfosource_geocluemaster_p.h"
+#include <QTimerEvent>
+#include <QDebug>
+
+// todo all calls to geocluemock should be done by calling slots to ensure
+// synchronization (the mocked library functions call mockend directly even
+// though its in different thread). now going a bit dangerously, but seems to work..
+static GeoclueMock* lg_currentMockend = 0;
+static QString lg_currentJournal;
+
+// These symbols override the symbols in the actual geoclue library;
+// they are used to mock the backend. ld won't resolve the actualy symbols
+// in the real geoclue library because they are already defined here.
+// However if this dodgy logic someday becomes untrue, make a shim library
+// with the same functionality and use LD_PRELOAD or LD_LIBRARY_PATH to
+// force loading of the shim library. For CI system, you will also need to reimplement the main()
+// of the testcase so that it can actually set one of those variables and then restart
+// the application.
+gulong g_signal_connect_data (gpointer instance,
+ const gchar *detailed_signal,
+ GCallback c_handler,
+ gpointer data,
+ GClosureNotify destroy_data = NULL,
+ GConnectFlags connect_flags = (GConnectFlags)0)
+{
+ Q_UNUSED(instance)
+ Q_UNUSED(destroy_data)
+ Q_UNUSED(connect_flags)
+ Q_ASSERT(lg_currentMockend);
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=mocked= g_signal_connect (_data)");
+#endif
+ lg_currentMockend->setPositionSource(static_cast<QObject*>(data));
+ if (QString::fromAscii(detailed_signal).contains("position-changed")) {
+ lg_currentMockend->setPositionChangedCallback(c_handler);
+ } else if (QString::fromAscii(detailed_signal).contains("velocity-changed")) {
+ lg_currentMockend->setVelocityChangedCallback(c_handler);
+ }
+ return 1; // dummy
+}
+
+guint g_signal_handlers_disconnect_matched (gpointer instance,
+ GSignalMatchType mask,
+ guint signal_id = guint(0),
+ GQuark detail = GQuark(0),
+ GClosure *closure = NULL,
+ gpointer func = NULL,
+ gpointer data = NULL)
+{
+ Q_UNUSED(instance)
+ Q_UNUSED(mask)
+ Q_UNUSED(signal_id)
+ Q_UNUSED(detail)
+ Q_UNUSED(closure)
+ Q_ASSERT(lg_currentMockend);
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=mocked= g_signal_handlers_disconnect_by_func (_matched)");
+#endif
+ lg_currentMockend->disconnectSignal(func, data);
+}
+
+GeoclueMaster *geoclue_master_get_default (void)
+{
+ Q_ASSERT(lg_currentMockend);
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=mocked= geoclue_master_get_default");
+#endif
+ GeoclueMaster* master = (GeoclueMaster*)g_object_new (G_TYPE_OBJECT, NULL);
+ return master;
+}
+
+GeoclueMasterClient *geoclue_master_create_client (GeoclueMaster *master,
+ char **object_path,
+ GError **error)
+{
+ Q_UNUSED(master)
+ Q_UNUSED(object_path)
+ Q_UNUSED(error)
+ Q_ASSERT(lg_currentMockend);
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=mocked= geoclue_master_create_client");
+#endif
+ GeoclueMasterClient* client = (GeoclueMasterClient*)g_object_new (G_TYPE_OBJECT, NULL);
+ return client;
+}
+
+gboolean geoclue_master_client_set_requirements (GeoclueMasterClient *client,
+ GeoclueAccuracyLevel min_accuracy,
+ int min_time,
+ gboolean require_updates,
+ GeoclueResourceFlags allowed_resources,
+ GError **error)
+{
+ Q_UNUSED(client)
+ Q_UNUSED(min_accuracy)
+ Q_UNUSED(min_time)
+ Q_UNUSED(require_updates)
+ Q_UNUSED(allowed_resources)
+ Q_UNUSED(error)
+ Q_ASSERT(lg_currentMockend);
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=mocked= geoclue_master_client_set_requirements");
+#endif
+ return true;
+}
+
+GeocluePosition *geoclue_master_client_create_position (GeoclueMasterClient *client, GError **error)
+{
+ Q_UNUSED(client)
+ Q_UNUSED(error)
+ Q_ASSERT(lg_currentMockend);
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=mocked= geoclue_master_client_create_position");
+#endif
+ GeocluePosition* position = (GeocluePosition*)g_object_new (G_TYPE_OBJECT, NULL);
+ return position;
+
+}
+
+GeoclueVelocity *geoclue_velocity_new (const char *service,
+ const char *path)
+{
+ Q_UNUSED(service)
+ Q_UNUSED(path)
+ Q_ASSERT(lg_currentMockend);
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=mocked= geoclue_velocity_new");
+#endif
+ GeoclueVelocity* velocity = (GeoclueVelocity*)g_object_new (G_TYPE_OBJECT, NULL);
+ return velocity;
+}
+
+void geoclue_position_get_position_async (GeocluePosition *position,
+ GeocluePositionCallback callback,
+ gpointer userdata)
+{
+ Q_UNUSED(position)
+ Q_ASSERT(lg_currentMockend);
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=mocked= geoclue_position_get_position_async");
+#endif
+ lg_currentMockend->setPositionSource(static_cast<QObject*>(userdata));
+ lg_currentMockend->setPositionCallback(callback);
+ lg_currentMockend->singleUpdate();
+}
+
+GeoclueMock::GeoclueMock() :
+ m_positionSource(0),
+ m_positionChangedCallback(0), m_velocityChangedCallback(0),
+ m_positionCallback(0)
+{
+ g_type_init();
+ lg_currentMockend = this;
+}
+
+GeoclueMock::~GeoclueMock()
+{
+ lg_currentMockend = 0;
+}
+
+void GeoclueMock::setPositionSource(QObject *positionSource)
+{
+ m_positionSource = positionSource;
+}
+
+void GeoclueMock::start()
+{
+ Q_ASSERT(QFile::exists(lg_currentJournal));
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=GeoclueMock start");
+#endif
+ stop(); // just in case
+ // If file is already open, continue reading it.
+ if (!m_currentJournalFile.isOpen()) {
+ m_currentJournalFile.setFileName(lg_currentJournal);
+ if (!m_currentJournalFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ qCritical() << "Journal opening failed:" << m_currentJournalFile.fileName();
+ Q_ASSERT(false);
+ }
+ }
+ UPDATE_TYPE update = readNextEntry();
+ while (update == SINGLE_UPDATE) {
+ update = readNextEntry(); // skip single entries (just stores values)
+ }
+ if (update == REGULAR_UPDATE ||
+ update == VELOCITY_UPDATE) {
+ m_regular.timerId = startTimer(m_regular.timeout);
+ } else {
+ Q_ASSERT(false); // journal ran out
+ }
+}
+
+void GeoclueMock::stop()
+{
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=GeoclueMock= stop");
+#endif
+ killTimer(m_single.timerId);
+ killTimer(m_regular.timerId);
+ m_single.timerId = 0;
+ m_regular.timerId = 0;
+ if (m_currentJournalFile.isOpen())
+ m_currentJournalFile.close();
+ m_positionChangedCallback = 0;
+ m_positionCallback = 0;
+ m_velocityChangedCallback = 0;
+ m_positionSource = 0;
+}
+
+void GeoclueMock::timerEvent(QTimerEvent *event)
+{
+ if (!m_positionSource) {
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=GeoclueMock= timerEvent no interested position sources, ignoring update.");
+#endif
+ return;
+ }
+
+ // check which timer
+ if (event->timerId() == m_regular.timerId) {
+ Q_ASSERT(m_regular.updateType);
+
+ switch (m_regular.updateType) {
+ case REGULAR_UPDATE:
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=GeoclueMock= regular update.");
+#endif
+ if (m_positionChangedCallback)
+ (*m_positionChangedCallback)((GeocluePosition*)1, // dummy
+ (GeocluePositionFields)m_regular.fields,
+ m_regular.timestamp,
+ m_regular.latitude,
+ m_regular.longitude,
+ m_regular.altitude,
+ (GeoclueAccuracy*)1, // dummy
+ (gpointer)m_positionSource);
+ break;
+
+ case VELOCITY_UPDATE:
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=GeoclueMock= velocity update.");
+#endif
+ if (m_velocityChangedCallback)
+ (*m_velocityChangedCallback)((GeoclueVelocity*)1, // dummy
+ (GeoclueVelocityFields)m_regular.fields,
+ 1, // dummy
+ m_regular.speed,
+ 1, // dummy
+ 1, // dummy
+ (gpointer)m_positionSource);
+ break;
+ default:
+ Q_ASSERT(false);
+ }
+ if (m_regular.repeats > 0) {
+ m_regular.repeats--;
+ return;
+ }
+ killTimer(m_regular.timerId);
+ } else if (event->timerId() == m_single.timerId) {
+ Q_ASSERT(m_single.updateType);
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=GeoclueMock= single position update.");
+#endif
+ if (m_positionCallback)
+ (*m_positionCallback)((GeocluePosition*)1, // dummy
+ (GeocluePositionFields)m_single.fields,
+ m_single.timestamp,
+ m_single.latitude,
+ m_single.longitude,
+ m_single.altitude,
+ (GeoclueAccuracy*)1, // dummy
+ (GError*)0,
+ (gpointer)m_positionSource);
+ // Single update only, remove the callback.
+ disconnectSignal(gpointer(m_positionCallback), (gpointer)m_positionSource);
+ killTimer(m_single.timerId);
+ } else {
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug() << "=GeoclueMock= astray timer, killing and ignoring: " << event->timerId();
+#endif
+ killTimer(event->timerId()); // Something has gone astray, kill and ignore
+ return;
+ }
+ // no more repeats
+ UPDATE_TYPE update = readNextEntry();
+ while (update == SINGLE_UPDATE) {
+ update = readNextEntry(); // skip single entries
+ }
+ if (update == REGULAR_UPDATE ||
+ update == VELOCITY_UPDATE) {
+ m_regular.timerId = startTimer(m_regular.timeout);
+ } else {
+ Q_ASSERT(false); // journal ran out
+ }
+}
+
+GeoclueMock::UPDATE_TYPE GeoclueMock::readNextEntry()
+{
+ QString line;
+ QTextStream stream;
+
+ line = m_currentJournalFile.readLine();
+ while (line.length() > 0) {
+ if (line.at(0) == '#') {
+ line = m_currentJournalFile.readLine();
+ continue;
+ }
+ if (line == "\n") {
+ line = m_currentJournalFile.readLine();
+ continue;
+ }
+ if (line == "REGULAR_POS_UPDATE\n") {
+ line = m_currentJournalFile.readLine();
+ stream.setString(&line);
+ m_regular.updateType = REGULAR_UPDATE;
+ parseRegularUpdate(stream);
+ return REGULAR_UPDATE;
+ }
+ else if (line == "SINGLE_POS_UPDATE\n") {
+ line = m_currentJournalFile.readLine();
+ stream.setString(&line);
+ parseSingleUpdate(stream);
+ m_single.updateType = SINGLE_UPDATE;
+ return SINGLE_UPDATE;
+
+ }
+ else if (line == "VELOCITY_UPDATE\n") {
+ line = m_currentJournalFile.readLine();
+ stream.setString(&line);
+ m_regular.updateType = VELOCITY_UPDATE;
+ parseVelocityUpdate(stream);
+ return VELOCITY_UPDATE;
+ }
+ qCritical("Invalid input file for geoclue mocking.");
+ Q_ASSERT(false);
+ }
+ return INVALID_UPDATE;
+}
+
+void GeoclueMock::parseRegularUpdate(QTextStream& stream)
+{
+ stream >> m_regular.repeats >> m_regular.timeout >> m_regular.timestamp >> m_regular.fields >> m_regular.latitude >> m_regular.longitude >> m_regular.altitude;
+}
+
+void GeoclueMock::parseSingleUpdate(QTextStream& stream)
+{
+ stream >> m_single.repeats >> m_single.timeout >> m_single.timestamp >> m_single.fields >> m_single.latitude >> m_single.longitude >> m_single.altitude;
+}
+
+void GeoclueMock::parseVelocityUpdate(QTextStream& stream)
+{
+ stream >> m_regular.repeats >> m_regular.timeout >> m_regular.fields >> m_regular.speed;
+}
+
+void GeoclueMock::setPositionChangedCallback(void (*callback)())
+{
+ m_positionChangedCallback = (PositionChangedCallback)callback;
+}
+
+void GeoclueMock::setVelocityChangedCallback(void (*callback)())
+{
+ m_velocityChangedCallback = (VelocityChangedCallback)callback;
+}
+
+void GeoclueMock::setPositionCallback(GeocluePositionCallback callback)
+{
+ m_positionCallback = (PositionCallback)callback;
+}
+
+void GeoclueMock::disconnectSignal(gpointer callback, gpointer positionSource)
+{
+ if (positionSource != (gpointer)m_positionSource) {
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=GeoclueMock disconnectSignal requested without connecting.");
+#endif
+ return;
+ }
+ if (callback == (gpointer)m_positionChangedCallback) {
+ m_positionChangedCallback = 0;
+ } else if (callback == (gpointer)m_positionCallback) {
+ m_positionCallback = 0;
+ } else if (callback == (gpointer)m_velocityChangedCallback) {
+ m_velocityChangedCallback = 0;
+ }
+ if (m_positionChangedCallback == 0 &&
+ m_velocityChangedCallback == 0 &&
+ m_positionCallback == 0 ) {
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=GeoclueMock= no callbacks anymore, removing pos source reference");
+#endif
+ m_positionSource = 0;
+ }
+}
+
+void GeoclueMock::singleUpdate()
+{
+#ifdef TST_GEOCLUE_MOCK_TRACE
+ qDebug("=GeoclueMock= singleUpdate");
+#endif
+ Q_ASSERT(m_single.updateType == SINGLE_UPDATE);
+ Q_ASSERT(m_positionSource);
+ killTimer(m_single.timerId);
+ m_single.timerId = startTimer(m_single.timeout);
+}
+
+// Misc functions to parametrize the behavior of the mockend
+void geocluemock_setjournal(QString journal)
+{
+ lg_currentJournal = journal;
+}
--- tests/auto/qgeopositioninfosource/geocluemock.h
+++ tests/auto/qgeopositioninfosource/geocluemock.h
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GEOCLUEMOCK_H
+#define GEOCLUEMOCK_H
+
+#include <QObject>
+#include <QFile>
+#include <QStringList>
+#include <QString>
+#include <QTextStream>
+#include <qgeopositioninfosource_geocluemaster_p.h>
+#include <geoclue/geoclue-master.h>
+#include <geoclue/geoclue-master-client.h>
+#include <geoclue/geoclue-velocity.h>
+#include <geoclue/geoclue-position.h>
+
+//#define TST_GEOCLUE_MOCK_TRACE 1
+
+void geocluemock_setjournal(QString journal);
+
+typedef void (*PositionChangedCallback) (GeocluePosition*,
+ GeocluePositionFields,
+ int,
+ double,
+ double,
+ double,
+ GeoclueAccuracy*,
+ gpointer);
+
+typedef void (*VelocityChangedCallback) (GeoclueVelocity*,
+ GeoclueVelocityFields,
+ int,
+ double,
+ double,
+ double,
+ gpointer);
+
+typedef void (*PositionCallback) (GeocluePosition*,
+ GeocluePositionFields,
+ int,
+ double,
+ double,
+ double,
+ GeoclueAccuracy*,
+ GError*,
+ gpointer);
+
+class GeoclueMock: public QObject
+{
+ Q_OBJECT
+public:
+ explicit GeoclueMock();
+ ~GeoclueMock();
+ void setPositionSource(QObject* positionSource);
+ void setPositionChangedCallback(void (*callback)());
+ void setVelocityChangedCallback(void (*callback)());
+ void setPositionCallback(GeocluePositionCallback callback);
+ void disconnectSignal(gpointer callback, gpointer positionSource);
+ void singleUpdate();
+
+ enum UPDATE_TYPE {
+ INVALID_UPDATE = 0,
+ REGULAR_UPDATE,
+ SINGLE_UPDATE,
+ VELOCITY_UPDATE
+ };
+
+ typedef struct {
+ int timerId;
+ int timeout;
+ int repeats;
+ int timestamp;
+ int fields;
+ double latitude;
+ double longitude;
+ double altitude;
+ double speed;
+ double direction;
+ double climb;
+ UPDATE_TYPE updateType;
+ } UpdateData;
+
+public slots:
+ void start();
+ void stop();
+
+protected:
+ void timerEvent(QTimerEvent *);
+
+private:
+ UPDATE_TYPE readNextEntry();
+ void parseRegularUpdate(QTextStream& stream);
+ void parseSingleUpdate(QTextStream& stream);
+ void parseVelocityUpdate(QTextStream& stream);
+
+private:
+ QFile m_currentJournalFile;
+ QObject* m_positionSource;
+ UpdateData m_regular;
+ UpdateData m_single;
+ PositionChangedCallback m_positionChangedCallback;
+ VelocityChangedCallback m_velocityChangedCallback;
+ PositionCallback m_positionCallback;
+};
+
+#endif // GEOCLUEMOCK_H
--- tests/auto/qgeopositioninfosource/qgeopositioninfosource.pro
+++ tests/auto/qgeopositioninfosource/qgeopositioninfosource.pro
@@ -10,14 +10,41 @@
# Input
HEADERS += ../qlocationtestutils_p.h \
../testqgeopositioninfosource_p.h
+
SOURCES += ../qlocationtestutils.cpp \
../testqgeopositioninfosource.cpp \
tst_qgeopositioninfosource.cpp
-CONFIG += mobility
-MOBILITY = location
+# With geoclue mock the underlying layers. For this purpose do not
+# link against the mobility location library.
+meego: contains (geoclue-master_enabled, yes) {
+ message("Mocking GeoClue libraries (real libraries will not be used)")
+ DEFINES += TST_GEOCLUEMOCK_ENABLED=1
+ DEFINES += GEOCLUE_MASTER_AVAILABLE=1
+ HEADERS += ../../../src/location/qgeopositioninfosource_geocluemaster_p.h \
+ ../../../src/location/qgeopositioninfo.h \
+ ../../../src/location/qgeopositioninfosource.h \
+ ../../../src/location/qgeocoordinate.h \
+ geocluemock.h
+ SOURCES += ../../../src/location/qgeopositioninfosource_geocluemaster.cpp \
+ ../../../src/location/qgeopositioninfo.cpp \
+ ../../../src/location/qgeopositioninfosource.cpp \
+ ../../../src/location/qgeocoordinate.cpp \
+ geocluemock.cpp
+ RESOURCES += geoclue_mock_data.qrc
+ PKGCONFIG += geoclue gconf-2.0 glib-2.0
+ QMAKE_PKGCONFIG_REQUIRES += geoclue glib-2.0 gconf-2.0
+ CONFIG += qdbus link_pkgconfig
+ pkgconfig.path = $$QT_MOBILITY_LIB/pkgconfig
+ pkgconfig.files = QtLocation.pc
+} else {
+ CONFIG += mobility
+ MOBILITY = location
+}
symbian {
TARGET.CAPABILITY = ALL -TCB
}
+CONFIG += middleware
+include(../../../features/deploy.pri)
--- tests/auto/qgeosatelliteinfosource/gypsymock
+++ tests/auto/qgeosatelliteinfosource/gypsymock
+(directory)
--- tests/auto/qgeosatelliteinfosource/gypsymock/data
+++ tests/auto/qgeosatelliteinfosource/gypsymock/data
+(directory)
--- tests/auto/qgeosatelliteinfosource/gypsymock/data/gypsymock_basic_sat.journal
+++ tests/auto/qgeosatelliteinfosource/gypsymock/data/gypsymock_basic_sat.journal
+#--------------------------------------------------------------
+# Satellite data, the keywords are:
+# START_REGULAR_SAT_UPDATE // starts marking group of satellites
+# repeats(i) timeout(i)
+# SATELLITE
+# elevation(u) azimuth(u) prn(i) snr(u) inuse(b)
+# END_REGULAR_SAT_UPDATE // ends marking group of satellites
+#--------------------------------------------------------------
+
+START_REGULAR_SAT_UPDATE
+500 500
+SATELLITE
+1 12 13 14 1
+SATELLITE
+2 22 23 24 0
+SATELLITE
+3 32 33 34 1
+SATELLITE
+4 42 43 44 0
+SATELLITE
+5 52 53 54 1
+SATELLITE
+6 62 63 64 0
+END_REGULAR_SAT_UPDATE
--- tests/auto/qgeosatelliteinfosource/gypsymock/gypsy_mock_data.qrc
+++ tests/auto/qgeosatelliteinfosource/gypsymock/gypsy_mock_data.qrc
+<!DOCTYPE RCC>
+<RCC version="1.0">
+<qresource>
+ <file>data/gypsymock_basic_sat.journal</file>
+</qresource>
+</RCC>
--- tests/auto/qgeosatelliteinfosource/gypsymock/gypsymock.cpp
+++ tests/auto/qgeosatelliteinfosource/gypsymock/gypsymock.cpp
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "gypsymock.h"
+
+#include <QTimerEvent>
+#include <QDebug>
+#include <QMetaObject>
+
+GypsyMock::GypsyMock() :
+ m_satelliteSource(0),
+ m_satellitesChangedCallback(0)
+{
+ TRACE0;
+ m_regular.satellites = 0;
+ m_currentJournal = ":/data/gypsymock_basic_sat.journal";
+}
+
+GypsyMock::~GypsyMock()
+{
+ TRACE0;
+ if (m_regular.satellites) {
+ // fixme, needs to be analyzed why freeing here causes crash
+ //gypsy_satellite_free_satellite_array(m_regular.satellites);
+ }
+}
+
+void GypsyMock::start()
+{
+ TRACE0;
+ Q_ASSERT(QFile::exists(m_currentJournal));
+ stop(); // just in case
+ // If file is already open, continue reading it.
+ if (!m_currentJournalFile.isOpen()) {
+ m_currentJournalFile.setFileName(m_currentJournal);
+ if (!m_currentJournalFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ qCritical() << "Journal opening failed:" << m_currentJournalFile.fileName();
+ Q_ASSERT(false);
+ }
+ }
+ UPDATE_TYPE update = readNextEntry();
+ if (update == REGULAR_UPDATE) {
+ m_regular.timerId = startTimer(m_regular.timeout);
+ } else {
+ Q_ASSERT(false); // journal ran out
+ }
+}
+
+void GypsyMock::stop()
+{
+ TRACE0;
+ killTimer(m_regular.timerId);
+ m_regular.timerId = 0;
+ if (m_currentJournalFile.isOpen())
+ m_currentJournalFile.close();
+ m_satellitesChangedCallback = 0;
+}
+
+void GypsyMock::timerEvent(QTimerEvent *event)
+{
+ TRACE0;
+ if (!m_satellitesChangedCallback || !m_satelliteSource) {
+ TRACE1("No registered callbacks or objects, update dropped.");
+ return;
+ }
+ if (event->timerId() == m_regular.timerId) {
+ (*m_satellitesChangedCallback)((GypsySatellite*)1, // dummy
+ m_regular.satellites,
+ m_satelliteSource);
+ if (m_regular.repeats > 0) {
+ m_regular.repeats--;
+ return;
+ }
+ killTimer(m_regular.timerId);
+ } else {
+ TRACE2("timer astray, killing and ignoring:", event->timerId());
+ killTimer(event->timerId()); // Something has gone astray, kill and ignore
+ return;
+ }
+ // no more repeats
+ UPDATE_TYPE update = readNextEntry();
+ if (update == REGULAR_UPDATE) {
+ TRACE2("Starting timer id: ", m_regular.timerId);
+ m_regular.timerId = startTimer(m_regular.timeout);
+ } else {
+ Q_ASSERT(false); // journal ran out
+ }
+}
+
+GypsyMock::UPDATE_TYPE GypsyMock::readNextEntry()
+{
+ TRACE0;
+ QString line;
+ QTextStream stream;
+ do {
+ line = m_currentJournalFile.readLine();
+ //line = line.trimmed();
+ if (line.at(0) == '#' || line.at(0) == '\n') {
+ continue;
+ }
+ else if (line == "START_REGULAR_SAT_UPDATE\n") {
+ line = m_currentJournalFile.readLine();
+ stream.setString(&line);
+ // initialize datastructs (release any previous data)
+ if (m_regular.satellites)
+ gypsy_satellite_free_satellite_array(m_regular.satellites);
+ m_regular.satellites = g_ptr_array_new();
+ parseRegularUpdate(stream);
+ continue;
+ }
+ else if (line == "SATELLITE\n") {
+ // read single satellite data
+ line = m_currentJournalFile.readLine();
+ stream.setString(&line);
+ parseSatelliteData(stream);
+ continue; // read next satellite or end of line
+ }
+ else if (line == "END_REGULAR_SAT_UPDATE\n") {
+ return REGULAR_UPDATE; // read data for one update round
+ }
+ else {
+ qCritical("Invalid input file for gypsy mocking.");
+ Q_ASSERT(false);
+ }
+ } while (line.length() > 0);
+ TRACE1("Invalid update.");
+ return INVALID_UPDATE;
+}
+
+void GypsyMock::parseRegularUpdate(QTextStream& stream)
+{
+ TRACE0;
+ stream >> m_regular.repeats >> m_regular.timeout;
+ //qDebug() << "parsed values: " << m_regular.repeats << m_regular.timeout;
+}
+
+void GypsyMock::parseSatelliteData(QTextStream& stream)
+{
+ TRACE0;
+ // create new satellite struct
+ GypsySatelliteDetails* details = new GypsySatelliteDetails;
+ int in_use;
+ stream >> details->elevation >> details->azimuth >> details->satellite_id >> details->snr >> in_use;
+ details->in_use = (bool)in_use; // stream doesn't support bools
+ // qDebug() << "parsed values: " << details->elevation << details->azimuth << details->satellite_id << details->snr << details->in_use;
+ // add it to the struct
+ g_ptr_array_add(m_regular.satellites, (gpointer)details);
+}
+
+void GypsyMock::disconnectSignal(int callback, int satelliteSource)
+{
+ TRACE0;
+ if ((gpointer)callback == (gpointer)m_satellitesChangedCallback &&
+ (m_satelliteSource == (QObject*)satelliteSource)) {
+ m_satellitesChangedCallback = 0;
+ } else {
+ TRACE1("Pretty bad, wrong callback was requested to disconnect. Fix.");
+ }
+}
+
+void GypsyMock::connectSignal(int signal, int callback, int satelliteSource)
+{
+ TRACE0;
+ if (!QString::compare(QString::fromAscii((char*)signal), "satellites-changed")) {
+ m_satellitesChangedCallback = (SatellitesChangedCallback)callback;
+ m_satelliteSource = (QObject*)satelliteSource;
+ } else {
+ TRACE2("Invalid callback signal:", signal);
+ }
+}
--- tests/auto/qgeosatelliteinfosource/gypsymock/gypsymock.h
+++ tests/auto/qgeosatelliteinfosource/gypsymock/gypsymock.h
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GYPSYMOCK_H
+#define GYPSYMOCK_H
+
+#include <QObject>
+#include <QDebug>
+#include <QFile>
+#include <QThread>
+#include <QStringList>
+#include <QString>
+#include <QTextStream>
+#include <glib.h>
+#include <glib-object.h>
+#include <gypsy/gypsy-satellite.h>
+#include <gypsy/gypsy-control.h>
+#include <gypsy/gypsy-device.h>
+#include <gconf/gconf-client.h>
+
+#define TST_GYPSY_MOCK_TRACE 1
+
+#ifdef TST_GYPSY_MOCK_TRACE
+#define TRACE0 qDebug() << "=GypsyMock=" << __FUNCTION__
+#define TRACE1(STR1) TRACE0 << STR1;
+#define TRACE2(STR1,STR2) TRACE0 << STR1 << STR2;
+#define TRACE3(STR1, STR2, STR3) TRACE0 << STR1 << STR2 << STR3;
+#else
+#define TRACE0
+#define TRACE1
+#define TRACE2
+#define TRACE3
+#endif
+
+// ================ Misc functions
+void gypsymock_setjournal(QString journal);
+typedef void (*SatellitesChangedCallback) (GypsySatellite *satellite,
+ GPtrArray *satellites,
+ gpointer userdata);
+
+class GypsyMock: public QObject
+{
+ Q_OBJECT
+public:
+ explicit GypsyMock();
+ ~GypsyMock();
+ void disconnectSignal(gpointer callback, gpointer positionSource);
+ void setSatellitesChangedCallback(void (*callback)());
+ void singleUpdate();
+
+ enum UPDATE_TYPE {
+ INVALID_UPDATE = 0,
+ REGULAR_UPDATE,
+ SINGLE_UPDATE,
+ };
+ typedef struct {
+ int timerId;
+ int timeout;
+ int repeats;
+ GPtrArray* satellites;
+ UPDATE_TYPE updateType;
+ } UpdateData;
+
+public slots:
+ void start();
+ void stop();
+ void disconnectSignal(int callback, int positionSource);
+ void connectSignal(int signal, int callback, int positionSource);
+
+protected:
+ void timerEvent(QTimerEvent *);
+
+private:
+ UPDATE_TYPE readNextEntry();
+ void parseRegularUpdate(QTextStream& stream);
+ void parseSatelliteData(QTextStream& stream);
+
+private:
+ QString m_currentJournal;
+ QObject* m_satelliteSource;
+ QFile m_currentJournalFile;
+ UpdateData m_regular;
+ QThread m_thread;
+ SatellitesChangedCallback m_satellitesChangedCallback;
+};
+
+#endif // GYPSYMOCK_H
--- tests/auto/qgeosatelliteinfosource/qgeosatelliteinfosource.pro
+++ tests/auto/qgeosatelliteinfosource/qgeosatelliteinfosource.pro
@@ -1,22 +1,6 @@
-TEMPLATE = app
-CONFIG+=testcase
-TARGET=tst_qgeosatelliteinfosource
+TEMPLATE = subdirs
include (../../../common.pri)
-
-INCLUDEPATH += ../../../src/location
+include (../../../staticconfig.pri)
-# Input
-SOURCES += tst_qgeosatelliteinfosource.cpp \
- ../testqgeosatelliteinfosource.cpp \
- ../qlocationtestutils.cpp
-HEADERS += ../testqgeosatelliteinfosource_p.h \
- ../qlocationtestutils_p.h
-
-CONFIG += mobility
-MOBILITY = location
-
-symbian {
- TARGET.CAPABILITY = ALL -TCB
-}
-
+SUBDIRS += test
--- tests/auto/qgeosatelliteinfosource/test
+++ tests/auto/qgeosatelliteinfosource/test
+(directory)
--- tests/auto/qgeosatelliteinfosource/test/test.pro
+++ tests/auto/qgeosatelliteinfosource/test/test.pro
+TEMPLATE = app
+CONFIG+=testcase
+TARGET=tst_qgeosatelliteinfosource
+
+include (../../../../common.pri)
+
+INCLUDEPATH += ../../../../src/location
+
+SOURCES += tst_qgeosatelliteinfosource.cpp \
+ ../../testqgeosatelliteinfosource.cpp \
+ ../../qlocationtestutils.cpp \
+
+HEADERS += ../../testqgeosatelliteinfosource_p.h \
+ ../../qlocationtestutils_p.h \
+
+CONFIG += mobility
+MOBILITY = location
+
+meego: contains (gypsy_enabled, yes) {
+ DEFINES += TST_GYPSYMOCK_ENABLED=1
+ INCLUDEPATH += ../gypsymock
+ RESOURCES += ../gypsymock/gypsy_mock_data.qrc
+ # needs to be compiled because we use private symbols (init):
+ HEADERS += ../../../../src/location/qgeosatelliteinfosource_gypsy_p.h
+ HEADERS += ../gypsymock/gypsymock.h
+ SOURCES += ../../../../src/location/qgeosatelliteinfosource_gypsy.cpp
+ SOURCES += ../gypsymock/gypsymock.cpp
+ CONFIG += qdbus link_pkgconfig
+ PKGCONFIG += gconf-2.0 glib-2.0 gypsy
+ QMAKE_PKGCONFIG_REQUIRES += glib-2.0 gconf-2.0 gypsy
+ pkgconfig.path = $$QT_MOBILITY_LIB/pkgconfig
+ pkgconfig.files = QtLocation.pc
+}
+
+symbian {
+ TARGET.CAPABILITY = ALL -TCB
+}
+
--- tests/auto/qgeosatelliteinfosource/test/tst_qgeosatelliteinfosource.cpp
+++ tests/auto/qgeosatelliteinfosource/test/tst_qgeosatelliteinfosource.cpp
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../../testqgeosatelliteinfosource_p.h"
+#include <QDebug>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication app(argc, argv);
+ TestQGeoSatelliteInfoSource *test = TestQGeoSatelliteInfoSource::createDefaultSourceTest();
+ return QTest::qExec(test, argc, argv);
+}
--- tests/auto/qgeosatelliteinfosource/tst_qgeosatelliteinfosource.cpp
+++ tests/auto/qgeosatelliteinfosource/tst_qgeosatelliteinfosource.cpp
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../testqgeosatelliteinfosource_p.h"
-
-int main(int argc, char *argv[])
-{
- QCoreApplication app(argc, argv);
- TestQGeoSatelliteInfoSource *test = TestQGeoSatelliteInfoSource::createDefaultSourceTest();
- return QTest::qExec(test, argc, argv);
-}
--- tests/auto/qgeotiledmapdata
+++ tests/auto/qgeotiledmapdata
+(directory)
--- tests/auto/qgeotiledmapdata/qgeotiledmapdata.pro
+++ tests/auto/qgeotiledmapdata/qgeotiledmapdata.pro
+TEMPLATE = app
+CONFIG += testcase
+TARGET = tst_qgeotiledmapdata
+
+include(../../../common.pri)
+
+INCLUDEPATH += ../../../src/location \
+ ../../../src/location/maps \
+ ../../../src/location/maps/tiled
+
+HEADERS += ../qlocationtestutils_p.h \
+ ../pixelindex/pixelindexengine.h
+
+SOURCES += tst_qgeotiledmapdata.cpp \
+ ../pixelindex/pixelindexengine.cpp \
+ ../qlocationtestutils.cpp
+
+CONFIG += mobility
+MOBILITY = location
+
+symbian {
+ INCLUDEPATH += $${EPOCROOT}epoc32/include/osextensions
+ TARGET.CAPABILITY = ALL -TCB
+}
+
--- tests/auto/qgeotiledmapdata/tst_qgeotiledmapdata.cpp
+++ tests/auto/qgeotiledmapdata/tst_qgeotiledmapdata.cpp
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//TESTED_COMPONENT=src/location
+
+#include "../qlocationtestutils_p.h"
+
+#include <qgeocoordinate.h>
+#include <qgraphicsgeomap.h>
+#include <qgeomappixmapobject.h>
+#include <qgeomapdata.h>
+#include <qgeomappingmanager.h>
+#include <qtest.h>
+
+#include <QtGui/QApplication>
+#include <QDebug>
+#include <QtGui>
+#include <QPixmap>
+
+#include "../pixelindex/pixelindexengine.h"
+
+QTM_USE_NAMESPACE
+Q_DECLARE_METATYPE(QGeoCoordinate)
+Q_DECLARE_METATYPE(QGeoCoordinate::CoordinateFormat)
+Q_DECLARE_METATYPE(QGeoCoordinate::CoordinateType)
+Q_DECLARE_METATYPE(QGeoMappingManagerEngine*)
+Q_DECLARE_METATYPE(QGeoMapData*)
+Q_DECLARE_METATYPE(QGeoMapPixmapObject*)
+
+class tst_QGeoTiledMapData : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void initTestCase();
+
+ void pixmapDraw_data();
+ void pixmapDraw();
+
+ void objectsAtPoint_data();
+ void objectsAtPoint();
+
+ void pixmapAtDateline_data();
+ void pixmapAtDateline();
+
+ void panTest_data();
+ void panTest();
+
+private:
+ void makeFixtures(QGeoMapData *&gmd, QGeoMapPixmapObject *&obj,
+ const QGeoCoordinate ¢er, const QGeoCoordinate &pixmap,
+ const qreal &zoom, const QPixmap &targetPixmap,
+ QGeoMappingManagerEngine *mgr, const QSize &window,
+ const QSize &target);
+
+};
+
+void tst_QGeoTiledMapData::initTestCase()
+{
+ qRegisterMetaType<QGeoCoordinate>("QGeoCoordinate");
+ qRegisterMetaType<QGeoMappingManagerEngine*>("QGeoMappingManagerEngine*");
+ qRegisterMetaType<QGeoMapData*>("QGeoMapData*");
+ qRegisterMetaType<QGeoMapPixmapObject*>("QGeoMapPixmapObject*");
+ qRegisterMetaType<QPixmap>("QPixmap");
+}
+
+void tst_QGeoTiledMapData::makeFixtures(QGeoMapData *&gmd,
+ QGeoMapPixmapObject *&obj,
+ const QGeoCoordinate ¢er,
+ const QGeoCoordinate &pixmap,
+ const qreal &zoom,
+ const QPixmap &targetPixmap,
+ QGeoMappingManagerEngine *mgr,
+ const QSize &window,
+ const QSize &target)
+{
+ gmd = mgr->createMapData();
+ // this call shouldn't be necessary?
+ // but you get a nice happy sigsegv without it
+ gmd->init();
+ gmd->setWindowSize(window);
+ gmd->setZoomLevel(zoom);
+ gmd->setCenter(center);
+ obj = new QGeoMapPixmapObject();
+ obj->setPixmap(targetPixmap);
+ obj->setCoordinate(pixmap);
+ gmd->addMapObject(obj);
+ obj->setVisible(true);
+}
+
+void tst_QGeoTiledMapData::pixmapDraw_data()
+{
+ QTest::addColumn<QGeoMappingManagerEngine*>("mgr");
+ QTest::addColumn<QGeoMapData*>("gmd");
+ QTest::addColumn<QGeoMapPixmapObject*>("obj");
+ QTest::addColumn<QSize>("windowSize");
+ QTest::addColumn<QSize>("targetSize");
+ QTest::addColumn<QPoint>("offset");
+
+ QMap<QString, QVariant> params;
+ QGeoMappingManagerEngine *mgr = new WhiteTileEngine(params, this);
+
+ QSize window = QSize(500, 500);
+ QSize target = QSize(50, 50);
+ QPoint offset = QPoint(0, 0);
+ QPixmap targetPixmap = indexedPixmap(target.width(), target.height());
+
+ QGeoMapData *gmd;
+ QGeoCoordinate center;
+ QGeoMapPixmapObject *obj;
+
+ center = QGeoCoordinate(-27.58, 153.10);
+ makeFixtures(gmd, obj, center, center, 3.0, targetPixmap, mgr, window, target);
+ QTest::newRow("Brisbane @z=3") << mgr << gmd << obj << window << target << offset;
+
+ center = QGeoCoordinate(45.6, -160.2);
+ makeFixtures(gmd, obj, center, center, 2.0, targetPixmap, mgr, window, target);
+ QTest::newRow("Somewhere up north") << mgr << gmd << obj << window << target << offset;
+
+ center = QGeoCoordinate(0.0, 0.0);
+ makeFixtures(gmd, obj, center, center, 1.0, targetPixmap, mgr, window, target);
+ QTest::newRow("At 0,0") << mgr << gmd << obj << window << target << offset;
+
+ center = QGeoCoordinate(0.0, 0.0);
+ makeFixtures(gmd, obj, center, center, 0.0, targetPixmap, mgr, window, target);
+ QTest::newRow("Zoom level 0") << mgr << gmd << obj << window << target << offset;
+
+ center = QGeoCoordinate(0.0, 179.9);
+ makeFixtures(gmd, obj, center, center, 2.0, targetPixmap, mgr, window, target);
+ QTest::newRow("Positive dateline") << mgr << gmd << obj << window << target << offset;
+
+ center = QGeoCoordinate(0.0, -180.0);
+ makeFixtures(gmd, obj, center, center, 2.0, targetPixmap, mgr, window, target);
+ QTest::newRow("Negative dateline") << mgr << gmd << obj << window << target << offset;
+
+ center = QGeoCoordinate(-27.58, 153.10);
+ makeFixtures(gmd, obj, center, center, 3.0, targetPixmap, mgr, window, target);
+ offset = QPoint(5,5);
+ obj->setOffset(offset);
+ QTest::newRow("Brisbane with offset") << mgr << gmd << obj << window << target << offset;
+
+ center = QGeoCoordinate(-27.58, 153.10);
+ makeFixtures(gmd, obj, center, center, 3.0, targetPixmap, mgr, window, target);
+ offset = QPoint(-5,-5);
+ obj->setOffset(offset);
+ QTest::newRow("Brisbane with -ve offset") << mgr << gmd << obj << window << target << offset;
+
+ center = QGeoCoordinate(0.0, -180.0);
+ makeFixtures(gmd, obj, center, center, 2.0, targetPixmap, mgr, window, target);
+ offset = QPoint(-20, 0);
+ obj->setOffset(offset);
+ QTest::newRow("Negative dateline with offset") << mgr << gmd << obj << window << target << offset;
+}
+
+void tst_QGeoTiledMapData::objectsAtPoint_data()
+{
+ QTest::addColumn<QGeoMappingManagerEngine*>("mgr");
+ QTest::addColumn<QGeoMapData*>("gmd");
+ QTest::addColumn<QGeoMapPixmapObject*>("obj");
+ QTest::addColumn<QGeoCoordinate>("center");
+
+ QMap<QString, QVariant> params;
+ QGeoMappingManagerEngine *mgr = new WhiteTileEngine(params, this);
+
+ QSize window = QSize(500, 500);
+ QSize target = QSize(50, 50);
+ QPixmap targetPixmap = indexedPixmap(target.width(), target.height());
+
+ QGeoMapData *gmd;
+ QGeoCoordinate center;
+ QGeoCoordinate pixmap;
+ QGeoMapPixmapObject *obj;
+
+ center = QGeoCoordinate(-27.58, 153.10);
+ makeFixtures(gmd, obj, center, center, 3.0, targetPixmap, mgr, window, target);
+ QTest::newRow("Brisbane @z=3") << mgr << gmd << obj << center;
+
+ center = QGeoCoordinate(0.0, 0.0);
+ makeFixtures(gmd, obj, center, center, 1.0, targetPixmap, mgr, window, target);
+ QTest::newRow("At 0,0") << mgr << gmd << obj << center;
+
+ center = QGeoCoordinate(0.0, 0.0);
+ makeFixtures(gmd, obj, center, center, 0.0, targetPixmap, mgr, window, target);
+ QTest::newRow("Zoom level 0") << mgr << gmd << obj << center;
+
+ center = QGeoCoordinate(0.0, 179.8);
+ makeFixtures(gmd, obj, center, center, 2.0, targetPixmap, mgr, window, target);
+ QTest::newRow("Positive dateline") << mgr << gmd << obj << center;
+
+ center = QGeoCoordinate(0.0, -179.9);
+ pixmap = QGeoCoordinate(3.0, 175.0);
+ makeFixtures(gmd, obj, center, pixmap, 3.0, targetPixmap, mgr, window, target);
+ QTest::newRow("Crossing dateline") << mgr << gmd << obj << center;
+}
+
+void tst_QGeoTiledMapData::panTest_data()
+{
+ QTest::addColumn<QGeoMappingManagerEngine*>("mgr");
+ QTest::addColumn<QGeoMapData*>("gmd");
+ QTest::addColumn<QGeoMapPixmapObject*>("obj");
+ QTest::addColumn<QGeoCoordinate>("center");
+ QTest::addColumn<QPoint>("pxCenter");
+ QTest::addColumn<QPoint>("pan");
+ QTest::addColumn<qreal>("dist");
+ QTest::addColumn<QPoint>("pxFinal");
+
+ QMap<QString, QVariant> params;
+ QGeoMappingManagerEngine *mgr = new WhiteTileEngine(params, this);
+
+ QSize window = QSize(500, 500);
+ QSize target = QSize(50, 50);
+ QPoint pxCenter = QPoint(250, 250);
+ QPoint pxFinal = pxCenter;
+ QPixmap targetPixmap = indexedPixmap(target.width(), target.height());
+
+ QGeoMapData *gmd;
+ QGeoCoordinate center;
+ QPoint pan;
+ qreal dist;
+ QGeoMapPixmapObject *obj;
+
+ center = QGeoCoordinate(-27.58, 153.10);
+ pan = QPoint(30, 50);
+ pxFinal = pxCenter - pan;
+ dist = 1800e3;
+ makeFixtures(gmd, obj, center, center, 3.0, targetPixmap, mgr, window, target);
+ QTest::newRow("Brisbane, pan +ve") << mgr << gmd << obj <<
+ center << pxCenter << pan << dist << pxFinal;
+
+ center = QGeoCoordinate(0.0, 0.0);
+ pan = QPoint(-30, 0);
+ pxFinal = pxCenter - pan;
+ dist = 4700e3;
+ makeFixtures(gmd, obj, center, center, 1.0, targetPixmap, mgr, window, target);
+ QTest::newRow("At 0,0, pan -ve x") << mgr << gmd << obj <<
+ center << pxCenter << pan << dist << pxFinal;
+
+ window = QSize(200, 200);
+ pxCenter = QPoint(100, 100);
+ center = QGeoCoordinate(0.0, 179.8);
+ pan = QPoint(50, -10);
+ pxFinal = pxCenter - pan;
+ dist = 3900e3;
+ makeFixtures(gmd, obj, center, center, 2.0, targetPixmap, mgr, window, target);
+ QTest::newRow("Positive dateline, pan +ve") << mgr << gmd << obj << center
+ << pxCenter << pan << dist << pxFinal;
+
+ center = QGeoCoordinate(0.0, 10.0);
+ pan = QPoint(0, -30);
+ pxFinal = pxCenter;
+ dist = 0;
+ makeFixtures(gmd, obj, center, center, 2.0, targetPixmap, mgr, window, target);
+ gmd->pan(0, -500);
+ center = gmd->screenPositionToCoordinate(pxCenter);
+ QTest::newRow("Clipping at north pole") << mgr << gmd << obj << center
+ << pxCenter << pan << dist << pxFinal;
+}
+
+void tst_QGeoTiledMapData::panTest()
+{
+ QFETCH(QGeoMappingManagerEngine*, mgr);
+ QFETCH(QGeoMapData*, gmd);
+ QFETCH(QGeoMapPixmapObject*, obj);
+ QFETCH(QGeoCoordinate, center);
+ QFETCH(QPoint, pxCenter);
+ QFETCH(QPoint, pxFinal);
+ QFETCH(QPoint, pan);
+ QFETCH(qreal, dist);
+
+ QPointF c = gmd->coordinateToScreenPosition(center);
+ QCOMPARE(int(c.x()+0.5), pxCenter.x());
+ QCOMPARE(int(c.y()+0.5), pxCenter.y());
+
+ gmd->pan(pan.x(), pan.y());
+
+ QPointF c2 = gmd->coordinateToScreenPosition(center);
+ QCOMPARE(int(c2.x()+0.5), pxFinal.x());
+ QCOMPARE(int(c2.y()+0.5), pxFinal.y());
+
+ if (dist > 1e-5) {
+ QGeoCoordinate nc = gmd->screenPositionToCoordinate(pxCenter);
+ qreal d = nc.distanceTo(center);
+ QVERIFY(d > 0.9*dist && d < 1.1*dist);
+ }
+}
+
+void tst_QGeoTiledMapData::objectsAtPoint()
+{
+ QFETCH(QGeoMappingManagerEngine*, mgr);
+ QFETCH(QGeoMapData*, gmd);
+ QFETCH(QGeoMapPixmapObject*, obj);
+ QFETCH(QGeoCoordinate, center);
+
+ QVERIFY(gmd->mapObjects().contains(obj));
+ QVERIFY(gmd->mapObjectsInViewport().contains(obj));
+ QPointF centerPt = gmd->coordinateToScreenPosition(center);
+ QVERIFY(gmd->mapObjectsAtScreenPosition(centerPt).contains(obj));
+}
+
+void tst_QGeoTiledMapData::pixmapDraw()
+{
+ QFETCH(QGeoMappingManagerEngine*, mgr);
+ QFETCH(QGeoMapData*, gmd);
+ QFETCH(QGeoMapPixmapObject*, obj);
+ QFETCH(QSize, windowSize);
+ QFETCH(QSize, targetSize);
+ QFETCH(QPoint, offset);
+
+ QPixmap pm(windowSize);
+ QPainter *painter = new QPainter(&pm);
+ pm.fill(Qt::black);
+
+ QApplication::processEvents();
+
+ gmd->paint(painter, NULL);
+ painter->end();
+
+ QImage im = pm.toImage();
+
+ uint px = 0;
+ uint x = windowSize.width()/2 + offset.x();
+ for (; px < targetSize.width(); px++, x++) {
+ uint py = 0;
+ uint y = windowSize.height()/2 + offset.y();
+ for (; py < targetSize.height(); py++, y++) {
+ TilePixelValue tpv(im.pixel(x, y));
+ QCOMPARE(tpv.px(), px);
+ QCOMPARE(tpv.py(), py);
+ QCOMPARE(tpv.zoom(), 1u);
+ }
+ }
+}
+
+void tst_QGeoTiledMapData::pixmapAtDateline_data()
+{
+ QTest::addColumn<QGeoMappingManagerEngine*>("mgr");
+ QTest::addColumn<QGeoMapData*>("gmd");
+ QTest::addColumn<QGeoMapPixmapObject*>("obj");
+ QTest::addColumn<QSize>("windowSize");
+ QTest::addColumn<QSize>("targetSize");
+
+ QMap<QString, QVariant> params;
+ QGeoMappingManagerEngine *mgr = new WhiteTileEngine(params, this);
+
+ QSize window = QSize(500, 500);
+ QSize target = QSize(50, 50);
+ QPixmap targetPixmap = indexedPixmap(target.width(), target.height());
+
+ QGeoMapData *gmd;
+ QGeoCoordinate center, pixmap;
+ QGeoMapPixmapObject *obj;
+ QPoint offset;
+
+ center = QGeoCoordinate(0.0, -179.9);
+ pixmap = QGeoCoordinate(3.0, 175.0);
+ makeFixtures(gmd, obj, center, pixmap, 3.0, targetPixmap, mgr, window, target);
+ QTest::newRow("east to west") << mgr << gmd << obj << window << target;
+
+ center = QGeoCoordinate(0.0, 179.0);
+ pixmap = QGeoCoordinate(0.0, -179.0);
+ makeFixtures(gmd, obj, center, pixmap, 3.0, targetPixmap, mgr, window, target);
+ offset = QPoint(-20, -5);
+ obj->setOffset(offset);
+ QTest::newRow("west to east") << mgr << gmd << obj << window << target;
+}
+
+void tst_QGeoTiledMapData::pixmapAtDateline()
+{
+ QFETCH(QGeoMappingManagerEngine*, mgr);
+ QFETCH(QGeoMapData*, gmd);
+ QFETCH(QGeoMapPixmapObject*, obj);
+ QFETCH(QSize, windowSize);
+ QFETCH(QSize, targetSize);
+
+ QPixmap pm(windowSize);
+ QPainter *painter = new QPainter(&pm);
+ pm.fill(Qt::black);
+
+ QApplication::processEvents();
+
+ gmd->paint(painter, NULL);
+ painter->end();
+
+ QImage im = pm.toImage();
+ TilePixelValue tpv(im.pixel(windowSize.width()/2, windowSize.height()/2));
+ QVERIFY(tpv.px() < targetSize.width());
+ QVERIFY(tpv.py() < targetSize.height());
+ QVERIFY(tpv.px() > 1);
+ QVERIFY(tpv.py() > 1);
+ QCOMPARE(tpv.zoom(), 1u);
+}
+
+QTEST_MAIN(tst_QGeoTiledMapData)
+#include "tst_qgeotiledmapdata.moc"
--- tests/auto/qgeotiledmappingmanagerengine/pixelindexengine.cpp
+++ tests/auto/qgeotiledmappingmanagerengine/pixelindexengine.cpp
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "pixelindexengine.h"
-#include <QBuffer>
-#include <QByteArray>
-
-TilePixelValue::TilePixelValue()
- : data_(0) {}
-
-TilePixelValue::TilePixelValue(QRgb rgb)
- : data_(0)
-{
- setRgb(rgb);
-}
-
-TilePixelValue::TilePixelValue(unsigned int zoom, unsigned int px, unsigned int py)
- : data_(0)
-{
- setZoom(zoom);
- setPx(px);
- setPy(py);
-}
-
-TilePixelValue::~TilePixelValue() {}
-
-void TilePixelValue::setRgb(QRgb rgb)
-{
- data_ = static_cast<unsigned int>(rgb);
-}
-
-QRgb TilePixelValue::rgb() const
-{
- return static_cast<QRgb>(data_);
-}
-
-void TilePixelValue::setZoom(unsigned int zoom)
-{
- data_ = (data_ & 0xFFFFFFF0) + (zoom & 0x0000000F);
-}
-
-unsigned int TilePixelValue::zoom() const
-{
- return (data_ & 0x0000000F);
-}
-
-void TilePixelValue::setPx(unsigned int px)
-{
- data_ = (data_ & 0xFFFFC00F) + ((px & 0x000003FF) << 4);
-}
-
-unsigned int TilePixelValue::px() const
-{
- return (data_ & 0x00003FF0) >> 4;
-}
-
-void TilePixelValue::setPy(unsigned int py)
-{
- data_ = (data_ & 0xFF003FFF) + ((py & 0x000003FF) << 14);
-}
-
-unsigned int TilePixelValue::py() const
-{
- return (data_ & 0x00FFC000) >> 14;
-}
-
-PixmapTiledMapReply::PixmapTiledMapReply(QPixmap &pixmap, const QGeoTiledMapRequest &request, QObject *parent) :
- QGeoTiledMapReply(request, parent),
- m_pixmap(pixmap)
-{
- QByteArray ba;
- QBuffer buff(&ba);
- buff.open(QIODevice::WriteOnly);
- pixmap.save(&buff, "PNG");
-
- setMapImageData(ba);
- setMapImageFormat("PNG");
- setFinished(true);
-}
-
-PixelIndexEngine::PixelIndexEngine(const QMap<QString, QVariant> ¶meters, QObject *parent) :
- QGeoTiledMappingManagerEngine(parameters, parent)
-{
- // might want to parametrise these for future use
- setTileSize(QSize(128,128));
- setMinimumZoomLevel(0.00);
- setMaximumZoomLevel(3.0);
-
- QList<QGraphicsGeoMap::MapType> types;
- types << QGraphicsGeoMap::StreetMap;
- types << QGraphicsGeoMap::TerrainMap;
- setSupportedMapTypes(types);
-
- QList<QGraphicsGeoMap::ConnectivityMode> modes;
- modes << QGraphicsGeoMap::OfflineMode;
- setSupportedConnectivityModes(modes);
-}
-
-QGeoTiledMapReply *PixelIndexEngine::getTileImage(const QGeoTiledMapRequest &request)
-{
- QImage im(128, 128, QImage::Format_RGB888);
- im.fill(0);
-
- for (int y = 0; y < im.height(); y++) {
- for (int x = 0; x < im.width(); x++) {
- TilePixelValue tpv;
- tpv.setPy(request.row()*128 + y);
- tpv.setPx(request.column()*128 + x);
- tpv.setZoom(request.zoomLevel());
- im.setPixel(x, y, tpv.rgb());
- }
- }
-
- QPixmap pm = QPixmap::fromImage(im);
- return new PixmapTiledMapReply(pm, request);
-}
--- tests/auto/qgeotiledmappingmanagerengine/pixelindexengine.h
+++ tests/auto/qgeotiledmappingmanagerengine/pixelindexengine.h
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PIXELINDEXENGINE_H
-#define PIXELINDEXENGINE_H
-
-#include <QtGui/QApplication>
-#include <QDebug>
-#include <QtGui>
-
-#include <qgeocoordinate.h>
-#include <qgraphicsgeomap.h>
-#include <qgeomapdata.h>
-#include <qgeotiledmapdata.h>
-#include <qgeotiledmaprequest.h>
-#include <qgeotiledmapreply.h>
-#include <qgeotiledmappingmanagerengine.h>
-
-QTM_USE_NAMESPACE
-
-/*
-typedef union {
- QRgb rgb;
- struct {
- unsigned int zoom:4;
- unsigned int px:10;
- unsigned int py:10;
- };
-} TilePixelValue;
-*/
-class TilePixelValue {
-
-public:
- TilePixelValue();
- TilePixelValue(QRgb rgb);
- TilePixelValue(unsigned int zoom, unsigned int px, unsigned int py);
- ~TilePixelValue();
-
- void setRgb(QRgb rgb);
- QRgb rgb() const;
-
- void setZoom(unsigned int zoom);
- unsigned int zoom() const;
-
- void setPx(unsigned int px);
- unsigned int px() const;
-
- void setPy(unsigned int py);
- unsigned int py() const;
-
-private:
- unsigned int data_;
-};
-
-/*!
- A tiled map reply subclass that is constructed already finished, with
- a given QPixmap as its content (saved in PNG format).
- */
-class PixmapTiledMapReply : public QGeoTiledMapReply
-{
- Q_OBJECT
-public:
- PixmapTiledMapReply(QPixmap &pixmap, const QGeoTiledMapRequest &request,
- QObject *parent=0);
-
-private:
- QPixmap m_pixmap;
-};
-
-/*!
- Tiled map engine that returns tiles made up of pixels with their color set
- to a TilePixelValue for that pixel's location and zoom level. Used for testing
- the map rendering code.
- */
-class PixelIndexEngine : public QGeoTiledMappingManagerEngine
-{
- Q_OBJECT
-public:
- PixelIndexEngine(const QMap<QString, QVariant> ¶meters,
- QObject *parent=0);
-
- QGeoTiledMapReply *getTileImage(const QGeoTiledMapRequest &request);
-
-};
-
-#endif // PIXELINDEXENGINE_H
--- tests/auto/qgeotiledmappingmanagerengine/qgeotiledmappingmanagerengine.pro
+++ tests/auto/qgeotiledmappingmanagerengine/qgeotiledmappingmanagerengine.pro
@@ -10,10 +10,10 @@
# Input
HEADERS += ../qlocationtestutils_p.h \
- pixelindexengine.h
+ ../pixelindex/pixelindexengine.h
SOURCES += tst_qgeotiledmappingmanagerengine.cpp \
- pixelindexengine.cpp \
+ ../pixelindex/pixelindexengine.cpp \
../qlocationtestutils.cpp
CONFIG += mobility
--- tests/auto/qgeotiledmappingmanagerengine/tst_qgeotiledmappingmanagerengine.cpp
+++ tests/auto/qgeotiledmappingmanagerengine/tst_qgeotiledmappingmanagerengine.cpp
@@ -53,7 +53,7 @@
#include <QDebug>
#include <QtGui>
-#include "pixelindexengine.h"
+#include "../pixelindex/pixelindexengine.h"
QTM_USE_NAMESPACE
Q_DECLARE_METATYPE(QGeoCoordinate)
@@ -101,9 +101,9 @@
QTest::addColumn<qreal>("lon");
QTest::addColumn<QPoint>("centerPixel");
- QTest::newRow("Brisbane @z=3") << 3.0 << -27.58 << 153.10;
- QTest::newRow("Somewhere random") << 3.0 << 50.0 << -120.0;
- QTest::newRow("Just before the date line") << 3.0 << -85.0 << 179.99;
+ QTest::newRow("Brisbane @z=3") << qreal(3.0) << qreal(-27.58) << qreal(153.10);
+ QTest::newRow("Somewhere random") << qreal(3.0) << qreal(50.0) << qreal(-120.0);
+ QTest::newRow("Just before the date line") << qreal(3.0) << qreal(-85.0) << qreal(179.8);
}
/*!
@@ -185,9 +185,9 @@
QTest::addColumn<uint>("midx");
QTest::addColumn<uint>("midy");
- QTest::newRow("zoom level 1") << 1.0 << 128u << 128u;
- QTest::newRow("zoom level 2") << 2.0 << 256u << 256u;
- QTest::newRow("zoom level 3") << 3.0 << 512u << 512u;
+ QTest::newRow("zoom level 1") << qreal(1.0) << 128u << 128u;
+ QTest::newRow("zoom level 2") << qreal(2.0) << 256u << 256u;
+ QTest::newRow("zoom level 3") << qreal(3.0) << 512u << 512u;
}
/*!
--- tests/auto/qmessagestore/tst_qmessagestore.cpp
+++ tests/auto/qmessagestore/tst_qmessagestore.cpp
@@ -160,6 +160,8 @@
void testFolder_data();
void testFolder();
+ void testRemoveAccount();
+
void testMessage_data();
void testMessage();
@@ -537,6 +539,23 @@
<< "byFilter";
}
+void tst_QMessageStore::testRemoveAccount()
+{
+ QVERIFY(QMessageManager().queryAccounts(QMessageAccountFilter::byName("Mr. Temp")).empty());
+
+ Support::Parameters p;
+ p.insert("name", "Mr. Temp");
+ p.insert("fromAddress", "anaddress at example.com");
+ QMessageAccountId id(Support::addAccount(p));
+ QVERIFY(id.isValid());
+
+ QVERIFY(!QMessageManager().queryAccounts(QMessageAccountFilter::byName("Mr. Temp")).empty());
+ QVERIFY(QMessageManager().removeAccount(id));
+
+ QTest::qWait(4000);
+ QVERIFY(QMessageManager().queryAccounts(QMessageAccountFilter::byName("Mr. Temp")).empty());
+}
+
void tst_QMessageStore::testMessage()
{
// Ensure we have an account to create messages with
--- tests/auto/qorganizermanager/tst_qorganizermanager.cpp
+++ tests/auto/qorganizermanager/tst_qorganizermanager.cpp
@@ -181,6 +181,7 @@
void recurrence();
void idComparison();
void emptyItemManipulation();
+ void partialSave();
/* Tests that take no data */
void itemValidation();
@@ -222,6 +223,7 @@
void recurrence_data() {addManagers();}
void idComparison_data() {addManagers();}
void emptyItemManipulation_data() {addManagers();}
+ void partialSave_data() {addManagers();}
};
class BasicItemLocalId : public QOrganizerItemEngineId
@@ -2493,12 +2495,17 @@
QVERIFY(arg.count() == 1);
QCOMPARE(QOrganizerItemId(arg.at(0)), cid);
+ QSharedPointer<QOrganizerItemObserver> todo1Observer = m1->observeItem(cid);
+ QScopedPointer<QSignalSpy> spyObserverModified1(new QSignalSpy(todo1Observer.data(), SIGNAL(itemChanged())));
+ QScopedPointer<QSignalSpy> spyObserverRemoved1(new QSignalSpy(todo1Observer.data(), SIGNAL(itemRemoved())));
+
// verify save modified emits signal changed
nc.setLabel("label me that");
QVERIFY(todo.saveDetail(&nc));
QVERIFY(m1->saveItem(&todo));
modSigCount += 1;
QTRY_COMPARE(spyModified.count(), modSigCount);
+ QTRY_COMPARE(spyObserverModified1->count(), 1);
args = spyModified.takeFirst();
modSigCount -= 1;
arg = args.first().value<QList<QOrganizerItemId> >();
@@ -2509,6 +2516,7 @@
QVERIFY(m1->removeItem(todo.id()));
remSigCount += 1;
QTRY_COMPARE(spyRemoved.count(), remSigCount);
+ QTRY_COMPARE(spyObserverRemoved1->count(), 1);
args = spyRemoved.takeFirst();
remSigCount -= 1;
arg = args.first().value<QList<QOrganizerItemId> >();
@@ -2529,6 +2537,15 @@
QTRY_COMPARE(spyModified.count(), modSigCount);
QTRY_COMPARE(spyAdded.count(), addSigCount);
+ spyObserverModified1->clear();
+ spyObserverRemoved1->clear();
+ QSharedPointer<QOrganizerItemObserver> todo2Observer = m1->observeItem(todo2.id());
+ QSharedPointer<QOrganizerItemObserver> todo3Observer = m1->observeItem(todo3.id());
+ QScopedPointer<QSignalSpy> spyObserverModified2(new QSignalSpy(todo2Observer.data(), SIGNAL(itemChanged())));
+ QScopedPointer<QSignalSpy> spyObserverModified3(new QSignalSpy(todo3Observer.data(), SIGNAL(itemChanged())));
+ QScopedPointer<QSignalSpy> spyObserverRemoved2(new QSignalSpy(todo2Observer.data(), SIGNAL(itemRemoved())));
+ QScopedPointer<QSignalSpy> spyObserverRemoved3(new QSignalSpy(todo3Observer.data(), SIGNAL(itemRemoved())));
+
// verify multiple modifies works as advertised
nc2.setLabel("M.");
QVERIFY(todo2.saveDetail(&nc2));
@@ -2543,6 +2560,9 @@
QVERIFY(m1->saveItem(&todo3));
modSigCount += 1;
QTRY_COMPARE(spyModified.count(), modSigCount);
+ QTRY_COMPARE(spyObserverModified2->count(), 2);
+ QTRY_COMPARE(spyObserverModified3->count(), 1);
+ QCOMPARE(spyObserverModified1->count(), 0);
// verify multiple removes works as advertised
m1->removeItem(todo3.id());
@@ -2550,6 +2570,9 @@
m1->removeItem(todo2.id());
remSigCount += 1;
QTRY_COMPARE(spyRemoved.count(), remSigCount);
+ QTRY_COMPARE(spyObserverRemoved2->count(), 1);
+ QTRY_COMPARE(spyObserverRemoved3->count(), 1);
+ QCOMPARE(spyObserverRemoved1->count(), 0);
QVERIFY(!m1->removeItem(todo.id())); // not saved.
@@ -2577,6 +2600,16 @@
QTRY_WAIT( while(spyAdded.size() > 0) {sigids += spyAdded.takeFirst().at(0).value<QList<QOrganizerItemId> >(); }, sigids.contains(todo.id()) && sigids.contains(todo2.id()) && sigids.contains(todo3.id()));
QTRY_COMPARE(spyModified.count(), 0);
+
+ todo1Observer = m1->observeItem(todo.id());
+ todo2Observer = m1->observeItem(todo2.id());
+ todo3Observer = m1->observeItem(todo3.id());
+ spyObserverModified1.reset(new QSignalSpy(todo1Observer.data(), SIGNAL(itemChanged())));
+ spyObserverModified2.reset(new QSignalSpy(todo2Observer.data(), SIGNAL(itemChanged())));
+ spyObserverModified3.reset(new QSignalSpy(todo3Observer.data(), SIGNAL(itemChanged())));
+ spyObserverRemoved1.reset(new QSignalSpy(todo1Observer.data(), SIGNAL(itemRemoved())));
+ spyObserverRemoved2.reset(new QSignalSpy(todo2Observer.data(), SIGNAL(itemRemoved())));
+ spyObserverRemoved3.reset(new QSignalSpy(todo3Observer.data(), SIGNAL(itemRemoved())));
QTRY_COMPARE(spyRemoved.count(), 0);
/* Batch modifies */
@@ -2594,6 +2627,9 @@
sigids.clear();
QTRY_WAIT( while(spyModified.size() > 0) {sigids += spyModified.takeFirst().at(0).value<QList<QOrganizerItemId> >(); }, sigids.contains(todo.id()) && sigids.contains(todo2.id()) && sigids.contains(todo3.id()));
+ QTRY_COMPARE(spyObserverModified1->count(), 1);
+ QTRY_COMPARE(spyObserverModified2->count(), 1);
+ QTRY_COMPARE(spyObserverModified3->count(), 1);
/* Batch removes */
batchRemove << todo.id() << todo2.id() << todo3.id();
@@ -2602,6 +2638,9 @@
sigids.clear();
QTRY_WAIT( while(spyRemoved.size() > 0) {sigids += spyRemoved.takeFirst().at(0).value<QList<QOrganizerItemId> >(); }, sigids.contains(todo.id()) && sigids.contains(todo2.id()) && sigids.contains(todo3.id()));
+ QTRY_COMPARE(spyObserverRemoved1->count(), 1);
+ QTRY_COMPARE(spyObserverRemoved2->count(), 1);
+ QTRY_COMPARE(spyObserverRemoved3->count(), 1);
QTRY_COMPARE(spyAdded.count(), 0);
QTRY_COMPARE(spyModified.count(), 0);
@@ -3850,6 +3889,116 @@
QVERIFY(!cm->removeItem(invalidId)); // id from different manager
}
+void tst_QOrganizerManager::partialSave()
+{
+ QFETCH(QString, uri);
+ QScopedPointer<QOrganizerManager> cm(QOrganizerManager::fromUri(uri));
+
+ QList<QOrganizerItem> items;
+ QOrganizerEvent event = QOrganizerEvent();
+ event.setDisplayLabel("One");
+ event.setStartDateTime(QDateTime(QDate(2010, 12, 25), QTime(1, 0, 0)));
+ event.setEndDateTime(QDateTime(QDate(2010, 12, 25), QTime(1, 30, 0)));
+ event.setDescription("One description");
+ items.append(event);
+
+ event = QOrganizerEvent();
+ event.setDisplayLabel("Two");
+ event.setStartDateTime(QDateTime(QDate(2010, 12, 25), QTime(2, 0, 0)));
+ event.setEndDateTime(QDateTime(QDate(2010, 12, 25), QTime(2, 30, 0)));
+ event.setDescription("Two description");
+ items.append(event);
+
+ event = QOrganizerEvent();
+ event.setDisplayLabel("Three");
+ event.setStartDateTime(QDateTime(QDate(2010, 12, 25), QTime(3, 0, 0)));
+ event.setEndDateTime(QDateTime(QDate(2010, 12, 25), QTime(3, 30, 0)));
+ items.append(event);
+
+ event = QOrganizerEvent();
+ event.setDisplayLabel("Four");
+ event.setStartDateTime(QDateTime(QDate(2010, 12, 25), QTime(4, 0, 0)));
+ event.setEndDateTime(QDateTime(QDate(2010, 12, 25), QTime(4, 30, 0)));
+ items.append(event);
+
+ // First save these items
+ QVERIFY(cm->saveItems(&items));
+ QList<QOrganizerItem> originalItems = items;
+
+ items[0].setDescription("One changed description");
+
+ // 0) empty mask == full save
+ QVERIFY(cm->saveItems(&items, QStringList()));
+
+ // That should have updated everything
+ QOrganizerItem a = cm->item(originalItems[0].id());
+ QVERIFY(a.description() == "One changed description");
+
+ // 1) Change the description for b, mask it out
+ items[1].setDescription("Two changed description");
+ QVERIFY(cm->saveItems(&items, QStringList(QOrganizerEventTime::DefinitionName)));
+ QVERIFY(cm->errorMap().isEmpty());
+
+ QOrganizerItem b = cm->item(originalItems[1].id());
+ QCOMPARE(b.description(), QString("Two description"));
+
+ // 2) save a modified detail in the mask
+ items[1].setDescription("Two changed description");
+
+ QVERIFY(cm->saveItems(&items, QStringList(QOrganizerItemDescription::DefinitionName)));
+ QVERIFY(cm->errorMap().isEmpty());
+ b = cm->item(originalItems[1].id());
+ QCOMPARE(b.description(), QString("Two changed description"));
+
+ // 3) Remove a description
+ QOrganizerItemDescription desc = items[1].detail<QOrganizerItemDescription>();
+ QVERIFY(items[1].removeDetail(&desc));
+ // Mask it out, so it shouldn't work.
+ QVERIFY(cm->saveItems(&items, QStringList(QOrganizerEventTime::DefinitionName)));
+ QVERIFY(cm->errorMap().isEmpty());
+ b = cm->item(originalItems[1].id());
+ QCOMPARE(b.details<QOrganizerItemDescription>().count(), 1);
+ // Now include it in the mask
+ QVERIFY(cm->saveItems(&items, QStringList(QOrganizerItemDescription::DefinitionName)));
+ QVERIFY(cm->errorMap().isEmpty());
+ b = cm->item(originalItems[1].id());
+ QCOMPARE(b.details<QOrganizerItemDescription>().count(), 0);
+
+ // 4 - New item, no details in the mask
+ QOrganizerItem newItem = originalItems[3];
+ newItem.setId(QOrganizerItemId());
+
+ items.append(newItem); // this is items[4]
+ QVERIFY(cm->saveItems(&items, QStringList(QOrganizerItemTag::DefinitionName)));
+ QVERIFY(cm->errorMap().isEmpty());
+ QVERIFY(!items[4].id().isNull()); // Saved
+ b = cm->item(items[4].id());
+ QCOMPARE(b.details<QOrganizerItemDisplayLabel>().count(), 0); // not saved
+ QCOMPARE(b.details<QOrganizerEventTime>().count(), 0); // not saved
+
+ // 5 - New item, some details in the mask
+ newItem = originalItems[2];
+ newItem.setId(QOrganizerItemId());
+ items.append(newItem); // this is items[5]
+ QVERIFY(cm->saveItems(&items, QStringList(QOrganizerItemDisplayLabel::DefinitionName)));
+ QVERIFY(cm->errorMap().isEmpty());
+ QVERIFY(!items[5].id().isNull()); // Saved
+ b = cm->item(items[5].id());
+ QCOMPARE(b.details<QOrganizerItemDisplayLabel>().count(), 1);
+ QCOMPARE(b.details<QOrganizerEventTime>().count(), 0); // not saved
+
+ // 6 Have a non existing item in the middle followed by a save error
+ cm->removeItem(items[4].id());
+ QOrganizerItemDetail badDetail("BadDetail");
+ badDetail.setValue("BadField", "BadValue");
+ items[5].saveDetail(&badDetail);
+ QVERIFY(!cm->saveItems(&items, QStringList("BadDetail")));
+ QMap<int, QOrganizerManager::Error> errorMap = cm->errorMap();
+ QCOMPARE(errorMap.count(), 2);
+ QCOMPARE(errorMap[4], QOrganizerManager::DoesNotExistError);
+ QCOMPARE(errorMap[5], QOrganizerManager::InvalidDetailError);
+}
+
void tst_QOrganizerManager::dateRange()
{
QFETCH(QOrganizerItem, item);
--- tests/auto/qversitcontactexporter/tst_qversitcontactexporter.cpp
+++ tests/auto/qversitcontactexporter/tst_qversitcontactexporter.cpp
@@ -1180,34 +1180,34 @@
document = mExporter->documents().first();
QCOMPARE(countProperties(document), 0);
- // Test service providers Jabber, AIM, ICQ, MSN, Yahoo, Skype
+ // Test protocols Jabber, AIM, ICQ, MSN, Yahoo, Skype
contact.clearDetails();
onlineAccount = QContactOnlineAccount();
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceJabber);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolJabber);
onlineAccount.setAccountUri("a");
contact.saveDetail(&onlineAccount);
onlineAccount = QContactOnlineAccount();
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceAim);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolAim);
onlineAccount.setAccountUri("b");
contact.saveDetail(&onlineAccount);
onlineAccount = QContactOnlineAccount();
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceIcq);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolIcq);
onlineAccount.setAccountUri("c");
contact.saveDetail(&onlineAccount);
onlineAccount = QContactOnlineAccount();
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceMsn);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolMsn);
onlineAccount.setAccountUri("d");
contact.saveDetail(&onlineAccount);
onlineAccount = QContactOnlineAccount();
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceQq);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolQq);
onlineAccount.setAccountUri("e");
contact.saveDetail(&onlineAccount);
onlineAccount = QContactOnlineAccount();
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceYahoo);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolYahoo);
onlineAccount.setAccountUri("f");
contact.saveDetail(&onlineAccount);
onlineAccount = QContactOnlineAccount();
- onlineAccount.setServiceProvider(QContactOnlineAccount::ServiceSkype);
+ onlineAccount.setProtocol(QContactOnlineAccount::ProtocolSkype);
onlineAccount.setAccountUri("g");
contact.saveDetail(&onlineAccount);
--- tests/auto/qversitcontactimporter/tst_qversitcontactimporter.cpp
+++ tests/auto/qversitcontactimporter/tst_qversitcontactimporter.cpp
@@ -1105,7 +1105,7 @@
subTypes = onlineAccount.subTypes();
QCOMPARE(subTypes.count(),1);
QVERIFY(subTypes.first() == QContactOnlineAccount::SubTypeImpp);
- QVERIFY(onlineAccount.serviceProvider() == QContactOnlineAccount::ServiceJabber);
+ QVERIFY(onlineAccount.protocol() == QContactOnlineAccount::ProtocolJabber);
document = QVersitDocument(QVersitDocument::VCard30Type);
property.setName("X-AIM");
@@ -1139,23 +1139,23 @@
contact = mImporter->contacts().first();
QList<QContactOnlineAccount> onlineAccounts = contact.details<QContactOnlineAccount>();
QCOMPARE(onlineAccounts.size(), 9);
- QVERIFY(onlineAccounts[0].serviceProvider() == QContactOnlineAccount::ServiceAim);
+ QVERIFY(onlineAccounts[0].protocol() == QContactOnlineAccount::ProtocolAim);
QVERIFY(onlineAccounts[0].accountUri() == "a");
- QVERIFY(onlineAccounts[1].serviceProvider() == QContactOnlineAccount::ServiceIcq);
+ QVERIFY(onlineAccounts[1].protocol() == QContactOnlineAccount::ProtocolIcq);
QVERIFY(onlineAccounts[1].accountUri() == "b");
- QVERIFY(onlineAccounts[2].serviceProvider() == QContactOnlineAccount::ServiceMsn);
+ QVERIFY(onlineAccounts[2].protocol() == QContactOnlineAccount::ProtocolMsn);
QVERIFY(onlineAccounts[2].accountUri() == "c");
- QVERIFY(onlineAccounts[3].serviceProvider() == QContactOnlineAccount::ServiceQq);
+ QVERIFY(onlineAccounts[3].protocol() == QContactOnlineAccount::ProtocolQq);
QVERIFY(onlineAccounts[3].accountUri() == "d");
- QVERIFY(onlineAccounts[4].serviceProvider() == QContactOnlineAccount::ServiceYahoo);
+ QVERIFY(onlineAccounts[4].protocol() == QContactOnlineAccount::ProtocolYahoo);
QVERIFY(onlineAccounts[4].accountUri() == "e");
- QVERIFY(onlineAccounts[5].serviceProvider() == QContactOnlineAccount::ServiceSkype);
+ QVERIFY(onlineAccounts[5].protocol() == QContactOnlineAccount::ProtocolSkype);
QVERIFY(onlineAccounts[5].accountUri() == "f");
- QVERIFY(onlineAccounts[6].serviceProvider() == QContactOnlineAccount::ServiceSkype);
+ QVERIFY(onlineAccounts[6].protocol() == QContactOnlineAccount::ProtocolSkype);
QVERIFY(onlineAccounts[6].accountUri() == "g");
- QVERIFY(onlineAccounts[7].serviceProvider().isEmpty());
+ QVERIFY(onlineAccounts[7].protocol().isEmpty());
QVERIFY(onlineAccounts[7].accountUri() == "h");
- QVERIFY(onlineAccounts[8].serviceProvider().isEmpty());
+ QVERIFY(onlineAccounts[8].protocol().isEmpty());
QVERIFY(onlineAccounts[8].accountUri() == "i");
}
--- tests/auto/support/support_maemo6.cpp
+++ tests/auto/support/support_maemo6.cpp
@@ -94,7 +94,7 @@
}
// Ensure that we initialise to the current version for file storage
- const QString key("qtopiamailfile");
+ const QString key("qmfstoragemanager");
QMailAccountConfiguration config;
config.addServiceConfiguration(key);
--- tests/auto/testqgeopositioninfosource.cpp
+++ tests/auto/testqgeopositioninfosource.cpp
@@ -56,6 +56,11 @@
#include "testqgeopositioninfosource_p.h"
#include "qlocationtestutils_p.h"
+#ifdef TST_GEOCLUEMOCK_ENABLED
+#include <geoclue/geoclue-master.h>
+#include <geoclue/geoclue-master-client.h>
+#include <geoclue/geoclue-velocity.h>
+#endif
Q_DECLARE_METATYPE(QGeoPositionInfoSource::PositioningMethod)
Q_DECLARE_METATYPE(QGeoPositionInfoSource::PositioningMethods)
@@ -120,6 +125,9 @@
TestQGeoPositionInfoSource::TestQGeoPositionInfoSource(QObject *parent)
: QObject(parent)
{
+#ifdef TST_GEOCLUEMOCK_ENABLED
+ m_geoclueMock = 0;
+#endif
m_testingDefaultSource = false;
}
@@ -163,15 +171,26 @@
void TestQGeoPositionInfoSource::initTestCase()
{
base_initTestCase();
+#ifdef TST_GEOCLUEMOCK_ENABLED
+ m_threadGeoclueMock.start();
+#endif
}
void TestQGeoPositionInfoSource::init()
{
+#ifdef TST_GEOCLUEMOCK_ENABLED
+ initGeoclueMock();
+#endif
base_init();
}
void TestQGeoPositionInfoSource::cleanup()
{
+#ifdef TST_GEOCLUEMOCK_ENABLED
+ if (m_geoclueMock)
+ delete m_geoclueMock;
+ m_geoclueMock =0;
+#endif
base_cleanup();
}
@@ -180,6 +199,18 @@
base_cleanupTestCase();
}
+#ifdef TST_GEOCLUEMOCK_ENABLED
+void TestQGeoPositionInfoSource::initGeoclueMock()
+{
+ if (m_geoclueMock)
+ delete m_geoclueMock;
+ m_geoclueMock = new GeoclueMock;
+ geocluemock_setjournal(":/data/gcmock_basic_vel_pos.journal");
+ m_geoclueMock->moveToThread(&m_threadGeoclueMock);
+ QMetaObject::invokeMethod(m_geoclueMock, "start", Qt::BlockingQueuedConnection);
+}
+#endif
+
// TC_ID_3_x_1
void TestQGeoPositionInfoSource::constructor_withParent()
{
@@ -290,6 +321,8 @@
QVERIFY(source != 0);
#elif defined(Q_WS_MAEMO_6)
QVERIFY(source != 0);
+#elif defined(Q_WS_MEEGO)
+ QVERIFY(source != 0);
#else
QVERIFY(source == 0);
#endif
@@ -312,7 +345,9 @@
{
QTest::addColumn<int>("interval");
QTest::addColumn<int>("expectedInterval");
-
+#ifdef TST_GEOCLUEMOCK_ENABLED
+ initGeoclueMock();
+#endif
QGeoPositionInfoSource *source = createTestSource();
int minUpdateInterval = source ? source->minimumUpdateInterval() : -1;
if (source)
@@ -342,7 +377,6 @@
void TestQGeoPositionInfoSource::lastKnownPosition()
{
CHECK_SOURCE_VALID;
-
QFETCH(int, positioningMethod);
QFETCH(bool, lastKnownPositionArgument);
QFETCH(bool, positionValid);
@@ -425,12 +459,16 @@
QTest::addColumn<bool>("lastKnownPositionArgument");
QTest::addColumn<bool>("positionValid");
- QTest::newRow("satellite - false") << int(QGeoPositionInfoSource::SatellitePositioningMethods) << false << true;
- QTest::newRow("satellite - true") << int(QGeoPositionInfoSource::SatellitePositioningMethods) << true << true;
+#ifndef GEOCLUE_MASTER_AVAILABLE
+ // Todo: this needs to be fixed in MeeGo; currently it returns any lastPosition from any source regardless of satellite
+ // parameter.
QTest::newRow("nonsatellite - false") << int(QGeoPositionInfoSource::NonSatellitePositioningMethods) << false << false;
QTest::newRow("nonsatellite - true") << int(QGeoPositionInfoSource::NonSatellitePositioningMethods) << true << true;
+#endif
QTest::newRow("all - false") << int(QGeoPositionInfoSource::AllPositioningMethods) << false << true;
QTest::newRow("all - true") << int(QGeoPositionInfoSource::AllPositioningMethods) << true << true;
+ QTest::newRow("satellite - false") << int(QGeoPositionInfoSource::SatellitePositioningMethods) << false << true;
+ QTest::newRow("satellite - true") << int(QGeoPositionInfoSource::SatellitePositioningMethods) << true << true;
}
void TestQGeoPositionInfoSource::minimumUpdateInterval()
@@ -613,14 +651,12 @@
void TestQGeoPositionInfoSource::stopUpdates_withoutStart()
{
CHECK_SOURCE_VALID;
-
m_source->stopUpdates(); // check there is no crash
}
void TestQGeoPositionInfoSource::requestUpdate()
{
CHECK_SOURCE_VALID;
-
QFETCH(int, timeout);
QSignalSpy spy(m_source, SIGNAL(updateTimeout()));
m_source->requestUpdate(timeout);
--- tests/auto/testqgeopositioninfosource_p.h
+++ tests/auto/testqgeopositioninfosource_p.h
@@ -43,6 +43,11 @@
#define TESTQGEOPOSITIONINFOSOURCE_P_H
#include <qmobilityglobal.h>
+#ifdef TST_GEOCLUEMOCK_ENABLED
+#include "geocluemock.h"
+#include <QThread>
+#endif
+
#include <QTest>
#include <QObject>
@@ -127,10 +132,14 @@
void removeSlotForPositionUpdated();
private:
+#ifdef TST_GEOCLUEMOCK_ENABLED
+ GeoclueMock* m_geoclueMock;
+ QThread m_threadGeoclueMock;
+ void initGeoclueMock();
+#endif
QGeoPositionInfoSource *m_source;
bool m_testingDefaultSource;
bool m_testSlot2Called;
};
-
#endif
--- tests/auto/testqgeosatelliteinfosource.cpp
+++ tests/auto/testqgeosatelliteinfosource.cpp
@@ -1,4 +1,4 @@
-/****************************************************************************
+/*********************f*******************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
@@ -52,6 +52,11 @@
#include "testqgeosatelliteinfosource_p.h"
#include "qlocationtestutils_p.h"
+#ifdef TST_GYPSYMOCK_ENABLED
+#include "qgeosatelliteinfosource_gypsy_p.h"
+#include <QProcessEnvironment>
+#include "../gypsymock/gypsymock.h"
+#endif
Q_DECLARE_METATYPE(QList<QGeoSatelliteInfo>)
@@ -60,6 +65,7 @@
// Must provide a valid source, unless testing the source
// returned by QGeoSatelliteInfoSource::createDefaultSource() on a system
// that has no default source
+// todo is a mock check useful here?
#define CHECK_SOURCE_VALID { \
if (!m_source) { \
if (m_testingDefaultSource && QGeoSatelliteInfoSource::createDefaultSource(0) == 0) \
@@ -69,6 +75,27 @@
} \
}
+#ifdef TST_GYPSYMOCK_ENABLED
+static bool useMockBackend()
+{
+ static bool mock_evaluated = false;
+ static bool use_mock = false;
+ if (mock_evaluated)
+ return use_mock;
+ QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
+ if (env.contains("TST_DISABLE_MOCKEND") &&
+ ((env.value("TST_DISABLE_MOCKEND") == "1") ||
+ (env.value("TST_DISABLE_MOCKEND") == "true") ||
+ (env.value("TST_DISABLE_MOCKEND") == "yes")))
+ use_mock = false;
+ else
+ use_mock = true;
+ mock_evaluated = true;
+ TRACE2("Are we using mockend:", use_mock);
+ return use_mock;
+}
+#endif
+
class MySatelliteSource : public QGeoSatelliteInfoSource
{
Q_OBJECT
@@ -76,19 +103,230 @@
MySatelliteSource(QObject *parent = 0)
: QGeoSatelliteInfoSource(parent) {
}
-
virtual void startUpdates() {}
virtual void stopUpdates() {}
-
virtual void requestUpdate(int) {}
};
+#ifdef TST_GYPSYMOCK_ENABLED
+// Mocked platform calls. Depending on environment variable,
+// either calls the mocked version or the real one (parentclass).
+class TestSatelliteGypsyEngine : public SatelliteGypsyEngine
+{
+public:
+ TestSatelliteGypsyEngine(QGeoSatelliteInfoSource *parent = 0):
+ SatelliteGypsyEngine(parent), m_gypsymock(0)
+ {
+ }
+ ~TestSatelliteGypsyEngine()
+ {
+ m_thread.quit();
+ m_thread.wait();
+ if (m_gypsymock) {
+ delete m_gypsymock;
+ m_gypsymock = 0;
+ }
+ }
+
+ gulong eng_g_signal_connect(gpointer instance,
+ const gchar* detailed_signal,
+ GCallback c_handler,
+ gpointer data)
+ {
+ Q_UNUSED(instance);
+ //TRACE1("============= blocking call to connectSignal");
+ QMetaObject::invokeMethod(m_gypsymock,
+ "connectSignal",
+ Qt::BlockingQueuedConnection,
+ //Qt::QueuedConnection,
+ Q_ARG(int, (int)detailed_signal),
+ Q_ARG(int, (int)c_handler),
+ Q_ARG(int, (int)data));
+ //TRACE1("============= nonblocking call to connectSignal DONE");
+ return 1; // dummy
+ }
+ guint eng_g_signal_handlers_disconnect_by_func (gpointer instance,
+ gpointer func,
+ gpointer data)
+ {
+ Q_UNUSED(instance);
+ //TRACE1("============= blocking call to disconnectSignal");
+ QMetaObject::invokeMethod(m_gypsymock,
+ "disconnectSignal",
+ //Qt::BlockingQueuedConnection,
+ Qt::QueuedConnection,
+ Q_ARG(int, (int)func),
+ Q_ARG(int, (int)data));
+ //TRACE1("============= blocking call to disconnectSignal DONE");
+ return 1; // dummy
+ }
+ GypsyControl* eng_gypsy_control_get_default (void)
+ {
+ return (GypsyControl*)g_object_new (G_TYPE_OBJECT, NULL); // dummy
+ }
+ char *eng_gypsy_control_create (GypsyControl *control, const char* device_name, GError **error)
+ {
+ if (!control || QString::compare(QString::fromAscii(device_name), "/my/little/device")) {
+ if (error) {
+ *error = g_error_new ((GQuark)1, // dummy
+ 2, // dummy
+ "=mock= No control or wrong device_name.");
+ }
+ return NULL;
+ }
+ return (char*)"/my/little/gypsycontrol";
+ }
+
+ GypsyDevice *eng_gypsy_device_new (const char* object_path)
+ {
+ // Create new mockend.
+ if (!object_path || QString::compare(QString::fromAscii(object_path), "/my/little/gypsycontrol")) {
+ TRACE1("No correctobject path given or mockend already existed.");
+ return NULL;
+ }
+
+ if (m_gypsymock)
+ delete m_gypsymock;
+ m_gypsymock = new GypsyMock;
+ m_gypsymock->moveToThread(&m_thread);
+ m_thread.start();
+ return (GypsyDevice*)g_object_new (G_TYPE_OBJECT, NULL); // dummy
+ }
+ GypsySatellite *eng_gypsy_satellite_new (const char *object_path)
+ {
+ if (!object_path || QString::compare(QString::fromAscii(object_path), "/my/little/gypsycontrol")) {
+ return NULL;
+ }
+ return (GypsySatellite*)g_object_new (G_TYPE_OBJECT, NULL); // dummy
+ }
+ gboolean eng_gypsy_device_start (GypsyDevice *device, GError **error)
+ {
+ if (!device || !m_gypsymock) {
+ if (error) {
+ *error = g_error_new ((GQuark)1, // dummy
+ 2, // dummy
+ "=mock= No device provided or mockend not created at gypsy_device_start");
+ }
+ return false;
+ }
+ //TRACE1("============= blocking call to start");
+ QMetaObject::invokeMethod(m_gypsymock,
+ "start",
+ Qt::BlockingQueuedConnection
+ //Qt::QueuedConnection
+ );
+ //TRACE1("============= blocking call to start DONE");
+ return true;
+ }
+ gboolean eng_gypsy_device_stop (GypsyDevice *device, GError **error)
+ {
+ if (!device || !m_gypsymock) {
+ if (error) {
+ *error = g_error_new ((GQuark)1, // dummy
+ 2, // dummy
+ "=mock= No device provided or mockend not created at gypsy_device_stop");
+ }
+ return false;
+ }
+ //TRACE1("============= blocking call to stop");
+ QMetaObject::invokeMethod(m_gypsymock,
+ "stop",
+ Qt::BlockingQueuedConnection
+ //Qt::QueuedConnection
+ );
+ //TRACE1("============= blocking call to DONE");
+ return true;
+ }
+ GypsyDeviceFixStatus eng_gypsy_device_get_fix_status (GypsyDevice *device, GError **error)
+ {
+ if (!device) {
+ if (error) {
+ *error = g_error_new ((GQuark)1, // dummy
+ 2, // dummy
+ "=mock= No device provided for gypsy_device_get_fix_status");
+ }
+ return GYPSY_DEVICE_FIX_STATUS_INVALID;
+ }
+ return GYPSY_DEVICE_FIX_STATUS_NONE;
+ }
+ GPtrArray *eng_gypsy_satellite_get_satellites (GypsySatellite *satellite, GError **error)
+ {
+ TRACE1("===== NOT YET IMPLEMENTED IN MOCK! =====");
+ if (!satellite) {
+ if (error) {
+ *error = g_error_new ((GQuark)1, // dummy
+ 2, // dummy
+ "=mock= No satellite provided for gypsy_satellite_get_satellites");
+ }
+ return NULL;
+ }
+ return (GPtrArray*)1; // todo
+ }
+ void eng_gypsy_satellite_free_satellite_array (GPtrArray *satellites)
+ {
+ for (uint i = 0; i < satellites->len; i++) {
+ delete (GypsySatelliteDetails*)g_ptr_array_index(satellites, i);
+ }
+ g_ptr_array_free(satellites, true);
+ }
+ // GConf symbols (mockability due to gconf X11 requirement)
+ GConfClient* eng_gconf_client_get_default(void)
+ {
+ return (GConfClient*)g_object_new (G_TYPE_OBJECT, NULL); // dummy
+ }
+ gchar* eng_gconf_client_get_string(GConfClient* client, const gchar* key, GError** err)
+ {
+ // QString::compare return value is a bit 'unintuitive'
+ TRACE1(key);
+ if (!client || QString::compare(QString::fromAscii(key),"/apps/geoclue/master/org.freedesktop.Geoclue.GPSDevice")) {
+ if (err) {
+ *err = g_error_new ((GQuark)1, // dummy
+ 2, // dummy
+ "=mock= No client or wrong key in gconf_client_get_string");
+ }
+ return 0;
+ } else {
+ return (gchar*)"/my/little/device";
+ }
+ }
+private:
+ GypsyMock* m_gypsymock;
+ QThread m_thread;
+};
+
+class TestQGeoSatelliteInfoSourceGypsy : public QGeoSatelliteInfoSourceGypsy
+{
+public:
+ TestQGeoSatelliteInfoSourceGypsy(QObject *parent = 0) :
+ QGeoSatelliteInfoSourceGypsy(parent) {}
+protected:
+ // override to mock platform calls
+ void createEngine() {
+ if (!useMockBackend())
+ m_engine = new SatelliteGypsyEngine(this);
+ else
+ m_engine = new TestSatelliteGypsyEngine(this); }
+};
+
+#endif // TST_GYPSYMOCK_ENABLED
+
class DefaultSourceTest : public TestQGeoSatelliteInfoSource
{
Q_OBJECT
protected:
QGeoSatelliteInfoSource *createTestSource() {
+#ifdef TST_GYPSYMOCK_ENABLED
+ TestQGeoSatelliteInfoSourceGypsy *source = new TestQGeoSatelliteInfoSourceGypsy(0);
+ int status = source->init();
+ if (status == -1) {
+ delete source;
+ return 0;
+ }
+ return source;
+#else
return QGeoSatelliteInfoSource::createDefaultSource(0);
+
+#endif
}
};
@@ -176,8 +414,16 @@
{
//QLocationTestUtils::uheap_mark();
QObject *parent = new QObject;
-
+#ifdef TST_GYPSYMOCK_ENABLED
+ QGeoSatelliteInfoSourceGypsy* source = new TestQGeoSatelliteInfoSourceGypsy(parent);
+ int status = source->init();
+ if (status == -1) {
+ delete source;
+ source = 0;
+ }
+#else
QGeoSatelliteInfoSource *source = QGeoSatelliteInfoSource::createDefaultSource(parent);
+#endif
#if defined(Q_OS_SYMBIAN)
QVERIFY(source != 0);
#elif defined(Q_OS_WINCE)
@@ -186,6 +432,8 @@
QVERIFY(source != 0);
#elif defined(Q_WS_MAEMO_6)
QVERIFY(source != 0);
+#elif defined(Q_WS_MEEGO)
+ QVERIFY(source != 0);
#else
QVERIFY(source == 0);
#endif
@@ -196,8 +444,16 @@
void TestQGeoSatelliteInfoSource::createDefaultSource_noParent()
{
//QLocationTestUtils::uheap_mark();
-
+#ifdef TST_GYPSYMOCK_ENABLED
+ QGeoSatelliteInfoSourceGypsy *source = new TestQGeoSatelliteInfoSourceGypsy(0);
+ int status = source->init();
+ if (status == -1) {
+ delete source;
+ source = 0;
+ }
+#else
QGeoSatelliteInfoSource *source = QGeoSatelliteInfoSource::createDefaultSource(0);
+#endif
#if defined(Q_OS_SYMBIAN)
QVERIFY(source != 0);
#elif defined(Q_OS_WINCE)
@@ -206,6 +462,8 @@
QVERIFY(source != 0);
#elif defined(Q_WS_MAEMO_6)
QVERIFY(source != 0);
+#elif defined(Q_WS_MEEGO)
+ QVERIFY(source != 0);
#else
QVERIFY(source == 0);
#endif
@@ -395,12 +653,12 @@
SIGNAL(satellitesInViewUpdated(const QList<QGeoSatelliteInfo> &)));
QSignalSpy spyUse(m_source,
SIGNAL(satellitesInUseUpdated(const QList<QGeoSatelliteInfo> &)));
- QSignalSpy spyTimeout(m_source,
+ QSignalSpy spyTimeout(m_source,
SIGNAL(requestTimeout()));
m_source->requestUpdate(0);
m_source->requestUpdate(1);
-
+
QTRY_COMPARE_WITH_TIMEOUT(spyTimeout.count(), 0, 7000);
EXPECT_FAIL_WINCE_SEE_MOBILITY_337;
@@ -474,16 +732,16 @@
void TestQGeoSatelliteInfoSource::removeSlotForRequestTimeout()
{
- CHECK_SOURCE_VALID;
-
- bool i = connect(m_source, SIGNAL(requestTimeout()), this, SLOT(test_slot1()));
- QVERIFY(i==true);
- i = connect(m_source, SIGNAL(requestTimeout()), this, SLOT(test_slot2()));
- QVERIFY(i==true);
- i = disconnect(m_source, SIGNAL(requestTimeout()), this, SLOT(test_slot1()));
- QVERIFY(i==true);
-
- m_source->requestUpdate(-1);
+ CHECK_SOURCE_VALID;
+
+ bool i = connect(m_source, SIGNAL(requestTimeout()), this, SLOT(test_slot1()));
+ QVERIFY(i==true);
+ i = connect(m_source, SIGNAL(requestTimeout()), this, SLOT(test_slot2()));
+ QVERIFY(i==true);
+ i = disconnect(m_source, SIGNAL(requestTimeout()), this, SLOT(test_slot1()));
+ QVERIFY(i==true);
+
+ m_source->requestUpdate(-1);
QTRY_VERIFY_WITH_TIMEOUT((m_testSlot2Called == true), 1000);
}
--- tests/auto/testqgeosatelliteinfosource_p.h
+++ tests/auto/testqgeosatelliteinfosource_p.h
@@ -46,6 +46,7 @@
#include <QTest>
#include <QObject>
+
QTM_BEGIN_NAMESPACE
class QGeoSatelliteInfoSource;
QTM_END_NAMESPACE
--- tests/btclient/btclient.c
+++ tests/btclient/btclient.c
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
--- tests/btclient/btclient.h
+++ tests/btclient/btclient.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef BTCLIENT_H
#define BTCLIENT_H
--- tests/locationex/boxgraphicsscene.cpp
+++ tests/locationex/boxgraphicsscene.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "boxgraphicsscene.h"
#include "mapbox.h"
#include "statswidget.h"
--- tests/locationex/boxgraphicsscene.h
+++ tests/locationex/boxgraphicsscene.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef BOXGRAPHICSSCENE_H
#define BOXGRAPHICSSCENE_H
--- tests/locationex/main.cpp
+++ tests/locationex/main.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include <QtGui/QApplication>
#include "mainwindow.h"
--- tests/locationex/mainwindow.cpp
+++ tests/locationex/mainwindow.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "mainwindow.h"
#include "mapbox.h"
--- tests/locationex/mainwindow.h
+++ tests/locationex/mainwindow.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
--- tests/locationex/mapbox.cpp
+++ tests/locationex/mapbox.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "mapbox.h"
#include "statswidget.h"
#include "boxgraphicsscene.h"
--- tests/locationex/mapbox.h
+++ tests/locationex/mapbox.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef MAPBOX_H
#define MAPBOX_H
--- tests/locationex/performance.cpp
+++ tests/locationex/performance.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "performance.h"
/************************** time measurement **************************/
--- tests/locationex/performance.h
+++ tests/locationex/performance.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef PERFORMANCE_H
#define PERFORMANCE_H
--- tests/locationex/statswidget.cpp
+++ tests/locationex/statswidget.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "statswidget.h"
#include <QLabel>
--- tests/locationex/statswidget.h
+++ tests/locationex/statswidget.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info at 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 at nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef STATSWIDGET_H
#define STATSWIDGET_H
++++++ qt-mobility.yaml
--- qt-mobility.yaml
+++ qt-mobility.yaml
@@ -1,17 +1,17 @@
Name: qt-mobility
Summary: APIs for mobile device functionality
-Version: 1.1.0+git2581
+Version: 1.1.0+git2727
Release: 1
Group: System/Libraries
License: LGPLv2.1 with exception or GPLv3
URL: http://qt.gitorious.org/qt-mobility
Sources:
- http://get.qt.nokia.com/qt/add-ons/%{name}-opensource-src-%{version}.tar.gz
+SourcePrefix: "%{name}-opensource-src-%{version}"
Patches:
- no_rpath.patch
- fix_translations_install_path.patch
- enable_pkgconfig_support.patch
- - add_location_api_meego_implementation_using_geoclue.patch
- enable_camerabin_with_meego_target.patch
Description: |
Qt Mobility delivers a set of new APIs for mobile device functionality. These
@@ -35,6 +35,7 @@
PkgConfigBR:
- QtGui
- QtOpenGL
+ - QtSparql
- alsa
- blkid
- bluez
@@ -208,7 +209,7 @@
- Name: libqtversitorganizer1
AsWholeName: yes
- Summary: Qt Mobility Versit (Organizer) module
+ Summary: Qt Mobility Versit (Organizer) module
Group: System/Libraries
Description: |
Qt Mobility delivers a set of new APIs for mobile device functionality.
++++++ deleted files:
--- add_location_api_meego_implementation_using_geoclue.patch
More information about the MeeGo-commits
mailing list