Skip to content

Commit

Permalink
volume: Add param parsing to launched command
Browse files Browse the repository at this point in the history
  • Loading branch information
palinek committed Jul 31, 2023
1 parent 04c1a44 commit 3fac08e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugin-volume/volumebutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ void VolumeButton::setMuteOnMiddleClick(bool state)

void VolumeButton::setMixerCommand(const QString &command)
{
m_mixerCommand = command;
m_mixerParams = QProcess::splitCommand(command);
m_mixerCommand = m_mixerParams.empty() ? QString{} : m_mixerParams.takeFirst();
}

void VolumeButton::enterEvent(QEvent *event)
Expand Down Expand Up @@ -140,7 +141,7 @@ void VolumeButton::hideVolumeSlider()

void VolumeButton::handleMixerLaunch()
{
QProcess::startDetached(m_mixerCommand, QStringList());
QProcess::startDetached(m_mixerCommand, m_mixerParams);
}

void VolumeButton::handleStockIconChanged(const QString &iconName)
Expand Down
1 change: 1 addition & 0 deletions plugin-volume/volumebutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ private slots:
QTimer m_popupHideTimer;
bool m_muteOnMiddleClick;
QString m_mixerCommand;
QStringList m_mixerParams;
};

#endif // VOLUMEBUTTON_H

0 comments on commit 3fac08e

Please sign in to comment.