aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bantablemodel.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <jonas.schnelli@include7.ch>2015-06-21 10:44:48 +0200
committerJonas Schnelli <jonas.schnelli@include7.ch>2015-09-16 16:50:19 +0200
commit53caec66cc43e1f16ba26e16147b77f5cfba22bb (patch)
tree13ec0315c209b5aa494c535e868ff76d2a729214 /src/qt/bantablemodel.cpp
parentf0bcbc4c8a9918e5d240ba2736286cede76155f5 (diff)
downloadbitcoin-53caec66cc43e1f16ba26e16147b77f5cfba22bb.tar.xz
[Qt] bantable overhaul
- some code cleanups - fix date formatting - reduce header includes
Diffstat (limited to 'src/qt/bantablemodel.cpp')
-rw-r--r--src/qt/bantablemodel.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp
index 615574cca7..b4b100bf5c 100644
--- a/src/qt/bantablemodel.cpp
+++ b/src/qt/bantablemodel.cpp
@@ -8,7 +8,6 @@
#include "guiconstants.h"
#include "guiutil.h"
-#include "net.h"
#include "sync.h"
#include "utiltime.h"
@@ -41,15 +40,16 @@ public:
cachedBanlist.reserve(banMap.size());
#endif
std::map<CSubNet, int64_t>::iterator iter;
- for (iter = banMap.begin(); iter != banMap.end(); ++iter) {
+ foreach (const PAIRTYPE(CSubNet, int64_t)& banentry, banMap)
+ {
CCombinedBan banEntry;
- banEntry.subnet = iter->first;
- banEntry.bantil = iter->second;
+ banEntry.subnet = banentry.first;
+ banEntry.bantil = banentry.second;
cachedBanlist.append(banEntry);
}
}
- int size()
+ int size() const
{
return cachedBanlist.size();
}
@@ -120,7 +120,7 @@ QVariant BanTableModel::data(const QModelIndex &index, int role) const
case Bantime:
QDateTime date = QDateTime::fromMSecsSinceEpoch(0);
date = date.addSecs(rec->bantil);
- return date.toString(Qt::SystemLocaleShortDate);
+ return date.toString(Qt::SystemLocaleLongDate);
}
} else if (role == Qt::TextAlignmentRole) {
if (index.column() == Bantime)