I have made the following changes intended for :
  CE:Apps:MTF / qmlcontacts

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/5290

Thank You,
Robin Burchell

[This message was auto-generated]

---

Request # 5290:

Messages from BOSS:

State: review at 2012-07-24T15:20:48 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: home:w00t:branches:CE:Apps:MTF / qmlcontacts -> CE:Apps:MTF / 
qmlcontacts
  
changes files:
--------------
--- qmlcontacts.changes
+++ qmlcontacts.changes
@@ -0,0 +1,9 @@
+* Fri Jul 20 2012 Robin Burchell <[email protected]> - 0.3.9
+- Fixes NEMO#251: Use the thumbnail provider for much faster avatar thumbnails
+- Fixes NEMO#241: When creating a new contact, default avatar is empty
+- Fixes NEMO#244: Fast scroll bar in contacts does not work
+- Fixes NEMO#245: Share the gallery UI for setting thumbnails
+- Fixes NEMO#249: Avatar quality is crap
+- Avoid stretching avatar thumbnails in some circumstances
+- Optimise list panning performance a bit
+

old:
----
  0001-clip-avatars-otherwise-we-ll-suffer-overdraw.patch
  0001-correctly-crop-images.patch
  0001-fix-hilights-to-overlay-the-image.patch
  0001-fix-warping-of-avatar-images.patch
  0001-only-set-one-dimension-of-sourceSize-to-avoid-stretc.patch
  qmlcontacts-0.3.7.tar.bz2

new:
----
  0001-remove-folder-list-model-dependency.patch
  0001-remove-unneeded-properties.patch
  0001-small-optimisations.patch
  qmlcontacts-0.3.9.tar.bz2

spec files:
-----------
--- qmlcontacts.spec
+++ qmlcontacts.spec
@@ -9,20 +9,19 @@
 # << macros
 
 Summary:    Contacts application for nemo
-Version:    0.3.7
+Version:    0.3.9
 Release:    1
 Group:      Applications/System
 License:    GPLv2
 URL:        https://github.com/nemomobile/qmlcontacts
 Source0:    %{name}-%{version}.tar.bz2
 Source100:  qmlcontacts.yaml
-Patch0:     0001-correctly-crop-images.patch
-Patch1:     0001-only-set-one-dimension-of-sourceSize-to-avoid-stretc.patch
-Patch2:     0001-clip-avatars-otherwise-we-ll-suffer-overdraw.patch
-Patch3:     0001-fix-hilights-to-overlay-the-image.patch
-Patch4:     0001-fix-warping-of-avatar-images.patch
+Patch0:     0001-small-optimisations.patch
+Patch1:     0001-remove-unneeded-properties.patch
+Patch2:     0001-remove-folder-list-model-dependency.patch
 Requires:   qt-components
-Requires:   libqtdeclarative4-folderlistmodel
+Requires:   nemo-qml-plugins-thumbnailer
+Requires:   qmlgallery
 BuildRequires:  pkgconfig(QtCore) >= 4.7.0
 BuildRequires:  pkgconfig(QtDeclarative)
 BuildRequires:  pkgconfig(QtContacts)
@@ -40,16 +39,12 @@
 %prep
 %setup -q -n %{name}
 
-# 0001-correctly-crop-images.patch
+# 0001-small-optimisations.patch
 %patch0 -p1
-# 0001-only-set-one-dimension-of-sourceSize-to-avoid-stretc.patch
+# 0001-remove-unneeded-properties.patch
 %patch1 -p1
-# 0001-clip-avatars-otherwise-we-ll-suffer-overdraw.patch
+# 0001-remove-folder-list-model-dependency.patch
 %patch2 -p1
-# 0001-fix-hilights-to-overlay-the-image.patch
-%patch3 -p1
-# 0001-fix-warping-of-avatar-images.patch
-%patch4 -p1
 # >> setup
 # << setup
 

other changes:
--------------

++++++ 0001-remove-folder-list-model-dependency.patch (new)
--- 0001-remove-folder-list-model-dependency.patch
+++ 0001-remove-folder-list-model-dependency.patch
@@ -0,0 +1,24 @@
+From 9f11298ee7f33b9c34859472bea863ddac396ba1 Mon Sep 17 00:00:00 2001
+From: Robin Burchell <[email protected]>
+Date: Tue, 24 Jul 2012 17:07:06 +0200
+Subject: [PATCH] remove folder list model dependency
+
+---
+ AvatarPickerSheet.qml |    1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/AvatarPickerSheet.qml b/AvatarPickerSheet.qml
+index e9df0a8..af3804b 100644
+--- a/AvatarPickerSheet.qml
++++ b/AvatarPickerSheet.qml
+@@ -1,7 +1,6 @@
+ import QtQuick 1.1
+ import QtMobility.contacts 1.1
+ import com.nokia.meego 1.0
+-import Qt.labs.folderlistmodel 1.0
+ import org.nemomobile.thumbnailer 1.0
+ import org.nemomobile.qmlgallery 1.0
+ 
+-- 
+1.7.7.6
+

++++++ 0001-remove-unneeded-properties.patch (new)
--- 0001-remove-unneeded-properties.patch
+++ 0001-remove-unneeded-properties.patch
@@ -0,0 +1,28 @@
+From a91166aafe1b35fd9e2185a1362f4a5083d40c8b Mon Sep 17 00:00:00 2001
+From: Robin Burchell <[email protected]>
+Date: Tue, 24 Jul 2012 16:26:13 +0200
+Subject: [PATCH] remove unneeded properties
+
+---
+ ContactListWidget.qml |    5 +----
+ 1 files changed, 1 insertions(+), 4 deletions(-)
+
+diff --git a/ContactListWidget.qml b/ContactListWidget.qml
+index c1e1b74..81f52f2 100644
+--- a/ContactListWidget.qml
++++ b/ContactListWidget.qml
+@@ -34,10 +34,7 @@ Item {
+     ListView {
+         id: cardListView
+         anchors.fill: parent
+-        snapMode: ListView.SnapToItem
+-        highlightFollowsCurrentItem: false
+-        focus: true
+-        keyNavigationWraps: false
++        cacheBuffer: cardListView.height
+         clip: true
+         model: app.contactListModel
+         opacity: 0
+-- 
+1.7.7.6
+

++++++ 0001-small-optimisations.patch (new)
--- 0001-small-optimisations.patch
+++ 0001-small-optimisations.patch
@@ -0,0 +1,34 @@
+From 535fa28a4ba1394de74e253d57d9d87ad9ac0945 Mon Sep 17 00:00:00 2001
+From: Robin Burchell <[email protected]>
+Date: Tue, 24 Jul 2012 16:23:25 +0200
+Subject: [PATCH] small optimisations
+
+---
+ ContactListDelegate.qml |    3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/ContactListDelegate.qml b/ContactListDelegate.qml
+index 833a0b2..d8faf5d 100644
+--- a/ContactListDelegate.qml
++++ b/ContactListDelegate.qml
+@@ -13,8 +13,8 @@ Item {
+     id: contactCardPortrait
+ 
+     height: UiConstants.ListItemHeightDefault
+-    width: parent.width
+     anchors.right: parent.right
++    anchors.left: parent.left
+ 
+     signal clicked
+ 
+@@ -38,7 +38,6 @@ Item {
+             verticalCenter: parent.verticalCenter;
+             leftMargin: UiConstants.DefaultMargin
+         }
+-        smooth: true
+     }
+ 
+     // TODO: only instantiate if required?
+-- 
+1.7.7.6
+

++++++ qmlcontacts-0.3.7.tar.bz2 -> qmlcontacts-0.3.9.tar.bz2
--- AvatarImage.qml
+++ AvatarImage.qml
@@ -8,16 +8,16 @@
 
 import QtQuick 1.1
 import QtMobility.contacts 1.1
+import org.nemomobile.thumbnailer 1.0
 
 Image {
     fillMode: Image.PreserveAspectCrop
     asynchronous: true
-    smooth: true
     width: UiConstants.ListItemHeightSmall
     height: UiConstants.ListItemHeightSmall
     property Contact contact
     sourceSize.width: width
-    sourceSize.height: height
+    sourceSize.height: width
 
     onContactChanged: {
         contact.avatar.fieldsChanged.connect(avatarPotentiallyChanged)
@@ -25,7 +25,7 @@
     }
 
     function avatarPotentiallyChanged() {
-        source = contact.avatar.imageUrl
+        source = "image://nemoThumbnail/" + contact.avatar.imageUrl
         if (source == "")
             source = "image://theme/icon-m-telephony-contact-avatar"
     }
--- AvatarPickerSheet.qml
+++ AvatarPickerSheet.qml
@@ -2,6 +2,8 @@
 import QtMobility.contacts 1.1
 import com.nokia.meego 1.0
 import Qt.labs.folderlistmodel 1.0
+import org.nemomobile.thumbnailer 1.0
+import org.nemomobile.qmlgallery 1.0
 
 Sheet {
     id: avatarPickerSheet
@@ -9,58 +11,38 @@
     rejectButtonText: "Cancel"
 
     property Contact contact
-
     signal avatarPicked(string pathToAvatar)
 
-    property int avatarGridSize: avatarPickerSheet.width / 3
-
-    Component {
-        id: gridHighlight
-        Rectangle {
-            color: "blue"
-            opacity: 0.5
-            width: avatarGridSize; height: avatarGridSize
-        }
-    }
-
-    content: GridView {
-        id: avatarGridView
+    content: Rectangle {
+        // TODO: see if we can get theme asset for inverted background
+        // cannot use theme.inverted, because that will change whole app's 
theme.
+        color: "black"
         anchors.fill: parent
-        cellWidth: avatarGridSize
-        cellHeight: avatarGridSize
-
-        model: FolderListModel {
-            id: avatarModel
-            folder: "file://" + systemAvatarDirectory
-            nameFilters: ["*.png", "*.jpg", "*.jpeg"]
-            showDirs: false
-        }
-        delegate: Item {
-            id: bgRect
-            width: avatarGridSize
-            height: avatarGridSize
-            property alias avatarPath: delegateImage.source
-            Image {
-                id: delegateImage
-                width: avatarGridSize
-                height: avatarGridSize
-                source: filePath
-                anchors.centerIn: parent
-                asynchronous: true
-                sourceSize.width: avatarGridSize
-                sourceSize.height: avatarGridSize
-            }
+        GalleryView {
+        id: avatarGridView
+        property string filePath
+        model: GalleryModel { }
+        delegate: GalleryDelegate {
+            id: delegateInstance
             MouseArea {
                 anchors.fill: parent
-                onClicked: avatarGridView.currentIndex = index
+                onClicked: {
+                    avatarGridView.currentIndex = index
+                    avatarGridView.filePath = url
+                }
+            }
+            Rectangle {
+                color: "blue"
+                opacity: 0.3
+                visible: delegateInstance.GridView.isCurrentItem
+                anchors.fill: parent
             }
         }
-        highlight: gridHighlight
-        highlightFollowsCurrentItem: true
-        focus: true
     }
+}
+
     onAccepted: {
-        avatarPicked(avatarGridView.currentItem.avatarPath)
+        avatarPicked(avatarGridView.filePath)
     }
 }
 
--- ContactEditorSheet.qml
+++ ContactEditorSheet.qml
@@ -45,7 +45,6 @@
                     id: data_avatar
                     width: parent.width - UiConstants.DefaultMargin
                     height: parent.height - UiConstants.DefaultMargin
-                    fillMode: Image.PreserveAspectCrop
                     anchors.centerIn: parent
                     contact: newContactViewPage.contact
                 }
--- ContactListDelegate.qml
+++ ContactListDelegate.qml
@@ -47,6 +47,7 @@
         source: "image://theme/icon-m-toolbar-favorite-mark"
         visible: contact.favorite.favorite
         anchors.right: parent.right
+        anchors.rightMargin: UiConstants.DefaultMargin
         anchors.verticalCenter: parent.verticalCenter
     }
 
--- ContactListWidget.qml
+++ ContactListWidget.qml
@@ -41,6 +41,41 @@
         clip: true
         model: app.contactListModel
         opacity: 0
+        section.property: "display"
+        section.criteria: ViewSection.FirstCharacter
+        section.delegate: Component {
+         Rectangle {
+             width: parent.width
+             height: childrenRect.height
+             color: "lightsteelblue"
+
+             Text {
+                 text: section
+                 font.bold: true
+             }
+         }
+        }
+
+        function customSectionScrollerDataHandler() {
+            var sections = []
+            var sectionsData = []
+            var curSection
+            var contacts = model.contacts
+            for (var i = 0; i < contacts.length; ++i) {
+                console.log(contacts[i])
+                if (contacts[i].displayLabel[0] != curSection) {
+                    sections.push(contacts[i].displayLabel[0])
+                    curSection = sections[sections.length - 1]
+                }
+            }
+            for (var i = 0; i < sections.length; ++i) {
+                sectionsData.push({ index: i })
+            }
+            return {
+                sectionData: sectionsData,
+                _sections: sections
+            }
+        }
 
         delegate: ContactListDelegate {
             id: card
@@ -53,29 +88,6 @@
                 );
             }
         }
-
-        section.property: "firstcharacter"
-        section.criteria: ViewSection.FirstCharacter
-        section.delegate: Item {
-            width: cardListView.width
-            height: 30
-            id: sectionBackground
-            Label {
-                //: If a contact isn't sorted under one of the values in a 
locale's alphabet, it is sorted under '#'
-                text: section.toUpperCase()
-                anchors.verticalCenter: sectionBackground.verticalCenter
-                anchors.right: sectionBackground.right
-                anchors.rightMargin: 30
-                smooth: true
-            }
-            Image {
-                anchors.right: sectionBackground.left
-                anchors.left: parent.left
-                anchors.verticalCenter: sectionBackground.verticalCenter
-                anchors.rightMargin: 24
-                source: "image://theme/meegotouch-groupheader" + 
(theme.inverted ? "-inverted" : "") + "-background"
-            }
-        }
     }
 
     SectionScroller {
--- main.qml
+++ main.qml
@@ -72,6 +72,8 @@
         anchors.bottom: parent.bottom
     }
 
-    property ContactModel contactListModel: ContactModel {}
+    property ContactModel contactListModel: ContactModel {
+        property int count: contacts.length
+    }
 }
 
--- meego-app-contacts.pro
+++ meego-app-contacts.pro
@@ -1,4 +1,4 @@
-VERSION = 0.3.7
+VERSION = 0.3.9
 PROJECT_NAME = qmlcontacts
 TEMPLATE = app
 CONFIG += ordered mobility

++++++ qmlcontacts.yaml
--- qmlcontacts.yaml
+++ qmlcontacts.yaml
@@ -1,6 +1,6 @@
 Name:  qmlcontacts
 Summary: Contacts application for nemo
-Version: 0.3.7
+Version: 0.3.9
 Release: 1
 Group: Applications/System
 License: GPLv2
@@ -8,11 +8,9 @@
 Sources:
     - "%{name}-%{version}.tar.bz2"
 Patches:
-    - 0001-correctly-crop-images.patch
-    - 0001-only-set-one-dimension-of-sourceSize-to-avoid-stretc.patch
-    - 0001-clip-avatars-otherwise-we-ll-suffer-overdraw.patch
-    - 0001-fix-hilights-to-overlay-the-image.patch
-    - 0001-fix-warping-of-avatar-images.patch
+    - 0001-small-optimisations.patch
+    - 0001-remove-unneeded-properties.patch
+    - 0001-remove-folder-list-model-dependency.patch
 Provides:
     - meego-handset-people > 0.2.32
     - meego-handset-people-branding-upstream > 0.2.32
@@ -30,8 +28,8 @@
 
 Requires:
     - qt-components
-# for avatar fetching
-    - libqtdeclarative4-folderlistmodel
+    - nemo-qml-plugins-thumbnailer
+    - qmlgallery
  
 Files:
     - "%{_bindir}/qmlcontacts"

++++++ deleted files:
--- 0001-clip-avatars-otherwise-we-ll-suffer-overdraw.patch
--- 0001-correctly-crop-images.patch
--- 0001-fix-hilights-to-overlay-the-image.patch
--- 0001-fix-warping-of-avatar-images.patch
--- 0001-only-set-one-dimension-of-sourceSize-to-avoid-stretc.patch



Reply via email to