┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/search
diff options
context:
space:
mode:
authorRené Bertin <[email protected]>2020-04-27 10:32:34 +0200
committerRené Bertin <[email protected]>2020-04-27 10:32:34 +0200
commitd3813ee65e1d375c09d05a4f893ad672e6646909 (patch)
tree72277d10b86861e22dfc2fc68c7bffcee7b73a97 /src/search
parentcaf2fe1c4388420dc05c00c71b3d6d0617c6d424 (diff)
prevent a QFileInfo warning
DolphinSearchBox::init() can generate a terminal warning depending on the user's search history: QFileInfo::absolutePath: Constructed with empty filename The warning can seem to appear randomly if you don't use the search feature often, because of its dependency on previous search activity. Prevent this warning by adding a simple check if the current m_searchPath is valid or not. This check has no effect on the value returned by DolphinSearchBox::isIndexingEnabled() and is in line with the fact that m_searchPath == QUrl() indicates that no search path has been set. Differential Revision: https://phabricator.kde.org/D29194
Diffstat (limited to 'src/search')
-rw-r--r--src/search/dolphinsearchbox.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp
index 22941104c..52a495270 100644
--- a/src/search/dolphinsearchbox.cpp
+++ b/src/search/dolphinsearchbox.cpp
@@ -544,7 +544,7 @@ bool DolphinSearchBox::isIndexingEnabled() const
{
#ifdef HAVE_BALOO
const Baloo::IndexerConfig searchInfo;
- return searchInfo.fileIndexingEnabled() && searchInfo.shouldBeIndexed(searchPath().toLocalFile());
+ return searchInfo.fileIndexingEnabled() && !searchPath().isEmpty() && searchInfo.shouldBeIndexed(searchPath().toLocalFile());
#else
return false;
#endif