summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Lowe <thomas.lowe@nokia.com>2012-05-31 09:25:13 +1000
committerQt by Nokia <qt-info@nokia.com>2012-06-07 06:58:52 +0200
commitc841313bed231e570bb277115e9cb6716bd6cf31 (patch)
tree6b68a0c0bc09a95b320b362327a928b5f97f3ced /src
parent06c838b0b983f57177d17931e602303f98f3b437 (diff)
downloadqtlocation-c841313bed231e570bb277115e9cb6716bd6cf31.tar.gz
remove unused gesture area limits
zoom/tilt/rotate limits were not properties, just functions. So not used publicly and up the count of uncovered functions in the auto tests. They also suffer that the zoom limits are duplicated in the cameraCapabilities class. So these functions have been removed. Leaving only the used ones. Change-Id: Ief3ddb94a652b33160a74eaf7add9df94ea5d900 Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/imports/location/qdeclarativegeomapgesturearea.cpp152
-rw-r--r--src/imports/location/qdeclarativegeomapgesturearea_p.h39
-rw-r--r--src/imports/location/qdeclarativegeomappincharea.cpp18
-rw-r--r--src/imports/location/qdeclarativegeomappincharea_p.h28
4 files changed, 2 insertions, 235 deletions
diff --git a/src/imports/location/qdeclarativegeomapgesturearea.cpp b/src/imports/location/qdeclarativegeomapgesturearea.cpp
index cb71bba4..57e50514 100644
--- a/src/imports/location/qdeclarativegeomapgesturearea.cpp
+++ b/src/imports/location/qdeclarativegeomapgesturearea.cpp
@@ -470,50 +470,6 @@ void QDeclarativeGeoMapGestureArea::setPanEnabled(bool enabled)
/*!
\internal
-*/
-qreal QDeclarativeGeoMapGestureArea::minimumZoomLevel() const
-{
- return pinch_.zoom.minimum;
-}
-
-/*!
- \internal
-*/
-void QDeclarativeGeoMapGestureArea::setMinimumZoomLevel(qreal zoomLevel)
-{
- if (zoomLevel == pinch_.zoom.minimum ||
- zoomLevel < declarativeMap_->minimumZoomLevel() ||
- (pinch_.zoom.maximum != -1.0 && zoomLevel > pinch_.zoom.maximum) )
- return;
- pinch_.zoom.minimum = zoomLevel;
- emit minimumZoomLevelChanged();
- emit pinchDep_->minimumZoomLevelChanged();
-}
-
-/*!
- \internal
-*/
-qreal QDeclarativeGeoMapGestureArea::maximumZoomLevel() const
-{
- return pinch_.zoom.maximum;
-}
-
-/*!
- \internal
-*/
-void QDeclarativeGeoMapGestureArea::setMaximumZoomLevel(qreal zoomLevel)
-{
- if (zoomLevel == pinch_.zoom.maximum ||
- zoomLevel > declarativeMap_->maximumZoomLevel() ||
- (pinch_.zoom.minimum != - 1.0 && zoomLevel < pinch_.zoom.minimum))
- return;
- pinch_.zoom.maximum = zoomLevel;
- emit maximumZoomLevelChanged();
- emit pinchDep_->maximumZoomLevelChanged();
-}
-
-/*!
- \internal
called internally when plugin's limits change. somewhat dodgy but
initialization order complicates the zoom limit settings a bit (for example when is
it possible to check against mapping plugins' limits)
@@ -521,9 +477,9 @@ void QDeclarativeGeoMapGestureArea::setMaximumZoomLevel(qreal zoomLevel)
void QDeclarativeGeoMapGestureArea::zoomLevelLimits(qreal min, qreal max)
{
if (pinch_.zoom.minimum == -1.0 || min > pinch_.zoom.minimum)
- setMinimumZoomLevel(min);
+ pinch_.zoom.minimum = min;
if (pinch_.zoom.maximum == -1.0 || max < pinch_.zoom.maximum)
- setMaximumZoomLevel(max);
+ pinch_.zoom.maximum = max;
}
/*!
@@ -549,50 +505,6 @@ void QDeclarativeGeoMapGestureArea::setMaximumZoomLevelChange(qreal maxChange)
/*!
\internal
*/
-qreal QDeclarativeGeoMapGestureArea::minimumRotation() const
-{
- return pinch_.rotation.minimum;
-}
-
-/*!
- \internal
-*/
-void QDeclarativeGeoMapGestureArea::setMinimumRotation(qreal rotation)
-{
- if (rotation == pinch_.rotation.minimum ||
- rotation < 0 ||
- rotation > pinch_.rotation.maximum)
- return;
- pinch_.rotation.minimum = rotation;
- emit minimumRotationChanged();
- emit pinchDep_->minimumRotationChanged();
-}
-
-/*!
- \internal
-*/
-qreal QDeclarativeGeoMapGestureArea::maximumRotation() const
-{
- return pinch_.rotation.maximum;
-}
-
-/*!
- \internal
-*/
-void QDeclarativeGeoMapGestureArea::setMaximumRotation(qreal rotation)
-{
- if (rotation == pinch_.rotation.maximum ||
- rotation > 360 ||
- rotation < pinch_.rotation.minimum)
- return;
- pinch_.rotation.maximum = rotation;
- emit maximumRotationChanged();
- emit pinchDep_->maximumRotationChanged();
-}
-
-/*!
- \internal
-*/
qreal QDeclarativeGeoMapGestureArea::rotationFactor() const
{
return pinch_.rotation.factor;
@@ -613,66 +525,6 @@ void QDeclarativeGeoMapGestureArea::setRotationFactor(qreal factor)
/*!
\internal
*/
-qreal QDeclarativeGeoMapGestureArea::maximumTilt() const
-{
- return pinch_.tilt.maximum;
-}
-
-/*!
- \internal
-*/
-void QDeclarativeGeoMapGestureArea::setMaximumTilt(qreal tilt)
-{
- if (pinch_.tilt.maximum == tilt)
- return;
- pinch_.tilt.maximum = tilt;
- emit maximumTiltChanged();
- emit pinchDep_->maximumTiltChanged();
-}
-
-/*!
- \internal
-*/
-qreal QDeclarativeGeoMapGestureArea::minimumTilt() const
-{
- return pinch_.tilt.minimum;
-}
-
-/*!
- \internal
-*/
-void QDeclarativeGeoMapGestureArea::setMinimumTilt(qreal tilt)
-{
- if (pinch_.tilt.minimum == tilt || tilt < 0.1)
- return;
- pinch_.tilt.minimum = tilt;
- emit minimumTiltChanged();
- emit pinchDep_->minimumTiltChanged();
-}
-
-/*!
- \internal
-*/
-qreal QDeclarativeGeoMapGestureArea::maximumTiltChange() const
-{
- return pinch_.tilt.maximumChange;
-}
-
-/*!
- \internal
-*/
-void QDeclarativeGeoMapGestureArea::setMaximumTiltChange(qreal tilt)
-{
- if (pinch_.tilt.maximumChange == tilt || tilt < 0.1)
- return;
- pinch_.tilt.maximumChange = tilt;
- emit maximumTiltChangeChanged();
- emit pinchDep_->maximumTiltChangeChanged();
-}
-
-/*!
- \internal
-*/
qreal QDeclarativeGeoMapGestureArea::flickDeceleration() const
{
return pan_.deceleration_;
diff --git a/src/imports/location/qdeclarativegeomapgesturearea_p.h b/src/imports/location/qdeclarativegeomapgesturearea_p.h
index f124335a..10bf2102 100644
--- a/src/imports/location/qdeclarativegeomapgesturearea_p.h
+++ b/src/imports/location/qdeclarativegeomapgesturearea_p.h
@@ -123,17 +123,6 @@ class QDeclarativeGeoMapGestureArea: public QObject
Q_PROPERTY(qreal maximumZoomLevelChange READ maximumZoomLevelChange WRITE setMaximumZoomLevelChange NOTIFY maximumZoomLevelChangeChanged)
Q_PROPERTY(qreal rotationFactor READ rotationFactor WRITE setRotationFactor NOTIFY rotationFactorChanged)
Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged)
-
- // need for these is not clear, use-case(s) not yet identified:
- //Q_PROPERTY(qreal minimumRotation READ minimumRotation WRITE setMinimumRotation NOTIFY minimumRotationChanged)
- //Q_PROPERTY(qreal maximumRotation READ maximumRotation WRITE setMaximumRotation NOTIFY maximumRotationChanged)
- //Q_PROPERTY(qreal minimumZoomLevel READ minimumZoomLevel WRITE setMinimumZoomLevel NOTIFY minimumZoomLevelChanged)
- //Q_PROPERTY(qreal maximumZoomLevel READ maximumZoomLevel WRITE setMaximumZoomLevel NOTIFY maximumZoomLevelChanged)
- // when tilt is supported, these are needed:
- //Q_PROPERTY(qreal maximumTilt READ maximumTilt WRITE setMaximumTilt NOTIFY maximumTiltChanged)
- //Q_PROPERTY(qreal minimumTilt READ minimumTilt WRITE setMinimumTilt NOTIFY minimumTiltChanged)
- //Q_PROPERTY(qreal maximumTiltChange READ maximumTiltChange WRITE setMaximumTiltChange NOTIFY maximumTiltChangeChanged)
-
public:
QDeclarativeGeoMapGestureArea(QDeclarativeGeoMap *map, QObject *parent = 0);
~QDeclarativeGeoMapGestureArea();
@@ -164,33 +153,12 @@ public:
bool panEnabled() const;
void setPanEnabled(bool enabled);
- qreal minimumZoomLevel() const;
- void setMinimumZoomLevel(qreal zoomLevel);
-
- qreal maximumZoomLevel() const;
- void setMaximumZoomLevel(qreal zoomLevel);
-
qreal maximumZoomLevelChange() const;
void setMaximumZoomLevelChange(qreal maxChange);
- qreal minimumRotation() const;
- void setMinimumRotation(qreal zoomLevel);
-
- qreal maximumRotation() const;
- void setMaximumRotation(qreal zoomLevel);
-
qreal rotationFactor() const;
void setRotationFactor(qreal factor);
- qreal maximumTilt() const;
- void setMaximumTilt(qreal tilt);
-
- qreal minimumTilt() const;
- void setMinimumTilt(qreal tilt);
-
- qreal maximumTiltChange() const;
- void setMaximumTiltChange(qreal tilt);
-
qreal flickDeceleration() const;
void setFlickDeceleration(qreal deceleration);
@@ -217,16 +185,9 @@ public:
Q_SIGNALS:
void pinchActiveChanged();
void enabledChanged();
- void minimumZoomLevelChanged();
- void maximumZoomLevelChanged();
void maximumZoomLevelChangeChanged();
- void minimumRotationChanged();
- void maximumRotationChanged();
void rotationFactorChanged();
void activeGesturesChanged();
- void minimumTiltChanged();
- void maximumTiltChanged();
- void maximumTiltChangeChanged();
void flickDecelerationChanged();
// backwards compatibility
diff --git a/src/imports/location/qdeclarativegeomappincharea.cpp b/src/imports/location/qdeclarativegeomappincharea.cpp
index 7152ee7b..80449bee 100644
--- a/src/imports/location/qdeclarativegeomappincharea.cpp
+++ b/src/imports/location/qdeclarativegeomappincharea.cpp
@@ -51,24 +51,6 @@
#include "math.h"
#include "qgeomap_p.h"
-#define QML_MAP_FLICK_DEFAULTMAXVELOCITY 2500
-#define QML_MAP_FLICK_MINIMUMDECELERATION 500
-#define QML_MAP_FLICK_DEFAULTDECELERATION 2500
-#define QML_MAP_FLICK_MAXIMUMDECELERATION 10000
-// The number of samples to use in calculating the velocity of a flick
-#define QML_MAP_FLICK_SAMPLEBUFFER 3
-// The number of samples to discard when calculating the flick velocity.
-// Touch panels often produce inaccurate results as the finger is lifted.
-#define QML_MAP_FLICK_DISCARDSAMPLES 1
-
-// FlickThreshold determines how far the "mouse" must have moved
-// before we perform a flick.
-static const int FlickThreshold = 20;
-// RetainGrabVelocity is the maxmimum instantaneous velocity that
-// will ensure the Flickable retains the grab on consecutive flicks.
-static const int RetainGrabVelocity = 15;
-// Really slow flicks can be annoying.
-const qreal MinimumFlickVelocity = 75.0;
QT_BEGIN_NAMESPACE
diff --git a/src/imports/location/qdeclarativegeomappincharea_p.h b/src/imports/location/qdeclarativegeomappincharea_p.h
index 4f054941..b5a9acc2 100644
--- a/src/imports/location/qdeclarativegeomappincharea_p.h
+++ b/src/imports/location/qdeclarativegeomappincharea_p.h
@@ -118,33 +118,12 @@ public:
bool enabled() const { return gestureArea_->pinchEnabled(); }
void setEnabled(bool enabled){ gestureArea_->setPinchEnabled(enabled); }
- qreal minimumZoomLevel() const { return gestureArea_->minimumZoomLevel(); }
- void setMinimumZoomLevel(qreal zoomLevel){ gestureArea_->setMinimumZoomLevel(zoomLevel); }
-
- qreal maximumZoomLevel() const { return gestureArea_->maximumZoomLevel(); }
- void setMaximumZoomLevel(qreal zoomLevel){ gestureArea_->setMaximumZoomLevel(zoomLevel); }
-
qreal maximumZoomLevelChange() const { return gestureArea_->maximumZoomLevelChange(); }
void setMaximumZoomLevelChange(qreal maxChange){ gestureArea_->setMaximumZoomLevelChange(maxChange); }
- qreal minimumRotation() const { return gestureArea_->minimumRotation(); }
- void setMinimumRotation(qreal zoomLevel){ gestureArea_->setMinimumRotation(zoomLevel); }
-
- qreal maximumRotation() const { return gestureArea_->maximumRotation(); }
- void setMaximumRotation(qreal zoomLevel){ gestureArea_->setMaximumRotation(zoomLevel); }
-
qreal rotationFactor() const { return gestureArea_->rotationFactor(); }
void setRotationFactor(qreal factor){ gestureArea_->setRotationFactor(factor); }
- qreal maximumTilt() const { return gestureArea_->maximumTilt(); }
- void setMaximumTilt(qreal tilt){ gestureArea_->setMaximumTilt(tilt); }
-
- qreal minimumTilt() const { return gestureArea_->minimumTilt(); }
- void setMinimumTilt(qreal tilt){ gestureArea_->setMinimumTilt(tilt); }
-
- qreal maximumTiltChange() const { return gestureArea_->maximumTiltChange(); }
- void setMaximumTiltChange(qreal tilt){ gestureArea_->setMaximumTiltChange(tilt); }
-
qreal flickDeceleration() const { return gestureArea_->flickDeceleration(); }
void setFlickDeceleration(qreal deceleration){ gestureArea_->setFlickDeceleration(deceleration); }
@@ -154,16 +133,9 @@ public:
Q_SIGNALS:
void activeChanged();
void enabledChanged();
- void minimumZoomLevelChanged();
- void maximumZoomLevelChanged();
void maximumZoomLevelChangeChanged();
- void minimumRotationChanged();
- void maximumRotationChanged();
void rotationFactorChanged();
void activeGesturesChanged();
- void minimumTiltChanged();
- void maximumTiltChanged();
- void maximumTiltChangeChanged();
void flickDecelerationChanged();
void pinchStarted(QDeclarativeGeoMapPinchEvent *pinch);