Handle applyPrefixes with an empty string

Summary:
When setting an empty QStringList as prefix, it can lead to unexpected results, such as the prefix not changing.

BUG: 377441

Reviewers: #plasma

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D5000
This commit is contained in:
David Edmundson 2017-03-10 09:49:47 +00:00
parent fe3fd0cf17
commit 547a34d346

View File

@ -556,7 +556,13 @@ void FrameSvgItem::updateDevicePixelRatio()
void FrameSvgItem::applyPrefixes()
{
if (m_prefixes.isEmpty() || m_frameSvg->imagePath().isEmpty()) {
if (m_frameSvg->imagePath().isEmpty()) {
return;
}
if (m_prefixes.isEmpty()) {
m_frameSvg->setElementPrefix(QString());
return;
}