Skip to content

Commit

Permalink
Temporarilly remove device path stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Inokinoki committed Jul 3, 2021
1 parent 9c26f2d commit 10649ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
22 changes: 0 additions & 22 deletions qefientry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

#include <QDebug>

extern "C" {
#include <efivar/efivar.h>
#include <efivar/efiboot-loadopt.h>
#include <efivar/efivar-dp.h>
}

QString QEFIEntry::name() const
{
return m_name;
Expand Down Expand Up @@ -42,22 +36,6 @@ QEFIEntry::QEFIEntry(quint16 id, QByteArray boot_data)
}
}
m_name = entry_name;

// TODO: Move these code to qefi, add support for Windows
char text_path[4096];
size_t text_path_len = 4096;
uint16_t pathlen;
ssize_t rc;
efidp dp = NULL;

efi_load_option *load_option = (efi_load_option *)boot_data.data();
pathlen = efi_loadopt_pathlen(load_option, boot_data.size());
dp = efi_loadopt_path(load_option, boot_data.size());
rc = efidp_format_device_path(text_path, text_path_len, dp, pathlen);
qDebug() << "[" << rc << "]" << text_path;
if (rc > 0) {
m_devicePath = QString(text_path);
}
}

QEFIEntry::QEFIEntry() {}
3 changes: 2 additions & 1 deletion qefientryrebootview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ QEFIEntryRebootView::QEFIEntryRebootView(QWidget *parent)
m_rebootItemIndex = -1;
for (int i = 0; i < m_entryIds.size(); i++) {
QEFIEntry &entry = m_entryItems[m_entryIds[i]];
m_entries->addItem(QString::asprintf("[%04X] ", entry.id()) + entry.name() + "\n" + entry.devicePath());
m_entries->addItem(QString::asprintf("[%04X] ", entry.id()) + entry.name()
+ (entry.devicePath().size() > 0 ? "\n" + entry.devicePath().size() : ""));
}
QObject::connect(m_entries, &QListWidget::currentRowChanged,
this, &QEFIEntryRebootView::entryChanged);
Expand Down
3 changes: 2 additions & 1 deletion qefientryview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ 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() + "\n" + entry.devicePath());
m_entries->addItem(QString::asprintf("[%04X] ", entry.id()) + entry.name()
+ (entry.devicePath().size() > 0 ? "\n" + entry.devicePath().size() : ""));
}
}
QObject::connect(m_entries, &QListWidget::currentRowChanged,
Expand Down

0 comments on commit 10649ab

Please sign in to comment.