From f18604926a8aa27f6e92202c5641931d509d2944 Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Fri, 3 Dec 2021 06:15:40 -0500 Subject: [PATCH] Qt build fix for missing function StrStrI. Changed code to use cross platform QString::indexOf instead. --- src/drivers/Qt/TasEditor/TasEditorWindow.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp index c689caf9..de285ecf 100644 --- a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp +++ b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -5467,17 +5468,24 @@ void TasFindNoteWindow::findNextClicked(void) cur_marker = markersManager->getMarkerAtFrame(current_frame); if (cur_marker) { + QString haystack, needle; + + needle = QString(markersManager->findNoteString); + haystack = QString::fromStdString(markersManager->getNoteCopy(cur_marker)); + if (taseditorConfig->findnoteMatchCase) { - result = (strstr(markersManager->getNoteCopy(cur_marker).c_str(), markersManager->findNoteString) != 0); + result = haystack.indexOf( needle, 0, Qt::CaseSensitive ) >= 0; + //result = (strstr(markersManager->getNoteCopy(cur_marker).c_str(), markersManager->findNoteString) != 0); } else { -#ifdef WIN32 - result = (StrStrI(markersManager->getNoteCopy(cur_marker).c_str(), markersManager->findNoteString) != 0); -#else - result = (strcasestr(markersManager->getNoteCopy(cur_marker).c_str(), markersManager->findNoteString) != 0); -#endif + result = haystack.indexOf( needle, 0, Qt::CaseInsensitive ) >= 0; +//#ifdef WIN32 +// result = (StrStrI(markersManager->getNoteCopy(cur_marker).c_str(), markersManager->findNoteString) != 0); +//#else +// result = (strcasestr(markersManager->getNoteCopy(cur_marker).c_str(), markersManager->findNoteString) != 0); +//#endif } if (result) {