diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/downloadfromdcthread.cpp | 12 | ||||
-rw-r--r-- | core/downloadfromdcthread.h | 1 |
2 files changed, 2 insertions, 11 deletions
diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index 8e937346d..ec0705cc1 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -24,7 +24,6 @@ static QString str_error(const char *fmt, ...) return str; } - static void updateRememberedDCs() { QString current = qPrefDiveComputer::vendor() + " - " + qPrefDiveComputer::product() + " - " + qPrefDiveComputer::device(); @@ -254,7 +253,6 @@ void show_computer_list() qDebug() << msg; } } -DCDeviceData *DCDeviceData::m_instance = NULL; DCDeviceData::DCDeviceData() { @@ -276,18 +274,12 @@ DCDeviceData::DCDeviceData() #else data.libdc_log = false; #endif - if (m_instance) { - qDebug() << "already have an instance of DCDevieData"; - return; - } - m_instance = this; } DCDeviceData *DCDeviceData::instance() { - if (!m_instance) - m_instance = new DCDeviceData; - return m_instance; + static DCDeviceData self; + return &self; } QStringList DCDeviceData::getProductListFromVendor(const QString &vendor) diff --git a/core/downloadfromdcthread.h b/core/downloadfromdcthread.h index 3e2d7ddc0..1ae6a4087 100644 --- a/core/downloadfromdcthread.h +++ b/core/downloadfromdcthread.h @@ -51,7 +51,6 @@ public: void setSaveDump(bool dumpMode); void setSaveLog(bool saveLog); private: - static DCDeviceData *m_instance; device_data_t data; // Bluetooth name is managed outside of libdivecomputer |