SVN commit 742941 by rdale:
* Look for enums of type 'int' in GetCPPEnumValue() but
return them as 'uint's as
that is the type of an Q_FLAGS arguments
CCMAIL: kde-bindings kde.org
M +12 -4 Qyoto.cs
--- trunk/KDE/kdebindings/csharp/qyoto/src/Qyoto.cs
#742940:742941
 -130,11
+130,19 
return 0;
}
foreach (Type nt in t.GetNestedTypes()) {
- if (nt.IsEnum && Enum.GetUnderlyingType(nt) ==
typeof(uint)) {
- foreach (uint i in Enum.GetValues(nt)) {
- if (Enum.Format(nt, i, "f") == value) {
- return (uint) i;
+ if (nt.IsEnum) {
+ if (Enum.GetUnderlyingType(nt) == typeof(uint)) {
+ foreach (uint i in Enum.GetValues(nt)) {
+ if (Enum.Format(nt, i, "f") == value) {
+ return i;
+ }
}
+ } else if (Enum.GetUnderlyingType(nt) == typeof(int))
{
+ foreach (int i in Enum.GetValues(nt)) {
+ if (Enum.Format(nt, i, "f") == value) {
+ return (uint) i;
+ }
+ }
}
}
}
_______________________________________________
Kde-bindings mailing list
Kde-bindings kde.org
ht
tps://mail.kde.org/mailman/listinfo/kde-bindings
|