From c08a148bafc27f35011b805e773993300c55713f Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 23 Mar 2021 18:27:13 +0400 Subject: [PATCH] Fix build on 32-bit systems --- .../platform/linux/linux_mpris_support.cpp | 12 ++++++------ .../SourceFiles/platform/linux/main_window_linux.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/linux_mpris_support.cpp b/Telegram/SourceFiles/platform/linux/linux_mpris_support.cpp index 3a3d05a132..339ae554ef 100644 --- a/Telegram/SourceFiles/platform/linux/linux_mpris_support.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_mpris_support.cpp @@ -96,7 +96,7 @@ auto CreateMetadata(const Media::Player::TrackState &state) { if (!Media::Player::IsStoppedOrStopping(state.state)) { result["mpris:trackid"] = Glib::wrap(g_variant_new_object_path( kFakeTrackPath.utf8().constData())); - result["mpris:length"] = Glib::Variant::create( + result["mpris:length"] = Glib::Variant::create( state.length * 1000); const auto audioData = state.id.audio(); @@ -159,7 +159,7 @@ void HandleMethodCall( } else if (method_name == "Previous") { Media::Player::instance()->previous(); } else if (method_name == "Seek") { - const auto offset = base::Platform::GlibVariantCast( + const auto offset = base::Platform::GlibVariantCast( parametersCopy.get_child(0)); const auto state = Media::Player::instance()->getState( @@ -170,7 +170,7 @@ void HandleMethodCall( float64(state.position * 1000 + offset) / (state.length * 1000)); } else if (method_name == "SetPosition") { - const auto position = base::Platform::GlibVariantCast( + const auto position = base::Platform::GlibVariantCast( parametersCopy.get_child(1)); const auto state = Media::Player::instance()->getState( @@ -251,7 +251,7 @@ void HandleGetProperty( const auto state = Media::Player::instance()->getState( kSongType); - property = Glib::Variant::create(state.position * 1000); + property = Glib::Variant::create(state.position * 1000); } else if (property_name == "Rate") { property = Glib::Variant::create(1.0); } else if (property_name == "Volume") { @@ -315,7 +315,7 @@ void PlayerPropertyChanged( } } -void Seeked(long position) { +void Seeked(gint64 position) { try { const auto connection = Gio::DBus::Connection::get_sync( Gio::DBus::BusType::BUS_TYPE_SESSION); @@ -348,7 +348,7 @@ public: std::map metadata; Glib::ustring playbackStatus; - long position = 0; + gint64 position = 0; rpl::lifetime lifetime; }; diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index 139667ea6f..624e5107a0 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -880,9 +880,9 @@ void MainWindow::updateIconCounters() { if (counterSlice > 0) { // According to the spec, it should be of 'x' D-Bus signature, - // which corresponds to gint64 (signed long) type with glib + // which corresponds to gint64 type with glib // https://wiki.ubuntu.com/Unity/LauncherAPI#Low_level_DBus_API:_com.canonical.Unity.LauncherEntry - dbusUnityProperties["count"] = Glib::Variant::create( + dbusUnityProperties["count"] = Glib::Variant::create( counterSlice); dbusUnityProperties["count-visible"] = Glib::Variant::create(true);