refs #621, use getXX for setup members, no idea why I have not used our standard

This commit is contained in:
Klaus Basan
2016-03-19 01:37:41 +01:00
parent 18c1da8502
commit 87a0c75f43
16 changed files with 78 additions and 70 deletions

View File

@@ -942,9 +942,9 @@ namespace BlackGui
CStatusMessage CViewBase<ModelClass, ContainerType, ObjectType>::ps_loadJson()
{
static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::validation()}));
QString fileName = QFileDialog::getOpenFileName(nullptr,
tr("Load data file"), getDefaultFilename(),
tr("swift (*.json *.txt)"));
const QString fileName = QFileDialog::getOpenFileName(nullptr,
tr("Load data file"), getDefaultFilename(),
tr("swift (*.json *.txt)"));
if (fileName.isEmpty()) { return CStatusMessage(cats, CStatusMessage::SeverityDebug, "Load canceled"); }
QString json(CFileUtils::readFileToString(fileName));
if (json.isEmpty())
@@ -961,9 +961,9 @@ namespace BlackGui
CStatusMessage CViewBase<ModelClass, ContainerType, ObjectType>::ps_saveJson() const
{
static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::validation()}));
QString fileName = QFileDialog::getSaveFileName(nullptr,
tr("Save data file"), getDefaultFilename(),
tr("swift (*.json *.txt)"));
const QString fileName = QFileDialog::getSaveFileName(nullptr,
tr("Save data file"), getDefaultFilename(),
tr("swift (*.json *.txt)"));
if (fileName.isEmpty()) { return CStatusMessage(cats, CStatusMessage::SeverityDebug, "Save canceled"); }
const QString json(this->toJsonString());
bool ok = CFileUtils::writeStringToFileInBackground(json, fileName);