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

Arno Rehn kde at arnorehn.de
Tue Dec 23 13:38:07 UTC 2008


SVN commit 900736 by arnorehn:

* Add a QList<const char*> marshaller. For the moment it only works in the
  'ToObject' direction.

CCMAIL: kde-bindings at kde.org



 M  +5 -0      ChangeLog  
 M  +28 -0     src/handlers.cpp  


--- trunk/KDE/kdebindings/csharp/qyoto/ChangeLog #900735:900736
@@ -1,3 +1,8 @@
+2008-12-23  Arno Rehn  <arno at arnorehn.de>
+
+	* Add a QList<const char*> marshaller. For the moment it only works in the
+	  'ToObject' direction.
+
 2008-12-20  Arno Rehn  <arno at arnorehn.de>
 
 	* Revert pointerMap to a Dictionary. The crash that was reported by Eric
--- trunk/KDE/kdebindings/csharp/qyoto/src/handlers.cpp #900735:900736
@@ -1728,6 +1728,32 @@
     }
 }
 
+void marshall_QListConstCharP(Marshall *m) {
+	switch (m->action()) {
+    case Marshall::FromObject:
+	{
+		m->unsupported();
+	}
+	break;
+	case Marshall::ToObject:
+	{
+		QList<const char*> *list = static_cast<QList<const char*>*>(m->item().s_voidp);
+		void* al = (*ConstructList)("System.String");
+		for (int i = 0; i < list->size(); i++) {
+			(*AddIntPtrToList)(al, (*IntPtrFromCharStar)(const_cast<char*>(list->at(i))));
+		}
+		m->var().s_voidp = al;
+		m->next();
+		if (m->cleanup())
+			delete list;
+	}
+	break;
+	default:
+		m->unsupported();
+		break;
+	}
+}
+
 DEF_LIST_MARSHALLER( QAbstractButtonList, QList<QAbstractButton*>, QAbstractButton )
 DEF_LIST_MARSHALLER( QActionGroupList, QList<QActionGroup*>, QActionGroup )
 DEF_LIST_MARSHALLER( QActionList, QList<QAction*>, QAction )
@@ -1860,6 +1886,8 @@
     { "QDBusVariant", marshall_QDBusVariant },
     { "QDBusVariant&", marshall_QDBusVariant },
     { "QFileInfoList", marshall_QFileInfoList },
+    { "QList<const char*>", marshall_QListConstCharP },
+    { "QList<const char*>&", marshall_QListConstCharP },
     { "QList<int>", marshall_QListInt },
     { "QList<int>&", marshall_QListInt },
     { "QList<QAbstractButton*>", marshall_QAbstractButtonList },



More information about the Kde-bindings mailing list