projects
/
situare
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9afe79f
)
Undoed the parameter for user drag actions
author
Sami Rämö
<sami.ramo@ixonos.com>
Tue, 24 Aug 2010 12:08:55 +0000
(15:08 +0300)
committer
Sami Rämö
<sami.ramo@ixonos.com>
Tue, 24 Aug 2010 12:08:55 +0000
(15:08 +0300)
src/engine/engine.cpp
patch
|
blob
|
history
src/map/mapengine.cpp
patch
|
blob
|
history
src/map/mapengine.h
patch
|
blob
|
history
src/map/mapscroller.cpp
patch
|
blob
|
history
src/map/mapscroller.h
patch
|
blob
|
history
src/map/mapview.cpp
patch
|
blob
|
history
src/map/mapview.h
patch
|
blob
|
history
src/ui/mainwindow.cpp
patch
|
blob
|
history
src/ui/mainwindow.h
patch
|
blob
|
history
diff --git
a/src/engine/engine.cpp
b/src/engine/engine.cpp
index
3df27a3
..
4b7b821
100644
(file)
--- a/
src/engine/engine.cpp
+++ b/
src/engine/engine.cpp
@@
-625,8
+625,8
@@
void SituareEngine::signalsFromMainWindow()
m_facebookAuthenticator, SLOT(updateCredentials(QUrl)));
// signals from map view
m_facebookAuthenticator, SLOT(updateCredentials(QUrl)));
// signals from map view
- connect(m_ui, SIGNAL(mapViewScrolled(SceneCoordinate, bool)),
- m_mapEngine, SLOT(setCenterPosition(SceneCoordinate, bool)));
+ connect(m_ui, SIGNAL(mapViewScrolled(SceneCoordinate)),
+ m_mapEngine, SLOT(setCenterPosition(SceneCoordinate)));
connect(m_ui, SIGNAL(mapViewResized(QSize)),
m_mapEngine, SLOT(viewResized(QSize)));
connect(m_ui, SIGNAL(mapViewResized(QSize)),
m_mapEngine, SLOT(viewResized(QSize)));
@@
-692,8
+692,8
@@
void SituareEngine::signalsFromMapEngine()
connect(m_mapEngine, SIGNAL(error(int, int)),
this, SLOT(error(int, int)));
connect(m_mapEngine, SIGNAL(error(int, int)),
this, SLOT(error(int, int)));
- connect(m_mapEngine, SIGNAL(locationChanged(SceneCoordinate, bool)),
- m_ui, SIGNAL(centerToSceneCoordinates(SceneCoordinate, bool)));
+ connect(m_mapEngine, SIGNAL(locationChanged(SceneCoordinate)),
+ m_ui, SIGNAL(centerToSceneCoordinates(SceneCoordinate)));
connect(m_mapEngine, SIGNAL(zoomLevelChanged(int)),
m_ui, SIGNAL(zoomLevelChanged(int)));
connect(m_mapEngine, SIGNAL(zoomLevelChanged(int)),
m_ui, SIGNAL(zoomLevelChanged(int)));
diff --git
a/src/map/mapengine.cpp
b/src/map/mapengine.cpp
index
2414c91
..
8c2a706
100644
(file)
--- a/
src/map/mapengine.cpp
+++ b/
src/map/mapengine.cpp
@@
-101,8
+101,8
@@
MapEngine::MapEngine(QObject *parent)
m_scroller = &MapScroller::getInstance();
m_scroller = &MapScroller::getInstance();
- connect(m_scroller, SIGNAL(coordinateUpdated(SceneCoordinate, bool)),
- this, SLOT(setCenterPosition(SceneCoordinate, bool)));
+ connect(m_scroller, SIGNAL(coordinateUpdated(SceneCoordinate)),
+ this, SLOT(setCenterPosition(SceneCoordinate)));
connect(m_scroller, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)),
this, SLOT(scrollerStateChanged(QAbstractAnimation::State)));
connect(m_scroller, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)),
this, SLOT(scrollerStateChanged(QAbstractAnimation::State)));
@@
-423,7
+423,7
@@
void MapEngine::setAutoCentering(bool enabled)
updateDirectionIndicator();
}
updateDirectionIndicator();
}
-void MapEngine::setCenterPosition(SceneCoordinate coordinate, bool isUserDragAction)
+void MapEngine::setCenterPosition(SceneCoordinate coordinate)
{
qDebug() << __PRETTY_FUNCTION__;
{
qDebug() << __PRETTY_FUNCTION__;
@@
-439,7
+439,7
@@
void MapEngine::setCenterPosition(SceneCoordinate coordinate, bool isUserDragAct
disableAutoCenteringIfRequired(coordinate);
m_sceneCoordinate = coordinate;
disableAutoCenteringIfRequired(coordinate);
m_sceneCoordinate = coordinate;
- emit locationChanged(m_sceneCoordinate, isUserDragAction);
+ emit locationChanged(m_sceneCoordinate);
if (isCenterTileChanged(coordinate)) {
getTiles(coordinate);
if (isCenterTileChanged(coordinate)) {
getTiles(coordinate);
@@
-566,7
+566,7
@@
void MapEngine::viewResized(const QSize &size)
m_viewSize = size;
setTilesGridSize(m_viewSize);
m_viewSize = size;
setTilesGridSize(m_viewSize);
- emit locationChanged(m_sceneCoordinate, false);
+ emit locationChanged(m_sceneCoordinate);
getTiles(m_sceneCoordinate);
m_mapScene->removeOutOfViewTiles(m_viewTilesGrid, m_zoomLevel);
m_mapScene->setSceneVerticalOverlap(m_viewSize.height(), m_zoomLevel);
getTiles(m_sceneCoordinate);
m_mapScene->removeOutOfViewTiles(m_viewTilesGrid, m_zoomLevel);
m_mapScene->setSceneVerticalOverlap(m_viewSize.height(), m_zoomLevel);
diff --git
a/src/map/mapengine.h
b/src/map/mapengine.h
index
774f795
..
07db7b9
100644
(file)
--- a/
src/map/mapengine.h
+++ b/
src/map/mapengine.h
@@
-321,9
+321,8
@@
private slots:
*
* Does emit locationChanged signal.
* @param coordinate Scene coordinates for new position
*
* Does emit locationChanged signal.
* @param coordinate Scene coordinates for new position
- * @param isUserDragAction True if caused by user dragging action
*/
*/
- void setCenterPosition(SceneCoordinate coordinate, bool isUserDragAction = false);
+ void setCenterPosition(SceneCoordinate coordinate);
/**
* @brief Builds and sets route, also centers it
/**
* @brief Builds and sets route, also centers it
@@
-407,9
+406,8
@@
signals:
* @brief Request view centering to new locaiton
*
* @param coordinate New scene coordinates
* @brief Request view centering to new locaiton
*
* @param coordinate New scene coordinates
- * @param isUserDragAction True if caused by user dragging action
*/
*/
- void locationChanged(SceneCoordinate coordinate, bool isUserDragAction);
+ void locationChanged(SceneCoordinate coordinate);
/**
* @brief Signal is emitted when location item is clicked.
/**
* @brief Signal is emitted when location item is clicked.
diff --git
a/src/map/mapscroller.cpp
b/src/map/mapscroller.cpp
index
ff18a11
..
f068b74
100644
(file)
--- a/
src/map/mapscroller.cpp
+++ b/
src/map/mapscroller.cpp
@@
-33,12
+33,6
@@
QVariant sceneCoordinateInterpolator(const SceneCoordinate &start,
const SceneCoordinate &end,
qreal progress);
const SceneCoordinate &end,
qreal progress);
-MapScroller::MapScroller()
- : m_isKineticScroll(false)
-{
- qDebug() << __PRETTY_FUNCTION__;
-}
-
MapScroller& MapScroller::getInstance()
{
qDebug() << __PRETTY_FUNCTION__;
MapScroller& MapScroller::getInstance()
{
qDebug() << __PRETTY_FUNCTION__;
@@
-49,24
+43,12
@@
MapScroller& MapScroller::getInstance()
return instance;
}
return instance;
}
-void MapScroller::setKineticScrollFlag(bool isKineticScroll)
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- m_isKineticScroll = isKineticScroll;
-}
-
void MapScroller::updateCurrentValue(const QVariant &value)
{
qDebug() << __PRETTY_FUNCTION__;
if ((state() == QAbstractAnimation::Running) && (value.canConvert<SceneCoordinate>()))
void MapScroller::updateCurrentValue(const QVariant &value)
{
qDebug() << __PRETTY_FUNCTION__;
if ((state() == QAbstractAnimation::Running) && (value.canConvert<SceneCoordinate>()))
- emit coordinateUpdated(value.value<SceneCoordinate>(), m_isKineticScroll);
- else
- m_isKineticScroll = false;
-
- // NOTE: m_isKineticScroll is cleared when new animation values are set, because this method is
- // called then and state() is QAbstractAnimation::Stopped
+ emit coordinateUpdated(value.value<SceneCoordinate>());
}
/////////////////////////////////////////////////////////////////////////////
}
/////////////////////////////////////////////////////////////////////////////
diff --git
a/src/map/mapscroller.h
b/src/map/mapscroller.h
index
d12923d
..
8f666f1
100644
(file)
--- a/
src/map/mapscroller.h
+++ b/
src/map/mapscroller.h
@@
-45,7
+45,7
@@
private:
/**
* @brief Constructor in not accessible because class is using singleton design pattern.
*/
/**
* @brief Constructor in not accessible because class is using singleton design pattern.
*/
- MapScroller();
+ MapScroller() {}
/**
* @brief Destructor in not accessible because class is using singleton design pattern.
/**
* @brief Destructor in not accessible because class is using singleton design pattern.
@@
-89,13
+89,6
@@
public:
*/
static MapScroller &getInstance();
*/
static MapScroller &getInstance();
- /**
- * @brief Set flag for kinetic scroll
- *
- * @param isKineticScroll Set to true if starting a kinetic scroll
- */
- void setKineticScrollFlag(bool isKineticScroll);
-
/*******************************************************************************
* SIGNALS
******************************************************************************/
/*******************************************************************************
* SIGNALS
******************************************************************************/
@@
-104,15
+97,8
@@
signals:
* @brief Signal if emitted when coordinate value is updated
*
* @param coordinate New coordinate value
* @brief Signal if emitted when coordinate value is updated
*
* @param coordinate New coordinate value
- * @param isKineticScroll True if currently running a kinetic scroll animation
*/
*/
- void coordinateUpdated(SceneCoordinate coordinate, bool isKineticScroll);
-
-/*******************************************************************************
- * DATA MEMBERS
- ******************************************************************************/
-private:
- bool m_isKineticScroll; ///< Is the current animation a kinetic scroll animation?
+ void coordinateUpdated(SceneCoordinate coordinate);
};
#endif // MAPSCROLLER_H
};
#endif // MAPSCROLLER_H
diff --git
a/src/map/mapview.cpp
b/src/map/mapview.cpp
index
56307da
..
2858739
100644
(file)
--- a/
src/map/mapview.cpp
+++ b/
src/map/mapview.cpp
@@
-86,15
+86,14
@@
QPointF MapView::center()
return mapToScene(m_viewCenterPoint) - m_centerHorizontalShiftPoint;
}
return mapToScene(m_viewCenterPoint) - m_centerHorizontalShiftPoint;
}
-void MapView::centerToSceneCoordinates(const SceneCoordinate &coordinate, bool isUserDragAction)
+void MapView::centerToSceneCoordinates(const SceneCoordinate &coordinate)
{
qDebug() << __PRETTY_FUNCTION__ << "coordinate" << coordinate;
QPointF target = coordinate.toPointF();
m_lastSetScenePosition = coordinate;
{
qDebug() << __PRETTY_FUNCTION__ << "coordinate" << coordinate;
QPointF target = coordinate.toPointF();
m_lastSetScenePosition = coordinate;
-// if (!isUserDragAction)
- target += m_centerHorizontalShiftPoint;
+ target += m_centerHorizontalShiftPoint;
centerOn(target);
}
centerOn(target);
}
@@
-173,7
+172,7
@@
void MapView::mouseMoveEvent(QMouseEvent *event)
QPointF viewCenterPoint = m_internalScenePosition - m_centerHorizontalShiftPoint;
QPointF viewCenterPoint = m_internalScenePosition - m_centerHorizontalShiftPoint;
- emit viewScrolled(SceneCoordinate(viewCenterPoint.x(), viewCenterPoint.y()), true);
+ emit viewScrolled(SceneCoordinate(viewCenterPoint.x(), viewCenterPoint.y()));
m_lastMouseEventScenePosition = mapToScene(event->pos()).toPoint();
m_lastMouseEventViewPosition = event->pos();
m_lastMouseEventScenePosition = mapToScene(event->pos()).toPoint();
m_lastMouseEventViewPosition = event->pos();
@@
-245,7
+244,6
@@
void MapView::mouseReleaseEvent(QMouseEvent *event)
m_scroller->setStartValue(SceneCoordinate(centerPoint.x(), centerPoint.y()));
QPointF endValue = centerPoint + effectSceneDistance;
m_scroller->setEndValue(SceneCoordinate(endValue.x(), endValue.y()));
m_scroller->setStartValue(SceneCoordinate(centerPoint.x(), centerPoint.y()));
QPointF endValue = centerPoint + effectSceneDistance;
m_scroller->setEndValue(SceneCoordinate(endValue.x(), endValue.y()));
- m_scroller->setKineticScrollFlag(true);
m_scroller->start();
}
}
m_scroller->start();
}
}
diff --git
a/src/map/mapview.h
b/src/map/mapview.h
index
2cd627a
..
520a369
100644
(file)
--- a/
src/map/mapview.h
+++ b/
src/map/mapview.h
@@
-142,10
+142,8
@@
public slots:
* Does also shift the center point horizontally, if required.
*
* @param coordinate Scene coordinates of the new center point
* Does also shift the center point horizontally, if required.
*
* @param coordinate Scene coordinates of the new center point
- * @param isUserDragAction True if caused by user dragging action. Does not shift the center
- * point if true.
*/
*/
- void centerToSceneCoordinates(const SceneCoordinate &coordinate, bool isUserDragAction = false);
+ void centerToSceneCoordinates(const SceneCoordinate &coordinate);
/**
* @brief Set zoom level of the view
/**
* @brief Set zoom level of the view
@@
-239,9
+237,8
@@
signals:
*
* Signal is emitted when view is scrolled.
* @param coordinate Scene coordinates of the new center point of the view
*
* Signal is emitted when view is scrolled.
* @param coordinate Scene coordinates of the new center point of the view
- * @param isUserDragAction True if caused by user dragging action
*/
*/
- void viewScrolled(const SceneCoordinate &coordinate, bool isUserDragAction);
+ void viewScrolled(const SceneCoordinate &coordinate);
/**
* @brief Signal for informing that zooming animation is finished
/**
* @brief Signal for informing that zooming animation is finished
diff --git
a/src/ui/mainwindow.cpp
b/src/ui/mainwindow.cpp
index
515cb3b
..
b8b5093
100644
(file)
--- a/
src/ui/mainwindow.cpp
+++ b/
src/ui/mainwindow.cpp
@@
-262,11
+262,11
@@
void MainWindow::buildMap()
buildIndicatorButtonPanel();
buildMapScale();
buildIndicatorButtonPanel();
buildMapScale();
- connect(m_mapView, SIGNAL(viewScrolled(SceneCoordinate, bool)),
- this, SIGNAL(mapViewScrolled(SceneCoordinate, bool)));
+ connect(m_mapView, SIGNAL(viewScrolled(SceneCoordinate)),
+ this, SIGNAL(mapViewScrolled(SceneCoordinate)));
- connect(this, SIGNAL(centerToSceneCoordinates(SceneCoordinate, bool)),
- m_mapView, SLOT(centerToSceneCoordinates(SceneCoordinate, bool)));
+ connect(this, SIGNAL(centerToSceneCoordinates(SceneCoordinate)),
+ m_mapView, SLOT(centerToSceneCoordinates(SceneCoordinate)));
connect(m_mapView, SIGNAL(viewResized(QSize)),
this, SIGNAL(mapViewResized(QSize)));
connect(m_mapView, SIGNAL(viewResized(QSize)),
this, SIGNAL(mapViewResized(QSize)));
diff --git
a/src/ui/mainwindow.h
b/src/ui/mainwindow.h
index
c36342b
..
5c2776f
100644
(file)
--- a/
src/ui/mainwindow.h
+++ b/
src/ui/mainwindow.h
@@
-438,9
+438,8
@@
signals:
* @brief View should be centered to new location
*
* @param coordinate Scene coordinates of the new center point
* @brief View should be centered to new location
*
* @param coordinate Scene coordinates of the new center point
- * @param isUserDragAction True if caused by user dragging action
*/
*/
- void centerToSceneCoordinates(const SceneCoordinate &coordinate, bool isUserDragAction);
+ void centerToSceneCoordinates(const SceneCoordinate &coordinate);
/**
* @brief Signal when direction and distance from current map center point to current GPS
/**
* @brief Signal when direction and distance from current map center point to current GPS
@@
-534,9
+533,8
@@
signals:
* @brief Forwarding signal from MapView to MapEngine
*
* @param coordinate New center point coordinate
* @brief Forwarding signal from MapView to MapEngine
*
* @param coordinate New center point coordinate
- * @param isUserDragAction True if caused by user dragging action
*/
*/
- void mapViewScrolled(const SceneCoordinate &coordinate, bool isUserDragAction);
+ void mapViewScrolled(const SceneCoordinate &coordinate);
/**
* @brief Forwarding signal from MapEngine to MapView
/**
* @brief Forwarding signal from MapEngine to MapView