feat: 修改自启动应用启动方式
*修改自启动应用启动方式, 采用loader进程先校验应用信息,再拉起应用的方式 *修复launcher模块部分接口导出失败的问题 *增加launcher、dock、loader模块代码注释 Log: 修改自启动应用启动方式 Task: https://pms.uniontech.com/task-view-131611.html Influence: 应用启动方式不同 Change-Id: Ie88027602d1395c6bbad69e610f3639ecc7dfbc1
This commit is contained in:
@ -29,6 +29,7 @@ add_definitions(-DUSE_QT)
|
||||
set(SRCS ${PROJECT_BINARY_DIR}/src/define.h)
|
||||
|
||||
set(SRCS
|
||||
./applicationhelper.h
|
||||
./main.cpp
|
||||
./impl/application_manager.h
|
||||
./impl/application_manager.cpp
|
||||
@ -36,7 +37,6 @@ set(SRCS
|
||||
./impl/application.cpp
|
||||
./impl/application_instance.h
|
||||
./impl/application_instance.cpp
|
||||
../modules/applicationhelper/helper.h
|
||||
../modules/tools/desktop_deconstruction.hpp
|
||||
../modules/socket/server.h
|
||||
../modules/socket/server.cpp
|
||||
@ -45,7 +45,6 @@ set(SRCS
|
||||
../modules/methods/instance.hpp
|
||||
../modules/methods/quit.hpp
|
||||
../modules/methods/registe.hpp
|
||||
|
||||
../lib/desktopinfo.h
|
||||
../lib/desktopinfo.cpp
|
||||
../lib/dlocale.h
|
||||
@ -82,6 +81,8 @@ set(SRCS
|
||||
../modules/apps/appmanager.cpp
|
||||
../modules/apps/dfwatcher.h
|
||||
../modules/apps/dfwatcher.cpp
|
||||
../modules/apps/dbusalrecorderadaptor.h
|
||||
../modules/apps/dbusalrecorderadaptor.cpp
|
||||
../modules/launcher/common.h
|
||||
../modules/launcher/launcher.h
|
||||
../modules/launcher/launcher.cpp
|
||||
@ -142,6 +143,8 @@ set(SRCS
|
||||
../frameworkdbus/types/launcheriteminfolist.cpp
|
||||
../frameworkdbus/types/rect.h
|
||||
../frameworkdbus/types/rect.cpp
|
||||
../frameworkdbus/types/unlaunchedappmap.h
|
||||
../frameworkdbus/types/unlaunchedappmap.cpp
|
||||
../frameworkdbus/dbuslauncherfront.h
|
||||
../frameworkdbus/dbuslauncherfront.cpp
|
||||
../frameworkdbus/dbuslauncher.h
|
||||
@ -192,6 +195,7 @@ target_include_directories(deepin-application-manager PUBLIC
|
||||
../utils
|
||||
../frameworkdbus
|
||||
../frameworkdbus/qtdbusextended
|
||||
../frameworkdbus/types
|
||||
)
|
||||
|
||||
install(TARGETS deepin-application-manager DESTINATION bin)
|
||||
|
76
src/service/applicationhelper.h
Normal file
76
src/service/applicationhelper.h
Normal file
@ -0,0 +1,76 @@
|
||||
#include "../modules/tools/desktop_deconstruction.hpp"
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace modules {
|
||||
namespace ApplicationHelper {
|
||||
class Helper {
|
||||
QString m_file;
|
||||
|
||||
public:
|
||||
Helper(const QString &desktop)
|
||||
: m_file(desktop)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
inline QString desktop() const { return m_file; }
|
||||
|
||||
template <typename T>
|
||||
T value(const QString &key) const
|
||||
{
|
||||
QSettings settings = DesktopDeconstruction(m_file);
|
||||
settings.beginGroup("Desktop Entry");
|
||||
return settings.value(key).value<T>();
|
||||
}
|
||||
|
||||
QStringList categories() const
|
||||
{
|
||||
QStringList result;
|
||||
QStringList tmp{ value<QString>("Categories").split(";") };
|
||||
for (auto t : tmp) {
|
||||
if (t.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
result << t;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QString icon() const
|
||||
{
|
||||
return value<QString>("Icon");
|
||||
}
|
||||
|
||||
// appId
|
||||
QString id() const
|
||||
{
|
||||
return m_file.split("/").last().split(".").first();
|
||||
}
|
||||
|
||||
QStringList mimetypes() const
|
||||
{
|
||||
QStringList result;
|
||||
QStringList tmp{ value<QString>("MimeType").split(";") };
|
||||
for (auto t : tmp) {
|
||||
if (t.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
result << t;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QString comment(const QString &locale) const
|
||||
{
|
||||
return value<QString>(QString("Comment[%1]").arg(locale));
|
||||
}
|
||||
|
||||
QString name(const QString &name) const
|
||||
{
|
||||
return value<QString>(QString("Name[%1]").arg(name));
|
||||
}
|
||||
};
|
||||
} // namespace ApplicationHelper
|
||||
} // namespace modules
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <QThread>
|
||||
#include <algorithm>
|
||||
|
||||
#include "../modules/applicationhelper/helper.h"
|
||||
#include "../applicationhelper.h"
|
||||
#include "../modules/tools/desktop_deconstruction.hpp"
|
||||
#include "application_instance.h"
|
||||
|
||||
@ -141,11 +141,11 @@ QString Application::filePath() const
|
||||
return d->helper->desktop();
|
||||
}
|
||||
|
||||
QSharedPointer<ApplicationInstance> Application::createInstance()
|
||||
QSharedPointer<ApplicationInstance> Application::createInstance(QStringList files)
|
||||
{
|
||||
Q_D(Application);
|
||||
|
||||
d->instances << QSharedPointer<ApplicationInstance>(new ApplicationInstance(this, d->helper));
|
||||
d->instances << QSharedPointer<ApplicationInstance>(new ApplicationInstance(this, d->helper, files));
|
||||
|
||||
connect(d->instances.last().get(), &ApplicationInstance::taskFinished, this, [=] {
|
||||
for (auto it = d->instances.begin(); it != d->instances.end(); ++it) {
|
||||
|
@ -50,7 +50,7 @@ public: // PROPERTIES
|
||||
|
||||
QString filePath() const;
|
||||
|
||||
QSharedPointer<ApplicationInstance> createInstance();
|
||||
QSharedPointer<ApplicationInstance> createInstance(QStringList files);
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
QString Comment(const QString &locale);
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <QUuid>
|
||||
#include <QtConcurrent/QtConcurrent>
|
||||
|
||||
#include "../../modules/applicationhelper/helper.h"
|
||||
#include "../applicationhelper.h"
|
||||
#include "application.h"
|
||||
#include "applicationinstanceadaptor.h"
|
||||
|
||||
@ -46,6 +46,7 @@ public:
|
||||
void run()
|
||||
{
|
||||
#ifdef DEFINE_LOADER_PATH
|
||||
|
||||
const QString task_hash{ QString("DAM_TASK_HASH=%1").arg(m_id) };
|
||||
const QString task_type{ "DAM_TASK_TYPE=freedesktop " };
|
||||
QProcess* p = new QProcess(q_ptr);
|
||||
@ -88,7 +89,10 @@ public:
|
||||
void _kill() {}
|
||||
};
|
||||
|
||||
ApplicationInstance::ApplicationInstance(Application* parent, QSharedPointer<modules::ApplicationHelper::Helper> helper) : QObject(nullptr), dd_ptr(new ApplicationInstancePrivate(this))
|
||||
ApplicationInstance::ApplicationInstance(Application* parent, QSharedPointer<modules::ApplicationHelper::Helper> helper, QStringList files)
|
||||
: QObject(nullptr)
|
||||
, dd_ptr(new ApplicationInstancePrivate(this))
|
||||
, m_files(files)
|
||||
{
|
||||
Q_D(ApplicationInstance);
|
||||
|
||||
@ -143,6 +147,7 @@ Methods::Task ApplicationInstance::taskInfo() const
|
||||
task.id = d->m_id;
|
||||
task.runId = d->application->id();
|
||||
task.date = QString::number(startuptime());
|
||||
task.arguments = m_files;
|
||||
|
||||
// TODO: debug to display environment
|
||||
task.environments.insert( "DISPLAY", ":0" );
|
||||
|
@ -18,8 +18,10 @@ class ApplicationInstance : public QObject {
|
||||
Q_OBJECT
|
||||
QScopedPointer<ApplicationInstancePrivate> dd_ptr;
|
||||
Q_DECLARE_PRIVATE_D(qGetPtrHelper(dd_ptr), ApplicationInstance)
|
||||
|
||||
QStringList m_files; // 实例打开的文件
|
||||
public:
|
||||
ApplicationInstance(Application* parent, QSharedPointer<modules::ApplicationHelper::Helper> helper);
|
||||
ApplicationInstance(Application* parent, QSharedPointer<modules::ApplicationHelper::Helper> helper, QStringList files);
|
||||
~ApplicationInstance() override;
|
||||
|
||||
public: // PROPERTIES
|
||||
|
@ -17,112 +17,111 @@
|
||||
#include "../../modules/methods/quit.hpp"
|
||||
#include "../../modules/methods/registe.hpp"
|
||||
#include "../../modules/methods/task.hpp"
|
||||
#include "../../modules/socket/server.h"
|
||||
#include "../../modules/startmanager/startmanager.h"
|
||||
#include "application.h"
|
||||
#include "application_instance.h"
|
||||
#include "applicationinstanceadaptor.h"
|
||||
|
||||
class ApplicationManagerPrivate : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
ApplicationManager *q_ptr = nullptr;
|
||||
Q_DECLARE_PUBLIC(ApplicationManager);
|
||||
|
||||
QList<QSharedPointer<Application>> applications;
|
||||
Socket::Server server;
|
||||
std::multimap<std::string, QSharedPointer<ApplicationInstance>> tasks;
|
||||
|
||||
StartManager *startManager;
|
||||
|
||||
public:
|
||||
ApplicationManagerPrivate(ApplicationManager *parent)
|
||||
ApplicationManagerPrivate::ApplicationManagerPrivate(ApplicationManager *parent)
|
||||
: QObject(parent)
|
||||
, q_ptr(parent)
|
||||
, startManager(new StartManager(this))
|
||||
{
|
||||
{
|
||||
const QString socketPath{QString("/run/user/%1/deepin-application-manager.socket").arg(getuid())};
|
||||
connect(&server, &Socket::Server::onReadyRead, this, &ApplicationManagerPrivate::recvClientData, Qt::QueuedConnection);
|
||||
server.listen(socketPath.toStdString());
|
||||
}
|
||||
~ApplicationManagerPrivate() {}
|
||||
}
|
||||
|
||||
bool checkDMsgUid()
|
||||
{
|
||||
QDBusReply<uint> reply = q_ptr->connection().interface()->serviceUid(q_ptr->message().service());
|
||||
return reply.isValid() && (reply.value() == getuid());
|
||||
}
|
||||
ApplicationManagerPrivate::~ApplicationManagerPrivate()
|
||||
{
|
||||
|
||||
private:
|
||||
void recvClientData(int socket, const std::vector<char> &data)
|
||||
{
|
||||
std::string tmp;
|
||||
for (char c : data) {
|
||||
tmp += c;
|
||||
}
|
||||
|
||||
bool ApplicationManagerPrivate::checkDMsgUid()
|
||||
{
|
||||
QDBusReply<uint> reply = q_ptr->connection().interface()->serviceUid(q_ptr->message().service());
|
||||
return reply.isValid() && (reply.value() == getuid());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ApplicationManagerPrivate::recvClientData 接受客户端数据,进行校验
|
||||
* @param socket 客户端套接字
|
||||
* @param data 接受到客户端数据
|
||||
*/
|
||||
void ApplicationManagerPrivate::recvClientData(int socket, const std::vector<char> &data)
|
||||
{
|
||||
QByteArray jsonArray = data.data();
|
||||
Methods::Basic basic;
|
||||
Methods::fromJson(jsonArray, basic);
|
||||
QByteArray tmpArray;
|
||||
do {
|
||||
// 运行实例
|
||||
if (basic.type == "instance") {
|
||||
Methods::Instance instance;
|
||||
Methods::fromJson(jsonArray, instance);
|
||||
|
||||
// 校验实例信息
|
||||
auto find = tasks.find(instance.hash.toStdString());
|
||||
if (find != tasks.end()) {
|
||||
Methods::Task task = find->second->taskInfo();
|
||||
Methods::toJson(tmpArray, task);
|
||||
|
||||
// 通过校验,传入应用启动信息
|
||||
write(socket, tmpArray.toStdString());
|
||||
tasks.erase(find);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QByteArray jsonArray = data.data();
|
||||
Methods::Basic basic;
|
||||
Methods::fromJson(jsonArray, basic);
|
||||
QByteArray tmpArray;
|
||||
do {
|
||||
if (basic.type == "instance") {
|
||||
Methods::Instance instance;
|
||||
Methods::fromJson(jsonArray, instance);
|
||||
auto find = tasks.find(instance.hash.toStdString());
|
||||
if (find != tasks.end())
|
||||
{
|
||||
Methods::Task task = find->second->taskInfo();
|
||||
Methods::toJson(tmpArray, task);
|
||||
write(socket, tmpArray.toStdString());
|
||||
tasks.erase(find);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (basic.type == "quit") {
|
||||
Methods::Quit quit;
|
||||
Methods::fromJson(jsonArray, quit);
|
||||
server.close(socket);
|
||||
std::cout << "client quit" << std::endl;
|
||||
break;
|
||||
}
|
||||
if (basic.type == "registe") {
|
||||
Methods::Registe registe;
|
||||
Methods::fromJson(jsonArray, registe);
|
||||
Methods::Registe result;
|
||||
result.state = false;
|
||||
// std::lock_guard<std::mutex> lock(task_mutex);
|
||||
for (auto it = tasks.begin(); it != tasks.end(); ++it) {
|
||||
result.state = true;
|
||||
result.hash = QString::fromStdString(it->first);
|
||||
}
|
||||
Methods::toJson(tmpArray, result);
|
||||
write(socket, tmpArray.toStdString());
|
||||
break;
|
||||
}
|
||||
write(socket, jsonArray.toStdString());
|
||||
} while (false);
|
||||
}
|
||||
// 退出
|
||||
if (basic.type == "quit") {
|
||||
Methods::Quit quit;
|
||||
Methods::fromJson(jsonArray, quit);
|
||||
server.close(socket);
|
||||
std::cout << "client quit" << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
void write(int socket, const std::vector<char> &data)
|
||||
{
|
||||
std::vector<char> tmp = data;
|
||||
tmp.push_back('\0');
|
||||
server.write(socket, tmp);
|
||||
}
|
||||
void write(int socket, const std::string &data)
|
||||
{
|
||||
std::vector<char> result;
|
||||
std::copy(data.cbegin(), data.cend(), std::back_inserter(result));
|
||||
return write(socket, result);
|
||||
}
|
||||
void write(int socket, const char c)
|
||||
{
|
||||
return write(socket, std::vector<char>(c));
|
||||
}
|
||||
};
|
||||
// 注册应用
|
||||
if (basic.type == "registe") {
|
||||
Methods::Registe registe;
|
||||
Methods::fromJson(jsonArray, registe);
|
||||
Methods::Registe result;
|
||||
result.state = false;
|
||||
// std::lock_guard<std::mutex> lock(task_mutex);
|
||||
for (auto it = tasks.begin(); it != tasks.end(); ++it) {
|
||||
result.state = true;
|
||||
result.hash = QString::fromStdString(it->first);
|
||||
}
|
||||
Methods::toJson(tmpArray, result);
|
||||
write(socket, tmpArray.toStdString());
|
||||
break;
|
||||
}
|
||||
write(socket, jsonArray.toStdString());
|
||||
} while (false);
|
||||
}
|
||||
|
||||
ApplicationManager* ApplicationManager::Instance() {
|
||||
void ApplicationManagerPrivate::write(int socket, const std::vector<char> &data)
|
||||
{
|
||||
std::vector<char> tmp = data;
|
||||
tmp.push_back('\0');
|
||||
server.write(socket, tmp);
|
||||
}
|
||||
|
||||
void ApplicationManagerPrivate::write(int socket, const std::string &data)
|
||||
{
|
||||
std::vector<char> result;
|
||||
std::copy(data.cbegin(), data.cend(), std::back_inserter(result));
|
||||
return write(socket, result);
|
||||
}
|
||||
|
||||
void ApplicationManagerPrivate::write(int socket, const char c)
|
||||
{
|
||||
return write(socket, std::vector<char>(c));
|
||||
}
|
||||
|
||||
|
||||
ApplicationManager* ApplicationManager::instance() {
|
||||
static ApplicationManager manager;
|
||||
return &manager;
|
||||
}
|
||||
@ -145,6 +144,23 @@ void ApplicationManager::addApplication(const QList<QSharedPointer<Application>>
|
||||
d->applications = list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ApplicationManager::launchAutostartApps 加载自启动应用
|
||||
* TODO 待优化点: 多个loader使用同一个套接字通信,串行执行,效率低
|
||||
*/
|
||||
void ApplicationManager::launchAutostartApps()
|
||||
{
|
||||
/*
|
||||
Launch("/freedesktop/system/seahorse", QStringList());
|
||||
QTimer::singleShot(1000, [&] {
|
||||
for (auto app : startManager->autostartList()) {
|
||||
QString id = app.split("/").last().split(".").first();
|
||||
Launch(id, QStringList());
|
||||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
QDBusObjectPath ApplicationManager::GetInformation(const QString &id)
|
||||
{
|
||||
Q_D(ApplicationManager);
|
||||
@ -175,7 +191,13 @@ QList<QDBusObjectPath> ApplicationManager::GetInstances(const QString &id)
|
||||
return {};
|
||||
}
|
||||
|
||||
QDBusObjectPath ApplicationManager::Run(const QString &id)
|
||||
/**
|
||||
* @brief ApplicationManager::Launch 启动应用
|
||||
* @param id QString("/%1/%2/%3").arg(Apptype).arg(d->m_type == Application::Type::System ? "system" : "user").arg(appId)
|
||||
* @param files 应用打开的文件
|
||||
* @return
|
||||
*/
|
||||
QDBusObjectPath ApplicationManager::Launch(const QString &id, QStringList files)
|
||||
{
|
||||
Q_D(ApplicationManager);
|
||||
if (!d->checkDMsgUid())
|
||||
@ -183,9 +205,10 @@ QDBusObjectPath ApplicationManager::Run(const QString &id)
|
||||
|
||||
// 创建一个实例
|
||||
for (const QSharedPointer<Application> &app : d->applications) {
|
||||
QString appId = app->id();
|
||||
if (app->id() == id) {
|
||||
// 创建任务所需的数据,并记录到任务队列,等待 loader 消耗
|
||||
QSharedPointer<ApplicationInstance> instance{app->createInstance()};
|
||||
QSharedPointer<ApplicationInstance> instance{app->createInstance(files)};
|
||||
const std::string hash{instance->hash().toStdString()};
|
||||
connect(instance.get(), &ApplicationInstance::taskFinished, this, [=] {
|
||||
for (auto it = d->tasks.begin(); it != d->tasks.end(); ++it) {
|
||||
|
@ -1,6 +1,9 @@
|
||||
#ifndef A2862DC7_5DA3_4129_9796_671D88015BED
|
||||
#define A2862DC7_5DA3_4129_9796_671D88015BED
|
||||
|
||||
#include "../../modules/startmanager/startmanager.h"
|
||||
#include "../../modules/socket/server.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QDBusObjectPath>
|
||||
#include <QList>
|
||||
@ -9,7 +12,34 @@
|
||||
|
||||
class Application;
|
||||
class ApplicationInstance;
|
||||
class ApplicationManagerPrivate;
|
||||
class ApplicationManagerPrivate : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
ApplicationManager *q_ptr = nullptr;
|
||||
Q_DECLARE_PUBLIC(ApplicationManager);
|
||||
|
||||
QList<QSharedPointer<Application>> applications;
|
||||
Socket::Server server;
|
||||
std::multimap<std::string, QSharedPointer<ApplicationInstance>> tasks;
|
||||
StartManager *startManager;
|
||||
|
||||
public:
|
||||
ApplicationManagerPrivate(ApplicationManager *parent);
|
||||
~ApplicationManagerPrivate();
|
||||
|
||||
// 检测调用方身份
|
||||
bool checkDMsgUid();
|
||||
|
||||
private:
|
||||
void recvClientData(int socket, const std::vector<char> &data);
|
||||
|
||||
void write(int socket, const std::vector<char> &data);
|
||||
|
||||
void write(int socket, const std::string &data);
|
||||
|
||||
void write(int socket, const char c);
|
||||
};
|
||||
|
||||
class ApplicationManager : public QObject, public QDBusContext
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -21,9 +51,10 @@ class ApplicationManager : public QObject, public QDBusContext
|
||||
public:
|
||||
ApplicationManager(QObject *parent = nullptr);
|
||||
~ApplicationManager() override;
|
||||
static ApplicationManager* Instance();
|
||||
static ApplicationManager* instance();
|
||||
|
||||
void addApplication(const QList<QSharedPointer<Application>> &list);
|
||||
void launchAutostartApps();
|
||||
|
||||
Q_SIGNALS:
|
||||
void AutostartChanged(QString status, QString filePath);
|
||||
@ -35,7 +66,7 @@ public: // PROPERTIES
|
||||
public Q_SLOTS: // METHODS
|
||||
QDBusObjectPath GetInformation(const QString &id);
|
||||
QList<QDBusObjectPath> GetInstances(const QString &id);
|
||||
QDBusObjectPath Run(const QString &id);
|
||||
QDBusObjectPath Launch(const QString &id, QStringList files);
|
||||
|
||||
// com.deepin.StartManager
|
||||
bool AddAutostart(QString fileName);
|
||||
@ -53,7 +84,6 @@ public Q_SLOTS: // METHODS
|
||||
void RunCommand(QString exe, QStringList args);
|
||||
void RunCommandWithOptions(QString exe, QStringList args, QMap<QString, QString> options);
|
||||
void TryAgain(bool launch);
|
||||
|
||||
};
|
||||
|
||||
#endif /* A2862DC7_5DA3_4129_9796_671D88015BED */
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "impl/application.h"
|
||||
#include "applicationmanageradaptor.h"
|
||||
#include "applicationadaptor.h"
|
||||
#include "../modules/applicationhelper/helper.h"
|
||||
#include "applicationhelper.h"
|
||||
#include "../modules/apps/appmanager.h"
|
||||
#include "../modules/launcher/launchermanager.h"
|
||||
#include "../modules/dock/dockmanager.h"
|
||||
@ -72,15 +72,15 @@ int main(int argc, char *argv[])
|
||||
DLogManager::registerConsoleAppender();
|
||||
DLogManager::registerFileAppender();
|
||||
|
||||
new AppManager(ApplicationManager::Instance());
|
||||
new LauncherManager(ApplicationManager::Instance());
|
||||
new DockManager(ApplicationManager::Instance());
|
||||
new StartManager(ApplicationManager::Instance());
|
||||
new ApplicationManagerAdaptor(ApplicationManager::Instance());
|
||||
new AppManager(ApplicationManager::instance());
|
||||
new LauncherManager(ApplicationManager::instance());
|
||||
new DockManager(ApplicationManager::instance());
|
||||
new StartManager(ApplicationManager::instance());
|
||||
new ApplicationManagerAdaptor(ApplicationManager::instance());
|
||||
|
||||
QDBusConnection::sessionBus().registerService("org.desktopspec.Application");
|
||||
QDBusConnection::sessionBus().registerService("org.desktopspec.ApplicationManager");
|
||||
QDBusConnection::sessionBus().registerObject("/org/desktopspec/ApplicationManager", "org.desktopspec.ApplicationManager", ApplicationManager::Instance());
|
||||
QDBusConnection::sessionBus().registerObject("/org/desktopspec/ApplicationManager", "org.desktopspec.ApplicationManager", ApplicationManager::instance());
|
||||
|
||||
QList<QSharedPointer<Application>> apps{ scanFiles() };
|
||||
QList<QSharedPointer<ApplicationAdaptor>> appAdapters;
|
||||
@ -90,7 +90,9 @@ int main(int argc, char *argv[])
|
||||
QDBusConnection::sessionBus().registerObject(app->path().path(), "org.desktopspec.Application", app.get());
|
||||
}
|
||||
|
||||
ApplicationManager::Instance()->addApplication(apps);
|
||||
ApplicationManager::instance()->addApplication(apps);
|
||||
|
||||
ApplicationManager::instance()->launchAutostartApps();
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
Reference in New Issue
Block a user