When using KAuth::ActionReply class, the setErrorCode function is used to set a custom error code whenever the ActionReply object is set to type HelperErrorType, however, such function does not allow to set such custom error code and instead asks for one of the (libabry internal) error codes designated for when the type is KAuthErrorType. Reproducible: Always Steps to Reproduce: 1. Instantiate a KAuth::ActionReply object: KAuth::ActionReply reply, 2. Set the reply object to an empty HelperErrorType: reply = KAuth::ActionReply::HelperErrorReply(); 3. Set the custom error code: reply.setErrorCode(myerrorcode); Actual Results: Compiler error, as the setErrorCode function receives a KAuth::ActionReply::Error instead of a uint. Expected Results: The setErrorCode function should receive a uint instead of a KAuth::ActionReply::Error so the code can compile. The KAuthActionReply header contains an example of the described usage: @code ActionReply MyHelper::read(QVariantMap args) { ActionReply reply; QString filename = args["filename"].toString(); QFile file(filename); if (!file.open(QIODevice::ReadOnly)) { reply = ActionReply::HelperErrorReply; reply.setErrorCode(file.error()); return reply; } QTextStream stream(&file); QString contents; stream >> contents; reply.data()["contents"] = contents; return reply; } @endcode But the code itself does not honor such functionality, so two things might be broken here, the function itself or the example provided in the header file.
Created attachment 96017 [details] Proposed fix
I'm pretty sure the way this is meant to work is that you make a helper error reply and set whatever you want in the data of the reply. That is 100% flexible. We do not treat enums as int in modern c++ so changing this is a firm no.