refactor: Don't initialize forward declared members

Using brace initialization here causes bar.hpp to not compile when
included on its own, forcing all clients to also include
tray_manager.hpp and so on, which defeats the purpose of forward
declaring those classes.

This also allows us to remove the tray_manager.hpp, renderer.hpp and
parser.hpp includes from the clients of bar.hpp
This commit is contained in:
patrick96 2018-05-06 17:45:43 +02:00 committed by Patrick Ziegler
parent c2ac93db55
commit 20f3d9a141
3 changed files with 3 additions and 8 deletions

View File

@ -97,9 +97,9 @@ class bar : public xpp::event::sink<evt::button_press, evt::expose, evt::propert
const config& m_conf; const config& m_conf;
const logger& m_log; const logger& m_log;
unique_ptr<screen> m_screen; unique_ptr<screen> m_screen;
unique_ptr<tray_manager> m_tray{}; unique_ptr<tray_manager> m_tray;
unique_ptr<renderer> m_renderer{}; unique_ptr<renderer> m_renderer;
unique_ptr<parser> m_parser{}; unique_ptr<parser> m_parser;
unique_ptr<taskqueue> m_taskqueue; unique_ptr<taskqueue> m_taskqueue;
bar_settings m_opts{}; bar_settings m_opts{};

View File

@ -5,7 +5,6 @@
#include "components/controller.hpp" #include "components/controller.hpp"
#include "components/ipc.hpp" #include "components/ipc.hpp"
#include "components/logger.hpp" #include "components/logger.hpp"
#include "components/renderer.hpp"
#include "components/types.hpp" #include "components/types.hpp"
#include "events/signal.hpp" #include "events/signal.hpp"
#include "events/signal_emitter.hpp" #include "events/signal_emitter.hpp"
@ -18,7 +17,6 @@
#include "utils/time.hpp" #include "utils/time.hpp"
#include "x11/connection.hpp" #include "x11/connection.hpp"
#include "x11/extensions/all.hpp" #include "x11/extensions/all.hpp"
#include "x11/tray_manager.hpp"
#include "x11/types.hpp" #include "x11/types.hpp"
POLYBAR_NS POLYBAR_NS

View File

@ -3,12 +3,9 @@
#include "components/config.hpp" #include "components/config.hpp"
#include "components/controller.hpp" #include "components/controller.hpp"
#include "components/ipc.hpp" #include "components/ipc.hpp"
#include "components/parser.hpp"
#include "components/renderer.hpp"
#include "utils/env.hpp" #include "utils/env.hpp"
#include "utils/inotify.hpp" #include "utils/inotify.hpp"
#include "utils/process.hpp" #include "utils/process.hpp"
#include "x11/tray_manager.hpp"
using namespace polybar; using namespace polybar;