summaryrefslogtreecommitdiff
path: root/src/scripttools
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripttools')
-rw-r--r--src/scripttools/debugging/qscriptcompletiontask.cpp4
-rw-r--r--src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolewidget.cpp4
-rw-r--r--src/scripttools/debugging/qscriptsyntaxhighlighter.cpp8
5 files changed, 18 insertions, 6 deletions
diff --git a/src/scripttools/debugging/qscriptcompletiontask.cpp b/src/scripttools/debugging/qscriptcompletiontask.cpp
index 7ea204f..769293d 100644
--- a/src/scripttools/debugging/qscriptcompletiontask.cpp
+++ b/src/scripttools/debugging/qscriptcompletiontask.cpp
@@ -54,6 +54,8 @@
#include <QtCore/qset.h>
#include <QtCore/qdebug.h>
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
class QScriptCompletionTaskPrivate
@@ -284,7 +286,7 @@ void QScriptCompletionTask::start()
if (isPrefixOf(arg, name))
d->results.append(name);
}
- qStableSort(d->results);
+ std::stable_sort(d->results.begin(), d->results.end());
} else if (argType == QLatin1String("script")) {
d->completeScriptExpression();
} else {
diff --git a/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp b/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp
index c8a048a..e6866b4 100644
--- a/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp
+++ b/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp
@@ -56,6 +56,8 @@
#include <QtScript/qscriptvalueiterator.h>
#include <QtCore/qdebug.h>
+#include <algorithm>
+
Q_DECLARE_METATYPE(QScriptScriptsDelta)
Q_DECLARE_METATYPE(QScriptDebuggerValueProperty)
Q_DECLARE_METATYPE(QScriptDebuggerValuePropertyList)
@@ -399,7 +401,7 @@ QScriptDebuggerResponse QScriptDebuggerCommandExecutor::execute(
}
}
QStringList matchesList = matches.toList();
- qStableSort(matchesList);
+ std::stable_sort(matchesList.begin(), matchesList.end());
response.setResult(matchesList);
} break;
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp
index 6fe100d..19f05c1 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp
@@ -46,6 +46,8 @@
#include <QtCore/qlist.h>
#include <QtCore/qstringlist.h>
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
/*!
@@ -237,7 +239,7 @@ QStringList QScriptDebuggerConsoleCommandManager::completions(const QString &pre
result.append(name);
}
}
- qStableSort(result);
+ std::stable_sort(result.begin(), result.end());
return result;
}
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolewidget.cpp b/src/scripttools/debugging/qscriptdebuggerconsolewidget.cpp
index 78bb5fc..55cfc2e 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolewidget.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerconsolewidget.cpp
@@ -54,6 +54,8 @@
#include <QtWidgets/qboxlayout.h>
#include <QtWidgets/qcompleter.h>
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
namespace {
@@ -277,7 +279,7 @@ void QScriptDebuggerConsoleWidgetPrivate::_q_onCompletionTaskFinished()
QStringList lst;
for (int i = 0; i < task->resultCount(); ++i)
lst.append(task->resultAt(i).mid(task->length()));
- qSort(lst.begin(), lst.end(), lengthLessThan);
+ std::sort(lst.begin(), lst.end(), lengthLessThan);
QString lcp = longestCommonPrefix(lst);
if (!lcp.isEmpty()) {
QString tmp = commandLine->input();
diff --git a/src/scripttools/debugging/qscriptsyntaxhighlighter.cpp b/src/scripttools/debugging/qscriptsyntaxhighlighter.cpp
index a8ccd95..112b4a9 100644
--- a/src/scripttools/debugging/qscriptsyntaxhighlighter.cpp
+++ b/src/scripttools/debugging/qscriptsyntaxhighlighter.cpp
@@ -42,6 +42,8 @@
#include "qscriptsyntaxhighlighter_p.h"
#include "private/qfunctions_p.h"
+#include <algorithm>
+
#ifndef QT_NO_SYNTAXHIGHLIGHTER
QT_BEGIN_NAMESPACE
@@ -143,9 +145,11 @@ static bool isKeyword(const QString &word)
{
const char * const *start = &keywords[0];
const char * const *end = &keywords[MAX_KEYWORD - 1];
- const char * const *kw = qBinaryFind(start, end, KeywordHelper(word));
- return kw != end;
+ const KeywordHelper keywordHelper(word);
+ const char * const *kw = std::lower_bound(start, end, keywordHelper);
+
+ return kw != end && !(keywordHelper < *kw);
}
QScriptSyntaxHighlighter::QScriptSyntaxHighlighter(QTextDocument *document)