Skip to content

Commit 6d6b11e

Browse files
committed
Merge pull request #6408
dca6040 [Qt] remove std namespace polution from code (Philip Kaufmann)
2 parents 8fe5cce + dca6040 commit 6d6b11e

File tree

5 files changed

+11
-20
lines changed

5 files changed

+11
-20
lines changed

src/qt/coincontroldialog.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <QTreeWidget>
3131
#include <QTreeWidgetItem>
3232

33-
using namespace std;
3433
QList<CAmount> CoinControlDialog::payAmounts;
3534
CCoinControl* CoinControlDialog::coinControl = new CCoinControl();
3635
bool CoinControlDialog::fSubtractFeeFromAmount = false;
@@ -442,7 +441,7 @@ QString CoinControlDialog::getPriorityLabel(double dPriority, double mempoolEsti
442441
// shows count of locked unspent outputs
443442
void CoinControlDialog::updateLabelLocked()
444443
{
445-
vector<COutPoint> vOutpts;
444+
std::vector<COutPoint> vOutpts;
446445
model->listLockedCoins(vOutpts);
447446
if (vOutpts.size() > 0)
448447
{
@@ -467,7 +466,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
467466

468467
if (amount > 0)
469468
{
470-
CTxOut txout(amount, (CScript)vector<unsigned char>(24, 0));
469+
CTxOut txout(amount, (CScript)std::vector<unsigned char>(24, 0));
471470
txDummy.vout.push_back(txout);
472471
if (txout.IsDust(::minRelayTxFee))
473472
fDust = true;
@@ -487,8 +486,8 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
487486
int nQuantityUncompressed = 0;
488487
bool fAllowFree = false;
489488

490-
vector<COutPoint> vCoinControl;
491-
vector<COutput> vOutputs;
489+
std::vector<COutPoint> vCoinControl;
490+
std::vector<COutput> vOutputs;
492491
coinControl->ListSelected(vCoinControl);
493492
model->getOutputs(vCoinControl, vOutputs);
494493

@@ -568,7 +567,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
568567
// Never create dust outputs; if we would, just add the dust to the fee.
569568
if (nChange > 0 && nChange < CENT)
570569
{
571-
CTxOut txout(nChange, (CScript)vector<unsigned char>(24, 0));
570+
CTxOut txout(nChange, (CScript)std::vector<unsigned char>(24, 0));
572571
if (txout.IsDust(::minRelayTxFee))
573572
{
574573
if (CoinControlDialog::fSubtractFeeFromAmount) // dust-change will be raised until no dust
@@ -687,10 +686,10 @@ void CoinControlDialog::updateView()
687686
int nDisplayUnit = model->getOptionsModel()->getDisplayUnit();
688687
double mempoolEstimatePriority = mempool.estimatePriority(nTxConfirmTarget);
689688

690-
map<QString, vector<COutput> > mapCoins;
689+
std::map<QString, std::vector<COutput> > mapCoins;
691690
model->listCoins(mapCoins);
692691

693-
BOOST_FOREACH(const PAIRTYPE(QString, vector<COutput>)& coins, mapCoins) {
692+
BOOST_FOREACH(const PAIRTYPE(QString, std::vector<COutput>)& coins, mapCoins) {
694693
QTreeWidgetItem *itemWalletAddress = new QTreeWidgetItem();
695694
itemWalletAddress->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);
696695
QString sWalletAddress = coins.first;

src/qt/paymentrequestplus.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#include <QDebug>
2020
#include <QSslCertificate>
2121

22-
using namespace std;
23-
2422
class SSLVerifyError : public std::runtime_error
2523
{
2624
public:
@@ -49,7 +47,7 @@ bool PaymentRequestPlus::parse(const QByteArray& data)
4947
return true;
5048
}
5149

52-
bool PaymentRequestPlus::SerializeToString(string* output) const
50+
bool PaymentRequestPlus::SerializeToString(std::string* output) const
5351
{
5452
return paymentRequest.SerializeToString(output);
5553
}

src/qt/paymentserver.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
#include <QUrlQuery>
4747
#endif
4848

49-
using namespace std;
50-
5149
const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds
5250
const QString BITCOIN_IPC_PREFIX("bitcoin:");
5351
// BIP70 payment protocol messages
@@ -647,7 +645,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien
647645
// Create a new refund address, or re-use:
648646
QString account = tr("Refund from %1").arg(recipient.authenticatedMerchant);
649647
std::string strAccount = account.toStdString();
650-
set<CTxDestination> refundAddresses = wallet->GetAccountAddresses(strAccount);
648+
std::set<CTxDestination> refundAddresses = wallet->GetAccountAddresses(strAccount);
651649
if (!refundAddresses.empty()) {
652650
CScript s = GetScriptForDestination(*refundAddresses.begin());
653651
payments::Output* refund_to = payment.add_refund_to();

src/qt/transactiondesc.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#include <stdint.h>
2222
#include <string>
2323

24-
using namespace std;
25-
2624
QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx)
2725
{
2826
AssertLockHeld(cs_main);
@@ -243,14 +241,14 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
243241
strHTML += "<b>" + tr("Transaction ID") + ":</b> " + TransactionRecord::formatSubTxId(wtx.GetHash(), rec->idx) + "<br>";
244242

245243
// Message from normal bitcoin:URI (bitcoin:123...?message=example)
246-
Q_FOREACH (const PAIRTYPE(string, string)& r, wtx.vOrderForm)
244+
Q_FOREACH (const PAIRTYPE(std::string, std::string)& r, wtx.vOrderForm)
247245
if (r.first == "Message")
248246
strHTML += "<br><b>" + tr("Message") + ":</b><br>" + GUIUtil::HtmlEscape(r.second, true) + "<br>";
249247

250248
//
251249
// PaymentRequest info:
252250
//
253-
Q_FOREACH (const PAIRTYPE(string, string)& r, wtx.vOrderForm)
251+
Q_FOREACH (const PAIRTYPE(std::string, std::string)& r, wtx.vOrderForm)
254252
{
255253
if (r.first == "PaymentRequest")
256254
{

src/qt/walletmodel.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
#include <QSet>
2626
#include <QTimer>
2727

28-
using namespace std;
29-
3028
WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent) :
3129
QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0),
3230
transactionTableModel(0),

0 commit comments

Comments
 (0)