summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-11-18 17:42:00 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-11-18 18:48:35 -0200
commit71d279c0406030faa97927f510e2b2f802daf794 (patch)
tree6626341cb5bae5c0dd86f24bb8332691503d6b9a
parent090e4a6525c5469b2f257eb978ae74b1b8df5ffc (diff)
downloadpyside-71d279c0406030faa97927f510e2b2f802daf794.tar.gz
pyside-71d279c0406030faa97927f510e2b2f802daf794.tar.xz
pyside-71d279c0406030faa97927f510e2b2f802daf794.zip
Uses QByteArray instead of QString to avoid data copy.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
-rw-r--r--libpyside/dynamicqmetaobject.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
index adb05d7..14fbe86 100644
--- a/libpyside/dynamicqmetaobject.cpp
+++ b/libpyside/dynamicqmetaobject.cpp
@@ -136,20 +136,14 @@ static bool isQRealType(const char *type)
/*
* Avoid API break keep this on cpp
*/
-static int maxSlotsCount(const QString& className)
+static int maxSlotsCount(const QByteArray& className)
{
- int maxSlots = MAX_SLOTS_COUNT;
- if (className == GLOBAL_RECEIVER_CLASS_NAME)
- maxSlots = MAX_GLOBAL_SIGNALS_COUNT;
- return maxSlots;
+ return className == GLOBAL_RECEIVER_CLASS_NAME ? MAX_GLOBAL_SIGNALS_COUNT : MAX_SLOTS_COUNT;
}
-static int maxSignalsCount(const QString& className)
+static int maxSignalsCount(const QByteArray& className)
{
- int maxSignals = MAX_SIGNALS_COUNT;
- if (className == GLOBAL_RECEIVER_CLASS_NAME)
- maxSignals = MAX_GLOBAL_SIGNALS_COUNT;
- return maxSignals;
+ return className == GLOBAL_RECEIVER_CLASS_NAME ? MAX_GLOBAL_SIGNALS_COUNT : MAX_SIGNALS_COUNT;
}
uint PropertyData::flags() const
@@ -296,7 +290,7 @@ DynamicQMetaObject::DynamicQMetaObject(const char* className, const QMetaObject*
d.stringdata = 0;
d.data = 0;
d.extradata = 0;
- m_d->m_className = QByteArray(className);
+ m_d->m_className = className;
m_d->updateMetaObject(this);
}