Merge lp:~renatofilho/address-book-app/contact-share into lp:~phablet-team/address-book-app/staging

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Merged at revision: 185
Proposed branch: lp:~renatofilho/address-book-app/contact-share
Merge into: lp:~phablet-team/address-book-app/staging
Diff against target: 608 lines (+137/-247)
14 files modified
CMakeLists.txt (+0/-1)
click/address-book-content.json (+3/-0)
debian/control (+0/-1)
src/app/CMakeLists.txt (+0/-7)
src/app/addressbookapp.cpp (+0/-10)
src/app/addressbookapp.h (+0/-3)
src/app/contentcommunicator.cpp (+0/-140)
src/app/contentcommunicator.h (+0/-61)
src/imports/CMakeLists.txt (+1/-0)
src/imports/ContactList/ContactListPage.qml (+43/-18)
src/imports/ContactShare/CMakeLists.txt (+10/-0)
src/imports/ContactShare/ContactSharePage.qml (+62/-0)
src/imports/ContactView/ContactView.qml (+11/-0)
src/imports/MainWindow.qml (+7/-6)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/contact-share
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Michael Sheldon (community) Approve
Review via email: mp+222879@code.launchpad.net

This proposal supersedes a proposal from 2014-06-02.

Commit message

Implemented contact share.
Replaced ContentHub API with QML API.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:234
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/80/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/610
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/559
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/80
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/80
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/80/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/80
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1051
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1176
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1176/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7990
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/500
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/698
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/698/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/80/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:235
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/81/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/613
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/564
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/81
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/81
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/81/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/81
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1053
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1182
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1182/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7996
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/503
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/703
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/703/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/81/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Sheldon (michael-sheldon) wrote : Posted in a previous version of this proposal

Couple of issue, when sharing I'm now getting:

file:///usr/share/address-book-app/imports/ContactShare/ContactSharePage.qml:51: ReferenceError: contactExporter is not defined

And when either exporting to another application or sharing, the exported .vcf file contains *all* contacts, not just the selected/shared ones.

Also as a minor thing the import of Ubuntu.Components.Popups 0.1 in ContactView.qml doesn't seem to be needed any more

review: Needs Fixing
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote : Posted in a previous version of this proposal

Are there any related MPs required for this MP to build/function as expected? YES
lp:~renatofilho/address-book-app/new-designer-contact-list

Is your branch in sync with latest trunk: YES

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator? YES

Did you successfully run all tests found in your component's Test Plan on device or emulator? ?YES

If you changed the UI, was the change specified/approved by design? NO UI CHANGE

If you changed the packaging (debian), did you subscribe a core-dev to this MP? NO PACKAGE CHANGE

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote : Posted in a previous version of this proposal

Are there any related MPs required for this MP to build/function as expected? YES
lp:~renatofilho/address-book-app/new-designer-contact-list

Is your branch in sync with latest trunk: YES

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator? YES

Did you successfully run all tests found in your component's Test Plan on device or emulator? ?YES

If you changed the UI, was the change specified/approved by design? NO UI CHANGE

If you changed the packaging (debian), did you subscribe a core-dev to this MP? YES

Revision history for this message
Michael Sheldon (michael-sheldon) wrote : Posted in a previous version of this proposal

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?

 * Yes

Did CI run pass? If not, please explain why.

 * Failed due to unrelated issues (old SDK package in Jenkins)

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?

 * Yes

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:236
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/82/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/626
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/574
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/82
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/82
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/82/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/82
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1064
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1205
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1205/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8020
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/510
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/713
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/713/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/82/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:236
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/84/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/648
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/593
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/84
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/84
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/84/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/84
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1082
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1240
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1240/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8050
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/525
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/732
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/732/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/84/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:184
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/124/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/809
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/749
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/124
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/124
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/124/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/124
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1228
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1498
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1498/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8330
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/666
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/888
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/888/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/124/rebuild

review: Approve (continuous-integration)
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?

 * Yes

Did CI run pass? If not, please explain why.

 * Yes

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?

 * Yes

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:185
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/126/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/818
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/758
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/126
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/126
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/126/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/126
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1237
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1510
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1510/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8344
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/674
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/897
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/897/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/126/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-autolanding/12/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/823
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/762
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-autolanding/12
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-autolanding/12
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-autolanding/12/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-autolanding/12
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1239
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1517
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1517/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8349
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/678
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/901
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/901/artifact/work/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-06-05 16:35:45 +0000
+++ CMakeLists.txt 2014-06-12 12:40:31 +0000
@@ -17,7 +17,6 @@
17find_package(Qt5Quick)17find_package(Qt5Quick)
18find_package(Qt5DBus)18find_package(Qt5DBus)
19find_package(PkgConfig REQUIRED)19find_package(PkgConfig REQUIRED)
20pkg_check_modules(CONTENTHUB REQUIRED libcontent-hub)
2120
22set(ADDRESS_BOOK_APP_DIR ${CMAKE_INSTALL_DATADIR}/address-book-app)21set(ADDRESS_BOOK_APP_DIR ${CMAKE_INSTALL_DATADIR}/address-book-app)
23set(ADDRESS_BOOK_APP_FULL_DIR ${CMAKE_INSTALL_FULL_DATADIR}/address-book-app)22set(ADDRESS_BOOK_APP_FULL_DIR ${CMAKE_INSTALL_FULL_DATADIR}/address-book-app)
2423
=== modified file 'click/address-book-content.json'
--- click/address-book-content.json 2014-03-12 01:34:34 +0000
+++ click/address-book-content.json 2014-06-12 12:40:31 +0000
@@ -1,4 +1,7 @@
1{1{
2 "destination": [
3 "contacts"
4 ],
2 "source": [5 "source": [
3 "contacts"6 "contacts"
4 ]7 ]
58
=== modified file 'debian/control'
--- debian/control 2014-06-06 21:02:16 +0000
+++ debian/control 2014-06-12 12:40:31 +0000
@@ -5,7 +5,6 @@
5Build-Depends: cmake,5Build-Depends: cmake,
6 debhelper (>= 9),6 debhelper (>= 9),
7 dh-translations,7 dh-translations,
8 libcontent-hub-dev,
9 libgl1-mesa-dev | libgl-dev,8 libgl1-mesa-dev | libgl-dev,
10 libgles2-mesa-dev,9 libgles2-mesa-dev,
11 python3,10 python3,
1211
=== modified file 'src/app/CMakeLists.txt'
--- src/app/CMakeLists.txt 2014-05-28 20:25:19 +0000
+++ src/app/CMakeLists.txt 2014-06-12 12:40:31 +0000
@@ -4,14 +4,11 @@
44
5include_directories(5include_directories(
6 ${CMAKE_BINARY_DIR}6 ${CMAKE_BINARY_DIR}
7 ${CONTENTHUB_INCLUDE_DIRS}
8)7)
98
10set(ADDRESS_BOOK_APP_SRCS9set(ADDRESS_BOOK_APP_SRCS
11 addressbookapp.h10 addressbookapp.h
12 addressbookapp.cpp11 addressbookapp.cpp
13 contentcommunicator.h
14 contentcommunicator.cpp
15 imagescalethread.h12 imagescalethread.h
16 imagescalethread.cpp13 imagescalethread.cpp
17 main.cpp14 main.cpp
@@ -23,10 +20,6 @@
2320
24qt5_use_modules(${ADDRESS_BOOK_APP_BIN} Gui Core Qml Quick DBus)21qt5_use_modules(${ADDRESS_BOOK_APP_BIN} Gui Core Qml Quick DBus)
2522
26target_link_libraries(${ADDRESS_BOOK_APP_BIN}
27 ${CONTENTHUB_LIBRARIES}
28)
29
30install(TARGETS ${ADDRESS_BOOK_APP_BIN}23install(TARGETS ${ADDRESS_BOOK_APP_BIN}
31 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}24 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
32)25)
3326
=== modified file 'src/app/addressbookapp.cpp'
--- src/app/addressbookapp.cpp 2014-06-05 19:22:08 +0000
+++ src/app/addressbookapp.cpp 2014-06-12 12:40:31 +0000
@@ -17,7 +17,6 @@
17#include "config.h"17#include "config.h"
18#include "addressbookapp.h"18#include "addressbookapp.h"
19#include "imagescalethread.h"19#include "imagescalethread.h"
20#include "contentcommunicator.h"
2120
22#include <QDir>21#include <QDir>
23#include <QUrl>22#include <QUrl>
@@ -94,7 +93,6 @@
94AddressBookApp::AddressBookApp(int &argc, char **argv)93AddressBookApp::AddressBookApp(int &argc, char **argv)
95 : QGuiApplication(argc, argv),94 : QGuiApplication(argc, argv),
96 m_view(0),95 m_view(0),
97 m_contentComm(0),
98 m_syncMonitor(0),96 m_syncMonitor(0),
99 m_pickingMode(false),97 m_pickingMode(false),
100 m_testMode(false),98 m_testMode(false),
@@ -151,10 +149,7 @@
151 qCritical("Library qttestability load failed!");149 qCritical("Library qttestability load failed!");
152 }150 }
153 m_testMode = true;151 m_testMode = true;
154 } else {
155 m_contentComm = new ContentCommunicator(this);
156 }152 }
157
158 /* Ubuntu APP Manager gathers info on the list of running applications from the .desktop153 /* Ubuntu APP Manager gathers info on the list of running applications from the .desktop
159 file specified on the command line with the desktop_file_hint switch, and will also pass a stage hint154 file specified on the command line with the desktop_file_hint switch, and will also pass a stage hint
160 So app will be launched like this:155 So app will be launched like this:
@@ -186,7 +181,6 @@
186 m_view->setTitle("AddressBook");181 m_view->setTitle("AddressBook");
187 m_view->engine()->addImportPath(QCoreApplication::applicationDirPath() + "/" + importPath(""));182 m_view->engine()->addImportPath(QCoreApplication::applicationDirPath() + "/" + importPath(""));
188 m_view->rootContext()->setContextProperty("QTCONTACTS_MANAGER_OVERRIDE", defaultManager);183 m_view->rootContext()->setContextProperty("QTCONTACTS_MANAGER_OVERRIDE", defaultManager);
189 m_view->rootContext()->setContextProperty("contactContentHub", m_contentComm);
190 m_view->rootContext()->setContextProperty("application", this);184 m_view->rootContext()->setContextProperty("application", this);
191 m_view->rootContext()->setContextProperty("contactKey", contactKey);185 m_view->rootContext()->setContextProperty("contactKey", contactKey);
192 m_view->rootContext()->setContextProperty("TEST_DATA", testData);186 m_view->rootContext()->setContextProperty("TEST_DATA", testData);
@@ -220,10 +214,6 @@
220 if (m_view) {214 if (m_view) {
221 delete m_view;215 delete m_view;
222 }216 }
223
224 if (m_contentComm) {
225 delete m_contentComm;
226 }
227}217}
228218
229void AddressBookApp::onViewStatusChanged(QQuickView::Status status)219void AddressBookApp::onViewStatusChanged(QQuickView::Status status)
230220
=== modified file 'src/app/addressbookapp.h'
--- src/app/addressbookapp.h 2014-05-09 20:00:09 +0000
+++ src/app/addressbookapp.h 2014-06-12 12:40:31 +0000
@@ -22,8 +22,6 @@
22#include <QtGui/QGuiApplication>22#include <QtGui/QGuiApplication>
23#include <QtQuick/QQuickView>23#include <QtQuick/QQuickView>
2424
25class ContentCommunicator;
26
27class AddressBookApp : public QGuiApplication25class AddressBookApp : public QGuiApplication
28{26{
29 Q_OBJECT27 Q_OBJECT
@@ -62,7 +60,6 @@
6260
63private:61private:
64 QQuickView *m_view;62 QQuickView *m_view;
65 ContentCommunicator *m_contentComm;
66 QDBusInterface *m_syncMonitor;63 QDBusInterface *m_syncMonitor;
67 QString m_initialArg;64 QString m_initialArg;
68 bool m_viewReady;65 bool m_viewReady;
6966
=== removed file 'src/app/contentcommunicator.cpp'
--- src/app/contentcommunicator.cpp 2014-03-12 00:58:11 +0000
+++ src/app/contentcommunicator.cpp 1970-01-01 00:00:00 +0000
@@ -1,140 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18#include <contentcommunicator.h>
19
20#include <QDebug>
21#include <QTemporaryFile>
22#include <QDir>
23
24#include <com/ubuntu/content/hub.h>
25#include <com/ubuntu/content/item.h>
26#include <com/ubuntu/content/transfer.h>
27
28using namespace com::ubuntu::content;
29
30/*!
31 * \brief ContentCommunicator::ContentCommunicator
32 * \param parent
33 */
34ContentCommunicator::ContentCommunicator(QObject *parent)
35 : ImportExportHandler(parent),
36 m_transfer(0)
37{
38 Hub *hub = Hub::Client::instance();
39 if (hub) {
40 hub->register_import_export_handler(this);
41 } else {
42 qWarning() << "Fail to get Hub client instance";
43 }
44}
45
46/*!
47 * \brief \reimp
48 */
49void ContentCommunicator::handle_import(content::Transfer *)
50{
51 qDebug() << Q_FUNC_INFO << "address book app does not import content";
52}
53
54/*!
55 * \brief \reimp
56 */
57void ContentCommunicator::handle_export(content::Transfer *transfer)
58{
59 if (m_transfer != 0) {
60 qWarning() << "address book app does only one content export at a time";
61 transfer->abort();
62 m_transfer = 0;
63 return;
64 }
65
66 if (transfer) {
67 m_transfer = transfer;
68 connect(m_transfer, SIGNAL(selectionTypeChanged()), SIGNAL(multipleItemsChanged()));
69 } else {
70 qWarning() << "Transfer pointer is null in handle_export";
71 }
72 Q_EMIT contactRequested();
73 Q_EMIT activeChanged();
74 Q_EMIT multipleItemsChanged();
75}
76
77/*!
78 * \brief \reimp
79 */
80void ContentCommunicator::handle_share(content::Transfer *)
81{
82 qDebug() << Q_FUNC_INFO << "address book app does not share content";
83}
84
85/*!
86 * \brief ContentCommunicator::cancelTransfer aborts the current transfer
87 */
88void ContentCommunicator::cancelTransfer()
89{
90 if (!m_transfer) {
91 qWarning() << "No ongoing transfer to cancel";
92 return;
93 }
94
95 m_transfer->abort();
96 m_transfer = 0;
97 Q_EMIT activeChanged();
98}
99
100/*!
101 * \brief ContentCommunicator::returnContacts returns the given contacts
102 * via content hub to the requester
103 * \param urls
104 */
105void ContentCommunicator::returnContacts(const QUrl &contactsFile)
106{
107 if (!m_transfer) {
108 qWarning() << "No ongoing transfer to return a contact";
109 return;
110 }
111
112 QVector<Item> items;
113 items << contactsFile;
114 m_transfer->charge(items);
115 m_transfer = 0;
116 Q_EMIT activeChanged();
117}
118
119bool ContentCommunicator::isActive() const
120{
121 return (m_transfer != 0);
122}
123
124bool ContentCommunicator::isMultipleItems() const
125{
126 return (m_transfer && m_transfer->selectionType() == Transfer::multiple);
127}
128
129QUrl ContentCommunicator::createTemporaryFile() const
130{
131 QTemporaryFile tmp(QDir::tempPath() + "/vcard_XXXXXX.vcf");
132 tmp.setAutoRemove(false);
133 if (!tmp.open()) {
134 qWarning() << "Fail to create temporary file for vcard.";
135 return QUrl();
136 }
137 QString tmpFileName = tmp.fileName();
138 tmp.close();
139 return QUrl::fromLocalFile(tmpFileName);
140}
1410
=== removed file 'src/app/contentcommunicator.h'
--- src/app/contentcommunicator.h 2014-03-12 00:58:11 +0000
+++ src/app/contentcommunicator.h 1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18#ifndef CONTENTCOMMUNICATOR_H
19#define CONTENTCOMMUNICATOR_H
20
21#include <com/ubuntu/content/import_export_handler.h>
22#include <com/ubuntu/content/transfer.h>
23
24#include <QStringList>
25
26using namespace com::ubuntu;
27
28/*!
29 * Class to handle the communication with the content manager
30 */
31class ContentCommunicator : public content::ImportExportHandler
32{
33 Q_OBJECT
34 Q_PROPERTY(bool active READ isActive NOTIFY activeChanged)
35 Q_PROPERTY(bool multipleItems READ isMultipleItems NOTIFY multipleItemsChanged)
36
37public:
38 ContentCommunicator(QObject *parent = 0);
39
40 virtual void handle_import(content::Transfer*);
41 virtual void handle_export(content::Transfer *transfer);
42 virtual void handle_share(content::Transfer*);
43
44 bool isActive() const;
45 bool isMultipleItems() const;
46
47public Q_SLOTS:
48 void cancelTransfer();
49 void returnContacts(const QUrl &contactsFile);
50 QUrl createTemporaryFile() const;
51
52Q_SIGNALS:
53 void contactRequested();
54 void activeChanged();
55 void multipleItemsChanged();
56
57private:
58 content::Transfer *m_transfer;
59};
60
61#endif // CONTENTCOMMUNICATOR_H
620
=== modified file 'src/imports/CMakeLists.txt'
--- src/imports/CMakeLists.txt 2013-11-12 15:52:18 +0000
+++ src/imports/CMakeLists.txt 2014-06-12 12:40:31 +0000
@@ -13,4 +13,5 @@
13add_subdirectory(ContactList)13add_subdirectory(ContactList)
14add_subdirectory(ContactView)14add_subdirectory(ContactView)
15add_subdirectory(ContactEdit)15add_subdirectory(ContactEdit)
16add_subdirectory(ContactShare)
16add_subdirectory(Ubuntu)17add_subdirectory(Ubuntu)
1718
=== modified file 'src/imports/ContactList/ContactListPage.qml'
--- src/imports/ContactList/ContactListPage.qml 2014-06-11 22:05:50 +0000
+++ src/imports/ContactList/ContactListPage.qml 2014-06-12 12:40:31 +0000
@@ -21,6 +21,7 @@
21import Ubuntu.Components.ListItems 0.1 as ListItem21import Ubuntu.Components.ListItems 0.1 as ListItem
22import Ubuntu.Contacts 0.1 as ContactsUI22import Ubuntu.Contacts 0.1 as ContactsUI
23import Ubuntu.Components.Popups 0.1 as Popups23import Ubuntu.Components.Popups 0.1 as Popups
24import Ubuntu.Content 0.1 as ContentHub
24import "../ContactEdit"25import "../ContactEdit"
25import "../Common"26import "../Common"
2627
@@ -29,6 +30,7 @@
29 objectName: "contactListPage"30 objectName: "contactListPage"
3031
31 property bool pickMode: false32 property bool pickMode: false
33 property alias contentHubTransfer: contactExporter.activeTransfer
32 property bool pickMultipleContacts: false34 property bool pickMultipleContacts: false
33 property var onlineAccountsMessageDialog: null35 property var onlineAccountsMessageDialog: null
34 property QtObject contactIndex: null36 property QtObject contactIndex: null
@@ -126,7 +128,7 @@
126 detailToPick: ContactDetail.PhoneNumber128 detailToPick: ContactDetail.PhoneNumber
127 multiSelectionEnabled: true129 multiSelectionEnabled: true
128 multipleSelection: !pickMode ||130 multipleSelection: !pickMode ||
129 ((contactContentHub && contactContentHub.multipleItems) || mainPage.pickMultipleContacts)131 mainPage.pickMultipleContacts || (contactExporter.active && contactExporter.isMultiple)
130132
131 anchors.fill: parent133 anchors.fill: parent
132134
@@ -181,9 +183,7 @@
181 for (var i=0; i < items.count; i++) {183 for (var i=0; i < items.count; i++) {
182 contacts.push(items.get(i).model.contact)184 contacts.push(items.get(i).model.contact)
183 }185 }
184 exporter.contactModel = contactList.listModel186 contactExporter.exportContacts(contacts)
185 exporter.contacts = contacts
186 exporter.start()
187 } else {187 } else {
188 var contacts = []188 var contacts = []
189189
@@ -198,8 +198,8 @@
198198
199 onSelectionCanceled: {199 onSelectionCanceled: {
200 if (pickMode) {200 if (pickMode) {
201 if (contactContentHub) {201 if (contentHubTransfer) {
202 contactContentHub.cancelTransfer()202 contentHubTransfer.state = ContentTransfer.Aborted
203 }203 }
204 pageStack.pop()204 pageStack.pop()
205 application.returnVcard("")205 application.returnVcard("")
@@ -430,20 +430,37 @@
430 }430 }
431 }431 }
432432
433 ContactExporter {433
434 id: exporter434 QtObject {
435 contactModel: contactList.listModel ? contactList.listModel : null435 id: contactExporter
436 outputFile: contactContentHub ? contactContentHub.createTemporaryFile() : "/tmp/vcard_address_book_app.vcf"436
437 onCompleted: {437 property var activeTransfer: null
438 if (contactContentHub) {438 readonly property bool active: activeTransfer && (activeTransfer.state === ContentHub.ContentTransfer.InProgress && activeTransfer.direction === ContentHub.ContentTransfer.Import)
439 if (error == ContactModel.ExportNoError) {439 readonly property bool isMultiple: activeTransfer && (activeTransfer.selectionType === ContentHub.ContentTransfer.Multiple)
440 contactContentHub.returnContacts(exporter.outputFile)440
441 } else {441 function exportContacts(contacts)
442 contactContentHub.cancelTransfer()442 {
443 }443 if (activeTransfer) {
444 var exportUrl = "file:///tmp/address_book_app_export.vcf"
445 mainPage.contactModel.exportCompleted.connect(contactExporter.onExportCompleted)
446 mainPage.contactModel.exportContacts(exportUrl, [], contacts)
447 } else {
448 console.error("Export requested with noo active transfer")
449 }
450 }
451
452 function onExportCompleted(error, url)
453 {
454 mainPage.contactModel.exportCompleted.disconnect(contactExporter.onExportCompleted)
455 if (error === ContactModel.ExportNoError) {
456 var obj = Qt.createQmlObject("import Ubuntu.Content 0.1; ContentItem { url: '" + url + "' }", contactExporter)
457 activeTransfer.items = [obj]
458 activeTransfer.state = ContentHub.ContentTransfer.Charged
459 } else {
460 console.error("Fail to export contacts:" + error)
444 }461 }
445 pageStack.pop()462 pageStack.pop()
446 application.returnVcard(exporter.outputFile)463 application.returnVcard(url)
447 }464 }
448 }465 }
449466
@@ -459,5 +476,13 @@
459 if (TEST_DATA != "") {476 if (TEST_DATA != "") {
460 contactList.listModel.importContacts("file://" + TEST_DATA)477 contactList.listModel.importContacts("file://" + TEST_DATA)
461 }478 }
479
480 if (!pickMode) {
481 mainPage.setBottomEdgePage(Qt.resolvedUrl("../ContactEdit/ContactEditor.qml"),
482 {model: contactList.listModel,
483 contact: mainPage.createEmptyContact(""),
484 active: false,
485 enabled: false})
486 }
462 }487 }
463}488}
464489
=== added directory 'src/imports/ContactShare'
=== added file 'src/imports/ContactShare/CMakeLists.txt'
--- src/imports/ContactShare/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/imports/ContactShare/CMakeLists.txt 2014-06-12 12:40:31 +0000
@@ -0,0 +1,10 @@
1set(CONTACT_SHARE_QMLS
2 ContactSharePage.qml
3)
4
5install(FILES ${CONTACT_SHARE_QMLS}
6 DESTINATION ${ADDRESS_BOOK_APP_DIR}/imports/ContactShare
7)
8
9# make the files visible on qtcreator
10add_custom_target(contact_share_QmlFiles ALL SOURCES ${CONTACT_SHARE_QMLS})
011
=== added file 'src/imports/ContactShare/ContactSharePage.qml'
--- src/imports/ContactShare/ContactSharePage.qml 1970-01-01 00:00:00 +0000
+++ src/imports/ContactShare/ContactSharePage.qml 2014-06-12 12:40:31 +0000
@@ -0,0 +1,62 @@
1/*
2 * Copyright (C) 2012-2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.2
18import QtContacts 5.0
19import Ubuntu.Components 0.1
20import Ubuntu.Content 0.1 as ContentHub
21
22Page {
23 id: picker
24
25 property var contactModel
26 property var contact
27 property var curTransfer
28
29 ContentHub.ContentPeerPicker {
30 visible: true
31 anchors.fill: parent
32 contentType: ContentHub.ContentType.Contacts
33 handler: ContentHub.ContentHandler.Share
34
35 onPeerSelected: {
36 picker.curTransfer = peer.request();
37 if (picker.curTransfer.state === ContentHub.ContentTransfer.InProgress) {
38 var vCardUrl = "file:///tmp/vcard_" + encodeURIComponent(contact.contactId) + ".vcf"
39 picker.contactModel.exportContacts(vCardUrl, [], [picker.contact])
40 }
41 }
42
43 onCancelPressed: pageStack.pop()
44 }
45
46 Connections {
47 target: picker.contactModel
48 onExportCompleted: {
49 if (picker.curTransfer && (picker.curTransfer.state === ContentHub.ContentTransfer.InProgress)) {
50 if (error === ContactModel.ExportNoError) {
51 var obj = Qt.createQmlObject("import Ubuntu.Content 0.1; ContentItem { url: '" + url + "' }", picker)
52 picker.curTransfer.items = [ obj ]
53 picker.curTransfer.state = ContentHub.ContentTransfer.Charged
54 } else {
55 picker.curTransfer = ContentHub.ContentTransfer.Aborted
56 console.error("Fail to export contact:" + error)
57 }
58 }
59 pageStack.pop()
60 }
61 }
62}
063
=== modified file 'src/imports/ContactView/ContactView.qml'
--- src/imports/ContactView/ContactView.qml 2014-06-10 12:27:54 +0000
+++ src/imports/ContactView/ContactView.qml 2014-06-12 12:40:31 +0000
@@ -202,6 +202,17 @@
202 tools: ToolbarItems {202 tools: ToolbarItems {
203 ToolbarButton {203 ToolbarButton {
204 action: Action {204 action: Action {
205 objectName: "share"
206 text: i18n.tr("Share")
207 iconName: "share"
208 onTriggered: {
209 pageStack.push(Qt.resolvedUrl("../ContactShare/ContactSharePage.qml"),
210 { contactModel: root.model, contact: root.contact})
211 }
212 }
213 }
214 ToolbarButton {
215 action: Action {
205 objectName: "edit"216 objectName: "edit"
206 text: i18n.tr("Edit")217 text: i18n.tr("Edit")
207 iconSource: "artwork:/edit.png"218 iconSource: "artwork:/edit.png"
208219
=== modified file 'src/imports/MainWindow.qml'
--- src/imports/MainWindow.qml 2014-06-05 19:20:12 +0000
+++ src/imports/MainWindow.qml 2014-06-12 12:40:31 +0000
@@ -18,6 +18,7 @@
18import QtContacts 5.018import QtContacts 5.0
19import Ubuntu.Components 0.119import Ubuntu.Components 0.1
20import Ubuntu.Components.Popups 0.1 as Popups20import Ubuntu.Components.Popups 0.1 as Popups
21import Ubuntu.Content 0.1 as ContentHub
2122
22MainView {23MainView {
23 id: mainWindow24 id: mainWindow
@@ -110,12 +111,12 @@
110 }111 }
111112
112 Connections {113 Connections {
113 target: contactContentHub114 target: ContentHub.ContentHub
114 onActiveChanged: {115 onExportRequested: {
115 if (contactContentHub && contactContentHub.active) {116 // enter in pick mode
116 // enter in pick mode117 mainStack.push(Qt.createComponent("ContactList/ContactListPage.qml"),
117 mainStack.push(Qt.createComponent("ContactList/ContactListPage.qml"), {pickMode: true})118 {pickMode: true,
118 }119 contentHubTransfer: transfer})
119 }120 }
120 }121 }
121}122}

Subscribers

People subscribed via source and target branches