Qt build fix for missing function StrStrI. Changed code to use cross platform QString::indexOf instead.

This commit is contained in:
mjbudd77 2021-12-03 06:15:40 -05:00
parent c2f1c5193b
commit f18604926a
1 changed files with 14 additions and 6 deletions

View File

@ -27,6 +27,7 @@
#include <zlib.h>
#include <QDir>
#include <QString>
#include <QPainter>
#include <QSettings>
#include <QHeaderView>
@ -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)
{