mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Remove old duplicated code
Way back in time this code was copied from downloadfromdcthread, so de-duplicate and call that code instead. Signed-off-by: Anton Lundin <glance@acc.umu.se>
This commit is contained in:
parent
996fda1fa1
commit
2fa7e86708
2 changed files with 2 additions and 51 deletions
|
@ -5,6 +5,8 @@
|
|||
#include "desktop-widgets/mainwindow.h"
|
||||
#include "core/display.h"
|
||||
#include "core/subsurface-qt/SettingsObjectWrapper.h"
|
||||
// For fill_computer_list, descriptorLookup
|
||||
#include "core/downloadfromdcthread.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
|
@ -12,13 +14,6 @@
|
|||
#include <QNetworkReply>
|
||||
#include <QProgressDialog>
|
||||
|
||||
struct mydescriptor {
|
||||
const char *vendor;
|
||||
const char *product;
|
||||
dc_family_t type;
|
||||
unsigned int model;
|
||||
};
|
||||
|
||||
GasSpinBoxItemDelegate::GasSpinBoxItemDelegate(QObject *parent, column_type type) : QStyledItemDelegate(parent), type(type)
|
||||
{
|
||||
}
|
||||
|
@ -417,45 +412,6 @@ void ConfigureDiveComputerDialog::fill_device_list(int dc_type)
|
|||
ui.device->setCurrentIndex(deviceIndex);
|
||||
}
|
||||
|
||||
void ConfigureDiveComputerDialog::fill_computer_list()
|
||||
{
|
||||
dc_iterator_t *iterator = NULL;
|
||||
dc_descriptor_t *descriptor = NULL;
|
||||
|
||||
struct mydescriptor *mydescriptor;
|
||||
|
||||
dc_descriptor_iterator(&iterator);
|
||||
while (dc_iterator_next(iterator, &descriptor) == DC_STATUS_SUCCESS) {
|
||||
const char *vendor = dc_descriptor_get_vendor(descriptor);
|
||||
const char *product = dc_descriptor_get_product(descriptor);
|
||||
|
||||
if (!vendorList.contains(vendor))
|
||||
vendorList.append(vendor);
|
||||
|
||||
if (!productList[vendor].contains(product))
|
||||
productList[vendor].push_back(product);
|
||||
|
||||
descriptorLookup[QString(vendor) + QString(product)] = descriptor;
|
||||
}
|
||||
dc_iterator_free(iterator);
|
||||
|
||||
mydescriptor = (struct mydescriptor *)malloc(sizeof(struct mydescriptor));
|
||||
mydescriptor->vendor = "Uemis";
|
||||
mydescriptor->product = "Zurich";
|
||||
mydescriptor->type = DC_FAMILY_NULL;
|
||||
mydescriptor->model = 0;
|
||||
|
||||
if (!vendorList.contains("Uemis"))
|
||||
vendorList.append("Uemis");
|
||||
|
||||
if (!productList["Uemis"].contains("Zurich"))
|
||||
productList["Uemis"].push_back("Zurich");
|
||||
|
||||
descriptorLookup["UemisZurich"] = (dc_descriptor_t *)mydescriptor;
|
||||
|
||||
qSort(vendorList);
|
||||
}
|
||||
|
||||
void ConfigureDiveComputerDialog::populateDeviceDetails()
|
||||
{
|
||||
switch (ui.dcStackedWidget->currentIndex()) {
|
||||
|
|
|
@ -98,16 +98,11 @@ private:
|
|||
|
||||
QString logFile;
|
||||
|
||||
QStringList vendorList;
|
||||
QHash<QString, QStringList> productList;
|
||||
|
||||
ConfigureDiveComputer *config;
|
||||
device_data_t device_data;
|
||||
void getDeviceData();
|
||||
|
||||
QHash<QString, dc_descriptor_t *> descriptorLookup;
|
||||
void fill_device_list(int dc_type);
|
||||
void fill_computer_list();
|
||||
|
||||
DeviceDetails *deviceDetails;
|
||||
void populateDeviceDetails();
|
||||
|
|
Loading…
Reference in a new issue