From eb8054f0ae27ce06b8c152edceddac94b5685c07 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 15 Jul 2014 08:11:11 -0500 Subject: use std::chrono to get the milliseconds for notify_notification_set_hint() --- src/snap.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/snap.cpp') diff --git a/src/snap.cpp b/src/snap.cpp index 7332b99..fe8e7f2 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -29,6 +29,7 @@ #include #include +#include #include // std::call_once() #include #include @@ -261,14 +262,14 @@ private: m_nn = notify_notification_new(title, body.c_str(), icon_name); if (m_interactive) { - const int32_t duration_msec = m_sound_builder.duration_minutes()*60*1000; + const auto duration = std::chrono::minutes(m_sound_builder.duration_minutes()); notify_notification_set_hint(m_nn, HINT_SNAP, g_variant_new_boolean(true)); notify_notification_set_hint(m_nn, HINT_TINT, g_variant_new_boolean(true)); notify_notification_set_hint(m_nn, HINT_TIMEOUT, - g_variant_new_int32(duration_msec)); + g_variant_new_int32(std::chrono::duration_cast(duration).count())); /// alarm popup dialog's button to show the active alarm notify_notification_add_action(m_nn, "show", _("Show"), -- cgit v1.2.3