diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-09-21 00:33:48 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-09-21 00:37:17 +0100 |
| commit | 9232bc2c00a57b99ac876b43fdfedfa25c2de774 (patch) | |
| tree | df71f765676bd668a57b0f0d011652390d6f6d7c | |
| parent | db0b764a5ac22e752d8557cc1e1e5a42ac58c7e4 (diff) | |
internal: move to hyprutils' scopeguard
bumps hyprutils dep to 0.2.2
| -rw-r--r-- | CMakeLists.txt | 2 | ||||
| -rw-r--r-- | flake.lock | 6 | ||||
| -rw-r--r-- | src/helpers/Monitor.cpp | 3 | ||||
| -rw-r--r-- | src/helpers/ScopeGuard.cpp | 10 | ||||
| -rw-r--r-- | src/helpers/ScopeGuard.hpp | 13 | ||||
| -rw-r--r-- | src/render/Renderer.cpp | 4 |
6 files changed, 9 insertions, 29 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b6ac8efc..e1718b2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,7 +114,7 @@ pkg_check_modules( gio-2.0 hyprlang>=0.3.2 hyprcursor>=0.1.7 - hyprutils>=0.2.1) + hyprutils>=0.2.2) find_package(hyprwayland-scanner 0.3.10 REQUIRED) @@ -116,11 +116,11 @@ ] }, "locked": { - "lastModified": 1724966483, - "narHash": "sha256-WXDgKIbzjYKczxSZOsJplCS1i1yrTUpsDPuJV/xpYLo=", + "lastModified": 1726874949, + "narHash": "sha256-PNnIpwGqpTvMU3N2r0wMQwK1E+t4Bb5fbJwblQvr+80=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "8976e3f6a5357da953a09511d0c7f6a890fb6ec2", + "rev": "d97af4f6bd068c03a518b597675e598f57ea2291", "type": "github" }, "original": { diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 708a5cc8..223a3f94 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -2,7 +2,6 @@ #include "MiscFunctions.hpp" #include "math/Math.hpp" #include "sync/SyncReleaser.hpp" -#include "ScopeGuard.hpp" #include "../Compositor.hpp" #include "../config/ConfigValue.hpp" #include "../protocols/GammaControl.hpp" @@ -17,7 +16,9 @@ #include "sync/SyncTimeline.hpp" #include <aquamarine/output/Output.hpp> #include <hyprutils/string/String.hpp> +#include <hyprutils/utils/ScopeGuard.hpp> using namespace Hyprutils::String; +using namespace Hyprutils::Utils; int ratHandler(void* data) { g_pHyprRenderer->renderMonitor((CMonitor*)data); diff --git a/src/helpers/ScopeGuard.cpp b/src/helpers/ScopeGuard.cpp deleted file mode 100644 index 319255cd..00000000 --- a/src/helpers/ScopeGuard.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "ScopeGuard.hpp" - -CScopeGuard::CScopeGuard(const std::function<void()>& fn_) : fn(fn_) { - ; -} - -CScopeGuard::~CScopeGuard() { - if (fn) - fn(); -} diff --git a/src/helpers/ScopeGuard.hpp b/src/helpers/ScopeGuard.hpp deleted file mode 100644 index 8a1468eb..00000000 --- a/src/helpers/ScopeGuard.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include <functional> - -// calls a function when it goes out of scope -class CScopeGuard { - public: - CScopeGuard(const std::function<void()>& fn_); - ~CScopeGuard(); - - private: - std::function<void()> fn; -}; diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 08bf76cb..417a3ff8 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1,7 +1,6 @@ #include "Renderer.hpp" #include "../Compositor.hpp" #include "../helpers/math/Math.hpp" -#include "../helpers/ScopeGuard.hpp" #include "../helpers/sync/SyncReleaser.hpp" #include <algorithm> #include <aquamarine/output/Output.hpp> @@ -23,6 +22,9 @@ #include "../helpers/sync/SyncTimeline.hpp" #include "debug/Log.hpp" +#include <hyprutils/utils/ScopeGuard.hpp> +using namespace Hyprutils::Utils; + extern "C" { #include <xf86drm.h> } |
