Fix stack overflow
We get an infinite recursion when we perform search with no files found. See below:
void FileSearchTab::performSearch()
{
if (m_searchFileListView->files().isEmpty()) { // <= assume true
addFilesToSearch(doScanRecursive(QDir(Project::instance()->poDir()))); // <= arg is an empty list
if (m_searchFileListView->files().isEmpty()) // <= unreachable, see below
[...]
}
void FileSearchTab::addFilesToSearch(const QStringList& files)
{
m_searchFileListView->addFiles(files); // <= files.isEmpty() == true
performSearch(); // <= m_searchFileListView->files().isEmpty() == true
}
Steps to reproduce:
- Project -> Create software translation project -> Save
- RMB -> Search in files
- Wait ~1 minute until crash