1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

be verbose with a warning if reading of a file fails

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2097 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
ligi 2010-11-09 04:24:04 +00:00 committed by ligi
parent 8e3813327c
commit a9ba6464d1

View File

@ -239,7 +239,12 @@ bool UAVObjectGenerator::processAll()
QString UAVObjectGenerator::readFile(QString name)
{
QFile file(name);
if (!file.open(QFile::ReadOnly)) return QString();
if (!file.open(QFile::ReadOnly))
{
sout << "Warning: Could not open " << name << endl;
return QString();
}
QTextStream fileStr(&file);
QString str = fileStr.readAll();
file.close();