diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-08-08 18:20:28 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-08-16 12:13:28 +0200 |
commit | 9cd37337dec6c970a1fd148e92ffc43fbf409cc3 (patch) | |
tree | 97635a16a175bb4b4a1d51cedea603bc24b77d7d /rbutil/rbutilqt | |
parent | b1332d974aa065e3c2a01408625d7c2c5b7fc77c (diff) |
rbutil: Fix various warnings.
Replace use of deprecated APIs with their replacements, and fix some
other minor warnings.
Change-Id: I3f63e0bd91b96ce86ce39c087fe0040fc226d16d
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r-- | rbutil/rbutilqt/base/encoderexe.cpp | 2 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/system.cpp | 6 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/system.h | 3 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/utils.cpp | 2 | ||||
-rw-r--r-- | rbutil/rbutilqt/configure.cpp | 4 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 2 | ||||
-rw-r--r-- | rbutil/rbutilqt/sysinfo.cpp | 2 |
7 files changed, 11 insertions, 10 deletions
diff --git a/rbutil/rbutilqt/base/encoderexe.cpp b/rbutil/rbutilqt/base/encoderexe.cpp index f56cf368eb..81315691e5 100644 --- a/rbutil/rbutilqt/base/encoderexe.cpp +++ b/rbutil/rbutilqt/base/encoderexe.cpp @@ -78,7 +78,7 @@ bool EncoderExe::encode(QString input,QString output) execstring.replace("%output",output); LOG_INFO() << "cmd: " << execstring; int result = QProcess::execute(execstring); - return (result == 0) ? true : false; + return result == 0; } diff --git a/rbutil/rbutilqt/base/system.cpp b/rbutil/rbutilqt/base/system.cpp index c33a172eeb..73f5024fa2 100644 --- a/rbutil/rbutilqt/base/system.cpp +++ b/rbutil/rbutilqt/base/system.cpp @@ -235,9 +235,9 @@ QList<uint32_t> System::listUsbIds(void) /** @brief detect devices based on usb pid / vid. * @return list with usb VID / PID values. */ -QMap<uint32_t, QString> System::listUsbDevices(void) +QMultiMap<uint32_t, QString> System::listUsbDevices(void) { - QMap<uint32_t, QString> usbids; + QMultiMap<uint32_t, QString> usbids; // usb pid detection LOG_INFO() << "Searching for USB devices"; #if defined(Q_OS_LINUX) @@ -272,7 +272,7 @@ QMap<uint32_t, QString> System::listUsbDevices(void) if(name.isEmpty()) name = tr("(no description available)"); if(id) { - usbids.insertMulti(id, name); + usbids.insert(id, name); LOG_INFO("USB: 0x%08x, %s", id, name.toLocal8Bit().data()); } } diff --git a/rbutil/rbutilqt/base/system.h b/rbutil/rbutilqt/base/system.h index 1d2deef170..61f0a6f1a9 100644 --- a/rbutil/rbutilqt/base/system.h +++ b/rbutil/rbutilqt/base/system.h @@ -26,6 +26,7 @@ #include <inttypes.h> +#include <QMultiMap> #include <QString> #include <QUrl> @@ -43,7 +44,7 @@ public: static QString userName(void); static QString osVersionString(void); static QList<uint32_t> listUsbIds(void); - static QMap<uint32_t, QString> listUsbDevices(void); + static QMultiMap<uint32_t, QString> listUsbDevices(void); static QUrl systemProxy(void); diff --git a/rbutil/rbutilqt/base/utils.cpp b/rbutil/rbutilqt/base/utils.cpp index 1f855beea7..e185effe2b 100644 --- a/rbutil/rbutilqt/base/utils.cpp +++ b/rbutil/rbutilqt/base/utils.cpp @@ -23,7 +23,7 @@ #include "systeminfo.h" #include "Logger.h" -#ifdef UNICODE +#if !defined(_UNICODE) #define _UNICODE #endif diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp index cc8b0ff976..ab0281774d 100644 --- a/rbutil/rbutilqt/configure.cpp +++ b/rbutil/rbutilqt/configure.cpp @@ -350,12 +350,12 @@ void Config::setDevices() else platformList = SystemInfo::platforms(SystemInfo::PlatformAll); - QMap <QString, QString> manuf; + QMultiMap <QString, QString> manuf; for(int it = 0; it < platformList.size(); it++) { QString curbrand = SystemInfo::platformValue(platformList.at(it), SystemInfo::CurBrand).toString(); - manuf.insertMulti(curbrand, platformList.at(it)); + manuf.insert(curbrand, platformList.at(it)); } // set up devices table diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 8f4ee582d5..5a39e8ab9a 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp @@ -55,7 +55,7 @@ #include <stdio.h> #endif #if defined(Q_OS_WIN32) -#if defined(UNICODE) +#if !defined(_UNICODE) #define _UNICODE #endif #include <stdio.h> diff --git a/rbutil/rbutilqt/sysinfo.cpp b/rbutil/rbutilqt/sysinfo.cpp index 0bb5465240..75ade2438f 100644 --- a/rbutil/rbutilqt/sysinfo.cpp +++ b/rbutil/rbutilqt/sysinfo.cpp @@ -48,7 +48,7 @@ QString Sysinfo::getInfo(Sysinfo::InfoType type) info += tr("<b>Permissions</b><br/>%1<hr/>").arg(System::userPermissionsString()); #endif info += tr("<b>Attached USB devices</b><br/>"); - QMap<uint32_t, QString> usbids = System::listUsbDevices(); + QMultiMap<uint32_t, QString> usbids = System::listUsbDevices(); QList<uint32_t> usbkeys = usbids.keys(); for(int i = 0; i < usbkeys.size(); i++) { info += tr("VID: %1 PID: %2, %3") |