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

ListItem {
    property bool returnToUser: false
    property alias showUser: userNameLabel.visible
    property int previousAppId: -1
    property int previousStep: 1

    contentHeight: Theme.itemSizeExtraLarge

    onClicked: {
        var appId = model.appId
        if (previousAppId === appId) {
            // Trying to open a page for the previous application, so just go back
            var p = pageStack.previousPage()
            for (var i = 1; i < previousStep; ++i) {
                p = pageStack.previousPage(p)
            }
            pageStack.pop(p)
        } else {
            pageStack.push(Qt.resolvedUrl("../pages/ApplicationPage.qml"), {
                               appId: appId,
                               returnToUser: returnToUser
                           })
        }
    }

    Row {
        id: row
        anchors.verticalCenter: parent.verticalCenter
        x: Theme.horizontalPageMargin
        width: parent.width - Theme.horizontalPageMargin * 2
        spacing: Theme.paddingMedium

        Image {
            id: appIcon
            anchors.verticalCenter: parent.verticalCenter
            width: Theme.iconSizeLauncher
            height: Theme.iconSizeLauncher
            fillMode: Image.PreserveAspectFit
            source: model.iconSource ? model.iconSource : "qrc:/images/appicon.png"
        }

        Column {
            id: column
            anchors.verticalCenter: parent.verticalCenter
            width: row.width - appIcon.width - Theme.paddingMedium
            spacing: Theme.paddingSmall

            Label {
                id: titleLabel
                width: parent.width - star.width
                maximumLineCount: 2
                verticalAlignment: Qt.AlignVCenter
                font.pixelSize: Theme.fontSizeExtraSmall
                wrapMode: Text.WordWrap
                text: model.title
            }

            Label {
                id: categoryLabel
                width: parent.width
                font.pixelSize: Theme.fontSizeExtraSmall
                color: Theme.secondaryColor
                text: model.category
            }

            Row {
                spacing: Theme.paddingSmall

                RatingBox {
                    id: ratingBox
                    ratingCount: model.ratingCount
                    rating: model.rating
                }

                Label {
                    id: userNameLabel
                    anchors.verticalCenter: parent.verticalCenter
                    width: column.width - ratingBox.width - statusLoader.width - parent.spacing * 2
                    horizontalAlignment: Qt.AlignRight
                    truncationMode: TruncationMode.Fade
                    font.pixelSize: Theme.fontSizeTiny
                    color: Theme.highlightColor
                    text: model.userName + "\u2009\u2022\u2009" +
                          model.createDate.toLocaleDateString(_locale, Locale.NarrowFormat)
                }

                Loader {
                    readonly property var _packageStatus: packageStatus

                    id: statusLoader
                    anchors.verticalCenter: parent.verticalCenter
                    sourceComponent: _packageStatus < OrnPm.PackageInstalling ?
                                         iconComponent : busyComponent

                    Component {
                        id: busyComponent
                        BusyIndicator {
                            size: BusyIndicatorSize.ExtraSmall
                            running: true<commit_msg>AppListDelegate.qml: use ShortFormat instead of NarrowFormat for dates<commit_after>import QtQuick 2.0
import Sailfish.Silica 1.0
import harbour.orn 1.0

ListItem {
    property bool returnToUser: false
    property alias showUser: userNameLabel.visible
    property int previousAppId: -1
    property int previousStep: 1

    contentHeight: Theme.itemSizeExtraLarge

    onClicked: {
        var appId = model.appId
        if (previousAppId === appId) {
            // Trying to open a page for the previous application, so just go back
            var p = pageStack.previousPage()
            for (var i = 1; i < previousStep; ++i) {
                p = pageStack.previousPage(p)
            }
            pageStack.pop(p)
        } else {
            pageStack.push(Qt.resolvedUrl("../pages/ApplicationPage.qml"), {
                               appId: appId,
                               returnToUser: returnToUser
                           })
        }
    }

    Row {
        id: row
        anchors.verticalCenter: parent.verticalCenter
        x: Theme.horizontalPageMargin
        width: parent.width - Theme.horizontalPageMargin * 2
        spacing: Theme.paddingMedium

        Image {
            id: appIcon
            anchors.verticalCenter: parent.verticalCenter
            width: Theme.iconSizeLauncher
            height: Theme.iconSizeLauncher
            fillMode: Image.PreserveAspectFit
            source: model.iconSource ? model.iconSource : "qrc:/images/appicon.png"
        }

        Column {
            id: column
            anchors.verticalCenter: parent.verticalCenter
            width: row.width - appIcon.width - Theme.paddingMedium
            spacing: Theme.paddingSmall

            Label {
                id: titleLabel
                width: parent.width - star.width
                maximumLineCount: 2
                verticalAlignment: Qt.AlignVCenter
                font.pixelSize: Theme.fontSizeExtraSmall
                wrapMode: Text.WordWrap
                text: model.title
            }

            Label {
                id: categoryLabel
                width: parent.width
                font.pixelSize: Theme.fontSizeExtraSmall
                color: Theme.secondaryColor
                text: model.category
            }

            Row {
                spacing: Theme.paddingSmall

                RatingBox {
                    id: ratingBox
                    ratingCount: model.ratingCount
                    rating: model.rating
                }

                Label {
                    id: userNameLabel
                    anchors.verticalCenter: parent.verticalCenter
                    width: column.width - ratingBox.width - statusLoader.width - parent.spacing * 2
                    horizontalAlignment: Qt.AlignRight
                    truncationMode: TruncationMode.Fade
                    font.pixelSize: Theme.fontSizeTiny
                    color: Theme.highlightColor
                    text: model.userName + "\u2009\u2022\u2009" +
                          model.createDate.toLocaleDateString(_locale, Locale.ShortFormat)
                }

                Loader {
                    readonly property var _packageStatus: packageStatus

                    id: statusLoader
                    anchors.verticalCenter: parent.verticalCenter
                    sourceComponent: _packageStatus < OrnPm.PackageInstalling ?
                                         iconComponent : busyComponent

                    Component {
                        id: busyComponent
                        BusyIndicator {
                            size: BusyIndicatorSize.ExtraSmall
                            running: true
{'fraction_non_alphanumeric': 0.05962059620596206, 'fraction_numerical': 0.0065040650406504065, 'mean_word_length': 1.2943736400373018, 'pattern_counts': {'":': 0, '<': 7, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7552687', 'n_tokens_mistral': 1790, 'n_tokens_neox': 1643, 'n_words': 386}