From 0925d25b641d6ab2428a3724db1bb5f7f715c844 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Sat, 6 Feb 2021 10:02:06 -0500 Subject: [PATCH] 2021-02-06 Fred Gleason * Removed 'Q3SocketDevice' dependencies from rdsoftkeys(1). Signed-off-by: Fred Gleason --- ChangeLog | 2 ++ utils/rdsoftkeys/rdsoftkeys.cpp | 23 +++++++++++------------ utils/rdsoftkeys/rdsoftkeys.h | 15 ++++++++------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index a02918d5..672e13ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21028,3 +21028,5 @@ * Removed 'Q3SocketDevice' dependencies from rmlsend(1). 2021-02-05 Fred Gleason * Removed 'Q3TextStream' dependencies from rmlsend(1). +2021-02-06 Fred Gleason + * Removed 'Q3SocketDevice' dependencies from rdsoftkeys(1). diff --git a/utils/rdsoftkeys/rdsoftkeys.cpp b/utils/rdsoftkeys/rdsoftkeys.cpp index 128115f1..3582d3ea 100644 --- a/utils/rdsoftkeys/rdsoftkeys.cpp +++ b/utils/rdsoftkeys/rdsoftkeys.cpp @@ -2,7 +2,7 @@ // // A utility for sending RML Commands // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2021 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -21,13 +21,12 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include #include #include "rdsoftkeys.h" @@ -67,7 +66,7 @@ MainWidget::MainWidget(QWidget *parent) // // RML Send Socket // - key_socket=new Q3SocketDevice(Q3SocketDevice::Datagram); + key_socket=new QUdpSocket(this); // // Create Buttons @@ -89,7 +88,7 @@ MainWidget::MainWidget(QWidget *parent) profile->setSource(map_filename); key_columns= profile->intValue("SoftKeys","Columns",RDSOFTKEYS_DEFAULT_COLUMNS); - unsigned col=0; + int col=0; unsigned row=0; while(!(rmlcmd=profile->stringValue("SoftKeys",QString(). sprintf("Command%d",n+1),"")).isEmpty()) { @@ -162,7 +161,7 @@ MainWidget::MainWidget(QWidget *parent) QSize MainWidget::sizeHint() const { - unsigned x=0; + int x=0; if(key_macros.size()>=key_columns) { x=10+90*key_columns; @@ -196,8 +195,8 @@ void MainWidget::buttonData(int id) else { addr.setAddress(key_addrs[id]); } - key_socket->writeBlock(key_macros[id],key_macros[id].length(), - addr,(Q_UINT16)RD_RML_NOECHO_PORT); + key_socket-> + writeDatagram(key_macros[id].toUtf8(),addr,(Q_UINT16)RD_RML_NOECHO_PORT); } diff --git a/utils/rdsoftkeys/rdsoftkeys.h b/utils/rdsoftkeys/rdsoftkeys.h index 5b24dcdb..dc415cc9 100644 --- a/utils/rdsoftkeys/rdsoftkeys.h +++ b/utils/rdsoftkeys/rdsoftkeys.h @@ -2,7 +2,7 @@ // // A utility for sending RML Commands // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2021 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -21,8 +21,9 @@ #ifndef RDSOFTKEYS_H #define RDSOFTKEYS_H -#include -#include +#include +#include +#include // // Settings @@ -44,11 +45,11 @@ class MainWidget : public QWidget private: QPixmap *key_icon_map; - Q3SocketDevice *key_socket; - unsigned key_columns; + QUdpSocket *key_socket; + int key_columns; unsigned key_ysize; - std::vector key_macros; - std::vector key_addrs; + QStringList key_macros; + QStringList key_addrs; };