Revert "fix: resolve X11 macro conflicts with enum values and Qt constants"

This reverts commit c32ac3b3c1.
This commit is contained in:
Zephyron
2025-09-14 20:15:29 +10:00
parent c32ac3b3c1
commit 12c3e4b92c
13 changed files with 41 additions and 41 deletions

View File

@@ -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());
});

View File

@@ -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<QKeyEvent*>(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);
}
});

View File

@@ -1843,7 +1843,7 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
const auto drd_callout = (UISettings::values.callout_flags.GetValue() &
static_cast<u32>(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</a>. 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<FileSys::NSP>(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<u8> 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});
}
}

View File

@@ -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.");

View File

@@ -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();

View File

@@ -31,7 +31,7 @@ class UpdaterService : public QObject {
public:
enum class UpdateResult {
UpdateSuccess,
Success,
Failed,
Cancelled,
NetworkError,

View File

@@ -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<u32>(load_result) >

View File

@@ -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<int>(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<Core::Debugger> debugger;
SystemResultStatus status = SystemResultStatus::SystemSuccess;
SystemResultStatus status = SystemResultStatus::Success;
std::string status_details = "";
std::unique_ptr<Core::PerfStats> perf_stats;

View File

@@ -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

View File

@@ -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;
}

View File

@@ -33,7 +33,7 @@ using ContentProviderParsingFunction = std::function<VirtualFile(const VirtualFi
using VfsCopyFunction = std::function<bool(const VirtualFile&, const VirtualFile&, size_t)>;
enum class InstallResult {
InstallSuccess,
Success,
OverwriteExisting,
ErrorAlreadyExists,
ErrorCopyFailed,

View File

@@ -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,

View File

@@ -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<std::string> 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;
}
/**