List Info

Thread: KDE/kdebindings/csharp/qyoto/src




KDE/kdebindings/csharp/qyoto/src
user name
2007-11-29 05:36:01
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-bindingskde.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-bindingskde.org
ht
tps://mail.kde.org/mailman/listinfo/kde-bindings

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )