More refactoring.

This commit is contained in:
kevin 2019-06-23 13:30:01 -04:00
parent ad3fc52f43
commit 39235f1df3
5 changed files with 7 additions and 15 deletions

View File

@ -14,7 +14,7 @@ hgx11::hgx11(QHash<QString, QString> opts)
while (i.hasNext()) {
i.next();
if ((i.key() == "a" || i.key() == "address") && !(i.value().isNull() && i.value().isEmpty())) {
addr = i.value();
addr = i.value();
} else if ((i.key() == "p" || i.key() == "port") && i.value().toUShort()) {
port = i.value().toUShort();
} else if ((i.key() == "s" || i.key() == "scale") && i.value().toUShort()) {
@ -82,7 +82,7 @@ QString hgx11::_parseColorArr(QString value, bool isInt)
if (values.size() != 3) {
return "";
}
QString retVal = "[";
value = "[";
for (int i = 0; i < 3; i++) {
if (isInt && (values.at(i).toInt() < 0 || values.at(i).toInt() > 255)) {
return "";
@ -90,12 +90,12 @@ QString hgx11::_parseColorArr(QString value, bool isInt)
if (!isInt && (values.at(i).toDouble() < 0.0 || values.at(i).toDouble() > 1.0)) {
return "";
}
retVal.append(values.at(i));
retVal.append(",");
value.append(values.at(i));
value.append(",");
}
retVal.chop(1);
retVal.append("]");
return retVal;
value.chop(1);
value.append("]");
return value;
}
// private slots

View File

@ -23,8 +23,6 @@ private:
QTimer *_timer_p;
int _inactiveTime_m = 0;
QString _destWidth_m;
QString _destHeight_m;
QString _parseColorArr(QString, bool);

View File

@ -4,7 +4,6 @@
#include <QThread>
#include <QDebug>
#include <X11/extensions/Xdamage.h>
#include <X11/Xlib.h>
class hgx11damage : public QThread
{

View File

@ -3,7 +3,6 @@
#include <QObject>
#include <QDebug>
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
#include <X11/extensions/XShm.h>
#include <sys/shm.h>

View File

@ -2,10 +2,6 @@
#define HGX11NET_H
#include <QTcpSocket>
#include <QAbstractSocket>
#include <QString>
#include <QObject>
#include <QByteArray>
class hgx11net : public QObject
{