From d30685514ca64860008d00e5b43c6b59003e1d15 Mon Sep 17 00:00:00 2001 From: Sanel Zukan Date: Mon, 3 Jun 2013 11:11:07 +0000 Subject: [PATCH] In case DBus wasn't available, do not compile DBus related code. --- .../battery-monitor/BatteryMonitor.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/ede-panel/applets/battery-monitor/BatteryMonitor.cpp b/ede-panel/applets/battery-monitor/BatteryMonitor.cpp index ea5df12..c8371b4 100644 --- a/ede-panel/applets/battery-monitor/BatteryMonitor.cpp +++ b/ede-panel/applets/battery-monitor/BatteryMonitor.cpp @@ -24,6 +24,11 @@ #include #include +#include +#include "Applet.h" +#undef EDELIB_HAVE_DBUS + +#ifdef EDELIB_HAVE_DBUS #include #include #include @@ -32,9 +37,6 @@ #include #include #include -#include - -#include "Applet.h" EDELIB_NS_USING(EdbusConnection) EDELIB_NS_USING(EdbusMessage) @@ -255,6 +257,17 @@ void BatteryMonitor::set_icon(double percentage) { IconLoader::set(this, icon, ICON_SIZE_SMALL); } +#else /* EDELIB_HAVE_DBUS */ +class BatteryMonitor : public Fl_Box { +public: + BatteryMonitor() : Fl_Box(0, 0, 30, 25) { + tooltip(_("Battery status not available")); + label("bat"); + } +}; +#endif + + EDE_PANEL_APPLET_EXPORT ( BatteryMonitor, EDE_PANEL_APPLET_OPTION_ALIGN_RIGHT,