aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorBrandon Dahler <brandon.dahler@gmail.com>2013-04-13 00:13:08 -0500
committerBrandon Dahler <brandon.dahler@gmail.com>2013-11-10 09:36:28 -0600
commit51ed9ec971614aebdbfbd9527aba365dd0afd437 (patch)
treed2f910390e55aef857023812fbdaefdd66cd99ff /src/qt
parent7c4c207be8420d394a5abc4368d1bb69ad4f8067 (diff)
Cleanup code using forward declarations.
Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/aboutdialog.cpp1
-rw-r--r--src/qt/aboutdialog.h3
-rw-r--r--src/qt/addressbookpage.cpp8
-rw-r--r--src/qt/addressbookpage.h8
-rw-r--r--src/qt/addresstablemodel.cpp2
-rw-r--r--src/qt/addresstablemodel.h3
-rw-r--r--src/qt/askpassphrasedialog.cpp4
-rw-r--r--src/qt/askpassphrasedialog.h3
-rw-r--r--src/qt/bitcoin.cpp33
-rw-r--r--src/qt/bitcoinamountfield.cpp5
-rw-r--r--src/qt/bitcoingui.cpp49
-rw-r--r--src/qt/bitcoingui.h20
-rw-r--r--src/qt/bitcoinstrings.cpp5
-rw-r--r--src/qt/bitcoinunits.h2
-rw-r--r--src/qt/clientmodel.cpp14
-rw-r--r--src/qt/clientmodel.h3
-rw-r--r--src/qt/csvmodelwriter.h2
-rw-r--r--src/qt/editaddressdialog.h3
-rw-r--r--src/qt/guiutil.cpp53
-rw-r--r--src/qt/guiutil.h10
-rw-r--r--src/qt/intro.cpp10
-rw-r--r--src/qt/intro.h5
-rw-r--r--src/qt/macdockiconhandler.h4
-rw-r--r--src/qt/macnotificationhandler.h1
-rw-r--r--src/qt/monitoreddatamapper.cpp2
-rw-r--r--src/qt/notificator.cpp24
-rw-r--r--src/qt/notificator.h3
-rw-r--r--src/qt/optionsdialog.cpp3
-rw-r--r--src/qt/optionsdialog.h7
-rw-r--r--src/qt/optionsmodel.cpp14
-rw-r--r--src/qt/overviewpage.cpp10
-rw-r--r--src/qt/overviewpage.h9
-rw-r--r--src/qt/paymentrequestplus.cpp12
-rw-r--r--src/qt/paymentrequestplus.h7
-rw-r--r--src/qt/paymentserver.cpp44
-rw-r--r--src/qt/paymentserver.h10
-rw-r--r--src/qt/rpcconsole.cpp14
-rw-r--r--src/qt/rpcconsole.h3
-rw-r--r--src/qt/sendcoinsdialog.cpp9
-rw-r--r--src/qt/sendcoinsdialog.h10
-rw-r--r--src/qt/sendcoinsentry.cpp7
-rw-r--r--src/qt/sendcoinsentry.h5
-rw-r--r--src/qt/signverifymessagedialog.cpp11
-rw-r--r--src/qt/signverifymessagedialog.h3
-rw-r--r--src/qt/splashscreen.cpp3
-rw-r--r--src/qt/test/paymentservertests.cpp18
-rw-r--r--src/qt/test/paymentservertests.h6
-rw-r--r--src/qt/test/test_main.cpp8
-rw-r--r--src/qt/test/uritests.cpp5
-rw-r--r--src/qt/test/uritests.h2
-rw-r--r--src/qt/transactiondesc.cpp28
-rw-r--r--src/qt/transactiondesc.h2
-rw-r--r--src/qt/transactionfilterproxy.cpp4
-rw-r--r--src/qt/transactionfilterproxy.h2
-rw-r--r--src/qt/transactionrecord.cpp20
-rw-r--r--src/qt/transactionrecord.h16
-rw-r--r--src/qt/transactiontablemodel.cpp21
-rw-r--r--src/qt/transactiontablemodel.h5
-rw-r--r--src/qt/transactionview.cpp27
-rw-r--r--src/qt/transactionview.h10
-rw-r--r--src/qt/walletframe.cpp7
-rw-r--r--src/qt/walletmodel.cpp25
-rw-r--r--src/qt/walletmodel.h13
-rw-r--r--src/qt/walletmodeltransaction.cpp2
-rw-r--r--src/qt/walletmodeltransaction.h6
-rw-r--r--src/qt/walletview.cpp26
-rw-r--r--src/qt/walletview.h9
67 files changed, 394 insertions, 329 deletions
diff --git a/src/qt/aboutdialog.cpp b/src/qt/aboutdialog.cpp
index e3ef92caea..797ebf97ed 100644
--- a/src/qt/aboutdialog.cpp
+++ b/src/qt/aboutdialog.cpp
@@ -6,6 +6,7 @@
#include "ui_aboutdialog.h"
#include "clientmodel.h"
+
#include "clientversion.h"
AboutDialog::AboutDialog(QWidget *parent) :
diff --git a/src/qt/aboutdialog.h b/src/qt/aboutdialog.h
index 72545f9b21..b02be74844 100644
--- a/src/qt/aboutdialog.h
+++ b/src/qt/aboutdialog.h
@@ -7,10 +7,11 @@
#include <QDialog>
+class ClientModel;
+
namespace Ui {
class AboutDialog;
}
-class ClientModel;
/** "About" dialog box */
class AboutDialog : public QDialog
diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp
index cef307b86d..5e82d4d17d 100644
--- a/src/qt/addressbookpage.cpp
+++ b/src/qt/addressbookpage.cpp
@@ -11,14 +11,14 @@
#include "addresstablemodel.h"
#include "bitcoingui.h"
-#include "editaddressdialog.h"
#include "csvmodelwriter.h"
+#include "editaddressdialog.h"
#include "guiutil.h"
-#include <QSortFilterProxyModel>
-#include <QClipboard>
-#include <QMessageBox>
+#include <QIcon>
#include <QMenu>
+#include <QMessageBox>
+#include <QSortFilterProxyModel>
AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
QDialog(parent),
diff --git a/src/qt/addressbookpage.h b/src/qt/addressbookpage.h
index 60b5d8c47f..a9192efc84 100644
--- a/src/qt/addressbookpage.h
+++ b/src/qt/addressbookpage.h
@@ -7,17 +7,19 @@
#include <QDialog>
+class AddressTableModel;
+class OptionsModel;
+
namespace Ui {
class AddressBookPage;
}
-class AddressTableModel;
QT_BEGIN_NAMESPACE
-class QTableView;
class QItemSelection;
-class QSortFilterProxyModel;
class QMenu;
class QModelIndex;
+class QSortFilterProxyModel;
+class QTableView;
QT_END_NAMESPACE
/** Widget that shows a list of sending or receiving addresses.
diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp
index ab1900fbf3..d686cd4fd8 100644
--- a/src/qt/addresstablemodel.cpp
+++ b/src/qt/addresstablemodel.cpp
@@ -7,8 +7,8 @@
#include "guiutil.h"
#include "walletmodel.h"
-#include "wallet.h"
#include "base58.h"
+#include "wallet.h"
#include <QFont>
#include <QDebug>
diff --git a/src/qt/addresstablemodel.h b/src/qt/addresstablemodel.h
index 1ddee1aeb5..71691f5a26 100644
--- a/src/qt/addresstablemodel.h
+++ b/src/qt/addresstablemodel.h
@@ -9,9 +9,10 @@
#include <QStringList>
class AddressTablePriv;
-class CWallet;
class WalletModel;
+class CWallet;
+
/**
Qt model of the address book in the core. This allows views to access and modify the address book.
*/
diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp
index 521585644e..2a6d6abc35 100644
--- a/src/qt/askpassphrasedialog.cpp
+++ b/src/qt/askpassphrasedialog.cpp
@@ -8,9 +8,11 @@
#include "guiconstants.h"
#include "walletmodel.h"
+#include "allocators.h"
+
+#include <QKeyEvent>
#include <QMessageBox>
#include <QPushButton>
-#include <QKeyEvent>
AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) :
QDialog(parent),
diff --git a/src/qt/askpassphrasedialog.h b/src/qt/askpassphrasedialog.h
index 838ad21beb..4c92afcd54 100644
--- a/src/qt/askpassphrasedialog.h
+++ b/src/qt/askpassphrasedialog.h
@@ -7,10 +7,11 @@
#include <QDialog>
+class WalletModel;
+
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 1e2f93f1e7..2fa7979eae 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -3,28 +3,35 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "bitcoingui.h"
+
#include "clientmodel.h"
-#include "walletmodel.h"
-#include "optionsmodel.h"
-#include "guiutil.h"
#include "guiconstants.h"
-#include "init.h"
-#include "util.h"
-#include "ui_interface.h"
+#include "guiutil.h"
+#include "intro.h"
+#include "optionsmodel.h"
#include "paymentserver.h"
#include "splashscreen.h"
-#include "intro.h"
+#include "walletmodel.h"
+
+#include "init.h"
+#include "main.h"
+#include "ui_interface.h"
+#include "util.h"
+#include <stdint.h>
+
+#include <boost/filesystem/operations.hpp>
#include <QApplication>
+#include <QLibraryInfo>
+#include <QLocale>
#include <QMessageBox>
+#include <QSettings>
+#include <QTimer>
+#include <QTranslator>
+
#if QT_VERSION < 0x050000
#include <QTextCodec>
#endif
-#include <QLocale>
-#include <QTimer>
-#include <QTranslator>
-#include <QLibraryInfo>
-#include <QSettings>
#if defined(BITCOIN_NEED_QT_PLUGINS) && !defined(_BITCOIN_QT_PLUGINS_INCLUDED)
#define _BITCOIN_QT_PLUGINS_INCLUDED
@@ -68,7 +75,7 @@ static bool ThreadSafeMessageBox(const std::string& message, const std::string&
}
}
-static bool ThreadSafeAskFee(int64 nFeeRequired)
+static bool ThreadSafeAskFee(int64_t nFeeRequired)
{
if(!guiref)
return false;
diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp
index f722a454f1..6b083331d3 100644
--- a/src/qt/bitcoinamountfield.cpp
+++ b/src/qt/bitcoinamountfield.cpp
@@ -4,15 +4,14 @@
#include "bitcoinamountfield.h"
-#include "qvaluecombobox.h"
#include "bitcoinunits.h"
#include "guiconstants.h"
+#include "qvaluecombobox.h"
#include <QApplication>
+#include <QDoubleSpinBox>
#include <QHBoxLayout>
#include <QKeyEvent>
-#include <QDoubleSpinBox>
-
#include <qmath.h> // for qPow()
BitcoinAmountField::BitcoinAmountField(QWidget *parent):
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 0b6bd517e5..a1bb0ee2f4 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -4,49 +4,54 @@
#include "bitcoingui.h"
-#include "optionsdialog.h"
#include "aboutdialog.h"
-#include "clientmodel.h"
-#include "walletmodel.h"
-#include "walletframe.h"
-#include "optionsmodel.h"
#include "bitcoinunits.h"
+#include "clientmodel.h"
#include "guiconstants.h"
-#include "notificator.h"
#include "guiutil.h"
+#include "notificator.h"
+#include "optionsdialog.h"
+#include "optionsmodel.h"
#include "rpcconsole.h"
-#include "ui_interface.h"
-#include "wallet.h"
-#include "init.h"
+#include "walletframe.h"
+#include "walletmodel.h"
#ifdef Q_OS_MAC
#include "macdockiconhandler.h"
#endif
+#include "init.h"
+#include "ui_interface.h"
+
+#include <iostream>
+
#include <QApplication>
-#include <QMenuBar>
-#include <QMenu>
+#include <QDateTime>
+#include <QDesktopWidget>
+#include <QDragEnterEvent>
#include <QIcon>
-#include <QVBoxLayout>
-#include <QToolBar>
-#include <QStatusBar>
#include <QLabel>
+#include <QListWidget>
+#include <QMenu>
+#include <QMenuBar>
#include <QMessageBox>
+#include <QMimeData>
+#include <QMovie>
#include <QProgressBar>
+#include <QSettings>
#include <QStackedWidget>
-#include <QDateTime>
-#include <QMovie>
+#include <QStatusBar>
+#include <QStyle>
#include <QTimer>
-#include <QDragEnterEvent>
+#include <QToolBar>
+#include <QVBoxLayout>
+
#if QT_VERSION < 0x050000
#include <QUrl>
#include <QTextDocument>
+#else
+#include <QUrlQuery>
#endif
-#include <QMimeData>
-#include <QStyle>
-#include <QListWidget>
-
-#include <iostream>
const QString BitcoinGUI::DEFAULT_WALLET = "~Default";
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index 6a2058e0b6..2e3b3e74b9 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -6,32 +6,22 @@
#define BITCOINGUI_H
#include <QMainWindow>
-#include <QSystemTrayIcon>
#include <QMap>
+#include <QSystemTrayIcon>
-class WalletFrame;
-class WalletView;
class ClientModel;
-class WalletModel;
-class WalletStack;
-class OverviewPage;
-class SendCoinsDialog;
-class SendCoinsRecipient;
-class SignVerifyMessageDialog;
class Notificator;
class RPCConsole;
+class SendCoinsRecipient;
+class WalletFrame;
+class WalletModel;
class CWallet;
QT_BEGIN_NAMESPACE
+class QAction;
class QLabel;
-class QModelIndex;
class QProgressBar;
-class QStackedWidget;
-class QUrl;
-class QListWidget;
-class QPushButton;
-class QAction;
QT_END_NAMESPACE
/**
diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp
index 457090b1f5..45a9bf6a41 100644
--- a/src/qt/bitcoinstrings.cpp
+++ b/src/qt/bitcoinstrings.cpp
@@ -1,4 +1,7 @@
+
+
#include <QtGlobal>
+
// Automatically generated by extract_strings.py
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
@@ -221,4 +224,4 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Warning"),
QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade required!"),
QT_TRANSLATE_NOOP("bitcoin-core", "You need to rebuild the database using -reindex to change -txindex"),
QT_TRANSLATE_NOOP("bitcoin-core", "wallet.dat corrupt, salvage failed"),
-}; \ No newline at end of file
+};
diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h
index 3342eeec17..46517fc07b 100644
--- a/src/qt/bitcoinunits.h
+++ b/src/qt/bitcoinunits.h
@@ -5,8 +5,8 @@
#ifndef BITCOINUNITS_H
#define BITCOINUNITS_H
-#include <QString>
#include <QAbstractListModel>
+#include <QString>
/** Bitcoin unit definitions. Encapsulates parsing and formatting
and serves as list model for drop-down selection boxes.
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index 872d714030..c64e411bca 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -5,21 +5,21 @@
#include "clientmodel.h"
#include "guiconstants.h"
-#include "optionsmodel.h"
-#include "addresstablemodel.h"
-#include "transactiontablemodel.h"
-#include "chainparams.h"
#include "alert.h"
-#include "main.h"
+#include "chainparams.h"
#include "checkpoints.h"
+#include "main.h"
+#include "net.h"
#include "ui_interface.h"
+#include <stdint.h>
+
#include <QDateTime>
-#include <QTimer>
#include <QDebug>
+#include <QTimer>
-static const int64 nClientStartupTime = GetTime();
+static const int64_t nClientStartupTime = GetTime();
ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) :
QObject(parent), optionsModel(optionsModel),
diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h
index 008320dcc3..dcc528f4fd 100644
--- a/src/qt/clientmodel.h
+++ b/src/qt/clientmodel.h
@@ -7,9 +7,10 @@
#include <QObject>
-class OptionsModel;
class AddressTableModel;
+class OptionsModel;
class TransactionTableModel;
+
class CWallet;
QT_BEGIN_NAMESPACE
diff --git a/src/qt/csvmodelwriter.h b/src/qt/csvmodelwriter.h
index 890deab092..29de251efe 100644
--- a/src/qt/csvmodelwriter.h
+++ b/src/qt/csvmodelwriter.h
@@ -5,8 +5,8 @@
#ifndef CSVMODELWRITER_H
#define CSVMODELWRITER_H
-#include <QObject>
#include <QList>
+#include <QObject>
QT_BEGIN_NAMESPACE
class QAbstractItemModel;
diff --git a/src/qt/editaddressdialog.h b/src/qt/editaddressdialog.h
index 8746786162..a448c4b23f 100644
--- a/src/qt/editaddressdialog.h
+++ b/src/qt/editaddressdialog.h
@@ -7,10 +7,11 @@
#include <QDialog>
+class AddressTableModel;
+
namespace Ui {
class EditAddressDialog;
}
-class AddressTableModel;
QT_BEGIN_NAMESPACE
class QDataWidgetMapper;
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index eb50aa8edd..e6a1138f11 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -5,33 +5,12 @@
#include "guiutil.h"
#include "bitcoinaddressvalidator.h"
-#include "walletmodel.h"
#include "bitcoinunits.h"
+#include "walletmodel.h"
-#include "util.h"
+#include "core.h"
#include "init.h"
-
-#include <QApplication>
-#include <QDateTime>
-#include <QDoubleValidator>
-#include <QFont>
-#include <QLineEdit>
-#if QT_VERSION >= 0x050000
-#include <QUrlQuery>
-#else
-#include <QUrl>
-#endif
-#include <QTextDocument> // for Qt::mightBeRichText
-#include <QAbstractItemView>
-#include <QClipboard>
-#include <QFileDialog>
-#include <QDesktopServices>
-#include <QThread>
-#include <QSettings>
-#include <QDesktopWidget>
-
-#include <boost/filesystem.hpp>
-#include <boost/filesystem/fstream.hpp>
+#include "util.h"
#ifdef WIN32
#ifdef _WIN32_WINNT
@@ -46,9 +25,31 @@
#ifndef NOMINMAX
#define NOMINMAX
#endif
-#include "shlwapi.h"
-#include "shlobj.h"
#include "shellapi.h"
+#include "shlobj.h"
+#include "shlwapi.h"
+#endif
+
+#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
+#include <QAbstractItemView>
+#include <QApplication>
+#include <QClipboard>
+#include <QDateTime>
+#include <QDesktopServices>
+#include <QDesktopWidget>
+#include <QDoubleValidator>
+#include <QFileDialog>
+#include <QFont>
+#include <QLineEdit>
+#include <QSettings>
+#include <QTextDocument> // for Qt::mightBeRichText
+#include <QThread>
+
+#if QT_VERSION < 0x050000
+#include <QUrl>
+#else
+#include <QUrlQuery>
#endif
namespace GUIUtil {
diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h
index 3c9f137ded..8bd0eab9de 100644
--- a/src/qt/guiutil.h
+++ b/src/qt/guiutil.h
@@ -5,19 +5,19 @@
#ifndef GUIUTIL_H
#define GUIUTIL_H
-#include <QString>
-#include <QObject>
#include <QMessageBox>
+#include <QObject>
+#include <QString>
class SendCoinsRecipient;
QT_BEGIN_NAMESPACE
+class QAbstractItemView;
+class QDateTime;
class QFont;
class QLineEdit;
-class QWidget;
-class QDateTime;
class QUrl;
-class QAbstractItemView;
+class QWidget;
QT_END_NAMESPACE
/** Utility functions used by the Bitcoin Qt UI.
diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp
index e7e7682258..3ecd96cc42 100644
--- a/src/qt/intro.cpp
+++ b/src/qt/intro.cpp
@@ -4,17 +4,17 @@
#include "intro.h"
#include "ui_intro.h"
+
#include "util.h"
+#include <boost/filesystem.hpp>
#include <QFileDialog>
#include <QSettings>
#include <QMessageBox>
-#include <boost/filesystem.hpp>
-
/* Minimum free space (in bytes) needed for data directory */
-static const uint64 GB_BYTES = 1000000000LL;
-static const uint64 BLOCK_CHAIN_SIZE = 10LL * GB_BYTES;
+static const uint64_t GB_BYTES = 1000000000LL;
+static const uint64_t BLOCK_CHAIN_SIZE = 10LL * GB_BYTES;
/* Check free space asynchronously to prevent hanging the UI thread.
@@ -60,7 +60,7 @@ void FreespaceChecker::check()
namespace fs = boost::filesystem;
QString dataDirStr = intro->getPathToCheck();
fs::path dataDir = fs::path(dataDirStr.toStdString());
- uint64 freeBytesAvailable = 0;
+ uint64_t freeBytesAvailable = 0;
int replyStatus = ST_OK;
QString replyMessage = tr("A new data directory will be created.");
diff --git a/src/qt/intro.h b/src/qt/intro.h
index b25d3f1152..72693d5544 100644
--- a/src/qt/intro.h
+++ b/src/qt/intro.h
@@ -6,13 +6,14 @@
#define INTRO_H
#include <QDialog>
-#include <QThread>
#include <QMutex>
+#include <QThread>
+
+class FreespaceChecker;
namespace Ui {
class Intro;
}
-class FreespaceChecker;
/** Introduction screen (pre-GUI startup).
Allows the user to choose a data directory,
diff --git a/src/qt/macdockiconhandler.h b/src/qt/macdockiconhandler.h
index fba7305a60..b21a61cb07 100644
--- a/src/qt/macdockiconhandler.h
+++ b/src/qt/macdockiconhandler.h
@@ -5,12 +5,12 @@
#ifndef MACDOCKICONHANDLER_H
#define MACDOCKICONHANDLER_H
-#include <QObject>
#include <QMainWindow>
+#include <QObject>
QT_BEGIN_NAMESPACE
-class QMenu;
class QIcon;
+class QMenu;
class QWidget;
QT_END_NAMESPACE
diff --git a/src/qt/macnotificationhandler.h b/src/qt/macnotificationhandler.h
index 257adde229..bc335edede 100644
--- a/src/qt/macnotificationhandler.h
+++ b/src/qt/macnotificationhandler.h
@@ -4,6 +4,7 @@
#ifndef MACNOTIFICATIONHANDLER_H
#define MACNOTIFICATIONHANDLER_H
+
#include <QObject>
/** Macintosh-specific notification handler (supports UserNotificationCenter and Growl).
diff --git a/src/qt/monitoreddatamapper.cpp b/src/qt/monitoreddatamapper.cpp
index 7abecbb12d..5931c53872 100644
--- a/src/qt/monitoreddatamapper.cpp
+++ b/src/qt/monitoreddatamapper.cpp
@@ -4,9 +4,9 @@
#include "monitoreddatamapper.h"
-#include <QWidget>
#include <QMetaObject>
#include <QMetaProperty>
+#include <QWidget>
MonitoredDataMapper::MonitoredDataMapper(QObject *parent) :
QDataWidgetMapper(parent)
diff --git a/src/qt/notificator.cpp b/src/qt/notificator.cpp
index fcde23f7e4..c9f6834ec2 100644
--- a/src/qt/notificator.cpp
+++ b/src/qt/notificator.cpp
@@ -4,27 +4,31 @@
#include "notificator.h"
+
#include <QApplication>
-#include <QMetaType>
-#include <QVariant>
+#include <QByteArray>
#include <QIcon>
+#include <QImageWriter>
+#include <QMessageBox>
+#include <QMetaType>
#include <QStyle>
-#include <QByteArray>
#include <QSystemTrayIcon>
-#include <QMessageBox>
#include <QTemporaryFile>
-#include <QImageWriter>
+#include <QVariant>
+
+#ifdef Q_OS_MAC
+#include "macnotificationhandler.h"
+
+#include <ApplicationServices/ApplicationServices.h>
+#endif
#ifdef USE_DBUS
-#include <QtDBus>
#include <stdint.h>
-#endif
-#ifdef Q_OS_MAC
-#include <ApplicationServices/ApplicationServices.h>
-#include "macnotificationhandler.h"
+#include <QtDBus>
#endif
+
// https://wiki.ubuntu.com/NotificationDevelopmentGuidelines recommends at least 128
const int FREEDESKTOP_NOTIFICATION_ICON_SIZE = 128;
diff --git a/src/qt/notificator.h b/src/qt/notificator.h
index e00d08b9cb..d6298c3c0d 100644
--- a/src/qt/notificator.h
+++ b/src/qt/notificator.h
@@ -9,11 +9,12 @@
#include "bitcoin-config.h"
#endif
-#include <QObject>
#include <QIcon>
+#include <QObject>
QT_BEGIN_NAMESPACE
class QSystemTrayIcon;
+
#ifdef USE_DBUS
class QDBusInterface;
#endif
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index 85d49e6a20..1e91a877a9 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -11,9 +11,10 @@
#include "bitcoinunits.h"
#include "monitoreddatamapper.h"
-#include "netbase.h"
#include "optionsmodel.h"
+#include "netbase.h"
+
#include <QDir>
#include <QIntValidator>
#include <QLocale>
diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h
index fea5c6d2fb..05234f645b 100644
--- a/src/qt/optionsdialog.h
+++ b/src/qt/optionsdialog.h
@@ -7,12 +7,13 @@
#include <QDialog>
+class MonitoredDataMapper;
+class OptionsModel;
+class QValidatedLineEdit;
+
namespace Ui {
class OptionsDialog;
}
-class OptionsModel;
-class MonitoredDataMapper;
-class QValidatedLineEdit;
/** Preferences dialog. */
class OptionsDialog : public QDialog
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 48bf357abb..65c017f088 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -9,12 +9,12 @@
#include "optionsmodel.h"
#include "bitcoinunits.h"
+#include "guiutil.h"
+
#include "init.h"
-#include "core.h"
-#include "wallet.h"
-#include "netbase.h"
+#include "main.h"
+#include "net.h"
#include "walletdb.h"
-#include "guiutil.h"
#include <QSettings>
@@ -200,7 +200,7 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
return QVariant(5);
}
case Fee:
- return QVariant(nTransactionFee);
+ return QVariant((qint64) nTransactionFee);
case DisplayUnit:
return QVariant(nDisplayUnit);
case DisplayAddresses:
@@ -274,7 +274,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
break;
case Fee:
nTransactionFee = value.toLongLong();
- settings.setValue("nTransactionFee", nTransactionFee);
+ settings.setValue("nTransactionFee", (qint64) nTransactionFee);
break;
case DisplayUnit:
nDisplayUnit = value.toInt();
@@ -299,7 +299,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
qint64 OptionsModel::getTransactionFee()
{
- return nTransactionFee;
+ return (qint64) nTransactionFee;
}
bool OptionsModel::getProxySettings(QString& proxyIP, quint16 &proxyPort) const
diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp
index d60ff194c1..016097c5a0 100644
--- a/src/qt/overviewpage.cpp
+++ b/src/qt/overviewpage.cpp
@@ -5,14 +5,14 @@
#include "overviewpage.h"
#include "ui_overviewpage.h"
-#include "clientmodel.h"
-#include "walletmodel.h"
#include "bitcoinunits.h"
+#include "clientmodel.h"
+#include "guiconstants.h"
+#include "guiutil.h"
#include "optionsmodel.h"
-#include "transactiontablemodel.h"
#include "transactionfilterproxy.h"
-#include "guiutil.h"
-#include "guiconstants.h"
+#include "transactiontablemodel.h"
+#include "walletmodel.h"
#include <QAbstractItemDelegate>
#include <QPainter>
diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h
index f662242836..2507a3fb31 100644
--- a/src/qt/overviewpage.h
+++ b/src/qt/overviewpage.h
@@ -7,13 +7,14 @@
#include <QWidget>
+class ClientModel;
+class TransactionFilterProxy;
+class TxViewDelegate;
+class WalletModel;
+
namespace Ui {
class OverviewPage;
}
-class ClientModel;
-class WalletModel;
-class TxViewDelegate;
-class TransactionFilterProxy;
QT_BEGIN_NAMESPACE
class QModelIndex;
diff --git a/src/qt/paymentrequestplus.cpp b/src/qt/paymentrequestplus.cpp
index c1476a4d5f..e369734a98 100644
--- a/src/qt/paymentrequestplus.cpp
+++ b/src/qt/paymentrequestplus.cpp
@@ -7,16 +7,16 @@
// with some extra methods
//
-#include <QDateTime>
-#include <QDebug>
-#include <QSslCertificate>
+#include "paymentrequestplus.h"
+
+#include <stdexcept>
#include <openssl/x509.h>
#include <openssl/x509_vfy.h>
+#include <QDateTime>
+#include <QDebug>
+#include <QSslCertificate>
-#include <stdexcept>
-
-#include "paymentrequestplus.h"
class SSLVerifyError : public std::runtime_error
{
diff --git a/src/qt/paymentrequestplus.h b/src/qt/paymentrequestplus.h
index 04848ec4ba..8c126b1fad 100644
--- a/src/qt/paymentrequestplus.h
+++ b/src/qt/paymentrequestplus.h
@@ -5,13 +5,14 @@
#ifndef PAYMENTREQUESTPLUS_H
#define PAYMENTREQUESTPLUS_H
+#include "paymentrequest.pb.h"
+
+#include "base58.h"
+
#include <QByteArray>
#include <QList>
#include <QString>
-#include "base58.h"
-#include "paymentrequest.pb.h"
-
//
// Wraps dumb protocol buffer paymentRequest
// with extra methods
diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp
index 87db4bbf34..cb6291c35d 100644
--- a/src/qt/paymentserver.cpp
+++ b/src/qt/paymentserver.cpp
@@ -2,6 +2,23 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#include "paymentserver.h"
+
+#include "bitcoinunits.h"
+#include "guiconstants.h"
+#include "guiutil.h"
+#include "optionsmodel.h"
+#include "paymentserver.h"
+#include "walletmodel.h"
+
+#include "base58.h"
+#include "ui_interface.h"
+#include "wallet.h"
+
+#include <cstdlib>
+
+#include <openssl/x509.h>
+#include <openssl/x509_vfy.h>
#include <QApplication>
#include <QByteArray>
#include <QDataStream>
@@ -13,8 +30,6 @@
#include <QList>
#include <QLocalServer>
#include <QLocalSocket>
-#include <QStringList>
-#include <QTextDocument>
#include <QNetworkAccessManager>
#include <QNetworkProxy>
#include <QNetworkReply>
@@ -22,27 +37,16 @@
#include <QSslCertificate>
#include <QSslError>
#include <QSslSocket>
+#include <QStringList>
+#include <QTextDocument>
+
#if QT_VERSION < 0x050000
#include <QUrl>
#else
#include <QUrlQuery>
#endif
-#include <cstdlib>
-
-#include <openssl/x509.h>
-#include <openssl/x509_vfy.h>
-
-#include "base58.h"
-#include "bitcoinunits.h"
-#include "guiconstants.h"
-#include "guiutil.h"
-#include "optionsmodel.h"
-#include "paymentserver.h"
-#include "ui_interface.h"
-#include "util.h"
-#include "wallet.h"
-#include "walletmodel.h"
+using namespace boost;
const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds
const QString BITCOIN_IPC_PREFIX("bitcoin:");
@@ -357,10 +361,10 @@ void PaymentServer::handleURIOrFile(const QString& s)
if (s.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // bitcoin:
{
-#if QT_VERSION >= 0x050000
- QUrlQuery uri((QUrl(s)));
-#else
+#if QT_VERSION < 0x050000
QUrl uri(s);
+#else
+ QUrlQuery uri((QUrl(s)));
#endif
if (uri.hasQueryItem("request"))
{
diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h
index 76cdb819d7..65bf034354 100644
--- a/src/qt/paymentserver.h
+++ b/src/qt/paymentserver.h
@@ -4,8 +4,6 @@
#ifndef PAYMENTSERVER_H
#define PAYMENTSERVER_H
-
-//
// This class handles payment requests from clicking on
// bitcoin: URIs
//
@@ -32,13 +30,13 @@
// and, if a server is running in another process,
// sends them to the server.
//
-#include <QObject>
-#include <QString>
#include "paymentrequestplus.h"
#include "walletmodel.h"
-class CWallet;
+#include <QObject>
+#include <QString>
+
class OptionsModel;
QT_BEGIN_NAMESPACE
@@ -51,6 +49,8 @@ class QSslError;
class QUrl;
QT_END_NAMESPACE
+class CWallet;
+
class PaymentServer : public QObject
{
Q_OBJECT
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 05bc460ab0..64a3a68ba7 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -6,18 +6,20 @@
#include "ui_rpcconsole.h"
#include "clientmodel.h"
-#include "bitcoinrpc.h"
#include "guiutil.h"
-#include <QTime>
-#include <QThread>
+#include "bitcoinrpc.h"
+
+#include "json/json_spirit_value.h"
+#include <openssl/crypto.h>
#include <QKeyEvent>
+#include <QScrollBar>
+#include <QThread>
+#include <QTime>
+
#if QT_VERSION < 0x050000
#include <QUrl>
#endif
-#include <QScrollBar>
-
-#include <openssl/crypto.h>
// TODO: add a scrollback limit, as there is currently none
// TODO: make it possible to filter out categories (esp debug messages when implemented)
diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h
index 076575fa3d..1370d0b103 100644
--- a/src/qt/rpcconsole.h
+++ b/src/qt/rpcconsole.h
@@ -7,10 +7,11 @@
#include <QDialog>
+class ClientModel;
+
namespace Ui {
class RPCConsole;
}
-class ClientModel;
/** Local Bitcoin RPC console. */
class RPCConsole: public QDialog
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp
index 2490c64835..b9c5eb08d6 100644
--- a/src/qt/sendcoinsdialog.cpp
+++ b/src/qt/sendcoinsdialog.cpp
@@ -6,16 +6,17 @@
#include "ui_sendcoinsdialog.h"
#include "bitcoinunits.h"
+#include "guiutil.h"
#include "optionsmodel.h"
#include "sendcoinsentry.h"
-#include "guiutil.h"
-#include "askpassphrasedialog.h"
+#include "walletmodel.h"
+
#include "base58.h"
#include "ui_interface.h"
#include <QMessageBox>
-#include <QTextDocument>
#include <QScrollBar>
+#include <QTextDocument>
SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
QDialog(parent),
@@ -324,7 +325,7 @@ bool SendCoinsDialog::handlePaymentRequest(const SendCoinsRecipient &rv)
if (rv.paymentRequest.IsInitialized()) {
// Expired payment request?
const payments::PaymentDetails& details = rv.paymentRequest.getDetails();
- if (details.has_expires() && (int64)details.expires() < GetTime())
+ if (details.has_expires() && (int64_t)details.expires() < GetTime())
{
emit message(strSendCoins, tr("Payment request expired"),
CClientUIInterface::MSG_WARNING);
diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h
index dcb1f2972f..9d5f34f0c2 100644
--- a/src/qt/sendcoinsdialog.h
+++ b/src/qt/sendcoinsdialog.h
@@ -8,12 +8,8 @@
#include "walletmodel.h"
#include <QDialog>
-#include <QVariant>
-#include <QPair>
-namespace Ui {
- class SendCoinsDialog;
-}
+class OptionsModel;
class SendCoinsEntry;
class SendCoinsRecipient;
@@ -21,6 +17,10 @@ QT_BEGIN_NAMESPACE
class QUrl;
QT_END_NAMESPACE
+namespace Ui {
+ class SendCoinsDialog;
+}
+
/** Dialog for sending bitcoins */
class SendCoinsDialog : public QDialog
{
diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp
index 490b9caf5e..2d240f1fe5 100644
--- a/src/qt/sendcoinsentry.cpp
+++ b/src/qt/sendcoinsentry.cpp
@@ -5,12 +5,11 @@
#include "sendcoinsentry.h"
#include "ui_sendcoinsentry.h"
-#include "guiutil.h"
-#include "bitcoinunits.h"
#include "addressbookpage.h"
-#include "walletmodel.h"
-#include "optionsmodel.h"
#include "addresstablemodel.h"
+#include "guiutil.h"
+#include "optionsmodel.h"
+#include "walletmodel.h"
#include <QApplication>
#include <QClipboard>
diff --git a/src/qt/sendcoinsentry.h b/src/qt/sendcoinsentry.h
index b658f6205a..6fc36f9787 100644
--- a/src/qt/sendcoinsentry.h
+++ b/src/qt/sendcoinsentry.h
@@ -5,14 +5,15 @@
#ifndef SENDCOINSENTRY_H
#define SENDCOINSENTRY_H
+#include "walletmodel.h"
+
#include <QStackedWidget>
-#include "walletmodel.h"
+class WalletModel;
namespace Ui {
class SendCoinsEntry;
}
-class WalletModel;
/**
* A single entry in the dialog for sending bitcoins.
diff --git a/src/qt/signverifymessagedialog.cpp b/src/qt/signverifymessagedialog.cpp
index 567d46ad3a..0fa51cb92a 100644
--- a/src/qt/signverifymessagedialog.cpp
+++ b/src/qt/signverifymessagedialog.cpp
@@ -6,19 +6,18 @@
#include "ui_signverifymessagedialog.h"
#include "addressbookpage.h"
-#include "base58.h"
#include "guiutil.h"
-#include "init.h"
-#include "main.h"
-#include "optionsmodel.h"
#include "walletmodel.h"
-#include "wallet.h"
-#include <QClipboard>
+#include "base58.h"
+#include "init.h"
+#include "wallet.h"
#include <string>
#include <vector>
+#include <QClipboard>
+
SignVerifyMessageDialog::SignVerifyMessageDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::SignVerifyMessageDialog),
diff --git a/src/qt/signverifymessagedialog.h b/src/qt/signverifymessagedialog.h
index a91a30308c..c741450b8a 100644
--- a/src/qt/signverifymessagedialog.h
+++ b/src/qt/signverifymessagedialog.h
@@ -7,10 +7,11 @@
#include <QDialog>
+class WalletModel;
+
namespace Ui {
class SignVerifyMessageDialog;
}
-class WalletModel;
class SignVerifyMessageDialog : public QDialog
{
diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp
index 13d99a589b..12280bb702 100644
--- a/src/qt/splashscreen.cpp
+++ b/src/qt/splashscreen.cpp
@@ -3,9 +3,10 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "splashscreen.h"
+
+#include "chainparams.h"
#include "clientversion.h"
#include "util.h"
-#include "chainparams.h"
#include <QApplication>
#include <QPainter>
diff --git a/src/qt/test/paymentservertests.cpp b/src/qt/test/paymentservertests.cpp
index 34079e94ff..f7d26fb919 100644
--- a/src/qt/test/paymentservertests.cpp
+++ b/src/qt/test/paymentservertests.cpp
@@ -1,17 +1,17 @@
-#include <QCoreApplication>
-#include <QDebug>
-#include <QTemporaryFile>
-#include <QVariant>
-#include <QFileOpenEvent>
-
-#include <openssl/x509.h>
-#include <openssl/x509_vfy.h>
+#include "paymentservertests.h"
#include "optionsmodel.h"
-#include "paymentservertests.h"
#include "paymentrequestdata.h"
+
#include "util.h"
+#include <openssl/x509.h>
+#include <openssl/x509_vfy.h>
+#include <QCoreApplication>
+#include <QDebug>
+#include <QFileOpenEvent>
+#include <QTemporaryFile>
+#include <QVariant>
X509 *parse_b64der_cert(const char* cert_data)
diff --git a/src/qt/test/paymentservertests.h b/src/qt/test/paymentservertests.h
index 5aa24ebaf2..0bff923ad4 100644
--- a/src/qt/test/paymentservertests.h
+++ b/src/qt/test/paymentservertests.h
@@ -1,11 +1,11 @@
#ifndef PAYMENTSERVERTESTS_H
#define PAYMENTSERVERTESTS_H
-#include <QTest>
-#include <QObject>
-
#include "../paymentserver.h"
+#include <QObject>
+#include <QTest>
+
class PaymentServerTests : public QObject
{
Q_OBJECT
diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp
index dae4e60412..5c941c6387 100644
--- a/src/qt/test/test_main.cpp
+++ b/src/qt/test/test_main.cpp
@@ -1,8 +1,10 @@
-#include <QTest>
-#include <QObject>
-#include "uritests.h"
+
#include "paymentservertests.h"
+#include "uritests.h"
+
+#include <QObject>
+#include <QTest>
// This is all you need to run all the tests
int main(int argc, char *argv[])
diff --git a/src/qt/test/uritests.cpp b/src/qt/test/uritests.cpp
index df4df3154b..5c0f4406a7 100644
--- a/src/qt/test/uritests.cpp
+++ b/src/qt/test/uritests.cpp
@@ -1,6 +1,7 @@
#include "uritests.h"
-#include "../guiutil.h"
-#include "../walletmodel.h"
+
+#include "guiutil.h"
+#include "walletmodel.h"
#include <QUrl>
diff --git a/src/qt/test/uritests.h b/src/qt/test/uritests.h
index 1237516e5f..17d4280a90 100644
--- a/src/qt/test/uritests.h
+++ b/src/qt/test/uritests.h
@@ -1,8 +1,8 @@
#ifndef URITESTS_H
#define URITESTS_H
-#include <QTest>
#include <QObject>
+#include <QTest>
class URITests : public QObject
{
diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp
index 3a9daf0665..8bd2bf564a 100644
--- a/src/qt/transactiondesc.cpp
+++ b/src/qt/transactiondesc.cpp
@@ -4,16 +4,18 @@
#include "transactiondesc.h"
-#include "guiutil.h"
#include "bitcoinunits.h"
-#include "main.h"
-#include "wallet.h"
-#include "db.h"
-#include "ui_interface.h"
+#include "guiutil.h"
+
#include "base58.h"
+#include "db.h"
+#include "main.h"
#include "paymentserver.h"
#include "transactionrecord.h"
+#include "ui_interface.h"
+#include "wallet.h"
+#include <stdint.h>
#include <string>
QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx)
@@ -46,10 +48,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int u
strHTML.reserve(4000);
strHTML += "<html><font face='verdana, arial, helvetica, sans-serif'>";
- int64 nTime = wtx.GetTxTime();
- int64 nCredit = wtx.GetCredit();
- int64 nDebit = wtx.GetDebit();
- int64 nNet = nCredit - nDebit;
+ int64_t nTime = wtx.GetTxTime();
+ int64_t nCredit = wtx.GetCredit();
+ int64_t nDebit = wtx.GetDebit();
+ int64_t nNet = nCredit - nDebit;
strHTML += "<b>" + tr("Status") + ":</b> " + FormatTxStatus(wtx);
int nRequests = wtx.GetRequestCount();
@@ -129,7 +131,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int u
//
// Coinbase
//
- int64 nUnmatured = 0;
+ int64_t nUnmatured = 0;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
nUnmatured += wallet->GetCredit(txout);
strHTML += "<b>" + tr("Credit") + ":</b> ";
@@ -186,13 +188,13 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int vout, int u
if (fAllToMe)
{
// Payment to self
- int64 nChange = wtx.GetChange();
- int64 nValue = nCredit - nChange;
+ int64_t nChange = wtx.GetChange();
+ int64_t nValue = nCredit - nChange;
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, -nValue) + "<br>";
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, nValue) + "<br>";
}
- int64 nTxFee = nDebit - GetValueOut(wtx);
+ int64_t nTxFee = nDebit - GetValueOut(wtx);
if (nTxFee > 0)
strHTML += "<b>" + tr("Transaction fee") + ":</b> " + BitcoinUnits::formatWithUnit(unit, -nTxFee) + "<br>";
}
diff --git a/src/qt/transactiondesc.h b/src/qt/transactiondesc.h
index 62f89b7285..92d093b3eb 100644
--- a/src/qt/transactiondesc.h
+++ b/src/qt/transactiondesc.h
@@ -5,8 +5,8 @@
#ifndef TRANSACTIONDESC_H
#define TRANSACTIONDESC_H
-#include <QString>
#include <QObject>
+#include <QString>
class CWallet;
class CWalletTx;
diff --git a/src/qt/transactionfilterproxy.cpp b/src/qt/transactionfilterproxy.cpp
index cccb6176a6..a14e74a469 100644
--- a/src/qt/transactionfilterproxy.cpp
+++ b/src/qt/transactionfilterproxy.cpp
@@ -6,10 +6,10 @@
#include "transactiontablemodel.h"
-#include <QDateTime>
-
#include <cstdlib>
+#include <QDateTime>
+
// Earliest date that can be represented (far in the past)
const QDateTime TransactionFilterProxy::MIN_DATE = QDateTime::fromTime_t(0);
// Last date that can be represented (far in the future)
diff --git a/src/qt/transactionfilterproxy.h b/src/qt/transactionfilterproxy.h
index 1a7612348b..6d1644d48d 100644
--- a/src/qt/transactionfilterproxy.h
+++ b/src/qt/transactionfilterproxy.h
@@ -5,8 +5,8 @@
#ifndef TRANSACTIONFILTERPROXY_H
#define TRANSACTIONFILTERPROXY_H
-#include <QSortFilterProxyModel>
#include <QDateTime>
+#include <QSortFilterProxyModel>
/** Filter the transaction list according to pre-specified rules. */
class TransactionFilterProxy : public QSortFilterProxyModel
diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp
index c488e2d21c..675daa9c9c 100644
--- a/src/qt/transactionrecord.cpp
+++ b/src/qt/transactionrecord.cpp
@@ -4,8 +4,10 @@
#include "transactionrecord.h"
-#include "wallet.h"
#include "base58.h"
+#include "wallet.h"
+
+#include <stdint.h>
/* Return positive answer if transaction should be shown in list.
*/
@@ -28,10 +30,10 @@ bool TransactionRecord::showTransaction(const CWalletTx &wtx)
QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx)
{
QList<TransactionRecord> parts;
- int64 nTime = wtx.GetTxTime();
- int64 nCredit = wtx.GetCredit(true);
- int64 nDebit = wtx.GetDebit();
- int64 nNet = nCredit - nDebit;
+ int64_t nTime = wtx.GetTxTime();
+ int64_t nCredit = wtx.GetCredit(true);
+ int64_t nDebit = wtx.GetDebit();
+ int64_t nNet = nCredit - nDebit;
uint256 hash = wtx.GetHash();
std::map<std::string, std::string> mapValue = wtx.mapValue;
@@ -83,7 +85,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
if (fAllFromMe && fAllToMe)
{
// Payment to self
- int64 nChange = wtx.GetChange();
+ int64_t nChange = wtx.GetChange();
parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, "",
-(nDebit - nChange), nCredit - nChange));
@@ -93,7 +95,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
//
// Debit
//
- int64 nTxFee = nDebit - GetValueOut(wtx);
+ int64_t nTxFee = nDebit - GetValueOut(wtx);
for (unsigned int nOut = 0; nOut < wtx.vout.size(); nOut++)
{
@@ -122,7 +124,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
sub.address = mapValue["to"];
}
- int64 nValue = txout.nValue;
+ int64_t nValue = txout.nValue;
/* Add fee to first output */
if (nTxFee > 0)
{
@@ -198,7 +200,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx)
// For generated transactions, determine maturity
if(type == TransactionRecord::Generated)
{
- int64 nCredit = wtx.GetCredit(true);
+ int64_t nCredit = wtx.GetCredit(true);
if (nCredit == 0)
{
status.maturity = TransactionStatus::Immature;
diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h
index 6f68f93fa5..8a7c9044e3 100644
--- a/src/qt/transactionrecord.h
+++ b/src/qt/transactionrecord.h
@@ -51,8 +51,8 @@ public:
/** @name Reported status
@{*/
Status status;
- int64 depth;
- int64 open_for; /**< Timestamp if status==OpenUntilDate, otherwise number
+ qint64 depth;
+ qint64 open_for; /**< Timestamp if status==OpenUntilDate, otherwise number
of additional blocks that need to be mined before
finalization */
/**@}*/
@@ -86,15 +86,15 @@ public:
{
}
- TransactionRecord(uint256 hash, int64 time):
+ TransactionRecord(uint256 hash, qint64 time):
hash(hash), time(time), type(Other), address(""), debit(0),
credit(0), idx(0)
{
}
- TransactionRecord(uint256 hash, int64 time,
+ TransactionRecord(uint256 hash, qint64 time,
Type type, const std::string &address,
- int64 debit, int64 credit):
+ qint64 debit, qint64 credit):
hash(hash), time(time), type(type), address(address), debit(debit), credit(credit),
idx(0)
{
@@ -108,11 +108,11 @@ public:
/** @name Immutable transaction attributes
@{*/
uint256 hash;
- int64 time;
+ qint64 time;
Type type;
std::string address;
- int64 debit;
- int64 credit;
+ qint64 debit;
+ qint64 credit;
/**@}*/
/** Subtransaction index, for sort key */
diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp
index a33f2b5a71..3777e82f31 100644
--- a/src/qt/transactiontablemodel.cpp
+++ b/src/qt/transactiontablemodel.cpp
@@ -4,24 +4,27 @@
#include "transactiontablemodel.h"
-#include "guiutil.h"
-#include "transactionrecord.h"
+#include "addresstablemodel.h"
+#include "bitcoinunits.h"
#include "guiconstants.h"
+#include "guiutil.h"
+#include "optionsmodel.h"
#include "transactiondesc.h"
+#include "transactionrecord.h"
#include "walletmodel.h"
-#include "optionsmodel.h"
-#include "addresstablemodel.h"
-#include "bitcoinunits.h"
+#include "main.h"
+#include "sync.h"
+#include "uint256.h"
+#include "util.h"
#include "wallet.h"
-#include "ui_interface.h"
-#include <QList>
#include <QColor>
-#include <QTimer>
-#include <QIcon>
#include <QDateTime>
#include <QDebug>
+#include <QIcon>
+#include <QList>
+#include <QTimer>
// 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 d1b4f706d8..c23c606c31 100644
--- a/src/qt/transactiontablemodel.h
+++ b/src/qt/transactiontablemodel.h
@@ -8,11 +8,12 @@
#include <QAbstractTableModel>
#include <QStringList>
-class CWallet;
-class TransactionTablePriv;
class TransactionRecord;
+class TransactionTablePriv;
class WalletModel;
+class CWallet;
+
/** UI model for the transaction table of a wallet.
*/
class TransactionTableModel : public QAbstractTableModel
diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp
index 46245f00ad..d3e2bdf400 100644
--- a/src/qt/transactionview.cpp
+++ b/src/qt/transactionview.cpp
@@ -4,31 +4,32 @@
#include "transactionview.h"
-#include "transactionfilterproxy.h"
-#include "transactionrecord.h"
-#include "walletmodel.h"
#include "addresstablemodel.h"
-#include "transactiontablemodel.h"
#include "bitcoinunits.h"
#include "csvmodelwriter.h"
-#include "transactiondescdialog.h"
#include "editaddressdialog.h"
-#include "optionsmodel.h"
#include "guiutil.h"
+#include "optionsmodel.h"
+#include "transactiondescdialog.h"
+#include "transactionfilterproxy.h"
+#include "transactionrecord.h"
+#include "transactiontablemodel.h"
+#include "walletmodel.h"
+
#include "ui_interface.h"
-#include <QScrollBar>
#include <QComboBox>
+#include <QDateTimeEdit>
#include <QDoubleValidator>
#include <QHBoxLayout>
-#include <QVBoxLayout>
-#include <QLineEdit>
-#include <QTableView>
#include <QHeaderView>
-#include <QPoint>
-#include <QMenu>
#include <QLabel>
-#include <QDateTimeEdit>
+#include <QLineEdit>
+#include <QMenu>
+#include <QPoint>
+#include <QScrollBar>
+#include <QTableView>
+#include <QVBoxLayout>
TransactionView::TransactionView(QWidget *parent) :
QWidget(parent), model(0), transactionProxyModel(0),
diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h
index 2690cbb8ad..18f2b9bfc9 100644
--- a/src/qt/transactionview.h
+++ b/src/qt/transactionview.h
@@ -7,17 +7,17 @@
#include <QWidget>
-class WalletModel;
class TransactionFilterProxy;
+class WalletModel;
QT_BEGIN_NAMESPACE
-class QTableView;
class QComboBox;
+class QDateTimeEdit;
+class QFrame;
class QLineEdit;
-class QModelIndex;
class QMenu;
-class QFrame;
-class QDateTimeEdit;
+class QModelIndex;
+class QTableView;
QT_END_NAMESPACE
/** Widget showing the transaction list for a wallet, including a filter row.
diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp
index bacc70070b..04eea59169 100644
--- a/src/qt/walletframe.cpp
+++ b/src/qt/walletframe.cpp
@@ -3,12 +3,13 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "walletframe.h"
-#include "walletview.h"
+
#include "bitcoingui.h"
+#include "walletview.h"
+
+#include <cstdio>
#include <QHBoxLayout>
-#include <QMessageBox>
-#include <QStackedWidget>
WalletFrame::WalletFrame(BitcoinGUI *_gui) :
QFrame(_gui),
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index 1c24ffb20b..b1d770e1a7 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -3,18 +3,25 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "walletmodel.h"
-#include "guiconstants.h"
-#include "optionsmodel.h"
+
#include "addresstablemodel.h"
+#include "guiconstants.h"
#include "transactiontablemodel.h"
+#include "base58.h"
+#include "db.h"
+#include "keystore.h"
+#include "main.h"
+#include "sync.h"
#include "ui_interface.h"
+#include "wallet.h"
#include "walletdb.h" // for BackupWallet
-#include "base58.h"
+#include <stdint.h>
+
+#include <QDebug>
#include <QSet>
#include <QTimer>
-#include <QDebug>
WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent) :
QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0),
@@ -133,7 +140,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
{
qint64 total = 0;
QList<SendCoinsRecipient> recipients = transaction.getRecipients();
- std::vector<std::pair<CScript, int64> > vecSend;
+ std::vector<std::pair<CScript, int64_t> > vecSend;
if(recipients.empty())
{
@@ -148,7 +155,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
{
if (rcp.paymentRequest.IsInitialized())
{ // PaymentRequest...
- int64 subtotal = 0;
+ int64_t subtotal = 0;
const payments::PaymentDetails& details = rcp.paymentRequest.getDetails();
for (int i = 0; i < details.outputs_size(); i++)
{
@@ -157,7 +164,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
subtotal += out.amount();
const unsigned char* scriptStr = (const unsigned char*)out.script().data();
CScript scriptPubKey(scriptStr, scriptStr+out.script().size());
- vecSend.push_back(std::pair<CScript, int64>(scriptPubKey, out.amount()));
+ vecSend.push_back(std::pair<CScript, int64_t>(scriptPubKey, out.amount()));
}
if (subtotal <= 0)
{
@@ -180,7 +187,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
CScript scriptPubKey;
scriptPubKey.SetDestination(CBitcoinAddress(rcp.address.toStdString()).Get());
- vecSend.push_back(std::pair<CScript, int64>(scriptPubKey, rcp.amount));
+ vecSend.push_back(std::pair<CScript, int64_t>(scriptPubKey, rcp.amount));
total += rcp.amount;
}
@@ -205,7 +212,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
LOCK2(cs_main, wallet->cs_wallet);
transaction.newPossibleKeyChange(wallet);
- int64 nFeeRequired = 0;
+ int64_t nFeeRequired = 0;
std::string strFailReason;
CWalletTx *newTx = transaction.getTransaction();
diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h
index efa6ccc668..f39e9dfca0 100644
--- a/src/qt/walletmodel.h
+++ b/src/qt/walletmodel.h
@@ -5,19 +5,20 @@
#ifndef WALLETMODEL_H
#define WALLETMODEL_H
-#include <QObject>
+#include "paymentrequestplus.h"
+#include "walletmodeltransaction.h"
#include "allocators.h" /* for SecureString */
-#include "wallet.h"
-#include "walletmodeltransaction.h"
-#include "paymentrequestplus.h"
-class OptionsModel;
+#include <QObject>
+
class AddressTableModel;
+class OptionsModel;
class TransactionTableModel;
-class CWallet;
class WalletModelTransaction;
+class CWallet;
+
QT_BEGIN_NAMESPACE
class QTimer;
QT_END_NAMESPACE
diff --git a/src/qt/walletmodeltransaction.cpp b/src/qt/walletmodeltransaction.cpp
index 96c2794dff..943f13e208 100644
--- a/src/qt/walletmodeltransaction.cpp
+++ b/src/qt/walletmodeltransaction.cpp
@@ -4,6 +4,8 @@
#include "walletmodeltransaction.h"
+#include "wallet.h"
+
WalletModelTransaction::WalletModelTransaction(const QList<SendCoinsRecipient> &recipients) :
recipients(recipients),
walletTransaction(0),
diff --git a/src/qt/walletmodeltransaction.h b/src/qt/walletmodeltransaction.h
index efc4814430..a948808a75 100644
--- a/src/qt/walletmodeltransaction.h
+++ b/src/qt/walletmodeltransaction.h
@@ -7,8 +7,14 @@
#include "walletmodel.h"
+#include <QObject>
+
class SendCoinsRecipient;
+class CReserveKey;
+class CWallet;
+class CWalletTx;
+
/** Data model for a walletmodel transaction. */
class WalletModelTransaction
{
diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp
index b026ca5446..2485688531 100644
--- a/src/qt/walletview.cpp
+++ b/src/qt/walletview.cpp
@@ -3,25 +3,29 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "walletview.h"
-#include "bitcoingui.h"
-#include "transactiontablemodel.h"
+
#include "addressbookpage.h"
-#include "sendcoinsdialog.h"
-#include "receivecoinsdialog.h"
-#include "signverifymessagedialog.h"
+#include "askpassphrasedialog.h"
+#include "bitcoingui.h"
#include "clientmodel.h"
-#include "walletmodel.h"
+#include "guiutil.h"
#include "optionsmodel.h"
-#include "transactionview.h"
#include "overviewpage.h"
-#include "askpassphrasedialog.h"
+#include "receivecoinsdialog.h"
+#include "sendcoinsdialog.h"
+#include "signverifymessagedialog.h"
+#include "transactiontablemodel.h"
+#include "transactionview.h"
+#include "walletmodel.h"
+
#include "ui_interface.h"
-#include "guiutil.h"
-#include <QHBoxLayout>
-#include <QVBoxLayout>
#include <QAction>
+#include <QActionGroup>
+#include <QFileDialog>
+#include <QHBoxLayout>
#include <QPushButton>
+#include <QVBoxLayout>
WalletView::WalletView(QWidget *parent):
QStackedWidget(parent),
diff --git a/src/qt/walletview.h b/src/qt/walletview.h
index 19be8f4d87..d951691621 100644
--- a/src/qt/walletview.h
+++ b/src/qt/walletview.h
@@ -9,17 +9,14 @@
class BitcoinGUI;
class ClientModel;
-class WalletModel;
-class TransactionView;
class OverviewPage;
-class SendCoinsDialog;
class ReceiveCoinsDialog;
+class SendCoinsDialog;
class SendCoinsRecipient;
-class SignVerifyMessageDialog;
-class RPCConsole;
+class TransactionView;
+class WalletModel;
QT_BEGIN_NAMESPACE
-class QLabel;
class QModelIndex;
QT_END_NAMESPACE