1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-04 01:42:44 +00:00

Fix sending of DeviceProfileInfo

Due to some errors within DeviceProfile and how nullables were
serialized, an invalid request was made and the
/Sessions/Capabilities/Full would give an 400 response back.

Besides that, ApiClient would generate a DeviceProfile before all
properties from QML were read. This has been fixed by implementing
QQmlParserStatus and only generating the device profile after all
properties are set.
This commit is contained in:
Henk Kalkwater 2021-09-08 23:20:12 +02:00
parent 8a9cb73686
commit 357ac89330
No known key found for this signature in database
GPG key ID: A69C050E9FD9FF6A
198 changed files with 5889 additions and 1761 deletions

View file

@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <QHostInfo>
#include <QObject>
#include <QQmlListProperty>
#include <QQmlParserStatus>
#include <QScopedPointer>
#include <QString>
#include <QSysInfo>
@ -85,10 +86,11 @@ class ApiClientPrivate;
*
* These steps might change. I'm considering decoupling CredentialsManager from this class to clean some code up.
*/
class ApiClient : public QObject {
class ApiClient : public QObject, public QQmlParserStatus {
friend class WebSocket;
friend class PlaybackManager;
Q_OBJECT
Q_INTERFACES(QQmlParserStatus)
Q_DECLARE_PRIVATE(ApiClient);
public:
explicit ApiClient(QObject *parent = nullptr);
@ -240,6 +242,9 @@ protected slots:
void credManagerUsersListed(const QString &server, QStringList users);
void credManagerTokenRetrieved(const QString &server, const QString &user, const QString &token);
void classBegin() override;
void componentComplete() override;
protected:
/**
* @brief Adds default headers to each request, like authentication headers etc.