refactor: Use new hyprutils casts (#11377)

This commit is contained in:
Kamikadze 2025-08-14 19:44:56 +05:00 committed by GitHub
parent aa6a78f0a4
commit beee22a95e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
116 changed files with 715 additions and 696 deletions

View file

@ -92,7 +92,7 @@ eDynamicPermissionAllowMode CDynamicPermissionManager::clientPermissionMode(wl_c
const auto LOOKUP = binaryNameForWlClient(client);
Debug::log(TRACE, "CDynamicPermissionManager::clientHasPermission: checking permission {} for client {:x} (binary {})", permissionToString(permission), (uintptr_t)client,
Debug::log(TRACE, "CDynamicPermissionManager::clientHasPermission: checking permission {} for client {:x} (binary {})", permissionToString(permission), rc<uintptr_t>(client),
LOOKUP.has_value() ? LOOKUP.value() : "lookup failed: " + LOOKUP.error());
// first, check if we have the client + perm combo in our cache.
@ -174,7 +174,7 @@ eDynamicPermissionAllowMode CDynamicPermissionManager::clientPermissionModeWithS
if (lookup.has_value())
binaryName = *lookup;
} else
binaryName = specialPidToString((eSpecialPidTypes)pid);
binaryName = specialPidToString(sc<eSpecialPidTypes>(pid));
// first, check if we have the client + perm combo in our cache.
auto it = std::ranges::find_if(m_rules, [str, permission, pid](const auto& e) { return e->m_keyString == str && pid && pid == e->m_pid && e->m_type == permission; });
@ -246,14 +246,14 @@ void CDynamicPermissionManager::askForPermission(wl_client* client, const std::s
std::string description = "";
if (binaryPath.empty())
description = std::format(std::runtime_format(permissionToHumanString(type)), std::format("unknown application (wayland client ID 0x{:x})", (uintptr_t)client));
description = std::format(std::runtime_format(permissionToHumanString(type)), std::format("unknown application (wayland client ID 0x{:x})", rc<uintptr_t>(client)));
else if (client) {
std::string binaryName = binaryPath.contains("/") ? binaryPath.substr(binaryPath.find_last_of('/') + 1) : binaryPath;
description = std::format(std::runtime_format(permissionToHumanString(type)), std::format("{}</b> ({})", binaryName, binaryPath));
} else {
std::string lookup = "";
if (pid < 0)
lookup = specialPidToString((eSpecialPidTypes)pid);
lookup = specialPidToString(sc<eSpecialPidTypes>(pid));
else {
const auto LOOKUP = binaryNameForPid(pid);
lookup = LOOKUP.value_or("Unknown");