Fix Increase/Decrease Volume shortcuts
Needs ReviewPublic

Authored by wbauer on Fri, Oct 4, 1:21 PM.


Group Reviewers

EngineController::increaseVolume( int ticks ) and EngineController::decreaseVolume( int ticks ) take an argument that specifies the amount by which to increase/decrease the volume.
But it gets called with 0 as argument when pressing the shortcut key, so the volume was not changed at all.

To make the keyboard shortcuts work, create new slots that don't take arguments and call the previous ones with the default value.

Test Plan

Press the increase or decrease volume shortcut keys (+ and - by default), the volume is actually changed now, before they had no effect.

Diff Detail

R181 Amarok
Lint Skipped
Unit Tests Skipped
wbauer created this revision.Fri, Oct 4, 1:21 PM
Restricted Application removed a project: Amarok. · View Herald TranscriptFri, Oct 4, 1:21 PM
wbauer requested review of this revision.EditedFri, Oct 4, 1:21 PM

PS: I think the argument is 0 because QAction::triggered() has a bool checked argument that's probably passed along.
But Qt's new signal/slots syntax doesn't support default arguments anyway, according to the docs.

ognarb added a subscriber: ognarb.Fri, Oct 4, 2:57 PM

Since the method is only one line long, why not using lambda instead here?

wbauer added a comment.Fri, Oct 4, 3:15 PM

Since the method is only one line long, why not using lambda instead here?

Because I couldn't get it to compile successfully, I got this error:
In lambda function passing 'const EngineController' as 'this' argument discards qualifiers