[Kde-bindings] KDE/kdebindings/qtruby
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Wed Jul 5 15:01:31 UTC 2006
SVN commit 558553 by rdale:
* Added some marshallers for Qt 4.2, for QList<QGraphicsItem*>,
QList<QStandardItem*> and QList<QUndoStack*> types.
* The Ruby String to 'char *' and String to 'unsigned char *' were using
the pointer within the Ruby String directly which meant they were
deleted when the Ruby String was gc'd. So they are copied with
strdup () instead.
CCMAIL: kde-bindings at kde.org
M +9 -0 ChangeLog
M +20 -0 rubylib/qtruby/handlers.cpp
M +2 -2 rubylib/qtruby/marshall_primitives.h
--- trunk/KDE/kdebindings/qtruby/ChangeLog #558552:558553
@@ -1,3 +1,12 @@
+2006-07-05 Richard Dale <rdale at foton.es>
+
+ * Added some marshallers for Qt 4.2, for QList<QGraphicsItem*>,
+ QList<QStandardItem*> and QList<QUndoStack*> types.
+ * The Ruby String to 'char *' and String to 'unsigned char *' were using
+ the pointer within the Ruby String directly which meant they were
+ deleted when the Ruby String was gc'd. So they are copied with
+ strdup () instead.
+
2006-06-26 Richard Dale <rdale at foton.es>
* Applied a fix from Cvetoslav Ludmiloff to make
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/handlers.cpp #558552:558553
@@ -42,6 +42,12 @@
#include <QtGui/qtabbar.h>
#include <QtCore/qhash.h>
+#if QT_VERSION >= 0x40200
+#include <QtGui/qgraphicsitem.h>
+#include <QtGui/qstandarditemmodel.h>
+#include <QtGui/qundostack.h>
+#endif
+
#include "smoke.h"
#undef DEBUG
@@ -1662,6 +1668,12 @@
DEF_LIST_MARSHALLER( QTextFrameList, QList<QTextFrame*>, QTextFrame )
DEF_LIST_MARSHALLER( QTreeWidgetItemList, QList<QTreeWidgetItem*>, QTreeWidgetItem )
+#if QT_VERSION >= 0x40200
+DEF_LIST_MARSHALLER( QGraphicsItemList, QList<QGraphicsItem*>, QGraphicsItem )
+DEF_LIST_MARSHALLER( QStandardItemList, QList<QStandardItem*>, QStandardItem )
+DEF_LIST_MARSHALLER( QUndoStackList, QList<QUndoStack*>, QUndoStack )
+#endif
+
template <class Item, class ItemList, const char *ItemSTR >
void marshall_ValueListItem(Marshall *m) {
switch(m->action()) {
@@ -1889,6 +1901,14 @@
{ "QObjectList", marshall_QObjectList },
{ "QObjectList&", marshall_QObjectList },
{ "QFileInfoList", marshall_QFileInfoList },
+#if QT_VERSION >= 0x40200
+ { "QList<QGraphicsItem*>", marshall_QGraphicsItemList },
+ { "QList<QGraphicsItem*>&", marshall_QGraphicsItemList },
+ { "QList<QStandardItem*>", marshall_QStandardItemList },
+ { "QList<QStandardItem*>&", marshall_QStandardItemList },
+ { "QList<QUndoStack*>", marshall_QUndoStackList },
+ { "QList<QUndoStack*>&", marshall_QUndoStackList },
+#endif
{ 0, 0 }
};
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/marshall_primitives.h #558552:558553
@@ -191,7 +191,7 @@
if(v == Qnil)
return 0;
- return StringValuePtr(v);
+ return strdup(StringValuePtr(v));
}
template <>
@@ -200,7 +200,7 @@
if(v == Qnil)
return 0;
- return (unsigned char*)StringValuePtr(v);
+ return (unsigned char*) strdup(StringValuePtr(v));
}
template <>
More information about the Kde-bindings
mailing list