tray: drop std::filesystem dependency

This commit is contained in:
Jan Beich 2019-08-11 15:23:37 +00:00
parent 496e782544
commit c844d7ac2e
4 changed files with 5 additions and 12 deletions

View File

@ -14,7 +14,7 @@
#include "modules/idle_inhibitor.hpp" #include "modules/idle_inhibitor.hpp"
#include "modules/memory.hpp" #include "modules/memory.hpp"
#include "modules/disk.hpp" #include "modules/disk.hpp"
#if defined(HAVE_DBUSMENU) && !defined(NO_FILESYSTEM) #ifdef HAVE_DBUSMENU
#include "modules/sni/tray.hpp" #include "modules/sni/tray.hpp"
#endif #endif
#ifdef HAVE_LIBNL #ifdef HAVE_LIBNL

View File

@ -10,11 +10,6 @@
#include <json/json.h> #include <json/json.h>
#include <libdbusmenu-gtk/dbusmenu-gtk.h> #include <libdbusmenu-gtk/dbusmenu-gtk.h>
#include <sigc++/trackable.h> #include <sigc++/trackable.h>
#ifdef FILESYSTEM_EXPERIMENTAL
#include <experimental/filesystem>
#else
#include <filesystem>
#endif
namespace waybar::modules::SNI { namespace waybar::modules::SNI {

View File

@ -38,7 +38,7 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const {
if (ref == "disk") { if (ref == "disk") {
return new waybar::modules::Disk(id, config_[name]); return new waybar::modules::Disk(id, config_[name]);
} }
#if defined(HAVE_DBUSMENU) && !defined(NO_FILESYSTEM) #ifdef HAVE_DBUSMENU
if (ref == "tray") { if (ref == "tray") {
return new waybar::modules::SNI::Tray(id, bar_, config_[name]); return new waybar::modules::SNI::Tray(id, bar_, config_[name]);
} }

View File

@ -1,6 +1,7 @@
#include "modules/sni/item.hpp" #include "modules/sni/item.hpp"
#include <glibmm/main.h> #include <glibmm/main.h>
#include <spdlog/spdlog.h> #include <spdlog/spdlog.h>
#include <fstream>
template <> template <>
struct fmt::formatter<Glib::ustring> : formatter<std::string> { struct fmt::formatter<Glib::ustring> : formatter<std::string> {
@ -256,11 +257,8 @@ void Item::updateImage() {
if (!icon_name.empty()) { if (!icon_name.empty()) {
try { try {
// Try to find icons specified by path and filename // Try to find icons specified by path and filename
#ifdef FILESYSTEM_EXPERIMENTAL std::ifstream temp(icon_name);
if (std::experimental::filesystem::exists(icon_name)) { if (temp.is_open()) {
#else
if (std::filesystem::exists(icon_name)) {
#endif
auto pixbuf = Gdk::Pixbuf::create_from_file(icon_name); auto pixbuf = Gdk::Pixbuf::create_from_file(icon_name);
if (pixbuf->gobj() != nullptr) { if (pixbuf->gobj() != nullptr) {
// An icon specified by path and filename may be the wrong size for // An icon specified by path and filename may be the wrong size for