mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 17:39:26 +02:00
Removed QmlCommerce.cpp, Ledger.cpp changes as requested
This commit is contained in:
parent
e5f06690b5
commit
628ec8ec2b
5 changed files with 18 additions and 12 deletions
|
@ -540,8 +540,17 @@ Rectangle {
|
||||||
listView: purchasesContentsList;
|
listView: purchasesContentsList;
|
||||||
getPage: function () {
|
getPage: function () {
|
||||||
console.debug('getPage', purchasesModel.listModelName, filterBar.primaryFilter_filterName, purchasesModel.currentPageToRetrieve, purchasesModel.itemsPerPage);
|
console.debug('getPage', purchasesModel.listModelName, filterBar.primaryFilter_filterName, purchasesModel.currentPageToRetrieve, purchasesModel.itemsPerPage);
|
||||||
|
var editionFilter = "";
|
||||||
|
var primaryFilter = "";
|
||||||
|
|
||||||
|
if (filterBar.primaryFilter_filterName === "proofs") {
|
||||||
|
editionFilter = "proofs";
|
||||||
|
} else {
|
||||||
|
primaryFilter = filterBar.primaryFilter_filterName;
|
||||||
|
}
|
||||||
Commerce.inventory(
|
Commerce.inventory(
|
||||||
filterBar.primaryFilter_filterName,
|
editionFilter,
|
||||||
|
primaryFilter,
|
||||||
filterBar.text,
|
filterBar.text,
|
||||||
purchasesModel.currentPageToRetrieve,
|
purchasesModel.currentPageToRetrieve,
|
||||||
purchasesModel.itemsPerPage
|
purchasesModel.itemsPerPage
|
||||||
|
|
|
@ -152,14 +152,10 @@ void Ledger::balance(const QStringList& keys) {
|
||||||
keysQuery("balance", "balanceSuccess", "balanceFailure");
|
keysQuery("balance", "balanceSuccess", "balanceFailure");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ledger::inventory(const QString& typeFilter, const QString& titleFilter, const int& page, const int& perPage) {
|
void Ledger::inventory(const QString& editionFilter, const QString& typeFilter, const QString& titleFilter, const int& page, const int& perPage) {
|
||||||
QJsonObject params;
|
QJsonObject params;
|
||||||
if (typeFilter == "proofs") {
|
params["edition_filter"] = editionFilter;
|
||||||
params["edition_filter"] = "proofs";
|
params["type_filter"] = typeFilter;
|
||||||
} else {
|
|
||||||
params["type_filter"] = typeFilter;
|
|
||||||
}
|
|
||||||
|
|
||||||
params["title_filter"] = titleFilter;
|
params["title_filter"] = titleFilter;
|
||||||
params["page"] = page;
|
params["page"] = page;
|
||||||
params["per_page"] = perPage;
|
params["per_page"] = perPage;
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
bool receiveAt(const QString& hfc_key, const QString& signing_key, const QByteArray& locker);
|
bool receiveAt(const QString& hfc_key, const QString& signing_key, const QByteArray& locker);
|
||||||
bool receiveAt();
|
bool receiveAt();
|
||||||
void balance(const QStringList& keys);
|
void balance(const QStringList& keys);
|
||||||
void inventory(const QString& typeFilter, const QString& titleFilter, const int& page, const int& perPage);
|
void inventory(const QString& editionFilter, const QString& typeFilter, const QString& titleFilter, const int& page, const int& perPage);
|
||||||
void history(const QStringList& keys, const int& pageNumber, const int& itemsPerPage);
|
void history(const QStringList& keys, const int& pageNumber, const int& itemsPerPage);
|
||||||
void account();
|
void account();
|
||||||
void updateLocation(const QString& asset_id, const QString& location, const bool& alsoUpdateSiblings = false, const bool controlledFailure = false);
|
void updateLocation(const QString& asset_id, const QString& location, const bool& alsoUpdateSiblings = false, const bool controlledFailure = false);
|
||||||
|
|
|
@ -151,7 +151,8 @@ void QmlCommerce::balance() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlCommerce::inventory(const QString& typeFilter,
|
void QmlCommerce::inventory(const QString& editionFilter,
|
||||||
|
const QString& typeFilter,
|
||||||
const QString& titleFilter,
|
const QString& titleFilter,
|
||||||
const int& page,
|
const int& page,
|
||||||
const int& perPage) {
|
const int& perPage) {
|
||||||
|
@ -159,7 +160,7 @@ void QmlCommerce::inventory(const QString& typeFilter,
|
||||||
auto wallet = DependencyManager::get<Wallet>();
|
auto wallet = DependencyManager::get<Wallet>();
|
||||||
QStringList cachedPublicKeys = wallet->listPublicKeys();
|
QStringList cachedPublicKeys = wallet->listPublicKeys();
|
||||||
if (!cachedPublicKeys.isEmpty()) {
|
if (!cachedPublicKeys.isEmpty()) {
|
||||||
ledger->inventory(typeFilter, titleFilter, page, perPage);
|
ledger->inventory(editionFilter, typeFilter, titleFilter, page, perPage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ protected:
|
||||||
|
|
||||||
Q_INVOKABLE void buy(const QString& assetId, int cost, const bool controlledFailure = false);
|
Q_INVOKABLE void buy(const QString& assetId, int cost, const bool controlledFailure = false);
|
||||||
Q_INVOKABLE void balance();
|
Q_INVOKABLE void balance();
|
||||||
Q_INVOKABLE void inventory(const QString& typeFilter = QString(), const QString& titleFilter = QString(), const int& page = 1, const int& perPage = 20);
|
Q_INVOKABLE void inventory(const QString& editionFilter = QString(), const QString& typeFilter = QString(), const QString& titleFilter = QString(), const int& page = 1, const int& perPage = 20);
|
||||||
Q_INVOKABLE void history(const int& pageNumber, const int& itemsPerPage = 100);
|
Q_INVOKABLE void history(const int& pageNumber, const int& itemsPerPage = 100);
|
||||||
Q_INVOKABLE void generateKeyPair();
|
Q_INVOKABLE void generateKeyPair();
|
||||||
Q_INVOKABLE void account();
|
Q_INVOKABLE void account();
|
||||||
|
|
Loading…
Reference in a new issue