mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 07:55:21 +01:00
qt6: Replace qAsConst() usage
This commit is contained in:
parent
da720afc7e
commit
df33637d32
2 changed files with 5 additions and 5 deletions
|
@ -134,7 +134,7 @@ uint32_t DeviceWrapperFatPartition::allocateCluster(uint32_t previousCluster)
|
||||||
void DeviceWrapperFatPartition::setFAT16(uint16_t cluster, uint16_t value)
|
void DeviceWrapperFatPartition::setFAT16(uint16_t cluster, uint16_t value)
|
||||||
{
|
{
|
||||||
/* Modify all FATs (usually 2) */
|
/* Modify all FATs (usually 2) */
|
||||||
for (auto fatStart : qAsConst(_fatStartOffset))
|
for (auto fatStart : std::as_const(_fatStartOffset))
|
||||||
{
|
{
|
||||||
seek(fatStart + cluster * 2);
|
seek(fatStart + cluster * 2);
|
||||||
write((char *) &value, 2);
|
write((char *) &value, 2);
|
||||||
|
@ -146,7 +146,7 @@ void DeviceWrapperFatPartition::setFAT32(uint32_t cluster, uint32_t value)
|
||||||
uint32_t prev_value, reserved_bits;
|
uint32_t prev_value, reserved_bits;
|
||||||
|
|
||||||
/* Modify all FATs (usually 2) */
|
/* Modify all FATs (usually 2) */
|
||||||
for (auto fatStart : qAsConst(_fatStartOffset))
|
for (auto fatStart : std::as_const(_fatStartOffset))
|
||||||
{
|
{
|
||||||
/* Spec (p. 16) mentions we must preserve high 4 bits of FAT32 FAT entry when modifiying */
|
/* Spec (p. 16) mentions we must preserve high 4 bits of FAT32 FAT entry when modifiying */
|
||||||
seek(fatStart + cluster * 4);
|
seek(fatStart + cluster * 4);
|
||||||
|
@ -234,7 +234,7 @@ QByteArray DeviceWrapperFatPartition::readFile(const QString &filename)
|
||||||
uint32_t len = entry.DIR_FileSize, pos = 0;
|
uint32_t len = entry.DIR_FileSize, pos = 0;
|
||||||
QByteArray result(len, 0);
|
QByteArray result(len, 0);
|
||||||
|
|
||||||
for (uint32_t cluster : qAsConst(clusterList))
|
for (uint32_t cluster : std::as_const(clusterList))
|
||||||
{
|
{
|
||||||
seekCluster(cluster);
|
seekCluster(cluster);
|
||||||
read(result.data()+pos, qMin(_bytesPerCluster, len-pos));
|
read(result.data()+pos, qMin(_bytesPerCluster, len-pos));
|
||||||
|
@ -311,7 +311,7 @@ void DeviceWrapperFatPartition::writeFile(const QString &filename, const QByteAr
|
||||||
//qDebug() << "First cluster:" << firstCluster << "Clusters:" << clusterList;
|
//qDebug() << "First cluster:" << firstCluster << "Clusters:" << clusterList;
|
||||||
|
|
||||||
/* Write file data */
|
/* Write file data */
|
||||||
for (uint32_t cluster : qAsConst(clusterList))
|
for (uint32_t cluster : std::as_const(clusterList))
|
||||||
{
|
{
|
||||||
seekCluster(cluster);
|
seekCluster(cluster);
|
||||||
write(contents.data()+pos, qMin((qsizetype)_bytesPerCluster, (qsizetype)(contents.length()-pos)));
|
write(contents.data()+pos, qMin((qsizetype)_bytesPerCluster, (qsizetype)(contents.length()-pos)));
|
||||||
|
|
|
@ -921,7 +921,7 @@ bool DownloadThread::_customizeImage()
|
||||||
configItems.removeAll("");
|
configItems.removeAll("");
|
||||||
QByteArray config = fat->readFile("config.txt");
|
QByteArray config = fat->readFile("config.txt");
|
||||||
|
|
||||||
for (const QByteArray& item : qAsConst(configItems))
|
for (const QByteArray& item : std::as_const(configItems))
|
||||||
{
|
{
|
||||||
if (config.contains("#"+item)) {
|
if (config.contains("#"+item)) {
|
||||||
/* Uncomment existing line */
|
/* Uncomment existing line */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue