Warning, file /utilities/toad/src/task.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // SPDX-FileCopyrightText: 2022 Felipe Kinoshita <kinofhek@gmail.com>
0002 // SPDX-License-Identifier: LGPL-2.1-or-later
0003 
0004 #include "task.h"
0005 
0006 Task::Task(QString title, bool checked)
0007 {
0008     m_title = title;
0009     m_checked = checked;
0010 }
0011 
0012 QString Task::title()
0013 {
0014     return m_title;
0015 }
0016 
0017 bool Task::checked()
0018 {
0019     return m_checked;
0020 }
0021 
0022 void Task::setTitle(const QString &title)
0023 {
0024     m_title = title;
0025 }
0026 
0027 void Task::setChecked(const bool &checked)
0028 {
0029     m_checked = checked;
0030 }
0031 
0032 Task Task::fromJson(const QJsonObject &obj)
0033 {
0034     Task task(obj.value(QStringLiteral("title")).toString(), obj.value(QStringLiteral("checked")).toBool());
0035 
0036     return task;
0037 }
0038 
0039 QJsonObject Task::toJson() const
0040 {
0041     return {
0042         {QStringLiteral("title"), m_title},
0043         {QStringLiteral("checked"), m_checked}
0044     };
0045 }