D29194: [dolphin] : prevent QFileInfo warning

René J.V. Bertin noreply at phabricator.kde.org
Sun Apr 26 11:49:47 BST 2020


rjvbb created this revision.
rjvbb added a reviewer: Dolphin.
rjvbb added a project: Dolphin.
Herald added a subscriber: kfm-devel.
rjvbb requested review of this revision.

REVISION 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.

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D29194

AFFECTED FILES
  src/search/dolphinsearchbox.cpp

To: rjvbb, #dolphin
Cc: kfm-devel, #dolphin, azyx, nikolaik, pberestov, iasensio, aprcela, fprice, fbampaloukas, alexde, Codezela, feverfew, meven, spoorun, navarromorales, firef, ngraham, andrebarros, emmanuelp, rdieter, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20200426/07cd16a3/attachment.htm>


More information about the kfm-devel mailing list