mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix: 修复部分命令无法执行的问题
调用QProcess::startDetached异步执行的时候,需要将命令和参数分隔,保证该命令正确执行 Log: 修复部分命令无法执行的问题 Influence: 任务栏关机命令观察是否正常执行 Task: https://pms.uniontech.com/task-view-213403.html Change-Id: I63d3a9629dce9becdfc4dcbe476b438070def5bf
This commit is contained in:
parent
7c2f2b38ea
commit
ad56764f49
@ -63,9 +63,12 @@ bool MultiQuickItem::eventFilter(QObject *obj, QEvent *event)
|
||||
Q_EMIT requestShowChildWidget(widget);
|
||||
|
||||
} else if (obj == this) {
|
||||
const QString &command = pluginItem()->itemCommand(itemKey());
|
||||
if (!command.isEmpty())
|
||||
QProcess::startDetached(command, QStringList());
|
||||
QStringList commandArgumend = pluginItem()->itemCommand(itemKey()).split(" ");
|
||||
if (commandArgumend.size() > 0) {
|
||||
QString command = commandArgumend.first();
|
||||
commandArgumend.removeFirst();
|
||||
QProcess::startDetached(command, commandArgumend);
|
||||
}
|
||||
}
|
||||
} else if (event->type() == QEvent::Resize) {
|
||||
QLabel *labelWidget = qobject_cast<QLabel *>(obj);
|
||||
|
@ -48,9 +48,12 @@ QuickSettingItem::QuickSettingType SingleQuickItem::type() const
|
||||
void SingleQuickItem::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
const QString &command = pluginItem()->itemCommand(itemKey());
|
||||
if (!command.isEmpty())
|
||||
QProcess::startDetached(command, QStringList());
|
||||
QStringList commandArgument = pluginItem()->itemCommand(itemKey()).split(" ");
|
||||
if (commandArgument.size() > 0) {
|
||||
QString command = commandArgument.first();
|
||||
commandArgument.removeFirst();
|
||||
QProcess::startDetached(command, commandArgument);
|
||||
}
|
||||
|
||||
QWidget *itemWidget = pluginItem()->itemWidget(QUICK_ITEM_KEY);
|
||||
if (itemWidget)
|
||||
|
@ -376,9 +376,11 @@ void StretchPluginsItem::mouseReleaseEvent(QMouseEvent *e)
|
||||
|
||||
void StretchPluginsItem::mouseClick()
|
||||
{
|
||||
const QString command = m_pluginInter->itemCommand(m_itemKey);
|
||||
if (!command.isEmpty()) {
|
||||
QProcess::startDetached(command, QStringList());
|
||||
QStringList commandArgument = m_pluginInter->itemCommand(m_itemKey).split(" ");
|
||||
if (commandArgument.size() > 0) {
|
||||
QString command = commandArgument.first();
|
||||
commandArgument.removeFirst();
|
||||
QProcess::startDetached(command, commandArgument);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user