From 556062841cbc5a25cce4f0e9cf8fad9f33a1e712 Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Thu, 17 Jul 2014 16:52:29 -0400 Subject: [PATCH] fixup notification icon path code 1) Don't assume that game_config::path ends in '/' 2) Normalize the path after concatenating '/' + "images/foo.png", to eliminate the double slashes "//" which apparently confuse dbus --- src/desktop/dbus_notification.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/desktop/dbus_notification.cpp b/src/desktop/dbus_notification.cpp index 643ca09d28f2..8eb495a8a81b 100644 --- a/src/desktop/dbus_notification.cpp +++ b/src/desktop/dbus_notification.cpp @@ -15,6 +15,7 @@ #include "dbus_notification.hpp" #include "global.hpp" +#include "filesystem.hpp" #include "game_config.hpp" #include "log.hpp" @@ -145,8 +146,14 @@ uint32_t send_dbus_notification(DBusConnection *connection, uint32_t replaces_id DBUS_TYPE_INVALID); } - std::string app_icon_ = game_config::path + game_config::images::app_icon; - LOG_DU << "app_icon_=\'" << app_icon_ << "\'\n"; + std::string app_icon_ = normalize_path(game_config::path + "/" + game_config::images::app_icon); + if (!file_exists(app_icon_)) { + ERR_DU << "Error: Could not find notification icon.\n" + << "raw path =\'" << game_config::path << "\' / \'" << game_config::images::app_icon << "\'\n" + << "normalized path =\'" << app_icon_ << "\'\n"; + } else { + LOG_DU << "app_icon_=\'" << app_icon_ << "\'\n"; + } const char *app_icon = app_icon_.c_str(); const char *summary = owner.c_str();