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);
|
execstring.replace("%output",output);
|
||||||
LOG_INFO() << "cmd: " << execstring;
|
LOG_INFO() << "cmd: " << execstring;
|
||||||
int result = QProcess::execute(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.
|
/** @brief detect devices based on usb pid / vid.
|
||||||
* @return list with usb VID / PID values.
|
* @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
|
// usb pid detection
|
||||||
LOG_INFO() << "Searching for USB devices";
|
LOG_INFO() << "Searching for USB devices";
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
|
@ -272,7 +272,7 @@ QMap<uint32_t, QString> System::listUsbDevices(void)
|
||||||
if(name.isEmpty())
|
if(name.isEmpty())
|
||||||
name = tr("(no description available)");
|
name = tr("(no description available)");
|
||||||
if(id) {
|
if(id) {
|
||||||
usbids.insertMulti(id, name);
|
usbids.insert(id, name);
|
||||||
LOG_INFO("USB: 0x%08x, %s", id, name.toLocal8Bit().data());
|
LOG_INFO("USB: 0x%08x, %s", id, name.toLocal8Bit().data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#include <QMultiMap>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ public:
|
||||||
static QString userName(void);
|
static QString userName(void);
|
||||||
static QString osVersionString(void);
|
static QString osVersionString(void);
|
||||||
static QList<uint32_t> listUsbIds(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);
|
static QUrl systemProxy(void);
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "systeminfo.h"
|
#include "systeminfo.h"
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
|
|
||||||
#ifdef UNICODE
|
#if !defined(_UNICODE)
|
||||||
#define _UNICODE
|
#define _UNICODE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -350,12 +350,12 @@ void Config::setDevices()
|
||||||
else
|
else
|
||||||
platformList = SystemInfo::platforms(SystemInfo::PlatformAll);
|
platformList = SystemInfo::platforms(SystemInfo::PlatformAll);
|
||||||
|
|
||||||
QMap <QString, QString> manuf;
|
QMultiMap <QString, QString> manuf;
|
||||||
for(int it = 0; it < platformList.size(); it++)
|
for(int it = 0; it < platformList.size(); it++)
|
||||||
{
|
{
|
||||||
QString curbrand = SystemInfo::platformValue(platformList.at(it),
|
QString curbrand = SystemInfo::platformValue(platformList.at(it),
|
||||||
SystemInfo::CurBrand).toString();
|
SystemInfo::CurBrand).toString();
|
||||||
manuf.insertMulti(curbrand, platformList.at(it));
|
manuf.insert(curbrand, platformList.at(it));
|
||||||
}
|
}
|
||||||
|
|
||||||
// set up devices table
|
// set up devices table
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
#if defined(Q_OS_WIN32)
|
#if defined(Q_OS_WIN32)
|
||||||
#if defined(UNICODE)
|
#if !defined(_UNICODE)
|
||||||
#define _UNICODE
|
#define _UNICODE
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
@ -48,7 +48,7 @@ QString Sysinfo::getInfo(Sysinfo::InfoType type)
|
||||||
info += tr("<b>Permissions</b><br/>%1<hr/>").arg(System::userPermissionsString());
|
info += tr("<b>Permissions</b><br/>%1<hr/>").arg(System::userPermissionsString());
|
||||||
#endif
|
#endif
|
||||||
info += tr("<b>Attached USB devices</b><br/>");
|
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();
|
QList<uint32_t> usbkeys = usbids.keys();
|
||||||
for(int i = 0; i < usbkeys.size(); i++) {
|
for(int i = 0; i < usbkeys.size(); i++) {
|
||||||
info += tr("VID: %1 PID: %2, %3")
|
info += tr("VID: %1 PID: %2, %3")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue