Commit 48e8e58e authored by Jan Möbius's avatar Jan Möbius
Browse files

Fixed some cppcheck warnings

parent 2a804285
...@@ -179,7 +179,7 @@ bool PythonInterpreter::runScript(QString _script) { ...@@ -179,7 +179,7 @@ bool PythonInterpreter::runScript(QString _script) {
} }
PyGILState_STATE state = PyGILState_Ensure(); PyGILState_STATE state = PyGILState_Ensure();
PyThreadState* tstate = PyGILState_GetThisThreadState(); //PyThreadState* tstate = PyGILState_GetThisThreadState();
auto locals = mainModule_.attr("__dict__"); auto locals = mainModule_.attr("__dict__");
...@@ -222,8 +222,6 @@ QString PythonInterpreter::runScriptOutput(QString _script) { ...@@ -222,8 +222,6 @@ QString PythonInterpreter::runScriptOutput(QString _script) {
runScript(_script); runScript(_script);
externalLogging_ = true; externalLogging_ = true;
return LogOut + LogErr; return LogOut + LogErr;
LogOut.clear();
LogErr.clear();
} }
......
...@@ -128,9 +128,8 @@ void PythonSyntaxHighlighter::highlightBlock(const QString &text) ...@@ -128,9 +128,8 @@ void PythonSyntaxHighlighter::highlightBlock(const QString &text)
bool PythonSyntaxHighlighter::matchMultiline(const QString &text, const QRegExp &delimiter, const int inState, const QTextCharFormat &style) bool PythonSyntaxHighlighter::matchMultiline(const QString &text, const QRegExp &delimiter, const int inState, const QTextCharFormat &style)
{ {
int start = -1; int start = -1;
int add = -1; int add = -1;
int end = -1;
int length = 0; int length = 0;
// If inside triple-single quotes, start at 0 // If inside triple-single quotes, start at 0
...@@ -148,7 +147,7 @@ bool PythonSyntaxHighlighter::matchMultiline(const QString &text, const QRegExp ...@@ -148,7 +147,7 @@ bool PythonSyntaxHighlighter::matchMultiline(const QString &text, const QRegExp
// As long as there's a delimiter match on this line... // As long as there's a delimiter match on this line...
while (start >= 0) { while (start >= 0) {
// Look for the ending delimiter // Look for the ending delimiter
end = delimiter.indexIn(text, start + add); int end = delimiter.indexIn(text, start + add);
// Ending delimiter on this line? // Ending delimiter on this line?
if (end >= add) { if (end >= add) {
length = end - start + add + delimiter.matchedLength(); length = end - start + add + delimiter.matchedLength();
......
...@@ -51,7 +51,7 @@ class PythonSyntaxHighlighter : public QSyntaxHighlighter ...@@ -51,7 +51,7 @@ class PythonSyntaxHighlighter : public QSyntaxHighlighter
{ {
Q_OBJECT Q_OBJECT
public: public:
PythonSyntaxHighlighter(QTextDocument *parent = 0); explicit PythonSyntaxHighlighter(QTextDocument *parent = 0);
protected: protected:
void highlightBlock(const QString &text); void highlightBlock(const QString &text);
private: private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment