Merge pull request #79 from mammonsama666/new

fix(thread): Process stuck because of thread.
This commit is contained in:
iaom 2021-01-13 18:38:31 +08:00 committed by GitHub
commit 7c90803f57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -218,11 +218,13 @@ void MainWindow::initUi()
*/ */
void MainWindow::bootOptionsFilter(QString opt) void MainWindow::bootOptionsFilter(QString opt)
{ {
if (opt == "-s" || opt == "--show") {
clearSearchResult(); clearSearchResult();
this->show(); this->show();
this->raise(); this->raise();
this->activateWindow(); this->activateWindow();
// m_search_result_thread->start(); // m_search_result_thread->start();
}
} }
/** /**

View File

@ -43,7 +43,7 @@ void SearchResult::run()
m_mainwindow->m_searcher->m_mutex2.unlock(); m_mainwindow->m_searcher->m_mutex2.unlock();
} }
m_mainwindow->m_searcher->m_mutex3.lock(); m_mainwindow->m_searcher->m_mutex3.lock();
if (!m_mainwindow->m_search_result_content->isEmpty()) // if (!m_mainwindow->m_search_result_content->isEmpty())
// qDebug() << m_mainwindow->m_search_result_content->head(); // qDebug() << m_mainwindow->m_search_result_content->head();
if (!m_mainwindow->m_search_result_content->isEmpty()) { if (!m_mainwindow->m_search_result_content->isEmpty()) {
Q_EMIT this->searchResultContent(m_mainwindow->m_search_result_content->dequeue()); Q_EMIT this->searchResultContent(m_mainwindow->m_search_result_content->dequeue());