Commit 2e198ce3 authored by Christopher Tenter's avatar Christopher Tenter
Browse files

added QFile open() call

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14577 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 30657521
......@@ -263,13 +263,16 @@ void ShaderGenerator::addIncludeFile(QString _fileName)
{
QFile file(_fileName);
QTextStream fileStream(&file);
while (!fileStream.atEnd())
if (file.open(QIODevice::ReadOnly | QIODevice::Text))
{
QString tmpLine = fileStream.readLine();
QTextStream fileStream(&file);
while (!fileStream.atEnd())
{
QString tmpLine = fileStream.readLine();
imports_.push_back(tmpLine.simplified());
imports_.push_back(tmpLine.simplified());
}
}
}
......@@ -279,11 +282,14 @@ void ShaderGenerator::addIncludeFile(QString _fileName)
void ShaderGenerator::saveToFile(const char* _fileName)
{
QFile file(_fileName);
QTextStream fileStream(&file);
if (file.open(QIODevice::WriteOnly | QIODevice::Text))
{
QTextStream fileStream(&file);
QString it;
foreach(it, code_)
fileStream << it << '\n';
QString it;
foreach(it, code_)
fileStream << it << '\n';
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment