Merge lp:~ricmm/qtubuntu/qurl-final into lp:qtubuntu

Proposed by Ricardo Mendoza
Status: Rejected
Rejected by: Loïc Minier
Proposed branch: lp:~ricmm/qtubuntu/qurl-final
Merge into: lp:qtubuntu
Diff against target: 164 lines (+88/-2)
6 files modified
debian/control (+1/-1)
src/platforms/base/base.pro (+2/-0)
src/platforms/base/integration.cc (+3/-1)
src/platforms/base/integration.h (+2/-0)
src/platforms/base/platformservices.cc (+50/-0)
src/platforms/base/platformservices.h (+30/-0)
To merge this branch: bzr merge lp:~ricmm/qtubuntu/qurl-final
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+186384@code.launchpad.net

Commit message

Implement QDesktopServices::openUrl()

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

FAILED: Continuous integration, rev:178
http://jenkins.qa.ubuntu.com/job/qtubuntu-ci/81/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/qtubuntu-saucy-armhf-ci/69/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/qtubuntu-ci/81/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Loïc Minier (lool) wrote :

I think we gave up on landing the last remaining change in this mp (build-dep bump) which would still be useful but we've landed recent enough packages in saucy anyway now.

Unmerged revisions

178. By Ricardo Mendoza

Bump build-dep version of platform-api

177. By Ricardo Mendoza

Implement QDesktopServices URL handlers

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2013-09-03 18:03:17 +0000
3+++ debian/control 2013-09-18 16:04:35 +0000
4@@ -10,7 +10,7 @@
5 libgles2-mesa-dev,
6 libglib2.0-dev,
7 libhybris-dev,
8- libplatform-api1-dev (>= 0.18.1daily13.06.11),
9+ libplatform-api1-dev (>= 0.19),
10 libudev-dev,
11 libunity-api-dev,
12 libxrender-dev,
13
14=== modified file 'src/platforms/base/base.pro'
15--- src/platforms/base/base.pro 2013-06-19 23:31:25 +0000
16+++ src/platforms/base/base.pro 2013-09-18 16:04:35 +0000
17@@ -19,6 +19,7 @@
18 window.cc \
19 input.cc \
20 theme.cc \
21+ platformservices.cc \
22 clipboard.cc
23
24 HEADERS = integration.h \
25@@ -30,6 +31,7 @@
26 input.h \
27 logging.h \
28 theme.h \
29+ platformservices.h \
30 clipboard.h
31
32 CONFIG += static create_prl egl qpa/genericunixfontdatabase
33
34=== modified file 'src/platforms/base/integration.cc'
35--- src/platforms/base/integration.cc 2013-02-14 16:31:33 +0000
36+++ src/platforms/base/integration.cc 2013-09-18 16:04:35 +0000
37@@ -20,6 +20,7 @@
38 #include "context.h"
39 #include "logging.h"
40 #include "theme.h"
41+#include "platformservices.h"
42 #include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
43 #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
44 #include <QtGui/private/qguiapplication_p.h>
45@@ -28,7 +29,8 @@
46 QUbuntuBaseIntegration::QUbuntuBaseIntegration()
47 : eventDispatcher_(createUnixEventDispatcher())
48 , nativeInterface_(new QUbuntuBaseNativeInterface())
49- , fontDb_(new QGenericUnixFontDatabase()) {
50+ , fontDb_(new QGenericUnixFontDatabase())
51+ , platformServices_(new QUbuntuBasePlatformServices()) {
52 QGuiApplicationPrivate::instance()->setEventDispatcher(eventDispatcher_);
53 DLOG("QUbuntuBaseIntegration::QUbuntuBaseIntegration (this=%p)", this);
54 }
55
56=== modified file 'src/platforms/base/integration.h'
57--- src/platforms/base/integration.h 2013-02-14 16:31:33 +0000
58+++ src/platforms/base/integration.h 2013-09-18 16:04:35 +0000
59@@ -29,6 +29,7 @@
60 bool hasCapability(QPlatformIntegration::Capability cap) const;
61 QAbstractEventDispatcher* guiThreadEventDispatcher() const { return eventDispatcher_; }
62 QPlatformNativeInterface* nativeInterface() const { return nativeInterface_; }
63+ QPlatformServices *services() const { return platformServices_; }
64 QPlatformBackingStore* createPlatformBackingStore(QWindow* window) const;
65 QPlatformOpenGLContext* createPlatformOpenGLContext(QOpenGLContext* context) const;
66 QPlatformOpenGLContext* createPlatformOpenGLContext(QOpenGLContext* context);
67@@ -40,6 +41,7 @@
68 QAbstractEventDispatcher* eventDispatcher_;
69 QPlatformNativeInterface* nativeInterface_;
70 QPlatformFontDatabase* fontDb_;
71+ QPlatformServices* platformServices_;
72 };
73
74 #endif // QUBUNTUBASEINTEGRATION_H
75
76=== added file 'src/platforms/base/platformservices.cc'
77--- src/platforms/base/platformservices.cc 1970-01-01 00:00:00 +0000
78+++ src/platforms/base/platformservices.cc 2013-09-18 16:04:35 +0000
79@@ -0,0 +1,50 @@
80+// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
81+// Copyright © 2013 Canonical Ltd.
82+//
83+// This program is free software: you can redistribute it and/or modify it under
84+// the terms of the GNU Lesser General Public License version 3, as published by
85+// the Free Software Foundation.
86+//
87+// This program is distributed in the hope that it will be useful, but WITHOUT
88+// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
89+// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
90+// Lesser General Public License for more details.
91+//
92+// You should have received a copy of the GNU Lesser General Public License
93+// along with this program. If not, see <http://www.gnu.org/licenses/>.
94+
95+#include "platformservices.h"
96+
97+#include <QUrl>
98+
99+#include <ubuntu/application/url_dispatcher/service.h>
100+#include <ubuntu/application/url_dispatcher/session.h>
101+
102+bool QUbuntuBasePlatformServices::openUrl(const QUrl &url)
103+{
104+ return callDispatcher(url);
105+}
106+
107+bool QUbuntuBasePlatformServices::openDocument(const QUrl &url)
108+{
109+ return callDispatcher(url);
110+}
111+
112+bool QUbuntuBasePlatformServices::callDispatcher(const QUrl &url)
113+{
114+ UAUrlDispatcherSession* session = ua_url_dispatcher_session();
115+ if (!session)
116+ return false;
117+
118+ ua_url_dispatcher_session_open(session, url.toEncoded().constData(), NULL, NULL);
119+
120+ free(session);
121+
122+ // We are returning true here because the other option
123+ // is spawning a nested event loop and wait for the
124+ // callback. But there is no guarantee on how fast
125+ // the callback is going to be so we prefer to avoid the
126+ // nested event loop. Long term plan is improve Qt API
127+ // to support an async openUrl
128+ return true;
129+}
130
131=== added file 'src/platforms/base/platformservices.h'
132--- src/platforms/base/platformservices.h 1970-01-01 00:00:00 +0000
133+++ src/platforms/base/platformservices.h 2013-09-18 16:04:35 +0000
134@@ -0,0 +1,30 @@
135+// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
136+// Copyright © 2013 Canonical Ltd.
137+//
138+// This program is free software: you can redistribute it and/or modify it under
139+// the terms of the GNU Lesser General Public License version 3, as published by
140+// the Free Software Foundation.
141+//
142+// This program is distributed in the hope that it will be useful, but WITHOUT
143+// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
144+// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
145+// Lesser General Public License for more details.
146+//
147+// You should have received a copy of the GNU Lesser General Public License
148+// along with this program. If not, see <http://www.gnu.org/licenses/>.
149+
150+#ifndef QUBUNTUBASEPLATFORMSERVICES_H
151+#define QUBUNTUBASEPLATFORMSERVICES_H
152+
153+#include <qpa/qplatformservices.h>
154+
155+class QUbuntuBasePlatformServices : public QPlatformServices {
156+public:
157+ bool openUrl(const QUrl &url);
158+ bool openDocument(const QUrl &url);
159+
160+private:
161+ bool callDispatcher(const QUrl &url);
162+};
163+
164+#endif // QUBUNTUBASEPLATFORMSERVICES_H

Subscribers

People subscribed via source and target branches