diff --git a/src/gui/basketmodel.cpp b/src/gui/basketmodel.cpp index d063d2e..8441e21 100644 --- a/src/gui/basketmodel.cpp +++ b/src/gui/basketmodel.cpp @@ -1,6 +1,7 @@ #include "basketmodel.h" #include +#include BasketModel::BasketModel(Marketplace* market, QObject* parent) : QAbstractTableModel(parent), marketplace_(market) @@ -79,20 +80,6 @@ QVariant BasketModel::headerData(int section, Qt::Orientation orientation, int r return ""; } -/* bool BasketModel::insertRows(int row, int count, const QModelIndex& parent) -{ - //emit beginInsertRows(parent, row, row + count - 1); - //auto article = std::make_unique
(); - //article->createUuid(); - //article->setArticleNo(marketplace_->getNextArticleNo()); - //marketplace_->addArticleToBasket(std::move(article)); - //emit endInsertRows(); - - emit layoutChanged(); - - return true; -} */ - void BasketModel::addArticle(Seller* seller, int price) { emit beginInsertRows(QModelIndex(), marketplace_->getBasket().size(), @@ -100,8 +87,8 @@ void BasketModel::addArticle(Seller* seller, int price) auto article = std::make_unique
(price); article->createUuid(); article->setArticleNo(marketplace_->getNextArticleNo()); + article->setSourceNo(QSettings().value("global/cashPointNo").toInt()); article->setSeller(seller); - // std::cout << "!!! Neuer Artikel: " << article->getPrice() << " Cent \n"; marketplace_->addArticleToBasket(std::move(article)); emit endInsertRows(); }