[gnome-games/wip/aplazas/781334-refactor-game-sources: 4/9] utils: Add Uri.from_uri_and_scheme()
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/aplazas/781334-refactor-game-sources: 4/9] utils: Add Uri.from_uri_and_scheme()
- Date: Sat, 6 May 2017 09:30:54 +0000 (UTC)
commit 0f15f2f6147be72cdd1b2c8a57844b140e673ae6
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.
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..670dbd2 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, sring 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]