Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[qt] Replaces numbered place marker %2 with %1. #12092

Conversation

l2a5b1
Copy link
Contributor

@l2a5b1 l2a5b1 commented Jan 4, 2018

This PR closes #12015 in which @chen610620 suggests to replace numbered place marker %2 with %1.

Calling member functionQString::arg() on a QString object with one arbitrary numbered place marker within the range [1,99] works, because QString::arg() replaces the lowest numbered place marker in the QString object it is called on.

QString::arg documentation:

Returns a copy of this string with the lowest numbered place marker replaced by string a, i.e., %1, %2, ..., %99.

I suspect that the %2 marker is just an unfortunate typo or the remainder of a string that used to have multiple numbered place markers.

This PR replaces the numbered place marker %2 with %1 to avoid any confusion in the future.

Replaces numbered place marker %2 with %1, because the QString::arg() member function is called once on the string used to create the QString object.
@fanquake fanquake added the GUI label Jan 4, 2018
@jb55
Copy link
Contributor

jb55 commented Jan 5, 2018 via email

@maflcko
Copy link
Member

maflcko commented Jan 5, 2018

Thanks. I missed this in 6dd3a44

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

utACK 8a93543419300bd78e189429e003c8b17c1b983a
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJaT+/rAAoJENLqSFDnUoslzKgP/3KtG/W3eHfzfzWRDXGvCBeb
TmGD4b3hEqMFz63Ns/6jptouuaHWz1T8YMX1Jgzj001Vr8BilbkiusQP1COsJQiA
Xdqvlko811P8ES2SPQVOxD57lZttaSICQpykT0MI3HcWqEqZzLP1a0bWdQkW1Try
DhQo2ycKZKKu1+5rZ/a8AAVnaz0gylQVjiosDKJlNp9jtl6/myc+M+cynSQMkmdR
/2XNEnmPykimhNpdtOTDnr/fDo5X31UQuzWAAyuigOVv3V0DEfzO7WHLYetqwRbE
oKcE/J8mZziN2Yz2EjGGM6PclcQ1C0E4XD99abIt5w9utbQoxrgdYcvGlGQtbrIx
c/Da2x4Dw0Vmw80z8DbAG28/oFI1+3MhY2+bd0iO6k4bFq+AeklRcfRRaPbwtlfI
zZNmYSucZp8WyiuqR3lwClQZejtRXfbQlYWj3rGotXIsYuAYJ5WalQUo4v8NNzbV
ysKdbrmEgnWatYg252haXZTX6eQABtPfARySePT+GxR2RhBgH6km0FcAI0Qa+qif
FVCO/FZu6320PZu34FmIQidGjJyn/Kk2PU+fblb63VtD2JNiP3dvyzPK5WtTP/km
xNaXBhjl/iueW5TBJ8HS+mXyA6fIDvu6M6UZCoBhQKmzDDZTWCD7vdWkhtcLu9Wu
jBfOLZDkNzAiG2TRvQ/K
=IXGR
-----END PGP SIGNATURE-----

@maflcko maflcko merged commit 8a93543 into bitcoin:master Jan 5, 2018
maflcko pushed a commit that referenced this pull request Jan 5, 2018
8a93543 Replaces numbered place marker %2 with %1. (251)

Pull request description:

  This PR closes #12015 in which @chen610620 suggests to replace numbered place marker `%2` with `%1`.

  Calling member function`QString::arg()` on a `QString` object with one arbitrary numbered place marker within the range [1,99] works, because `QString::arg()` replaces the _lowest_ numbered place marker in the `QString` object it is called on.

  [QString::arg documentation:](http://doc.qt.io/qt-5/qstring.html#arg)
  > Returns a copy of this string with the lowest numbered place marker replaced by string a, i.e., %1, %2, ..., %99.

  I suspect that the `%2` marker is just an unfortunate typo or the remainder of a string that used to have multiple numbered place markers.

  This PR replaces the numbered place marker `%2` with `%1` to avoid any confusion in the future.

Tree-SHA512: 0bb40cf3b9824e1eeba0a184e72358b30d20e8261e12deb287155b7cc8317ad0b0787ef1d0671325eb8bccc9e51b3037d737015749338c31cf400930840e56b6
@l2a5b1 l2a5b1 deleted the patch/12015/sendcoinsdialog-replaces-numbered-place-marker branch February 12, 2018 14:36
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Sep 27, 2019
Summary:
This PR closes #12015 in which @chen610620 suggests to replace numbered place marker `%2` with `%1`.

Backport of Bitcoin Core PR12092
bitcoin/bitcoin#12092

Test Plan:
```
make
./src/qt/bitcoin-qt -regtest
```

1. Open the "Send" dialog.
2. Enter a BCH testnet address.
3. Enter a valid amount.
4. Press "Send" button, at bottom.
5. Check that the confirmation message is Ok.

Reviewers: Fabien, #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D4077
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maybe A bug in qt/sendcoinsdialog.cpp:339
4 participants