aboutsummaryrefslogtreecommitdiff
path: root/src/snap.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-07-15 08:11:11 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-07-15 08:11:11 -0500
commiteb8054f0ae27ce06b8c152edceddac94b5685c07 (patch)
tree773be424bd95c5684955e994a8ab428728f54342 /src/snap.cpp
parent5b1f9d5eebb291117945ed4249af32a6a08194b0 (diff)
downloadayatana-indicator-datetime-eb8054f0ae27ce06b8c152edceddac94b5685c07.tar.gz
ayatana-indicator-datetime-eb8054f0ae27ce06b8c152edceddac94b5685c07.tar.bz2
ayatana-indicator-datetime-eb8054f0ae27ce06b8c152edceddac94b5685c07.zip
use std::chrono to get the milliseconds for notify_notification_set_hint()
Diffstat (limited to 'src/snap.cpp')
-rw-r--r--src/snap.cpp5
1 files changed, 3 insertions, 2 deletions
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 <glib/gi18n.h>
#include <glib.h>
+#include <chrono>
#include <mutex> // std::call_once()
#include <set>
#include <string>
@@ -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<std::chrono::milliseconds>(duration).count()));
/// alarm popup dialog's button to show the active alarm
notify_notification_add_action(m_nn, "show", _("Show"),