diff --git a/hgx11.cpp b/hgx11.cpp index 68a069b..f435a38 100644 --- a/hgx11.cpp +++ b/hgx11.cpp @@ -16,7 +16,7 @@ hgx11::hgx11(QHash opts) } else if ((i.key() == "f" || i.key() == "frameskip") && (i.value().toInt() > 0 && i.value().toInt() < 256)) { _frameskip_m = i.value(); } else if ((i.key() == "i" || i.key() == "inactive") && (i.value().toInt() > 0)) { - _inactiveTime_m = QString::number(i.value().toInt() * 1000); + _inactiveTime_m = (i.value().toInt() * 1000); } else if (i.key() == "r" || i.key() == "redadjust") { _redAdjust_m = _parseColorArr(i.value(), 1); } else if (i.key() == "g" || i.key() == "greenadjust") { @@ -46,10 +46,10 @@ hgx11::hgx11(QHash opts) connect(_grabber_p, SIGNAL(scaleChanged()), this, SLOT(_setImgSize())); connect(_grabber_p, SIGNAL(imageCreated()), this, SLOT(_sendImage())); - if (_inactiveTime_m.toInt()) { + if (_inactiveTime_m) { _timer_p = new QTimer(this); connect(_timer_p, SIGNAL(timeout()), this, SLOT(_inActivity())); - _timer_p->start(_inactiveTime_m.toInt()); + _timer_p->start(_inactiveTime_m); connect(_damage_p, SIGNAL(damageDetected()), this, SLOT(_activity())); } } @@ -105,7 +105,7 @@ void hgx11::_inActivity() void hgx11::_activity() { _timer_p->stop(); - _timer_p->start(_inactiveTime_m.toInt()); + _timer_p->start(_inactiveTime_m); } void hgx11::_setImgSize() diff --git a/hgx11.h b/hgx11.h index b3df4bf..1e6b04a 100644 --- a/hgx11.h +++ b/hgx11.h @@ -22,11 +22,11 @@ private: hgx11net *_hclient_p; QTimer *_timer_p; + int _inactiveTime_m = 0; QString _addr_m = "localhost"; QString _port_m = "19444"; QString _scale_m = "8"; QString _frameskip_m = "0"; - QString _inactiveTime_m = "0"; QString _redAdjust_m = ""; QString _greenAdjust_m = ""; QString _blueAdjust_m = "";