Browse Source

added missing flushes to generator

master
Skycoder42 6 years ago
parent
commit
47d797a0a5
No known key found for this signature in database GPG Key ID: 8E01AD9EF0578D2B
  1. 2
      tools/settingsgenerator/cppsettingsgenerator.cpp
  2. 1
      tools/settingsgenerator/cppsettingsgenerator.h
  3. 2
      tools/settingsgenerator/qmlsettingsgenerator.cpp
  4. 1
      tools/settingsgenerator/qmlsettingsgenerator.h
  5. 1
      tools/settingsgenerator/settingsgeneratorimpl.h
  6. 1
      tools/settingsgenerator/settingstranslator.cpp

2
tools/settingsgenerator/cppsettingsgenerator.cpp

@ -23,11 +23,13 @@ void CppSettingsGenerator::process(const QString &inPath)
if(!_hdrFile.open(QIODevice::WriteOnly | QIODevice::Text))
throw FileException{_hdrFile};
writeHeader(settings);
_hdr.flush();
_hdrFile.close();
if(!_srcFile.open(QIODevice::WriteOnly | QIODevice::Text))
throw FileException{_srcFile};
writeSource(settings);
_src.flush();
_srcFile.close();
}

1
tools/settingsgenerator/cppsettingsgenerator.h

@ -2,6 +2,7 @@
#define CPPSETTINGSGENERATOR_H
#include "settingsgeneratorimpl.h"
#include <QTextStream>
class CppSettingsGenerator : public SettingsGeneratorImpl
{

2
tools/settingsgenerator/qmlsettingsgenerator.cpp

@ -24,11 +24,13 @@ void QmlSettingsGenerator::process(const QString &inPath)
if(!_hdrFile.open(QIODevice::WriteOnly | QIODevice::Text))
throw FileException{_hdrFile};
auto typeNum = writeHeader(settings, QFileInfo{inPath}.completeBaseName() + QStringLiteral(".h"));
_hdr.flush();
_hdrFile.close();
if(!_srcFile.open(QIODevice::WriteOnly | QIODevice::Text))
throw FileException{_srcFile};
writeSource(settings, typeNum);
_src.flush();
_srcFile.close();
}

1
tools/settingsgenerator/qmlsettingsgenerator.h

@ -4,6 +4,7 @@
#include "settingsgeneratorimpl.h"
#include <tuple>
#include <QSet>
#include <QTextStream>
class QmlSettingsGenerator : public SettingsGeneratorImpl
{

1
tools/settingsgenerator/settingsgeneratorimpl.h

@ -2,7 +2,6 @@
#define SETTINGSGENERATOR_H
#include <QFile>
#include <QTextStream>
#include "qsettingsgenerator.h"
#include "settingsconfigimpl_p.h"

1
tools/settingsgenerator/settingstranslator.cpp

@ -51,6 +51,7 @@ void SettingsTranslator::writeTranslations(const SettingsConfigType &settings, c
_src << "}\n\n"
<< "}\n";
_src.flush();
_srcFile.close();
}

Loading…
Cancel
Save