Merge lp:~pkunal-parmar/ubuntu-calendar-app/UrlInvocation into lp:ubuntu-calendar-app

Proposed by Kunal Parmar on 2015-04-05
Status: Merged
Approved by: Kunal Parmar on 2015-07-23
Approved revision: 629
Merged at revision: 697
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/UrlInvocation
Merge into: lp:ubuntu-calendar-app
Diff against target: 62 lines (+33/-8)
1 file modified
calendar.qml (+33/-8)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/UrlInvocation
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-07-18
Bartosz Kosiorek (community) 2015-04-05 Approve on 2015-07-10
Mihir Soni 2015-04-16 Pending
Review via email: mp+255234@code.launchpad.net

Commit message

resolves 1426519

handing the invocation from URL

Description of the change

resolves 1426519

handing the invocation from URL

To post a comment you must log in.
Andrea Bernabei (faenil) wrote :

code comment added

Andrea Bernabei (faenil) :
Kunal Parmar (pkunal-parmar) wrote :

Hi Andrea, Your comment was very helpful.

Now I modified the code, can you have a another look.

Thanks

Andrea Bernabei (faenil) wrote :

minor comments from me, looks good otherwise, thanks :)

Bartosz Kosiorek (gang65) wrote :

It is working perfectly for me.

review: Approve
Kunal Parmar (pkunal-parmar) wrote :

Thanks Gang65,

Seems like some issue with AP, I will have a look and try to fix it.

628. By Kunal Parmar on 2015-07-16

merge from trunk

Kunal Parmar (pkunal-parmar) wrote :

AP fails does not seem like regression from this MR, but not sure why testcases are failing ramdomly

629. By Kunal Parmar on 2015-07-16

test

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'calendar.qml'
2--- calendar.qml 2015-01-22 20:07:30 +0000
3+++ calendar.qml 2015-07-18 01:29:50 +0000
4@@ -95,6 +95,21 @@
5 footerColor: "#ECECEC"
6 anchorToKeyboard: true
7
8+ Connections {
9+ target: UriHandler
10+ onOpened: {
11+ var uri = uris[0]
12+ if(uri !== undefined && url != "") {
13+ var commands = uri.split("://")[1].split("=");
14+ if(commands[0].toLowerCase() === "eventid") {
15+ // calendar://eventid=??
16+ if( eventModel ) {
17+ eventModel.showEventFromId(commands[1]);
18+ }
19+ }
20+ }
21+ }
22+ }
23
24 PageStack {
25 id: pageStack
26@@ -168,18 +183,28 @@
27 collectionFilter.ids = collectionIds;
28 }
29
30+ function showEventFromId(eventId) {
31+ if(eventId === undefined || eventId === "") {
32+ return;
33+ }
34+
35+ var requestId = "";
36+ var callbackFunc = function(id,fetchedItems) {
37+ if( requestId === id && fetchedItems.length > 0 ) {
38+ pageStack.push(Qt.resolvedUrl("EventDetails.qml"),{"event":fetchedItems[0],"model": eventModel});
39+ }
40+ eventModel.onItemsFetched.disconnect( callbackFunc );
41+ }
42+
43+ eventModel.onItemsFetched.connect( callbackFunc );
44+ requestId = eventModel.fetchItems(eventId);
45+ }
46+
47 Component.onCompleted: {
48 delayedApplyFilter();
49
50 if (args.values.eventid) {
51- var requestId = "";
52- eventModel.onItemsFetched.connect( function(id,fetchedItems) {
53- if( requestId === id && fetchedItems.length > 0 ) {
54- var event = fetchedItems[0];
55- pageStack.push(Qt.resolvedUrl("EventDetails.qml"),{"event":event,"model": eventModel});
56- }
57- });
58- requestId = eventModel.fetchItems([args.values.eventid]);
59+ showEventFromId(args.values.eventid);
60 }
61 }
62 }

Subscribers

People subscribed via source and target branches

to status/vote changes: