mirror of
https://github.com/polybar/polybar.git
synced 2024-11-25 13:55:47 -05:00
refactor: Pass singleton instance directly
This commit is contained in:
parent
5d5542169b
commit
bff119834a
3 changed files with 4 additions and 6 deletions
|
@ -8,8 +8,7 @@ signal_receivers_t g_signal_receivers;
|
|||
* Create instance
|
||||
*/
|
||||
signal_emitter::make_type signal_emitter::make() {
|
||||
auto instance = factory_util::singleton<signal_emitter>();
|
||||
return static_cast<signal_emitter&>(*instance);
|
||||
return static_cast<signal_emitter&>(*factory_util::singleton<signal_emitter>());
|
||||
}
|
||||
|
||||
POLYBAR_NS_END
|
||||
|
|
|
@ -12,8 +12,8 @@ POLYBAR_NS
|
|||
* Create instance
|
||||
*/
|
||||
connection::make_type connection::make() {
|
||||
auto instance = factory_util::singleton<connection>(xutils::get_connection(), xutils::get_connection_fd());
|
||||
return static_cast<connection&>(*instance);
|
||||
return static_cast<connection&>(
|
||||
*factory_util::singleton<connection>(xutils::get_connection(), xutils::get_connection_fd()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,8 +12,7 @@ POLYBAR_NS
|
|||
* Create instance
|
||||
*/
|
||||
const xresource_manager& xresource_manager::make() {
|
||||
auto instance = factory_util::singleton<xresource_manager>();
|
||||
return static_cast<const xresource_manager&>(*instance);
|
||||
return static_cast<const xresource_manager&>(*factory_util::singleton<xresource_manager>());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue