I have made the following changes intended for :
  CE:Apps / 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/8283

Thank You,
Robin Burchell

[This message was auto-generated]

---

Request # 8283:

Messages from BOSS:

State: review at 2013-03-03T00:14:13 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 / qmlcontacts -> CE:Apps / qmlcontacts
  
changes files:
--------------
--- qmlcontacts.changes
+++ qmlcontacts.changes
@@ -0,0 +1,7 @@
+* Sun Mar 03 2013 Robin Burchell <[email protected]> - 0.4.2
+- Remove constants.js fork from qmantle2, now that components can cache sheets
+  (from Robin)
+- Simplify anchoring to improve performance (from Robin)
+- Use unified empty state component (from Robin)
+- Import packaging to repository (from Robin)
+

old:
----
  qmlcontacts-0.4.1.tar.bz2

new:
----
  qmlcontacts-0.4.2.tar.bz2

spec files:
-----------
--- qmlcontacts.spec
+++ qmlcontacts.spec
@@ -9,14 +9,14 @@
 # << macros
 
 Summary:    Contacts application for nemo
-Version:    0.4.1
+Version:    0.4.2
 Release:    1
 Group:      Applications/System
 License:    GPLv2
 URL:        https://github.com/nemomobile/qmlcontacts
 Source0:    %{name}-%{version}.tar.bz2
 Source100:  qmlcontacts.yaml
-Requires:   qt-components
+Requires:   qt-components >= 1.4.8
 Requires:   nemo-qml-plugins-thumbnailer
 Requires:   nemo-qml-plugins-contacts
 Requires:   nemo-qml-plugins-folderlistmodel

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

++++++ qmlcontacts-0.4.1.tar.bz2 -> qmlcontacts-0.4.2.tar.bz2
--- rpm
+++ rpm
+(directory)
--- rpm/qmlcontacts.spec
+++ rpm/qmlcontacts.spec
@@ -0,0 +1,92 @@
+# 
+# Do NOT Edit the Auto-generated Part!
+# Generated by: spectacle version 0.25
+# 
+
+Name:       qmlcontacts
+
+# >> macros
+# << macros
+
+Summary:    Contacts application for nemo
+Version:    0.4.1
+Release:    1
+Group:      Applications/System
+License:    GPLv2
+URL:        https://github.com/nemomobile/qmlcontacts
+Source0:    %{name}-%{version}.tar.bz2
+Source100:  qmlcontacts.yaml
+Requires:   qt-components
+Requires:   nemo-qml-plugins-thumbnailer
+Requires:   nemo-qml-plugins-contacts
+Requires:   nemo-qml-plugins-folderlistmodel
+Requires:   qmlgallery
+Requires:   qmlfilemuncher
+Requires:   contactsd
+Requires:   nemo-qml-plugins-messages
+Requires:   qmlmessages >= 0.1.0
+BuildRequires:  pkgconfig(QtCore) >= 4.7.0
+BuildRequires:  pkgconfig(QtDeclarative)
+BuildRequires:  pkgconfig(QtContacts)
+BuildRequires:  pkgconfig(qdeclarative-boostable)
+BuildRequires:  desktop-file-utils
+Provides:   meego-handset-people > 0.2.32
+Provides:   meego-handset-people-branding-upstream > 0.2.32
+Obsoletes:   meego-handset-people <= 0.2.32
+Obsoletes:   meego-handset-people-branding-upstream <= 0.2.32
+
+%description
+Contacts application using Qt Quick for Nemo Mobile.
+
+%package tools
+Summary:    Development tools for qmlcontacts
+License:    BSD
+Group:      Applications/System
+
+%description tools
+Tools to help development of contacts application/framework/etc.
+
+
+%prep
+%setup -q -n %{name}-%{version}
+
+# >> setup
+# << setup
+
+%build
+# >> build pre
+# << build pre
+
+%qmake 
+
+make %{?jobs:-j%jobs}
+
+# >> build post
+# << build post
+
+%install
+rm -rf %{buildroot}
+# >> install pre
+# << install pre
+%qmake_install
+
+# >> install post
+# << install post
+
+desktop-file-install --delete-original       \
+  --dir %{buildroot}%{_datadir}/applications             \
+   %{buildroot}%{_datadir}/applications/*.desktop
+
+%files
+%defattr(-,root,root,-)
+%{_bindir}/qmlcontacts
+%{_datadir}/applications/qmlcontacts.desktop
+%{_libdir}/qt4/imports/org/nemomobile/qmlcontacts/*
+# >> files
+# << files
+
+%files tools
+%defattr(-,root,root,-)
+%{_bindir}/vcardconverter
+# >> files tools
+# << files tools
--- rpm/qmlcontacts.yaml
+++ rpm/qmlcontacts.yaml
@@ -0,0 +1,55 @@
+Name:  qmlcontacts
+Summary: Contacts application for nemo
+Version: 0.4.1
+Release: 1
+Group: Applications/System
+License: GPLv2
+URL: https://github.com/nemomobile/qmlcontacts
+Sources:
+    - "%{name}-%{version}.tar.bz2"
+Provides:
+    - meego-handset-people > 0.2.32
+    - meego-handset-people-branding-upstream > 0.2.32
+Obsoletes:
+    - meego-handset-people <= 0.2.32
+    - meego-handset-people-branding-upstream <= 0.2.32
+Description: Contacts application using Qt Quick for Nemo Mobile.
+Configure: none
+Builder: qmake
+PkgConfigBR:
+    - QtCore >= 4.7.0
+    - QtDeclarative
+    - QtContacts
+    - qdeclarative-boostable
+
+Requires:
+    - qt-components
+    - nemo-qml-plugins-thumbnailer
+    - nemo-qml-plugins-contacts
+    - nemo-qml-plugins-folderlistmodel
+    # qmlgallery code is used for avatar picker
+    - qmlgallery
+    # importing contacts is using code from qmlfilemuncher
+    - qmlfilemuncher
+    # contactsd is required to show IM contacts in the applications
+    - contactsd
+    # required for SMS/IM integration
+    - nemo-qml-plugins-messages
+    # prevent installation of old qmlmessages, which conflicts with 
nemo-qml-plugins-messages
+    - qmlmessages >= 0.1.0
+ 
+Files:
+    - "%{_bindir}/qmlcontacts"
+    - "%{_datadir}/applications/qmlcontacts.desktop"
+    - "%{_libdir}/qt4/imports/org/nemomobile/qmlcontacts/*"
+
+SubPackages:
+    - Name: tools
+      Summary: Development tools for qmlcontacts
+      Description: Tools to help development of contacts 
application/framework/etc.
+      Group: Applications/System
+      License: BSD
+      AutoDepend: false
+      Files:
+          - "%{_bindir}/vcardconverter"
+
--- src/qml/ContactCardPage.qml
+++ src/qml/ContactCardPage.qml
@@ -31,7 +31,6 @@
 
 import QtQuick 1.1
 import com.nokia.meego 1.0
-import "constants.js" as Constants
 import org.nemomobile.qmlcontacts 1.0
 import org.nemomobile.contacts 1.0
 import stage.rubyx.voicecall 1.0
@@ -66,14 +65,7 @@
         }
         ToolIcon {
             iconId: "icon-m-toolbar-edit"
-            onClicked: {
-                Constants.loadSingleton("ContactEditorSheet.qml", 
detailViewPage,
-                    function(editor) {
-                        editor.contact = contact
-                        editor.open();
-                    }
-                );
-            }
+            onClicked: 
pageStack.openSheet(Qt.resolvedUrl("ContactEditorSheet.qml"), { contact: 
contact })
         }
         ToolIcon {
             iconId: contact.favorite ? "icon-m-toolbar-favorite-mark" : 
"icon-m-toolbar-favorite-unmark"
@@ -95,14 +87,7 @@
         MenuLayout {
             MenuItem {
                 text: "Delete";
-                onClicked: {
-                    Constants.loadSingleton("DeleteContactDialog.qml", 
detailViewPage,
-                        function(deleteDialog) {
-                            deleteDialog.contact = contact
-                            deleteDialog.open();
-                        }
-                    );
-                }
+                onClicked: 
pageStack.openDialog(Qt.resolvedUrl("DeleteContactDialog.qml"), { contact: 
contact })
             }
         }
     }
--- src/qml/ContactEditorSheet.qml
+++ src/qml/ContactEditorSheet.qml
@@ -32,7 +32,6 @@
 
 import QtQuick 1.1
 import com.nokia.meego 1.0
-import "constants.js" as Constants
 import org.nemomobile.qmlcontacts 1.0
 import org.nemomobile.contacts 1.0
 
@@ -84,16 +83,11 @@
                 width: height
                 anchors { top: parent.top; topMargin: 
UiConstants.DefaultMargin; left:parent.left; bottom: data_last.bottom }
                 onClicked: {
-                    Constants.loadSingleton("AvatarPickerSheet.qml", 
newContactViewPage,
-                        function(avatarPicker) {
-                            avatarPicker.contact = contact
-                            avatarPicker.avatarPicked.disconnect()
-                            avatarPicker.avatarPicked.connect(function(avatar) 
{
-                                data_avatar.source = avatar
-                            });
-                            avatarPicker.open();
-                        }
-                    );
+                    var avatarPicker = 
pageStack.openSheet(Qt.resolvedUrl("AvatarPickerSheet.qml"), { contact: contact 
})
+                    avatarPicker.avatarPicked.disconnect()
+                    avatarPicker.avatarPicked.connect(function(avatar) {
+                        data_avatar.source = avatar
+                    });
                 }
                 ContactAvatarImage {
                     id: data_avatar
--- src/qml/ContactImportSheet.qml
+++ src/qml/ContactImportSheet.qml
@@ -32,7 +32,6 @@
 
 import QtQuick 1.1
 import com.nokia.meego 1.0
-import "constants.js" as Constants
 import org.nemomobile.contacts 1.0
 import org.nemomobile.folderlistmodel 1.0
 import org.nemomobile.qmlfilemuncher 1.0
--- src/qml/ContactListPage.qml
+++ src/qml/ContactListPage.qml
@@ -31,7 +31,6 @@
 
 import QtQuick 1.1
 import com.nokia.meego 1.2
-import "constants.js" as Constants
 import org.nemomobile.qmlcontacts 1.0
 import org.nemomobile.contacts 1.0
 
@@ -48,8 +47,7 @@
          id: searchbox
          placeHolderText: "Search"
          anchors.top: header.bottom
-         anchors.left: parent.left
-         anchors.right: parent.right
+         width: parent.width
          onSearchTextChanged: {
              app.contactListModel.search(searchbox.searchText);
          }
@@ -64,30 +62,19 @@
     ContactListWidget {
         id: gvp
         anchors.top: searchbox.bottom
-        anchors.left: parent.left
-        anchors.right: parent.right
+        width: parent.width
         anchors.bottom: parent.bottom
         clip: true
         onAddNewContact: {
-            Constants.loadSingleton("ContactEditorSheet.qml", groupedViewPage,
-            function(editor) {
-                    editor.contact = contactComponent.createObject(editor)
-                    editor.open()
-            })
+            var editor = 
pageStack.openSheet(Qt.resolvedUrl("ContactEditorSheet.qml"))
+            editor.contact = contactComponent.createObject(editor)
         }
 
         searching: (searchbox.searchText.length > 0)
         model: app.contactListModel
         delegate: ContactListDelegate {
             id: card
-            onClicked: {
-                Constants.loadSingleton("ContactCardPage.qml", groupedViewPage,
-                    function(card) {
-                        card.contact = model.person
-                        pageStack.push(card)
-                    }
-                );
-            }
+            onClicked: pageStack.push(Qt.resolvedUrl("ContactCardPage.qml"), { 
contact: model.person })
         }
 
     }
@@ -96,12 +83,8 @@
         ToolIcon {
             iconId: "icon-m-common-add"
             onClicked: {
-                Constants.loadSingleton("ContactEditorSheet.qml", 
groupedViewPage,
-                    function(editor) {
-                        editor.contact = contactComponent.createObject(editor)
-                        editor.open();
-                    }
-                );
+                var editor = 
pageStack.openSheet(Qt.resolvedUrl("ContactEditorSheet.qml"));
+                editor.contact = contactComponent.createObject(editor)
             }
         }
 
@@ -116,12 +99,7 @@
         MenuLayout {
             MenuItem {
                 text: "Import contacts"
-                onClicked: {
-                    Constants.loadSingleton("ContactImportSheet.qml", 
groupedViewPage,
-                    function(editor) {
-                        editor.open()
-                    })
-                }
+                onClicked: 
pageStack.openSheet(Qt.resolvedUrl("ContactImportSheet.qml"))
             }
 
             MenuItem {
--- src/qml/api/ContactListDelegate.qml
+++ src/qml/api/ContactListDelegate.qml
@@ -36,17 +36,13 @@
     id: listDelegate
 
     height: UiConstants.ListItemHeightDefault
-    anchors.right: parent.right
-    anchors.left: parent.left
+    width: parent.width
 
     ContactAvatarImage {
         id: photo
         contact: model.person
-        anchors {
-            left: parent.left;
-            leftMargin: UiConstants.DefaultMargin
-            verticalCenter: parent.verticalCenter
-        }
+        x: UiConstants.DefaultMargin
+        anchors.verticalCenter: parent.verticalCenter
     }
 
     Label {
--- src/qml/api/ContactListWidget.qml
+++ src/qml/api/ContactListWidget.qml
@@ -30,7 +30,7 @@
  */
 
 import QtQuick 1.1
-import com.nokia.meego 1.0
+import com.nokia.meego 1.2
 
 ListView {
     id: groupedViewPortrait
@@ -42,27 +42,21 @@
     cacheBuffer: height
     section.property: "sectionBucket"
     section.criteria: ViewSection.FirstCharacter
-    section.delegate: Component {
-        Rectangle {
-            width: parent.width
-            height: childrenRect.height
-            color: "lightsteelblue"
-
-            Text {
-                anchors.right: parent.right
-                anchors.rightMargin: UiConstants.DefaultMargin
-                text: section
-                font.bold: true
-            }
+    section.delegate: Rectangle {
+        width: parent.width
+        height: childrenRect.height
+        color: "lightsteelblue"
+
+        Text {
+            anchors.right: parent.right
+            anchors.rightMargin: UiConstants.DefaultMargin
+            text: section
+            font.bold: true
         }
     }
 
-    Label {
-        // TODO: it would be nice if this was only instantiated
-        // when needed, and destroyed after
-        id: emptyListView
-        visible: parent.count == 0
-        anchors.centerIn: parent
+    ViewPlaceholder {
+        enabled: parent.count == 0
         text: ((searching) ? qsTr("Contact not found.") : qsTr("You haven't 
added any contacts yet."));
 
         Button {
--- src/qml/constants.js
+++ src/qml/constants.js
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2011-2012 Robin Burchell <[email protected]>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *   * Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *   * Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in
- *     the documentation and/or other materials provided with the
- *     distribution.
- *   * Neither the name of Nemo Mobile nor the names of its contributors
- *     may be used to endorse or promote products derived from this
- *     software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- */
-
-var landscape = 0
-var portrait = 90
-var reverseLandscape = 180
-var reversePortrait = 270
-
-var homescreenWidgetRowsPortrait = 4
-var homescreenWidgetColumnsPortrait = 3
-var homescreenWidgetRowsLandscape = 3
-var homescreenWidgetColumnsLandscape = 4
-
-// 1024x600
-var screen = { width: 540, height: 960 };
-//var screen = { width: 400, height: 600 };
-
-var componentCache = {}
-var singletonObjects = {}
-
-function loadSingleton(fileName, parent, callback, data) {
-    if (singletonObjects[fileName]) {
-        callback(singletonObjects[fileName])
-        return
-    }
-
-    loadComponent(fileName, function(loadedComponent) {
-            if (data)
-                singletonObjects[fileName] = 
loadedComponent.createObject(parent, data)
-            else
-                singletonObjects[fileName] = 
loadedComponent.createObject(parent)
-            callback(singletonObjects[fileName])
-    });
-}
-
-function loadComponent(fileName, callback) {
-    if (componentCache[fileName]) {
-        callback(componentCache[fileName])
-        return
-    }
-
-    // TODO: can Qt.createComponent work asynchronously (even for local files)
-    // like Loader?
-    var loadingComponent = Qt.createComponent(fileName);
-
-    if (!loadingComponent) {
-        console.log("FAILED LOADING COMPONENT: " + fileName + " - " + 
loadingComponent.errorString())
-        return
-    }
-
-    if (loadingComponent.status == Component.Ready) {
-        componentCache[fileName] = loadingComponent
-        callback(loadingComponent)
-    } else if (loadingComponent.status == Component.Error) {
-        console.log("FAILED LOADING COMPONENT: " + fileName + " - " + 
loadingComponent.errorString())
-    } else {
-        loadingComponent.statusChanged.connect(function() {
-            if (loadingComponent.status == Component.Ready) {
-                componentCache[fileName] = loadingComponent
-                callback(loadingComponent)
-            } else if (loadingComponent.status == Component.Error) {
-                console.log("FAILED LOADING COMPONENT: " + fileName + " - " + 
loadingComponent.errorString())
-            }
-        })
-    }
-}
-
--- src/qml/main.qml
+++ src/qml/main.qml
@@ -51,11 +51,7 @@
 
     property int animationDuration: 250
 
-    initialPage: ContactListPage {}
-
-    ToolBar {
-        anchors.bottom: parent.bottom
-    }
+    initialPage: Component { ContactListPage {} }
 
     property PeopleModel contactListModel: PeopleModel {
 
--- src/res.qrc
+++ src/res.qrc
@@ -9,7 +9,6 @@
         <file>qml/ContactListPage.qml</file>
         <file>qml/DeleteContactDialog.qml</file>
         <file>qml/main.qml</file>
-        <file>qml/constants.js</file>
         <file>qml/SearchBox.qml</file>
     </qresource>
 </RCC>

++++++ qmlcontacts.yaml
--- qmlcontacts.yaml
+++ qmlcontacts.yaml
@@ -1,6 +1,6 @@
 Name:  qmlcontacts
 Summary: Contacts application for nemo
-Version: 0.4.1
+Version: 0.4.2
 Release: 1
 Group: Applications/System
 License: GPLv2
@@ -23,7 +23,7 @@
     - qdeclarative-boostable
 
 Requires:
-    - qt-components
+    - qt-components >= 1.4.8
     - nemo-qml-plugins-thumbnailer
     - nemo-qml-plugins-contacts
     - nemo-qml-plugins-folderlistmodel



Reply via email to