[Kde-bindings] KDE/kdebindings/csharp
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Thu Jun 19 09:36:22 UTC 2008
SVN commit 822128 by rdale:
* If SmokeMarshallers.CreateInstance() couldn't find a C# class with
the name passed to it, it just crashed. So output an error message
so it is obvious what is going on.
* The names of the C# classes were not being set up correctly in the
C++ to C# name maps.
CCMAIL: kde-bindings at kde.org
M +8 -6 khtml/src/khtml.cpp
M +13 -6 kimono/src/kimono.cpp
M +3 -6 plasma/src/plasma.cpp
M +8 -0 qyoto/ChangeLog
M +5 -0 qyoto/src/SmokeMarshallers.cs
M +8 -6 qyoto/src/qyoto.cpp
--- trunk/KDE/kdebindings/csharp/khtml/src/khtml.cpp #822127:822128
@@ -54,14 +54,16 @@
{
init_khtml_Smoke();
khtml_Smoke->binding = new QyotoSmokeBinding(khtml_Smoke, &classNames);
- QString prefix("KHTML.");
- QString className;
- QByteArray classStringName;
+ QByteArray prefix("Kimono.");
for (int i = 1; i <= khtml_Smoke->numClasses; i++) {
- className = prefix + khtml_Smoke->classes[i].className;
- classStringName = className.toLatin1();
- classNames.insert(i, strdup(classStringName.constData()));
+ QByteArray name(khtml_Smoke->classes[i].className);
+ name.replace("::", ".");
+ if (!name.startsWith("KParts") && !name.startsWith("DOM")) {
+ name = prefix + name;
+ }
+
+ classNames.insert(i, strdup(name.constData()));
}
QyotoModule module = { "KHTML", resolve_classname_khtml, IsContainedInstanceKHTML };
--- trunk/KDE/kdebindings/csharp/kimono/src/kimono.cpp #822127:822128
@@ -54,14 +54,21 @@
{
init_kde_Smoke();
kde_Smoke->binding = new QyotoSmokeBinding(kde_Smoke, &classNames);
- QString prefix("Kimono.");
- QString className;
- QByteArray classStringName;
+ QByteArray prefix("Kimono.");
for (int i = 1; i <= kde_Smoke->numClasses; i++) {
- className = prefix + kde_Smoke->classes[i].className;
- classStringName = className.toLatin1();
- classNames.insert(i, strdup(classStringName.constData()));
+ QByteArray name(kde_Smoke->classes[i].className);
+ name.replace("::", ".");
+ if ( !name.startsWith("KParts")
+ && !name.startsWith("Sonnet")
+ && !name.startsWith("KIO")
+ && !name.startsWith("KWallet")
+ && !name.startsWith("KNS") )
+ {
+ name = prefix + name;
+ }
+
+ classNames.insert(i, strdup(name.constData()));
}
QyotoModule module = { "Kimono", resolve_classname_KDE, IsContainedInstanceKDE };
--- trunk/KDE/kdebindings/csharp/plasma/src/plasma.cpp #822127:822128
@@ -54,14 +54,11 @@
{
init_plasma_Smoke();
plasma_Smoke->binding = new QyotoSmokeBinding(plasma_Smoke, &classNames);
- QString prefix("Plasma.");
- QString className;
- QByteArray classStringName;
for (int i = 1; i <= plasma_Smoke->numClasses; i++) {
- className = prefix + plasma_Smoke->classes[i].className;
- classStringName = className.toLatin1();
- classNames.insert(i, strdup(classStringName.constData()));
+ QByteArray name(khtml_Smoke->classes[i].className);
+ name.replace("::", ".");
+ classNames.insert(i, strdup(name.constData()));
}
QyotoModule module = { "Plasma", resolve_classname_Plasma, IsContainedInstancePlasma };
--- trunk/KDE/kdebindings/csharp/qyoto/ChangeLog #822127:822128
@@ -1,3 +1,11 @@
+2008-06-19 Richard Dale <richard.j.dale at gmail.com>
+
+ * If SmokeMarshallers.CreateInstance() couldn't find a C# class with
+ the name passed to it, it just crashed. So output an error message
+ so it is obvious what is going on.
+ * The names of the C# classes were not being set up correctly in the
+ C++ to C# name maps.
+
2008-06-18 Richard Dale <richard.j.dale at gmail.com>
* Don't convert QChars to C# chars, keep them as QChars
--- trunk/KDE/kdebindings/csharp/qyoto/src/SmokeMarshallers.cs #822127:822128
@@ -515,6 +515,11 @@
if (t != null)
data = GetSmokeClassData(t);
}
+
+ if (data == null) {
+ Console.Error.WriteLine("CreateInstance() ** Missing class ** {0}", className);
+ }
+
object result = data.constructorInfo.Invoke(data.constructorParamTypes);
#if DEBUG
if ((QDebug.DebugChannel() & QtDebugChannel.QTDB_GC) != 0) {
--- trunk/KDE/kdebindings/csharp/qyoto/src/qyoto.cpp #822127:822128
@@ -880,14 +880,16 @@
init_qt_Smoke();
qt_Smoke->binding = new QyotoSmokeBinding(qt_Smoke, &classname);
install_handlers(Qt_handlers);
- QString classPrefix("Qyoto.");
- QString className;
- QByteArray classStringName;
+ QByteArray prefix("Qyoto.");
for (int i = 1; i <= qt_Smoke->numClasses; i++) {
- className = classPrefix + qt_Smoke->classes[i].className;
- classStringName = className.toLatin1();
- classname.insert(i, strdup(classStringName.constData()));
+ QByteArray name(qt_Smoke->classes[i].className);
+ name.replace("::", ".");
+ if (name != "QAccessible2" && name != "QDBus" && name != "QGL" && name != "QSql" && name != "QSsl") {
+ name = prefix + name;
+ }
+
+ classname.insert(i, strdup(name.constData()));
}
QyotoModule module = { "Qyoto", resolve_classname_Qt, IsContainedInstanceQt };
More information about the Kde-bindings
mailing list