diff options
Diffstat (limited to 'src/nfc/qqmlndefrecord.cpp')
-rw-r--r-- | src/nfc/qqmlndefrecord.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/nfc/qqmlndefrecord.cpp b/src/nfc/qqmlndefrecord.cpp index fd154d74..8a3f24d7 100644 --- a/src/nfc/qqmlndefrecord.cpp +++ b/src/nfc/qqmlndefrecord.cpp @@ -294,22 +294,17 @@ void QQmlNdefRecord::setType(const QString &newtype) } /*! - Sets the type name format of the NDEF record to \a typeNameFormat. + Sets the type name format of the NDEF record to \a newTypeNameFormat. */ -void QQmlNdefRecord::setTypeNameFormat(QQmlNdefRecord::TypeNameFormat typeNameFormat) +void QQmlNdefRecord::setTypeNameFormat(QQmlNdefRecord::TypeNameFormat newTypeNameFormat) { - Q_D(QQmlNdefRecord); - bool emitChanged = true; - if (static_cast<QQmlNdefRecord::TypeNameFormat>(d->record.typeNameFormat()) == typeNameFormat) { - emitChanged = false; - } + if (newTypeNameFormat == typeNameFormat()) + return; - //We always have to set the tnf, otherwise we run into problems when tnf is empty. Then - //the QNdefRecordPrivate is not created - d->record.setTypeNameFormat(static_cast<QNdefRecord::TypeNameFormat>(typeNameFormat)); + Q_D(QQmlNdefRecord); + d->record.setTypeNameFormat(static_cast<QNdefRecord::TypeNameFormat>(newTypeNameFormat)); - if (emitChanged) - Q_EMIT(typeNameFormatChanged()); + emit typeNameFormatChanged(); } /*! |