Fix one source of log spam referenced in Bug 388389 (Empty filename passed to function)
ClosedPublic

Authored by rkron on Jan 16 2018, 4:56 PM.

Details

Summary

I found two places in plasma-framework svg.cpp (Plasma::Svg) that were triggering this message.

path variable was not being checked for empty before passing to QFile::exists().

This seems to be one source of the issue reported in Bug 388389

Test Plan

Found that kicker was triggering this message and also plasmashell tooltips.

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rkron requested review of this revision.Jan 16 2018, 4:56 PM
rkron created this revision.
aacid added a subscriber: aacid.Jan 16 2018, 6:47 PM

Wonder if QFile really should be giving a warning if the path is empty instead of just returning false to be honest, but i'll leave it to the plasma devs to decide if they want this or if we should try to convince Qt to be less spammy

There was a similar fix commited somewhere (don't remember, in KIO?) related to QFile in newer Qt complaining about empty filenames passed, so this is probably fine too...

rkron updated this revision to Diff 25540.Jan 17 2018, 1:45 PM

After reviewing the kio commit where similar changes were made, I changed QFile::exists to QFileInfo::exists as was done in kio and have updated my patch. I should have looked at kio before my first submission. Sorry.

davidedmundson accepted this revision.Jan 17 2018, 1:47 PM
This revision is now accepted and ready to land.Jan 17 2018, 1:47 PM

I'm new to phabricator and do not have commit access. Does someone need to commit this?

This revision was automatically updated to reflect the committed changes.

@davidedmundson If the associated bug is fixed, it should be closed.

rkron added a comment.Jan 21 2018, 4:06 PM

@davidedmundson Thanks for the commit!