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:
parent
1e795ae8b6
commit
90db983c30
358 changed files with 3785 additions and 322 deletions
|
@ -69,7 +69,20 @@ namespace DTO {
|
|||
|
||||
class BaseItemDto {
|
||||
public:
|
||||
BaseItemDto();
|
||||
BaseItemDto(
|
||||
QString jellyfinId,
|
||||
Video3DFormat video3DFormat,
|
||||
PlayAccess playAccess,
|
||||
QSharedPointer<UserItemDataDto> userData,
|
||||
VideoType videoType,
|
||||
LocationType locationType,
|
||||
IsoType isoType,
|
||||
ImageOrientation imageOrientation,
|
||||
ChannelType channelType,
|
||||
ProgramAudio audio,
|
||||
QSharedPointer<BaseItemDto> currentProgram
|
||||
);
|
||||
|
||||
BaseItemDto(const BaseItemDto &other);
|
||||
|
||||
/**
|
||||
|
@ -1700,8 +1713,13 @@ protected:
|
|||
std::optional<bool> m_isPremiere = std::nullopt;
|
||||
QString m_timerId;
|
||||
QSharedPointer<BaseItemDto> m_currentProgram = QSharedPointer<BaseItemDto>();
|
||||
|
||||
private:
|
||||
// Private constructor which generates an invalid object, for use withing BaseItemDto::fromJson();
|
||||
BaseItemDto();
|
||||
};
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue