aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-08-03 16:19:51 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:42 -0300
commitfae2dfd9b1bc948b72b4a34469a6e0e08e12a30f (patch)
tree22f7324462f64719b8208747209e4059057ae863
parentd129ca02f607068ded1ed6d073c20b56a3e9a276 (diff)
Moved AutoArrayPointer from libpyside to libshiboken.
Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml8
-rw-r--r--PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp2
-rw-r--r--PySide/QtNetwork/typesystem_network.xml12
-rw-r--r--PySide/typesystem_templates.xml2
-rw-r--r--libpyside/autoarraypointer.h46
5 files changed, 4 insertions, 66 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 279670898..724d50630 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -3257,10 +3257,6 @@
<!-- TODO: Support conversions on virtual function -->
<modify-function signature="drawItems(QPainter*, int, QGraphicsItem**, const QStyleOptionGraphicsItem*)">
- <extra-includes>
- <include file-name="autoarraypointer.h" location="global"/>
- </extra-includes>
-
<modify-argument index="2">
<remove-argument/>
<conversion-rule class="native">
@@ -3272,7 +3268,7 @@
<replace-type modified-type="PySequence"/>
<conversion-rule class="native">
int numItems = PySequence_Size(%PYARG_1);
- PySide::AutoArrayPointer&lt;QGraphicsItem*&gt; %out(numItems);
+ Shiboken::AutoArrayPointer&lt;QGraphicsItem*&gt; %out(numItems);
for (int i=0; i &lt; numItems; i++) {
%out[i] = %CONVERTTOCPP[QGraphicsItem*](PySequence_Fast_GET_ITEM(%PYARG_1, i));
}
@@ -3299,7 +3295,7 @@
<conversion-rule class="native">
int numOptions = PySequence_Size(%PYARG_2);
- PySide::AutoArrayPointer&lt;QStyleOptionGraphicsItem&gt; %out(numOptions);
+ Shiboken::AutoArrayPointer&lt;QStyleOptionGraphicsItem&gt; %out(numOptions);
for (int i=0; i &lt; numOptions; i++) {
%out[i] = %CONVERTTOCPP[QStyleOptionGraphicsItem](PySequence_Fast_GET_ITEM(%PYARG_1, i));
}
diff --git a/PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp b/PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp
index db38f4526..bffc042d5 100644
--- a/PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp
+++ b/PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp
@@ -1,4 +1,4 @@
- PySide::AutoArrayPointer<char> data(%ARGUMENT_NAMES);
+ Shiboken::AutoArrayPointer<char> data(%ARGUMENT_NAMES);
QHostAddress ha;
quint16 port;
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index ab3f1efd1..6acbdef27 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -53,10 +53,6 @@
<enum-type name="State"/>
<enum-type name="TransferMode"/>
<enum-type name="TransferType"/>
- <extra-includes>
- <include file-name="autoarraypointer.h" location="global"/>
- </extra-includes>
-
<modify-function signature="connectToHost(const QString&amp;, quint16)" allow-thread="yes" />
<modify-function signature="login(const QString&amp;, const QString&amp;)" allow-thread="yes" />
<modify-function signature="close()" allow-thread="yes" />
@@ -88,10 +84,6 @@
<enum-type name="ConnectionMode"/>
<enum-type name="Error"/>
<enum-type name="State"/>
- <extra-includes>
- <include file-name="autoarraypointer.h" location="global"/>
- </extra-includes>
-
<modify-function signature="readAll()" allow-thread="yes"/>
<modify-function signature="read(char*, qint64)" allow-thread="yes">
<modify-argument index="return">
@@ -129,10 +121,6 @@
<object-type name="QTcpSocket"/>
<object-type name="QUdpSocket">
<enum-type name="BindFlag" flags="BindMode"/>
- <extra-includes>
- <include file-name="autoarraypointer.h" location="global"/>
- </extra-includes>
-
<modify-function signature="readDatagram(char*, qint64, QHostAddress*, quint16*)" allow-thread="yes">
<modify-argument index="1">
<remove-argument/>
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index 9c2be1e7f..4abe6ac38 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -189,7 +189,7 @@
%PYARG_0 = Shiboken::makeTuple(a, b, c, d, e);
</template>
<template name="read_wrapper">
- PySide::AutoArrayPointer&lt;char&gt; _data(%2);
+ Shiboken::AutoArrayPointer&lt;char&gt; _data(%2);
qint64 _size = %CPPSELF.%FUNCTION_NAME(_data, %2);
if (_size > 0)
%PYARG_0 = %CONVERTTOPYTHON[QByteArray](QByteArray(_data, _size));
diff --git a/libpyside/autoarraypointer.h b/libpyside/autoarraypointer.h
deleted file mode 100644
index 47eda60b0..000000000
--- a/libpyside/autoarraypointer.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * This file is part of the PySide project.
- *
- * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
- *
- * Contact: PySide team <contact@pyside.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AUTOARRAYPOINTER_H
-#define AUTOARRAYPOINTER_H
-
-
-namespace PySide
-{
-
-template<class T>
-class AutoArrayPointer
-{
- public:
- AutoArrayPointer(int size) { data = new T[size]; }
- T& operator[](int pos) { return data[pos]; }
- operator T*() const { return data; }
- ~AutoArrayPointer() { delete[] data; }
- private:
- T* data;
-};
-
-} //namespace PySide
-
-
-#endif // AUTOARRAYPOINTER_H
-