[dolphin] : prevent QFileInfo warning
ClosedPublic

Authored by rjvbb on Apr 26 2020, 10:49 AM.

Details

Summary

DolphinSearchBox::init() leads to a call to DolphinSearchBox::isIndexingEnabled() which can generate the following terminal warning depending on the state of the m_everywhere checkbox and whether or not m_searchPath has been initialised:

QFileInfo::absolutePath: Constructed with empty filename

From what I can tell, DolphinSearchPath::searchPath() returns $HOME or m_searchpath depending on the last used search settings, so the warning can seem to appear randomly if you don't use the search feature often.

It can be prevented by a simple check whether the current search path is valid or not. searchInfo.shouldBeIndexed() returns false for empty paths so this change is transparent. As far as I can tell, m_searchPath == QUrl() is not an anomaly but not special-casing this value is.

Test Plan

No terminal warnings with this patch applied.

Diff Detail

Repository
R318 Dolphin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rjvbb created this revision.Apr 26 2020, 10:49 AM
Restricted Application added a subscriber: kfm-devel. · View Herald TranscriptApr 26 2020, 10:49 AM
rjvbb requested review of this revision.Apr 26 2020, 10:49 AM
meven added a subscriber: meven.Apr 26 2020, 11:12 AM

What do those warnings look like, could you copy them in the commit comment ?

Make sense

rjvbb edited the summary of this revision. (Show Details)Apr 26 2020, 1:11 PM
rjvbb added a comment.Apr 26 2020, 1:12 PM
What do those warnings look like, could you copy them in the commit comment ?

Already there (but I made it stand out better) ;)

meven accepted this revision.Apr 26 2020, 1:16 PM
This revision is now accepted and ready to land.Apr 26 2020, 1:16 PM

Shouldn't this be fixed in Baloo then?

rjvbb added a comment.Apr 26 2020, 2:40 PM
Shouldn't this be fixed in Baloo then?

That would be up to the Baloo devs to decide. I remember a rather recent exchange I had about preventing this warning because of an empty path returned by Samba or the Sambla KIO extra. The consensus there was "fix the upstream, it should return empty paths".

Plus, fixing it only in Baloo will only prevent the warning for those who use the latest frameworks versions.

elvisangelaccio accepted this revision.Apr 26 2020, 9:52 PM
This revision was automatically updated to reflect the committed changes.