Skip to content
Snippets Groups Projects
Commit 2f006220 authored by Madgula Rohan's avatar Madgula Rohan Committed by Simon McVittie
Browse files

Use cby_entry_point_open_uri_async () to open uri

LaunchNewApp dbus method will be obsolete in near
future

Apertis: https://phabricator.apertis.org/T3572



Signed-off-by: default avatarRohan Madgula <Rohan.Madgula@in.bosch.com>
Reviewed-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D5752
parent ad87243e
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ PKG_CHECK_MODULES([GLIB], [$DIDCOT_PACKAGES_PUBLIC_GLIB $DIDCOT_PACKAGES_PRIVATE
PKG_CHECK_MODULES([CANTERBURY], [$DIDCOT_PACKAGES_PUBLIC_CANTERBURY $DIDCOT_PACKAGES_PRIVATE_CANTERBURY])
PKG_CHECK_MODULES([BARKWAY], [$DIDCOT_PACKAGES_PUBLIC_BARKWAY $DIDCOT_PACKAGES_PRIVATE_BARKWAY])
PKG_CHECK_MODULES([CANTERBURY_PLATFORM], [canterbury-platform-0 >= 0.1703.4 ])
PKG_CHECK_MODULES([CANTERBURY_PLATFORM], [canterbury-platform-0 >= 0.1703.5 ])
DIDCOT_FI=' -ldidcotlaunchiface -ldidcotshareiface'
......
......@@ -13,7 +13,7 @@ Build-Depends:
hotdoc (>= 0.8),
hotdoc-c-extension,
hotdoc-dbus-extension,
libcanterbury-platform-0-dev (>= 0.1703.4),
libcanterbury-platform-0-dev (>= 0.1703.5),
libgirepository1.0-dev,
libglib2.0-dev,
Standards-Version: 3.9.2
......
......@@ -192,21 +192,22 @@ static void search_for_apps_for_given_type(gpointer app_name , gpointer value ,g
static void
new_app_launch_cb (GObject *source_object, GAsyncResult *res,
gpointer user_data)
entry_point_open_uri_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
GError *error = NULL;
gboolean is_launched = FALSE;
OpenURIRequestData *request_data = user_data;
canterbury_app_db_handler_call_launch_new_app_finish (
CANTERBURY_APP_DB_HANDLER (source_object), &is_launched, res, &error);
if (is_launched == TRUE)
gboolean open_success = FALSE;
open_success = cby_entry_point_open_uri_finish (CBY_ENTRY_POINT (source_object),
res,
&error);
if (open_success)
didcot_launch_complete_open_uri (NULL, request_data->invocation);
else
{
g_dbus_method_invocation_return_gerror (request_data->invocation, error);
g_error_free (error);
}
g_dbus_method_invocation_take_error (request_data->invocation, error);
open_uri_request_data_free (request_data);
}
......@@ -214,17 +215,22 @@ static void
launch_app_with_url (const gchar* file_path, const gchar *mimetype,const gchar* app_name,OpenURIRequestData *request_data)
{
GVariantBuilder gvb;
GVariant *arg_list;
g_variant_builder_init (&gvb, G_VARIANT_TYPE ("a{ss}"));
g_variant_builder_add (&gvb, "{ss}", "mime-type", mimetype);
g_variant_builder_add (&gvb, "{ss}", "launch", file_path);
arg_list = g_variant_builder_end (&gvb);
canterbury_app_db_handler_call_launch_new_app (data_struct.app_launch_proxy,
app_name, arg_list, NULL,
new_app_launch_cb,
request_data);
GVariant *platform_data = NULL;
g_autoptr (CbyEntryPoint) entry_point = NULL;
const gchar *content_types[] = { NULL, NULL };
content_types[0] = mimetype;
g_variant_builder_init (&gvb, G_VARIANT_TYPE_VARDICT);
g_variant_builder_add (&gvb, "{sv}", "X-Apertis-ContentTypes",
g_variant_new ("^as", content_types));
/* Floating ref, ownership taken by open_uri_async */
platform_data = g_variant_builder_end (&gvb);
entry_point = cby_entry_point_index_get_by_id (data_struct.entry_point_index,
app_name);
cby_entry_point_open_uri_async (entry_point, file_path, platform_data, NULL,
entry_point_open_uri_cb, request_data);
}
static void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment