on xenial help sign in
reverted url dispatcher
7b084d9Nick Dedekind
debian/control−1
@@ -19,7 +19,6 @@ Build-Depends: cmake,
19 libqt5xmlpatterns5-dev,
19 libqt5xmlpatterns5-dev,
20 libunity-api-dev (>= 7.82),
20 libunity-api-dev (>= 7.82),
21 libunity-mir-dev,
21 libunity-mir-dev,
22− liburl-dispatcher1-dev,
23 libusermetricsoutput1-dev,
22 libusermetricsoutput1-dev,
24 libxcb1-dev,
23 libxcb1-dev,
25 pkg-config,
24 pkg-config,
plugins/Utils/CMakeLists.txt+2−8
@@ -2,23 +2,20 @@
2include(FindPkgConfig)
2include(FindPkgConfig)
3
3
4pkg_search_module(GIO REQUIRED gio-2.0)
4pkg_search_module(GIO REQUIRED gio-2.0)
5−pkg_search_module(URLDISPATCHER REQUIRED url-dispatcher-1)
6
5
7include_directories(
6include_directories(
8 ${CMAKE_CURRENT_SOURCE_DIR}
7 ${CMAKE_CURRENT_SOURCE_DIR}
9 ${CMAKE_CURRENT_BINARY_DIR}
8 ${CMAKE_CURRENT_BINARY_DIR}
10 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
9 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
11 ${GIO_INCLUDE_DIRS}
10 ${GIO_INCLUDE_DIRS}
12− ${URLDISPATCHER_INCLUDE_DIRS}
13)
11)
14
12
15set(QMLPLUGIN_SRC
13set(QMLPLUGIN_SRC
16− easingcurve.cpp
17 qlimitproxymodelqml.cpp
14 qlimitproxymodelqml.cpp
18 qsortfilterproxymodelqml.cpp
15 qsortfilterproxymodelqml.cpp
19 timeformatter.cpp
16 timeformatter.cpp
20 unitymenumodelpaths.cpp
17 unitymenumodelpaths.cpp
21− urldispatcher.cpp
18+ easingcurve.cpp
22 plugin.cpp
19 plugin.cpp
23 )
20 )
24
21
@@ -26,10 +23,7 @@ add_library(Utils-qml SHARED
26 ${QMLPLUGIN_SRC}
23 ${QMLPLUGIN_SRC}
27 )
24 )
28
25
29−target_link_libraries(Utils-qml
26+target_link_libraries(Utils-qml ${GIO_LDFLAGS})
30− ${GIO_LDFLAGS}
31− ${URLDISPATCHER_LDFLAGS}
32−)
33
27
34# Because this is an internal support library, we want
28# Because this is an internal support library, we want
35# to expose all symbols in it. Consider changing this
29# to expose all symbols in it. Consider changing this
plugins/Utils/plugin.cpp+1−10
@@ -26,18 +26,11 @@
26#include "plugin.h"
26#include "plugin.h"
27
27
28// local
28// local
29−#include "easingcurve.h"
30#include "qlimitproxymodelqml.h"
29#include "qlimitproxymodelqml.h"
31#include "qsortfilterproxymodelqml.h"
30#include "qsortfilterproxymodelqml.h"
32#include "timeformatter.h"
31#include "timeformatter.h"
33#include "unitymenumodelpaths.h"
32#include "unitymenumodelpaths.h"
34−#include "urldispatcher.h"
33+#include "easingcurve.h"
35−
36−static QObject* urlDispatcherSingleton(QQmlEngine* engine, QJSEngine* scriptEngine) {
37− Q_UNUSED(engine);
38− Q_UNUSED(scriptEngine);
39− return new URLDispatcher;
40−}
41
34
42void UtilsPlugin::registerTypes(const char *uri)
35void UtilsPlugin::registerTypes(const char *uri)
43{
36{
@@ -49,8 +42,6 @@ void UtilsPlugin::registerTypes(const char *uri)
49 qmlRegisterType<TimeFormatter>(uri, 0, 1, "TimeFormatter");
42 qmlRegisterType<TimeFormatter>(uri, 0, 1, "TimeFormatter");
50 qmlRegisterType<GDateTimeFormatter>(uri, 0, 1, "GDateTimeFormatter");
43 qmlRegisterType<GDateTimeFormatter>(uri, 0, 1, "GDateTimeFormatter");
51 qmlRegisterType<EasingCurve>(uri, 0, 1, "EasingCurve");
44 qmlRegisterType<EasingCurve>(uri, 0, 1, "EasingCurve");
52−
53− qmlRegisterSingletonType<URLDispatcher>(uri, 0, 1, "URLDispatcher", urlDispatcherSingleton);
54}
45}
55
46
56void UtilsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
47void UtilsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
plugins/Utils/urldispatcher.cppdeleted−38
@@ -1,38 +0,0 @@
1−/*
2− * Copyright 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 Lesser 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 Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors: Nick Dedekind <nick.dedekind@canonical.com>
17−*/
18−
19−#include "urldispatcher.h"
20−
21−#include <url-dispatcher.h>
22−
23−URLDispatcher::URLDispatcher(QObject *parent):
24− QObject(parent)
25−{
26−
27−}
28−
29−static void dispatched(const gchar * url, gboolean success, gpointer user_data)
30−{
31− URLDispatcher* urlDispatcher = (URLDispatcher*)user_data;
32− urlDispatcher->urlDispatched(QByteArray(url), success);
33−}
34−
35−void URLDispatcher::send(QByteArray const& url)
36−{
37− url_dispatch_send(url.constData(), dispatched, this);
38−}
plugins/Utils/urldispatcher.hdeleted−42
@@ -1,42 +0,0 @@
1−/*
2− * Copyright 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 Lesser 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 Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors: Nick Dedekind <nick.dedekind@canonical.com>
17−*/
18−
19−#ifndef URLDISPATCHER_H
20−#define URLDISPATCHER_H
21−
22−#include <QObject>
23−
24−/**
25− * @brief The URLDispatcher class
26− *
27− * This class exposes the url-dispatcher glib API to QML.
28− */
29−
30−class URLDispatcher: public QObject
31−{
32− Q_OBJECT
33−public:
34− URLDispatcher(QObject *parent = 0);
35−
36− Q_INVOKABLE void send(QByteArray const& url);
37−
38−Q_SIGNALS:
39− void urlDispatched(QByteArray const& url, bool success);
40−};
41−
42−#endif
qml/Panel/ActiveCallHint.qml+1−2
@@ -18,7 +18,6 @@ import QtQuick 2.0
18import Ubuntu.Telephony 0.1 as Telephony
18import Ubuntu.Telephony 0.1 as Telephony
19import Ubuntu.Components 0.1
19import Ubuntu.Components 0.1
20import Unity.Application 0.1
20import Unity.Application 0.1
21−import Utils 0.1
22import "../Components"
21import "../Components"
23
22
24Item {
23Item {
@@ -34,7 +33,7 @@ Item {
34 }
33 }
35
34
36 function activate() {
35 function activate() {
37− URLDispatcher.send("dialer:///?view=liveCall");
36+ ApplicationManager.requestFocusApplication("dialer-app");
38 }
37 }
39
38
40 MouseArea {
39 MouseArea {