summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-01-09 12:07:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-01-11 14:29:22 +0100
commitb71660540e326db3b15899a9db0aa3bf4aed2cee (patch)
tree384de799a0e4a17efb06286d40ace7618d237fb9 /shell
parent74b3924a98dfeeec719f7bc27a2e0a2e1a597167 (diff)
[API CHANGE] migrate PackageKit usage to Modify2
xid dropped in favour of application_id Change-Id: Id1eb43aa9c8dfb4eac82f99eff0f84c5320e0da0 Reviewed-on: https://gerrit.libreoffice.org/47661 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/source/sessioninstall/SyncDbusSessionHelper.cxx51
-rw-r--r--shell/source/sessioninstall/SyncDbusSessionHelper.hxx20
2 files changed, 39 insertions, 32 deletions
diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
index 4092d146f7c2..9fd928f7e982 100644
--- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
+++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
@@ -55,8 +55,15 @@ namespace
return proxy;
}
+ GVariant* pk_make_platform_data()
+ {
+ GVariantBuilder builder;
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("a{sv}"));
+ return g_variant_builder_end(&builder);
+ }
+
void request(
- char const * method, sal_uInt32 xid,
+ char const * method,
css::uno::Sequence<OUString> const & resources,
OUString const & interaction)
{
@@ -70,13 +77,13 @@ void request(
}
auto iactUtf8(OUStringToOString(interaction, RTL_TEXTENCODING_UTF8));
std::shared_ptr<GDBusProxy> proxy(
- lcl_GetPackageKitProxy("Modify"), GObjectDeleter<GDBusProxy>());
+ lcl_GetPackageKitProxy("Modify2"), GObjectDeleter<GDBusProxy>());
GErrorWrapper error;
std::shared_ptr<GVariant> result(g_dbus_proxy_call_sync(
proxy.get(), method,
g_variant_new(
- "(uass)", static_cast<guint32>(xid), builder.get(),
- iactUtf8.getStr()),
+ "(asss@a{sv})", builder.get(), iactUtf8.getStr(),
+ "libreoffice-startcenter.desktop", pk_make_platform_data()),
G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &error.getRef()), GVariantDeleter());
}
@@ -92,66 +99,66 @@ namespace shell { namespace sessioninstall
}
void SyncDbusSessionHelper::InstallPackageFiles(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & files,
+ css::uno::Sequence<OUString> const & files,
OUString const & interaction)
{
- request("InstallPackageFiles", xid, files, interaction);
+ request("InstallPackageFiles", files, interaction);
}
void SyncDbusSessionHelper::InstallProvideFiles(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & files,
+ css::uno::Sequence<OUString> const & files,
OUString const & interaction)
{
- request("InstallProvideFiles", xid, files, interaction);
+ request("InstallProvideFiles", files, interaction);
}
void SyncDbusSessionHelper::InstallCatalogs(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & files,
+ css::uno::Sequence<OUString> const & files,
OUString const & interaction)
{
- request("InstallCatalogs", xid, files, interaction);
+ request("InstallCatalogs", files, interaction);
}
void SyncDbusSessionHelper::InstallPackageNames(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & packages,
+ css::uno::Sequence<OUString> const & packages,
OUString const & interaction)
{
- request("InstallPackageNames", xid, packages, interaction);
+ request("InstallPackageNames", packages, interaction);
}
void SyncDbusSessionHelper::InstallMimeTypes(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & mimeTypes,
+ css::uno::Sequence<OUString> const & mimeTypes,
OUString const & interaction)
{
- request("InstallMimeTypes", xid, mimeTypes, interaction);
+ request("InstallMimeTypes", mimeTypes, interaction);
}
void SyncDbusSessionHelper::InstallFontconfigResources(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & resources,
+ css::uno::Sequence<OUString> const & resources,
OUString const & interaction)
{
- request("InstallFontconfigResources", xid, resources, interaction);
+ request("InstallFontconfigResources", resources, interaction);
}
void SyncDbusSessionHelper::InstallGStreamerResources(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & resources,
+ css::uno::Sequence<OUString> const & resources,
OUString const & interaction)
{
- request("InstallGStreamerResources", xid, resources, interaction);
+ request("InstallGStreamerResources", resources, interaction);
}
void SyncDbusSessionHelper::RemovePackageByFiles(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & files,
+ css::uno::Sequence<OUString> const & files,
OUString const & interaction)
{
- request("RemovePackageByFiles", xid, files, interaction);
+ request("RemovePackageByFiles", files, interaction);
}
void SyncDbusSessionHelper::InstallPrinterDrivers(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & files,
+ css::uno::Sequence<OUString> const & files,
OUString const & interaction)
{
- request("InstallPrinteDrivers", xid, files, interaction);
+ request("InstallPrinteDrivers", files, interaction);
}
void SAL_CALL SyncDbusSessionHelper::IsInstalled( const OUString& sPackagename, const OUString& sInteraction, sal_Bool& o_isInstalled )
diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.hxx b/shell/source/sessioninstall/SyncDbusSessionHelper.hxx
index 731b649d723a..72b17ba468cc 100644
--- a/shell/source/sessioninstall/SyncDbusSessionHelper.hxx
+++ b/shell/source/sessioninstall/SyncDbusSessionHelper.hxx
@@ -23,26 +23,26 @@ namespace shell { namespace sessioninstall
SyncDbusSessionHelper(css::uno::Reference< css::uno::XComponentContext> const&);
// XModify Methods
- virtual void SAL_CALL InstallPackageFiles( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallPackageFiles( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
- virtual void SAL_CALL InstallProvideFiles( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallProvideFiles( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
- virtual void SAL_CALL InstallCatalogs( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallCatalogs( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
- virtual void SAL_CALL InstallPackageNames( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& packages, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallPackageNames( const css::uno::Sequence< OUString >& packages, const OUString& interaction ) override;
- virtual void SAL_CALL InstallMimeTypes( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& mimeTypes, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallMimeTypes( const css::uno::Sequence< OUString >& mimeTypes, const OUString& interaction ) override;
- virtual void SAL_CALL InstallFontconfigResources( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& resources, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallFontconfigResources( const css::uno::Sequence< OUString >& resources, const OUString& interaction ) override;
- virtual void SAL_CALL InstallGStreamerResources( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& resources, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallGStreamerResources( const css::uno::Sequence< OUString >& resources, const OUString& interaction ) override;
- virtual void SAL_CALL InstallResources( ::sal_uInt32 /* xid */, const css::uno::Sequence< OUString >& /* types */, const css::uno::Sequence< OUString >& /* resources */, const OUString& /* interaction */ ) override
+ virtual void SAL_CALL InstallResources( const css::uno::Sequence< OUString >& /* types */, const css::uno::Sequence< OUString >& /* resources */, const OUString& /* interaction */ ) override
{ throw css::uno::RuntimeException(); } // not implemented
- virtual void SAL_CALL RemovePackageByFiles( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+ virtual void SAL_CALL RemovePackageByFiles( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
- virtual void SAL_CALL InstallPrinterDrivers( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallPrinterDrivers( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
// XQuery Methods
virtual void SAL_CALL IsInstalled( const OUString& /* package_name */, const OUString& /* interaction */, sal_Bool& /* installed */ ) override;