<commit_before>// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
import com.nokia.symbian 1.1
import "../Component"
import QGoogleAuth 1.0

Page {
    id: viewProviderPage
    property int providerId
    property string providerNameValue
    property string providerSecretValue

    tools: ToolBarLayout {
        ToolButtonWithTip {
            flat: true
            iconSource: "toolbar-back"
            toolTipText: qsTr("Back")
            onClicked: {
                window.pageStack.pop()
            }
        }

        ToolButtonWithTip {
            flat: true
            text: qsTr("Edit")
            onClicked: {
                setProviderValues(window.addProviderPage, providerId, providerNameValue, providerSecretValue)
                window.pageStack.push(window.addProviderPage)
            }
        }

    }


    ListHeading {
        id: listHeading

        ListItemText {
            id: headingText
            anchors.fill: listHeading.paddingItem
            text: "View provider PIN"
        }
    }
    Label {
        id: providerLabel
        text: "Provider name"
        anchors {
            top: listHeading.bottom
        }
    }

    TextField {
        id: providerName
        text: providerNameValue
        width: viewProviderPage.width -10
        anchors {
            top: providerLabel.bottom
        }
        readOnly: true
    }

    Label {
        id: totpLabel
        text: "PIN"
        anchors {
            top: providerName.bottom
        }
    }
    TextField {
        id: providerPIN
        width: viewProviderPage.width -10
        readOnly: true
        anchors {
            top: totpLabel.bottom
        }
        text: qGoogleAuth.generatePin(providerSecretValue)
    }
    Timer {
        interval: 5000
        running: true
        repeat: true
        onTriggered: providerPIN.text = qGoogleAuth.generatePin(providerSecretValue)
    }

    QGoogleAuth {
        id: qGoogleAuth
    }<commit_msg>Small optimization<commit_after>// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
import com.nokia.symbian 1.1
import "../Component"
import QGoogleAuth 1.0

Page {
    id: viewProviderPage
    property int providerId
    property string providerNameValue
    property string providerSecretValue
    property variant addProviderPage: AddProviderPage {}

    QueryDialog {
        id: deleteProviderDialog
        titleText: qsTr("Delete request")
        message: qsTr("Delete provider?")
        acceptButtonText: qsTr("Delete")
        rejectButtonText: qsTr("Cancel")

        onAccepted: {
            providerModel.deleteProvider(providerId)
            window.pageStack.pop()
        }
    }

    tools: ToolBarLayout {
        ToolButtonWithTip {
            flat: true
            iconSource: "toolbar-back"
            toolTipText: qsTr("Back")
            onClicked: {
                window.pageStack.pop()
            }
        }

        ToolButtonWithTip {
            flat: true
            text: qsTr("Edit")
            onClicked: {
                setProviderValues(addProviderPage, providerId, providerNameValue, providerSecretValue)
                window.pageStack.push(addProviderPage)
            }
        }

        ToolButtonWithTip {
            flat: true
            text: qsTr("Delete")
            onClicked: {
                deleteProviderDialog.open()
            }
        }


    }


    ListHeading {
        id: listHeading

        ListItemText {
            id: headingText
            anchors.fill: listHeading.paddingItem
            text: "View provider PIN"
        }
    }
    Label {
        id: providerLabel
        text: "Provider name"
        anchors {
            top: listHeading.bottom
        }
    }

    TextField {
        id: providerName
        text: providerNameValue
        width: viewProviderPage.width -10
        anchors {
            top: providerLabel.bottom
        }
        readOnly: true
    }

    Label {
        id: totpLabel
        text: "PIN"
        anchors {
            top: providerName.bottom
        }
    }
    TextField {
        id: providerPIN
        width: viewProviderPage.width -10
        readOnly: true
        anchors {
            top: totpLabel.bottom
        }
        text: qGoogleAuth.generatePin(providerSecretValue)
    }
    Timer {
        id: generatorTimer
        interval: 5000
        running: false
        repeat: true
        onTriggered: {
            providerPIN.text = qGoogleAuth.generatePin(providerSecretValue)
        }
    }

    onStatusChanged: {
        if (status === PageStatus.Activating)
        {
            generatorTimer.running = true
        }

        if (status === PageStatus.Deactivating)
        {
            generatorTimer.running = false
        }
    }

    QGoogleAuth {
        id: qGoogleAuth
    }
{'fraction_non_alphanumeric': 0.07160443167829299, 'fraction_numerical': 0.008206811653672548, 'mean_word_length': 1.5456919060052219, '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': '6947616', 'n_tokens_mistral': 1351, 'n_tokens_neox': 1289, 'n_words': 291}