Skip to content

Commit

Permalink
refactor: use QStringLiteral() & arg() to concatenate strings (#21)
Browse files Browse the repository at this point in the history
* refactor: use QStringLiteral() & arg() to concatenate strings

* Update actions/upload-artifact to fix workflow
  • Loading branch information
Integral-Tech authored Oct 28, 2024
1 parent e3afad2 commit 83e5a60
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions qefientryview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,16 @@ QEFIEntryView::QEFIEntryView(QWidget *parent)
for (int i = 0; i < m_order.size(); i++) {
if (m_entryItems.contains(m_order[i])) {
QEFIEntry &entry = m_entryItems[m_order[i]];
m_entries->addItem(QString::asprintf("[%04X] ", entry.id()) + entry.name()
+ (entry.devicePath().size() > 0 ? "\n" + entry.devicePath() : ""));
QString item = QStringLiteral("[%1] %2")
.arg(entry.id(), 4, 16, QLatin1Char('0'))
.arg(entry.name());

if (entry.devicePath().size() > 0) {
item.append('\n').append(entry.devicePath());
}

m_entries->addItem(item);

// Get the activation state
QListWidgetItem *currentItem = m_entries->item(i);
if (currentItem && !entry.isActive()) {
Expand Down Expand Up @@ -138,8 +146,15 @@ void QEFIEntryView::resetClicked(bool checked)
for (int i = 0; i < m_order.size(); i++) {
if (m_entryItems.contains(m_order[i])) {
QEFIEntry &entry = m_entryItems[m_order[i]];
m_entries->addItem(QString::asprintf("[%04X] ", entry.id()) + entry.name()
+ (entry.devicePath().size() > 0 ? "\n" + entry.devicePath() : ""));
QString item = QStringLiteral("[%1] %2")
.arg(entry.id(), 4, 16, QLatin1Char('0'))
.arg(entry.name());

if (entry.devicePath().size() > 0) {
item.append('\n').append(entry.devicePath());
}

m_entries->addItem(item);
}
}
updateButtonState();
Expand Down

0 comments on commit 83e5a60

Please sign in to comment.