1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-05 10:12:46 +00:00

Replace not-fully-initializing DTO constructors

There were some constructors in the DTOs which allowed construction of
DTO which weren't fully initialized. These constructors have been made
private, as they are still used in the 'fromJson' methods. Additionally,
a constructor with all required parameters to fully initialize the
class has been added.

Additionally, the Loader class has been modified, since it no longer can
assume it is able to default construct the parameter type. The parameter
is now stored as an optional.

Closes #15
This commit is contained in:
Chris Josten 2021-09-25 16:54:33 +02:00
parent 1e795ae8b6
commit 90db983c30
358 changed files with 3785 additions and 322 deletions

View file

@ -49,7 +49,11 @@ namespace DTO {
class PlayRequestDto {
public:
PlayRequestDto();
PlayRequestDto(
qint32 playingItemPosition,
qint64 startPositionTicks
);
PlayRequestDto(const PlayRequestDto &other);
/**
@ -96,8 +100,13 @@ protected:
QStringList m_playingQueue;
qint32 m_playingItemPosition;
qint64 m_startPositionTicks;
private:
// Private constructor which generates an invalid object, for use withing PlayRequestDto::fromJson();
PlayRequestDto();
};
} // NS DTO
namespace Support {