From 68f72d69ccac08e13f79c41e7946761e16533b4f Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Wed, 19 Oct 2016 01:26:17 +0200 Subject: [PATCH] refactor: Drop tokenized labels Handle placeholder tokens inside each label instead of cloning into a new instance each time --- include/components/builder.hpp | 2 +- include/components/types.hpp | 3 + include/drawtypes/label.hpp | 41 ++++++---- include/modules/backlight.hpp | 17 ++-- include/modules/battery.hpp | 34 ++++---- include/modules/bspwm.hpp | 9 +- include/modules/counter.hpp | 2 +- include/modules/cpu.hpp | 18 ++-- include/modules/date.hpp | 2 +- include/modules/i3.hpp | 5 +- include/modules/memory.hpp | 37 ++++----- include/modules/menu.hpp | 2 +- include/modules/meta.hpp | 21 ++--- include/modules/mpd.hpp | 140 ++++++++++++++++---------------- include/modules/network.hpp | 31 +++---- include/modules/script.hpp | 2 +- include/modules/text.hpp | 2 +- include/modules/unsupported.hpp | 2 +- include/modules/volume.hpp | 24 +++--- 19 files changed, 185 insertions(+), 209 deletions(-) diff --git a/include/components/builder.hpp b/include/components/builder.hpp index ebf63f49..5cd8c89c 100644 --- a/include/components/builder.hpp +++ b/include/components/builder.hpp @@ -154,7 +154,7 @@ class builder { if (!label || !*label) return; - auto text = label->m_text; + auto text = label->get(); if (label->m_maxlen > 0 && text.length() > label->m_maxlen) { text = text.substr(0, label->m_maxlen) + "..."; diff --git a/include/components/types.hpp b/include/components/types.hpp index c1d66167..4b2f44dc 100644 --- a/include/components/types.hpp +++ b/include/components/types.hpp @@ -105,4 +105,7 @@ struct action_block { #endif }; +struct wmsettings_bspwm { +}; + LEMONBUDDY_NS_END diff --git a/include/drawtypes/label.hpp b/include/drawtypes/label.hpp index cf283f23..f12386b0 100644 --- a/include/drawtypes/label.hpp +++ b/include/drawtypes/label.hpp @@ -14,23 +14,21 @@ namespace drawtypes { class label : public non_copyable_mixin