Reordered GenericCore function implementations according to their declarations.
This commit is contained in:
@ -98,23 +98,6 @@ std::shared_ptr<GeneralSortFilterModel> GenericCore::getSortFilterModel() const
|
|||||||
return m_sortFilterModel;
|
return m_sortFilterModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Save items to default file (in standard location).
|
|
||||||
* @brief GenericCore::saveItems Saves item fo file.
|
|
||||||
*/
|
|
||||||
void GenericCore::saveItems() {
|
|
||||||
qDebug() << "saving items...";
|
|
||||||
|
|
||||||
const QJsonDocument doc = m_mainModel->getAllItemsAsJsonDoc();
|
|
||||||
const bool successfulSave = FileHandler::saveToFile(doc, ITEMS_FILE_NAME);
|
|
||||||
if (successfulSave) {
|
|
||||||
m_modelUndoStack->setClean();
|
|
||||||
emit displayStatusMessage(QString("Items saved."));
|
|
||||||
} else {
|
|
||||||
emit displayStatusMessage(QString("Error: Items couldn't be saved."));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GenericCore::importCSVFile(const QString& filePath) {
|
void GenericCore::importCSVFile(const QString& filePath) {
|
||||||
qInfo() << "importing items from CSV...";
|
qInfo() << "importing items from CSV...";
|
||||||
qDebug() << "filePath:" << filePath;
|
qDebug() << "filePath:" << filePath;
|
||||||
@ -158,6 +141,22 @@ bool GenericCore::isSyncServerSetup() const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save items to default file (in standard location).
|
||||||
|
* @brief GenericCore::saveItems Saves item fo file.
|
||||||
|
*/
|
||||||
|
void GenericCore::saveItems() {
|
||||||
|
qDebug() << "saving items...";
|
||||||
|
|
||||||
|
const QJsonDocument doc = m_mainModel->getAllItemsAsJsonDoc();
|
||||||
|
const bool successfulSave = FileHandler::saveToFile(doc, ITEMS_FILE_NAME);
|
||||||
|
if (successfulSave) {
|
||||||
|
m_modelUndoStack->setClean();
|
||||||
|
emit displayStatusMessage(QString("Items saved."));
|
||||||
|
} else {
|
||||||
|
emit displayStatusMessage(QString("Error: Items couldn't be saved."));
|
||||||
|
}
|
||||||
|
}
|
||||||
void GenericCore::onSendItemTriggered(const QByteArray& jsonData) {
|
void GenericCore::onSendItemTriggered(const QByteArray& jsonData) {
|
||||||
m_serverCommunicator->postItems(jsonData);
|
m_serverCommunicator->postItems(jsonData);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user