diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-07-02 12:16:52 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-07-02 12:16:52 +0200 |
commit | 1de91b6c81b1cff3c922eae852e5bb08f32cd2d3 (patch) | |
tree | 6d8390c1c32b05e048599e529e2aef9d345d4160 /src/DesktopIntegration.vala | |
parent | dcfb4504919bc8bc36e8b38d2a88349e4f549b10 (diff) | |
parent | f6062696f6bbd00d4eaa8a6e994dabfefc455f31 (diff) |
Update upstream source from tag 'upstream/0.32.7'
Update to upstream version '0.32.7'
with Debian dir 56d9facdfffd13cdf018382bd6c17544613d8ff0
Diffstat (limited to 'src/DesktopIntegration.vala')
-rw-r--r-- | src/DesktopIntegration.vala | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/DesktopIntegration.vala b/src/DesktopIntegration.vala index 754d9a1..d29e0f7 100644 --- a/src/DesktopIntegration.vala +++ b/src/DesktopIntegration.vala @@ -105,13 +105,13 @@ public async void files_send_to(File[] files) { } AppWindow.get_instance().set_busy_cursor(); - try{ - var portal = new Xdp.Portal(); + try { + var portal = new Xdp.Portal.initable_new(); // Use empty list for addresses instead of null to word around bug in xdg-desktop-portal-gtk yield portal.compose_email(parent, {null}, null, null, _("Send files per Mail: ") + file_names.str, null, file_paths, Xdp.EmailFlags.NONE, null); - } catch (Error e){ + } catch (Error e) { // Translators: The first %s is the name of the file, the second %s is the reason why it could not be sent AppWindow.error_message(_("Unable to send file %s, %s").printf( file_names.str, e.message)); @@ -175,12 +175,16 @@ public void set_background(Photo photo, bool desktop, bool screensaver) { } var parent = Xdp.parent_new_gtk(AppWindow.get_instance()); - var portal = new Xdp.Portal(); Xdp.WallpaperFlags flags = Xdp.WallpaperFlags.PREVIEW; if (desktop) flags |= Xdp.WallpaperFlags.BACKGROUND; if (screensaver) flags |= Xdp.WallpaperFlags.LOCKSCREEN; - portal.set_wallpaper.begin(parent, save_as.get_uri(), flags, null); + try { + var portal = new Xdp.Portal.initable_new(); + portal.set_wallpaper.begin(parent, save_as.get_uri(), flags, null); + } catch (Error err) { + AppWindow.error_message(_("Unable to set background: %s").printf(err.message)); + } GLib.FileUtils.chmod(save_as.get_parse_name(), 0644); } @@ -313,12 +317,16 @@ private void on_desktop_slideshow_exported(Exporter exporter, bool is_cancelled) } var parent = Xdp.parent_new_gtk(AppWindow.get_instance()); - var portal = new Xdp.Portal(); Xdp.WallpaperFlags flags = Xdp.WallpaperFlags.PREVIEW; if (set_desktop_background) flags |= Xdp.WallpaperFlags.BACKGROUND; if (set_screensaver) flags |= Xdp.WallpaperFlags.LOCKSCREEN; - portal.set_wallpaper.begin(parent, xml_file.get_uri(), flags, null); + try { + var portal = new Xdp.Portal.initable_new(); + portal.set_wallpaper.begin(parent, xml_file.get_uri(), flags, null); + } catch (Error err) { + AppWindow.error_message(_("Unable to set background: %s").printf(err.message)); + } } } |