Fix trailing whitespaces

Fixed some whitespaces "errors" which i found when going through the source.
This commit is contained in:
Michael Vetter
2014-07-29 14:59:32 +02:00
parent c2fca955c4
commit 61621516bc
24 changed files with 915 additions and 915 deletions
+19 -19
View File
@@ -46,7 +46,7 @@
FilterChain::~FilterChain()
{
QMutableListIterator<Filter*> iter(*this);
while ( iter.hasNext() )
{
Filter* filter = iter.next();
@@ -140,7 +140,7 @@ void TerminalImageFilterChain::setImage(const Character* const image , int lines
PlainTextDecoder decoder;
decoder.setTrailingWhitespace(false);
// setup new shared buffers for the filters to process on
QString* newBuffer = new QString();
QList<int>* newLinePositions = new QList<int>();
@@ -166,7 +166,7 @@ void TerminalImageFilterChain::setImage(const Character* const image , int lines
// being treated as part of a link that occurs at the start of the next line
//
// the downside is that links which are spread over more than one line are not
// highlighted.
// highlighted.
//
// TODO - Use the "line wrapped" attribute associated with lines in a
// terminal image to avoid adding this imaginary character for wrapped
@@ -218,7 +218,7 @@ void Filter::getLineColumn(int position , int& startLine , int& startColumn)
else
nextLine = _linePositions->value(i+1);
if ( _linePositions->value(i) <= position && position < nextLine )
if ( _linePositions->value(i) <= position && position < nextLine )
{
startLine = i;
startColumn = string_width(buffer()->mid(_linePositions->value(i),position - _linePositions->value(i)));
@@ -226,7 +226,7 @@ void Filter::getLineColumn(int position , int& startLine , int& startColumn)
}
}
}
/*void Filter::addLine(const QString& text)
{
@@ -248,7 +248,7 @@ void Filter::addHotSpot(HotSpot* spot)
for (int line = spot->startLine() ; line <= spot->endLine() ; line++)
{
_hotspots.insert(line,spot);
}
}
}
QList<Filter::HotSpot*> Filter::hotSpots() const
{
@@ -266,12 +266,12 @@ Filter::HotSpot* Filter::hotSpotAt(int line , int column) const
while (spotIter.hasNext())
{
HotSpot* spot = spotIter.next();
if ( spot->startLine() == line && spot->startColumn() > column )
continue;
if ( spot->endLine() == line && spot->endColumn() < column )
continue;
return spot;
}
@@ -342,7 +342,7 @@ QStringList RegExpFilter::HotSpot::capturedTexts() const
return _capturedTexts;
}
void RegExpFilter::setRegExp(const QRegExp& regExp)
void RegExpFilter::setRegExp(const QRegExp& regExp)
{
_searchText = regExp;
}
@@ -385,14 +385,14 @@ void RegExpFilter::process()
endLine,endColumn);
spot->setCapturedTexts(_searchText.capturedTexts());
addHotSpot( spot );
addHotSpot( spot );
pos += _searchText.matchedLength();
// if matchedLength == 0, the program will get stuck in an infinite loop
if ( _searchText.matchedLength() == 0 )
pos = -1;
}
}
}
}
RegExpFilter::HotSpot* RegExpFilter::newHotSpot(int startLine,int startColumn,
@@ -420,16 +420,16 @@ QString UrlFilter::HotSpot::tooltip() const
const UrlType kind = urlType();
if ( kind == StandardUrl )
return QString();
return QString();
else if ( kind == Email )
return QString();
return QString();
else
return QString();
}
UrlFilter::HotSpot::UrlType UrlFilter::HotSpot::urlType() const
{
QString url = capturedTexts().first();
if ( FullUrlRegExp.exactMatch(url) )
return StandardUrl;
else if ( EmailAddressRegExp.exactMatch(url) )
@@ -462,24 +462,24 @@ void UrlFilter::HotSpot::activate(QObject* object)
{
url.prepend("http://");
}
}
}
else if ( kind == Email )
{
url.prepend("mailto:");
}
QDesktopServices::openUrl(QUrl(url));
//new KRun(url,QApplication::activeWindow());
}
}
// Note: Altering these regular expressions can have a major effect on the performance of the filters
// Note: Altering these regular expressions can have a major effect on the performance of the filters
// used for finding URLs in the text, especially if they are very general and could match very long
// pieces of text.
// Please be careful when altering them.
//regexp matches:
// full url:
// full url:
// protocolname:// or www. followed by anything other than whitespaces, <, >, ' or ", and ends before whitespaces, <, >, ', ", ], !, comma and dot
const QRegExp UrlFilter::FullUrlRegExp("(www\\.(?!\\.)|[a-z][a-z0-9+.-]*://)[^\\s<>'\"]+[^!,\\.\\s<>'\"\\]]");
// email address:
@@ -536,7 +536,7 @@ QList<QAction*> UrlFilter::HotSpot::actions()
list << openAction;
list << copyAction;
return list;
return list;
}
//#include "Filter.moc"