refact: change dbus api and service impl
1. change IconName and DisplayName to method 2. refactor impl of GetManagedObject and move it to global.h 3. refactor impl of JobService::status 4. add ut_job.cpp Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
13
src/global.h
13
src/global.h
@ -361,4 +361,17 @@ inline QPair<QString, QString> processUnitName(const QString &unitName)
|
||||
return qMakePair(unescapeApplicationId(applicationId), std::move(instanceId));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
ObjectMap dumpDBusObject(const QMap<QDBusObjectPath, QSharedPointer<T>> &map)
|
||||
{
|
||||
ObjectMap objs;
|
||||
|
||||
for (const auto &[key, value] : map.asKeyValueRange()) {
|
||||
auto interfaces = getInterfacesListFromObject(value.data());
|
||||
objs.insert(key, interfaces);
|
||||
}
|
||||
|
||||
return objs;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user