[vala] gtkmodule: Respect "alias" attribute in gresource
- From: Daiki Ueno <dueno src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] gtkmodule: Respect "alias" attribute in gresource
- Date: Thu, 25 Dec 2014 02:14:12 +0000 (UTC)
commit 6c268a67864fe594371925549b6fc94cfb25314f
Author: Daiki Ueno <dueno src gnome org>
Date: Fri Dec 19 15:49:53 2014 +0900
gtkmodule: Respect "alias" attribute in gresource
Though undocumented, glib-compile-resources looks at "alias" attribute
of "file" element and maps the physical file name to a logical path
name.
https://bugzilla.gnome.org/show_bug.cgi?id=741743
codegen/valagtkmodule.vala | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagtkmodule.vala b/codegen/valagtkmodule.vala
index deb0704..ecc709f 100644
--- a/codegen/valagtkmodule.vala
+++ b/codegen/valagtkmodule.vala
@@ -70,16 +70,22 @@ public class Vala.GtkModule : GSignalModule {
int state = 0;
string prefix = null;
+ string alias = null;
MarkupTokenType current_token = reader.read_token (null, null);
while (current_token != MarkupTokenType.EOF) {
if (current_token == MarkupTokenType.START_ELEMENT && reader.name ==
"gresource") {
prefix = reader.get_attribute ("prefix");
} else if (current_token == MarkupTokenType.START_ELEMENT && reader.name ==
"file") {
+ alias = reader.get_attribute ("alias");
state = 1;
} else if (state == 1 && current_token == MarkupTokenType.TEXT) {
var name = reader.content;
- gresource_to_file_map.set (Path.build_filename (prefix, name),
Path.build_filename (gresource_dir, name));
+ var filename = Path.build_filename (gresource_dir, name);
+ if (alias != null) {
+ gresource_to_file_map.set (Path.build_filename (prefix,
alias), filename);
+ }
+ gresource_to_file_map.set (Path.build_filename (prefix, name),
filename);
state = 0;
}
current_token = reader.read_token (null, null);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]