dde-application-manager/src/dbus/jobservice.cpp
ComixHe bb83716d27 feat: change dbus interface api
1. remove method: Application, Launch. (ApplicationManager1)
2. add property: IconName, DisplayName. (Application1)
3. refact the way of construct ApplicationService.
4. if Desktop Entry Key `Hidden` is true, this application wouldn't
   export to DBus.

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-22 11:42:13 +08:00

51 lines
912 B
C++

// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#include "dbus/jobservice.h"
JobService::JobService(const QFuture<QVariantList> &job)
: m_job(job)
{
}
JobService::~JobService() = default;
QString JobService::status() const // FIXME: job status aren't mutually exclusive
{
if (m_job.isFinished()) {
return "finished";
}
if (m_job.isCanceled()) {
return "canceled";
}
if (m_job.isSuspended()) {
return "suspended";
}
if (m_job.isSuspending()) {
return "suspending";
}
if (m_job.isStarted()) {
return "started";
}
if (m_job.isRunning()) {
return "running";
}
Q_UNREACHABLE();
}
void JobService::Cancel()
{
m_job.cancel();
}
void JobService::Suspend()
{
m_job.suspend();
}
void JobService::Resume()
{
m_job.resume();
}