summaryrefslogtreecommitdiff
path: root/src/config
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-01-23 21:55:41 +0100
committerGitHub <noreply@github.com>2025-01-23 21:55:41 +0100
commit0a1ae48a9fd6eb76baad27de98c00f653a55e4ac (patch)
tree007cd36eb83d343d2aba49cf0741028c5f554895 /src/config
parentae403e6a05452336abd97e61be2706f6a930d827 (diff)
core: move all shared_ptrs from the STL to hyprutils (#9143)
Diffstat (limited to 'src/config')
-rw-r--r--src/config/ConfigManager.cpp10
-rw-r--r--src/config/ConfigManager.hpp4
-rw-r--r--src/config/ConfigWatcher.hpp4
3 files changed, 9 insertions, 9 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 60b818f0..08f0f33f 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -44,6 +44,7 @@
#include <unordered_set>
#include <hyprutils/string/String.hpp>
#include <filesystem>
+#include <memory>
using namespace Hyprutils::String;
using namespace Hyprutils::Animation;
@@ -374,7 +375,7 @@ CConfigManager::CConfigManager() {
const auto ERR = verifyConfigExists();
m_configPaths.emplace_back(getMainConfigPath());
- m_pConfig = std::make_unique<Hyprlang::CConfig>(m_configPaths.begin()->c_str(), Hyprlang::SConfigOptions{.throwAllErrors = true, .allowMissingConfig = true});
+ m_pConfig = makeUnique<Hyprlang::CConfig>(m_configPaths.begin()->c_str(), Hyprlang::SConfigOptions{.throwAllErrors = true, .allowMissingConfig = true});
m_pConfig->addConfigValue("general:border_size", Hyprlang::INT{1});
m_pConfig->addConfigValue("general:no_border_on_floating", Hyprlang::INT{0});
@@ -955,9 +956,8 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
// enable/disable xwayland usage
if (!isFirstLaunch) {
bool prevEnabledXwayland = g_pXWayland->enabled();
- if (g_pCompositor->m_bWantsXwayland != prevEnabledXwayland) {
- g_pXWayland = std::make_unique<CXWayland>(g_pCompositor->m_bWantsXwayland);
- }
+ if (g_pCompositor->m_bWantsXwayland != prevEnabledXwayland)
+ g_pXWayland = makeUnique<CXWayland>(g_pCompositor->m_bWantsXwayland);
} else
g_pCompositor->m_bWantsXwayland = PENABLEXWAYLAND;
#endif
@@ -1659,7 +1659,7 @@ void CConfigManager::addExecRule(const SExecRequestedRule& rule) {
}
void CConfigManager::handlePluginLoads() {
- if (g_pPluginSystem == nullptr)
+ if (!g_pPluginSystem)
return;
bool pluginsChanged = false;
diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp
index 1962e4d2..31ad81cd 100644
--- a/src/config/ConfigManager.hpp
+++ b/src/config/ConfigManager.hpp
@@ -262,7 +262,7 @@ class CConfigManager {
bool isLaunchingExecOnce = false; // For exec-once to skip initial ws tracking
private:
- std::unique_ptr<Hyprlang::CConfig> m_pConfig;
+ UP<Hyprlang::CConfig> m_pConfig;
std::vector<std::string> m_configPaths;
@@ -303,4 +303,4 @@ class CConfigManager {
SWorkspaceRule mergeWorkspaceRules(const SWorkspaceRule&, const SWorkspaceRule&);
};
-inline std::unique_ptr<CConfigManager> g_pConfigManager;
+inline UP<CConfigManager> g_pConfigManager;
diff --git a/src/config/ConfigWatcher.hpp b/src/config/ConfigWatcher.hpp
index 0a698fc8..c36ecd17 100644
--- a/src/config/ConfigWatcher.hpp
+++ b/src/config/ConfigWatcher.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include <memory>
+#include "../helpers/memory/Memory.hpp"
#include <vector>
#include <string>
#include <functional>
@@ -29,4 +29,4 @@ class CConfigWatcher {
int m_inotifyFd = -1;
};
-inline std::unique_ptr<CConfigWatcher> g_pConfigWatcher = std::make_unique<CConfigWatcher>(); \ No newline at end of file
+inline UP<CConfigWatcher> g_pConfigWatcher = makeUnique<CConfigWatcher>(); \ No newline at end of file