qt: define QT_NO_KEYWORDS

QT_NO_KEYWORDS prevents Qt from defining the `foreach`, `signals`,
`slots` and `emit` macros.

Avoid overlap between Qt macros and boost - for example #undef hackiness
in #6421.
This commit is contained in:
Wladimir J. van der Laan 2015-07-14 13:59:05 +02:00
parent fd5dfda939
commit d29ec6c230
66 changed files with 184 additions and 184 deletions

View File

@ -322,7 +322,7 @@ RES_MOVIES = $(wildcard qt/res/movies/spinner-*.png)
BITCOIN_RC = qt/res/bitcoin-qt-res.rc BITCOIN_RC = qt/res/bitcoin-qt-res.rc
BITCOIN_QT_INCLUDES = -I$(builddir)/qt -I$(srcdir)/qt -I$(srcdir)/qt/forms \ BITCOIN_QT_INCLUDES = -I$(builddir)/qt -I$(srcdir)/qt -I$(srcdir)/qt/forms \
-I$(builddir)/qt/forms -I$(builddir)/qt/forms -DQT_NO_KEYWORDS
qt_libbitcoinqt_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ qt_libbitcoinqt_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
$(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS) $(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)

View File

@ -254,7 +254,7 @@ void AddressBookPage::done(int retval)
// Figure out which address was selected, and return it // Figure out which address was selected, and return it
QModelIndexList indexes = table->selectionModel()->selectedRows(AddressTableModel::Address); QModelIndexList indexes = table->selectionModel()->selectedRows(AddressTableModel::Address);
foreach (const QModelIndex& index, indexes) { Q_FOREACH (const QModelIndex& index, indexes) {
QVariant address = table->model()->data(index); QVariant address = table->model()->data(index);
returnValue = address.toString(); returnValue = address.toString();
} }

View File

@ -45,7 +45,7 @@ public:
void setModel(AddressTableModel *model); void setModel(AddressTableModel *model);
const QString &getReturnValue() const { return returnValue; } const QString &getReturnValue() const { return returnValue; }
public slots: public Q_SLOTS:
void done(int retval); void done(int retval);
private: private:
@ -59,7 +59,7 @@ private:
QAction *deleteAction; // to be able to explicitly disable it QAction *deleteAction; // to be able to explicitly disable it
QString newAddressToSelect; QString newAddressToSelect;
private slots: private Q_SLOTS:
/** Delete currently selected address entry */ /** Delete currently selected address entry */
void on_deleteAddress_clicked(); void on_deleteAddress_clicked();
/** Create a new address for receiving coins and / or add a new address book entry */ /** Create a new address for receiving coins and / or add a new address book entry */
@ -80,7 +80,7 @@ private slots:
/** New entry/entries were added to address table */ /** New entry/entries were added to address table */
void selectNewAddress(const QModelIndex &parent, int begin, int /*end*/); void selectNewAddress(const QModelIndex &parent, int begin, int /*end*/);
signals: Q_SIGNALS:
void sendCoins(QString addr); void sendCoins(QString addr);
}; };

View File

@ -450,5 +450,5 @@ int AddressTableModel::lookupAddress(const QString &address) const
void AddressTableModel::emitDataChanged(int idx) void AddressTableModel::emitDataChanged(int idx)
{ {
emit dataChanged(index(idx, 0, QModelIndex()), index(idx, columns.length()-1, QModelIndex())); Q_EMIT dataChanged(index(idx, 0, QModelIndex()), index(idx, columns.length()-1, QModelIndex()));
} }

View File

@ -84,7 +84,7 @@ private:
/** Notify listeners that data changed. */ /** Notify listeners that data changed. */
void emitDataChanged(int index); void emitDataChanged(int index);
public slots: public Q_SLOTS:
/* Update address list from core. /* Update address list from core.
*/ */
void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status); void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status);

View File

@ -40,7 +40,7 @@ private:
WalletModel *model; WalletModel *model;
bool fCapsLock; bool fCapsLock;
private slots: private Q_SLOTS:
void textChanged(); void textChanged();
protected: protected:

View File

@ -169,11 +169,11 @@ class BitcoinCore: public QObject
public: public:
explicit BitcoinCore(); explicit BitcoinCore();
public slots: public Q_SLOTS:
void initialize(); void initialize();
void shutdown(); void shutdown();
signals: Q_SIGNALS:
void initializeResult(int retval); void initializeResult(int retval);
void shutdownResult(int retval); void shutdownResult(int retval);
void runawayException(const QString &message); void runawayException(const QString &message);
@ -216,13 +216,13 @@ public:
/// Get window identifier of QMainWindow (BitcoinGUI) /// Get window identifier of QMainWindow (BitcoinGUI)
WId getMainWinId() const; WId getMainWinId() const;
public slots: public Q_SLOTS:
void initializeResult(int retval); void initializeResult(int retval);
void shutdownResult(int retval); void shutdownResult(int retval);
/// Handle runaway exceptions. Shows a message box with the problem and quits the program. /// Handle runaway exceptions. Shows a message box with the problem and quits the program.
void handleRunawayException(const QString &message); void handleRunawayException(const QString &message);
signals: Q_SIGNALS:
void requestedInitialize(); void requestedInitialize();
void requestedShutdown(); void requestedShutdown();
void stopThread(); void stopThread();
@ -253,7 +253,7 @@ BitcoinCore::BitcoinCore():
void BitcoinCore::handleRunawayException(const std::exception *e) void BitcoinCore::handleRunawayException(const std::exception *e)
{ {
PrintExceptionContinue(e, "Runaway exception"); PrintExceptionContinue(e, "Runaway exception");
emit runawayException(QString::fromStdString(strMiscWarning)); Q_EMIT runawayException(QString::fromStdString(strMiscWarning));
} }
void BitcoinCore::initialize() void BitcoinCore::initialize()
@ -269,7 +269,7 @@ void BitcoinCore::initialize()
*/ */
StartDummyRPCThread(); StartDummyRPCThread();
} }
emit initializeResult(rv); Q_EMIT initializeResult(rv);
} catch (const std::exception& e) { } catch (const std::exception& e) {
handleRunawayException(&e); handleRunawayException(&e);
} catch (...) { } catch (...) {
@ -286,7 +286,7 @@ void BitcoinCore::shutdown()
threadGroup.join_all(); threadGroup.join_all();
Shutdown(); Shutdown();
qDebug() << __func__ << ": Shutdown finished"; qDebug() << __func__ << ": Shutdown finished";
emit shutdownResult(1); Q_EMIT shutdownResult(1);
} catch (const std::exception& e) { } catch (const std::exception& e) {
handleRunawayException(&e); handleRunawayException(&e);
} catch (...) { } catch (...) {
@ -315,7 +315,7 @@ BitcoinApplication::~BitcoinApplication()
if(coreThread) if(coreThread)
{ {
qDebug() << __func__ << ": Stopping thread"; qDebug() << __func__ << ": Stopping thread";
emit stopThread(); Q_EMIT stopThread();
coreThread->wait(); coreThread->wait();
qDebug() << __func__ << ": Stopped thread"; qDebug() << __func__ << ": Stopped thread";
} }
@ -386,7 +386,7 @@ void BitcoinApplication::requestInitialize()
{ {
qDebug() << __func__ << ": Requesting initialize"; qDebug() << __func__ << ": Requesting initialize";
startThread(); startThread();
emit requestedInitialize(); Q_EMIT requestedInitialize();
} }
void BitcoinApplication::requestShutdown() void BitcoinApplication::requestShutdown()
@ -409,7 +409,7 @@ void BitcoinApplication::requestShutdown()
ShutdownWindow::showShutdownWindow(window); ShutdownWindow::showShutdownWindow(window);
// Request shutdown from core thread // Request shutdown from core thread
emit requestedShutdown(); Q_EMIT requestedShutdown();
} }
void BitcoinApplication::initializeResult(int retval) void BitcoinApplication::initializeResult(int retval)
@ -449,7 +449,7 @@ void BitcoinApplication::initializeResult(int retval)
{ {
window->show(); window->show();
} }
emit splashFinished(window); Q_EMIT splashFinished(window);
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
// Now that initialization/startup is done, process any command-line // Now that initialization/startup is done, process any command-line

View File

@ -61,7 +61,7 @@ public:
void setValue(const CAmount& value) void setValue(const CAmount& value)
{ {
lineEdit()->setText(BitcoinUnits::format(currentUnit, value, false, BitcoinUnits::separatorAlways)); lineEdit()->setText(BitcoinUnits::format(currentUnit, value, false, BitcoinUnits::separatorAlways));
emit valueChanged(); Q_EMIT valueChanged();
} }
void stepBy(int steps) void stepBy(int steps)
@ -184,7 +184,7 @@ protected:
return rv; return rv;
} }
signals: Q_SIGNALS:
void valueChanged(); void valueChanged();
}; };

View File

@ -56,7 +56,7 @@ public:
*/ */
QWidget *setupTabChain(QWidget *prev); QWidget *setupTabChain(QWidget *prev);
signals: Q_SIGNALS:
void valueChanged(); void valueChanged();
protected: protected:
@ -67,7 +67,7 @@ private:
AmountSpinBox *amount; AmountSpinBox *amount;
QValueComboBox *unit; QValueComboBox *unit;
private slots: private Q_SLOTS:
void unitChanged(int idx); void unitChanged(int idx);
}; };

View File

@ -600,7 +600,7 @@ void BitcoinGUI::openClicked()
OpenURIDialog dlg(this); OpenURIDialog dlg(this);
if(dlg.exec()) if(dlg.exec())
{ {
emit receivedURI(dlg.getURI()); Q_EMIT receivedURI(dlg.getURI());
} }
} }
@ -886,9 +886,9 @@ void BitcoinGUI::dropEvent(QDropEvent *event)
{ {
if(event->mimeData()->hasUrls()) if(event->mimeData()->hasUrls())
{ {
foreach(const QUrl &uri, event->mimeData()->urls()) Q_FOREACH(const QUrl &uri, event->mimeData()->urls())
{ {
emit receivedURI(uri.toString()); Q_EMIT receivedURI(uri.toString());
} }
} }
event->acceptProposedAction(); event->acceptProposedAction();
@ -1050,7 +1050,7 @@ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl() :
QList<BitcoinUnits::Unit> units = BitcoinUnits::availableUnits(); QList<BitcoinUnits::Unit> units = BitcoinUnits::availableUnits();
int max_width = 0; int max_width = 0;
const QFontMetrics fm(font()); const QFontMetrics fm(font());
foreach (const BitcoinUnits::Unit unit, units) Q_FOREACH (const BitcoinUnits::Unit unit, units)
{ {
max_width = qMax(max_width, fm.width(BitcoinUnits::name(unit))); max_width = qMax(max_width, fm.width(BitcoinUnits::name(unit)));
} }
@ -1069,7 +1069,7 @@ void UnitDisplayStatusBarControl::mousePressEvent(QMouseEvent *event)
void UnitDisplayStatusBarControl::createContextMenu() void UnitDisplayStatusBarControl::createContextMenu()
{ {
menu = new QMenu(); menu = new QMenu();
foreach(BitcoinUnits::Unit u, BitcoinUnits::availableUnits()) Q_FOREACH(BitcoinUnits::Unit u, BitcoinUnits::availableUnits())
{ {
QAction *menuAction = new QAction(QString(BitcoinUnits::name(u)), this); QAction *menuAction = new QAction(QString(BitcoinUnits::name(u)), this);
menuAction->setData(QVariant(u)); menuAction->setData(QVariant(u));

View File

@ -136,11 +136,11 @@ private:
/** Disconnect core signals from GUI client */ /** Disconnect core signals from GUI client */
void unsubscribeFromCoreSignals(); void unsubscribeFromCoreSignals();
signals: Q_SIGNALS:
/** Signal raised when a URI was entered or dragged to the GUI */ /** Signal raised when a URI was entered or dragged to the GUI */
void receivedURI(const QString &uri); void receivedURI(const QString &uri);
public slots: public Q_SLOTS:
/** Set number of connections shown in the UI */ /** Set number of connections shown in the UI */
void setNumConnections(int count); void setNumConnections(int count);
/** Set number of blocks and last block date shown in the UI */ /** Set number of blocks and last block date shown in the UI */
@ -168,7 +168,7 @@ public slots:
void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label); void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label);
#endif // ENABLE_WALLET #endif // ENABLE_WALLET
private slots: private Q_SLOTS:
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
/** Switch to overview (home) page */ /** Switch to overview (home) page */
void gotoOverviewPage(); void gotoOverviewPage();
@ -232,7 +232,7 @@ private:
/** Creates context menu, its actions, and wires up all the relevant signals for mouse events. */ /** Creates context menu, its actions, and wires up all the relevant signals for mouse events. */
void createContextMenu(); void createContextMenu();
private slots: private Q_SLOTS:
/** When Display Units are changed on OptionsModel it will refresh the display text of the control on the status bar */ /** When Display Units are changed on OptionsModel it will refresh the display text of the control on the status bar */
void updateDisplayUnit(int newUnits); void updateDisplayUnit(int newUnits);
/** Tells underlying optionsModel to update its current display unit. */ /** Tells underlying optionsModel to update its current display unit. */

View File

@ -117,15 +117,15 @@ void ClientModel::updateTimer()
cachedReindexing = fReindex; cachedReindexing = fReindex;
cachedImporting = fImporting; cachedImporting = fImporting;
emit numBlocksChanged(newNumBlocks, newBlockDate); Q_EMIT numBlocksChanged(newNumBlocks, newBlockDate);
} }
emit bytesChanged(getTotalBytesRecv(), getTotalBytesSent()); Q_EMIT bytesChanged(getTotalBytesRecv(), getTotalBytesSent());
} }
void ClientModel::updateNumConnections(int numConnections) void ClientModel::updateNumConnections(int numConnections)
{ {
emit numConnectionsChanged(numConnections); Q_EMIT numConnectionsChanged(numConnections);
} }
void ClientModel::updateAlert(const QString &hash, int status) void ClientModel::updateAlert(const QString &hash, int status)
@ -138,11 +138,11 @@ void ClientModel::updateAlert(const QString &hash, int status)
CAlert alert = CAlert::getAlertByHash(hash_256); CAlert alert = CAlert::getAlertByHash(hash_256);
if(!alert.IsNull()) if(!alert.IsNull())
{ {
emit message(tr("Network Alert"), QString::fromStdString(alert.strStatusBar), CClientUIInterface::ICON_ERROR); Q_EMIT message(tr("Network Alert"), QString::fromStdString(alert.strStatusBar), CClientUIInterface::ICON_ERROR);
} }
} }
emit alertsChanged(getStatusBarWarnings()); Q_EMIT alertsChanged(getStatusBarWarnings());
} }
bool ClientModel::inInitialBlockDownload() const bool ClientModel::inInitialBlockDownload() const

View File

@ -82,7 +82,7 @@ private:
void subscribeToCoreSignals(); void subscribeToCoreSignals();
void unsubscribeFromCoreSignals(); void unsubscribeFromCoreSignals();
signals: Q_SIGNALS:
void numConnectionsChanged(int count); void numConnectionsChanged(int count);
void numBlocksChanged(int count, const QDateTime& blockDate); void numBlocksChanged(int count, const QDateTime& blockDate);
void alertsChanged(const QString &warnings); void alertsChanged(const QString &warnings);
@ -94,7 +94,7 @@ signals:
// Show progress dialog e.g. for verifychain // Show progress dialog e.g. for verifychain
void showProgress(const QString &title, int nProgress); void showProgress(const QString &title, int nProgress);
public slots: public Q_SLOTS:
void updateTimer(); void updateTimer();
void updateNumConnections(int numConnections); void updateNumConnections(int numConnections);
void updateAlert(const QString &hash, int status); void updateAlert(const QString &hash, int status);

View File

@ -461,7 +461,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
CAmount nPayAmount = 0; CAmount nPayAmount = 0;
bool fDust = false; bool fDust = false;
CMutableTransaction txDummy; CMutableTransaction txDummy;
foreach(const CAmount &amount, CoinControlDialog::payAmounts) Q_FOREACH(const CAmount &amount, CoinControlDialog::payAmounts)
{ {
nPayAmount += amount; nPayAmount += amount;

View File

@ -102,7 +102,7 @@ private:
return column; return column;
} }
private slots: private Q_SLOTS:
void showMenu(const QPoint &); void showMenu(const QPoint &);
void copyAmount(); void copyAmount();
void copyLabel(); void copyLabel();

View File

@ -40,7 +40,7 @@ public:
QString getAddress() const; QString getAddress() const;
void setAddress(const QString &address); void setAddress(const QString &address);
public slots: public Q_SLOTS:
void accept(); void accept();
private: private:

View File

@ -169,7 +169,7 @@ namespace GUIUtil
void setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode); void setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode);
void resizeColumn(int nColumnIndex, int width); void resizeColumn(int nColumnIndex, int width);
private slots: private Q_SLOTS:
void on_sectionResized(int logicalIndex, int oldSize, int newSize); void on_sectionResized(int logicalIndex, int oldSize, int newSize);
void on_geometriesChanged(); void on_geometriesChanged();
}; };

View File

@ -42,10 +42,10 @@ public:
ST_ERROR ST_ERROR
}; };
public slots: public Q_SLOTS:
void check(); void check();
signals: Q_SIGNALS:
void reply(int status, const QString &message, quint64 available); void reply(int status, const QString &message, quint64 available);
private: private:
@ -102,7 +102,7 @@ void FreespaceChecker::check()
replyStatus = ST_ERROR; replyStatus = ST_ERROR;
replyMessage = tr("Cannot create data directory here."); replyMessage = tr("Cannot create data directory here.");
} }
emit reply(replyStatus, replyMessage, freeBytesAvailable); Q_EMIT reply(replyStatus, replyMessage, freeBytesAvailable);
} }
@ -121,7 +121,7 @@ Intro::~Intro()
{ {
delete ui; delete ui;
/* Ensure thread is finished before it is deleted */ /* Ensure thread is finished before it is deleted */
emit stopThread(); Q_EMIT stopThread();
thread->wait(); thread->wait();
} }
@ -277,7 +277,7 @@ void Intro::checkPath(const QString &dataDir)
if(!signalled) if(!signalled)
{ {
signalled = true; signalled = true;
emit requestCheck(); Q_EMIT requestCheck();
} }
mutex.unlock(); mutex.unlock();
} }

View File

@ -43,14 +43,14 @@ public:
*/ */
static QString getDefaultDataDirectory(); static QString getDefaultDataDirectory();
signals: Q_SIGNALS:
void requestCheck(); void requestCheck();
void stopThread(); void stopThread();
public slots: public Q_SLOTS:
void setStatus(int status, const QString &message, quint64 bytesAvailable); void setStatus(int status, const QString &message, quint64 bytesAvailable);
private slots: private Q_SLOTS:
void on_dataDirectory_textChanged(const QString &arg1); void on_dataDirectory_textChanged(const QString &arg1);
void on_ellipsisButton_clicked(); void on_ellipsisButton_clicked();
void on_dataDirDefault_clicked(); void on_dataDirDefault_clicked();

View File

@ -30,7 +30,7 @@ public:
static void cleanup(); static void cleanup();
void handleDockIconClickEvent(); void handleDockIconClickEvent();
signals: Q_SIGNALS:
void dockIconClicked(); void dockIconClicked();
private: private:

View File

@ -40,7 +40,7 @@ public:
Critical /**< An error occurred */ Critical /**< An error occurred */
}; };
public slots: public Q_SLOTS:
/** Show notification message. /** Show notification message.
@param[in] cls general message class @param[in] cls general message class
@param[in] title title shown with message @param[in] title title shown with message

View File

@ -21,10 +21,10 @@ public:
QString getURI(); QString getURI();
protected slots: protected Q_SLOTS:
void accept(); void accept();
private slots: private Q_SLOTS:
void on_selectFileButton_clicked(); void on_selectFileButton_clicked();
private: private:

View File

@ -73,7 +73,7 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
/* Display elements init */ /* Display elements init */
QDir translations(":translations"); QDir translations(":translations");
ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant("")); ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant(""));
foreach(const QString &langStr, translations.entryList()) Q_FOREACH(const QString &langStr, translations.entryList())
{ {
QLocale locale(langStr); QLocale locale(langStr);
@ -281,7 +281,7 @@ bool OptionsDialog::eventFilter(QObject *object, QEvent *event)
{ {
if(object == ui->proxyIp) if(object == ui->proxyIp)
{ {
emit proxyIpChecks(ui->proxyIp, ui->proxyPort->text().toInt()); Q_EMIT proxyIpChecks(ui->proxyIp, ui->proxyPort->text().toInt());
} }
} }
return QDialog::eventFilter(object, event); return QDialog::eventFilter(object, event);

View File

@ -33,7 +33,7 @@ public:
protected: protected:
bool eventFilter(QObject *object, QEvent *event); bool eventFilter(QObject *object, QEvent *event);
private slots: private Q_SLOTS:
/* enable OK button */ /* enable OK button */
void enableOkButton(); void enableOkButton();
/* disable OK button */ /* disable OK button */
@ -48,7 +48,7 @@ private slots:
void clearStatusLabel(); void clearStatusLabel();
void doProxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort); void doProxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort);
signals: Q_SIGNALS:
void proxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort); void proxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort);
private: private:

View File

@ -286,7 +286,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
case CoinControlFeatures: case CoinControlFeatures:
fCoinControlFeatures = value.toBool(); fCoinControlFeatures = value.toBool();
settings.setValue("fCoinControlFeatures", fCoinControlFeatures); settings.setValue("fCoinControlFeatures", fCoinControlFeatures);
emit coinControlFeaturesChanged(fCoinControlFeatures); Q_EMIT coinControlFeaturesChanged(fCoinControlFeatures);
break; break;
case DatabaseCache: case DatabaseCache:
if (settings.value("nDatabaseCache") != value) { if (settings.value("nDatabaseCache") != value) {
@ -311,7 +311,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
} }
} }
emit dataChanged(index, index); Q_EMIT dataChanged(index, index);
return successful; return successful;
} }
@ -324,7 +324,7 @@ void OptionsModel::setDisplayUnit(const QVariant &value)
QSettings settings; QSettings settings;
nDisplayUnit = value.toInt(); nDisplayUnit = value.toInt();
settings.setValue("nDisplayUnit", nDisplayUnit); settings.setValue("nDisplayUnit", nDisplayUnit);
emit displayUnitChanged(nDisplayUnit); Q_EMIT displayUnitChanged(nDisplayUnit);
} }
} }

View File

@ -81,7 +81,7 @@ private:
/// Add option to list of GUI options overridden through command line/config file /// Add option to list of GUI options overridden through command line/config file
void addOverriddenOption(const std::string &option); void addOverriddenOption(const std::string &option);
signals: Q_SIGNALS:
void displayUnitChanged(int unit); void displayUnitChanged(int unit);
void coinControlFeaturesChanged(bool); void coinControlFeaturesChanged(bool);
}; };

View File

@ -142,7 +142,7 @@ OverviewPage::OverviewPage(QWidget *parent) :
void OverviewPage::handleTransactionClicked(const QModelIndex &index) void OverviewPage::handleTransactionClicked(const QModelIndex &index)
{ {
if(filter) if(filter)
emit transactionClicked(filter->mapToSource(index)); Q_EMIT transactionClicked(filter->mapToSource(index));
} }
OverviewPage::~OverviewPage() OverviewPage::~OverviewPage()

View File

@ -35,11 +35,11 @@ public:
void setWalletModel(WalletModel *walletModel); void setWalletModel(WalletModel *walletModel);
void showOutOfSyncWarning(bool fShow); void showOutOfSyncWarning(bool fShow);
public slots: public Q_SLOTS:
void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance,
const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance); const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance);
signals: Q_SIGNALS:
void transactionClicked(const QModelIndex &index); void transactionClicked(const QModelIndex &index);
private: private:
@ -56,7 +56,7 @@ private:
TxViewDelegate *txdelegate; TxViewDelegate *txdelegate;
TransactionFilterProxy *filter; TransactionFilterProxy *filter;
private slots: private Q_SLOTS:
void updateDisplayUnit(); void updateDisplayUnit();
void handleTransactionClicked(const QModelIndex &index); void handleTransactionClicked(const QModelIndex &index);
void updateAlerts(const QString &warnings); void updateAlerts(const QString &warnings);

View File

@ -148,7 +148,7 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store)
int nRootCerts = 0; int nRootCerts = 0;
const QDateTime currentTime = QDateTime::currentDateTime(); const QDateTime currentTime = QDateTime::currentDateTime();
foreach (const QSslCertificate& cert, certList) { Q_FOREACH (const QSslCertificate& cert, certList) {
// Don't log NULL certificates // Don't log NULL certificates
if (cert.isNull()) if (cert.isNull())
continue; continue;
@ -201,7 +201,7 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store)
// when uiReady() is called. // when uiReady() is called.
// //
// Warning: ipcSendCommandLine() is called early in init, // Warning: ipcSendCommandLine() is called early in init,
// so don't use "emit message()", but "QMessageBox::"! // so don't use "Q_EMIT message()", but "QMessageBox::"!
// //
void PaymentServer::ipcParseCommandLine(int argc, char* argv[]) void PaymentServer::ipcParseCommandLine(int argc, char* argv[])
{ {
@ -269,7 +269,7 @@ void PaymentServer::ipcParseCommandLine(int argc, char* argv[])
bool PaymentServer::ipcSendCommandLine() bool PaymentServer::ipcSendCommandLine()
{ {
bool fResult = false; bool fResult = false;
foreach (const QString& r, savedPaymentRequests) Q_FOREACH (const QString& r, savedPaymentRequests)
{ {
QLocalSocket* socket = new QLocalSocket(); QLocalSocket* socket = new QLocalSocket();
socket->connectToServer(ipcServerName(), QIODevice::WriteOnly); socket->connectToServer(ipcServerName(), QIODevice::WriteOnly);
@ -326,7 +326,7 @@ PaymentServer::PaymentServer(QObject* parent, bool startLocalServer) :
uriServer = new QLocalServer(this); uriServer = new QLocalServer(this);
if (!uriServer->listen(name)) { if (!uriServer->listen(name)) {
// constructor is called early in init, so don't use "emit message()" here // constructor is called early in init, so don't use "Q_EMIT message()" here
QMessageBox::critical(0, tr("Payment request error"), QMessageBox::critical(0, tr("Payment request error"),
tr("Cannot start bitcoin: click-to-pay handler")); tr("Cannot start bitcoin: click-to-pay handler"));
} }
@ -394,7 +394,7 @@ void PaymentServer::uiReady()
initNetManager(); initNetManager();
saveURIs = false; saveURIs = false;
foreach (const QString& s, savedPaymentRequests) Q_FOREACH (const QString& s, savedPaymentRequests)
{ {
handleURIOrFile(s); handleURIOrFile(s);
} }
@ -431,7 +431,7 @@ void PaymentServer::handleURIOrFile(const QString& s)
else else
{ {
qWarning() << "PaymentServer::handleURIOrFile: Invalid URL: " << fetchUrl; qWarning() << "PaymentServer::handleURIOrFile: Invalid URL: " << fetchUrl;
emit message(tr("URI handling"), Q_EMIT message(tr("URI handling"),
tr("Payment request fetch URL is invalid: %1").arg(fetchUrl.toString()), tr("Payment request fetch URL is invalid: %1").arg(fetchUrl.toString()),
CClientUIInterface::ICON_WARNING); CClientUIInterface::ICON_WARNING);
} }
@ -445,14 +445,14 @@ void PaymentServer::handleURIOrFile(const QString& s)
{ {
CBitcoinAddress address(recipient.address.toStdString()); CBitcoinAddress address(recipient.address.toStdString());
if (!address.IsValid()) { if (!address.IsValid()) {
emit message(tr("URI handling"), tr("Invalid payment address %1").arg(recipient.address), Q_EMIT message(tr("URI handling"), tr("Invalid payment address %1").arg(recipient.address),
CClientUIInterface::MSG_ERROR); CClientUIInterface::MSG_ERROR);
} }
else else
emit receivedPaymentRequest(recipient); Q_EMIT receivedPaymentRequest(recipient);
} }
else else
emit message(tr("URI handling"), Q_EMIT message(tr("URI handling"),
tr("URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters."), tr("URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters."),
CClientUIInterface::ICON_WARNING); CClientUIInterface::ICON_WARNING);
@ -466,12 +466,12 @@ void PaymentServer::handleURIOrFile(const QString& s)
SendCoinsRecipient recipient; SendCoinsRecipient recipient;
if (!readPaymentRequestFromFile(s, request)) if (!readPaymentRequestFromFile(s, request))
{ {
emit message(tr("Payment request file handling"), Q_EMIT message(tr("Payment request file handling"),
tr("Payment request file cannot be read! This can be caused by an invalid payment request file."), tr("Payment request file cannot be read! This can be caused by an invalid payment request file."),
CClientUIInterface::ICON_WARNING); CClientUIInterface::ICON_WARNING);
} }
else if (processPaymentRequest(request, recipient)) else if (processPaymentRequest(request, recipient))
emit receivedPaymentRequest(recipient); Q_EMIT receivedPaymentRequest(recipient);
return; return;
} }
@ -500,7 +500,7 @@ void PaymentServer::handleURIConnection()
// //
// Warning: readPaymentRequestFromFile() is used in ipcSendCommandLine() // Warning: readPaymentRequestFromFile() is used in ipcSendCommandLine()
// so don't use "emit message()", but "QMessageBox::"! // so don't use "Q_EMIT message()", but "QMessageBox::"!
// //
bool PaymentServer::readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request) bool PaymentServer::readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request)
{ {
@ -533,7 +533,7 @@ bool PaymentServer::processPaymentRequest(const PaymentRequestPlus& request, Sen
if (request.IsInitialized()) { if (request.IsInitialized()) {
// Payment request network matches client network? // Payment request network matches client network?
if (!verifyNetwork(request.getDetails())) { if (!verifyNetwork(request.getDetails())) {
emit message(tr("Payment request rejected"), tr("Payment request network doesn't match client network."), Q_EMIT message(tr("Payment request rejected"), tr("Payment request network doesn't match client network."),
CClientUIInterface::MSG_ERROR); CClientUIInterface::MSG_ERROR);
return false; return false;
@ -542,13 +542,13 @@ bool PaymentServer::processPaymentRequest(const PaymentRequestPlus& request, Sen
// Make sure any payment requests involved are still valid. // Make sure any payment requests involved are still valid.
// This is re-checked just before sending coins in WalletModel::sendCoins(). // This is re-checked just before sending coins in WalletModel::sendCoins().
if (verifyExpired(request.getDetails())) { if (verifyExpired(request.getDetails())) {
emit message(tr("Payment request rejected"), tr("Payment request expired."), Q_EMIT message(tr("Payment request rejected"), tr("Payment request expired."),
CClientUIInterface::MSG_ERROR); CClientUIInterface::MSG_ERROR);
return false; return false;
} }
} else { } else {
emit message(tr("Payment request error"), tr("Payment request is not initialized."), Q_EMIT message(tr("Payment request error"), tr("Payment request is not initialized."),
CClientUIInterface::MSG_ERROR); CClientUIInterface::MSG_ERROR);
return false; return false;
@ -562,7 +562,7 @@ bool PaymentServer::processPaymentRequest(const PaymentRequestPlus& request, Sen
QList<std::pair<CScript, CAmount> > sendingTos = request.getPayTo(); QList<std::pair<CScript, CAmount> > sendingTos = request.getPayTo();
QStringList addresses; QStringList addresses;
foreach(const PAIRTYPE(CScript, CAmount)& sendingTo, sendingTos) { Q_FOREACH(const PAIRTYPE(CScript, CAmount)& sendingTo, sendingTos) {
// Extract and check destination addresses // Extract and check destination addresses
CTxDestination dest; CTxDestination dest;
if (ExtractDestination(sendingTo.first, dest)) { if (ExtractDestination(sendingTo.first, dest)) {
@ -573,7 +573,7 @@ bool PaymentServer::processPaymentRequest(const PaymentRequestPlus& request, Sen
// Unauthenticated payment requests to custom bitcoin addresses are not supported // Unauthenticated payment requests to custom bitcoin addresses are not supported
// (there is no good way to tell the user where they are paying in a way they'd // (there is no good way to tell the user where they are paying in a way they'd
// have a chance of understanding). // have a chance of understanding).
emit message(tr("Payment request rejected"), Q_EMIT message(tr("Payment request rejected"),
tr("Unverified payment requests to custom payment scripts are unsupported."), tr("Unverified payment requests to custom payment scripts are unsupported."),
CClientUIInterface::MSG_ERROR); CClientUIInterface::MSG_ERROR);
return false; return false;
@ -583,14 +583,14 @@ bool PaymentServer::processPaymentRequest(const PaymentRequestPlus& request, Sen
// but CAmount is defined as int64_t. Because of that we need to verify that amounts are in a valid range // but CAmount is defined as int64_t. Because of that we need to verify that amounts are in a valid range
// and no overflow has happened. // and no overflow has happened.
if (!verifyAmount(sendingTo.second)) { if (!verifyAmount(sendingTo.second)) {
emit message(tr("Payment request rejected"), tr("Invalid payment request."), CClientUIInterface::MSG_ERROR); Q_EMIT message(tr("Payment request rejected"), tr("Invalid payment request."), CClientUIInterface::MSG_ERROR);
return false; return false;
} }
// Extract and check amounts // Extract and check amounts
CTxOut txOut(sendingTo.second, sendingTo.first); CTxOut txOut(sendingTo.second, sendingTo.first);
if (txOut.IsDust(::minRelayTxFee)) { if (txOut.IsDust(::minRelayTxFee)) {
emit message(tr("Payment request error"), tr("Requested payment amount of %1 is too small (considered dust).") Q_EMIT message(tr("Payment request error"), tr("Requested payment amount of %1 is too small (considered dust).")
.arg(BitcoinUnits::formatWithUnit(optionsModel->getDisplayUnit(), sendingTo.second)), .arg(BitcoinUnits::formatWithUnit(optionsModel->getDisplayUnit(), sendingTo.second)),
CClientUIInterface::MSG_ERROR); CClientUIInterface::MSG_ERROR);
@ -600,7 +600,7 @@ bool PaymentServer::processPaymentRequest(const PaymentRequestPlus& request, Sen
recipient.amount += sendingTo.second; recipient.amount += sendingTo.second;
// Also verify that the final amount is still in a valid range after adding additional amounts. // Also verify that the final amount is still in a valid range after adding additional amounts.
if (!verifyAmount(recipient.amount)) { if (!verifyAmount(recipient.amount)) {
emit message(tr("Payment request rejected"), tr("Invalid payment request."), CClientUIInterface::MSG_ERROR); Q_EMIT message(tr("Payment request rejected"), tr("Invalid payment request."), CClientUIInterface::MSG_ERROR);
return false; return false;
} }
} }
@ -694,7 +694,7 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply)
.arg(BIP70_MAX_PAYMENTREQUEST_SIZE); .arg(BIP70_MAX_PAYMENTREQUEST_SIZE);
qWarning() << QString("PaymentServer::%1:").arg(__func__) << msg; qWarning() << QString("PaymentServer::%1:").arg(__func__) << msg;
emit message(tr("Payment request DoS protection"), msg, CClientUIInterface::MSG_ERROR); Q_EMIT message(tr("Payment request DoS protection"), msg, CClientUIInterface::MSG_ERROR);
return; return;
} }
@ -704,7 +704,7 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply)
.arg(reply->errorString()); .arg(reply->errorString());
qWarning() << "PaymentServer::netRequestFinished: " << msg; qWarning() << "PaymentServer::netRequestFinished: " << msg;
emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR); Q_EMIT message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR);
return; return;
} }
@ -718,12 +718,12 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply)
if (!request.parse(data)) if (!request.parse(data))
{ {
qWarning() << "PaymentServer::netRequestFinished: Error parsing payment request"; qWarning() << "PaymentServer::netRequestFinished: Error parsing payment request";
emit message(tr("Payment request error"), Q_EMIT message(tr("Payment request error"),
tr("Payment request cannot be parsed!"), tr("Payment request cannot be parsed!"),
CClientUIInterface::MSG_ERROR); CClientUIInterface::MSG_ERROR);
} }
else if (processPaymentRequest(request, recipient)) else if (processPaymentRequest(request, recipient))
emit receivedPaymentRequest(recipient); Q_EMIT receivedPaymentRequest(recipient);
return; return;
} }
@ -736,11 +736,11 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply)
.arg(reply->request().url().toString()); .arg(reply->request().url().toString());
qWarning() << "PaymentServer::netRequestFinished: " << msg; qWarning() << "PaymentServer::netRequestFinished: " << msg;
emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR); Q_EMIT message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR);
} }
else else
{ {
emit receivedPaymentACK(GUIUtil::HtmlEscape(paymentACK.memo())); Q_EMIT receivedPaymentACK(GUIUtil::HtmlEscape(paymentACK.memo()));
} }
} }
} }
@ -750,11 +750,11 @@ void PaymentServer::reportSslErrors(QNetworkReply* reply, const QList<QSslError>
Q_UNUSED(reply); Q_UNUSED(reply);
QString errString; QString errString;
foreach (const QSslError& err, errs) { Q_FOREACH (const QSslError& err, errs) {
qWarning() << "PaymentServer::reportSslErrors: " << err; qWarning() << "PaymentServer::reportSslErrors: " << err;
errString += err.errorString() + "\n"; errString += err.errorString() + "\n";
} }
emit message(tr("Network request error"), errString, CClientUIInterface::MSG_ERROR); Q_EMIT message(tr("Network request error"), errString, CClientUIInterface::MSG_ERROR);
} }
void PaymentServer::setOptionsModel(OptionsModel *optionsModel) void PaymentServer::setOptionsModel(OptionsModel *optionsModel)
@ -765,7 +765,7 @@ void PaymentServer::setOptionsModel(OptionsModel *optionsModel)
void PaymentServer::handlePaymentACK(const QString& paymentACKMsg) void PaymentServer::handlePaymentACK(const QString& paymentACKMsg)
{ {
// currently we don't futher process or store the paymentACK message // currently we don't futher process or store the paymentACK message
emit message(tr("Payment acknowledged"), paymentACKMsg, CClientUIInterface::ICON_INFORMATION | CClientUIInterface::MODAL); Q_EMIT message(tr("Payment acknowledged"), paymentACKMsg, CClientUIInterface::ICON_INFORMATION | CClientUIInterface::MODAL);
} }
bool PaymentServer::verifyNetwork(const payments::PaymentDetails& requestDetails) bool PaymentServer::verifyNetwork(const payments::PaymentDetails& requestDetails)

View File

@ -98,7 +98,7 @@ public:
// Verify the payment request amount is valid // Verify the payment request amount is valid
static bool verifyAmount(const CAmount& requestAmount); static bool verifyAmount(const CAmount& requestAmount);
signals: Q_SIGNALS:
// Fired when a valid payment request is received // Fired when a valid payment request is received
void receivedPaymentRequest(SendCoinsRecipient); void receivedPaymentRequest(SendCoinsRecipient);
@ -108,7 +108,7 @@ signals:
// Fired when a message should be reported to the user // Fired when a message should be reported to the user
void message(const QString &title, const QString &message, unsigned int style); void message(const QString &title, const QString &message, unsigned int style);
public slots: public Q_SLOTS:
// Signal this when the main window's UI is ready // Signal this when the main window's UI is ready
// to display payment requests to the user // to display payment requests to the user
void uiReady(); void uiReady();
@ -119,7 +119,7 @@ public slots:
// Handle an incoming URI, URI with local file scheme or file // Handle an incoming URI, URI with local file scheme or file
void handleURIOrFile(const QString& s); void handleURIOrFile(const QString& s);
private slots: private Q_SLOTS:
void handleURIConnection(); void handleURIConnection();
void netRequestFinished(QNetworkReply*); void netRequestFinished(QNetworkReply*);
void reportSslErrors(QNetworkReply*, const QList<QSslError> &); void reportSslErrors(QNetworkReply*, const QList<QSslError> &);

View File

@ -63,7 +63,7 @@ public:
#if QT_VERSION >= 0x040700 #if QT_VERSION >= 0x040700
cachedNodeStats.reserve(vNodes.size()); cachedNodeStats.reserve(vNodes.size());
#endif #endif
foreach (CNode* pnode, vNodes) Q_FOREACH (CNode* pnode, vNodes)
{ {
CNodeCombinedStats stats; CNodeCombinedStats stats;
stats.nodeStateStats.nMisbehavior = 0; stats.nodeStateStats.nMisbehavior = 0;
@ -92,7 +92,7 @@ public:
// build index map // build index map
mapNodeRows.clear(); mapNodeRows.clear();
int row = 0; int row = 0;
foreach (const CNodeCombinedStats& stats, cachedNodeStats) Q_FOREACH (const CNodeCombinedStats& stats, cachedNodeStats)
mapNodeRows.insert(std::pair<NodeId, int>(stats.nodeStats.nodeid, row++)); mapNodeRows.insert(std::pair<NodeId, int>(stats.nodeStats.nodeid, row++));
} }
@ -220,9 +220,9 @@ const CNodeCombinedStats *PeerTableModel::getNodeStats(int idx)
void PeerTableModel::refresh() void PeerTableModel::refresh()
{ {
emit layoutAboutToBeChanged(); Q_EMIT layoutAboutToBeChanged();
priv->refreshPeers(); priv->refreshPeers();
emit layoutChanged(); Q_EMIT layoutChanged();
} }
int PeerTableModel::getRowByNodeId(NodeId nodeid) int PeerTableModel::getRowByNodeId(NodeId nodeid)

View File

@ -68,7 +68,7 @@ public:
void sort(int column, Qt::SortOrder order); void sort(int column, Qt::SortOrder order);
/*@}*/ /*@}*/
public slots: public Q_SLOTS:
void refresh(); void refresh();
private: private:

View File

@ -27,11 +27,11 @@ private:
bool valid; bool valid;
const QValidator *checkValidator; const QValidator *checkValidator;
public slots: public Q_SLOTS:
void setValid(bool valid); void setValid(bool valid);
void setEnabled(bool enabled); void setEnabled(bool enabled);
private slots: private Q_SLOTS:
void markValid(); void markValid();
void checkValidity(); void checkValidity();
}; };

View File

@ -27,5 +27,5 @@ void QValueComboBox::setRole(int role)
void QValueComboBox::handleSelectionChanged(int idx) void QValueComboBox::handleSelectionChanged(int idx)
{ {
emit valueChanged(); Q_EMIT valueChanged();
} }

View File

@ -24,13 +24,13 @@ public:
/** Specify model role to use as ordinal value (defaults to Qt::UserRole) */ /** Specify model role to use as ordinal value (defaults to Qt::UserRole) */
void setRole(int role); void setRole(int role);
signals: Q_SIGNALS:
void valueChanged(); void valueChanged();
private: private:
int role; int role;
private slots: private Q_SLOTS:
void handleSelectionChanged(int idx); void handleSelectionChanged(int idx);
}; };

View File

@ -185,7 +185,7 @@ void ReceiveCoinsDialog::on_showRequestButton_clicked()
return; return;
QModelIndexList selection = ui->recentRequestsView->selectionModel()->selectedRows(); QModelIndexList selection = ui->recentRequestsView->selectionModel()->selectedRows();
foreach (const QModelIndex& index, selection) { Q_FOREACH (const QModelIndex& index, selection) {
on_recentRequestsView_doubleClicked(index); on_recentRequestsView_doubleClicked(index);
} }
} }

View File

@ -44,7 +44,7 @@ public:
void setModel(WalletModel *model); void setModel(WalletModel *model);
public slots: public Q_SLOTS:
void clear(); void clear();
void reject(); void reject();
void accept(); void accept();
@ -60,7 +60,7 @@ private:
void copyColumnToClipboard(int column); void copyColumnToClipboard(int column);
virtual void resizeEvent(QResizeEvent *event); virtual void resizeEvent(QResizeEvent *event);
private slots: private Q_SLOTS:
void on_receiveButton_clicked(); void on_receiveButton_clicked();
void on_showRequestButton_clicked(); void on_showRequestButton_clicked();
void on_removeRequestButton_clicked(); void on_removeRequestButton_clicked();

View File

@ -32,7 +32,7 @@ public:
explicit QRImageWidget(QWidget *parent = 0); explicit QRImageWidget(QWidget *parent = 0);
QImage exportImage(); QImage exportImage();
public slots: public Q_SLOTS:
void saveImage(); void saveImage();
void copyImage(); void copyImage();
@ -55,7 +55,7 @@ public:
void setModel(OptionsModel *model); void setModel(OptionsModel *model);
void setInfo(const SendCoinsRecipient &info); void setInfo(const SendCoinsRecipient &info);
private slots: private Q_SLOTS:
void on_btnCopyURI_clicked(); void on_btnCopyURI_clicked();
void on_btnCopyAddress_clicked(); void on_btnCopyAddress_clicked();

View File

@ -119,7 +119,7 @@ QVariant RecentRequestsTableModel::headerData(int section, Qt::Orientation orien
void RecentRequestsTableModel::updateAmountColumnTitle() void RecentRequestsTableModel::updateAmountColumnTitle()
{ {
columns[Amount] = getAmountTitle(); columns[Amount] = getAmountTitle();
emit headerDataChanged(Qt::Horizontal,Amount,Amount); Q_EMIT headerDataChanged(Qt::Horizontal,Amount,Amount);
} }
/** Gets title for amount column including current display unit if optionsModel reference available. */ /** Gets title for amount column including current display unit if optionsModel reference available. */
@ -214,7 +214,7 @@ void RecentRequestsTableModel::addNewRequest(RecentRequestEntry &recipient)
void RecentRequestsTableModel::sort(int column, Qt::SortOrder order) void RecentRequestsTableModel::sort(int column, Qt::SortOrder order)
{ {
qSort(list.begin(), list.end(), RecentRequestEntryLessThan(column, order)); qSort(list.begin(), list.end(), RecentRequestEntryLessThan(column, order));
emit dataChanged(index(0, 0, QModelIndex()), index(list.size() - 1, NUMBER_OF_COLUMNS - 1, QModelIndex())); Q_EMIT dataChanged(index(0, 0, QModelIndex()), index(list.size() - 1, NUMBER_OF_COLUMNS - 1, QModelIndex()));
} }
void RecentRequestsTableModel::updateDisplayUnit() void RecentRequestsTableModel::updateDisplayUnit()

View File

@ -89,7 +89,7 @@ public:
void addNewRequest(const std::string &recipient); void addNewRequest(const std::string &recipient);
void addNewRequest(RecentRequestEntry &recipient); void addNewRequest(RecentRequestEntry &recipient);
public slots: public Q_SLOTS:
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
void updateDisplayUnit(); void updateDisplayUnit();

View File

@ -60,10 +60,10 @@ class RPCExecutor : public QObject
{ {
Q_OBJECT Q_OBJECT
public slots: public Q_SLOTS:
void request(const QString &command); void request(const QString &command);
signals: Q_SIGNALS:
void reply(int category, const QString &command); void reply(int category, const QString &command);
}; };
@ -95,7 +95,7 @@ bool parseCommandLine(std::vector<std::string> &args, const std::string &strComm
STATE_ESCAPE_DOUBLEQUOTED STATE_ESCAPE_DOUBLEQUOTED
} state = STATE_EATING_SPACES; } state = STATE_EATING_SPACES;
std::string curarg; std::string curarg;
foreach(char ch, strCommand) Q_FOREACH(char ch, strCommand)
{ {
switch(state) switch(state)
{ {
@ -158,7 +158,7 @@ void RPCExecutor::request(const QString &command)
std::vector<std::string> args; std::vector<std::string> args;
if(!parseCommandLine(args, command.toStdString())) if(!parseCommandLine(args, command.toStdString()))
{ {
emit reply(RPCConsole::CMD_ERROR, QString("Parse error: unbalanced ' or \"")); Q_EMIT reply(RPCConsole::CMD_ERROR, QString("Parse error: unbalanced ' or \""));
return; return;
} }
if(args.empty()) if(args.empty())
@ -180,7 +180,7 @@ void RPCExecutor::request(const QString &command)
else else
strPrint = result.write(2); strPrint = result.write(2);
emit reply(RPCConsole::CMD_REPLY, QString::fromStdString(strPrint)); Q_EMIT reply(RPCConsole::CMD_REPLY, QString::fromStdString(strPrint));
} }
catch (UniValue& objError) catch (UniValue& objError)
{ {
@ -188,16 +188,16 @@ void RPCExecutor::request(const QString &command)
{ {
int code = find_value(objError, "code").get_int(); int code = find_value(objError, "code").get_int();
std::string message = find_value(objError, "message").get_str(); std::string message = find_value(objError, "message").get_str();
emit reply(RPCConsole::CMD_ERROR, QString::fromStdString(message) + " (code " + QString::number(code) + ")"); Q_EMIT reply(RPCConsole::CMD_ERROR, QString::fromStdString(message) + " (code " + QString::number(code) + ")");
} }
catch (const std::runtime_error&) // raised when converting to invalid type, i.e. missing code or message catch (const std::runtime_error&) // raised when converting to invalid type, i.e. missing code or message
{ // Show raw JSON object { // Show raw JSON object
emit reply(RPCConsole::CMD_ERROR, QString::fromStdString(objError.write())); Q_EMIT reply(RPCConsole::CMD_ERROR, QString::fromStdString(objError.write()));
} }
} }
catch (const std::exception& e) catch (const std::exception& e)
{ {
emit reply(RPCConsole::CMD_ERROR, QString("Error: ") + QString::fromStdString(e.what())); Q_EMIT reply(RPCConsole::CMD_ERROR, QString("Error: ") + QString::fromStdString(e.what()));
} }
} }
@ -245,7 +245,7 @@ RPCConsole::RPCConsole(QWidget *parent) :
RPCConsole::~RPCConsole() RPCConsole::~RPCConsole()
{ {
GUIUtil::saveWindowGeometry("nRPCConsoleWindow", this); GUIUtil::saveWindowGeometry("nRPCConsoleWindow", this);
emit stopExecutor(); Q_EMIT stopExecutor();
delete ui; delete ui;
} }
@ -431,7 +431,7 @@ void RPCConsole::on_lineEdit_returnPressed()
if(!cmd.isEmpty()) if(!cmd.isEmpty())
{ {
message(CMD_REQUEST, cmd); message(CMD_REQUEST, cmd);
emit cmdRequest(cmd); Q_EMIT cmdRequest(cmd);
// Remove command, if already in history // Remove command, if already in history
history.removeOne(cmd); history.removeOne(cmd);
// Append command to history // Append command to history

View File

@ -46,7 +46,7 @@ protected:
virtual bool eventFilter(QObject* obj, QEvent *event); virtual bool eventFilter(QObject* obj, QEvent *event);
void keyPressEvent(QKeyEvent *); void keyPressEvent(QKeyEvent *);
private slots: private Q_SLOTS:
void on_lineEdit_returnPressed(); void on_lineEdit_returnPressed();
void on_tabWidget_currentChanged(int index); void on_tabWidget_currentChanged(int index);
/** open the debug.log from the current datadir */ /** open the debug.log from the current datadir */
@ -61,7 +61,7 @@ private slots:
/** Show custom context menu on Peers tab */ /** Show custom context menu on Peers tab */
void showMenu(const QPoint& point); void showMenu(const QPoint& point);
public slots: public Q_SLOTS:
void clear(); void clear();
void message(int category, const QString &message, bool html = false); void message(int category, const QString &message, bool html = false);
/** Set number of connections shown in the UI */ /** Set number of connections shown in the UI */
@ -79,7 +79,7 @@ public slots:
/** Disconnect a selected node on the Peers tab */ /** Disconnect a selected node on the Peers tab */
void disconnectSelectedNode(); void disconnectSelectedNode();
signals: Q_SIGNALS:
// For RPC command executor // For RPC command executor
void stopExecutor(); void stopExecutor();
void cmdRequest(const QString &command); void cmdRequest(const QString &command);

View File

@ -251,7 +251,7 @@ void SendCoinsDialog::on_sendButton_clicked()
// Format confirmation message // Format confirmation message
QStringList formatted; QStringList formatted;
foreach(const SendCoinsRecipient &rcp, currentTransaction.getRecipients()) Q_FOREACH(const SendCoinsRecipient &rcp, currentTransaction.getRecipients())
{ {
// generate bold amount string // generate bold amount string
QString amount = "<b>" + BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), rcp.amount); QString amount = "<b>" + BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), rcp.amount);
@ -305,7 +305,7 @@ void SendCoinsDialog::on_sendButton_clicked()
questionString.append("<hr />"); questionString.append("<hr />");
CAmount totalAmount = currentTransaction.getTotalTransactionAmount() + txFee; CAmount totalAmount = currentTransaction.getTotalTransactionAmount() + txFee;
QStringList alternativeUnits; QStringList alternativeUnits;
foreach(BitcoinUnits::Unit u, BitcoinUnits::availableUnits()) Q_FOREACH(BitcoinUnits::Unit u, BitcoinUnits::availableUnits())
{ {
if(u != model->getOptionsModel()->getDisplayUnit()) if(u != model->getOptionsModel()->getDisplayUnit())
alternativeUnits.append(BitcoinUnits::formatHtmlWithUnit(u, totalAmount)); alternativeUnits.append(BitcoinUnits::formatHtmlWithUnit(u, totalAmount));
@ -540,7 +540,7 @@ void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn
return; return;
} }
emit message(tr("Send Coins"), msgParams.first, msgParams.second); Q_EMIT message(tr("Send Coins"), msgParams.first, msgParams.second);
} }
void SendCoinsDialog::minimizeFeeSection(bool fMinimize) void SendCoinsDialog::minimizeFeeSection(bool fMinimize)

View File

@ -45,7 +45,7 @@ public:
void pasteEntry(const SendCoinsRecipient &rv); void pasteEntry(const SendCoinsRecipient &rv);
bool handlePaymentRequest(const SendCoinsRecipient &recipient); bool handlePaymentRequest(const SendCoinsRecipient &recipient);
public slots: public Q_SLOTS:
void clear(); void clear();
void reject(); void reject();
void accept(); void accept();
@ -62,13 +62,13 @@ private:
bool fFeeMinimized; bool fFeeMinimized;
// Process WalletModel::SendCoinsReturn and generate a pair consisting // Process WalletModel::SendCoinsReturn and generate a pair consisting
// of a message and message flags for use in emit message(). // of a message and message flags for use in Q_EMIT message().
// Additional parameter msgArg can be used via .arg(msgArg). // Additional parameter msgArg can be used via .arg(msgArg).
void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg = QString()); void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg = QString());
void minimizeFeeSection(bool fMinimize); void minimizeFeeSection(bool fMinimize);
void updateFeeMinimizedLabel(); void updateFeeMinimizedLabel();
private slots: private Q_SLOTS:
void on_sendButton_clicked(); void on_sendButton_clicked();
void on_buttonChooseFee_clicked(); void on_buttonChooseFee_clicked();
void on_buttonMinimizeFee_clicked(); void on_buttonMinimizeFee_clicked();
@ -93,7 +93,7 @@ private slots:
void updateSmartFeeLabel(); void updateSmartFeeLabel();
void updateGlobalFeeVariables(); void updateGlobalFeeVariables();
signals: Q_SIGNALS:
// Fired when a message should be reported to the user // Fired when a message should be reported to the user
void message(const QString &title, const QString &message, unsigned int style); void message(const QString &title, const QString &message, unsigned int style);
}; };

View File

@ -114,7 +114,7 @@ void SendCoinsEntry::clear()
void SendCoinsEntry::deleteClicked() void SendCoinsEntry::deleteClicked()
{ {
emit removeEntry(this); Q_EMIT removeEntry(this);
} }
bool SendCoinsEntry::validate() bool SendCoinsEntry::validate()

View File

@ -45,15 +45,15 @@ public:
void setFocus(); void setFocus();
public slots: public Q_SLOTS:
void clear(); void clear();
signals: Q_SIGNALS:
void removeEntry(SendCoinsEntry *entry); void removeEntry(SendCoinsEntry *entry);
void payAmountChanged(); void payAmountChanged();
void subtractFeeFromAmountChanged(); void subtractFeeFromAmountChanged();
private slots: private Q_SLOTS:
void deleteClicked(); void deleteClicked();
void on_payTo_textChanged(const QString &address); void on_payTo_textChanged(const QString &address);
void on_addressBookButton_clicked(); void on_addressBookButton_clicked();

View File

@ -35,7 +35,7 @@ private:
Ui::SignVerifyMessageDialog *ui; Ui::SignVerifyMessageDialog *ui;
WalletModel *model; WalletModel *model;
private slots: private Q_SLOTS:
/* sign message */ /* sign message */
void on_addressBookButton_SM_clicked(); void on_addressBookButton_SM_clicked();
void on_pasteButton_SM_clicked(); void on_pasteButton_SM_clicked();

View File

@ -27,7 +27,7 @@ protected:
void paintEvent(QPaintEvent *event); void paintEvent(QPaintEvent *event);
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
public slots: public Q_SLOTS:
/** Slot to call finish() method as it's not defined as slot */ /** Slot to call finish() method as it's not defined as slot */
void slotFinish(QWidget *mainWin); void slotFinish(QWidget *mainWin);

View File

@ -195,7 +195,7 @@ void PaymentServerTests::paymentServerTests()
QVERIFY(r.paymentRequest.IsInitialized()); QVERIFY(r.paymentRequest.IsInitialized());
// Extract address and amount from the request // Extract address and amount from the request
QList<std::pair<CScript, CAmount> > sendingTos = r.paymentRequest.getPayTo(); QList<std::pair<CScript, CAmount> > sendingTos = r.paymentRequest.getPayTo();
foreach (const PAIRTYPE(CScript, CAmount)& sendingTo, sendingTos) { Q_FOREACH (const PAIRTYPE(CScript, CAmount)& sendingTo, sendingTos) {
CTxDestination dest; CTxDestination dest;
if (ExtractDestination(sendingTo.first, dest)) if (ExtractDestination(sendingTo.first, dest))
QCOMPARE(PaymentServer::verifyAmount(sendingTo.second), false); QCOMPARE(PaymentServer::verifyAmount(sendingTo.second), false);

View File

@ -14,7 +14,7 @@ class PaymentServerTests : public QObject
{ {
Q_OBJECT Q_OBJECT
private slots: private Q_SLOTS:
void paymentServerTests(); void paymentServerTests();
}; };
@ -25,7 +25,7 @@ class RecipientCatcher : public QObject
{ {
Q_OBJECT Q_OBJECT
public slots: public Q_SLOTS:
void getRecipient(SendCoinsRecipient r); void getRecipient(SendCoinsRecipient r);
public: public:

View File

@ -12,7 +12,7 @@ class URITests : public QObject
{ {
Q_OBJECT Q_OBJECT
private slots: private Q_SLOTS:
void uriTests(); void uriTests();
}; };

View File

@ -139,10 +139,10 @@ void TrafficGraphWidget::updateRates()
} }
float tmax = 0.0f; float tmax = 0.0f;
foreach(float f, vSamplesIn) { Q_FOREACH(float f, vSamplesIn) {
if(f > tmax) tmax = f; if(f > tmax) tmax = f;
} }
foreach(float f, vSamplesOut) { Q_FOREACH(float f, vSamplesOut) {
if(f > tmax) tmax = f; if(f > tmax) tmax = f;
} }
fMax = tmax; fMax = tmax;

View File

@ -27,7 +27,7 @@ public:
protected: protected:
void paintEvent(QPaintEvent *); void paintEvent(QPaintEvent *);
public slots: public Q_SLOTS:
void updateRates(); void updateRates();
void setGraphRangeMins(int mins); void setGraphRangeMins(int mins);
void clear(); void clear();

View File

@ -243,14 +243,14 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
strHTML += "<b>" + tr("Transaction ID") + ":</b> " + TransactionRecord::formatSubTxId(wtx.GetHash(), rec->idx) + "<br>"; strHTML += "<b>" + tr("Transaction ID") + ":</b> " + TransactionRecord::formatSubTxId(wtx.GetHash(), rec->idx) + "<br>";
// Message from normal bitcoin:URI (bitcoin:123...?message=example) // Message from normal bitcoin:URI (bitcoin:123...?message=example)
foreach (const PAIRTYPE(string, string)& r, wtx.vOrderForm) Q_FOREACH (const PAIRTYPE(string, string)& r, wtx.vOrderForm)
if (r.first == "Message") if (r.first == "Message")
strHTML += "<br><b>" + tr("Message") + ":</b><br>" + GUIUtil::HtmlEscape(r.second, true) + "<br>"; strHTML += "<br><b>" + tr("Message") + ":</b><br>" + GUIUtil::HtmlEscape(r.second, true) + "<br>";
// //
// PaymentRequest info: // PaymentRequest info:
// //
foreach (const PAIRTYPE(string, string)& r, wtx.vOrderForm) Q_FOREACH (const PAIRTYPE(string, string)& r, wtx.vOrderForm)
{ {
if (r.first == "PaymentRequest") if (r.first == "PaymentRequest")
{ {

View File

@ -142,7 +142,7 @@ public:
{ {
parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex+toInsert.size()-1); parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex+toInsert.size()-1);
int insert_idx = lowerIndex; int insert_idx = lowerIndex;
foreach(const TransactionRecord &rec, toInsert) Q_FOREACH(const TransactionRecord &rec, toInsert)
{ {
cachedWallet.insert(insert_idx, rec); cachedWallet.insert(insert_idx, rec);
insert_idx += 1; insert_idx += 1;
@ -245,7 +245,7 @@ TransactionTableModel::~TransactionTableModel()
void TransactionTableModel::updateAmountColumnTitle() void TransactionTableModel::updateAmountColumnTitle()
{ {
columns[Amount] = BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit()); columns[Amount] = BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit());
emit headerDataChanged(Qt::Horizontal,Amount,Amount); Q_EMIT headerDataChanged(Qt::Horizontal,Amount,Amount);
} }
void TransactionTableModel::updateTransaction(const QString &hash, int status, bool showTransaction) void TransactionTableModel::updateTransaction(const QString &hash, int status, bool showTransaction)
@ -262,8 +262,8 @@ void TransactionTableModel::updateConfirmations()
// Invalidate status (number of confirmations) and (possibly) description // Invalidate status (number of confirmations) and (possibly) description
// for all rows. Qt is smart enough to only actually request the data for the // for all rows. Qt is smart enough to only actually request the data for the
// visible rows. // visible rows.
emit dataChanged(index(0, Status), index(priv->size()-1, Status)); Q_EMIT dataChanged(index(0, Status), index(priv->size()-1, Status));
emit dataChanged(index(0, ToAddress), index(priv->size()-1, ToAddress)); Q_EMIT dataChanged(index(0, ToAddress), index(priv->size()-1, ToAddress));
} }
int TransactionTableModel::rowCount(const QModelIndex &parent) const int TransactionTableModel::rowCount(const QModelIndex &parent) const
@ -650,7 +650,7 @@ void TransactionTableModel::updateDisplayUnit()
{ {
// emit dataChanged to update Amount column with the current unit // emit dataChanged to update Amount column with the current unit
updateAmountColumnTitle(); updateAmountColumnTitle();
emit dataChanged(index(0, Amount), index(priv->size()-1, Amount)); Q_EMIT dataChanged(index(0, Amount), index(priv->size()-1, Amount));
} }
// queue notifications to show a non freezing progress dialog e.g. for rescan // queue notifications to show a non freezing progress dialog e.g. for rescan

View File

@ -98,7 +98,7 @@ private:
QVariant txWatchonlyDecoration(const TransactionRecord *wtx) const; QVariant txWatchonlyDecoration(const TransactionRecord *wtx) const;
QVariant txAddressDecoration(const TransactionRecord *wtx) const; QVariant txAddressDecoration(const TransactionRecord *wtx) const;
public slots: public Q_SLOTS:
/* New transaction, or transaction changed status */ /* New transaction, or transaction changed status */
void updateTransaction(const QString &hash, int status, bool showTransaction); void updateTransaction(const QString &hash, int status, bool showTransaction);
void updateConfirmations(); void updateConfirmations();

View File

@ -341,11 +341,11 @@ void TransactionView::exportClicked()
writer.addColumn(tr("ID"), 0, TransactionTableModel::TxIDRole); writer.addColumn(tr("ID"), 0, TransactionTableModel::TxIDRole);
if(!writer.write()) { if(!writer.write()) {
emit message(tr("Exporting Failed"), tr("There was an error trying to save the transaction history to %1.").arg(filename), Q_EMIT message(tr("Exporting Failed"), tr("There was an error trying to save the transaction history to %1.").arg(filename),
CClientUIInterface::MSG_ERROR); CClientUIInterface::MSG_ERROR);
} }
else { else {
emit message(tr("Exporting Successful"), tr("The transaction history was successfully saved to %1.").arg(filename), Q_EMIT message(tr("Exporting Successful"), tr("The transaction history was successfully saved to %1.").arg(filename),
CClientUIInterface::MSG_INFORMATION); CClientUIInterface::MSG_INFORMATION);
} }
} }

View File

@ -83,7 +83,7 @@ private:
bool eventFilter(QObject *obj, QEvent *event); bool eventFilter(QObject *obj, QEvent *event);
private slots: private Q_SLOTS:
void contextualMenu(const QPoint &); void contextualMenu(const QPoint &);
void dateRangeChanged(); void dateRangeChanged();
void showDetails(); void showDetails();
@ -95,13 +95,13 @@ private slots:
void openThirdPartyTxUrl(QString url); void openThirdPartyTxUrl(QString url);
void updateWatchOnlyColumn(bool fHaveWatchOnly); void updateWatchOnlyColumn(bool fHaveWatchOnly);
signals: Q_SIGNALS:
void doubleClicked(const QModelIndex&); void doubleClicked(const QModelIndex&);
/** Fired when a message should be reported to the user */ /** Fired when a message should be reported to the user */
void message(const QString &title, const QString &message, unsigned int style); void message(const QString &title, const QString &message, unsigned int style);
public slots: public Q_SLOTS:
void chooseDate(int idx); void chooseDate(int idx);
void chooseType(int idx); void chooseType(int idx);
void chooseWatchonly(int idx); void chooseWatchonly(int idx);

View File

@ -84,7 +84,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
QTextCharFormat bold; QTextCharFormat bold;
bold.setFontWeight(QFont::Bold); bold.setFontWeight(QFont::Bold);
foreach (const QString &line, coreOptions.split("\n")) { Q_FOREACH (const QString &line, coreOptions.split("\n")) {
if (line.startsWith(" -")) if (line.startsWith(" -"))
{ {
cursor.currentTable()->appendRows(1); cursor.currentTable()->appendRows(1);

View File

@ -31,7 +31,7 @@ private:
Ui::HelpMessageDialog *ui; Ui::HelpMessageDialog *ui;
QString text; QString text;
private slots: private Q_SLOTS:
void on_okButton_accepted(); void on_okButton_accepted();
}; };

View File

@ -47,7 +47,7 @@ private:
WalletView *currentWalletView(); WalletView *currentWalletView();
public slots: public Q_SLOTS:
/** Switch to overview (home) page */ /** Switch to overview (home) page */
void gotoOverviewPage(); void gotoOverviewPage();
/** Switch to history (transactions) page */ /** Switch to history (transactions) page */

View File

@ -107,7 +107,7 @@ void WalletModel::updateStatus()
EncryptionStatus newEncryptionStatus = getEncryptionStatus(); EncryptionStatus newEncryptionStatus = getEncryptionStatus();
if(cachedEncryptionStatus != newEncryptionStatus) if(cachedEncryptionStatus != newEncryptionStatus)
emit encryptionStatusChanged(newEncryptionStatus); Q_EMIT encryptionStatusChanged(newEncryptionStatus);
} }
void WalletModel::pollBalanceChanged() void WalletModel::pollBalanceChanged()
@ -159,7 +159,7 @@ void WalletModel::checkBalanceChanged()
cachedWatchOnlyBalance = newWatchOnlyBalance; cachedWatchOnlyBalance = newWatchOnlyBalance;
cachedWatchUnconfBalance = newWatchUnconfBalance; cachedWatchUnconfBalance = newWatchUnconfBalance;
cachedWatchImmatureBalance = newWatchImmatureBalance; cachedWatchImmatureBalance = newWatchImmatureBalance;
emit balanceChanged(newBalance, newUnconfirmedBalance, newImmatureBalance, Q_EMIT balanceChanged(newBalance, newUnconfirmedBalance, newImmatureBalance,
newWatchOnlyBalance, newWatchUnconfBalance, newWatchImmatureBalance); newWatchOnlyBalance, newWatchUnconfBalance, newWatchImmatureBalance);
} }
} }
@ -180,7 +180,7 @@ void WalletModel::updateAddressBook(const QString &address, const QString &label
void WalletModel::updateWatchOnlyFlag(bool fHaveWatchonly) void WalletModel::updateWatchOnlyFlag(bool fHaveWatchonly)
{ {
fHaveWatchOnly = fHaveWatchonly; fHaveWatchOnly = fHaveWatchonly;
emit notifyWatchonlyChanged(fHaveWatchonly); Q_EMIT notifyWatchonlyChanged(fHaveWatchonly);
} }
bool WalletModel::validateAddress(const QString &address) bool WalletModel::validateAddress(const QString &address)
@ -205,7 +205,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
int nAddresses = 0; int nAddresses = 0;
// Pre-check input data for validity // Pre-check input data for validity
foreach(const SendCoinsRecipient &rcp, recipients) Q_FOREACH(const SendCoinsRecipient &rcp, recipients)
{ {
if (rcp.fSubtractFeeFromAmount) if (rcp.fSubtractFeeFromAmount)
fSubtractFeeFromAmount = true; fSubtractFeeFromAmount = true;
@ -285,7 +285,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
{ {
return SendCoinsReturn(AmountWithFeeExceedsBalance); return SendCoinsReturn(AmountWithFeeExceedsBalance);
} }
emit message(tr("Send Coins"), QString::fromStdString(strFailReason), Q_EMIT message(tr("Send Coins"), QString::fromStdString(strFailReason),
CClientUIInterface::MSG_ERROR); CClientUIInterface::MSG_ERROR);
return TransactionCreationFailed; return TransactionCreationFailed;
} }
@ -306,7 +306,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran
LOCK2(cs_main, wallet->cs_wallet); LOCK2(cs_main, wallet->cs_wallet);
CWalletTx *newTx = transaction.getTransaction(); CWalletTx *newTx = transaction.getTransaction();
foreach(const SendCoinsRecipient &rcp, transaction.getRecipients()) Q_FOREACH(const SendCoinsRecipient &rcp, transaction.getRecipients())
{ {
if (rcp.paymentRequest.IsInitialized()) if (rcp.paymentRequest.IsInitialized())
{ {
@ -337,7 +337,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran
// Add addresses / update labels that we've sent to to the address book, // Add addresses / update labels that we've sent to to the address book,
// and emit coinsSent signal for each recipient // and emit coinsSent signal for each recipient
foreach(const SendCoinsRecipient &rcp, transaction.getRecipients()) Q_FOREACH(const SendCoinsRecipient &rcp, transaction.getRecipients())
{ {
// Don't touch the address book when we have a payment request // Don't touch the address book when we have a payment request
if (!rcp.paymentRequest.IsInitialized()) if (!rcp.paymentRequest.IsInitialized())
@ -361,7 +361,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran
} }
} }
} }
emit coinsSent(wallet, rcp, transaction_array); Q_EMIT coinsSent(wallet, rcp, transaction_array);
} }
checkBalanceChanged(); // update balance immediately, otherwise there could be a short noticeable delay until pollBalanceChanged hits checkBalanceChanged(); // update balance immediately, otherwise there could be a short noticeable delay until pollBalanceChanged hits
@ -521,7 +521,7 @@ WalletModel::UnlockContext WalletModel::requestUnlock()
if(was_locked) if(was_locked)
{ {
// Request UI to unlock wallet // Request UI to unlock wallet
emit requireUnlock(); Q_EMIT requireUnlock();
} }
// If wallet is still locked, unlock was failed or cancelled, mark context as invalid // If wallet is still locked, unlock was failed or cancelled, mark context as invalid
bool valid = getEncryptionStatus() != Locked; bool valid = getEncryptionStatus() != Locked;

View File

@ -227,7 +227,7 @@ private:
void unsubscribeFromCoreSignals(); void unsubscribeFromCoreSignals();
void checkBalanceChanged(); void checkBalanceChanged();
signals: Q_SIGNALS:
// Signal that balance in wallet changed // Signal that balance in wallet changed
void balanceChanged(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, void balanceChanged(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance,
const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance); const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance);
@ -252,7 +252,7 @@ signals:
// Watch-only address added // Watch-only address added
void notifyWatchonlyChanged(bool fHaveWatchonly); void notifyWatchonlyChanged(bool fHaveWatchonly);
public slots: public Q_SLOTS:
/* Wallet status might have changed */ /* Wallet status might have changed */
void updateStatus(); void updateStatus();
/* New transaction, or transaction changed status */ /* New transaction, or transaction changed status */

View File

@ -81,7 +81,7 @@ void WalletModelTransaction::reassignAmounts(int nChangePosRet)
CAmount WalletModelTransaction::getTotalTransactionAmount() CAmount WalletModelTransaction::getTotalTransactionAmount()
{ {
CAmount totalTransactionAmount = 0; CAmount totalTransactionAmount = 0;
foreach(const SendCoinsRecipient &rcp, recipients) Q_FOREACH(const SendCoinsRecipient &rcp, recipients)
{ {
totalTransactionAmount += rcp.amount; totalTransactionAmount += rcp.amount;
} }

View File

@ -153,7 +153,7 @@ void WalletView::processNewTransaction(const QModelIndex& parent, int start, int
QString address = ttm->data(index, TransactionTableModel::AddressRole).toString(); QString address = ttm->data(index, TransactionTableModel::AddressRole).toString();
QString label = ttm->data(index, TransactionTableModel::LabelRole).toString(); QString label = ttm->data(index, TransactionTableModel::LabelRole).toString();
emit incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address, label); Q_EMIT incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address, label);
} }
void WalletView::gotoOverviewPage() void WalletView::gotoOverviewPage()
@ -215,7 +215,7 @@ void WalletView::showOutOfSyncWarning(bool fShow)
void WalletView::updateEncryptionStatus() void WalletView::updateEncryptionStatus()
{ {
emit encryptionStatusChanged(walletModel->getEncryptionStatus()); Q_EMIT encryptionStatusChanged(walletModel->getEncryptionStatus());
} }
void WalletView::encryptWallet(bool status) void WalletView::encryptWallet(bool status)
@ -239,11 +239,11 @@ void WalletView::backupWallet()
return; return;
if (!walletModel->backupWallet(filename)) { if (!walletModel->backupWallet(filename)) {
emit message(tr("Backup Failed"), tr("There was an error trying to save the wallet data to %1.").arg(filename), Q_EMIT message(tr("Backup Failed"), tr("There was an error trying to save the wallet data to %1.").arg(filename),
CClientUIInterface::MSG_ERROR); CClientUIInterface::MSG_ERROR);
} }
else { else {
emit message(tr("Backup Successful"), tr("The wallet data was successfully saved to %1.").arg(filename), Q_EMIT message(tr("Backup Successful"), tr("The wallet data was successfully saved to %1.").arg(filename),
CClientUIInterface::MSG_INFORMATION); CClientUIInterface::MSG_INFORMATION);
} }
} }

View File

@ -65,7 +65,7 @@ private:
QProgressDialog *progressDialog; QProgressDialog *progressDialog;
public slots: public Q_SLOTS:
/** Switch to overview (home) page */ /** Switch to overview (home) page */
void gotoOverviewPage(); void gotoOverviewPage();
/** Switch to history (transactions) page */ /** Switch to history (transactions) page */
@ -105,7 +105,7 @@ public slots:
/** Show progress dialog e.g. for rescan */ /** Show progress dialog e.g. for rescan */
void showProgress(const QString &title, int nProgress); void showProgress(const QString &title, int nProgress);
signals: Q_SIGNALS:
/** Signal that we want to show the main window */ /** Signal that we want to show the main window */
void showNormalIfMinimized(); void showNormalIfMinimized();
/** Fired when a message should be reported to the user */ /** Fired when a message should be reported to the user */