diff --git a/dialogs/newitemdialog.cpp b/dialogs/newitemdialog.cpp index 3455f54..a3760c2 100644 --- a/dialogs/newitemdialog.cpp +++ b/dialogs/newitemdialog.cpp @@ -64,7 +64,7 @@ void NewItemDialog::createContent() { } void NewItemDialog::accept() { - QHash itemValues; + ModelItemValues itemValues; // TODO (after refactoring data structure for input widgets) use iteration through the relevant // roles and their input widgets itemValues.insert(NameRole, m_nameEdit->text()); @@ -73,7 +73,7 @@ void NewItemDialog::accept() { itemValues.insert(AmountRole, m_amountBox->value()); itemValues.insert(FactorRole, m_factorBox->value()); - const QByteArray jsonDoc = JsonParser::itemValuesListToJson({itemValues}, ITEM_KEY_STRING); + const QByteArray jsonDoc = JsonParser::itemValuesListToJson({itemValues}, ITEMS_KEY_STRING); emit addItems(jsonDoc); // resetContent(); diff --git a/mainwindow.cpp b/mainwindow.cpp index 6641ba2..a40ea35 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -306,7 +306,7 @@ void MainWindow::postItems() { showStatusMessage(tr("Invoked 'Server|Post items'")); const QModelIndex currentIndex = ui->tableView->currentIndex(); const QByteArray jsonData = m_proxyModel->jsonDataForServer(currentIndex); - emit m_core->sendItemToServer(jsonData); + emit m_core->postItemToServer(jsonData); } void MainWindow::createActions() {