diff options
Diffstat (limited to 'TelepathyQt/channel-request.cpp')
-rw-r--r-- | TelepathyQt/channel-request.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/TelepathyQt/channel-request.cpp b/TelepathyQt/channel-request.cpp index 3b138637..3189f499 100644 --- a/TelepathyQt/channel-request.cpp +++ b/TelepathyQt/channel-request.cpp @@ -153,8 +153,8 @@ void ChannelRequest::Private::introspectMain(ChannelRequest::Private *self) bool needIntrospectMainProps = false; const char *propertiesNames[] = { "Account", "UserActionTime", "PreferredHandler", "Requests", "Interfaces", - NULL }; - for (unsigned i = 0; propertiesNames[i] != NULL; ++i) { + nullptr }; + for (unsigned i = 0; propertiesNames[i] != nullptr; ++i) { key = TP_QT_IFACE_CHANNEL_REQUEST + QLatin1String("."); key += QLatin1String(propertiesNames[i]); if (!self->immutableProperties.contains(key)) { @@ -188,7 +188,7 @@ void ChannelRequest::Private::introspectMain(ChannelRequest::Private *self) void ChannelRequest::Private::extractMainProps(const QVariantMap &props, bool lastCall) { - PendingReady *readyOp = 0; + PendingReady *readyOp = nullptr; if (props.contains(QLatin1String("Account"))) { QDBusObjectPath accountObjectPath = @@ -225,7 +225,11 @@ void ChannelRequest::Private::extractMainProps(const QVariantMap &props, bool la // FIXME See http://bugs.freedesktop.org/show_bug.cgi?id=21690 uint stamp = (uint) qdbus_cast<qlonglong>(props.value(QLatin1String("UserActionTime"))); if (stamp != 0) { +#if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) userActionTime = QDateTime::fromTime_t(stamp); +#else + userActionTime = QDateTime::fromSecsSinceEpoch(stamp); +#endif } preferredHandler = qdbus_cast<QString>(props.value(QLatin1String("PreferredHandler"))); @@ -286,6 +290,7 @@ const Feature ChannelRequest::FeatureCore = Feature(QLatin1String(ChannelRequest /** * Create a new channel request object using the given \a bus and the given factories. * + * \param bus QDBusConnection to use. * \param objectPath The channel request object path. * \param immutableProperties The channel request immutable properties. * \param accountFactory The account factory to use. @@ -504,7 +509,11 @@ QVariantMap ChannelRequest::immutableProperties() const if (userActionTime().isValid()) { props.insert(TP_QT_IFACE_CHANNEL_REQUEST + QLatin1String(".UserActionTime"), +#if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) QVariant::fromValue(userActionTime().toTime_t())); +#else + QVariant::fromValue(userActionTime().toSecsSinceEpoch())); +#endif } if (!preferredHandler().isNull()) { @@ -746,7 +755,7 @@ ChannelRequestHints &ChannelRequestHints::operator=(const ChannelRequestHints &o bool ChannelRequestHints::isValid() const { - return mPriv.constData() != 0; + return mPriv.constData() != nullptr; } bool ChannelRequestHints::hasHint(const QString &reversedDomain, const QString &localName) const |