diff --git a/src/citron/applets/qt_profile_select.cpp b/src/citron/applets/qt_profile_select.cpp index 0c95359b1..3cde4f909 100644 --- a/src/citron/applets/qt_profile_select.cpp +++ b/src/citron/applets/qt_profile_select.cpp @@ -103,7 +103,7 @@ QtProfileSelectionDialog::QtProfileSelectionDialog( if (!this->isActiveWindow()) { return; } - QKeyEvent* event = new QKeyEvent(QEvent::Type::KeyPress, key, Qt::NoModifier); + QKeyEvent* event = new QKeyEvent(QEvent::KeyPress, key, Qt::NoModifier); QCoreApplication::postEvent(tree_view, event); SelectUser(tree_view->currentIndex()); }); diff --git a/src/citron/game_list.cpp b/src/citron/game_list.cpp index 3e7fc5ac8..f71e11adb 100644 --- a/src/citron/game_list.cpp +++ b/src/citron/game_list.cpp @@ -35,7 +35,7 @@ GameListSearchField::KeyReleaseEater::KeyReleaseEater(GameList* gamelist_, QObje // EventFilter in order to process systemkeys while editing the searchfield bool GameListSearchField::KeyReleaseEater::eventFilter(QObject* obj, QEvent* event) { // If it isn't a KeyRelease event then continue with standard event processing - if (event->type() != QEvent::Type::KeyRelease) + if (event->type() != QEvent::KeyRelease) return QObject::eventFilter(obj, event); QKeyEvent* keyEvent = static_cast(event); @@ -479,7 +479,7 @@ GameList::GameList(FileSys::VirtualFilesystem vfs_, FileSys::ManualContentProvid } // Only send events to visible and properly initialized views - QKeyEvent* event = new QKeyEvent(QEvent::Type::KeyPress, key, Qt::NoModifier); + QKeyEvent* event = new QKeyEvent(QEvent::KeyPress, key, Qt::NoModifier); if (tree_view->isVisible() && tree_view->model()) { QCoreApplication::postEvent(tree_view, event); @@ -487,7 +487,7 @@ GameList::GameList(FileSys::VirtualFilesystem vfs_, FileSys::ManualContentProvid if (list_view->isVisible() && list_view->model()) { // Create a new event for the list view to avoid double deletion - QKeyEvent* list_event = new QKeyEvent(QEvent::Type::KeyPress, key, Qt::NoModifier); + QKeyEvent* list_event = new QKeyEvent(QEvent::KeyPress, key, Qt::NoModifier); QCoreApplication::postEvent(list_view, list_event); } }); diff --git a/src/citron/main.cpp b/src/citron/main.cpp index 7e1e0a8af..17f9bd1c2 100644 --- a/src/citron/main.cpp +++ b/src/citron/main.cpp @@ -1843,7 +1843,7 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa const auto drd_callout = (UISettings::values.callout_flags.GetValue() & static_cast(CalloutFlag::DRDDeprecation)) == 0; - if (result == Core::SystemResultStatus::SystemSuccess && + if (result == Core::SystemResultStatus::Success && system->GetAppLoader().GetFileType() == Loader::FileType::DeconstructedRomDirectory && drd_callout) { UISettings::values.callout_flags = UISettings::values.callout_flags.GetValue() | @@ -1858,7 +1858,7 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa "wiki. This message will not be shown again.")); } - if (result != Core::SystemResultStatus::SystemSuccess) { + if (result != Core::SystemResultStatus::Success) { switch (result) { case Core::SystemResultStatus::ErrorGetLoader: LOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filename.toStdString()); @@ -1943,11 +1943,11 @@ void GMainWindow::ConfigureFilesystemProvider(const std::string& filepath) { u64 program_id = 0; const auto res2 = loader->ReadProgramId(program_id); - if (res2 == Loader::ResultStatus::LoaderSuccess && file_type == Loader::FileType::NCA) { + if (res2 == Loader::ResultStatus::Success && file_type == Loader::FileType::NCA) { provider->AddEntry(FileSys::TitleType::Application, FileSys::GetCRTypeFromNCAType(FileSys::NCA{file}.GetType()), program_id, file); - } else if (res2 == Loader::ResultStatus::LoaderSuccess && + } else if (res2 == Loader::ResultStatus::Success && (file_type == Loader::FileType::XCI || file_type == Loader::FileType::NSP)) { const auto nsp = file_type == Loader::FileType::NSP ? std::make_shared(file) @@ -1983,7 +1983,7 @@ void GMainWindow::BootGame(const QString& filename, Service::AM::FrontendAppletP const auto v_file = Core::GetGameFileFromPath(vfs, filename.toUtf8().constData()); const auto loader = Loader::GetLoader(*system, v_file, params.program_id, params.program_index); - if (loader != nullptr && loader->ReadProgramId(title_id) == Loader::ResultStatus::LoaderSuccess && + if (loader != nullptr && loader->ReadProgramId(title_id) == Loader::ResultStatus::Success && type == StartGameType::Normal) { // Load per game settings const auto file_path = @@ -2081,7 +2081,7 @@ void GMainWindow::BootGame(const QString& filename, Service::AM::FrontendAppletP title_version = metadata.first->GetVersionString(); title_name = metadata.first->GetApplicationName(); } - if (res != Loader::ResultStatus::LoaderSuccess || title_name.empty()) { + if (res != Loader::ResultStatus::Success || title_name.empty()) { title_name = Common::FS::PathToUTF8String( std::filesystem::path{Common::U16StringFromBuffer(filename.utf16(), filename.size())} .filename()); @@ -2853,7 +2853,7 @@ void GMainWindow::OnGameListVerifyIntegrity(const std::string& game_path) { const auto result = ContentManager::VerifyGameContents(*system, game_path, QtProgressCallback); progress.close(); switch (result) { - case ContentManager::GameVerificationResult::VerificationSuccess: + case ContentManager::GameVerificationResult::Success: QMessageBox::information(this, tr("Integrity verification succeeded!"), tr("The operation completed successfully.")); break; @@ -3094,7 +3094,7 @@ void GMainWindow::OnGameListCreateShortcut(u64 program_id, const std::string& ga std::vector icon_image_file{}; if (control.second != nullptr) { icon_image_file = control.second->ReadAllBytes(); - } else if (loader->ReadIcon(icon_image_file) != Loader::ResultStatus::LoaderSuccess) { + } else if (loader->ReadIcon(icon_image_file) != Loader::ResultStatus::Success) { LOG_WARNING(Frontend, "Could not read icon from {:s}", game_path); } QImage icon_data = @@ -3195,7 +3195,7 @@ void GMainWindow::OnGameListOpenPerGameProperties(const std::string& file) { const auto v_file = Core::GetGameFileFromPath(vfs, file); const auto loader = Loader::GetLoader(*system, v_file); - if (loader == nullptr || loader->ReadProgramId(title_id) != Loader::ResultStatus::LoaderSuccess) { + if (loader == nullptr || loader->ReadProgramId(title_id) != Loader::ResultStatus::Success) { QMessageBox::information(this, tr("Properties"), tr("The game properties could not be loaded.")); return; @@ -3339,7 +3339,7 @@ void GMainWindow::OnMenuInstallToNAND() { std::this_thread::sleep_for(std::chrono::milliseconds(10)); switch (result) { - case ContentManager::InstallResult::InstallSuccess: + case ContentManager::InstallResult::Success: new_files.append(QFileInfo(file).fileName()); break; case ContentManager::InstallResult::Overwrite: @@ -4119,7 +4119,7 @@ bool GMainWindow::question(QWidget* parent, const QString& title, const QString& new ControllerNavigation(system->HIDCore(), box_dialog); connect(controller_navigation, &ControllerNavigation::TriggerKeyboardEvent, [box_dialog](Qt::Key key) { - QKeyEvent* event = new QKeyEvent(QEvent::Type::KeyPress, key, Qt::NoModifier); + QKeyEvent* event = new QKeyEvent(QEvent::KeyPress, key, Qt::NoModifier); QCoreApplication::postEvent(box_dialog, event); }); int res = box_dialog->exec(); @@ -5034,7 +5034,7 @@ bool GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProvider& installe const auto entries = installed.ListEntriesFilter(title_type, record_type); for (const auto& entry : entries) { if (FileSys::GetBaseTitleID(entry.title_id) == program_id && - installed.GetEntry(entry)->GetStatus() == Loader::ResultStatus::LoaderSuccess) { + installed.GetEntry(entry)->GetStatus() == Loader::ResultStatus::Success) { available_title_ids.insert({entry.title_id, title_type, record_type}); } } diff --git a/src/citron/updater/updater_dialog.cpp b/src/citron/updater/updater_dialog.cpp index a00d819cd..59290522e 100644 --- a/src/citron/updater/updater_dialog.cpp +++ b/src/citron/updater/updater_dialog.cpp @@ -102,7 +102,7 @@ void UpdaterDialog::OnUpdateCompleted(Updater::UpdaterService::UpdateResult resu progress_timer->stop(); switch (result) { - case Updater::UpdaterService::UpdateResult::UpdateSuccess: + case Updater::UpdaterService::UpdateResult::Success: ShowCompletedState(); break; case Updater::UpdaterService::UpdateResult::Cancelled: @@ -329,7 +329,7 @@ QString UpdaterDialog::FormatBytes(qint64 bytes) const { QString UpdaterDialog::GetUpdateMessage(Updater::UpdaterService::UpdateResult result) const { switch (result) { - case Updater::UpdaterService::UpdateResult::UpdateSuccess: + case Updater::UpdaterService::UpdateResult::Success: return QStringLiteral("Update completed successfully!"); case Updater::UpdaterService::UpdateResult::Failed: return QStringLiteral("Update failed due to an unknown error."); diff --git a/src/citron/updater/updater_service.cpp b/src/citron/updater/updater_service.cpp index b39e0f22d..e9c8ff59a 100644 --- a/src/citron/updater/updater_service.cpp +++ b/src/citron/updater/updater_service.cpp @@ -455,7 +455,7 @@ void UpdaterService::OnDownloadFinished() { } emit UpdateInstallProgress(100, QStringLiteral("Update completed successfully!")); - emit UpdateCompleted(UpdateResult::UpdateSuccess, QStringLiteral("Update installed successfully. Please restart the application.")); + emit UpdateCompleted(UpdateResult::Success, QStringLiteral("Update installed successfully. Please restart the application.")); update_in_progress.store(false); CleanupFiles(); diff --git a/src/citron/updater/updater_service.h b/src/citron/updater/updater_service.h index 2bd0d36a6..b1a405269 100644 --- a/src/citron/updater/updater_service.h +++ b/src/citron/updater/updater_service.h @@ -31,7 +31,7 @@ class UpdaterService : public QObject { public: enum class UpdateResult { - UpdateSuccess, + Success, Failed, Cancelled, NetworkError, diff --git a/src/citron_cmd/citron.cpp b/src/citron_cmd/citron.cpp index 612630a54..f728fb38f 100644 --- a/src/citron_cmd/citron.cpp +++ b/src/citron_cmd/citron.cpp @@ -387,7 +387,7 @@ int main(int argc, char** argv) { case Core::SystemResultStatus::ErrorVideoCore: LOG_CRITICAL(Frontend, "Failed to initialize VideoCore!"); return -1; - case Core::SystemResultStatus::SystemSuccess: + case Core::SystemResultStatus::Success: break; // Expected case default: if (static_cast(load_result) > diff --git a/src/core/core.cpp b/src/core/core.cpp index ed678fe48..e1c8b41ee 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -301,7 +301,7 @@ struct System::Impl { LOG_DEBUG(Core, "Initialized OK"); - return SystemResultStatus::SystemSuccess; + return SystemResultStatus::Success; } SystemResultStatus Load(System& system, Frontend::EmuWindow& emu_window, @@ -347,7 +347,7 @@ struct System::Impl { // Set up the rest of the system. SystemResultStatus init_result{SetupForApplicationProcess(system, emu_window)}; - if (init_result != SystemResultStatus::SystemSuccess) { + if (init_result != SystemResultStatus::Success) { LOG_CRITICAL(Core, "Failed to initialize system (Error {})!", static_cast(init_result)); ShutdownMainProcess(); @@ -394,7 +394,7 @@ struct System::Impl { room_member->SendGameInfo(game_info); } - status = SystemResultStatus::SystemSuccess; + status = SystemResultStatus::Success; return status; } @@ -543,7 +543,7 @@ struct System::Impl { /// Debugger std::unique_ptr debugger; - SystemResultStatus status = SystemResultStatus::SystemSuccess; + SystemResultStatus status = SystemResultStatus::Success; std::string status_details = ""; std::unique_ptr perf_stats; diff --git a/src/core/core.h b/src/core/core.h index ec061a644..90826bd3a 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -131,7 +131,7 @@ FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs, /// Enumeration representing the return values of the System Initialize and Load process. enum class SystemResultStatus : u32 { - SystemSuccess, ///< Succeeded + Success, ///< Succeeded ErrorNotInitialized, ///< Error trying to use core prior to initialization ErrorGetLoader, ///< Error finding the correct application loader ErrorSystemFiles, ///< Error in finding system files diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index a01976354..2bfe34689 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp @@ -206,7 +206,7 @@ bool PlaceholderCache::Register(RegisteredCache* cache, const NcaID& placeholder const auto res = cache->RawInstallNCA(NCA{file}, &VfsRawCopy, false, install); - if (res != InstallResult::InstallSuccess) + if (res != InstallResult::Success) return false; return Delete(placeholder); @@ -609,7 +609,7 @@ InstallResult RegisteredCache::InstallEntry(const NSP& nsp, bool overwrite_if_ex // Install Metadata File const auto meta_result = RawInstallNCA(**meta_iter, copy, overwrite_if_exists, meta_id_data); - if (meta_result != InstallResult::InstallSuccess) { + if (meta_result != InstallResult::Success) { return meta_result; } @@ -628,13 +628,13 @@ InstallResult RegisteredCache::InstallEntry(const NSP& nsp, bool overwrite_if_ex // Create fake cnmt for patch to multiprogram application const auto sub_nca_result = InstallEntry(*nca, cnmt.GetHeader(), record, overwrite_if_exists, copy); - if (sub_nca_result != InstallResult::InstallSuccess) { + if (sub_nca_result != InstallResult::Success) { return sub_nca_result; } continue; } const auto nca_result = RawInstallNCA(*nca, copy, overwrite_if_exists, record.nca_id); - if (nca_result != InstallResult::InstallSuccess) { + if (nca_result != InstallResult::Success) { return nca_result; } } @@ -643,7 +643,7 @@ InstallResult RegisteredCache::InstallEntry(const NSP& nsp, bool overwrite_if_ex if (result) { return InstallResult::OverwriteExisting; } - return InstallResult::InstallSuccess; + return InstallResult::Success; } InstallResult RegisteredCache::InstallEntry(const NCA& nca, TitleType type, @@ -798,7 +798,7 @@ InstallResult RegisteredCache::RawInstallNCA(const NCA& nca, const VfsCopyFuncti if (out == nullptr) { return InstallResult::ErrorCopyFailed; } - return copy(in, out, VFS_RC_LARGE_COPY_BLOCK) ? InstallResult::InstallSuccess + return copy(in, out, VFS_RC_LARGE_COPY_BLOCK) ? InstallResult::Success : InstallResult::ErrorCopyFailed; } diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h index 909ce4e34..bf111e466 100644 --- a/src/core/file_sys/registered_cache.h +++ b/src/core/file_sys/registered_cache.h @@ -33,7 +33,7 @@ using ContentProviderParsingFunction = std::function; enum class InstallResult { - InstallSuccess, + Success, OverwriteExisting, ErrorAlreadyExists, ErrorCopyFailed, diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index c6537864f..f5957e73a 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h @@ -67,7 +67,7 @@ std::string GetFileTypeString(FileType type); /// Return type for functions in Loader namespace enum class ResultStatus : u16 { - LoaderSuccess, + Success, ErrorAlreadyLoaded, ErrorNotImplemented, ErrorNotInitialized, diff --git a/src/frontend_common/content_manager.h b/src/frontend_common/content_manager.h index 2cef54dde..c4e97a47b 100644 --- a/src/frontend_common/content_manager.h +++ b/src/frontend_common/content_manager.h @@ -21,14 +21,14 @@ namespace ContentManager { enum class InstallResult { - InstallSuccess, + Success, Overwrite, Failure, BaseInstallAttempted, }; enum class GameVerificationResult { - VerificationSuccess, + Success, Failed, NotImplemented, }; @@ -169,7 +169,7 @@ inline InstallResult InstallNSP(Core::System& system, FileSys::VfsFilesystem& vf return InstallResult::Failure; } - if (nsp->GetStatus() != Loader::ResultStatus::LoaderSuccess) { + if (nsp->GetStatus() != Loader::ResultStatus::Success) { return InstallResult::Failure; } const auto res = @@ -229,7 +229,7 @@ inline InstallResult InstallNCA(FileSys::VfsFilesystem& vfs, const std::string& const auto id = nca->GetStatus(); // Game updates necessary are missing base RomFS - if (id != Loader::ResultStatus::LoaderSuccess && + if (id != Loader::ResultStatus::Success && id != Loader::ResultStatus::ErrorMissingBKTRBaseRomFS) { return InstallResult::Failure; } @@ -306,14 +306,14 @@ inline std::vector VerifyInstalledContents( if (cancelled) { break; } - if (status != Loader::ResultStatus::LoaderSuccess) { + if (status != Loader::ResultStatus::Success) { FileSys::NCA nca(nca_file); const auto title_id = nca.GetTitleId(); std::string title_name = "unknown"; const auto control = provider.GetEntry(FileSys::GetBaseTitleID(title_id), FileSys::ContentRecordType::Control); - if (control && control->GetStatus() == Loader::ResultStatus::LoaderSuccess) { + if (control && control->GetStatus() == Loader::ResultStatus::Success) { const FileSys::PatchManager pm{title_id, system.GetFileSystemController(), provider}; const auto [nacp, logo] = pm.ParseControlNCA(*control); @@ -367,7 +367,7 @@ inline GameVerificationResult VerifyGameContents( if (status == Loader::ResultStatus::ErrorIntegrityVerificationFailed) { return GameVerificationResult::Failed; } - return GameVerificationResult::VerificationSuccess; + return GameVerificationResult::Success; } /**