summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-08-03 16:19:51 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-08-03 18:53:54 -0300
commit39d9b90429441f95f35fb50926ca429cf809f7a6 (patch)
tree8a19c4e5db05c2e8d6c7899353d6d3c4a77b65e3
parent8bf041b71335f51bd08b59bc89828311ad810468 (diff)
downloadpyside-39d9b90429441f95f35fb50926ca429cf809f7a6.tar.gz
pyside-39d9b90429441f95f35fb50926ca429cf809f7a6.tar.xz
pyside-39d9b90429441f95f35fb50926ca429cf809f7a6.zip
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 2796708..724d506 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 db38f45..bffc042 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 ab3f1ef..6acbdef 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 9c2be1e..4abe6ac 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 47eda60..0000000
--- 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
-