refact: DesktopFile's method and structure

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe
2023-08-21 16:02:26 +08:00
committed by Comix
parent 65b6c9eaf0
commit 06ee5e5899
10 changed files with 155 additions and 99 deletions

View File

@ -32,8 +32,8 @@ public:
bus.setDestBus();
m_am = new ApplicationManager1Service{std::make_unique<CGroupsIdentifier>(), bus.globalServerBus()};
DesktopFile file{true, "/usr/share/applications/test-Application.desktop", "test-Application", 0};
auto ptr = std::make_unique<QFile>(QString{"/usr/share/applications/test-Application.desktop"});
DesktopFile file{std::move(ptr), "test-Application", 0};
QSharedPointer<ApplicationService> app = QSharedPointer<ApplicationService>::create(std::move(file), nullptr);
QSharedPointer<InstanceService> instance =
QSharedPointer<InstanceService>::create(InstancePath.path().split('/').last(), ApplicationPath.path(), QString{"/"});