Retrieving the JSON data of the current index to send to the server through the proxy model. Sending this data happens by triggering the core.
This commit is contained in:
@ -142,16 +142,15 @@ bool GenericCore::isSyncServerSetup() const {
|
||||
}
|
||||
}
|
||||
|
||||
void GenericCore::onSendItemTriggered(const int row) {
|
||||
// NEXT gather item values from model to send to server
|
||||
m_serverCommunicator->postItems();
|
||||
void GenericCore::onSendItemTriggered(const QByteArray& jsonData) {
|
||||
m_serverCommunicator->postItems(jsonData);
|
||||
}
|
||||
|
||||
void GenericCore::onItemsFetched(const QByteArray jsonDoc) {
|
||||
void GenericCore::onItemsFetched(const QByteArray jsonData) {
|
||||
emit displayStatusMessage("New items fetched.");
|
||||
// TODO ? check compability of JSON structure beforehand?
|
||||
// TODO check if item already exists?
|
||||
m_mainModel->appendItems(jsonDoc);
|
||||
m_mainModel->appendItems(jsonData);
|
||||
}
|
||||
|
||||
void GenericCore::onItemsFetchFailure(const QString errorString) {
|
||||
|
||||
Reference in New Issue
Block a user