mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-04 01:42:44 +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
|
@ -40,8 +40,13 @@ public:
|
|||
using BaseItemDto::userData;
|
||||
/**
|
||||
* @brief Constructor that creates an empty item.
|
||||
*
|
||||
Item(QObject *parent = nullptr);*/
|
||||
|
||||
/**
|
||||
* Creates an "empty" item
|
||||
*/
|
||||
Item(QObject *parent = nullptr);
|
||||
Item(ApiClient *apiClient = nullptr, QObject *parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Copies the data from the DTO into this model and attaches an ApiClient
|
||||
|
|
|
@ -27,7 +27,8 @@ namespace Model {
|
|||
class User : public DTO::UserDto {
|
||||
|
||||
public:
|
||||
User();
|
||||
// Default empty constructor
|
||||
User(ApiClient *apiClient = nullptr);
|
||||
User(const DTO::UserDto &data, ApiClient *apiClient = nullptr);
|
||||
|
||||
bool sameAs(const DTO::UserDto &other);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue