on xenial help sign in
reverted url dispatcher
commit7b084d92a329a780c1c8888eaa4c1d3d053a0714 authorNick Dedekind <nicholas.dedekind@gmail.com> dateMon 23 Jun 2014, 17:20 (12 years ago) parent1b19117
6 files changed+4−101
debian/control−1 plugins/Utils/CMakeLists.txt+2−8 plugins/Utils/plugin.cpp+1−10 plugins/Utils/urldispatcher.cpp−38 plugins/Utils/urldispatcher.h−42 qml/Panel/ActiveCallHint.qml+1−2
debian/control−1
@@ -19,7 +19,6 @@ Build-Depends: cmake,
1919 libqt5xmlpatterns5-dev,
2020 libunity-api-dev (>= 7.82),
2121 libunity-mir-dev,
22− liburl-dispatcher1-dev,
2322 libusermetricsoutput1-dev,
2423 libxcb1-dev,
2524 pkg-config,
plugins/Utils/CMakeLists.txt+2−8
@@ -2,23 +2,20 @@
22include(FindPkgConfig)
33
44pkg_search_module(GIO REQUIRED gio-2.0)
5−pkg_search_module(URLDISPATCHER REQUIRED url-dispatcher-1)
65
76include_directories(
87 ${CMAKE_CURRENT_SOURCE_DIR}
98 ${CMAKE_CURRENT_BINARY_DIR}
109 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
1110 ${GIO_INCLUDE_DIRS}
12− ${URLDISPATCHER_INCLUDE_DIRS}
1311)
1412
1513set(QMLPLUGIN_SRC
16− easingcurve.cpp
1714 qlimitproxymodelqml.cpp
1815 qsortfilterproxymodelqml.cpp
1916 timeformatter.cpp
2017 unitymenumodelpaths.cpp
21− urldispatcher.cpp
18+ easingcurve.cpp
2219 plugin.cpp
2320 )
2421
@@ -26,10 +23,7 @@ add_library(Utils-qml SHARED
2623 ${QMLPLUGIN_SRC}
2724 )
2825
29−target_link_libraries(Utils-qml
30− ${GIO_LDFLAGS}
31− ${URLDISPATCHER_LDFLAGS}
32−)
26+target_link_libraries(Utils-qml ${GIO_LDFLAGS})
3327
3428# Because this is an internal support library, we want
3529# to expose all symbols in it. Consider changing this
plugins/Utils/plugin.cpp+1−10
@@ -26,18 +26,11 @@
2626#include "plugin.h"
2727
2828// local
29−#include "easingcurve.h"
3029#include "qlimitproxymodelqml.h"
3130#include "qsortfilterproxymodelqml.h"
3231#include "timeformatter.h"
3332#include "unitymenumodelpaths.h"
34−#include "urldispatcher.h"
35−
36−static QObject* urlDispatcherSingleton(QQmlEngine* engine, QJSEngine* scriptEngine) {
37− Q_UNUSED(engine);
38− Q_UNUSED(scriptEngine);
39− return new URLDispatcher;
40−}
33+#include "easingcurve.h"
4134
4235void UtilsPlugin::registerTypes(const char *uri)
4336{
@@ -49,8 +42,6 @@ void UtilsPlugin::registerTypes(const char *uri)
4942 qmlRegisterType<TimeFormatter>(uri, 0, 1, "TimeFormatter");
5043 qmlRegisterType<GDateTimeFormatter>(uri, 0, 1, "GDateTimeFormatter");
5144 qmlRegisterType<EasingCurve>(uri, 0, 1, "EasingCurve");
52−
53− qmlRegisterSingletonType<URLDispatcher>(uri, 0, 1, "URLDispatcher", urlDispatcherSingleton);
5445}
5546
5647void 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
1818import Ubuntu.Telephony 0.1 as Telephony
1919import Ubuntu.Components 0.1
2020import Unity.Application 0.1
21−import Utils 0.1
2221import "../Components"
2322
2423Item {
@@ -34,7 +33,7 @@ Item {
3433 }
3534
3635 function activate() {
37− URLDispatcher.send("dialer:///?view=liveCall");
36+ ApplicationManager.requestFocusApplication("dialer-app");
3837 }
3938
4039 MouseArea {