[REQ] [Qt5] Emit a generic signal anytime an api call is completed
Created by: xconverge
The current callback in the API interface emits signals specific to the API, for example
if (worker->error_type == QNetworkReply::NoError) {
emit createUsersWithArrayInputSignal();
emit createUsersWithArrayInputSignalFull(worker);
} else {
emit createUsersWithArrayInputSignalE(error_type, error_str);
emit createUsersWithArrayInputSignalEFull(worker, error_type, error_str);
}
From the outside we can then connect to these signals
The API has different signals per function call.
I would like to be able to know if the API did "any work" not just some "specific work"
For example I would add a signal called void workDone()
if (worker->error_type == QNetworkReply::NoError) {
emit createUsersWithArrayInputSignal();
emit createUsersWithArrayInputSignalFull(worker);
} else {
emit createUsersWithArrayInputSignalE(error_type, error_str);
emit createUsersWithArrayInputSignalEFull(worker, error_type, error_str);
}
emit workDone();
if (worker->error_type == QNetworkReply::NoError) {
emit createUsersWithListInputSignal();
emit createUsersWithListInputSignalFull(worker);
} else {
emit createUsersWithListInputSignalE(error_type, error_str);
emit createUsersWithListInputSignalEFull(worker, error_type, error_str);
}
emit workDone();
and this would be added to ALL of the callback functions. From the outside then we could connect to know if the API class has done anything yet without needing to connect to a whole bunch of individual signals
This would be trivial for me to add so I wanted to open it up for discussion before just adding a PR