Skip to content

Commit

Permalink
libdeng2: Added a way to adjust line width of MonospaceLogSinkFormatter
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 26, 2013
1 parent 8fba507 commit 9467980
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doomsday/libdeng2/include/de/core/monospacelogsinkformatter.h
Expand Up @@ -35,6 +35,16 @@ class MonospaceLogSinkFormatter : public LogSink::IFormatter

QList<String> logEntryToTextLines(LogEntry const &entry);

/**
* Sets the maximum line length. Entries will be wrapped onto multiple
* lines if they don't fit on one line.
*
* @param maxLength Maximum line length.
*/
void setMaxLength(duint maxLength);

duint maxLength() const;

private:
duint _maxLength;
int _minimumIndent;
Expand Down
10 changes: 10 additions & 0 deletions doomsday/libdeng2/src/core/monospacelogsinkformatter.cpp
Expand Up @@ -178,4 +178,14 @@ QList<String> MonospaceLogSinkFormatter::logEntryToTextLines(LogEntry const &ent
return resultLines;
}

void MonospaceLogSinkFormatter::setMaxLength(duint maxLength)
{
_maxLength = maxLength;
}

duint MonospaceLogSinkFormatter::maxLength() const
{
return _maxLength;
}

} // namespace de

0 comments on commit 9467980

Please sign in to comment.