Update glibmm to latest version

This commit is contained in:
Ilya Fedin 2022-11-03 13:41:18 +04:00 committed by John Preston
parent 67d99355ca
commit 1336a7149b
9 changed files with 33 additions and 64 deletions

View file

@ -30,7 +30,7 @@ void UnsafeOpenUrl(const QString &url) {
base::Platform::AppLaunchContext())) { base::Platform::AppLaunchContext())) {
return; return;
} }
} catch (const Glib::Error &e) { } catch (const std::exception &e) {
LOG(("App Error: %1").arg(QString::fromStdString(e.what()))); LOG(("App Error: %1").arg(QString::fromStdString(e.what())));
} }
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
@ -60,7 +60,7 @@ void UnsafeLaunch(const QString &filepath) {
base::Platform::AppLaunchContext())) { base::Platform::AppLaunchContext())) {
return; return;
} }
} catch (const Glib::Error &e) { } catch (const std::exception &e) {
LOG(("App Error: %1").arg(QString::fromStdString(e.what()))); LOG(("App Error: %1").arg(QString::fromStdString(e.what())));
} }

View file

@ -32,7 +32,7 @@ constexpr auto kPropertiesInterface = "org.freedesktop.DBus.Properties"_cs;
bool ShowXDPOpenWithDialog(const QString &filepath) { bool ShowXDPOpenWithDialog(const QString &filepath) {
try { try {
const auto connection = Gio::DBus::Connection::get_sync( const auto connection = Gio::DBus::Connection::get_sync(
Gio::DBus::BusType::BUS_TYPE_SESSION); Gio::DBus::BusType::SESSION);
auto reply = connection->call_sync( auto reply = connection->call_sync(
std::string(base::Platform::XDP::kObjectPath), std::string(base::Platform::XDP::kObjectPath),

View file

@ -178,7 +178,7 @@ bool UseUnityCounter() {
static const auto Result = [&] { static const auto Result = [&] {
try { try {
const auto connection = Gio::DBus::Connection::get_sync( const auto connection = Gio::DBus::Connection::get_sync(
Gio::DBus::BusType::BUS_TYPE_SESSION); Gio::DBus::BusType::SESSION);
return base::Platform::DBus::NameHasOwner( return base::Platform::DBus::NameHasOwner(
connection, connection,
@ -280,7 +280,7 @@ void MainWindow::updateIconCounters() {
try { try {
const auto connection = Gio::DBus::Connection::get_sync( const auto connection = Gio::DBus::Connection::get_sync(
Gio::DBus::BusType::BUS_TYPE_SESSION); Gio::DBus::BusType::SESSION);
connection->emit_signal( connection->emit_signal(
"/com/canonical/unity/launcherentry/" "/com/canonical/unity/launcherentry/"

View file

@ -53,9 +53,6 @@ void Noexcept(Fn<void()> callback, Fn<void()> failed = nullptr) noexcept {
try { try {
callback(); callback();
return; return;
} catch (const Glib::Error &e) {
LOG(("Native Notification Error: %1").arg(
QString::fromStdString(e.what())));
} catch (const std::exception &e) { } catch (const std::exception &e) {
LOG(("Native Notification Error: %1").arg( LOG(("Native Notification Error: %1").arg(
QString::fromStdString(e.what()))); QString::fromStdString(e.what())));
@ -69,7 +66,7 @@ void Noexcept(Fn<void()> callback, Fn<void()> failed = nullptr) noexcept {
std::unique_ptr<base::Platform::DBus::ServiceWatcher> CreateServiceWatcher() { std::unique_ptr<base::Platform::DBus::ServiceWatcher> CreateServiceWatcher() {
try { try {
const auto connection = Gio::DBus::Connection::get_sync( const auto connection = Gio::DBus::Connection::get_sync(
Gio::DBus::BusType::BUS_TYPE_SESSION); Gio::DBus::BusType::SESSION);
const auto activatable = [&] { const auto activatable = [&] {
try { try {
@ -109,7 +106,7 @@ std::unique_ptr<base::Platform::DBus::ServiceWatcher> CreateServiceWatcher() {
void StartServiceAsync(Fn<void()> callback) { void StartServiceAsync(Fn<void()> callback) {
try { try {
const auto connection = Gio::DBus::Connection::get_sync( const auto connection = Gio::DBus::Connection::get_sync(
Gio::DBus::BusType::BUS_TYPE_SESSION); Gio::DBus::BusType::SESSION);
DBus::StartServiceByNameAsync( DBus::StartServiceByNameAsync(
connection, connection,
@ -145,7 +142,7 @@ void StartServiceAsync(Fn<void()> callback) {
bool GetServiceRegistered() { bool GetServiceRegistered() {
try { try {
const auto connection = Gio::DBus::Connection::get_sync( const auto connection = Gio::DBus::Connection::get_sync(
Gio::DBus::BusType::BUS_TYPE_SESSION); Gio::DBus::BusType::SESSION);
const auto hasOwner = [&] { const auto hasOwner = [&] {
try { try {
@ -178,7 +175,7 @@ void GetServerInformation(
Fn<void(const std::optional<ServerInformation> &)> callback) { Fn<void(const std::optional<ServerInformation> &)> callback) {
Noexcept([&] { Noexcept([&] {
const auto connection = Gio::DBus::Connection::get_sync( const auto connection = Gio::DBus::Connection::get_sync(
Gio::DBus::BusType::BUS_TYPE_SESSION); Gio::DBus::BusType::SESSION);
connection->call( connection->call(
std::string(kObjectPath), std::string(kObjectPath),
@ -224,7 +221,7 @@ void GetServerInformation(
void GetCapabilities(Fn<void(const QStringList &)> callback) { void GetCapabilities(Fn<void(const QStringList &)> callback) {
Noexcept([&] { Noexcept([&] {
const auto connection = Gio::DBus::Connection::get_sync( const auto connection = Gio::DBus::Connection::get_sync(
Gio::DBus::BusType::BUS_TYPE_SESSION); Gio::DBus::BusType::SESSION);
connection->call( connection->call(
std::string(kObjectPath), std::string(kObjectPath),
@ -263,7 +260,7 @@ void GetInhibited(Fn<void(bool)> callback) {
Noexcept([&] { Noexcept([&] {
const auto connection = Gio::DBus::Connection::get_sync( const auto connection = Gio::DBus::Connection::get_sync(
Gio::DBus::BusType::BUS_TYPE_SESSION); Gio::DBus::BusType::SESSION);
connection->call( connection->call(
std::string(kObjectPath), std::string(kObjectPath),
@ -380,7 +377,7 @@ bool NotificationData::init(
Window::Notifications::Manager::DisplayOptions options) { Window::Notifications::Manager::DisplayOptions options) {
Noexcept([&] { Noexcept([&] {
_dbusConnection = Gio::DBus::Connection::get_sync( _dbusConnection = Gio::DBus::Connection::get_sync(
Gio::DBus::BusType::BUS_TYPE_SESSION); Gio::DBus::BusType::SESSION);
}); });
if (!_dbusConnection) { if (!_dbusConnection) {
@ -600,7 +597,7 @@ void NotificationData::close() {
{}, {},
std::string(kService), std::string(kService),
-1, -1,
Gio::DBus::CALL_FLAGS_NO_AUTO_START); Gio::DBus::CallFlags::NO_AUTO_START);
_manager->clearNotification(_id); _manager->clearNotification(_id);
} }
@ -849,7 +846,7 @@ Manager::Private::Private(not_null<Manager*> manager, Type type)
Noexcept([&] { Noexcept([&] {
_dbusConnection = Gio::DBus::Connection::get_sync( _dbusConnection = Gio::DBus::Connection::get_sync(
Gio::DBus::BusType::BUS_TYPE_SESSION); Gio::DBus::BusType::SESSION);
}); });
if (!_dbusConnection) { if (!_dbusConnection) {
@ -873,7 +870,7 @@ Manager::Private::Private(not_null<Manager*> manager, Type type)
const auto interface = GlibVariantCast<Glib::ustring>( const auto interface = GlibVariantCast<Glib::ustring>(
parameters.get_child(0)); parameters.get_child(0));
if (interface != std::string(kInterface)) { if (interface != kInterface.data()) {
return; return;
} }

View file

@ -70,7 +70,7 @@ void PortalAutostart(bool start, bool silent) {
try { try {
const auto connection = Gio::DBus::Connection::get_sync( 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 parentWindowId = [&]() -> Glib::ustring {
const auto activeWindow = Core::App().activeWindow(); const auto activeWindow = Core::App().activeWindow();
@ -165,7 +165,7 @@ void PortalAutostart(bool start, bool silent) {
window.show(); window.show();
loop->run(); loop->run();
} }
} catch (const Glib::Error &e) { } catch (const std::exception &e) {
if (!silent) { if (!silent) {
LOG(("Portal Autostart Error: %1").arg( LOG(("Portal Autostart Error: %1").arg(
QString::fromStdString(e.what()))); QString::fromStdString(e.what())));
@ -464,7 +464,7 @@ void start() {
Gio::init(); Gio::init();
Glib::set_prgname(cExeName().toStdString()); Glib::set_prgname(cExeName().toStdString());
Glib::set_application_name(std::string(AppName)); Glib::set_application_name(AppName.data());
#ifdef DESKTOP_APP_USE_PACKAGED_RLOTTIE #ifdef DESKTOP_APP_USE_PACKAGED_RLOTTIE
g_warning( g_warning(

View file

@ -53,7 +53,7 @@ ENV CXXFLAGS $CFLAGS
FROM builder AS patches FROM builder AS patches
RUN git clone {{ GIT }}/desktop-app/patches.git \ RUN git clone {{ GIT }}/desktop-app/patches.git \
&& cd patches \ && cd patches \
&& git checkout c95e7f1bb7 \ && git checkout b3b5f5cf92 \
&& rm -rf .git && rm -rf .git
FROM builder AS nasm FROM builder AS nasm
@ -625,47 +625,20 @@ RUN git clone -b xkbcommon-1.3.1 --depth=1 {{ GIT }}/xkbcommon/libxkbcommon.git
&& cd .. \ && cd .. \
&& rm -rf libxkbcommon && 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 FROM patches AS glibmm
COPY --link --from=mm-common {{ LibrariesPath }}/mm-common-cache / RUN git clone -b 2.74.0 --depth=1 {{ GIT }}/GNOME/glibmm.git \
COPY --link --from=libsigcplusplus {{ LibrariesPath }}/libsigcplusplus-cache /
RUN git clone -b 2.56.1 --depth=1 {{ GIT }}/GNOME/glibmm.git \
&& cd glibmm \ && cd glibmm \
&& git apply ../patches/glibmm.patch \ && git apply ../patches/glibmm.patch \
&& export ACLOCAL_PATH="/usr/local/share/aclocal" \ && meson build \
&& NOCONFIGURE=1 ./autogen.sh \ --buildtype=plain \
&& ./configure \ --default-library=both \
--enable-maintainer-mode \ -Dbuild-documentation=false \
--enable-static \ -Dbuild-examples=false \
--disable-documentation \ -Dsigc++-3.0:build-documentation=false \
&& make -j$(nproc) \ -Dsigc++-3.0:build-examples=false \
&& make DESTDIR="{{ LibrariesPath }}/glibmm-cache" install \ -Dmm-common:use-network=true \
&& meson compile -C build \
&& DESTDIR="{{ LibrariesPath }}/glibmm-cache" meson install -C build \
&& cd .. \ && cd .. \
&& rm -rf glibmm && rm -rf glibmm
@ -806,7 +779,6 @@ COPY --link --from=ffmpeg {{ LibrariesPath }}/ffmpeg-cache /
COPY --link --from=openal {{ LibrariesPath }}/openal-cache / COPY --link --from=openal {{ LibrariesPath }}/openal-cache /
COPY --link --from=openssl {{ LibrariesPath }}/openssl-cache / COPY --link --from=openssl {{ LibrariesPath }}/openssl-cache /
COPY --link --from=xkbcommon {{ LibrariesPath }}/xkbcommon-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=glibmm {{ LibrariesPath }}/glibmm-cache /
COPY --link --from=qt {{ LibrariesPath }}/qt-cache / COPY --link --from=qt {{ LibrariesPath }}/qt-cache /
COPY --link --from=breakpad {{ LibrariesPath }}/breakpad-cache / COPY --link --from=breakpad {{ LibrariesPath }}/breakpad-cache /

@ -1 +1 @@
Subproject commit 986a867f85716843eafbef6e2ae0820ea30d6cfc Subproject commit 2dc6281594037047cd7ea376fff28629035d93e0

@ -1 +1 @@
Subproject commit ef855c7325e81c3075ec3213f3ef504cd93edcf6 Subproject commit bbd42f7dfebf5c05b76e507fda50159e91d25dae

2
cmake

@ -1 +1 @@
Subproject commit 36ee4977bbac6d5de4f3c463777a4e0588c661f9 Subproject commit cc8fc487d7d6fbe0704753d35b7043bf0bed4549