Skip to content

Commit

Permalink
Refine LookupAddressDialog includes
Browse files Browse the repository at this point in the history
 - add destructor
 - remove unused members
 - remove unused headers
 - forward declare classes
 - sort headers
 - ...
  • Loading branch information
dexX7 committed May 18, 2015
1 parent 825f512 commit cd18197
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 69 deletions.
82 changes: 25 additions & 57 deletions src/qt/lookupaddressdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,29 @@
#include "ui_lookupaddressdialog.h"

#include "guiutil.h"
#include "optionsmodel.h"
#include "walletmodel.h"
#include "wallet.h"
#include "base58.h"
#include "ui_interface.h"

#include <boost/filesystem.hpp>

#include "leveldb/db.h"
#include "leveldb/write_batch.h"

// potentially overzealous includes here
#include "base58.h"
#include "rpcserver.h"
#include "init.h"
#include "util.h"
#include <fstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <string>
#include <boost/assign/list_of.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/find.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/format.hpp>
#include <boost/filesystem.hpp>
#include "json/json_spirit_utils.h"
#include "json/json_spirit_value.h"
#include "leveldb/db.h"
#include "leveldb/write_batch.h"
// end potentially overzealous includes

using namespace json_spirit;
#include "mastercore.h"
using namespace mastercore;

// potentially overzealous using here
using namespace std;
using namespace boost;
using namespace boost::assign;
using namespace leveldb;
// end potentially overzealous using

#include "mastercore_dex.h"
#include "mastercore_tx.h"
#include "mastercore_sp.h"
#include "base58.h"

#include <QMessageBox>
#include <QScrollBar>
#include <QTextDocument>
#include <stdint.h>
#include <sstream>
#include <string>

#include <QAction>
#include <QClipboard>
#include <QContextMenuEvent>
#include <QDialog>
#include <QDrag>
#include <QImage>
#include <QLabel>
#include <QMenu>
#include <QMessageBox>
#include <QMimeData>
#include <QMouseEvent>
#include <QPixmap>
#include <QMenu>
#if QT_VERSION < 0x050000
#include <QUrl>
#endif
#include <QString>
#include <QWidget>

#if defined(HAVE_CONFIG_H)
#include "bitcoin-config.h" /* for USE_QRCODE */
Expand All @@ -77,6 +38,11 @@ using namespace leveldb;
#include <qrencode.h>
#endif

using std::ostringstream;
using std::string;

using namespace mastercore;

MPQRImageWidget::MPQRImageWidget(QWidget *parent):
QLabel(parent), contextMenu(0)
{
Expand Down Expand Up @@ -139,14 +105,11 @@ void MPQRImageWidget::contextMenuEvent(QContextMenuEvent *event)

LookupAddressDialog::LookupAddressDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::LookupAddressDialog),
model(0)
ui(new Ui::LookupAddressDialog)
{
ui->setupUi(this);
this->model = model;

#if QT_VERSION >= 0x040700
// populate placeholder text
ui->searchLineEdit->setPlaceholderText("Search address");
#endif

Expand All @@ -166,6 +129,11 @@ LookupAddressDialog::LookupAddressDialog(QWidget *parent) :
ui->frame->setVisible(false);
}

LookupAddressDialog::~LookupAddressDialog()
{
delete ui;
}

void LookupAddressDialog::searchAddress()
{
// search function to lookup address
Expand Down Expand Up @@ -216,7 +184,7 @@ void LookupAddressDialog::searchAddress()
unsigned int propertyId;
unsigned int lastFoundPropertyIdMainEco = 1;
unsigned int lastFoundPropertyIdTestEco = 1;
string pName[12];
string pName[12]; // TODO: enough slots?
uint64_t pBal[12];
bool pDivisible[12];
bool pFound[12];
Expand Down
19 changes: 7 additions & 12 deletions src/qt/lookupaddressdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
#ifndef LOOKUPADDRESSDIALOG_H
#define LOOKUPADDRESSDIALOG_H

#include "walletmodel.h"

#include <QDialog>
#include <QString>
#include <QImage>
#include <QLabel>
class OptionsModel;

QT_BEGIN_NAMESPACE
class QUrl;
class QContextMenuEvent;
class QImage;
class QMenu;
class QMouseEvent;
class QString;
class QWidget;
QT_END_NAMESPACE

namespace Ui {
Expand Down Expand Up @@ -52,19 +51,15 @@ class LookupAddressDialog : public QDialog

public:
explicit LookupAddressDialog(QWidget *parent = 0);
~LookupAddressDialog();

void searchAddress();
/** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907).
*/
QWidget *setupTabChain(QWidget *prev);

public slots:
void searchButtonClicked();

private:
Ui::LookupAddressDialog *ui;
WalletModel *model;

//private slots:

signals:
// Fired when a message should be reported to the user
Expand Down

0 comments on commit cd18197

Please sign in to comment.