1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file src/visualizer/LogInput.cpp
12 #include "visualizer/LogInput.h"
13 #include "util/MessageSystem.h"
15 namespace Visualizer
{
17 LogInput::LogInput(const std::string
& filename
, Visualizer::ArtisanManager
*artisanManager
)
18 : DataInput(artisanManager
) {
19 m_file
.setFileName(QString::fromStdString(filename
));
21 m_file
.open(QIODevice::ReadOnly
);
23 connect(&m_timer
, SIGNAL(timeout()), this, SLOT(readMore()));
24 connect(this, SIGNAL(moreData(QByteArray
)), this, SLOT(addData(QByteArray
)));
29 LogInput::~LogInput() {
33 void LogInput::readMore() {
34 QByteArray more
= m_file
.read(1048576);
36 if(more
.size() == 0) m_timer
.stop();
42 } // namespace Visualizer