Lessen log spam by not checking for existence of file with empty name
AbandonedPublic

Authored by rkflx on Jan 20 2018, 7:58 AM.

Details

Summary

Calls to QFile::exists() while starting a Plasma session
resulted in Empty filename passed to function being logged
since Qt 5.10 (0dee566e98f5 in qtbase).

This can be avoided by skipping the check for empty filenames, which
would have returned false in any case. Similarly to what was done in
R241:549fc81e8e8a, also port to the faster QFileInfo::exists().

Note this does not simply hide a deeper issue, i.e. the actual cause
resulting in the empty variable, because libpath.isEmpty() will be
handled explicitly later on. In the case under investigation
/usr/lib64/libexec/org_kde_powerdevil did not match
/usr/lib64/libexec/kf5, but even if it was in that subfolder there
would have been no corresponding libkdeinit5_ anyway.

CCBUG: 388611

Test Plan

Grep session log for "Empty filename passed to function" after
restarting the Plasma session and compare before/after.

Diff Detail

Repository
R303 KInit
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
rkflx created this revision.Jan 20 2018, 7:58 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 20 2018, 7:58 AM
rkflx requested review of this revision.Jan 20 2018, 7:58 AM

+1, but someone else must approve.

You could even add this as comment: // check for empty string to avoid warning message in QFileExists.

rkflx updated this revision to Diff 25671.Jan 20 2018, 8:44 AM

Add comment. Thanks for the tip, Dominik :)

rkflx updated this revision to Diff 25672.Jan 20 2018, 8:46 AM

Spelling.

rkflx abandoned this revision.Aug 25 2018, 6:46 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald TranscriptAug 25 2018, 6:46 AM

@rkflx I think this patch is definitely good enough to not let it go.

@dfaure Can you give another +1?

@rkflx can you please reopen so we can accept this?