mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
Fix clazy-range-loop-detachs and other clazy complaints
This commit is contained in:
parent
8837d7e897
commit
152831e72f
5 changed files with 11 additions and 9 deletions
|
@ -77,7 +77,7 @@ size_t DownloadStatsTelemetry::_curl_write_callback(char *, size_t size, size_t
|
||||||
size_t DownloadStatsTelemetry::_curl_header_callback( void *ptr, size_t size, size_t nmemb, void *)
|
size_t DownloadStatsTelemetry::_curl_header_callback( void *ptr, size_t size, size_t nmemb, void *)
|
||||||
{
|
{
|
||||||
int len = size*nmemb;
|
int len = size*nmemb;
|
||||||
QByteArray headerstr((char *) ptr, len);
|
//QByteArray headerstr((char *) ptr, len);
|
||||||
//qDebug() << "Received telemetry header:" << headerstr;
|
//qDebug() << "Received telemetry header:" << headerstr;
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1012,7 +1012,7 @@ bool DownloadThread::_customizeImage()
|
||||||
f.close();
|
f.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const QByteArray& item : configItems)
|
for (const QByteArray& item : qAsConst(configItems))
|
||||||
{
|
{
|
||||||
if (config.contains("#"+item)) {
|
if (config.contains("#"+item)) {
|
||||||
/* Uncomment existing line */
|
/* Uncomment existing line */
|
||||||
|
|
|
@ -60,8 +60,8 @@ namespace Drivelist
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonDocument d = QJsonDocument::fromJson(output);
|
QJsonDocument d = QJsonDocument::fromJson(output);
|
||||||
QJsonArray a = d.object()["blockdevices"].toArray();
|
const QJsonArray a = d.object()["blockdevices"].toArray();
|
||||||
for (auto i : a)
|
for (const auto &i : a)
|
||||||
{
|
{
|
||||||
DeviceDescriptor d;
|
DeviceDescriptor d;
|
||||||
QJsonObject bdev = i.toObject();
|
QJsonObject bdev = i.toObject();
|
||||||
|
|
|
@ -56,7 +56,7 @@ QString UDisks2Api::_resolveDevice(const QString &device)
|
||||||
if (!manager.isValid() || !list.isValid() || list.value().isEmpty())
|
if (!manager.isValid() || !list.isValid() || list.value().isEmpty())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
return list.value().first().path();
|
return list.value().constFirst().path();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UDisks2Api::_unmountDrive(const QString &driveDbusPath)
|
void UDisks2Api::_unmountDrive(const QString &driveDbusPath)
|
||||||
|
@ -66,12 +66,13 @@ void UDisks2Api::_unmountDrive(const QString &driveDbusPath)
|
||||||
QDBusInterface manager("org.freedesktop.UDisks2", "/org/freedesktop/UDisks2/Manager",
|
QDBusInterface manager("org.freedesktop.UDisks2", "/org/freedesktop/UDisks2/Manager",
|
||||||
"org.freedesktop.UDisks2.Manager", QDBusConnection::systemBus());
|
"org.freedesktop.UDisks2.Manager", QDBusConnection::systemBus());
|
||||||
QVariantMap options;
|
QVariantMap options;
|
||||||
QDBusReply<QList<QDBusObjectPath>> list = manager.call("GetBlockDevices", options);
|
const QDBusReply<QList<QDBusObjectPath>> list = manager.call("GetBlockDevices", options);
|
||||||
|
|
||||||
if (!manager.isValid() || !list.isValid())
|
if (!manager.isValid() || !list.isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (const auto& devpath : list.value())
|
const auto listValue = list.value();
|
||||||
|
for (const auto& devpath : listValue)
|
||||||
{
|
{
|
||||||
QString devpathStr = devpath.path();
|
QString devpathStr = devpath.path();
|
||||||
|
|
||||||
|
@ -263,7 +264,8 @@ QByteArrayList UDisks2Api::mountPoints(const QDBusInterface &filesystem)
|
||||||
QVariantList args = {"org.freedesktop.UDisks2.Filesystem", "MountPoints"};
|
QVariantList args = {"org.freedesktop.UDisks2.Filesystem", "MountPoints"};
|
||||||
msg.setArguments(args);
|
msg.setArguments(args);
|
||||||
QDBusMessage reply = QDBusConnection::systemBus().call(msg);
|
QDBusMessage reply = QDBusConnection::systemBus().call(msg);
|
||||||
for (const auto& arg : reply.arguments())
|
const auto replyArgs = reply.arguments();
|
||||||
|
for (const auto& arg : replyArgs)
|
||||||
{
|
{
|
||||||
arg.value<QDBusVariant>().variant().value<QDBusArgument>() >> mps;
|
arg.value<QDBusVariant>().variant().value<QDBusArgument>() >> mps;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,6 @@ int main(int argc, char *argv[])
|
||||||
ImageWriter imageWriter;
|
ImageWriter imageWriter;
|
||||||
NetworkAccessManagerFactory namf;
|
NetworkAccessManagerFactory namf;
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
QTranslator *translator = new QTranslator;
|
|
||||||
QString customQm;
|
QString customQm;
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
|
@ -206,6 +205,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QTranslator *translator = new QTranslator;
|
||||||
if (customQm.isEmpty())
|
if (customQm.isEmpty())
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_DARWIN
|
#ifdef Q_OS_DARWIN
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue