X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fsyncableobject.cpp;h=0a142037bfcb645cd152f3ce52a3a018a5b984c7;hp=1b907c71be130b82a5feea0c320282a8381e70b1;hb=40601ae070413b727a68e35e5b8c619176c661b1;hpb=694f9bfbf7f1af19108461c7e00d133e55082bce diff --git a/src/common/syncableobject.cpp b/src/common/syncableobject.cpp index 1b907c71..0a142037 100644 --- a/src/common/syncableobject.cpp +++ b/src/common/syncableobject.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-09 by the Quassel Project * + * Copyright (C) 2005-2014 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include @@ -114,13 +114,17 @@ QVariantMap SyncableObject::toVariantMap() QVariant::Type variantType = QVariant::nameToType(method.typeName()); if (variantType == QVariant::Invalid && !QByteArray(method.typeName()).isEmpty()) { +#if QT_VERSION >= 0x050000 + qWarning() << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.methodSignature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName()); +#else qWarning() << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.signature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName()); +#endif continue; } QVariant value(variantType, (const void *)0); QGenericReturnArgument genericvalue = QGenericReturnArgument(method.typeName(), value.data()); - QMetaObject::invokeMethod(this, methodname.toAscii(), genericvalue); + QMetaObject::invokeMethod(this, methodname.toLatin1(), genericvalue); properties[SignalProxy::ExtendedMetaObject::methodBaseName(method)] = value; } @@ -141,12 +145,12 @@ void SyncableObject::fromVariantMap(const QVariantMap &properties) continue; } - int propertyIndex = meta->indexOfProperty(propName.toAscii()); + int propertyIndex = meta->indexOfProperty(propName.toLatin1()); if (propertyIndex == -1 || !meta->property(propertyIndex).isWritable()) setInitValue(propName, iterator.value()); else - setProperty(propName.toAscii(), iterator.value()); + setProperty(propName.toLatin1(), iterator.value()); // qDebug() << "<<< SYNC:" << name << iterator.value(); iterator++; } @@ -159,9 +163,9 @@ bool SyncableObject::setInitValue(const QString &property, const QVariant &value handlername[7] = handlername[7].toUpper(); QString methodSignature = QString("%1(%2)").arg(handlername).arg(value.typeName()); - int methodIdx = metaObject()->indexOfMethod(methodSignature.toAscii().constData()); + int methodIdx = metaObject()->indexOfMethod(methodSignature.toLatin1().constData()); if (methodIdx < 0) { - QByteArray normedMethodName = QMetaObject::normalizedSignature(methodSignature.toAscii().constData()); + QByteArray normedMethodName = QMetaObject::normalizedSignature(methodSignature.toLatin1().constData()); methodIdx = metaObject()->indexOfMethod(normedMethodName.constData()); } if (methodIdx < 0) { @@ -169,7 +173,7 @@ bool SyncableObject::setInitValue(const QString &property, const QVariant &value } QGenericArgument param(value.typeName(), value.constData()); - return QMetaObject::invokeMethod(this, handlername.toAscii(), param); + return QMetaObject::invokeMethod(this, handlername.toLatin1(), param); }