<commit_before>import QtQuick 2.12
import QtQuick.Controls 2.5

import ".."

Item {
    id: root

    property string name
    property Setting setting
    property alias echoMode: textField.echoMode
    property alias inputMethodHints: textField.inputMethodHints

    implicitHeight: item.implicitHeight

    SettingItem {
        id: item

        name: root.name
        subtitle: setting.value
        anchors.fill: parent

        onClicked: dialog.open()

        Dialog {
            id: dialog

            title: root.name
            anchors.centerIn: Overlay.overlay
            modal: true
            standardButtons: Dialog.Ok | Dialog.Cancel

            onAccepted: setting.setValue(textField.text)
            onRejected: textField.text = setting.value

            TextField {
                id: textField
                anchors.fill: parent
                text: setting.value
            }<commit_msg>Stop showing raw passwords in QML settings<commit_after>import QtQuick 2.12
import QtQuick.Controls 2.5

import ".."

Item {
    id: root

    property string name
    property Setting setting
    property alias echoMode: textField.echoMode
    property alias inputMethodHints: textField.inputMethodHints

    implicitHeight: item.implicitHeight

    SettingItem {
        id: item

        name: root.name
        subtitle: textField.echoMode === TextField.Password
            ? "*".repeat(setting.value.length)
            : setting.value
        anchors.fill: parent

        onClicked: dialog.open()

        Dialog {
            id: dialog

            title: root.name
            anchors.centerIn: Overlay.overlay
            modal: true
            standardButtons: Dialog.Ok | Dialog.Cancel

            onAccepted: setting.setValue(textField.text)
            onRejected: textField.text = setting.value

            TextField {
                id: textField
                anchors.fill: parent
                text: setting.value
            }
{'fraction_non_alphanumeric': 0.06622851365015167, 'fraction_numerical': 0.005055611729019211, 'mean_word_length': 1.787323943661972, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6540059', 'n_tokens_mistral': 529, 'n_tokens_neox': 498, 'n_words': 131}