[gnome-boxes] wizard-source: Introduce download_required prop



commit 0482d0c5875fd683ca7bb242b68c5f70ef397c25
Author: Lasse Schuirmann <lasse schuirmann gmail com>
Date:   Mon Jun 23 16:26:44 2014 +0200

    wizard-source: Introduce download_required prop
    
    This function will be used by the following patches to determine
    whether a remote source has to be downloaded or not. A source is
    considered to require download if it uses the HTTP(S) URI scheme.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729026

 src/wizard-source.vala |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index cc5d710..1f21934 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -132,6 +132,15 @@ private class Boxes.WizardSource: Gtk.Stack {
 
     public MediaManager media_manager;
 
+    public bool download_required {
+        get {
+            const string[] supported_schemes = { "http", "https" };
+            string scheme = Uri.parse_scheme (uri);
+
+            return (scheme != null && scheme in supported_schemes);
+        }
+    }
+
     private SourcePage _page;
     public SourcePage page {
         get { return _page; }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]