<commit_before>/*
 * Copyright 2011 Intel Corporation.
 *
 * This program is licensed under the terms and conditions of the
 * Apache License, version 2.0.  The full text of the Apache License is at 	
 * http://www.apache.org/licenses/LICENSE-2.0
 */

import QtQuick 1.1
import com.nokia.meego 1.0

Item {
    id: contactCardPortrait

    height: UiConstants.ListItemHeightDefault
    anchors.right: parent.right
    anchors.left: parent.left

    signal clicked

    ContactAvatarImage {
        id: photo
        contact: model.person
        anchors {
            left: parent.left;
            leftMargin: UiConstants.DefaultMargin
            verticalCenter: parent.verticalCenter
        }
    }

    Label {
        id: nameFirst
        text: model.person.displayLabel
        elide: Text.ElideRight
        anchors {
            left: photo.right;
            right: favorite.visible ? favorite.left : parent.right
            verticalCenter: parent.verticalCenter;
            leftMargin: UiConstants.DefaultMargin
        }
    }

    // TODO: only instantiate if required?
    Image {
        id: favorite
        source: "image://theme/icon-m-toolbar-favorite-mark"
        visible: model.person.favorite
        anchors.right: parent.right
        anchors.rightMargin: UiConstants.DefaultMargin
        anchors.verticalCenter: parent.verticalCenter
    }

    MouseArea {
        id: mouseArea
        anchors.fill: contactCardPortrait
        onClicked: {
            contactCardPortrait.clicked();
        }
    }

    states: State {
        name: "pressed"; when: mouseArea.pressed == true
        PropertyChanges { target: contactCardPortrait; opacity: .7}
    }

}

<commit_msg>remove an unnecessary Item in list delegate<commit_after>/*
 * Copyright 2011 Intel Corporation.
 *
 * This program is licensed under the terms and conditions of the
 * Apache License, version 2.0.  The full text of the Apache License is at 	
 * http://www.apache.org/licenses/LICENSE-2.0
 */

import QtQuick 1.1
import com.nokia.meego 1.0

MouseArea {
    id: listDelegate

    height: UiConstants.ListItemHeightDefault
    anchors.right: parent.right
    anchors.left: parent.left

    ContactAvatarImage {
        id: photo
        contact: model.person
        anchors {
            left: parent.left;
            leftMargin: UiConstants.DefaultMargin
            verticalCenter: parent.verticalCenter
        }
    }

    Label {
        id: nameFirst
        text: model.person.displayLabel
        elide: Text.ElideRight
        anchors {
            left: photo.right;
            right: favorite.visible ? favorite.left : parent.right
            verticalCenter: parent.verticalCenter;
            leftMargin: UiConstants.DefaultMargin
        }
    }

    // TODO: only instantiate if required?
    Image {
        id: favorite
        source: "image://theme/icon-m-toolbar-favorite-mark"
        visible: model.person.favorite
        anchors.right: parent.right
        anchors.rightMargin: UiConstants.DefaultMargin
        anchors.verticalCenter: parent.verticalCenter
    }

    states: State {
        name: "pressed"; when: pressed == true
        PropertyChanges { target: listDelegate; opacity: .7}
    }

}


{'fraction_non_alphanumeric': 0.08090514569125852, 'fraction_numerical': 0.008059516429014259, 'mean_word_length': 2.142161635832522, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7302442', 'n_tokens_mistral': 907, 'n_tokens_neox': 886, 'n_words': 225}