[ci skip] Remove void keyword from C++ ctors/dtors

This commit is contained in:
Pablo Curiel 2024-04-19 12:08:44 +02:00
parent de71768380
commit 6dfbb301df
20 changed files with 64 additions and 63 deletions

View File

@ -49,8 +49,8 @@ namespace nxdt::views
void layout(NVGcontext* vg, brls::Style* style, brls::FontStash* stash) override; void layout(NVGcontext* vg, brls::Style* style, brls::FontStash* stash) override;
public: public:
AboutTab(void); AboutTab();
~AboutTab(void); ~AboutTab();
}; };
} }

View File

@ -101,7 +101,7 @@ namespace nxdt::tasks
NON_COPYABLE(AsyncTask); NON_COPYABLE(AsyncTask);
NON_MOVEABLE(AsyncTask); NON_MOVEABLE(AsyncTask);
virtual ~AsyncTask(void) noexcept virtual ~AsyncTask() noexcept
{ {
/* Return right away if the task isn't running. */ /* Return right away if the task isn't running. */
if (this->getStatus() != AsyncTaskStatus::RUNNING) return; if (this->getStatus() != AsyncTaskStatus::RUNNING) return;
@ -159,7 +159,7 @@ namespace nxdt::tasks
} }
public: public:
AsyncTask(void) = default; AsyncTask() = default;
/* Cancels the task. Runs on the calling thread. */ /* Cancels the task. Runs on the calling thread. */
void cancel(void) noexcept void cancel(void) noexcept

View File

@ -42,8 +42,8 @@ namespace nxdt::views
void layout(NVGcontext* vg, brls::Style* style, brls::FontStash* stash) override; void layout(NVGcontext* vg, brls::Style* style, brls::FontStash* stash) override;
public: public:
DataTransferProgressDisplay(void); DataTransferProgressDisplay();
~DataTransferProgressDisplay(void); ~DataTransferProgressDisplay();
void setProgress(const nxdt::tasks::DataTransferProgress& progress); void setProgress(const nxdt::tasks::DataTransferProgress& progress);

View File

@ -190,13 +190,13 @@ namespace nxdt::tasks
} }
public: public:
DataTransferTask(void) DataTransferTask()
{ {
/* Create task handler. */ /* Create task handler. */
this->task_handler = new Handler(DATA_TRANSFER_TASK_INTERVAL, this); this->task_handler = new Handler(DATA_TRANSFER_TASK_INTERVAL, this);
} }
~DataTransferTask(void) ~DataTransferTask()
{ {
/* Stop task handler. Borealis' task manager will take care of deleting it. */ /* Stop task handler. Borealis' task manager will take care of deleting it. */
this->task_handler->stop(); this->task_handler->stop();

View File

@ -42,7 +42,7 @@ namespace nxdt::tasks
NON_MOVEABLE(DownloadTask); NON_MOVEABLE(DownloadTask);
public: public:
DownloadTask(void) = default; DownloadTask() = default;
/* Runs on the asynchronous task thread. Required by cURL. */ /* Runs on the asynchronous task thread. Required by cURL. */
/* Make sure to pass it to either httpDownloadFile() or httpDownloadData() with 'this' as the user pointer. */ /* Make sure to pass it to either httpDownloadFile() or httpDownloadData() with 'this' as the user pointer. */
@ -85,7 +85,7 @@ namespace nxdt::tasks
} }
public: public:
DownloadFileTask(void) = default; DownloadFileTask() = default;
}; };
/* Asynchronous task to store downloaded data into a dynamically allocated buffer using a URL. */ /* Asynchronous task to store downloaded data into a dynamically allocated buffer using a URL. */
@ -110,7 +110,7 @@ namespace nxdt::tasks
} }
public: public:
DownloadDataTask(void) = default; DownloadDataTask() = default;
}; };
} }

View File

@ -364,7 +364,7 @@ namespace nxdt::views
this->setContentView(this->list); this->setContentView(this->list);
} }
~DumpOptionsFrame(void) ~DumpOptionsFrame()
{ {
/* Unregister task listener. */ /* Unregister task listener. */
this->root_view->UnregisterUmsTaskListener(this->ums_task_sub); this->root_view->UnregisterUmsTaskListener(this->ums_task_sub);

View File

@ -41,7 +41,7 @@ namespace nxdt::views
public: public:
ErrorFrame(std::string msg = ""); ErrorFrame(std::string msg = "");
~ErrorFrame(void); ~ErrorFrame();
void SetMessage(std::string msg); void SetMessage(std::string msg);
}; };

View File

@ -50,7 +50,7 @@ namespace nxdt::views
public: public:
GameCardTab(RootView *root_view); GameCardTab(RootView *root_view);
~GameCardTab(void); ~GameCardTab();
}; };
} }

View File

@ -64,8 +64,8 @@ namespace nxdt::views
bool onCancel(void) override; bool onCancel(void) override;
public: public:
OptionsTabUpdateApplicationFrame(void); OptionsTabUpdateApplicationFrame();
~OptionsTabUpdateApplicationFrame(void); ~OptionsTabUpdateApplicationFrame();
}; };
class OptionsTab: public brls::List class OptionsTab: public brls::List
@ -73,7 +73,6 @@ namespace nxdt::views
private: private:
RootView *root_view = nullptr; RootView *root_view = nullptr;
brls::SelectListItem *unmount_ums_device = nullptr;
nxdt::tasks::UmsDeviceVector ums_devices{}; nxdt::tasks::UmsDeviceVector ums_devices{};
nxdt::tasks::UmsEvent::Subscription ums_task_sub; nxdt::tasks::UmsEvent::Subscription ums_task_sub;
@ -84,7 +83,7 @@ namespace nxdt::views
void DisplayNotification(const std::string& str); void DisplayNotification(const std::string& str);
public: public:
OptionsTab(RootView *root_view); OptionsTab(RootView *root_view);
~OptionsTab(void); ~OptionsTab();
}; };
} }

View File

@ -60,8 +60,8 @@ namespace nxdt::views
brls::View *getDefaultFocus(void) override; brls::View *getDefaultFocus(void) override;
public: public:
RootView(void); RootView();
~RootView(void); ~RootView();
static std::string GetFormattedDateString(const struct tm& timeinfo); static std::string GetFormattedDateString(const struct tm& timeinfo);

View File

@ -75,8 +75,8 @@ namespace nxdt::tasks
void run(retro_time_t current_time) override; void run(retro_time_t current_time) override;
public: public:
StatusInfoTask(void); StatusInfoTask();
~StatusInfoTask(void); ~StatusInfoTask();
bool IsInternetConnectionAvailable(void); bool IsInternetConnectionAvailable(void);
@ -97,8 +97,8 @@ namespace nxdt::tasks
void run(retro_time_t current_time) override; void run(retro_time_t current_time) override;
public: public:
GameCardTask(void); GameCardTask();
~GameCardTask(void); ~GameCardTask();
EVENT_SUBSCRIPTION(GameCardStatusEvent, gc_status_event); EVENT_SUBSCRIPTION(GameCardStatusEvent, gc_status_event);
}; };
@ -119,8 +119,8 @@ namespace nxdt::tasks
void run(retro_time_t current_time) override; void run(retro_time_t current_time) override;
public: public:
TitleTask(void); TitleTask();
~TitleTask(void); ~TitleTask();
/* Intentionally left here to let views retrieve title metadata on-demand. */ /* Intentionally left here to let views retrieve title metadata on-demand. */
const TitleApplicationMetadataVector& GetApplicationMetadata(bool is_system); const TitleApplicationMetadataVector& GetApplicationMetadata(bool is_system);
@ -146,8 +146,8 @@ namespace nxdt::tasks
void run(retro_time_t current_time) override; void run(retro_time_t current_time) override;
public: public:
UmsTask(void); UmsTask();
~UmsTask(void); ~UmsTask();
/* Intentionally left here to let views retrieve UMS device info on-demand. */ /* Intentionally left here to let views retrieve UMS device info on-demand. */
const UmsDeviceVector& GetUmsDevices(void); const UmsDeviceVector& GetUmsDevices(void);
@ -167,8 +167,8 @@ namespace nxdt::tasks
void run(retro_time_t current_time) override; void run(retro_time_t current_time) override;
public: public:
UsbHostTask(void); UsbHostTask();
~UsbHostTask(void); ~UsbHostTask();
EVENT_SUBSCRIPTION(UsbHostEvent, usb_host_event); EVENT_SUBSCRIPTION(UsbHostEvent, usb_host_event);
}; };

View File

@ -41,7 +41,7 @@ namespace nxdt::views
public: public:
TitlesTabPopup(const TitleApplicationMetadata *app_metadata, bool is_system); TitlesTabPopup(const TitleApplicationMetadata *app_metadata, bool is_system);
~TitlesTabPopup(void); ~TitlesTabPopup();
}; };
/* Expanded ListItem class to hold application metadata. */ /* Expanded ListItem class to hold application metadata. */
@ -80,7 +80,7 @@ namespace nxdt::views
public: public:
TitlesTab(RootView *root_view, bool is_system); TitlesTab(RootView *root_view, bool is_system);
~TitlesTab(void); ~TitlesTab();
}; };
} }

View File

@ -29,7 +29,7 @@ using namespace i18n::literals; /* For _i18n. */
namespace nxdt::views namespace nxdt::views
{ {
AboutTab::AboutTab(void) : brls::List() AboutTab::AboutTab() : brls::List()
{ {
/* Set custom spacing. */ /* Set custom spacing. */
this->setSpacing(this->getSpacing() / 2); this->setSpacing(this->getSpacing() / 2);
@ -69,7 +69,7 @@ namespace nxdt::views
this->addView(new AboutTabLabel(brls::LabelStyle::SMALL, i18n::getStr("about_tab/links/line_00"_i18n, DISCORD_SERVER_URL))); this->addView(new AboutTabLabel(brls::LabelStyle::SMALL, i18n::getStr("about_tab/links/line_00"_i18n, DISCORD_SERVER_URL)));
} }
AboutTab::~AboutTab(void) AboutTab::~AboutTab()
{ {
delete this->logo; delete this->logo;
} }

View File

@ -23,7 +23,7 @@
namespace nxdt::views namespace nxdt::views
{ {
DataTransferProgressDisplay::DataTransferProgressDisplay(void) DataTransferProgressDisplay::DataTransferProgressDisplay()
{ {
this->progress_display = new brls::ProgressDisplay(); this->progress_display = new brls::ProgressDisplay();
this->progress_display->setParent(this); this->progress_display->setParent(this);
@ -37,7 +37,7 @@ namespace nxdt::views
this->speed_eta_lbl->setParent(this); this->speed_eta_lbl->setParent(this);
} }
DataTransferProgressDisplay::~DataTransferProgressDisplay(void) DataTransferProgressDisplay::~DataTransferProgressDisplay()
{ {
delete this->progress_display; delete this->progress_display;
delete this->size_lbl; delete this->size_lbl;

View File

@ -33,7 +33,7 @@ namespace nxdt::views
this->label->setParent(this); this->label->setParent(this);
} }
ErrorFrame::~ErrorFrame(void) ErrorFrame::~ErrorFrame()
{ {
delete this->label; delete this->label;
} }

View File

@ -45,7 +45,7 @@ namespace nxdt::views
this->ProcessGameCardStatus(GameCardStatus_NotInserted); this->ProcessGameCardStatus(GameCardStatus_NotInserted);
} }
GameCardTab::~GameCardTab(void) GameCardTab::~GameCardTab()
{ {
/* Unregister task listener. */ /* Unregister task listener. */
this->root_view->UnregisterGameCardTaskListener(this->gc_status_task_sub); this->root_view->UnregisterGameCardTaskListener(this->gc_status_task_sub);

View File

@ -70,7 +70,7 @@ namespace nxdt::views
this->download_task.execute(path, url, force_https); this->download_task.execute(path, url, force_https);
} }
OptionsTabUpdateApplicationFrame::OptionsTabUpdateApplicationFrame(void) : brls::StagedAppletFrame(false) OptionsTabUpdateApplicationFrame::OptionsTabUpdateApplicationFrame() : brls::StagedAppletFrame(false)
{ {
/* Set UI properties. */ /* Set UI properties. */
this->setTitle("options_tab/update_app/label"_i18n); this->setTitle("options_tab/update_app/label"_i18n);
@ -138,7 +138,7 @@ namespace nxdt::views
this->json_task.execute(GITHUB_API_RELEASE_URL, true); this->json_task.execute(GITHUB_API_RELEASE_URL, true);
} }
OptionsTabUpdateApplicationFrame::~OptionsTabUpdateApplicationFrame(void) OptionsTabUpdateApplicationFrame::~OptionsTabUpdateApplicationFrame()
{ {
/* Free parsed JSON data. */ /* Free parsed JSON data. */
utilsFreeGitHubReleaseJsonData(&(this->json_data)); utilsFreeGitHubReleaseJsonData(&(this->json_data));
@ -317,17 +317,17 @@ namespace nxdt::views
this->addView(naming_convention); this->addView(naming_convention);
/* Unmount UMS devices. */ /* Unmount USB Mass Storage devices. */
/* We will replace its default click event with a new one that will: */ /* We will replace its default click event with a new one that will: */
/* 1. Check if any UMS devices are available before displaying the dropdown and display a notification if there are none. */ /* 1. Check if any UMS devices are available before displaying the dropdown and display a notification if there are none. */
/* 2. Generate the string vector required by the dropdown. */ /* 2. Generate the string vector required by the dropdown. */
/* 3. Initialize the dropdown and pass a custom callback that will take care of unmounting the selected device. */ /* 3. Initialize the dropdown and pass a custom callback that will take care of unmounting the selected device. */
this->unmount_ums_device = new brls::SelectListItem("options_tab/unmount_ums_device/label"_i18n, { "dummy" }, 0, brls::SelectListItem *unmount_ums_device = new brls::SelectListItem("options_tab/unmount_ums_device/label"_i18n, { "dummy" }, 0,
i18n::getStr("options_tab/unmount_ums_device/description"_i18n, APP_TITLE), false); i18n::getStr("options_tab/unmount_ums_device/description"_i18n, APP_TITLE), false);
this->unmount_ums_device->getClickEvent()->unsubscribeAll(); unmount_ums_device->getClickEvent()->unsubscribeAll();
this->unmount_ums_device->getClickEvent()->subscribe([this](brls::View* view) { unmount_ums_device->getClickEvent()->subscribe([this](brls::View* view) {
if (this->ums_devices.empty()) if (this->ums_devices.empty())
{ {
/* Display a notification if we haven't mounted any UMS devices at all. */ /* Display a notification if we haven't mounted any UMS devices at all. */
@ -340,7 +340,9 @@ namespace nxdt::views
for(nxdt::tasks::UmsDeviceVectorEntry ums_device_entry : this->ums_devices) values.push_back(ums_device_entry.second); for(nxdt::tasks::UmsDeviceVectorEntry ums_device_entry : this->ums_devices) values.push_back(ums_device_entry.second);
/* Display dropdown. */ /* Display dropdown. */
brls::Dropdown::open(this->unmount_ums_device->getLabel(), values, [this](int idx) { brls::SelectListItem *unmount_ums_device = static_cast<brls::SelectListItem*>(view);
brls::Dropdown::open(unmount_ums_device->getLabel(), values, [this](int idx) {
/* Make sure the current value isn't out of bounds. */ /* Make sure the current value isn't out of bounds. */
if (idx < 0 || idx >= static_cast<int>(this->ums_devices.size())) return; if (idx < 0 || idx >= static_cast<int>(this->ums_devices.size())) return;
@ -358,7 +360,7 @@ namespace nxdt::views
this->ums_devices = this->root_view->GetUmsDevices(); this->ums_devices = this->root_view->GetUmsDevices();
/* Subscribe to the UMS device event. */ /* Subscribe to the UMS device event. */
this->ums_task_sub = this->root_view->RegisterUmsTaskListener([this](const nxdt::tasks::UmsDeviceVector& ums_devices) { this->ums_task_sub = this->root_view->RegisterUmsTaskListener([this, unmount_ums_device](const nxdt::tasks::UmsDeviceVector& ums_devices) {
/* Update UMS devices vector. */ /* Update UMS devices vector. */
this->ums_devices = this->root_view->GetUmsDevices(); this->ums_devices = this->root_view->GetUmsDevices();
@ -368,7 +370,7 @@ namespace nxdt::views
/* Update SelectListItem values. */ /* Update SelectListItem values. */
/* If the dropdown menu is already being displayed, it'll be reloaded or popped from the view stack, depending on whether the provided vector is empty or not. */ /* If the dropdown menu is already being displayed, it'll be reloaded or popped from the view stack, depending on whether the provided vector is empty or not. */
this->unmount_ums_device->updateValues(values); unmount_ums_device->updateValues(values);
}); });
this->addView(unmount_ums_device); this->addView(unmount_ums_device);
@ -421,7 +423,7 @@ namespace nxdt::views
this->addView(update_app); this->addView(update_app);
} }
OptionsTab::~OptionsTab(void) OptionsTab::~OptionsTab()
{ {
this->root_view->UnregisterUmsTaskListener(this->ums_task_sub); this->root_view->UnregisterUmsTaskListener(this->ums_task_sub);

View File

@ -31,7 +31,7 @@ using namespace i18n::literals; /* For _i18n. */
namespace nxdt::views namespace nxdt::views
{ {
RootView::RootView(void) : brls::TabFrame() RootView::RootView() : brls::TabFrame()
{ {
int material = brls::Application::getFontStash()->material; int material = brls::Application::getFontStash()->material;
@ -168,7 +168,7 @@ namespace nxdt::views
}); });
} }
RootView::~RootView(void) RootView::~RootView()
{ {
/* Unregister task listeners. */ /* Unregister task listeners. */
this->usb_host_task->UnregisterListener(this->usb_host_task_sub); this->usb_host_task->UnregisterListener(this->usb_host_task_sub);

View File

@ -30,13 +30,13 @@ namespace nxdt::tasks
{ {
/* Status info task. */ /* Status info task. */
StatusInfoTask::StatusInfoTask(void) : brls::RepeatingTask(NXDT_TASK_INTERVAL) StatusInfoTask::StatusInfoTask() : brls::RepeatingTask(NXDT_TASK_INTERVAL)
{ {
brls::RepeatingTask::start(); brls::RepeatingTask::start();
LOG_MSG_DEBUG("Status info task started."); LOG_MSG_DEBUG("Status info task started.");
} }
StatusInfoTask::~StatusInfoTask(void) StatusInfoTask::~StatusInfoTask()
{ {
LOG_MSG_DEBUG("Status info task stopped."); LOG_MSG_DEBUG("Status info task stopped.");
} }
@ -84,7 +84,7 @@ namespace nxdt::tasks
/* Gamecard task. */ /* Gamecard task. */
GameCardTask::GameCardTask(void) : brls::RepeatingTask(NXDT_TASK_INTERVAL) GameCardTask::GameCardTask() : brls::RepeatingTask(NXDT_TASK_INTERVAL)
{ {
brls::RepeatingTask::start(); brls::RepeatingTask::start();
LOG_MSG_DEBUG("Gamecard task started."); LOG_MSG_DEBUG("Gamecard task started.");
@ -92,7 +92,7 @@ namespace nxdt::tasks
this->first_notification = (gamecardGetStatus() >= GameCardStatus_Processing); this->first_notification = (gamecardGetStatus() >= GameCardStatus_Processing);
} }
GameCardTask::~GameCardTask(void) GameCardTask::~GameCardTask()
{ {
LOG_MSG_DEBUG("Gamecard task stopped."); LOG_MSG_DEBUG("Gamecard task stopped.");
} }
@ -134,7 +134,7 @@ namespace nxdt::tasks
/* Title task. */ /* Title task. */
TitleTask::TitleTask(void) : brls::RepeatingTask(NXDT_TASK_INTERVAL) TitleTask::TitleTask() : brls::RepeatingTask(NXDT_TASK_INTERVAL)
{ {
/* Get system metadata entries. */ /* Get system metadata entries. */
this->PopulateApplicationMetadataVector(true); this->PopulateApplicationMetadataVector(true);
@ -147,7 +147,7 @@ namespace nxdt::tasks
LOG_MSG_DEBUG("Title task started."); LOG_MSG_DEBUG("Title task started.");
} }
TitleTask::~TitleTask(void) TitleTask::~TitleTask()
{ {
/* Clear application metadata vectors. */ /* Clear application metadata vectors. */
this->system_metadata.clear(); this->system_metadata.clear();
@ -203,13 +203,13 @@ namespace nxdt::tasks
/* USB Mass Storage task. */ /* USB Mass Storage task. */
UmsTask::UmsTask(void) : brls::RepeatingTask(NXDT_TASK_INTERVAL) UmsTask::UmsTask() : brls::RepeatingTask(NXDT_TASK_INTERVAL)
{ {
brls::RepeatingTask::start(); brls::RepeatingTask::start();
LOG_MSG_DEBUG("UMS task started."); LOG_MSG_DEBUG("UMS task started.");
} }
UmsTask::~UmsTask(void) UmsTask::~UmsTask()
{ {
/* Clear UMS device vector. */ /* Clear UMS device vector. */
this->ums_devices_vector.clear(); this->ums_devices_vector.clear();
@ -280,13 +280,13 @@ namespace nxdt::tasks
/* USB host device connection task. */ /* USB host device connection task. */
UsbHostTask::UsbHostTask(void) : brls::RepeatingTask(NXDT_TASK_INTERVAL) UsbHostTask::UsbHostTask() : brls::RepeatingTask(NXDT_TASK_INTERVAL)
{ {
brls::RepeatingTask::start(); brls::RepeatingTask::start();
LOG_MSG_DEBUG("USB host task started."); LOG_MSG_DEBUG("USB host task started.");
} }
UsbHostTask::~UsbHostTask(void) UsbHostTask::~UsbHostTask()
{ {
LOG_MSG_DEBUG("USB host task stopped."); LOG_MSG_DEBUG("USB host task stopped.");
} }

View File

@ -50,7 +50,7 @@ namespace nxdt::views
this->addTab("Blue", new brls::Rectangle(nvgRGB(0, 0, 255))); this->addTab("Blue", new brls::Rectangle(nvgRGB(0, 0, 255)));
} }
TitlesTabPopup::~TitlesTabPopup(void) TitlesTabPopup::~TitlesTabPopup()
{ {
/* Free title information. */ /* Free title information. */
if (!this->is_system) if (!this->is_system)
@ -96,7 +96,7 @@ namespace nxdt::views
} }
} }
TitlesTab::~TitlesTab(void) TitlesTab::~TitlesTab()
{ {
/* Unregister task listener if this is the user titles tab. */ /* Unregister task listener if this is the user titles tab. */
if (!this->is_system) this->root_view->UnregisterTitleTaskListener(this->title_task_sub); if (!this->is_system) this->root_view->UnregisterTitleTaskListener(this->title_task_sub);