Skip to content

Commit

Permalink
Github Issue #122: Implemented temporary solution to a problem when t…
Browse files Browse the repository at this point in the history
…here is a request to start a thread that may be still running when backspace is pressed causing multiple calls before the thread exists safely. If there are requests while the thread is still running then its completely ignore. Its okay to ignore those calls as they are just multiple high number of backspace presses.
  • Loading branch information
AngryFender committed Feb 9, 2024
1 parent 115c7be commit 8599a87
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions views_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,12 @@ void ViewsHandler::checkIfCursorInBlockHandler(bool &isBlock, QTextCursor &curso

void ViewsHandler::textSearchChangedHandler(const QString &text)
{
textSearchWorker.setText(text);
textSearchWorker.setRootPath(modelTree.rootPath());
proxyModel.createAllFilesList(viewTree->rootIndex(), textSearchWorker.getListPaths());
searchThread.start();
if(!searchThread.isRunning()){
textSearchWorker.setText(text);
textSearchWorker.setRootPath(modelTree.rootPath());
proxyModel.createAllFilesList(viewTree->rootIndex(), textSearchWorker.getListPaths());
searchThread.start();
}
}

void ViewsHandler::updateTextSearchViewHandler(QStandardItemModel *model, int matchCount)
Expand Down

0 comments on commit 8599a87

Please sign in to comment.