Replace std::cout and std::cerr with qDebug and qWarning.

This commit is contained in:
Jim Evins
2014-09-26 21:44:33 -04:00
parent 3d9875545c
commit f402599b8a
9 changed files with 162 additions and 179 deletions
+10 -12
View File
@@ -23,7 +23,7 @@
#include <QFile>
#include <QDomDocument>
#include <QDomNode>
#include <iostream>
#include <QtDebug>
#include "Category.h"
#include "XmlUtil.h"
@@ -39,9 +39,8 @@ namespace libglabels
if ( !file.open( QFile::ReadOnly | QFile::Text) )
{
std::cerr << "Error: Cannot read file " << qPrintable(fileName)
<< ": " << qPrintable(file.errorString())
<< std::endl;
qWarning() << "Error: Cannot read file " << fileName
<< ": " << file.errorString();
return false;
}
@@ -53,17 +52,16 @@ namespace libglabels
if ( !doc.setContent( &file, false, &errorString, &errorLine, &errorColumn ) )
{
std::cerr << "Error: Parse error at line " << errorLine
<< "column " << errorColumn
<< ": " << qPrintable(errorString)
<< std::endl;
qWarning() << "Error: Parse error at line " << errorLine
<< "column " << errorColumn
<< ": " << errorString;
return false;
}
QDomElement root = doc.documentElement();
if ( root.tagName() != "Glabels-categories" )
{
std::cerr << "Error: Not a Glabels-categories file" << std::endl;
qWarning() << "Error: Not a Glabels-categories file.";
return false;
}
@@ -82,9 +80,9 @@ namespace libglabels
}
else if ( !child.isComment() )
{
std::cerr << "Warning: bad element: " << qPrintable(child.toElement().tagName())
<< ", Ignored"
<< std::endl;
qWarning() << "Warning: bad element: "
<< child.toElement().tagName()
<< ", Ignored.";
}
}
}