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: 1) Project -> Create software translation project -> Save 2) RMB -> Search in files 3) Wait ~1 minute until crash (cherry picked from commit 9b82f864)
parent
5130ecf6
Please register or sign in to comment