Skip to content

Commit

Permalink
refactor: use QStringLiteral() & arg() to concatenate strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Integral-Tech authored and Inokinoki committed Oct 28, 2024
1 parent fa271d7 commit 303cdfb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions qefi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,8 +892,8 @@ quint16 qefi_get_variable_uint16(QUuid uuid, QString name)
QString dir;
if (dummy_backend_get_dir(dir)) {
QDir storedDir(dir);
QString filename = storedDir.absoluteFilePath(uuid.toString(QUuid::WithoutBraces)
+ name + QStringLiteral(".bin"));
QString filename = storedDir.absoluteFilePath(
QStringLiteral("%1%2.bin").arg(uuid.toString(QUuid::WithoutBraces), name));

qDebug() << filename;
QFile file(filename);
Expand All @@ -918,8 +918,8 @@ QByteArray qefi_get_variable(QUuid uuid, QString name)
QString dir;
if (dummy_backend_get_dir(dir)) {
QDir storedDir(dir);
QString filename = storedDir.absoluteFilePath(uuid.toString(QUuid::WithoutBraces)
+ name + QStringLiteral(".bin"));
QString filename = storedDir.absoluteFilePath(
QStringLiteral("%1%2.bin").arg(uuid.toString(QUuid::WithoutBraces), name));

qDebug() << filename;
QFile file(filename);
Expand All @@ -938,8 +938,8 @@ void qefi_set_variable_uint16(QUuid uuid, QString name, quint16 value)
QString dir;
if (dummy_backend_get_dir(dir)) {
QDir storedDir(dir);
QString filename = storedDir.absoluteFilePath(uuid.toString(QUuid::WithoutBraces)
+ name + QStringLiteral(".bin"));
QString filename = storedDir.absoluteFilePath(
QStringLiteral("%1%2.bin").arg(uuid.toString(QUuid::WithoutBraces), name));

QByteArray data;
data.append((const char)(value & 0xFF));
Expand All @@ -957,8 +957,8 @@ void qefi_set_variable(QUuid uuid, QString name, QByteArray value)
QString dir;
if (dummy_backend_get_dir(dir)) {
QDir storedDir(dir);
QString filename = storedDir.absoluteFilePath(uuid.toString(QUuid::WithoutBraces)
+ name + QStringLiteral(".bin"));
QString filename = storedDir.absoluteFilePath(
QStringLiteral("%1%2.bin").arg(uuid.toString(QUuid::WithoutBraces), name));

qDebug() << filename;
QFile file(filename);
Expand Down

0 comments on commit 303cdfb

Please sign in to comment.