ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #08898
[Merge] lp:~renatofilho/ubuntu-calendar-app/fix-1439049 into lp:ubuntu-calendar-app
Renato Araujo Oliveira Filho has proposed merging lp:~renatofilho/ubuntu-calendar-app/fix-1439049 into lp:ubuntu-calendar-app.
Commit message:
Accept 'calendar://*' url as argument on app startup.
This is necessary because url-dispatcher calls the app with argument if the app is not opened yet.
Requested reviews:
Ubuntu Calendar Developers (ubuntu-calendar-dev)
Related bugs:
Bug #1439049 in Ubuntu Calendar App: "Indicator entry doesn’t open event details"
https://bugs.launchpad.net/ubuntu-calendar-app/+bug/1439049
For more details, see:
https://code.launchpad.net/~renatofilho/ubuntu-calendar-app/fix-1439049/+merge/289198
--
Your team Ubuntu Calendar Developers is requested to review the proposed merge of lp:~renatofilho/ubuntu-calendar-app/fix-1439049 into lp:ubuntu-calendar-app.
=== modified file 'calendar.qml'
--- calendar.qml 2016-03-14 20:38:05 +0000
+++ calendar.qml 2016-03-16 14:09:44 +0000
@@ -31,6 +31,25 @@
property int reminderDefaultValue: 900;
readonly property bool syncInProgress: commonHeaderActions.syncInProgress
+ function handleUri(uri)
+ {
+ if(uri !== undefined && uri !== "") {
+ var commands = uri.split("://")[1].split("=");
+ if(commands[0].toLowerCase() === "eventid") {
+ // calendar://eventid=??
+ if( eventModel ) {
+ // qtorganizer:eds::<event-id>
+ var eventId = commands[1];
+ var prefix = "qtorganizer:eds::";
+ if (eventId.indexOf(prefix) < 0)
+ eventId = prefix + eventId;
+
+ eventModel.showEventFromId(eventId);
+ }
+ }
+ }
+ }
+
// Work-around until this branch lands:
// https://code.launchpad.net/~tpeeters/ubuntu-ui-toolkit/optIn-tabsDrawer/+merge/212496
//property bool windowActive: typeof window != 'undefined'
@@ -99,24 +118,7 @@
Connections {
target: UriHandler
- onOpened: {
- var uri = uris[0]
- if(uri !== undefined && uri !== "") {
- var commands = uri.split("://")[1].split("=");
- if(commands[0].toLowerCase() === "eventid") {
- // calendar://eventid=??
- if( eventModel ) {
- // qtorganizer:eds::<event-id>
- var eventId = commands[1];
- var prefix = "qtorganizer:eds::";
- if (eventId.indexOf(prefix) < 0)
- eventId = prefix + eventId;
-
- eventModel.showEventFromId(eventId);
- }
- }
- }
- }
+ onOpened: handleUri(uris[0])
}
PageStack {
@@ -379,6 +381,12 @@
var starttimepattern = new RegExp ("starttime=\\d+");
var endtimepattern = new RegExp ("endtime=\\d+");
var eventIdpattern = new RegExp ("eventId=.*")
+ var urlpattern = new RegExp("calendar://.*")
+
+ if (urlpattern.test(url)) {
+ handleUri(url)
+ return
+ }
newevent = newevenpattern.test(url);
References