From 9467980fdb3b0ba4730f9f06e7aceb205c2484e6 Mon Sep 17 00:00:00 2001 From: skyjake Date: Sat, 26 Jan 2013 20:47:54 +0200 Subject: [PATCH] libdeng2: Added a way to adjust line width of MonospaceLogSinkFormatter --- .../include/de/core/monospacelogsinkformatter.h | 10 ++++++++++ .../libdeng2/src/core/monospacelogsinkformatter.cpp | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/doomsday/libdeng2/include/de/core/monospacelogsinkformatter.h b/doomsday/libdeng2/include/de/core/monospacelogsinkformatter.h index ddb68d5d92..b4904348ec 100644 --- a/doomsday/libdeng2/include/de/core/monospacelogsinkformatter.h +++ b/doomsday/libdeng2/include/de/core/monospacelogsinkformatter.h @@ -35,6 +35,16 @@ class MonospaceLogSinkFormatter : public LogSink::IFormatter QList 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; diff --git a/doomsday/libdeng2/src/core/monospacelogsinkformatter.cpp b/doomsday/libdeng2/src/core/monospacelogsinkformatter.cpp index 51403bfe99..d0dee70dd6 100644 --- a/doomsday/libdeng2/src/core/monospacelogsinkformatter.cpp +++ b/doomsday/libdeng2/src/core/monospacelogsinkformatter.cpp @@ -178,4 +178,14 @@ QList MonospaceLogSinkFormatter::logEntryToTextLines(LogEntry const &ent return resultLines; } +void MonospaceLogSinkFormatter::setMaxLength(duint maxLength) +{ + _maxLength = maxLength; +} + +duint MonospaceLogSinkFormatter::maxLength() const +{ + return _maxLength; +} + } // namespace de