In KDElibs4 KAuth::ActionReply::errorCode returned an int.
errorCode was documented as
"The error code returned is one of the values in the ActionReply::Error
enumeration if type() == KAuthError, or is totally application-dependent
type() == HelperError. It also should be zero for successful replies."
In frameworks that documentation is exactly the same, however
setErrorCode and errorCode were changed to only use
the enum values in ActionReply::Error as an argument, which goes against
the documentation and is only meant to be used for internal errors, not
Worst this leads to broken error reporting, because if one uses the new
HelperError static constructor, we have type==HelperError, but errorCode
is still 0.
This means ActionReply::failed is true, but at a KJob level, we think
the action succeeded.
Some clients are working round this by either static casting or by
incorrectly using the ActionReply::Error codes which are meant purely
for backend errors not helper errors.
Others are simply failing to report errors.
We need a fix that will support the clients which are passing an error
code back, and also fix clients which are just using
This patch reintroduces the method as an integer, but changing the name
for compatibility reasons. Also a new static constructor is created that
allows one to set an error code when the AuthReply type is HelperError.
There's @param but the argument doesn't have a name.