core: move all shared_ptrs from the STL to hyprutils (#9143)
This commit is contained in:
parent
ae403e6a05
commit
0a1ae48a9f
152 changed files with 297 additions and 349 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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>();
|
||||
inline UP<CConfigWatcher> g_pConfigWatcher = makeUnique<CConfigWatcher>();
|
||||
Loading…
Add table
Add a link
Reference in a new issue