2018-02-06 Fred Gleason <fredg@paravelsystems.com>

* Refactored the RDPeaksExport class to use RDApplication.
This commit is contained in:
Fred Gleason
2018-02-06 06:54:12 -05:00
parent 6c976c71d7
commit 56ed436dc4
5 changed files with 15 additions and 19 deletions

View File

@@ -2,7 +2,7 @@
//
// Export peak data using the RdXport Web Service
//
// (C) Copyright 2010,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2010,2016-2018 Fred Gleason <fredg@paravelsystems.com>
//
// 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
@@ -32,10 +32,11 @@
#include <qapplication.h>
#include <qobject.h>
#include <rd.h>
#include <rdxport_interface.h>
#include <rdformpost.h>
#include <rdpeaksexport.h>
#include "rd.h"
#include "rdapplication.h"
#include "rdxport_interface.h"
#include "rdformpost.h"
#include "rdpeaksexport.h"
//
// LibCURL Write Callback
@@ -63,11 +64,8 @@ RDPeaksExport::~RDPeaksExport()
}
RDPeaksExport::RDPeaksExport(RDStation *station,RDConfig *config,
QObject *parent)
RDPeaksExport::RDPeaksExport(QObject *parent)
{
conv_station=station;
conv_config=config;
conv_cart_number=0;
conv_cut_number=0;
conv_energy_data=NULL;
@@ -117,14 +115,14 @@ RDPeaksExport::ErrorCode RDPeaksExport::runExport(const QString &username,
// otherwise some versions of LibCurl will throw a 'bad/illegal format'
// error.
//
strncpy(url,conv_station->webServiceUrl(conv_config),1024);
strncpy(url,rda->station()->webServiceUrl(rda->config()),1024);
curl_easy_setopt(curl,CURLOPT_URL,url);
curl_easy_setopt(curl,CURLOPT_POST,1);
curl_easy_setopt(curl,CURLOPT_POSTFIELDS,(const char *)post);
curl_easy_setopt(curl,CURLOPT_TIMEOUT,RD_CURL_TIMEOUT);
curl_easy_setopt(curl,CURLOPT_NOPROGRESS,1);
curl_easy_setopt(curl,CURLOPT_USERAGENT,
(const char *)conv_config->userAgent());
(const char *)rda->config()->userAgent());
//curl_easy_setopt(curl,CURLOPT_VERBOSE,1);
switch((curl_err=curl_easy_perform(curl))) {