fix: App proxy invalid
AddProxyProc for launched app by launcher. Issue: https://github.com/linuxdeepin/developer-center/issues/3791
This commit is contained in:
parent
dcb310c0e2
commit
af8d6d18f9
@ -446,16 +446,23 @@ bool StartManager::launch(DesktopInfo *info, QString cmdLine, uint32_t timestamp
|
|||||||
exeArgs.removeAt(0);
|
exeArgs.removeAt(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
qDebug() << "Launching app, desktop: " << desktopFile << " exec: " << exec
|
||||||
qInfo() << "launchApp: " << desktopFile << " exec: " << exec << " args: " << exeArgs;
|
<< " args: " << exeArgs << " useProxy:" << useProxy << "appid:" << appId;
|
||||||
#endif
|
|
||||||
|
|
||||||
process.setProgram(exec);
|
process.setProgram(exec);
|
||||||
process.setArguments(exeArgs);
|
process.setArguments(exeArgs);
|
||||||
process.setWorkingDirectory(workingDir.c_str());
|
process.setWorkingDirectory(workingDir.c_str());
|
||||||
process.setEnvironment(envs);
|
process.setEnvironment(envs);
|
||||||
qint64 *pid = nullptr;
|
qint64 pid = 0;
|
||||||
return process.startDetached(pid);
|
if (process.startDetached(&pid)) {
|
||||||
|
if (useProxy) {
|
||||||
|
qDebug() << "Launch the process[" << pid << "] by app proxy.";
|
||||||
|
dbusHandler->addProxyProc(pid);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StartManager::doRunCommandWithOptions(QString exe, QStringList args, QVariantMap options)
|
bool StartManager::doRunCommandWithOptions(QString exe, QStringList args, QVariantMap options)
|
||||||
|
@ -22,7 +22,7 @@ void StartManagerDBusHandler::markLaunched(QString desktopFile)
|
|||||||
QString StartManagerDBusHandler::getProxyMsg()
|
QString StartManagerDBusHandler::getProxyMsg()
|
||||||
{
|
{
|
||||||
QString ret;
|
QString ret;
|
||||||
QDBusInterface interface = QDBusInterface("org.deepin.dde.NetworkProxy1", "/org/deepin/dde/NetworkProxy1", "org.deepin.dde.NetworkProxy1.App", QDBusConnection::systemBus());
|
QDBusInterface interface = QDBusInterface("org.deepin.dde.NetworkProxy1", "/org/deepin/dde/NetworkProxy1/App", "org.deepin.dde.NetworkProxy1.App", QDBusConnection::systemBus());
|
||||||
QDBusReply<QString> reply = interface.call("GetProxy");
|
QDBusReply<QString> reply = interface.call("GetProxy");
|
||||||
if (reply.isValid())
|
if (reply.isValid())
|
||||||
ret = reply.value();
|
ret = reply.value();
|
||||||
@ -32,6 +32,6 @@ QString StartManagerDBusHandler::getProxyMsg()
|
|||||||
|
|
||||||
void StartManagerDBusHandler::addProxyProc(int32_t pid)
|
void StartManagerDBusHandler::addProxyProc(int32_t pid)
|
||||||
{
|
{
|
||||||
QDBusInterface interface = QDBusInterface("org.deepin.dde.NetworkProxy1", "/org/deepin/dde/NetworkProxy1", "org.deepin.dde.NetworkProxy1.App", QDBusConnection::systemBus());
|
QDBusInterface interface = QDBusInterface("org.deepin.dde.NetworkProxy1", "/org/deepin/dde/NetworkProxy1/App", "org.deepin.dde.NetworkProxy1.App", QDBusConnection::systemBus());
|
||||||
interface.call("AddProc", pid);
|
interface.call("AddProc", pid);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user