StelScriptOutput.cpp   StelScriptOutput.cpp 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "StelScriptOutput.hpp" #include "StelScriptOutput.hpp"
#include <QDebug> #include <QDebug>
// Init statics variables. // Init static variables.
QFile StelScriptOutput::outputFile; QFile StelScriptOutput::outputFile;
QString StelScriptOutput::outputText; QString StelScriptOutput::outputText;
void StelScriptOutput::init(const QString& outputFilePath) void StelScriptOutput::init(const QString& outputFilePath)
{ {
outputFile.setFileName(outputFilePath); outputFile.setFileName(outputFilePath);
if (!outputFile.open(QIODevice::WriteOnly | QIODevice::Truncate | QI ODevice::Text | QIODevice::Unbuffered)) if (!outputFile.open(QIODevice::WriteOnly | QIODevice::Truncate | QI ODevice::Text | QIODevice::Unbuffered))
qDebug() << "ERROR: Cannot open output.txt file"; qDebug() << "ERROR: Cannot open file" << outputFilePath;
} }
void StelScriptOutput::deinit() void StelScriptOutput::deinit()
{ {
outputFile.close(); outputFile.close();
} }
void StelScriptOutput::writeLog(QString msg) void StelScriptOutput::writeLog(QString msg)
{ {
msg += "\n"; msg += "\n";
outputFile.write(qPrintable(msg), msg.size()); outputFile.write(qPrintable(msg), msg.size());
outputText += msg; outputText += msg;
} }
void StelScriptOutput::reset(void)
{
outputFile.reset();
outputText.clear();
}
 End of changes. 3 change blocks. 
2 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/