Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP2:GA
virt-viewer
e4bacb8f-remote-viewer-add-a-default-extension-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File e4bacb8f-remote-viewer-add-a-default-extension-to-screenshot-filenames.patch of Package virt-viewer
Subject: remote-viewer: add a default extension to screenshot filenames From: Julien ROPE jrope@redhat.com Fri Dec 13 11:16:23 2019 +0100 Date: Wed Feb 19 09:47:21 2020 +0100: Git: e4bacb8fde16cd21b8b8f095be720ad1a6c2d0e5 When doing a screenshot, if the user provides a filename without a file extension, an error occurs because the image format could not be determined. This patch adds a .png extension to such filenames, so that there is a default file format for screenshots. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1752514 Reviewed-by: Victor Toso <victortoso@redhat.com> Signed-off-by: Julien Ropé <jrope@redhat.com> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c index 4c08423..f58ebad 100644 --- a/src/virt-viewer-window.c +++ b/src/virt-viewer-window.c @@ -1069,6 +1069,14 @@ virt_viewer_window_menu_file_screenshot(GtkWidget *menu G_GNUC_UNUSED, GError *error = NULL; filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog)); + if (g_strrstr(filename, ".") == NULL) { + // no extension provided: add the .png default + char *tmp_filename ; + tmp_filename = g_strdup_printf("%s.png", filename) ; + g_free(filename) ; + filename = tmp_filename ; + } + if (!virt_viewer_window_save_screenshot(self, filename, &error)) { virt_viewer_app_simple_message_dialog(self->priv->app, error->message);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor