From 32af5266cfc604a32ed90b6099f8b2fb308d6c15 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 23 Jan 2013 21:51:02 +0100 Subject: [PATCH] Bitcoin-Qt: massive header and cpp cleanup - try to enforce the same style to all Qt related files - remove unneeded includes from the files - add missing Q_OBJECT, QT_BEGIN_NAMESPACE / QT_END_NAMESPACE - prepares for a pull-req to include Qt5 compatibility --- src/qt/addressbookpage.cpp | 8 ++++---- src/qt/addresstablemodel.cpp | 2 +- src/qt/addresstablemodel.h | 1 + src/qt/askpassphrasedialog.h | 1 - src/qt/bitcoin.cpp | 4 +++- src/qt/bitcoin.qrc | 2 +- src/qt/bitcoinaddressvalidator.h | 7 ++----- src/qt/bitcoinamountfield.cpp | 8 ++------ src/qt/bitcoinamountfield.h | 3 ++- src/qt/bitcoingui.cpp | 11 +++++------ src/qt/bitcoingui.h | 5 +---- src/qt/bitcoinunits.h | 3 +++ src/qt/clientmodel.cpp | 1 + src/qt/clientmodel.h | 2 ++ src/qt/csvmodelwriter.h | 6 +----- src/qt/editaddressdialog.cpp | 1 + src/qt/editaddressdialog.h | 8 ++++---- src/qt/guiutil.cpp | 6 ++++-- src/qt/guiutil.h | 3 ++- src/qt/macdockiconhandler.h | 5 +++-- src/qt/macdockiconhandler.mm | 1 - src/qt/monitoreddatamapper.cpp | 1 - src/qt/monitoreddatamapper.h | 5 ++--- src/qt/notificator.cpp | 2 +- src/qt/notificator.h | 8 ++++---- src/qt/optionsdialog.cpp | 2 -- src/qt/optionsmodel.cpp | 5 +++-- src/qt/overviewpage.h | 8 ++++---- src/qt/paymentserver.cpp | 7 ++++--- src/qt/qvalidatedlineedit.h | 1 + src/qt/qvaluecombobox.h | 4 ++-- src/qt/rpcconsole.cpp | 6 +++--- src/qt/sendcoinsdialog.cpp | 2 +- src/qt/sendcoinsentry.cpp | 1 + src/qt/signverifymessagedialog.cpp | 4 ++-- src/qt/signverifymessagedialog.h | 3 --- src/qt/test/uritests.cpp | 9 --------- src/qt/transactiondesc.cpp | 3 ++- src/qt/transactiondesc.h | 3 ++- src/qt/transactiondescdialog.h | 1 + src/qt/transactionfilterproxy.cpp | 1 + src/qt/transactionfilterproxy.h | 7 ++----- src/qt/transactionrecord.h | 4 ++-- src/qt/transactiontablemodel.cpp | 3 +-- src/qt/transactiontablemodel.h | 2 ++ src/qt/transactionview.cpp | 18 +++++------------- src/qt/transactionview.h | 1 + src/qt/walletmodel.h | 2 +- 48 files changed, 91 insertions(+), 110 deletions(-) diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index f4696d5a3..b53a37fc2 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -8,15 +8,15 @@ #include "csvmodelwriter.h" #include "guiutil.h" +#ifdef USE_QRCODE +#include "qrcodedialog.h" +#endif + #include #include #include #include -#ifdef USE_QRCODE -#include "qrcodedialog.h" -#endif - AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : QDialog(parent), ui(new Ui::AddressBookPage), diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp index 03b09cdce..180144452 100644 --- a/src/qt/addresstablemodel.cpp +++ b/src/qt/addresstablemodel.cpp @@ -1,4 +1,5 @@ #include "addresstablemodel.h" + #include "guiutil.h" #include "walletmodel.h" @@ -6,7 +7,6 @@ #include "base58.h" #include -#include const QString AddressTableModel::Send = "S"; const QString AddressTableModel::Receive = "R"; diff --git a/src/qt/addresstablemodel.h b/src/qt/addresstablemodel.h index ae3e3b2f0..48baff5e5 100644 --- a/src/qt/addresstablemodel.h +++ b/src/qt/addresstablemodel.h @@ -14,6 +14,7 @@ class WalletModel; class AddressTableModel : public QAbstractTableModel { Q_OBJECT + public: explicit AddressTableModel(CWallet *wallet, WalletModel *parent = 0); ~AddressTableModel(); diff --git a/src/qt/askpassphrasedialog.h b/src/qt/askpassphrasedialog.h index 338853ce2..9df002da2 100644 --- a/src/qt/askpassphrasedialog.h +++ b/src/qt/askpassphrasedialog.h @@ -6,7 +6,6 @@ namespace Ui { class AskPassphraseDialog; } - class WalletModel; /** Multifunctional dialog to ask for passphrases. Used for encryption, unlocking, and changing the passphrase. diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 75e9b965b..e3d51be54 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -1,6 +1,9 @@ /* * W.J. van der Laan 2011-2012 */ + +#include + #include "bitcoingui.h" #include "clientmodel.h" #include "walletmodel.h" @@ -11,7 +14,6 @@ #include "ui_interface.h" #include "paymentserver.h" -#include #include #include #include diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index b13a87dd2..84ebb2483 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -1,4 +1,4 @@ - + res/icons/bitcoin.png res/icons/address-book.png diff --git a/src/qt/bitcoinaddressvalidator.h b/src/qt/bitcoinaddressvalidator.h index 9710d122b..2b6a59367 100644 --- a/src/qt/bitcoinaddressvalidator.h +++ b/src/qt/bitcoinaddressvalidator.h @@ -1,7 +1,7 @@ #ifndef BITCOINADDRESSVALIDATOR_H #define BITCOINADDRESSVALIDATOR_H -#include +#include /** Base48 entry widget validator. Corrects near-miss characters and refuses characters that are no part of base48. @@ -9,16 +9,13 @@ class BitcoinAddressValidator : public QValidator { Q_OBJECT + public: explicit BitcoinAddressValidator(QObject *parent = 0); State validate(QString &input, int &pos) const; static const int MaxAddressLength = 35; -signals: - -public slots: - }; #endif // BITCOINADDRESSVALIDATOR_H diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index 9514ec846..ddf185c41 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -1,18 +1,14 @@ #include "bitcoinamountfield.h" + #include "qvaluecombobox.h" #include "bitcoinunits.h" - #include "guiconstants.h" -#include -#include -#include #include #include #include -#include #include -#include +#include // for qPow() BitcoinAmountField::BitcoinAmountField(QWidget *parent): QWidget(parent), amount(0), currentUnit(-1) diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index 4797c4c88..dacbb395e 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -13,7 +13,9 @@ QT_END_NAMESPACE class BitcoinAmountField: public QWidget { Q_OBJECT + Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY textChanged USER true) + public: explicit BitcoinAmountField(QWidget *parent = 0); @@ -56,5 +58,4 @@ private slots: }; - #endif // BITCOINAMOUNTFIELD_H diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index f1bf5f588..4f97a4815 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -4,7 +4,11 @@ * W.J. van der Laan 2011-2012 * The Bitcoin Developers 2011-2012 */ + +#include + #include "bitcoingui.h" + #include "transactiontablemodel.h" #include "addressbookpage.h" #include "sendcoinsdialog.h" @@ -31,19 +35,13 @@ #include "macdockiconhandler.h" #endif -#include -#include #include #include #include -#include #include #include #include #include -#include -#include -#include #include #include #include @@ -54,6 +52,7 @@ #include #include #include +#include #include #include diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 8ce0335bc..b992bfdc6 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -17,13 +17,9 @@ class RPCConsole; QT_BEGIN_NAMESPACE class QLabel; -class QLineEdit; -class QTableView; -class QAbstractItemModel; class QModelIndex; class QProgressBar; class QStackedWidget; -class QUrl; QT_END_NAMESPACE /** @@ -33,6 +29,7 @@ QT_END_NAMESPACE class BitcoinGUI : public QMainWindow { Q_OBJECT + public: explicit BitcoinGUI(QWidget *parent = 0); ~BitcoinGUI(); diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index 9b7c9e160..6e96cef59 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -9,6 +9,8 @@ */ class BitcoinUnits: public QAbstractListModel { + Q_OBJECT + public: explicit BitcoinUnits(QObject *parent); @@ -58,6 +60,7 @@ public: int rowCount(const QModelIndex &parent) const; QVariant data(const QModelIndex &index, int role) const; ///@} + private: QList unitlist; }; diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 858fbe241..ae6692418 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -1,4 +1,5 @@ #include "clientmodel.h" + #include "guiconstants.h" #include "optionsmodel.h" #include "addresstablemodel.h" diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index a3fe92048..3ba34b278 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -24,6 +24,7 @@ enum BlockSource { class ClientModel : public QObject { Q_OBJECT + public: explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0); ~ClientModel(); @@ -66,6 +67,7 @@ private: void subscribeToCoreSignals(); void unsubscribeFromCoreSignals(); + signals: void numConnectionsChanged(int count); void numBlocksChanged(int count, int countOfPeers); diff --git a/src/qt/csvmodelwriter.h b/src/qt/csvmodelwriter.h index 6c9dcbaf3..c4504ee91 100644 --- a/src/qt/csvmodelwriter.h +++ b/src/qt/csvmodelwriter.h @@ -14,6 +14,7 @@ QT_END_NAMESPACE class CSVModelWriter : public QObject { Q_OBJECT + public: explicit CSVModelWriter(const QString &filename, QObject *parent = 0); @@ -36,11 +37,6 @@ private: int role; }; QList columns; - -signals: - -public slots: - }; #endif // CSVMODELWRITER_H diff --git a/src/qt/editaddressdialog.cpp b/src/qt/editaddressdialog.cpp index 5cfcb34b9..9abad7647 100644 --- a/src/qt/editaddressdialog.cpp +++ b/src/qt/editaddressdialog.cpp @@ -1,5 +1,6 @@ #include "editaddressdialog.h" #include "ui_editaddressdialog.h" + #include "addresstablemodel.h" #include "guiutil.h" diff --git a/src/qt/editaddressdialog.h b/src/qt/editaddressdialog.h index 0e4183bd5..44e5023d2 100644 --- a/src/qt/editaddressdialog.h +++ b/src/qt/editaddressdialog.h @@ -3,15 +3,15 @@ #include -QT_BEGIN_NAMESPACE -class QDataWidgetMapper; -QT_END_NAMESPACE - namespace Ui { class EditAddressDialog; } class AddressTableModel; +QT_BEGIN_NAMESPACE +class QDataWidgetMapper; +QT_END_NAMESPACE + /** Dialog for editing an address and associated information. */ class EditAddressDialog : public QDialog diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index d4e73adf9..30ad8ef66 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -1,11 +1,14 @@ +#include + #include "guiutil.h" + #include "bitcoinaddressvalidator.h" #include "walletmodel.h" #include "bitcoinunits.h" + #include "util.h" #include "init.h" -#include #include #include #include @@ -13,7 +16,6 @@ #include #include // For Qt::escape #include -#include #include #include #include diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index db100bdb7..e2c7d18aa 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -5,6 +5,8 @@ #include #include +class SendCoinsRecipient; + QT_BEGIN_NAMESPACE class QFont; class QLineEdit; @@ -13,7 +15,6 @@ class QDateTime; class QUrl; class QAbstractItemView; QT_END_NAMESPACE -class SendCoinsRecipient; /** Utility functions used by the Bitcoin Qt UI. */ diff --git a/src/qt/macdockiconhandler.h b/src/qt/macdockiconhandler.h index dd85e0c33..5018456aa 100644 --- a/src/qt/macdockiconhandler.h +++ b/src/qt/macdockiconhandler.h @@ -3,9 +3,11 @@ #include +QT_BEGIN_NAMESPACE class QMenu; class QIcon; class QWidget; +QT_END_NAMESPACE #ifdef __OBJC__ @class DockIconClickEventHandler; @@ -18,6 +20,7 @@ class DockIconClickEventHandler; class MacDockIconHandler : public QObject { Q_OBJECT + public: ~MacDockIconHandler(); @@ -31,8 +34,6 @@ public: signals: void dockIconClicked(); -public slots: - private: MacDockIconHandler(); diff --git a/src/qt/macdockiconhandler.mm b/src/qt/macdockiconhandler.mm index 75684403e..ea868401c 100644 --- a/src/qt/macdockiconhandler.mm +++ b/src/qt/macdockiconhandler.mm @@ -1,4 +1,3 @@ - #include "macdockiconhandler.h" #include diff --git a/src/qt/monitoreddatamapper.cpp b/src/qt/monitoreddatamapper.cpp index 88948d07b..4c201834c 100644 --- a/src/qt/monitoreddatamapper.cpp +++ b/src/qt/monitoreddatamapper.cpp @@ -9,7 +9,6 @@ MonitoredDataMapper::MonitoredDataMapper(QObject *parent) : { } - void MonitoredDataMapper::addMapping(QWidget *widget, int section) { QDataWidgetMapper::addMapping(widget, section); diff --git a/src/qt/monitoreddatamapper.h b/src/qt/monitoreddatamapper.h index 33a874e73..de55c86fc 100644 --- a/src/qt/monitoreddatamapper.h +++ b/src/qt/monitoreddatamapper.h @@ -13,19 +13,18 @@ QT_END_NAMESPACE class MonitoredDataMapper : public QDataWidgetMapper { Q_OBJECT + public: explicit MonitoredDataMapper(QObject *parent=0); void addMapping(QWidget *widget, int section); void addMapping(QWidget *widget, int section, const QByteArray &propertyName); + private: void addChangeMonitor(QWidget *widget); signals: void viewModified(); - }; - - #endif // MONITOREDDATAMAPPER_H diff --git a/src/qt/notificator.cpp b/src/qt/notificator.cpp index 628dca159..397e7aa4a 100644 --- a/src/qt/notificator.cpp +++ b/src/qt/notificator.cpp @@ -12,7 +12,7 @@ #include #ifdef USE_DBUS -#include +#include #include #endif diff --git a/src/qt/notificator.h b/src/qt/notificator.h index 833b52cb1..d20673abb 100644 --- a/src/qt/notificator.h +++ b/src/qt/notificator.h @@ -15,6 +15,7 @@ QT_END_NAMESPACE class Notificator: public QObject { Q_OBJECT + public: /** Create a new notificator. @note Ownership of trayIcon is not transferred to this object. @@ -25,13 +26,12 @@ public: // Message class enum Class { - Information, /**< Informational message */ - Warning, /**< Notify user of potential problem */ - Critical /**< An error occurred */ + Information, /**< Informational message */ + Warning, /**< Notify user of potential problem */ + Critical /**< An error occurred */ }; public slots: - /** Show notification message. @param[in] cls general message class @param[in] title title shown with message diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 6b98ab192..4fa1f6092 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -10,8 +10,6 @@ #include #include #include -#include -#include OptionsDialog::OptionsDialog(QWidget *parent) : QDialog(parent), diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 2457e3874..cd3170a30 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -1,11 +1,12 @@ #include "optionsmodel.h" -#include "bitcoinunits.h" -#include +#include "bitcoinunits.h" #include "init.h" #include "walletdb.h" #include "guiutil.h" +#include + OptionsModel::OptionsModel(QObject *parent) : QAbstractListModel(parent) { diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h index bb32a0c33..b287f479f 100644 --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -3,10 +3,6 @@ #include -QT_BEGIN_NAMESPACE -class QModelIndex; -QT_END_NAMESPACE - namespace Ui { class OverviewPage; } @@ -15,6 +11,10 @@ class WalletModel; class TxViewDelegate; class TransactionFilterProxy; +QT_BEGIN_NAMESPACE +class QModelIndex; +QT_END_NAMESPACE + /** Overview ("home") page widget */ class OverviewPage : public QWidget { diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 05f2ac10e..a92e6fc32 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -2,14 +2,15 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include + #include "paymentserver.h" + #include "guiconstants.h" #include "ui_interface.h" #include "util.h" -#include #include -#include #include #include #include @@ -59,7 +60,7 @@ bool PaymentServer::ipcSendCommandLine() { bool fResult = false; - const QStringList& args = QCoreApplication::arguments(); + const QStringList& args = qApp->arguments(); for (int i = 1; i < args.size(); i++) { if (!args[i].startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) diff --git a/src/qt/qvalidatedlineedit.h b/src/qt/qvalidatedlineedit.h index 66e26be9a..ec74633c0 100644 --- a/src/qt/qvalidatedlineedit.h +++ b/src/qt/qvalidatedlineedit.h @@ -9,6 +9,7 @@ class QValidatedLineEdit : public QLineEdit { Q_OBJECT + public: explicit QValidatedLineEdit(QWidget *parent = 0); void clear(); diff --git a/src/qt/qvaluecombobox.h b/src/qt/qvaluecombobox.h index 1a47bb656..64a7da9df 100644 --- a/src/qt/qvaluecombobox.h +++ b/src/qt/qvaluecombobox.h @@ -8,7 +8,9 @@ class QValueComboBox : public QComboBox { Q_OBJECT + Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged USER true) + public: explicit QValueComboBox(QWidget *parent = 0); @@ -21,8 +23,6 @@ public: signals: void valueChanged(); -public slots: - private: int role; diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 7cf2d4196..c9ce37434 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -6,9 +6,7 @@ #include "guiutil.h" #include -#include #include -#include #include #include #include @@ -35,12 +33,14 @@ const struct { /* Object for executing console RPC commands in a separate thread. */ -class RPCExecutor: public QObject +class RPCExecutor : public QObject { Q_OBJECT + public slots: void start(); void request(const QString &command); + signals: void reply(int category, const QString &command); }; diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 0c1547bd8..56392f96d 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -1,5 +1,6 @@ #include "sendcoinsdialog.h" #include "ui_sendcoinsdialog.h" + #include "walletmodel.h" #include "bitcoinunits.h" #include "addressbookpage.h" @@ -10,7 +11,6 @@ #include "base58.h" #include -#include #include #include diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp index c4d84c388..7dbca2408 100644 --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -1,5 +1,6 @@ #include "sendcoinsentry.h" #include "ui_sendcoinsentry.h" + #include "guiutil.h" #include "bitcoinunits.h" #include "addressbookpage.h" diff --git a/src/qt/signverifymessagedialog.cpp b/src/qt/signverifymessagedialog.cpp index 371b5ba53..7c43e5839 100644 --- a/src/qt/signverifymessagedialog.cpp +++ b/src/qt/signverifymessagedialog.cpp @@ -10,11 +10,11 @@ #include "walletmodel.h" #include "wallet.h" +#include + #include #include -#include - SignVerifyMessageDialog::SignVerifyMessageDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SignVerifyMessageDialog), diff --git a/src/qt/signverifymessagedialog.h b/src/qt/signverifymessagedialog.h index 2c2677cc0..558f24e23 100644 --- a/src/qt/signverifymessagedialog.h +++ b/src/qt/signverifymessagedialog.h @@ -8,9 +8,6 @@ namespace Ui { } class WalletModel; -QT_BEGIN_NAMESPACE -QT_END_NAMESPACE - class SignVerifyMessageDialog : public QDialog { Q_OBJECT diff --git a/src/qt/test/uritests.cpp b/src/qt/test/uritests.cpp index 4662f5ed3..802d74719 100644 --- a/src/qt/test/uritests.cpp +++ b/src/qt/test/uritests.cpp @@ -4,15 +4,6 @@ #include -/* -struct SendCoinsRecipient -{ - QString address; - QString label; - qint64 amount; -}; -*/ - void URITests::uriTests() { SendCoinsRecipient rv; diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index d5b08448d..e4dbf9c0d 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -2,13 +2,14 @@ #include "guiutil.h" #include "bitcoinunits.h" - #include "main.h" #include "wallet.h" #include "db.h" #include "ui_interface.h" #include "base58.h" +#include + QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx) { if (!wtx.IsFinal()) diff --git a/src/qt/transactiondesc.h b/src/qt/transactiondesc.h index 2523f9aa6..cb0dda5b5 100644 --- a/src/qt/transactiondesc.h +++ b/src/qt/transactiondesc.h @@ -3,7 +3,6 @@ #include #include -#include class CWallet; class CWalletTx; @@ -13,8 +12,10 @@ class CWalletTx; class TransactionDesc: public QObject { Q_OBJECT + public: static QString toHTML(CWallet *wallet, CWalletTx &wtx); + private: TransactionDesc() {} diff --git a/src/qt/transactiondescdialog.h b/src/qt/transactiondescdialog.h index e86fb58a6..f7ceacb63 100644 --- a/src/qt/transactiondescdialog.h +++ b/src/qt/transactiondescdialog.h @@ -6,6 +6,7 @@ namespace Ui { class TransactionDescDialog; } + QT_BEGIN_NAMESPACE class QModelIndex; QT_END_NAMESPACE diff --git a/src/qt/transactionfilterproxy.cpp b/src/qt/transactionfilterproxy.cpp index 16fb4dab9..068e5550d 100644 --- a/src/qt/transactionfilterproxy.cpp +++ b/src/qt/transactionfilterproxy.cpp @@ -1,4 +1,5 @@ #include "transactionfilterproxy.h" + #include "transactiontablemodel.h" #include diff --git a/src/qt/transactionfilterproxy.h b/src/qt/transactionfilterproxy.h index 30b98588f..1aea85a00 100644 --- a/src/qt/transactionfilterproxy.h +++ b/src/qt/transactionfilterproxy.h @@ -8,6 +8,7 @@ class TransactionFilterProxy : public QSortFilterProxyModel { Q_OBJECT + public: explicit TransactionFilterProxy(QObject *parent = 0); @@ -32,6 +33,7 @@ public: void setLimit(int limit); int rowCount(const QModelIndex &parent = QModelIndex()) const; + protected: bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const; @@ -42,11 +44,6 @@ private: quint32 typeFilter; qint64 minAmount; int limitRows; - -signals: - -public slots: - }; #endif // TRANSACTIONFILTERPROXY_H diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index f6570803d..d760d47c8 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -14,8 +14,8 @@ class TransactionStatus { public: TransactionStatus(): - confirmed(false), sortKey(""), maturity(Mature), - matures_in(0), status(Offline), depth(0), open_for(0), cur_num_blocks(-1) + confirmed(false), sortKey(""), maturity(Mature), + matures_in(0), status(Offline), depth(0), open_for(0), cur_num_blocks(-1) { } enum Maturity diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index aef0e409b..baf1e1648 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -1,4 +1,5 @@ #include "transactiontablemodel.h" + #include "guiutil.h" #include "transactionrecord.h" #include "guiconstants.h" @@ -11,13 +12,11 @@ #include "wallet.h" #include "ui_interface.h" -#include #include #include #include #include #include -#include // Amount column is right-aligned it contains numbers static int column_alignments[] = { diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index b0687d539..6b2961c28 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -14,6 +14,7 @@ class WalletModel; class TransactionTableModel : public QAbstractTableModel { Q_OBJECT + public: explicit TransactionTableModel(CWallet* wallet, WalletModel *parent = 0); ~TransactionTableModel(); @@ -55,6 +56,7 @@ public: QVariant data(const QModelIndex &index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; + private: CWallet* wallet; WalletModel *walletModel; diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 7acf5deaa..e7c384161 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -20,12 +20,9 @@ #include #include #include -#include #include #include #include -#include -#include #include #include @@ -173,16 +170,11 @@ void TransactionView::setModel(WalletModel *model) transactionView->sortByColumn(TransactionTableModel::Status, Qt::DescendingOrder); transactionView->verticalHeader()->hide(); - transactionView->horizontalHeader()->resizeSection( - TransactionTableModel::Status, 23); - transactionView->horizontalHeader()->resizeSection( - TransactionTableModel::Date, 120); - transactionView->horizontalHeader()->resizeSection( - TransactionTableModel::Type, 120); - transactionView->horizontalHeader()->setResizeMode( - TransactionTableModel::ToAddress, QHeaderView::Stretch); - transactionView->horizontalHeader()->resizeSection( - TransactionTableModel::Amount, 100); + transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Status, 23); + transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Date, 120); + transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Type, 120); + transactionView->horizontalHeader()->setResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch); + transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Amount, 100); } } diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h index 4ade3ecd5..e61515fda 100644 --- a/src/qt/transactionview.h +++ b/src/qt/transactionview.h @@ -22,6 +22,7 @@ QT_END_NAMESPACE class TransactionView : public QWidget { Q_OBJECT + public: explicit TransactionView(QWidget *parent = 0); diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index fd5c8c4d4..f14b09eff 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -26,6 +26,7 @@ public: class WalletModel : public QObject { Q_OBJECT + public: explicit WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent = 0); ~WalletModel(); @@ -161,5 +162,4 @@ public slots: void pollBalanceChanged(); }; - #endif // WALLETMODEL_H