Skip to content

Commit

Permalink
libdeng2: Fixed build and removed redundant functionality in LogSinks
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 26, 2013
1 parent f93a6d9 commit cc43694
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 38 deletions.
2 changes: 0 additions & 2 deletions doomsday/libdeng2/include/de/core/debuglogsink.h
Expand Up @@ -32,10 +32,8 @@ class DebugLogSink : public LogSink
{
public:
DebugLogSink(QtMsgType msgType);

~DebugLogSink();

LogSink &operator << (LogEntry const &entry);
LogSink &operator << (String const &plainText);

private:
Expand Down
2 changes: 0 additions & 2 deletions doomsday/libdeng2/include/de/core/filelogsink.h
Expand Up @@ -34,8 +34,6 @@ class FileLogSink : public LogSink
public:
FileLogSink(File &outputFile);

LogSink &operator << (LogEntry const &entry);

LogSink &operator << (String const &plainText);

void flush();
Expand Down
7 changes: 5 additions & 2 deletions doomsday/libdeng2/include/de/core/logsink.h
Expand Up @@ -79,9 +79,12 @@ class DENG2_PUBLIC LogSink
* isAccepted() whether this is an acceptable entry according to the mode
* of the sink.
*
* @param entry
* The default implementation uses the formatter to convert the entry
* to one or more lines of text.
*
* @param entry Log entry to output.
*/
virtual LogSink &operator << (LogEntry const &entry) = 0;
virtual LogSink &operator << (LogEntry const &entry);

virtual LogSink &operator << (String const &plainText) = 0;

Expand Down
2 changes: 0 additions & 2 deletions doomsday/libdeng2/include/de/core/textstreamlogsink.h
Expand Up @@ -40,8 +40,6 @@ class TextStreamLogSink : public LogSink

~TextStreamLogSink();

LogSink &operator << (LogEntry const &entry);

LogSink &operator << (String const &plainText);

void flush();
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libdeng2/include/de/widgets/animation.h
Expand Up @@ -130,7 +130,7 @@ class Animation : public ISerializable
* @param value New value for the Animation, set without a transition.
*/
inline Animation &operator = (float value) {
setValue(v);
setValue(value);
return *this;
}

Expand Down
9 changes: 0 additions & 9 deletions doomsday/libdeng2/src/core/debuglogsink.cpp
Expand Up @@ -31,15 +31,6 @@ DebugLogSink::~DebugLogSink()
delete _qs;
}

LogSink &DebugLogSink::operator << (LogEntry const &entry)
{
foreach(String line, _format.logEntryToTextLines(entry))
{
*_qs << line;
}
return *this;
}

LogSink &DebugLogSink::operator << (String const &plainText)
{
*_qs << plainText.toUtf8().constData();
Expand Down
9 changes: 0 additions & 9 deletions doomsday/libdeng2/src/core/filelogsink.cpp
Expand Up @@ -25,15 +25,6 @@ FileLogSink::FileLogSink(File &outputFile)
: LogSink(_format), _file(outputFile)
{}

LogSink &FileLogSink::operator << (LogEntry const &entry)
{
foreach(String line, _format.logEntryToTextLines(entry))
{
*this << line;
}
return *this;
}

LogSink &FileLogSink::operator << (String const &plainText)
{
_file << Block((plainText + "\n").toUtf8());
Expand Down
11 changes: 11 additions & 0 deletions doomsday/libdeng2/src/core/logsink.cpp
Expand Up @@ -61,4 +61,15 @@ LogSink::IFormatter *LogSink::formatter()
return _formatter;
}

LogSink &LogSink::operator << (LogEntry const &entry)
{
DENG2_ASSERT(formatter());

foreach(String line, formatter()->logEntryToTextLines(entry))
{
*this << line;
}
return *this;
}

} // namespace de
9 changes: 0 additions & 9 deletions doomsday/libdeng2/src/core/textstreamlogsink.cpp
Expand Up @@ -32,15 +32,6 @@ TextStreamLogSink::~TextStreamLogSink()
delete _ts;
}

LogSink &TextStreamLogSink::operator << (LogEntry const &entry)
{
foreach(String line, _format.logEntryToTextLines(entry))
{
*this << line;
}
return *this;
}

LogSink &TextStreamLogSink::operator << (String const &plainText)
{
*_ts << plainText + "\n";
Expand Down
4 changes: 2 additions & 2 deletions doomsday/libdeng2/src/widgets/animation.cpp
Expand Up @@ -260,7 +260,7 @@ Clock const &Animation::clock()
DENG2_ASSERT(_clock != 0);
if(!_clock)
{
throw ClockMissing("Animation::clock", "Animation has no clock");
throw ClockMissingError("Animation::clock", "Animation has no clock");
}
return *_clock;
}
Expand Down Expand Up @@ -308,7 +308,7 @@ Time Animation::currentTime()
DENG2_ASSERT(_clock != 0);
if(!_clock)
{
throw ClockMissing("Animation::clock", "Animation has no clock");
throw ClockMissingError("Animation::clock", "Animation has no clock");
}
return _clock->time();
}
Expand Down

0 comments on commit cc43694

Please sign in to comment.