chore: V23接口改造适配
V23接口改造适配 Log: V23接口改造适配 Influence: 无 Task: https://pms.uniontech.com/task-view-207483.html Change-Id: I91e7c2807c168e87781e18aedc7aec887702ae13
This commit is contained in:
@ -32,7 +32,7 @@ class DFWatcher;
|
||||
class AlRecorder: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.daemon.AlRecorder1")
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.AlRecorder1")
|
||||
|
||||
public:
|
||||
// 各个应用目录中应用的启动记录
|
||||
|
@ -36,13 +36,13 @@ AppManager::AppManager(QObject *parent)
|
||||
qInfo() << "AppManager";
|
||||
new DBusAdaptorRecorder(recorder);
|
||||
QDBusConnection con = QDBusConnection::sessionBus();
|
||||
if (!con.registerService("org.deepin.daemon.AlRecorder1"))
|
||||
if (!con.registerService("org.deepin.dde.AlRecorder1"))
|
||||
{
|
||||
qWarning() << "register service AlRecorder1 error:" << con.lastError().message();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!con.registerObject("/org/deepin/daemon/AlRecorder1", recorder))
|
||||
if (!con.registerObject("/org/deepin/dde/AlRecorder1", recorder))
|
||||
{
|
||||
qWarning() << "register object AlRecorder1 error:" << con.lastError().message();
|
||||
return;
|
||||
|
@ -18,9 +18,9 @@
|
||||
class DBusAdaptorRecorder: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.daemon.AlRecorder1")
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.AlRecorder1")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.deepin.daemon.AlRecorder1\">\n"
|
||||
" <interface name=\"org.deepin.dde.AlRecorder1\">\n"
|
||||
" <method name=\"GetNew\">\n"
|
||||
" <arg direction=\"out\" type=\"a{sas}\" name=\"newApps\"/>\n"
|
||||
" <annotation value=\"UnLaunchedAppMap\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
|
||||
|
@ -34,13 +34,13 @@ const QString configSuffix = ".json";
|
||||
, watcher(new QFileSystemWatcher(this))
|
||||
{
|
||||
QDBusConnection con = QDBusConnection::sessionBus();
|
||||
if (!con.registerService("org.deepin.daemon.DFWatcher1"))
|
||||
if (!con.registerService("org.deepin.dde.DFWatcher1"))
|
||||
{
|
||||
qInfo() << "register service DFWatcher error:" << con.lastError().message();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!con.registerObject("/org/deepin/daemon/DFWatcher1", this, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals))
|
||||
if (!con.registerObject("/org/deepin/dde/DFWatcher1", this, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals))
|
||||
{
|
||||
qInfo() << "register object DFWatcher error:" << con.lastError().message();
|
||||
return;
|
||||
@ -52,7 +52,7 @@ const QString configSuffix = ".json";
|
||||
|
||||
DFWatcher::~DFWatcher()
|
||||
{
|
||||
QDBusConnection::sessionBus().unregisterObject("/org/deepin/daemon/DFWatcher1");
|
||||
QDBusConnection::sessionBus().unregisterObject("/org/deepin/dde/DFWatcher1");
|
||||
}
|
||||
|
||||
void DFWatcher::addDir(const QString &path)
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
class DFWatcher: public QObject {
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.daemon.DFWatcher1")
|
||||
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.DFWatcher1")
|
||||
|
||||
public:
|
||||
enum event{
|
||||
|
@ -31,7 +31,7 @@ DBusHandler::DBusHandler(Dock *_dock, QObject *parent)
|
||||
, m_launcherEnd(new LauncherBackEnd("org.deepin.dde.daemon.Launcher1", "/org/deepin/dde/daemon/Launcher1", m_session, this))
|
||||
, m_launcherFront(new LauncherFront("org.deepin.dde.Launcher1", "/org/deepin/dde/Launcher1", m_session, this))
|
||||
, m_wm(new com::deepin::WM("com.deepin.wm", "/com/deepin/wm", m_session, this))
|
||||
, m_wmSwitcher(new com::deepin::WMSwitcher("com.deepin.wmWMSwitcher", "/com/deepin/WMSwitcher", m_session, this))
|
||||
, m_wmSwitcher(new org::deepin::dde::WMSwitcher1("org.deepin.dde.WMSwitcher1", "/org/deepin/dde/WMSwitcher1", m_session, this))
|
||||
, m_kwaylandManager(nullptr)
|
||||
, m_xEventMonitor(nullptr)
|
||||
{
|
||||
@ -44,22 +44,22 @@ DBusHandler::DBusHandler(Dock *_dock, QObject *parent)
|
||||
m_dock->updateHideState(false);
|
||||
});
|
||||
|
||||
// 关联com.deepin.WMSwitcher事件 WMChanged
|
||||
// 关联org.deepin.dde.WMSwitcher1事件 WMChanged
|
||||
connect(m_wmSwitcher, &__WMSwitcher::WMChanged, this, [&](QString name) {m_dock->setWMName(name);});
|
||||
|
||||
if (QString(getenv("XDG_SESSION_TYPE")).contains("wayland")) {
|
||||
m_xEventMonitor = new org::deepin::api::XEventMonitor1("org.deepin.api.XEventMonitor1", "/org/deepin/api/XEventMonitor1", m_session, this);
|
||||
m_xEventMonitor = new org::deepin::dde::XEventMonitor1("org.deepin.dde.XEventMonitor1", "/org/deepin/dde/XEventMonitor1", m_session, this);
|
||||
// 注册XEventMonitor区域为整个屏幕的区域
|
||||
m_activeWindowMonitorKey = m_xEventMonitor->RegisterFullScreen();
|
||||
// 关联XEventMonitor的ButtonRelease事件
|
||||
connect(m_xEventMonitor, &org::deepin::api::XEventMonitor1::ButtonRelease, this, &DBusHandler::onActiveWindowButtonRelease);
|
||||
connect(m_xEventMonitor, &org::deepin::dde::XEventMonitor1::ButtonRelease, this, &DBusHandler::onActiveWindowButtonRelease);
|
||||
}
|
||||
}
|
||||
|
||||
// 关联com.deepin.daemon.KWayland.WindowManager事件
|
||||
// 关联org.deepin.dde.KWayland.WindowManager事件
|
||||
void DBusHandler::listenWaylandWMSignals()
|
||||
{
|
||||
m_kwaylandManager = new com::deepin::daemon::kwayland::WindowManager("com.deepin.daemon.KWayland", "/com/deepin/daemon/KWayland/WindowManager", m_session, this);
|
||||
m_kwaylandManager = new org::deepin::dde::kwayland1::WindowManager("org.deepin.dde.KWayland1", "/org/deepin/dde/KWayland1/WindowManager", m_session, this);
|
||||
|
||||
// ActiveWindowchanged
|
||||
connect(m_kwaylandManager, &__KwaylandManager::ActiveWindowChanged, this, &DBusHandler::handleWlActiveWindowChange);
|
||||
@ -102,22 +102,22 @@ QString DBusHandler::getCurrentWM()
|
||||
return m_wmSwitcher->CurrentWM().value();
|
||||
}
|
||||
|
||||
// TODO 扩展ApplicationManager Launch接口,允许带参数启动应用,暂时调用StartManager接口
|
||||
// TODO 扩展Application Manager Launch接口,允许带参数启动应用,暂时调用StartManager接口
|
||||
void DBusHandler::launchApp(QString desktopFile, uint32_t timestamp, QStringList files)
|
||||
{
|
||||
QDBusInterface interface = QDBusInterface("com.deepin.daemon.Display", "/com/deepin/StartManager", "com.deepin.StartManager");
|
||||
QDBusInterface interface = QDBusInterface("org.deepin.dde.Application1.Manager", "/org/deepin/dde/Application1/Manager", "org.deepin.dde.Application1.Manager");
|
||||
interface.call("LaunchApp", desktopFile, timestamp, files);
|
||||
}
|
||||
|
||||
void DBusHandler::launchAppAction(QString desktopFile, QString action, uint32_t timestamp)
|
||||
{
|
||||
QDBusInterface interface = QDBusInterface("com.deepin.daemon.Display", "/com/deepin/StartManager", "com.deepin.StartManager");
|
||||
QDBusInterface interface = QDBusInterface("org.deepin.dde.Application1.Manager", "/org/deepin/dde/Application1/Manager", "org.deepin.dde.Application1.Manager");
|
||||
interface.call("LaunchAppAction", desktopFile, action, timestamp);
|
||||
}
|
||||
|
||||
void DBusHandler::markAppLaunched(const QString &filePath)
|
||||
{
|
||||
QDBusInterface interface = QDBusInterface("org.deepin.daemon.AlRecorder1", "/org/deepin/daemon/AlRecorder1", "org.deepin.daemon.AlRecorder1");
|
||||
QDBusInterface interface = QDBusInterface("org.deepin.dde.AlRecorder1", "/org/deepin/dde/AlRecorder1", "org.deepin.dde.AlRecorder1");
|
||||
interface.call("MarkLaunched", filePath);
|
||||
}
|
||||
|
||||
@ -225,7 +225,7 @@ void DBusHandler::listenKWindowSignals(WindowInfoK *windowInfo)
|
||||
|
||||
PlasmaWindow *DBusHandler::createPlasmaWindow(QString objPath)
|
||||
{
|
||||
return new PlasmaWindow("com.deepin.daemon.KWayland", objPath, m_session, this);
|
||||
return new PlasmaWindow("org.deepin.dde.KWayland1", objPath, m_session, this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -86,10 +86,10 @@ private:
|
||||
LauncherBackEnd *m_launcherEnd;
|
||||
LauncherFront *m_launcherFront;
|
||||
com::deepin::WM *m_wm;
|
||||
com::deepin::WMSwitcher *m_wmSwitcher;
|
||||
com::deepin::daemon::kwayland::WindowManager *m_kwaylandManager;
|
||||
org::deepin::dde::WMSwitcher1 *m_wmSwitcher;
|
||||
org::deepin::dde::kwayland1::WindowManager *m_kwaylandManager;
|
||||
|
||||
org::deepin::api::XEventMonitor1 *m_xEventMonitor;
|
||||
org::deepin::dde::XEventMonitor1 *m_xEventMonitor;
|
||||
QString m_activeWindowMonitorKey;
|
||||
};
|
||||
|
||||
|
@ -40,6 +40,8 @@ class WindowInfoK;
|
||||
class WindowInfoX;
|
||||
class ApplicationManager;
|
||||
|
||||
using PlasmaWindow = org::deepin::dde::kwayland1::PlasmaWindow;
|
||||
|
||||
enum class HideState
|
||||
{
|
||||
Unknown,
|
||||
|
@ -27,6 +27,8 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
using PlasmaWindow = org::deepin::dde::kwayland1::PlasmaWindow;
|
||||
|
||||
class Entry;
|
||||
class ProcessInfo;
|
||||
|
||||
|
@ -47,9 +47,9 @@ DCORE_USE_NAMESPACE
|
||||
|
||||
#define SETTING LauncherSettings::instance()
|
||||
|
||||
const QString LASTORE_SERVICE = "org.deepin.lastore1";
|
||||
const QString LASTORE_PATH = "/org/deepin/lastore1";
|
||||
const QString LASTORE_INTERFACE = "org.deepin.lastore1.Manager";
|
||||
const QString LASTORE_SERVICE = "org.deepin.dde.Lastore1";
|
||||
const QString LASTORE_PATH = "/org/deepin/dde/Lastore1";
|
||||
const QString LASTORE_INTERFACE = "org.deepin.dde.Lastore1.Manager";
|
||||
|
||||
Launcher::Launcher(QObject *parent)
|
||||
: SynModule(parent)
|
||||
@ -143,7 +143,7 @@ QStringList Launcher::getAllNewInstalledApps()
|
||||
{
|
||||
QStringList ret;
|
||||
QMap<QString, QStringList> newApps;
|
||||
QDBusInterface interface = QDBusInterface("org.deepin.daemon.AlRecorder1", "/org/deepin/daemon/AlRecorder1", "org.deepin.daemon.AlRecorder1");
|
||||
QDBusInterface interface = QDBusInterface("org.deepin.dde.AlRecorder1", "/org/deepin/dde/AlRecorder1", "org.deepin.dde.AlRecorder1");
|
||||
QDBusReply<QMap<QString, QStringList>> reply = interface.call("GetNew");
|
||||
if (reply.isValid())
|
||||
newApps = reply;
|
||||
@ -579,16 +579,16 @@ void Launcher::onNewAppLaunched(const QString &filePath)
|
||||
|
||||
void Launcher::initConnection()
|
||||
{
|
||||
QDBusConnection::sessionBus().connect("org.deepin.daemon.DFWatcher1",
|
||||
"/org/deepin/daemon/DFWatcher1",
|
||||
"org.deepin.daemon.DFWatcher1",
|
||||
QDBusConnection::sessionBus().connect("org.deepin.dde.DFWatcher1",
|
||||
"/org/deepin/dde/DFWatcher1",
|
||||
"org.deepin.dde.DFWatcher1",
|
||||
"Event",
|
||||
this,
|
||||
SLOT(onCheckDesktopFile(const QString &, int)));
|
||||
|
||||
QDBusConnection::sessionBus().connect("org.deepin.daemon.AlRecorder1",
|
||||
"/org/deepin/daemon/AlRecorder1",
|
||||
"org.deepin.daemon.AlRecorder1",
|
||||
QDBusConnection::sessionBus().connect("org.deepin.dde.AlRecorder1",
|
||||
"/org/deepin/dde/AlRecorder1",
|
||||
"org.deepin.dde.AlRecorder1",
|
||||
"Launched",
|
||||
this,
|
||||
SLOT(onNewAppLaunched(const QString &)));
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
const QString AMServiceName = "/org/desktopspec/ApplicationManager";
|
||||
const QString AMServiceName = "/org/deepin/dde/Application1/Manager";
|
||||
const QString autostartDir = "autostart";
|
||||
const QString proxychainsBinary = "proxychains4";
|
||||
|
||||
|
@ -32,14 +32,14 @@ StartManagerDBusHandler::StartManagerDBusHandler(QObject *parent)
|
||||
|
||||
void StartManagerDBusHandler::markLaunched(QString desktopFile)
|
||||
{
|
||||
QDBusInterface interface = QDBusInterface("org.deepin.daemon.AlRecorder1", "/org/deepin/daemon/AlRecorder1", "org.deepin.daemon.AlRecorder1");
|
||||
QDBusInterface interface = QDBusInterface("org.deepin.dde.AlRecorder1", "/org/deepin/dde/AlRecorder1", "org.deepin.dde.AlRecorder1");
|
||||
interface.call("MarkLaunched", desktopFile);
|
||||
}
|
||||
|
||||
QString StartManagerDBusHandler::getProxyMsg()
|
||||
{
|
||||
QString ret;
|
||||
QDBusInterface interface = QDBusInterface("com.deepin.system.proxy", "/com/deepin/system/proxy", "com.deepin.system.proxy.App");
|
||||
QDBusInterface interface = QDBusInterface("org.deepin.dde.NetworkProxy1", "/org/deepin/dde/NetworkProxy1", "org.deepin.dde.NetworkProxy1.App", QDBusConnection::systemBus());
|
||||
QDBusReply<QString> reply = interface.call("GetProxy");
|
||||
if (reply.isValid())
|
||||
ret = reply.value();
|
||||
@ -49,8 +49,8 @@ QString StartManagerDBusHandler::getProxyMsg()
|
||||
|
||||
void StartManagerDBusHandler::addProxyProc(int32_t pid)
|
||||
{
|
||||
QDBusInterface interface = QDBusInterface("com.deepin.system.proxy", "/com/deepin/system/proxy", "com.deepin.system.proxy.App");
|
||||
interface.call("AddProc");
|
||||
QDBusInterface interface = QDBusInterface("org.deepin.dde.NetworkProxy1", "/org/deepin/dde/NetworkProxy1", "org.deepin.dde.NetworkProxy1.App", QDBusConnection::systemBus());
|
||||
interface.call("AddProc", pid);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user