From 3a6ca90fcb9a101fa137d734df49fdb3b73d9d82 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Wed, 14 Dec 2016 04:45:20 +0100 Subject: [PATCH] refactor(i3): Remove wsname-maxlen --- include/modules/i3.hpp | 1 - src/modules/i3.cpp | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/include/modules/i3.hpp b/include/modules/i3.hpp index 18c09541..b959a0c2 100644 --- a/include/modules/i3.hpp +++ b/include/modules/i3.hpp @@ -71,7 +71,6 @@ namespace modules { bool m_indexsort{false}; bool m_pinworkspaces{false}; bool m_strip_wsnumbers{false}; - size_t m_wsname_maxlen{0}; unique_ptr m_ipc; }; diff --git a/src/modules/i3.cpp b/src/modules/i3.cpp index 4828ae09..de0845ee 100644 --- a/src/modules/i3.cpp +++ b/src/modules/i3.cpp @@ -34,7 +34,8 @@ namespace modules { GET_CONFIG_VALUE(name(), m_indexsort, "index-sort"); GET_CONFIG_VALUE(name(), m_pinworkspaces, "pin-workspaces"); GET_CONFIG_VALUE(name(), m_strip_wsnumbers, "strip-wsnumbers"); - GET_CONFIG_VALUE(name(), m_wsname_maxlen, "wsname-maxlen"); + + m_conf.warn_deprecated(name(), "wsname-maxlen", "%name:min:max%"); // Add formats and create components m_formatter->add(DEFAULT_FORMAT, DEFAULT_TAGS, {TAG_LABEL_STATE, TAG_LABEL_MODE}); @@ -142,11 +143,6 @@ namespace modules { // Trim leading and trailing whitespace ws_name = string_util::trim(ws_name, ' '); - // Cap at configured max length - if (m_wsname_maxlen > 0 && ws_name.length() > m_wsname_maxlen) { - ws_name.erase(m_wsname_maxlen); - } - auto icon = m_icons->get(ws->name, DEFAULT_WS_ICON); auto label = m_statelabels.find(ws_state)->second->clone();