Status and Priority service singleton
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#define TASKS_KEY "tasks"
|
||||
#define UUID_KEY "uuid"
|
||||
#define DESCRIPTION_KEY "description"
|
||||
#define AUTOSTATUS_KEY "auto_status"
|
||||
#define STATUS_KEY "status"
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonValue>
|
||||
@@ -23,6 +25,8 @@ Board::Board(QJsonObject obj)
|
||||
this->uuid = obj[UUID_KEY].toString(uuid.toString(QUuid::WithoutBraces));
|
||||
this->name = obj[NAME_KEY].toString("!Missing name!");
|
||||
this->description = obj[DESCRIPTION_KEY].toString("");
|
||||
this->autoStatus = obj[AUTOSTATUS_KEY].toBool(true);
|
||||
this->statusUUID = obj[STATUS_KEY].toString();
|
||||
QJsonArray jsonTasks = obj[TASKS_KEY].toArray();
|
||||
foreach (QJsonValue value, jsonTasks) {
|
||||
Task *t = new Task(value.toObject());
|
||||
@@ -54,6 +58,16 @@ const QString Board::getDescription()
|
||||
return description;
|
||||
}
|
||||
|
||||
const QString Board::getStatus()
|
||||
{
|
||||
return statusUUID;
|
||||
}
|
||||
|
||||
bool Board::isAutoStatus()
|
||||
{
|
||||
return autoStatus;
|
||||
}
|
||||
|
||||
void Board::setName(const QString name)
|
||||
{
|
||||
this->name = name;
|
||||
@@ -100,6 +114,8 @@ const QJsonObject Board::toJson()
|
||||
QJsonObject obj;
|
||||
obj[NAME_KEY] = this->name;
|
||||
obj[UUID_KEY] = this->uuid;
|
||||
obj[STATUS_KEY] = this->statusUUID;
|
||||
obj[AUTOSTATUS_KEY] = this->autoStatus;
|
||||
obj[TASKS_KEY] = array;
|
||||
obj[DESCRIPTION_KEY] = description;
|
||||
return obj;
|
||||
|
||||
Reference in New Issue
Block a user