From 1336a7149b784be36f130f3b59067e3cf69c5062 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 3 Nov 2022 13:41:18 +0400 Subject: [PATCH] Update glibmm to latest version --- .../platform/linux/file_utilities_linux.cpp | 4 +- .../linux/linux_xdp_open_with_dialog.cpp | 2 +- .../platform/linux/main_window_linux.cpp | 4 +- .../linux/notifications_manager_linux.cpp | 23 ++++---- .../platform/linux/specific_linux.cpp | 6 +-- Telegram/build/docker/centos_env/Dockerfile | 52 +++++-------------- Telegram/lib_base | 2 +- Telegram/lib_webview | 2 +- cmake | 2 +- 9 files changed, 33 insertions(+), 64 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp index 1c68614e1..b06d5bae8 100644 --- a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp @@ -30,7 +30,7 @@ void UnsafeOpenUrl(const QString &url) { base::Platform::AppLaunchContext())) { return; } - } catch (const Glib::Error &e) { + } catch (const std::exception &e) { LOG(("App Error: %1").arg(QString::fromStdString(e.what()))); } #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION @@ -60,7 +60,7 @@ void UnsafeLaunch(const QString &filepath) { base::Platform::AppLaunchContext())) { return; } - } catch (const Glib::Error &e) { + } catch (const std::exception &e) { LOG(("App Error: %1").arg(QString::fromStdString(e.what()))); } diff --git a/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp b/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp index 15f3e3fa1..70eebdf71 100644 --- a/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp @@ -32,7 +32,7 @@ constexpr auto kPropertiesInterface = "org.freedesktop.DBus.Properties"_cs; bool ShowXDPOpenWithDialog(const QString &filepath) { try { const auto connection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); + Gio::DBus::BusType::SESSION); auto reply = connection->call_sync( std::string(base::Platform::XDP::kObjectPath), diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index a5cecbf79..e7dcff70a 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -178,7 +178,7 @@ bool UseUnityCounter() { static const auto Result = [&] { try { const auto connection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); + Gio::DBus::BusType::SESSION); return base::Platform::DBus::NameHasOwner( connection, @@ -280,7 +280,7 @@ void MainWindow::updateIconCounters() { try { const auto connection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); + Gio::DBus::BusType::SESSION); connection->emit_signal( "/com/canonical/unity/launcherentry/" diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index 228b216ac..1d96b1105 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -53,9 +53,6 @@ void Noexcept(Fn callback, Fn failed = nullptr) noexcept { try { callback(); return; - } catch (const Glib::Error &e) { - LOG(("Native Notification Error: %1").arg( - QString::fromStdString(e.what()))); } catch (const std::exception &e) { LOG(("Native Notification Error: %1").arg( QString::fromStdString(e.what()))); @@ -69,7 +66,7 @@ void Noexcept(Fn callback, Fn failed = nullptr) noexcept { std::unique_ptr CreateServiceWatcher() { try { const auto connection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); + Gio::DBus::BusType::SESSION); const auto activatable = [&] { try { @@ -109,7 +106,7 @@ std::unique_ptr CreateServiceWatcher() { void StartServiceAsync(Fn callback) { try { const auto connection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); + Gio::DBus::BusType::SESSION); DBus::StartServiceByNameAsync( connection, @@ -145,7 +142,7 @@ void StartServiceAsync(Fn callback) { bool GetServiceRegistered() { try { const auto connection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); + Gio::DBus::BusType::SESSION); const auto hasOwner = [&] { try { @@ -178,7 +175,7 @@ void GetServerInformation( Fn &)> callback) { Noexcept([&] { const auto connection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); + Gio::DBus::BusType::SESSION); connection->call( std::string(kObjectPath), @@ -224,7 +221,7 @@ void GetServerInformation( void GetCapabilities(Fn callback) { Noexcept([&] { const auto connection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); + Gio::DBus::BusType::SESSION); connection->call( std::string(kObjectPath), @@ -263,7 +260,7 @@ void GetInhibited(Fn callback) { Noexcept([&] { const auto connection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); + Gio::DBus::BusType::SESSION); connection->call( std::string(kObjectPath), @@ -380,7 +377,7 @@ bool NotificationData::init( Window::Notifications::Manager::DisplayOptions options) { Noexcept([&] { _dbusConnection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); + Gio::DBus::BusType::SESSION); }); if (!_dbusConnection) { @@ -600,7 +597,7 @@ void NotificationData::close() { {}, std::string(kService), -1, - Gio::DBus::CALL_FLAGS_NO_AUTO_START); + Gio::DBus::CallFlags::NO_AUTO_START); _manager->clearNotification(_id); } @@ -849,7 +846,7 @@ Manager::Private::Private(not_null manager, Type type) Noexcept([&] { _dbusConnection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); + Gio::DBus::BusType::SESSION); }); if (!_dbusConnection) { @@ -873,7 +870,7 @@ Manager::Private::Private(not_null manager, Type type) const auto interface = GlibVariantCast( parameters.get_child(0)); - if (interface != std::string(kInterface)) { + if (interface != kInterface.data()) { return; } diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 636c7536c..28e0dc5ee 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -70,7 +70,7 @@ void PortalAutostart(bool start, bool silent) { try { const auto connection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); + Gio::DBus::BusType::SESSION); const auto parentWindowId = [&]() -> Glib::ustring { const auto activeWindow = Core::App().activeWindow(); @@ -165,7 +165,7 @@ void PortalAutostart(bool start, bool silent) { window.show(); loop->run(); } - } catch (const Glib::Error &e) { + } catch (const std::exception &e) { if (!silent) { LOG(("Portal Autostart Error: %1").arg( QString::fromStdString(e.what()))); @@ -464,7 +464,7 @@ void start() { Gio::init(); Glib::set_prgname(cExeName().toStdString()); - Glib::set_application_name(std::string(AppName)); + Glib::set_application_name(AppName.data()); #ifdef DESKTOP_APP_USE_PACKAGED_RLOTTIE g_warning( diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index 0a917b729..31ba49c78 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -53,7 +53,7 @@ ENV CXXFLAGS $CFLAGS FROM builder AS patches RUN git clone {{ GIT }}/desktop-app/patches.git \ && cd patches \ - && git checkout c95e7f1bb7 \ + && git checkout b3b5f5cf92 \ && rm -rf .git FROM builder AS nasm @@ -625,47 +625,20 @@ RUN git clone -b xkbcommon-1.3.1 --depth=1 {{ GIT }}/xkbcommon/libxkbcommon.git && cd .. \ && rm -rf libxkbcommon -FROM builder AS mm-common -RUN git clone -b 1.0.3 --depth=1 {{ GIT }}/GNOME/mm-common.git \ - && cd mm-common \ - && NOCONFIGURE=1 ./autogen.sh \ - && ./configure --enable-network \ - && make -j$(nproc) \ - && make DESTDIR="{{ LibrariesPath }}/mm-common-cache" install \ - && cd .. \ - && rm -rf mm-common - -FROM builder AS libsigcplusplus -COPY --link --from=mm-common {{ LibrariesPath }}/mm-common-cache / - -RUN git clone -b 2.10.7 --depth=1 {{ GIT }}/libsigcplusplus/libsigcplusplus.git \ - && cd libsigcplusplus \ - && export ACLOCAL_PATH="/usr/local/share/aclocal" \ - && NOCONFIGURE=1 ./autogen.sh \ - && ./configure \ - --enable-maintainer-mode \ - --enable-static \ - --disable-documentation \ - && make -j$(nproc) \ - && make DESTDIR="{{ LibrariesPath }}/libsigcplusplus-cache" install \ - && cd .. \ - && rm -rf libsigcplusplus - FROM patches AS glibmm -COPY --link --from=mm-common {{ LibrariesPath }}/mm-common-cache / -COPY --link --from=libsigcplusplus {{ LibrariesPath }}/libsigcplusplus-cache / - -RUN git clone -b 2.56.1 --depth=1 {{ GIT }}/GNOME/glibmm.git \ +RUN git clone -b 2.74.0 --depth=1 {{ GIT }}/GNOME/glibmm.git \ && cd glibmm \ && git apply ../patches/glibmm.patch \ - && export ACLOCAL_PATH="/usr/local/share/aclocal" \ - && NOCONFIGURE=1 ./autogen.sh \ - && ./configure \ - --enable-maintainer-mode \ - --enable-static \ - --disable-documentation \ - && make -j$(nproc) \ - && make DESTDIR="{{ LibrariesPath }}/glibmm-cache" install \ + && meson build \ + --buildtype=plain \ + --default-library=both \ + -Dbuild-documentation=false \ + -Dbuild-examples=false \ + -Dsigc++-3.0:build-documentation=false \ + -Dsigc++-3.0:build-examples=false \ + -Dmm-common:use-network=true \ + && meson compile -C build \ + && DESTDIR="{{ LibrariesPath }}/glibmm-cache" meson install -C build \ && cd .. \ && rm -rf glibmm @@ -806,7 +779,6 @@ COPY --link --from=ffmpeg {{ LibrariesPath }}/ffmpeg-cache / COPY --link --from=openal {{ LibrariesPath }}/openal-cache / COPY --link --from=openssl {{ LibrariesPath }}/openssl-cache / COPY --link --from=xkbcommon {{ LibrariesPath }}/xkbcommon-cache / -COPY --link --from=libsigcplusplus {{ LibrariesPath }}/libsigcplusplus-cache / COPY --link --from=glibmm {{ LibrariesPath }}/glibmm-cache / COPY --link --from=qt {{ LibrariesPath }}/qt-cache / COPY --link --from=breakpad {{ LibrariesPath }}/breakpad-cache / diff --git a/Telegram/lib_base b/Telegram/lib_base index 986a867f8..2dc628159 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit 986a867f85716843eafbef6e2ae0820ea30d6cfc +Subproject commit 2dc6281594037047cd7ea376fff28629035d93e0 diff --git a/Telegram/lib_webview b/Telegram/lib_webview index ef855c732..bbd42f7df 160000 --- a/Telegram/lib_webview +++ b/Telegram/lib_webview @@ -1 +1 @@ -Subproject commit ef855c7325e81c3075ec3213f3ef504cd93edcf6 +Subproject commit bbd42f7dfebf5c05b76e507fda50159e91d25dae diff --git a/cmake b/cmake index 36ee4977b..cc8fc487d 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 36ee4977bbac6d5de4f3c463777a4e0588c661f9 +Subproject commit cc8fc487d7d6fbe0704753d35b7043bf0bed4549