-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible loss of time-zone information from KDDateTime arguments #123
Comments
The problem is that such overloads would have to be added in I think it would be better to provide a conversion operator to |
Adding a conversion operator to |
The test currently fails due to issue KDAB#123
This prevents implicit conversion to base QDateTime and loss of time-zone information when passing the value as QVariant. Fixes KDAB#123.
The test currently fails due to issue KDAB#123
This prevents implicit conversion to base QDateTime and loss of time-zone information when passing the value as QVariant. Fixes KDAB#123.
As a work-around to #122, one may try to construct a KDDateTime object and explicitly set its timezone via KDDateTime::setTimeZone() method. However, this information may get lost when object is passed to a remote-method call request:
Running the above example (compiled with Qt5) results in the following request:
As can be seen, the explicitly-set time-zone string was lost. The issue here is that KDSoapValueList::addArgument() will implicitly construct a QVariant, and in the above example, it will use the QVariant::QVariant(const QDateTime &) constructor. So the variant actually stores a QDateTime, and during serialization goes through the following case:
KDSoap/src/KDSoapClient/KDSoapValue.cpp
Line 179 in 57cccea
which constructs a new KDDateTime object without time-zone information.
The above issue is avoided by explicitly constructing QVariant:
data.addArgument("TimeStampU", QVariant::fromValue(currentUtc));
and could be addressed in the library by providing an overload of KDSoapValueList::addArgument() for KDDateTime, which would take care of explicit QVariant construction.
The text was updated successfully, but these errors were encountered: