[Kde-bindings] KDE/kdebindings/csharp/qyoto/src

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Nov 29 11:36:01 UTC 2007


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 at 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;
+							}
+						}
 					}
 				}
 			}



More information about the Kde-bindings mailing list