[gnome-boxes/wip/rishi/rhel: 11/17] wizard: Allow a custom filename when sanity-checking downloadable URIs
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/wip/rishi/rhel: 11/17] wizard: Allow a custom filename when sanity-checking downloadable URIs
- Date: Thu, 21 Sep 2017 17:29:46 +0000 (UTC)
commit b12861fcf5795b2cf7b5ef9b27a10d09cf319442
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Aug 31 20:33:18 2017 +0200
wizard: Allow a custom filename when sanity-checking downloadable URIs
https://bugzilla.gnome.org/show_bug.cgi?id=786679
src/wizard.vala | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/wizard.vala b/src/wizard.vala
index c3fcbb7..a724199 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -306,14 +306,20 @@ private class Boxes.Wizard: Gtk.Stack, Boxes.UI {
prepare_for_uri (file.get_uri ());
}
- private void prepare_for_uri (string uri_as_text) throws Boxes.Error {
+ private void prepare_for_uri (string uri_as_text, string? filename = null) throws Boxes.Error {
var uri = Xml.URI.parse (uri_as_text);
if (uri == null || uri.scheme == null)
throw new Boxes.Error.INVALID (_("Invalid URL"));
if (wizard_source.download_required) {
- var file = File.new_for_uri (uri_as_text);
- var basename = file.get_basename ();
+ string? basename = null;
+
+ if (filename == null) {
+ var file = File.new_for_uri (uri_as_text);
+ basename = file.get_basename ();
+ } else {
+ basename = filename;
+ }
if (basename == null || basename == "" || basename == "/")
throw new Boxes.Error.INVALID (_("Invalid URL"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]