mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 13:23:06 +02:00
Merge pull request #11524 from zfox23/commerce_fixBuyingFreeItems
Fix buying free items using Commerce system
This commit is contained in:
commit
0f9df93097
4 changed files with 9 additions and 5 deletions
|
@ -35,7 +35,7 @@ Rectangle {
|
|||
property string itemHref;
|
||||
property double balanceAfterPurchase;
|
||||
property bool alreadyOwned: false;
|
||||
property int itemPrice;
|
||||
property int itemPrice: -1;
|
||||
property bool itemIsJson: true;
|
||||
property bool shouldBuyWithControlledFailure: false;
|
||||
property bool debugCheckoutSuccess: false;
|
||||
|
@ -339,7 +339,7 @@ Rectangle {
|
|||
}
|
||||
FiraSansSemiBold {
|
||||
id: itemPriceText;
|
||||
text: root.itemPrice;
|
||||
text: (root.itemPrice === -1) ? "--" : root.itemPrice;
|
||||
// Text size
|
||||
size: 26;
|
||||
// Anchors
|
||||
|
|
|
@ -119,7 +119,9 @@ void QmlCommerce::history() {
|
|||
|
||||
void QmlCommerce::changePassphrase(const QString& oldPassphrase, const QString& newPassphrase) {
|
||||
auto wallet = DependencyManager::get<Wallet>();
|
||||
if ((wallet->getPassphrase()->isEmpty() || wallet->getPassphrase() == oldPassphrase) && !newPassphrase.isEmpty()) {
|
||||
if (wallet->getPassphrase()->isEmpty()) {
|
||||
emit changePassphraseStatusResult(wallet->setPassphrase(newPassphrase));
|
||||
} else if (wallet->getPassphrase() == oldPassphrase && !newPassphrase.isEmpty()) {
|
||||
emit changePassphraseStatusResult(wallet->changePassphrase(newPassphrase));
|
||||
} else {
|
||||
emit changePassphraseStatusResult(false);
|
||||
|
|
|
@ -293,13 +293,15 @@ Wallet::~Wallet() {
|
|||
}
|
||||
}
|
||||
|
||||
void Wallet::setPassphrase(const QString& passphrase) {
|
||||
bool Wallet::setPassphrase(const QString& passphrase) {
|
||||
if (_passphrase) {
|
||||
delete _passphrase;
|
||||
}
|
||||
_passphrase = new QString(passphrase);
|
||||
|
||||
_publicKeys.clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Wallet::writeSecurityImage(const QPixmap* pixmap, const QString& outputFilePath) {
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
void setCKey(const QByteArray& ckey) { _ckey = ckey; }
|
||||
QByteArray getCKey() { return _ckey; }
|
||||
|
||||
void setPassphrase(const QString& passphrase);
|
||||
bool setPassphrase(const QString& passphrase);
|
||||
QString* getPassphrase() { return _passphrase; }
|
||||
bool getPassphraseIsCached() { return !(_passphrase->isEmpty()); }
|
||||
bool walletIsAuthenticatedWithPassphrase();
|
||||
|
|
Loading…
Reference in a new issue