<commit_before>import QtQuick 2.0
import Sailfish.Silica 1.0
import harbour.orn 1.0
import "../components"

Page {
    property bool _working: false

    id: page
    allowedOrientations: defaultAllowedOrientations

    SilicaListView {
        id: appsList
        anchors.fill: parent
        model: OrnProxyModel {
            id: proxyModel
            sortRole: OrnInstalledAppsModel.SortRole
            sortCaseSensitivity: Qt.CaseInsensitive
            sourceModel: OrnInstalledAppsModel {
                id: installedAppsModel
                onModelAboutToBeReset: _working = true
                onModelReset: {
                    _working = false
                    proxyModel.sort(Qt.AscendingOrder)
                }
            }
        }

        header: PageHeader {
            //% "Installed Applications"
            title: qsTrId("orn-installed-apps")
            //% "Only from enabled repositories"
            description: qsTrId("orn-installed-apps-description")
        }

        section {
            property: OrnPm.updatesAvailable ? "updateAvailable" : "section"
            delegate: SectionHeader {
                // If updates are available then show sections by status
                // otherwise show sections by the first letter of titles
                text: OrnPm.updatesAvailable ?
                          (section === '1' ? qsTrId("orn-update-available") :
                                             qsTrId("orn-installed")) :
                          section
            }
        }

        delegate: ListItem {
            id: item
            contentHeight: Theme.itemSizeExtraLarge
            onClicked: pageStack.push(Qt.resolvedUrl("SearchPage.qml"),
                                      { initialSearch: packageName })

            menu: ContextMenu {

                MenuItem {
                    visible: updateAvailable
                    text: qsTrId("orn-update")
                    onClicked: OrnPm.installPackage(packageName)
                }

                MenuItem {
                    text: qsTrId("orn-remove")
                    onClicked: Remorse.itemAction(item, qsTrId("orn-removing"), function() {
                        // FIXME
                        OrnPm.removePackage(packageId)
                    })
                }
            }

            Row {
                id: row
                anchors {
                    verticalCenter: parent.verticalCenter
                    left: parent.left
                    right: parent.right
                    leftMargin: Theme.horizontalPageMargin
                    rightMargin: Theme.horizontalPageMargin
                }
                spacing: Theme.paddingMedium
<commit_msg>InstalledAppsPage - fix update menu entry<commit_after>import QtQuick 2.0
import Sailfish.Silica 1.0
import harbour.orn 1.0
import "../components"

Page {
    property bool _working: false

    id: page
    allowedOrientations: defaultAllowedOrientations

    SilicaListView {
        id: appsList
        anchors.fill: parent
        model: OrnProxyModel {
            id: proxyModel
            sortRole: OrnInstalledAppsModel.SortRole
            sortCaseSensitivity: Qt.CaseInsensitive
            sourceModel: OrnInstalledAppsModel {
                id: installedAppsModel
                onModelAboutToBeReset: _working = true
                onModelReset: {
                    _working = false
                    proxyModel.sort(Qt.AscendingOrder)
                }
            }
        }

        header: PageHeader {
            //% "Installed Applications"
            title: qsTrId("orn-installed-apps")
            //% "Only from enabled repositories"
            description: qsTrId("orn-installed-apps-description")
        }

        section {
            property: OrnPm.updatesAvailable ? "updateAvailable" : "section"
            delegate: SectionHeader {
                // If updates are available then show sections by status
                // otherwise show sections by the first letter of titles
                text: OrnPm.updatesAvailable ?
                          (section === '1' ? qsTrId("orn-update-available") :
                                             qsTrId("orn-installed")) :
                          section
            }
        }

        delegate: ListItem {
            id: item
            contentHeight: Theme.itemSizeExtraLarge
            onClicked: pageStack.push(Qt.resolvedUrl("SearchPage.qml"),
                                      { initialSearch: packageName })

            menu: ContextMenu {

                MenuItem {
                    visible: updateAvailable
                    text: qsTrId("orn-update")
                    onClicked: OrnPm.updatePackage(packageName)
                }

                MenuItem {
                    text: qsTrId("orn-remove")
                    onClicked: Remorse.itemAction(item, qsTrId("orn-removing"), function() {
                        // FIXME
                        OrnPm.removePackage(packageId)
                    })
                }
            }

            Row {
                id: row
                anchors {
                    verticalCenter: parent.verticalCenter
                    left: parent.left
                    right: parent.right
                    leftMargin: Theme.horizontalPageMargin
                    rightMargin: Theme.horizontalPageMargin
                }
                spacing: Theme.paddingMedium

{'fraction_non_alphanumeric': 0.0698268003646308, 'fraction_numerical': 0.0025524156791248863, 'mean_word_length': 1.2419288925214549, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '971409', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1251, 'n_words': 268}