aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-07-28 16:40:28 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 07:31:11 -0700
commit69f8fc3c5b78eff762e469ae8d0ff9d62f5114ba (patch)
tree6513aeec4e11887bf1b89a9f2b03540cd8677ad1
parent591c4bfccab8ab0c972ea8c574df82579b865374 (diff)
downloadsubsurface-69f8fc3c5b78eff762e469ae8d0ff9d62f5114ba.tar.gz
map: whitespace cleanup in QML and C++ files
- remove ";"s - remove {} where not needed or move them to the same line Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
-rw-r--r--desktop-widgets/mapwidget.h1
-rw-r--r--mobile-widgets/qml/MapWidget.qml76
-rw-r--r--mobile-widgets/qml/MapWidgetContextMenu.qml12
-rw-r--r--qt-models/maplocationmodel.h2
4 files changed, 22 insertions, 69 deletions
diff --git a/desktop-widgets/mapwidget.h b/desktop-widgets/mapwidget.h
index 49d94608a..2d33ee85b 100644
--- a/desktop-widgets/mapwidget.h
+++ b/desktop-widgets/mapwidget.h
@@ -40,7 +40,6 @@ private:
static MapWidget *m_instance;
QQuickItem *m_rootItem;
MapWidgetHelper *m_mapHelper;
-
};
#endif // MAPWIDGET_H
diff --git a/mobile-widgets/qml/MapWidget.qml b/mobile-widgets/qml/MapWidget.qml
index 0182c9f89..2d5a6ddc7 100644
--- a/mobile-widgets/qml/MapWidget.qml
+++ b/mobile-widgets/qml/MapWidget.qml
@@ -16,11 +16,7 @@ Item {
id: mapHelper
map: map
editMode: false
-
- onSelectedDivesChanged: {
- // 'list' contains a list of dive list indexes
- nSelectedDives = list.length
- }
+ onSelectedDivesChanged: nSelectedDives = list.length
onEditModeChanged: editMessage.isVisible = editMode === true ? 1 : 0
onCoordinatesChanged: {}
}
@@ -42,10 +38,7 @@ Item {
property real newZoomOut: 1.0
property var clickCoord: QtPositioning.coordinate(0, 0)
- Component.onCompleted: {
- activeMapType = mapType.SATELLITE
- }
-
+ Component.onCompleted: activeMapType = mapType.SATELLITE
onZoomLevelChanged: mapHelper.calculateSmallCircleRadius(map.center)
MapItemView {
@@ -63,12 +56,8 @@ Item {
source: "qrc:///mapwidget-marker" + (mapHelper.model.selectedUuid === model.uuid ? "-selected" : "")
SequentialAnimation {
id: mapItemImageAnimation
- PropertyAnimation {
- target: mapItemImage; property: "scale"; from: 1.0; to: 0.7; duration: 120
- }
- PropertyAnimation {
- target: mapItemImage; property: "scale"; from: 0.7; to: 1.0; duration: 80
- }
+ PropertyAnimation { target: mapItemImage; property: "scale"; from: 1.0; to: 0.7; duration: 120 }
+ PropertyAnimation { target: mapItemImage; property: "scale"; from: 0.7; to: 1.0; duration: 80 }
}
MouseArea {
drag.target: (mapHelper.editMode && mapHelper.model.selectedUuid === model.uuid) ? mapItem : undefined
@@ -113,9 +102,7 @@ Item {
target: map; property: "zoomLevel"; to: map.newZoomOut; duration: Math.abs(map.newZoomOut - map.zoomLevel) * 200
}
ParallelAnimation {
- CoordinateAnimation {
- target: map; property: "center"; to: map.newCenter; duration: 1000
- }
+ CoordinateAnimation { target: map; property: "center"; to: map.newCenter; duration: 1000 }
NumberAnimation {
target: map; property: "zoomLevel"; to: map.newZoom ; duration: 2000; easing.type: Easing.InCubic
}
@@ -124,25 +111,17 @@ Item {
ParallelAnimation {
id: mapAnimationZoomOut
- NumberAnimation {
- target: map; property: "zoomLevel"; from: map.zoomLevel; to: map.newZoom; duration: 3000
- }
+ NumberAnimation { target: map; property: "zoomLevel"; from: map.zoomLevel; to: map.newZoom; duration: 3000 }
SequentialAnimation {
PauseAnimation { duration: 2000 }
- CoordinateAnimation {
- target: map; property: "center"; to: map.newCenter; duration: 2000
- }
+ CoordinateAnimation { target: map; property: "center"; to: map.newCenter; duration: 2000 }
}
}
ParallelAnimation {
id: mapAnimationClick
- CoordinateAnimation {
- target: map; property: "center"; to: map.newCenter; duration: 500
- }
- NumberAnimation {
- target: map; property: "zoomLevel"; to: map.newZoom; duration: 500
- }
+ CoordinateAnimation { target: map; property: "center"; to: map.newCenter; duration: 500 }
+ NumberAnimation { target: map; property: "zoomLevel"; to: map.newZoom; duration: 500 }
}
MouseArea {
@@ -205,15 +184,12 @@ Item {
opacity: 0.0
property int isVisible: -1
property real padding: 10.0
-
onOpacityChanged: visible = opacity != 0.0
states: [
State { when: editMessage.isVisible === 1; PropertyChanges { target: editMessage; opacity: 1.0 }},
State { when: editMessage.isVisible === 0; PropertyChanges { target: editMessage; opacity: 0.0 }}
]
- transitions: Transition {
- NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad }
- }
+ transitions: Transition { NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad }}
Text {
id: editMessageText
y: editMessage.padding; x: editMessage.padding
@@ -228,17 +204,11 @@ Item {
id: toggleImage
x: 10; y: x
source: "qrc:///mapwidget-toggle-" + (map.activeMapType === map.mapType.SATELLITE ? "street" : "satellite")
-
SequentialAnimation {
id: toggleImageAnimation
- PropertyAnimation {
- target: toggleImage; property: "scale"; from: 1.0; to: 0.8; duration: 120
- }
- PropertyAnimation {
- target: toggleImage; property: "scale"; from: 0.8; to: 1.0; duration: 80
- }
+ PropertyAnimation { target: toggleImage; property: "scale"; from: 1.0; to: 0.8; duration: 120 }
+ PropertyAnimation { target: toggleImage; property: "scale"; from: 0.8; to: 1.0; duration: 80 }
}
-
MouseArea {
anchors.fill: parent
onClicked: {
@@ -254,12 +224,8 @@ Item {
source: "qrc:///mapwidget-zoom-in"
SequentialAnimation {
id: imageZoomInAnimation
- PropertyAnimation {
- target: imageZoomIn; property: "scale"; from: 1.0; to: 0.8; duration: 120
- }
- PropertyAnimation {
- target: imageZoomIn; property: "scale"; from: 0.8; to: 1.0; duration: 80
- }
+ PropertyAnimation { target: imageZoomIn; property: "scale"; from: 1.0; to: 0.8; duration: 120 }
+ PropertyAnimation { target: imageZoomIn; property: "scale"; from: 0.8; to: 1.0; duration: 80 }
}
MouseArea {
anchors.fill: parent
@@ -280,12 +246,8 @@ Item {
source: "qrc:///mapwidget-zoom-out"
SequentialAnimation {
id: imageZoomOutAnimation
- PropertyAnimation {
- target: imageZoomOut; property: "scale"; from: 1.0; to: 0.8; duration: 120
- }
- PropertyAnimation {
- target: imageZoomOut; property: "scale"; from: 0.8; to: 1.0; duration: 80
- }
+ PropertyAnimation { target: imageZoomOut; property: "scale"; from: 1.0; to: 0.8; duration: 120 }
+ PropertyAnimation { target: imageZoomOut; property: "scale"; from: 0.8; to: 1.0; duration: 80 }
}
MouseArea {
anchors.fill: parent
@@ -311,13 +273,13 @@ Item {
switch (action) {
case contextMenu.actions.OPEN_LOCATION_IN_GOOGLE_MAPS:
openLocationInGoogleMaps(map.center.latitude, map.center.longitude)
- break;
+ break
case contextMenu.actions.COPY_LOCATION_DECIMAL:
mapHelper.copyToClipboardCoordinates(map.center, false)
- break;
+ break
case contextMenu.actions.COPY_LOCATION_SEXAGESIMAL:
mapHelper.copyToClipboardCoordinates(map.center, true)
- break;
+ break
}
}
}
diff --git a/mobile-widgets/qml/MapWidgetContextMenu.qml b/mobile-widgets/qml/MapWidgetContextMenu.qml
index ca7da4057..50432569c 100644
--- a/mobile-widgets/qml/MapWidgetContextMenu.qml
+++ b/mobile-widgets/qml/MapWidgetContextMenu.qml
@@ -33,12 +33,8 @@ Item {
SequentialAnimation {
id:contextMenuImageAnimation
- PropertyAnimation {
- target: contextMenuImage; property: "scale"; from: 1.0; to: 0.8; duration: 80;
- }
- PropertyAnimation {
- target: contextMenuImage; property: "scale"; from: 0.8; to: 1.0; duration: 60;
- }
+ PropertyAnimation { target: contextMenuImage; property: "scale"; from: 1.0; to: 0.8; duration: 80 }
+ PropertyAnimation { target: contextMenuImage; property: "scale"; from: 0.8; to: 1.0; duration: 60 }
}
MouseArea {
@@ -121,8 +117,6 @@ Item {
State { when: listViewIsVisible === 1; PropertyChanges { target: listView; opacity: 1.0 }},
State { when: listViewIsVisible === 0; PropertyChanges { target: listView; opacity: 0.0 }}
]
- transitions: Transition {
- NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad }
- }
+ transitions: Transition { NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad }}
}
}
diff --git a/qt-models/maplocationmodel.h b/qt-models/maplocationmodel.h
index b3a059038..c2305888d 100644
--- a/qt-models/maplocationmodel.h
+++ b/qt-models/maplocationmodel.h
@@ -55,7 +55,6 @@ public:
~MapLocationModel();
Q_INVOKABLE MapLocation *get(int row);
-
QVariant data(const QModelIndex &index, int role) const override;
int rowCount(const QModelIndex &parent) const override;
int count();
@@ -78,7 +77,6 @@ signals:
void countChanged(int c);
void selectedUuidChanged();
void selectedLocationChanged(MapLocation *);
-
};
#endif