Skip to content

Commit

Permalink
🧹 drivers: refactor a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
vnepogodin committed Apr 29, 2024
1 parent 2eab619 commit b5253b2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/drivers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ using namespace std::string_view_literals;
#include "follow_process_log.hpp"
#endif

namespace tui {
namespace {

static void setup_graphics_card() noexcept {
void setup_graphics_card() noexcept {

Check failure on line 26 in src/drivers.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

/src/drivers.cpp:26:6 [bugprone-exception-escape

an exception may be thrown in function 'setup_graphics_card' which should not throw exceptions
std::string driver{};

/// TODO(vnepogodin): parse toml DBs
Expand All @@ -42,7 +42,7 @@ static void setup_graphics_card() noexcept {
driver = radiobox_list[static_cast<size_t>(selected)];
screen.ExitLoopClosure()();
};
detail::radiolist_widget(radiobox_list, ok_callback, &selected, &screen, {.text = use_spacebar}, {.text_size = nothing});
tui::detail::radiolist_widget(radiobox_list, ok_callback, &selected, &screen, {.text = use_spacebar}, {.text_size = nothing});
}
/* clang-format off */
if (driver.empty()) { return; }
Expand All @@ -62,7 +62,7 @@ static void setup_graphics_card() noexcept {
#endif
}

static void install_graphics_menu() noexcept {
void install_graphics_menu() noexcept {

Check failure on line 65 in src/drivers.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

/src/drivers.cpp:65:6 [bugprone-exception-escape

an exception may be thrown in function 'install_graphics_menu' which should not throw exceptions
[[maybe_unused]] auto* config_instance = Config::instance();
[[maybe_unused]] auto& config_data = config_instance->data();
[[maybe_unused]] const auto& mountpoint = std::get<std::string>(config_data["MOUNTPOINT"]);
Expand Down Expand Up @@ -96,9 +96,13 @@ static void install_graphics_menu() noexcept {
break;
}
};
detail::menu_widget(menu_entries, ok_callback, &selected, &screen);
tui::detail::menu_widget(menu_entries, ok_callback, &selected, &screen);
}

} // namespace

namespace tui {

void install_drivers_menu() noexcept {

Check failure on line 106 in src/drivers.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

/src/drivers.cpp:106:6 [bugprone-exception-escape

an exception may be thrown in function 'install_drivers_menu' which should not throw exceptions
const std::vector<std::string> menu_entries = {
"Install Display Driver",
Expand Down

0 comments on commit b5253b2

Please sign in to comment.