Fix method that calls itself recursively
Test Plan: Read the code.
Reviewers: Plasma
Subscribers: plasma-devel
Tags: Plasma
Differential Revision: https://phabricator.kde.org/D2843