diff options
Diffstat (limited to 'worker.cxx')
-rw-r--r-- | worker.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -3,27 +3,21 @@ #include "user.hxx" #include "worker.hxx" -Worker::Worker(QObject* parent) : - QObject{parent} +Worker::Worker() { rtclient_init("https://darapsa.co.id/rt"); } void Worker::logIn(QString const& name, QString const& password) { - auto engine = dynamic_cast<QQmlApplicationEngine*>(this->parent()); - auto user = engine->singletonInstance<User*>(User::typeId); - user->setName(name); rtclient_login(name.toLatin1().constData(), password.toLatin1().constData()); rtclient_user(name.toLatin1().constData()); } -void Worker::getTaskList() +void Worker::search(QString const& owner) { - auto engine = dynamic_cast<QQmlApplicationEngine*>(this->parent()); - auto user = engine->singletonInstance<User*>(User::typeId); QString query{"Owner='"}; - query.append(user->name()); + query.append(owner); query.append("'"); rtclient_search(query.toLatin1().constData()); } |