forked from len0rd/rockbox
rbutil: Fix various warnings.
Replace use of deprecated APIs with their replacements, and fix some other minor warnings. Change-Id: I3f63e0bd91b96ce86ce39c087fe0040fc226d16d
This commit is contained in:
parent
b1332d974a
commit
9cd37337de
7 changed files with 11 additions and 10 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "systeminfo.h"
|
||||
#include "Logger.h"
|
||||
|
||||
#ifdef UNICODE
|
||||
#if !defined(_UNICODE)
|
||||
#define _UNICODE
|
||||
#endif
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue