mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-01 16:13:57 -04:00
0d8772f25a
Make WSPRnet.org spot uploads tolerant of network issues, spots still get discarded for any period that has problems but now uploading resumes on the next period. Ensure that decoded text starts with correct font by not using the base class append method directly. Fixed a major memory leak in the WSPRNet class which was not freeing processed request reply objects. Added some helpful debug prints in WSPRnet.org spot processing. Also tidied up a number of class implementations that were not including he MOC generated code. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5560 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
#ifndef WSPRNET_H
|
|
#define WSPRNET_H
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <QList>
|
|
#include <QHash>
|
|
#include <QQueue>
|
|
|
|
class QNetworkAccessManager;
|
|
class QTimer;
|
|
class QNetworkReply;
|
|
|
|
class WSPRNet : public QObject
|
|
{
|
|
Q_OBJECT;
|
|
|
|
public:
|
|
explicit WSPRNet(QObject *parent = nullptr);
|
|
void upload(QString const& call, QString const& grid, QString const& rfreq, QString const& tfreq,
|
|
QString const& mode, QString const& tpct, QString const& dbm, QString const& version,
|
|
QString const& fileName);
|
|
static bool decodeLine(QString const& line, QHash<QString,QString> &query);
|
|
|
|
signals:
|
|
void uploadStatus(QString);
|
|
|
|
public slots:
|
|
void networkReply(QNetworkReply *);
|
|
void work();
|
|
void abortOutstandingRequests ();
|
|
|
|
private:
|
|
QNetworkAccessManager *networkManager;
|
|
QList<QNetworkReply *> m_outstandingRequests;
|
|
QString m_call, m_grid, m_rfreq, m_tfreq, m_mode, m_tpct, m_dbm, m_vers, m_file;
|
|
QQueue<QString> urlQueue;
|
|
QTimer *uploadTimer;
|
|
int m_urlQueueSize;
|
|
int m_uploadType;
|
|
|
|
QString urlEncodeNoSpot();
|
|
QString urlEncodeSpot(QHash<QString,QString> const& spot);
|
|
};
|
|
|
|
#endif // WSPRNET_H
|