From 0c654b464fa215190c5fef74e8aa6e0d951224e7 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Tue, 26 Apr 2016 12:02:03 -0300 Subject: Fixed as reviewer requested. --- include/notifications/notifications.h | 2 +- src/notifications.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/notifications/notifications.h b/include/notifications/notifications.h index 2bb6694..4b66800 100644 --- a/include/notifications/notifications.h +++ b/include/notifications/notifications.h @@ -81,7 +81,7 @@ public: private: friend class Engine; class Impl; - std::shared_ptr impl; + std::unique_ptr impl; }; /** diff --git a/src/notifications.cpp b/src/notifications.cpp index 076ad13..f3dcb14 100644 --- a/src/notifications.cpp +++ b/src/notifications.cpp @@ -278,8 +278,9 @@ public: uuid_t message_uuid; uuid_generate(message_uuid); - char message_id[37]; - uuid_unparse(message_uuid, message_id); + char uuid_buf[37]; + uuid_unparse(message_uuid, uuid_buf); + const std::string message_id(uuid_buf); GIcon *icon = g_themed_icon_new(data.m_icon_name.c_str()); @@ -287,7 +288,7 @@ public: if (!messaging_menu_app_has_source(m_messaging_app.get(), m_app_name.c_str())) messaging_menu_app_append_source(m_messaging_app.get(), m_app_name.c_str(), icon, "Calendar"); - auto msg = messaging_menu_message_new(message_id, + auto msg = messaging_menu_message_new(message_id.c_str(), icon, data.m_title.c_str(), nullptr, @@ -297,7 +298,7 @@ public: if (msg) { std::shared_ptr msg_data(new messaging_menu_data{message_id, data.m_missed_click_callback, this}); - m_messaging_messages[std::string(message_id)] = msg_data; + m_messaging_messages[message_id] = msg_data; g_signal_connect(G_OBJECT(msg), "activate", G_CALLBACK(on_message_activated), msg_data.get()); messaging_menu_app_append_message(m_messaging_app.get(), msg, m_app_name.c_str(), false); -- cgit v1.2.3