Skip to content

Commit

Permalink
Refine LookupSPDialog 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 cd18197 commit 2e2ede3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 58 deletions.
65 changes: 18 additions & 47 deletions src/qt/lookupspdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,35 @@
#include "ui_lookupspdialog.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"
#include "mastercore.h"
#include "mastercore_sp.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;
#include <stdint.h>
#include <algorithm>
#include <string>

// potentially overzealous using here
using namespace std;
using namespace boost;
using namespace boost::assign;
using namespace leveldb;
// end potentially overzealous using
#include <QDateTime>
#include <QDialog>
#include <QString>
#include <QWidget>

#include "mastercore_dex.h"
#include "mastercore_tx.h"
#include "mastercore_sp.h"
using std::ostringstream;
using std::string;

#include <QMessageBox>
#include <QScrollBar>
#include <QTextDocument>
#include <QDateTime>
using namespace mastercore;

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

// populate placeholder text
#if QT_VERSION >= 0x040700
ui->searchLineEdit->setPlaceholderText("ID, name or issuer");
#endif
Expand All @@ -95,6 +61,11 @@ LookupSPDialog::LookupSPDialog(QWidget *parent) :
ui->rightFrame->setVisible(false);
}

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

void LookupSPDialog::searchSP()
{
// search function to lookup properties, we want this search function to be as capable as possible to
Expand Down
18 changes: 7 additions & 11 deletions src/qt/lookupspdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
#ifndef LOOKUPSPDIALOG_H
#define LOOKUPSPDIALOG_H

#include "walletmodel.h"

#include <QDialog>
#include <QString>

class OptionsModel;
class WalletModel;

QT_BEGIN_NAMESPACE
class QUrl;
class QString;
class QWidget;
QT_END_NAMESPACE

namespace Ui {
Expand All @@ -27,17 +25,15 @@ class LookupSPDialog : public QDialog

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

void searchSP();
void updateDisplayedProperty();
void addSPToMatchingResults(unsigned int);
/** 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);

void addSPToMatchingResults(unsigned int propertyId);

public slots:
void searchButtonClicked();
void matchingComboBoxChanged(int);
void matchingComboBoxChanged(int idx);

private:
Ui::LookupSPDialog *ui;
Expand Down

0 comments on commit 2e2ede3

Please sign in to comment.