Skip to content

Commit

Permalink
Get rid of unneeded gi::result wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed May 19, 2023
1 parent cc2c563 commit 8402502
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions base/platform/linux/base_system_media_controls_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ struct SystemMediaControls::Private : public Mpris::MediaPlayer2 {
gi::ref_ptr<Player> _player;

struct {
gi::result<Gio::DBusConnection> connection;
Gio::DBusConnection connection;
Mpris::ObjectSkeleton object;
Gio::DBusObjectManagerServer objectManager;
uint ownId = 0;
Expand All @@ -179,7 +179,9 @@ struct SystemMediaControls::Private : public Mpris::MediaPlayer2 {
SystemMediaControls::Private::Private()
: Mpris::MediaPlayer2(Mpris::MediaPlayer2Skeleton::new_())
, _player(gi::make_ref<Player>(this))
, _dbus({ .connection = Gio::bus_get_sync(Gio::BusType::SESSION_) }) {
, _dbus({
.connection = Gio::bus_get_sync(Gio::BusType::SESSION_, nullptr)
}) {
set_can_quit(true);
set_can_raise(!::Platform::IsWayland());
set_desktop_entry(
Expand Down Expand Up @@ -262,9 +264,9 @@ void SystemMediaControls::Private::init() {
_dbus.object.set_media_player2_player(player());
_dbus.objectManager = Gio::DBusObjectManagerServer::new_("/org/mpris");
_dbus.objectManager.export_(_dbus.object);
_dbus.objectManager.set_connection(*_dbus.connection);
_dbus.objectManager.set_connection(_dbus.connection);
_dbus.ownId = Gio::bus_own_name_on_connection(
*_dbus.connection,
_dbus.connection,
"org.mpris.MediaPlayer2." + (KSandbox::isFlatpak()
? qEnvironmentVariable("FLATPAK_ID").toStdString()
: KSandbox::isSnap()
Expand Down

0 comments on commit 8402502

Please sign in to comment.