|
|
@ -13,7 +13,6 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include <QDebug> |
|
|
|
#include <QDebug> |
|
|
|
#include <QList> |
|
|
|
#include <QList> |
|
|
|
#include <QTimer> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <boost/date_time/posix_time/posix_time.hpp> |
|
|
|
#include <boost/date_time/posix_time/posix_time.hpp> |
|
|
|
#include <boost/date_time/c_local_time_adjustor.hpp> |
|
|
|
#include <boost/date_time/c_local_time_adjustor.hpp> |
|
|
@ -65,33 +64,17 @@ public: |
|
|
|
|
|
|
|
|
|
|
|
BanTableModel::BanTableModel(ClientModel *parent) : |
|
|
|
BanTableModel::BanTableModel(ClientModel *parent) : |
|
|
|
QAbstractTableModel(parent), |
|
|
|
QAbstractTableModel(parent), |
|
|
|
clientModel(parent), |
|
|
|
clientModel(parent) |
|
|
|
timer(0) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
columns << tr("IP/Netmask") << tr("Banned Until"); |
|
|
|
columns << tr("IP/Netmask") << tr("Banned Until"); |
|
|
|
priv = new BanTablePriv(); |
|
|
|
priv = new BanTablePriv(); |
|
|
|
// default to unsorted
|
|
|
|
// default to unsorted
|
|
|
|
priv->sortColumn = -1; |
|
|
|
priv->sortColumn = -1; |
|
|
|
|
|
|
|
|
|
|
|
// set up timer for auto refresh
|
|
|
|
|
|
|
|
timer = new QTimer(); |
|
|
|
|
|
|
|
connect(timer, SIGNAL(timeout()), SLOT(refresh())); |
|
|
|
|
|
|
|
timer->setInterval(MODEL_UPDATE_DELAY); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// load initial data
|
|
|
|
// load initial data
|
|
|
|
refresh(); |
|
|
|
refresh(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void BanTableModel::startAutoRefresh() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
timer->start(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void BanTableModel::stopAutoRefresh() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
timer->stop(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int BanTableModel::rowCount(const QModelIndex &parent) const |
|
|
|
int BanTableModel::rowCount(const QModelIndex &parent) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
Q_UNUSED(parent); |
|
|
|
Q_UNUSED(parent); |
|
|
|