Clean up trailing whitespaces

This commit is contained in:
Jerome Leclanche
2015-07-09 20:22:48 +02:00
parent da6838df1a
commit 72ffc262eb
32 changed files with 1343 additions and 1343 deletions
+19 -19
View File
@@ -47,7 +47,7 @@ using namespace Konsole;
FilterChain::~FilterChain()
{
QMutableListIterator<Filter*> iter(*this);
while ( iter.hasNext() )
{
Filter* filter = iter.next();
@@ -141,7 +141,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>();
@@ -167,7 +167,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
@@ -219,7 +219,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)));
@@ -227,7 +227,7 @@ void Filter::getLineColumn(int position , int& startLine , int& startColumn)
}
}
}
/*void Filter::addLine(const QString& text)
{
@@ -249,7 +249,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
{
@@ -267,12 +267,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;
}
@@ -343,7 +343,7 @@ QStringList RegExpFilter::HotSpot::capturedTexts() const
return _capturedTexts;
}
void RegExpFilter::setRegExp(const QRegExp& regExp)
void RegExpFilter::setRegExp(const QRegExp& regExp)
{
_searchText = regExp;
}
@@ -386,14 +386,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,
@@ -425,16 +425,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) )
@@ -465,23 +465,23 @@ void UrlFilter::HotSpot::activate(const QString& actionName)
{
url.prepend("http://");
}
}
}
else if ( kind == Email )
{
url.prepend("mailto:");
}
_urlObject->emitActivated(url);
}
}
// 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:
@@ -551,7 +551,7 @@ QList<QAction*> UrlFilter::HotSpot::actions()
list << openAction;
list << copyAction;
return list;
return list;
}
//#include "Filter.moc"