diff options
author | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-06-21 10:44:48 +0200 |
---|---|---|
committer | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-09-16 16:50:19 +0200 |
commit | 53caec66cc43e1f16ba26e16147b77f5cfba22bb (patch) | |
tree | 13ec0315c209b5aa494c535e868ff76d2a729214 /src/qt/bantablemodel.cpp | |
parent | f0bcbc4c8a9918e5d240ba2736286cede76155f5 (diff) |
[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.cpp | 12 |
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) |