Using "model/metadata.h" for file and JSON object naming as well. Using all upper case for naming static meta data constants and functions.
This commit is contained in:
@ -12,6 +12,7 @@
|
||||
#include "CoreConfig.h"
|
||||
#include "constants.h"
|
||||
#include "data/filehandler.h"
|
||||
#include "model/metadata.h"
|
||||
#include "model/tablemodel.h"
|
||||
|
||||
#include <QtGui/QUndoStack>
|
||||
@ -98,7 +99,7 @@ void GenericCore::saveItems() {
|
||||
qDebug() << "saving items...";
|
||||
|
||||
const QJsonDocument doc = m_mainModel->getAllItemsAsJsonDoc();
|
||||
const bool successfulSave = FileHandler::saveToFile(doc, "items.json");
|
||||
const bool successfulSave = FileHandler::saveToFile(doc, ITEM_FILE_NAME);
|
||||
if (successfulSave) {
|
||||
// QStringList completedTaskStrings = m_model->completedTasks();
|
||||
// appendCompletedTasksToFile(completedTaskStrings, "completed.txt");
|
||||
@ -122,7 +123,7 @@ void GenericCore::setupModels() {
|
||||
*/
|
||||
void GenericCore::initModelData() {
|
||||
qInfo() << "Trying to read model data from file...";
|
||||
const QByteArray jsonDoc = FileHandler::loadJSONDataFromFile("items.json");
|
||||
const QByteArray jsonDoc = FileHandler::loadJSONDataFromFile(ITEM_FILE_NAME);
|
||||
// qDebug() << "jsonDoc:" << jsonDoc;
|
||||
// TODO decide on lack of file(s) (config, data) if example items should be generated
|
||||
// (see welcome wizard)
|
||||
|
||||
Reference in New Issue
Block a user