diff options
author | Paulo Alcantara <pcacjr@gmail.com> | 2012-01-09 18:24:56 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-09 16:50:33 -0300 |
commit | eb2614d3ac818a6e2dfe85b1d1b98408f2d37f06 (patch) | |
tree | 67f2dcc1c1339ad0104b78cb9fac918b2185b55e /tests/libsample | |
parent | 633836a403355d2bc245819aab07f29b05ac901f (diff) |
Fix BUG #1105 - "Spyder fails with HEAD"
When handling typedef'd primitive types we don't need to create indices
for them, nor converters. Instead, we must use the underlying primitive
type converters.
See http://bugs.pyside.org/show_bug.cgi?id=1105.
Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org>
Reviewed-by: Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'tests/libsample')
-rw-r--r-- | tests/libsample/handle.cpp | 9 | ||||
-rw-r--r-- | tests/libsample/handle.h | 20 |
2 files changed, 23 insertions, 6 deletions
diff --git a/tests/libsample/handle.cpp b/tests/libsample/handle.cpp index 3fe91124a..60d2ef81c 100644 --- a/tests/libsample/handle.cpp +++ b/tests/libsample/handle.cpp @@ -1,7 +1,7 @@ /* * This file is part of the Shiboken Python Binding Generator project. * - * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (C) 2011-2012 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * @@ -17,7 +17,7 @@ * * 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 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "handle.h" @@ -31,3 +31,8 @@ bool HandleHolder::compare(HandleHolder* other) { return other->m_handle == m_handle; } + +bool HandleHolder::compare2(HandleHolder* other) +{ + return other->m_handle2 == m_handle2; +} diff --git a/tests/libsample/handle.h b/tests/libsample/handle.h index c75f3e46a..15fcc36d4 100644 --- a/tests/libsample/handle.h +++ b/tests/libsample/handle.h @@ -1,7 +1,7 @@ /* * This file is part of the Shiboken Python Binding Generator project. * - * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (C) 2010-2012 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * @@ -17,7 +17,7 @@ * * 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 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef HANDLE_H @@ -25,6 +25,11 @@ #include "libsamplemacros.h" +/* See http://bugs.pyside.org/show_bug.cgi?id=1105. */ +namespace Foo { + typedef unsigned long HANDLE; +} + class LIBSAMPLE_API OBJ { }; @@ -35,13 +40,20 @@ class LIBSAMPLE_API HandleHolder { public: explicit HandleHolder(HANDLE ptr = 0) : m_handle(ptr) {} - void set(HANDLE ptr) { m_handle = m_handle; } - HANDLE get() { return m_handle; } + explicit HandleHolder(Foo::HANDLE val = 0): m_handle2(val) {} + + inline void set(HANDLE ptr) { m_handle = m_handle; } + inline void set(const Foo::HANDLE& val) { m_handle2 = val; } + inline HANDLE handle() { return m_handle; } + inline Foo::HANDLE handle2() { return m_handle2; } static HANDLE createHandle(); bool compare(HandleHolder* other); + bool compare2(HandleHolder* other); + private: HANDLE m_handle; + Foo::HANDLE m_handle2; }; struct LIBSAMPLE_API PrimitiveStruct {}; |