Cleanup: use temp variables instead of querying properties repeatedly
Differential Revision: https://phabricator.kde.org/D8597