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>
This commit is contained in:
Lubomir I. Ivanov 2017-07-28 16:40:28 +03:00 committed by Dirk Hohndel
parent 591c4bfcca
commit 69f8fc3c5b
4 changed files with 22 additions and 69 deletions

View file

@ -40,7 +40,6 @@ private:
static MapWidget *m_instance; static MapWidget *m_instance;
QQuickItem *m_rootItem; QQuickItem *m_rootItem;
MapWidgetHelper *m_mapHelper; MapWidgetHelper *m_mapHelper;
}; };
#endif // MAPWIDGET_H #endif // MAPWIDGET_H

View file

@ -16,11 +16,7 @@ Item {
id: mapHelper id: mapHelper
map: map map: map
editMode: false editMode: false
onSelectedDivesChanged: nSelectedDives = list.length
onSelectedDivesChanged: {
// 'list' contains a list of dive list indexes
nSelectedDives = list.length
}
onEditModeChanged: editMessage.isVisible = editMode === true ? 1 : 0 onEditModeChanged: editMessage.isVisible = editMode === true ? 1 : 0
onCoordinatesChanged: {} onCoordinatesChanged: {}
} }
@ -42,10 +38,7 @@ Item {
property real newZoomOut: 1.0 property real newZoomOut: 1.0
property var clickCoord: QtPositioning.coordinate(0, 0) property var clickCoord: QtPositioning.coordinate(0, 0)
Component.onCompleted: { Component.onCompleted: activeMapType = mapType.SATELLITE
activeMapType = mapType.SATELLITE
}
onZoomLevelChanged: mapHelper.calculateSmallCircleRadius(map.center) onZoomLevelChanged: mapHelper.calculateSmallCircleRadius(map.center)
MapItemView { MapItemView {
@ -63,12 +56,8 @@ Item {
source: "qrc:///mapwidget-marker" + (mapHelper.model.selectedUuid === model.uuid ? "-selected" : "") source: "qrc:///mapwidget-marker" + (mapHelper.model.selectedUuid === model.uuid ? "-selected" : "")
SequentialAnimation { SequentialAnimation {
id: mapItemImageAnimation id: mapItemImageAnimation
PropertyAnimation { PropertyAnimation { target: mapItemImage; property: "scale"; from: 1.0; to: 0.7; duration: 120 }
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: 0.7; to: 1.0; duration: 80
}
} }
MouseArea { MouseArea {
drag.target: (mapHelper.editMode && mapHelper.model.selectedUuid === model.uuid) ? mapItem : undefined 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 target: map; property: "zoomLevel"; to: map.newZoomOut; duration: Math.abs(map.newZoomOut - map.zoomLevel) * 200
} }
ParallelAnimation { ParallelAnimation {
CoordinateAnimation { CoordinateAnimation { target: map; property: "center"; to: map.newCenter; duration: 1000 }
target: map; property: "center"; to: map.newCenter; duration: 1000
}
NumberAnimation { NumberAnimation {
target: map; property: "zoomLevel"; to: map.newZoom ; duration: 2000; easing.type: Easing.InCubic target: map; property: "zoomLevel"; to: map.newZoom ; duration: 2000; easing.type: Easing.InCubic
} }
@ -124,25 +111,17 @@ Item {
ParallelAnimation { ParallelAnimation {
id: mapAnimationZoomOut id: mapAnimationZoomOut
NumberAnimation { NumberAnimation { target: map; property: "zoomLevel"; from: map.zoomLevel; to: map.newZoom; duration: 3000 }
target: map; property: "zoomLevel"; from: map.zoomLevel; to: map.newZoom; duration: 3000
}
SequentialAnimation { SequentialAnimation {
PauseAnimation { duration: 2000 } PauseAnimation { duration: 2000 }
CoordinateAnimation { CoordinateAnimation { target: map; property: "center"; to: map.newCenter; duration: 2000 }
target: map; property: "center"; to: map.newCenter; duration: 2000
}
} }
} }
ParallelAnimation { ParallelAnimation {
id: mapAnimationClick id: mapAnimationClick
CoordinateAnimation { CoordinateAnimation { target: map; property: "center"; to: map.newCenter; duration: 500 }
target: map; property: "center"; to: map.newCenter; duration: 500 NumberAnimation { target: map; property: "zoomLevel"; to: map.newZoom; duration: 500 }
}
NumberAnimation {
target: map; property: "zoomLevel"; to: map.newZoom; duration: 500
}
} }
MouseArea { MouseArea {
@ -205,15 +184,12 @@ Item {
opacity: 0.0 opacity: 0.0
property int isVisible: -1 property int isVisible: -1
property real padding: 10.0 property real padding: 10.0
onOpacityChanged: visible = opacity != 0.0 onOpacityChanged: visible = opacity != 0.0
states: [ states: [
State { when: editMessage.isVisible === 1; PropertyChanges { target: editMessage; opacity: 1.0 }}, State { when: editMessage.isVisible === 1; PropertyChanges { target: editMessage; opacity: 1.0 }},
State { when: editMessage.isVisible === 0; PropertyChanges { target: editMessage; opacity: 0.0 }} State { when: editMessage.isVisible === 0; PropertyChanges { target: editMessage; opacity: 0.0 }}
] ]
transitions: Transition { transitions: Transition { NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad }}
NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad }
}
Text { Text {
id: editMessageText id: editMessageText
y: editMessage.padding; x: editMessage.padding y: editMessage.padding; x: editMessage.padding
@ -228,17 +204,11 @@ Item {
id: toggleImage id: toggleImage
x: 10; y: x x: 10; y: x
source: "qrc:///mapwidget-toggle-" + (map.activeMapType === map.mapType.SATELLITE ? "street" : "satellite") source: "qrc:///mapwidget-toggle-" + (map.activeMapType === map.mapType.SATELLITE ? "street" : "satellite")
SequentialAnimation { SequentialAnimation {
id: toggleImageAnimation id: toggleImageAnimation
PropertyAnimation { PropertyAnimation { target: toggleImage; property: "scale"; from: 1.0; to: 0.8; duration: 120 }
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: 0.8; to: 1.0; duration: 80
}
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
@ -254,12 +224,8 @@ Item {
source: "qrc:///mapwidget-zoom-in" source: "qrc:///mapwidget-zoom-in"
SequentialAnimation { SequentialAnimation {
id: imageZoomInAnimation id: imageZoomInAnimation
PropertyAnimation { PropertyAnimation { target: imageZoomIn; property: "scale"; from: 1.0; to: 0.8; duration: 120 }
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: 0.8; to: 1.0; duration: 80
}
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
@ -280,12 +246,8 @@ Item {
source: "qrc:///mapwidget-zoom-out" source: "qrc:///mapwidget-zoom-out"
SequentialAnimation { SequentialAnimation {
id: imageZoomOutAnimation id: imageZoomOutAnimation
PropertyAnimation { PropertyAnimation { target: imageZoomOut; property: "scale"; from: 1.0; to: 0.8; duration: 120 }
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: 0.8; to: 1.0; duration: 80
}
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
@ -311,13 +273,13 @@ Item {
switch (action) { switch (action) {
case contextMenu.actions.OPEN_LOCATION_IN_GOOGLE_MAPS: case contextMenu.actions.OPEN_LOCATION_IN_GOOGLE_MAPS:
openLocationInGoogleMaps(map.center.latitude, map.center.longitude) openLocationInGoogleMaps(map.center.latitude, map.center.longitude)
break; break
case contextMenu.actions.COPY_LOCATION_DECIMAL: case contextMenu.actions.COPY_LOCATION_DECIMAL:
mapHelper.copyToClipboardCoordinates(map.center, false) mapHelper.copyToClipboardCoordinates(map.center, false)
break; break
case contextMenu.actions.COPY_LOCATION_SEXAGESIMAL: case contextMenu.actions.COPY_LOCATION_SEXAGESIMAL:
mapHelper.copyToClipboardCoordinates(map.center, true) mapHelper.copyToClipboardCoordinates(map.center, true)
break; break
} }
} }
} }

View file

@ -33,12 +33,8 @@ Item {
SequentialAnimation { SequentialAnimation {
id:contextMenuImageAnimation id:contextMenuImageAnimation
PropertyAnimation { PropertyAnimation { target: contextMenuImage; property: "scale"; from: 1.0; to: 0.8; duration: 80 }
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: 0.8; to: 1.0; duration: 60;
}
} }
MouseArea { MouseArea {
@ -121,8 +117,6 @@ Item {
State { when: listViewIsVisible === 1; PropertyChanges { target: listView; opacity: 1.0 }}, State { when: listViewIsVisible === 1; PropertyChanges { target: listView; opacity: 1.0 }},
State { when: listViewIsVisible === 0; PropertyChanges { target: listView; opacity: 0.0 }} State { when: listViewIsVisible === 0; PropertyChanges { target: listView; opacity: 0.0 }}
] ]
transitions: Transition { transitions: Transition { NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad }}
NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad }
}
} }
} }

View file

@ -55,7 +55,6 @@ public:
~MapLocationModel(); ~MapLocationModel();
Q_INVOKABLE MapLocation *get(int row); Q_INVOKABLE MapLocation *get(int row);
QVariant data(const QModelIndex &index, int role) const override; QVariant data(const QModelIndex &index, int role) const override;
int rowCount(const QModelIndex &parent) const override; int rowCount(const QModelIndex &parent) const override;
int count(); int count();
@ -78,7 +77,6 @@ signals:
void countChanged(int c); void countChanged(int c);
void selectedUuidChanged(); void selectedUuidChanged();
void selectedLocationChanged(MapLocation *); void selectedLocationChanged(MapLocation *);
}; };
#endif #endif