aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar un1versal2016-06-13 08:51:37 +0100
committerGravatar un1versal2016-06-13 17:51:28 +0100
commit101c9477cef94cfc39261e158513ffe0187aa780 (patch)
tree529197198d046a5370a4fc0c0476a9658964397b
parentKviControlCodes: cleanup duplication in control codes (diff)
downloadKVIrc-101c9477cef94cfc39261e158513ffe0187aa780.tar.gz
KVIrc-101c9477cef94cfc39261e158513ffe0187aa780.tar.bz2
KVIrc-101c9477cef94cfc39261e158513ffe0187aa780.zip
source: cosmetic cleanups
-rw-r--r--src/kvilib/irc/KviControlCodes.h2
-rw-r--r--src/kvirc/ui/KviInputEditor.cpp23
-rw-r--r--src/modules/objects/KvsObject_multiLineEdit.cpp4
3 files changed, 10 insertions, 19 deletions
diff --git a/src/kvilib/irc/KviControlCodes.h b/src/kvilib/irc/KviControlCodes.h
index 81430d1b8..760050547 100644
--- a/src/kvilib/irc/KviControlCodes.h
+++ b/src/kvilib/irc/KviControlCodes.h
@@ -159,7 +159,7 @@ namespace KviControlCodes
Reset = 0x0f, /**< Reset */
Reverse = 0x16, /**< Reverse */
Icon = 0x1c, /**< Icon, KVIrc control code */
- Italic = 0x1d,
+ Italic = 0x1d, /**< Italic */
CryptEscape = 0x1e, /**< Crypt escape, KVIrc control code */
Underline = 0x1f /**< Underline */
};
diff --git a/src/kvirc/ui/KviInputEditor.cpp b/src/kvirc/ui/KviInputEditor.cpp
index 6a5b1907f..6d99c53df 100644
--- a/src/kvirc/ui/KviInputEditor.cpp
+++ b/src/kvirc/ui/KviInputEditor.cpp
@@ -467,7 +467,7 @@ void KviInputEditor::splitTextIntoSpellCheckerBlocks(const QString & szText, Kvi
case QChar::Number_Other:
if(!pWordBegin && !pNonWordBegin)
pNonWordBegin = p; // start a non-word
- // else just go ahead keeping current state
+ // else just go ahead keeping current state
break;
default:
if(!pNonWordBegin)
@@ -475,9 +475,9 @@ void KviInputEditor::splitTextIntoSpellCheckerBlocks(const QString & szText, Kvi
if(p->unicode() == '\'')
{
// special case for the ' character which can be part of a word in many languages
- if(!pWordBegin) // word not started
+ if(!pWordBegin) // word not started
pNonWordBegin = p; // then start a nonwod
- // else keep current state
+ // else keep current state
}
else
{
@@ -485,7 +485,7 @@ void KviInputEditor::splitTextIntoSpellCheckerBlocks(const QString & szText, Kvi
{
// a word to spellcheck
if((p - 1)->unicode() == '\'') // exclude the trailing ' from the word
- p--; // go back one char, so it will become a non-word
+ p--; // go back one char, so it will become a non-word
QString szWord(pWordBegin, p - pWordBegin);
ADD_SPELLCHECKER_BLOCK(lBuffer, szWord, pWordBegin - pBufferBegin, true, checkWordSpelling(szWord));
@@ -535,7 +535,7 @@ void KviInputEditor::rebuildTextBlocks()
m_p->bTextBlocksDirty = false;
if(lSpellCheckerBlocks.isEmpty()) // should never happen, but well...
- return; // nothing to do
+ return; // nothing to do
#define NOT_CONTROL_CHAR() \
( \
@@ -588,7 +588,6 @@ void KviInputEditor::rebuildTextBlocks()
}
// control char
-
switch(c)
{
case KviControlCodes::Bold:
@@ -730,8 +729,7 @@ void KviInputEditor::rebuildTextBlocks()
if(m_iSelectionEnd >= iCurEnd)
{
- // selection ends after or at the end of this block
- }
+ } // selection ends after or at the end of this block
else
{
// selection ends in the middle of the block
@@ -928,9 +926,7 @@ void KviInputEditor::drawContents(QPainter * p)
if(pBlock->uFlags & KviInputEditorTextBlock::IsSpellingMistake)
{
- p->setPen(QPen(Qt::red, 1));
-
- // red overlay
+ p->setPen(QPen(Qt::red, 1)); // red overlay
int iY = iTextBaseline + fm->descent() - 1;
p->fillRect(QRectF(fCurX, iTop, pBlock->fWidth, iY - iTop), QColor(255, 0, 0, 30)); // alpha = 30
p->drawLine(QPointF(fCurX, iY), QPointF(fCurX + pBlock->fWidth, iY));
@@ -1116,7 +1112,6 @@ void KviInputEditor::showContextPopup(const QPoint & pos)
pAction->setEnabled(false);
else
pAction->setEnabled(!m_bReadOnly);
-
if(m_bSpSlowFlag)
pAction = g_pInputPopup->addAction(__tr2qs("Stop Paste"), this, SLOT(stopPasteSlow())); /*G&N 2005*/
@@ -3428,5 +3423,5 @@ void KviInputEditor::toggleCommandMode()
void KviInputEditor::dummy()
{
- // this function does nothing. check the header file for explanation
-}
+} // this function does nothing. check the header file for explanation
+
diff --git a/src/modules/objects/KvsObject_multiLineEdit.cpp b/src/modules/objects/KvsObject_multiLineEdit.cpp
index b860b6f06..955091b6d 100644
--- a/src/modules/objects/KvsObject_multiLineEdit.cpp
+++ b/src/modules/objects/KvsObject_multiLineEdit.cpp
@@ -356,7 +356,6 @@ bool KvsObject_textedit::functionSetWordWrap(KviKvsObjectFunctionCall * c)
bool KvsObject_textedit::functionWordWrap(KviKvsObjectFunctionCall * c)
{
-
if(!widget())
return true;
QTextEdit::LineWrapMode mode = ((QTextEdit *)widget())->lineWrapMode();
@@ -370,7 +369,6 @@ bool KvsObject_textedit::functionWordWrap(KviKvsObjectFunctionCall * c)
else
szWrapMode = "FixedColumnWidth";
c->returnValue()->setString(szWrapMode);
-
return true;
}
@@ -392,7 +390,6 @@ bool KvsObject_textedit::functionWordWrapWidth(KviKvsObjectFunctionCall * c)
if(widget())
c->returnValue()->setInteger(((QTextEdit *)widget())->lineWrapColumnOrWidth());
-
return true;
}
@@ -840,7 +837,6 @@ bool KvsObject_textedit::functionsaveFile(KviKvsObjectFunctionCall * c)
bool bRet = KviFileUtils::writeFile(szFile, szData);
if(!bRet)
c->warning(__tr2qs("Failed to write to file '%Q': the destination couldn't be opened"), &szFile);
-
return true;
}