diff --git a/sources/plugins/scs/highlightingrules/scsabstracthighlightingrule.cpp b/sources/plugins/scs/highlightingrules/scsabstracthighlightingrule.cpp
index 5418444..97c7c56 100644
--- a/sources/plugins/scs/highlightingrules/scsabstracthighlightingrule.cpp
+++ b/sources/plugins/scs/highlightingrules/scsabstracthighlightingrule.cpp
@@ -38,7 +38,8 @@ SCsAbstractHighlightingRule::~SCsAbstractHighlightingRule()
void SCsAbstractHighlightingRule::assignFormat(SCsSyntaxHighlighter *highlighter, const QString &text)
{
-
+ Q_UNUSED(highlighter);
+ Q_UNUSED(text);
}
void SCsAbstractHighlightingRule::setFormat(QTextCharFormat format)
diff --git a/sources/plugins/scs/scscodeeditor.cpp b/sources/plugins/scs/scscodeeditor.cpp
index d6edad9..31a92a7 100644
--- a/sources/plugins/scs/scscodeeditor.cpp
+++ b/sources/plugins/scs/scscodeeditor.cpp
@@ -40,11 +40,11 @@ along with OSTIS. If not, see .
#define SPACE_FOR_ERROR_LABEL 20
-SCsCodeEditor::SCsCodeEditor(QWidget *parent, SCsErrorTableWidget *errorTable) :
- QPlainTextEdit(parent)
- ,mLastCursorPosition(0)
- ,mIsTextInsert(false)
- ,mErrorTable(errorTable)
+SCsCodeEditor::SCsCodeEditor(QWidget *parent, SCsErrorTableWidget *errorTable)
+ : QPlainTextEdit(parent)
+ , mErrorTable(errorTable)
+ , mLastCursorPosition(0)
+ , mIsTextInsert(false)
{
mLineNumberArea = new SCsLineNumberArea(this);
mAnalyzer = new SCsCodeAnalyzer(this);
@@ -77,6 +77,7 @@ SCsCodeEditor::SCsCodeEditor(QWidget *parent, SCsErrorTableWidget *errorTable) :
void SCsCodeEditor::setDocumentPath(const QString &path)
{
+ Q_UNUSED(path);
mAnalyzer->parse(toPlainText(), (QStandardItemModel*)mCompleter->model());
}
diff --git a/sources/plugins/scs/scscodeerroranalyzer.cpp b/sources/plugins/scs/scscodeerroranalyzer.cpp
index 0fcd4fa..2b68857 100644
--- a/sources/plugins/scs/scscodeerroranalyzer.cpp
+++ b/sources/plugins/scs/scscodeerroranalyzer.cpp
@@ -7,9 +7,9 @@
SCsCodeErrorAnalyzer::SCsCodeErrorAnalyzer(SCsCodeEditor* editor, SCsErrorTableWidget *errorTable)
: QObject(editor)
- , mEditor(editor)
- , mErrorTable(errorTable)
, mAsynchParser(0)
+ , mErrorTable(errorTable)
+ , mEditor(editor)
{
Q_CHECK_PTR(mEditor);
@@ -18,7 +18,7 @@ SCsCodeErrorAnalyzer::SCsCodeErrorAnalyzer(SCsCodeEditor* editor, SCsErrorTableW
connect(mAsynchParser,SIGNAL(parseExceptionsFinished()),SLOT(parseExceptionFinished()));
}
-void SCsCodeErrorAnalyzer::parse(QString &text)
+void SCsCodeErrorAnalyzer::parse(const QString &text)
{
if (mAsynchParser->doWork() || text.isEmpty())
return;
diff --git a/sources/plugins/scs/scscodeerroranalyzer.h b/sources/plugins/scs/scscodeerroranalyzer.h
index 0d12908..4adc7b9 100644
--- a/sources/plugins/scs/scscodeerroranalyzer.h
+++ b/sources/plugins/scs/scscodeerroranalyzer.h
@@ -38,7 +38,7 @@ class SCsCodeErrorAnalyzer : public QObject
Q_OBJECT
public:
explicit SCsCodeErrorAnalyzer(SCsCodeEditor* editor, SCsErrorTableWidget *errorTable);
- void parse(QString &text);
+ void parse(const QString &text);
private:
void showError(const QVector &exceptions) const;
diff --git a/sources/plugins/scs/scserrortablewidget.cpp b/sources/plugins/scs/scserrortablewidget.cpp
index d3890e9..6c22969 100644
--- a/sources/plugins/scs/scserrortablewidget.cpp
+++ b/sources/plugins/scs/scserrortablewidget.cpp
@@ -35,6 +35,9 @@ void SCsErrorTableWidget::doubleClickAtCell(int row, int col)
{
if(item(row,0)->type() != ERROR_TABLE_WIDGET_ITEM_TYPE)
return;
+
+ Q_UNUSED(col);
+
SCsErrorTableWidgetItem *item = (SCsErrorTableWidgetItem*) this->item(row,ERROR_TABLE_WIDGET_ITEM_COLUMN);
Q_CHECK_PTR(item);
diff --git a/sources/plugins/scs/scsfindwidget.cpp b/sources/plugins/scs/scsfindwidget.cpp
index 04a29b6..2f56ddc 100644
--- a/sources/plugins/scs/scsfindwidget.cpp
+++ b/sources/plugins/scs/scsfindwidget.cpp
@@ -148,12 +148,14 @@ void SCsFindWidget::updateButtons()
void SCsFindWidget::caseSensitivityChanged(int val)
{
+ Q_UNUSED(val)
emit find(mSearchEdit->text());
}
void SCsFindWidget::wholeWordChanged(int val)
{
+ Q_UNUSED(val)
emit find(mSearchEdit->text());
}
diff --git a/sources/plugins/scs/scsparser/scsparserexception.cpp b/sources/plugins/scs/scsparser/scsparserexception.cpp
index 5f6f98c..716e856 100644
--- a/sources/plugins/scs/scsparser/scsparserexception.cpp
+++ b/sources/plugins/scs/scsparser/scsparserexception.cpp
@@ -22,25 +22,32 @@ along with OSTIS. If not, see .
#include "scsparserexception.h"
-SCsParserException::SCsParserException():
- mLine(-1), mPositionInLine(-1), mExceptionType(-1), mExceptionPlace(SCsParserException::UNDEFINED)
+SCsParserException::SCsParserException()
+ : mExceptionPlace(SCsParserException::UNDEFINED)
+ , mExceptionType(-1)
+ , mLine(-1)
+ , mPositionInLine(-1)
{
}
-SCsParserException::SCsParserException(SCsParserException::ExceptionPlace place) :
- mLine(-1), mPositionInLine(-1), mExceptionType(-1), mExceptionPlace(place)
+SCsParserException::SCsParserException(SCsParserException::ExceptionPlace place)
+ : mExceptionPlace(place)
+ , mExceptionType(-1)
+ , mLine(-1)
+ , mPositionInLine(-1)
{
}
-SCsParserException::SCsParserException(ExceptionPlace place, int line, int positionInLine, ExceptionType exType):
- mLine(line)
- ,mPositionInLine(positionInLine)
- ,mExceptionType(exType)
- ,mExceptionPlace(place)
+SCsParserException::SCsParserException(ExceptionPlace place, int line, int positionInLine, ExceptionType exType)
+ : mExceptionPlace(place)
+ , mExceptionType(exType)
+ , mLine(line)
+ , mPositionInLine(positionInLine)
+
{
}
@@ -71,24 +78,31 @@ SCsParserException::~SCsParserException()
}
-SCsParserToken::SCsParserToken():
- mTokenType(0), mLine(-1), mPositionInLine(-1)
+SCsParserToken::SCsParserToken()
+ : mLine(-1)
+ , mPositionInLine(-1)
+ , mTokenType(0)
{
}
-SCsParserToken::SCsParserToken(int tokenType):
- mTokenType(tokenType), mLine(-1), mPositionInLine(-1)
+SCsParserToken::SCsParserToken(int tokenType)
+ : mLine(-1)
+ , mPositionInLine(-1)
+ , mTokenType(tokenType)
{
}
-SCsParserToken::SCsParserToken(int tokenType, QString tokenText, int line, int positionInLine):
- mTokenType(tokenType), mLine(line), mPositionInLine(positionInLine)
+SCsParserToken::SCsParserToken(int tokenType,const QString &tokenText, int line, int positionInLine)
+ : mTokenText(tokenText)
+ , mLine(line)
+ , mPositionInLine(positionInLine)
+ , mTokenType(tokenType)
{
- mTokenText = tokenText;
+
}
@@ -116,4 +130,4 @@ SCsParserToken& SCsParserToken::operator=(const SCsParserToken& copy)
SCsParserToken::~SCsParserToken()
{
-}
\ No newline at end of file
+}
diff --git a/sources/plugins/scs/scsparser/scsparserexception.h b/sources/plugins/scs/scsparser/scsparserexception.h
index 09b317a..646a9b9 100644
--- a/sources/plugins/scs/scsparser/scsparserexception.h
+++ b/sources/plugins/scs/scsparser/scsparserexception.h
@@ -70,7 +70,7 @@ class SCsParserToken
};
SCsParserToken();
SCsParserToken(int tokenType);
- SCsParserToken(int tokenType, QString tokenText, int line, int positionInLine);
+ SCsParserToken(int tokenType, const QString &tokenText, int line, int positionInLine);
SCsParserToken(const SCsParserToken& copy);
SCsParserToken& operator=(const SCsParserToken& copy);
virtual ~SCsParserToken();
diff --git a/sources/plugins/scs/scsparser/scsparserwrapper.cpp b/sources/plugins/scs/scsparser/scsparserwrapper.cpp
index 2b72d5b..9739b65 100644
--- a/sources/plugins/scs/scsparser/scsparserwrapper.cpp
+++ b/sources/plugins/scs/scsparser/scsparserwrapper.cpp
@@ -244,7 +244,7 @@ QSharedPointer SCsParser::getTokens(const QString &text) co
pANTLR3_COMMON_TOKEN tok;
pANTLR3_STRING tokText;
- for(int i=0; icount; i++)
+ for(uint i=0; icount; i++)
{
tok = (pANTLR3_COMMON_TOKEN) tokens->elements[i].element;
tokText = tok->getText(tok);
diff --git a/sources/plugins/scs/scswindow.cpp b/sources/plugins/scs/scswindow.cpp
index fa69ee2..86e4015 100644
--- a/sources/plugins/scs/scswindow.cpp
+++ b/sources/plugins/scs/scswindow.cpp
@@ -38,12 +38,12 @@ along with OSTIS. If not, see .
#include
#include
-SCsWindow::SCsWindow(const QString& _windowTitle, QWidget *parent):
- QWidget(parent),
- mEditor(0),
- mHighlighter(0),
- mIsSaved(false),
- mErrorTable(0)
+SCsWindow::SCsWindow(const QString& _windowTitle, QWidget *parent)
+ : QWidget(parent)
+ , mEditor(0)
+ , mHighlighter(0)
+ , mErrorTable(0)
+ , mIsSaved(false)
{
@@ -86,6 +86,8 @@ SCsWindow::SCsWindow(const QString& _windowTitle, QWidget *parent):
connect(mEditor, SIGNAL(textChanged()), this, SLOT(textChanged()));
+
+ setWindowTitle(_windowTitle);
}
SCsWindow::~SCsWindow()
@@ -131,6 +133,8 @@ bool SCsWindow::loadFromFile(const QString &fileName)
}
QTextStream in(&fileIn);
+ in.setCodec("UTF-8");
+
mEditor->document()->setPlainText(in.readAll());
mEditor->setDocumentPath(fileName);
fileIn.close();
@@ -156,6 +160,8 @@ bool SCsWindow::saveToFile(const QString &fileName)
return false;
}
QTextStream out(&fileOut);
+ out.setCodec("UTF-8");
+
out << mEditor->document()->toPlainText();
fileOut.close();