Permalink
Browse files

Route qDebug() messages to debug.log

remove printf redefinition from bitcoinrpc.cpp
code cleanup
  • Loading branch information...
Tranz5 committed Oct 11, 2014
1 parent 959ac3e commit 0cbb1f94cf120d6acaba05eb1b52c26fd77b419c
Showing with 138 additions and 151 deletions.
  1. +0 −3 src/bitcoinrpc.cpp
  2. +3 −0 src/coincontrol.h
  3. +4 −4 src/qt/addressbookpage.cpp
  4. +5 −4 src/qt/addresstablemodel.cpp
  5. +1 −0 src/qt/addresstablemodel.h
  6. +0 −1 src/qt/askpassphrasedialog.h
  7. +13 −9 src/qt/bitcoin.cpp
  8. +1 −1 src/qt/bitcoin.qrc
  9. +1 −5 src/qt/bitcoinaddressvalidator.h
  10. +2 −6 src/qt/bitcoinamountfield.cpp
  11. +2 −1 src/qt/bitcoinamountfield.h
  12. +4 −5 src/qt/bitcoingui.cpp
  13. +1 −5 src/qt/bitcoingui.h
  14. +3 −0 src/qt/bitcoinunits.h
  15. +3 −5 src/qt/blockbrowser.h
  16. +2 −2 src/qt/charitydialog.cpp
  17. +12 −9 src/qt/clientmodel.cpp
  18. +1 −0 src/qt/clientmodel.h
  19. +1 −5 src/qt/csvmodelwriter.h
  20. +1 −0 src/qt/editaddressdialog.cpp
  21. +4 −4 src/qt/editaddressdialog.h
  22. +4 −3 src/qt/guiutil.cpp
  23. +2 −1 src/qt/guiutil.h
  24. +0 −1 src/qt/monitoreddatamapper.cpp
  25. +2 −3 src/qt/monitoreddatamapper.h
  26. +1 −1 src/qt/notificator.cpp
  27. +4 −4 src/qt/notificator.h
  28. +0 −2 src/qt/optionsdialog.cpp
  29. +3 −2 src/qt/optionsmodel.cpp
  30. +4 −4 src/qt/overviewpage.h
  31. +1 −0 src/qt/qvalidatedlineedit.h
  32. +1 −2 src/qt/qvaluecombobox.h
  33. +5 −4 src/qt/rpcconsole.cpp
  34. +2 −1 src/qt/rpcconsole.h
  35. +1 −2 src/qt/sendcoinsdialog.cpp
  36. +1 −0 src/qt/sendcoinsentry.cpp
  37. +2 −2 src/qt/signverifymessagedialog.cpp
  38. +0 −3 src/qt/signverifymessagedialog.h
  39. +0 −9 src/qt/test/uritests.cpp
  40. +2 −1 src/qt/transactiondesc.cpp
  41. +3 −2 src/qt/transactiondesc.h
  42. +1 −0 src/qt/transactiondescdialog.h
  43. +2 −5 src/qt/transactionfilterproxy.h
  44. +2 −2 src/qt/transactionrecord.h
  45. +10 −9 src/qt/transactiontablemodel.cpp
  46. +2 −0 src/qt/transactiontablemodel.h
  47. +4 −11 src/qt/transactionview.cpp
  48. +1 −0 src/qt/transactionview.h
  49. +14 −8 src/qt/walletmodel.cpp
@@ -11,7 +11,6 @@
#include "bitcoinrpc.h"
#include "db.h"
#undef printf
#include <boost/asio.hpp>
#include <boost/asio/ip/v6_only.hpp>
#include <boost/bind.hpp>
@@ -26,8 +25,6 @@
#include <boost/shared_ptr.hpp>
#include <list>
#define printf OutputDebugStringF
using namespace std;
using namespace boost;
using namespace boost::asio;
@@ -1,6 +1,9 @@
#ifndef COINCONTROL_H
#define COINCONTROL_H
#include "main.h"
#include "script.h"
/** Coin Control Features. */
class CCoinControl
{
@@ -8,15 +8,15 @@
#include "csvmodelwriter.h"
#include "guiutil.h"
#ifdef USE_QRCODE
#include "qrcodedialog.h"
#endif
#include <QSortFilterProxyModel>
#include <QClipboard>
#include <QMessageBox>
#include <QMenu>
#ifdef USE_QRCODE
#include "qrcodedialog.h"
#endif
AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
QDialog(parent),
ui(new Ui::AddressBookPage),
@@ -1,12 +1,13 @@
#include "addresstablemodel.h"
#include "guiutil.h"
#include "walletmodel.h"
#include "wallet.h"
#include "base58.h"
#include <QFont>
#include <QColor>
#include <QDebug>
const QString AddressTableModel::Send = "S";
const QString AddressTableModel::Receive = "R";
@@ -90,7 +91,7 @@ class AddressTablePriv
case CT_NEW:
if(inModel)
{
OutputDebugStringF("Warning: AddressTablePriv::updateEntry: Got CT_NOW, but entry is already in model\n");
qDebug() << "AddressTablePriv::updateEntry : Warning: Got CT_NEW, but entry is already in model";
break;
}
parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex);
@@ -100,7 +101,7 @@ class AddressTablePriv
case CT_UPDATED:
if(!inModel)
{
OutputDebugStringF("Warning: AddressTablePriv::updateEntry: Got CT_UPDATED, but entry is not in model\n");
qDebug() << "AddressTablePriv::updateEntry : Warning: Got CT_UPDATED, but entry is not in model";
break;
}
lower->type = newEntryType;
@@ -110,7 +111,7 @@ class AddressTablePriv
case CT_DELETED:
if(!inModel)
{
OutputDebugStringF("Warning: AddressTablePriv::updateEntry: Got CT_DELETED, but entry is not in model\n");
qDebug() << "AddressTablePriv::updateEntry : Warning: Got CT_DELETED, but entry is not in model";
break;
}
parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1);
@@ -14,6 +14,7 @@ class WalletModel;
class AddressTableModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit AddressTableModel(CWallet *wallet, WalletModel *parent = 0);
~AddressTableModel();
@@ -6,7 +6,6 @@
namespace Ui {
class AskPassphraseDialog;
}
class WalletModel;
/** Multifunctional dialog to ask for passphrases. Used for encryption, unlocking, and changing the passphrase.
@@ -1,6 +1,9 @@
/*
* W.J. van der Laan 2011-2012
*/
#include <QApplication>
#include "bitcoingui.h"
#include "clientmodel.h"
#include "walletmodel.h"
@@ -13,7 +16,7 @@
#include "ui_interface.h"
#include "qtipcserver.h"
#include <QApplication>
#include <QMessageBox>
#if QT_VERSION < 0x050000
#include <QTextCodec>
@@ -118,12 +121,12 @@ static void handleRunawayException(std::exception *e)
#if QT_VERSION < 0x050000
void DebugMessageHandler(QtMsgType type, const char * msg)
{
OutputDebugStringF("%s\n", msg);
OutputDebugStringF("Bitcoin-Qt: %s\n", msg);
}
#else
void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg)
{
OutputDebugStringF("%s\n", qPrintable(msg));
OutputDebugStringF("Bitcoin-Qt: %s\n", qPrintable(msg));
}
#endif
@@ -155,6 +158,13 @@ int main(int argc, char *argv[])
// Install global event filter that makes sure that long tooltips can be word-wrapped
app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app));
// Install qDebug() message handler to route to debug.log:
#if QT_VERSION < 0x050000
qInstallMsgHandler(DebugMessageHandler);
#else
qInstallMessageHandler(DebugMessageHandler);
#endif
// ... then bitcoin.conf:
if (!boost::filesystem::is_directory(GetDataDir(false)))
{
@@ -222,12 +232,6 @@ int main(int argc, char *argv[])
return 1;
}
// Install qDebug() message handler to route to debug.log:
#if QT_VERSION < 0x050000
qInstallMsgHandler(DebugMessageHandler);
#else
qInstallMessageHandler(DebugMessageHandler);
#endif
QSplashScreen splash(QPixmap(":/images/splash"), 0);
if (GetBoolArg("-splash", true) && !GetBoolArg("-min"))
@@ -1,4 +1,4 @@
<RCC>
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/icons">
<file alias="bitcoin">res/icons/HoboNickels-128.png</file>
<file alias="address-book">res/icons/address-book.png</file>
@@ -1,7 +1,7 @@
#ifndef BITCOINADDRESSVALIDATOR_H
#define BITCOINADDRESSVALIDATOR_H
#include <QRegExpValidator>
#include <QValidator>
/** Base48 entry widget validator.
Corrects near-miss characters and refuses characters that are no part of base48.
@@ -15,10 +15,6 @@ class BitcoinAddressValidator : public QValidator
State validate(QString &input, int &pos) const;
static const int MaxAddressLength = 35;
signals:
public slots:
};
#endif // BITCOINADDRESSVALIDATOR_H
@@ -1,18 +1,14 @@
#include "bitcoinamountfield.h"
#include "qvaluecombobox.h"
#include "bitcoinunits.h"
#include "guiconstants.h"
#include <QLabel>
#include <QLineEdit>
#include <QRegExpValidator>
#include <QHBoxLayout>
#include <QKeyEvent>
#include <QDoubleSpinBox>
#include <QComboBox>
#include <QApplication>
#include <qmath.h>
#include <qmath.h> // for qPow()
BitcoinAmountField::BitcoinAmountField(QWidget *parent):
QWidget(parent), amount(0), currentUnit(-1)
@@ -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
@@ -4,7 +4,11 @@
* W.J. van der Laan 2011-2012
* The Bitcoin Developers 2011-2012
*/
#include <QApplication>
#include "bitcoingui.h"
#include "transactiontablemodel.h"
#include "optionsdialog.h"
#include "aboutdialog.h"
@@ -25,19 +29,14 @@
#include "macdockiconhandler.h"
#endif
#include <QApplication>
#include <QMainWindow>
#include <QMenuBar>
#include <QMenu>
#include <QIcon>
#include <QTabWidget>
#include <QVBoxLayout>
#include <QToolBar>
#include <QStatusBar>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QLocale>
#include <QMessageBox>
#include <QProgressBar>
#include <QStackedWidget>
@@ -18,19 +18,14 @@ class SignVerifyMessageDialog;
class Notificator;
class RPCConsole;
class StakeForCharityDialog;
class CWallet;
class CWalletManager;
QT_BEGIN_NAMESPACE
class QLabel;
class QLineEdit;
class QTableView;
class QAbstractItemModel;
class QModelIndex;
class QProgressBar;
class QStackedWidget;
class QUrl;
class QListWidget;
class QPushButton;
QT_END_NAMESPACE
@@ -42,6 +37,7 @@ QT_END_NAMESPACE
class BitcoinGUI : public QMainWindow
{
Q_OBJECT
public:
explicit BitcoinGUI(QWidget *parent = 0);
~BitcoinGUI();
@@ -9,6 +9,8 @@
*/
class BitcoinUnits: public QAbstractListModel
{
Q_OBJECT
public:
explicit BitcoinUnits(QObject *parent);
@@ -60,6 +62,7 @@ class BitcoinUnits: public QAbstractListModel
int rowCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
///@}
private:
QList<BitcoinUnits::Unit> unitlist;
};
@@ -1,10 +1,11 @@
#ifndef BLOCKBROWSER_H
#define BLOCKBROWSER_H
#include <QDialog>
#include "clientmodel.h"
#include "main.h"
#include <QDialog>
#include "main.h"
namespace Ui {
class BlockBrowser;
@@ -30,9 +31,6 @@ public slots:
void updateExplorer(bool);
double getTxFees(std::string);
private slots:
private:
Ui::BlockBrowser *ui;
ClientModel *model;
@@ -2,13 +2,13 @@
#include "ui_charitydialog.h"
#include "walletmodel.h"
#include "base58.h"
#include "addressbookpage.h"
#include "init.h"
#include "base58.h"
#include <QLineEdit>
StakeForCharityDialog::StakeForCharityDialog(QWidget *parent) :
QWidget(parent),
ui(new Ui::StakeForCharityDialog),
Oops, something went wrong.

0 comments on commit 0cbb1f9

Please sign in to comment.