aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2014-06-03 14:42:20 +0200
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2014-06-03 15:01:50 +0200
commitbbe1925ce3e627fd405d83e3c947e1f430a1d720 (patch)
treec90ef9fe03b5f4cbb30ccd23ab42b1c43b26bb1f
parent4c097f9669a28420da74b159a4d61e509da80d33 (diff)
[Qt] style police and small addition in rpcconsole
- fix spaces, indentation and coding style glitches
-rw-r--r--src/qt/clientmodel.cpp4
-rw-r--r--src/qt/guiutil.cpp3
-rw-r--r--src/qt/guiutil.h1
-rw-r--r--src/qt/peertablemodel.cpp2
-rw-r--r--src/qt/peertablemodel.h7
-rw-r--r--src/qt/receiverequestdialog.cpp2
-rw-r--r--src/qt/receiverequestdialog.h4
-rw-r--r--src/qt/rpcconsole.cpp15
-rw-r--r--src/qt/rpcconsole.h8
-rw-r--r--src/qt/transactiondesc.h1
10 files changed, 26 insertions, 21 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index ce773e0f82..1c008428a3 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -23,7 +23,9 @@
static const int64_t nClientStartupTime = GetTime();
ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) :
- QObject(parent), optionsModel(optionsModel), peerTableModel(0),
+ QObject(parent),
+ optionsModel(optionsModel),
+ peerTableModel(0),
cachedNumBlocks(0),
cachedReindexing(0), cachedImporting(0),
numBlocksAtStartup(-1), pollTimer(0)
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 62db0487fc..1922d228c5 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -780,7 +780,7 @@ QString formatServicesStr(uint64_t mask)
QStringList strList;
// Just scan the last 8 bits for now.
- for (int i=0; i < 8; i++) {
+ for (int i = 0; i < 8; i++) {
uint64_t check = 1 << i;
if (mask & check)
{
@@ -799,7 +799,6 @@ QString formatServicesStr(uint64_t mask)
return strList.join(" & ");
else
return QObject::tr("None");
-
}
} // namespace GUIUtil
diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h
index ea6b7de872..45c78b4e14 100644
--- a/src/qt/guiutil.h
+++ b/src/qt/guiutil.h
@@ -178,7 +178,6 @@ namespace GUIUtil
/* Format CNodeStats.nServices bitmask into a user-readable string */
QString formatServicesStr(uint64_t mask);
-
} // namespace GUIUtil
#endif // GUIUTIL_H
diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp
index fba9d84e77..db5ce639b1 100644
--- a/src/qt/peertablemodel.cpp
+++ b/src/qt/peertablemodel.cpp
@@ -81,7 +81,6 @@ public:
}
}
-
if (sortColumn >= 0)
// sort cacheNodeStats (use stable sort to prevent rows jumping around unneceesarily)
qStableSort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder));
@@ -110,7 +109,6 @@ public:
return 0;
}
}
-
};
PeerTableModel::PeerTableModel(ClientModel *parent) :
diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h
index d947e21240..385bf0e0c1 100644
--- a/src/qt/peertablemodel.h
+++ b/src/qt/peertablemodel.h
@@ -11,10 +11,12 @@
#include <QAbstractTableModel>
#include <QStringList>
-class PeerTablePriv;
class ClientModel;
+class PeerTablePriv;
+QT_BEGIN_NAMESPACE
class QTimer;
+QT_END_NAMESPACE
struct CNodeCombinedStats {
CNodeStats nodestats;
@@ -24,7 +26,7 @@ struct CNodeCombinedStats {
class NodeLessThan
{
public:
- NodeLessThan(int nColumn, Qt::SortOrder fOrder):
+ NodeLessThan(int nColumn, Qt::SortOrder fOrder) :
column(nColumn), order(fOrder) {}
bool operator()(const CNodeCombinedStats &left, const CNodeCombinedStats &right) const;
@@ -73,7 +75,6 @@ private:
QStringList columns;
PeerTablePriv *priv;
QTimer *timer;
-
};
#endif // PEERTABLEMODEL_H
diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp
index 062638f2bc..d8dad15c0d 100644
--- a/src/qt/receiverequestdialog.cpp
+++ b/src/qt/receiverequestdialog.cpp
@@ -13,10 +13,10 @@
#include <QClipboard>
#include <QDrag>
+#include <QMenu>
#include <QMimeData>
#include <QMouseEvent>
#include <QPixmap>
-#include <QMenu>
#if QT_VERSION < 0x050000
#include <QUrl>
#endif
diff --git a/src/qt/receiverequestdialog.h b/src/qt/receiverequestdialog.h
index 5614ac635a..9b78e495c3 100644
--- a/src/qt/receiverequestdialog.h
+++ b/src/qt/receiverequestdialog.h
@@ -11,10 +11,12 @@
#include <QImage>
#include <QLabel>
+class OptionsModel;
+
namespace Ui {
class ReceiveRequestDialog;
}
-class OptionsModel;
+
QT_BEGIN_NAMESPACE
class QMenu;
QT_END_NAMESPACE
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index ed048cf3cc..3b7d37ff39 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -10,10 +10,9 @@
#include "peertablemodel.h"
#include "main.h"
-#include "util.h"
-
#include "rpcserver.h"
#include "rpcclient.h"
+#include "util.h"
#include "json/json_spirit_value.h"
#include <openssl/crypto.h>
@@ -297,10 +296,8 @@ void RPCConsole::setClientModel(ClientModel *model)
// connect the peerWidget's selection model to our peerSelected() handler
QItemSelectionModel *peerSelectModel = ui->peerWidget->selectionModel();
- connect(peerSelectModel,
- SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
- this,
- SLOT(peerSelected(const QItemSelection &, const QItemSelection &)));
+ connect(peerSelectModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
+ this, SLOT(peerSelected(const QItemSelection &, const QItemSelection &)));
connect(model->getPeerTableModel(), SIGNAL(layoutChanged()), this, SLOT(peerLayoutChanged()));
// Provide initial values
@@ -511,6 +508,8 @@ void RPCConsole::updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut)
void RPCConsole::peerSelected(const QItemSelection &selected, const QItemSelection &deselected)
{
+ Q_UNUSED(deselected);
+
if (selected.indexes().isEmpty())
return;
@@ -638,6 +637,8 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *combinedStats)
ui->peerBanScore->setText(tr("Fetching..."));
}
+// We override the virtual resizeEvent of the QWidget to adjust tables column
+// sizes as the tables width is proportional to the dialogs width.
void RPCConsole::resizeEvent(QResizeEvent *event)
{
QWidget::resizeEvent(event);
@@ -651,7 +652,7 @@ void RPCConsole::showEvent(QShowEvent *event)
// peerWidget needs a resize in case the dialog has non-default geometry
columnResizingFixer->stretchColumnWidth(PeerTableModel::Address);
- // start the PeerTableModel refresh timer
+ // start PeerTableModel auto refresh
clientModel->getPeerTableModel()->startAutoRefresh(1000);
}
diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h
index c17d5397ec..3fee34d00e 100644
--- a/src/qt/rpcconsole.h
+++ b/src/qt/rpcconsole.h
@@ -6,16 +6,18 @@
#define RPCCONSOLE_H
#include "guiutil.h"
-#include "net.h"
-
#include "peertablemodel.h"
+#include "net.h"
+
#include <QDialog>
class ClientModel;
+class CNodeCombinedStats;
+QT_BEGIN_NAMESPACE
class QItemSelection;
-class CNodeCombinedStats;
+QT_END_NAMESPACE
namespace Ui {
class RPCConsole;
diff --git a/src/qt/transactiondesc.h b/src/qt/transactiondesc.h
index f5a1328a71..4bd4293210 100644
--- a/src/qt/transactiondesc.h
+++ b/src/qt/transactiondesc.h
@@ -9,6 +9,7 @@
#include <QString>
class TransactionRecord;
+
class CWallet;
class CWalletTx;