<commit_before>import QtQuick 2.4
import QtQuick.Controls 1.3
import QtLocation 5.3
import QtPositioning 5.3
import QtSensors 5.3
import QtGraphicalEffects 1.0

Item {
    id: topView
    width: 480
    height: 800
    visible: true

    focus: true

    property bool active: true
    property bool showZoomLevel: true
    property bool showControls: true

    property real contolsOpacity: showControls ? 1.0 : 0.0

    signal clicked()
    signal menuClicked()

    Keys.onEscapePressed: Qt.quit()
    Keys.onPressed: {
        if (event.key === Qt.Key_Plus) {
            map.zoom(map.zoomLevel + 1)
        } else if (event.key === Qt.Key_Minus) {
            map.zoom(map.zoomLevel - 1)
        }
    }

    Plugin {
        id: mapPlugin
        name: "osm"
    }

    function aboutToClose() {
        if (holdDialog.visible) {
            holdDialog.hide()
            return false
        }
        return true
    }

    PositionSource {
        id: positionSource
        name: "osm"
        updateInterval: 200
        preferredPositioningMethods: PositionSource.AllPositioningMethods
        onPositionChanged: {
            console.log("position changed")
            map.showMyPos()
            stop()
        }

        onSourceErrorChanged: {

        }

        function getAvgZoomLevel(scale) {
            return map.minimumZoomLevel + (map.maximumZoomLevel - map.minimumZoomLevel) * scale
        }

        onActiveChanged: {
            console.log("active changed: " + active.toString())
                /*console.log("geoposition changed")
                if (position.coordinate.isValid) {
                    console.log("new geopos received")
                    var expectedZoomLevel = getAvgZoomLevel(0.5)
                    if (expectedZoomLevel < map.zoomLevel) {
                        expectedZoomLevel = map.zoomLevel
                    }
                    map.moveToCoord(position.coordinate, expectedZoomLevel)

                    if (me == null) {
                        var mapMeMarkComponent = Qt.createComponent("MapMeMark.qml")
                        if (mapMeMarkComponent.status === Component.Ready) {
                            me = mapMeMarkComponent.createObject(map)
                        }
                    }
                    me.coordinate = position.coordinate
                    map.addMapItem(me)

                    findMeButtonRotationAnim.stop()
                    findMeButtonRotationAnimBack.start()
                }
            }*/
        }

        function debugPrintSupportedPositioningMethods() {
            if (supportedPositioningMethods == PositionSource.AllPositioningMethods) {
                console.log("All pos methods")
                return
            }
            if (supportedPositioningMethods & PositionSource.SatellitePositioningMethods) {
                console.log("Sat pos methods")
            }
            if (supportedPositioningMethods & PositionSource.NonSatellitePositioningMethods) {
                console.log("Network pos methods")
            }
            if (supportedPositioningMethods & PositionSource.NoPositioningMethods) {
                console.log("No pos methods")
            }
        }
    }

    EnableLocServiceDialog {
        id: enableLocServiceDialog
        onVisibilityChanged: {
            console.log("dialog showed")
        }
        onRejected: {<commit_msg>[C|Client] Removed unused code<commit_after>import QtQuick 2.4
import QtQuick.Controls 1.3
import QtLocation 5.3
import QtPositioning 5.3
import QtSensors 5.3
import QtGraphicalEffects 1.0

Item {
    id: topView
    width: 480
    height: 800
    visible: true

    focus: true

    property bool active: true
    property bool showZoomLevel: true
    property bool showControls: true

    property real contolsOpacity: showControls ? 1.0 : 0.0

    signal clicked()
    signal menuClicked()

    Keys.onEscapePressed: Qt.quit()
    Keys.onPressed: {
        if (event.key === Qt.Key_Plus) {
            map.zoom(map.zoomLevel + 1)
        } else if (event.key === Qt.Key_Minus) {
            map.zoom(map.zoomLevel - 1)
        }
    }

    Plugin {
        id: mapPlugin
        name: "osm"
    }

    function aboutToClose() {
        if (holdDialog.visible) {
            holdDialog.hide()
            return false
        }
        return true
    }

    PositionSource {
        id: positionSource
        name: "osm"
        updateInterval: 200
        preferredPositioningMethods: PositionSource.AllPositioningMethods
        onPositionChanged: {
            console.log("position changed")
            map.showMyPos()
            stop()
        }

        function getAvgZoomLevel(scale) {
            return map.minimumZoomLevel + (map.maximumZoomLevel - map.minimumZoomLevel) * scale
        }

        onActiveChanged: {
            console.log("active changed: " + active.toString())
        }

        function debugPrintSupportedPositioningMethods() {
            if (supportedPositioningMethods == PositionSource.AllPositioningMethods) {
                console.log("All pos methods")
                return
            }
            if (supportedPositioningMethods & PositionSource.SatellitePositioningMethods) {
                console.log("Sat pos methods")
            }
            if (supportedPositioningMethods & PositionSource.NonSatellitePositioningMethods) {
                console.log("Network pos methods")
            }
            if (supportedPositioningMethods & PositionSource.NoPositioningMethods) {
                console.log("No pos methods")
            }
        }
    }

    EnableLocServiceDialog {
        id: enableLocServiceDialog
        onVisibilityChanged: {
            console.log("dialog showed")
        }
        onRejected: {
{'fraction_non_alphanumeric': 0.0801658604008293, 'fraction_numerical': 0.009675190048375951, 'mean_word_length': 1.7203947368421053, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6847800', 'n_tokens_mistral': 1573, 'n_tokens_neox': 1449, 'n_words': 313}