[gnome-games] utils: Add Uri.from_uri_and_scheme()



commit 5843eb3850dee5e47868ddfc6087a9ed9c01cac4
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Sat May 6 11:08:06 2017 +0200

    utils: Add Uri.from_uri_and_scheme()
    
    This will be used by game factories to adapt a URI scheme to their
    needs.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781334

 src/utils/uri.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/utils/uri.vala b/src/utils/uri.vala
index 818ebff..9dac436 100644
--- a/src/utils/uri.vala
+++ b/src/utils/uri.vala
@@ -9,6 +9,10 @@ public class Games.Uri {
                this.uri = uri;
        }
 
+       public Uri.from_uri_and_scheme (Uri uri, string scheme) {
+               this.uri = scheme_regex.replace (uri.uri, -1, 0, scheme + ":");
+       }
+
        public Uri.from_file (File file) {
                uri = file.get_uri ();
        }


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