aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-07-27 00:08:29 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-07-27 00:08:29 -0500
commita1e8addae51d3f8a026630b47b0c42c11cd52507 (patch)
treedd42576bdce387ca1bd83b280ab5bbb34e0c15a7 /src
parentfcd77b806a8826d5f694f78c63943d0f768ef6ec (diff)
downloadayatana-indicator-datetime-a1e8addae51d3f8a026630b47b0c42c11cd52507.tar.gz
ayatana-indicator-datetime-a1e8addae51d3f8a026630b47b0c42c11cd52507.tar.bz2
ayatana-indicator-datetime-a1e8addae51d3f8a026630b47b0c42c11cd52507.zip
copyediting
Diffstat (limited to 'src')
-rw-r--r--src/notifications.cpp2
-rw-r--r--src/snap.cpp29
2 files changed, 14 insertions, 17 deletions
diff --git a/src/notifications.cpp b/src/notifications.cpp
index 41ced42..486a910 100644
--- a/src/notifications.cpp
+++ b/src/notifications.cpp
@@ -160,7 +160,7 @@ public:
// close() removes the item from m_notifications,
// so increment the iterator before it gets invalidated
- for (auto it=m_notifications.begin(), end=m_notifications.end(); it!=end; )
+ for (auto it=m_notifications.begin(), e=m_notifications.end(); it!=e; )
{
const int key = it->first;
++it;
diff --git a/src/snap.cpp b/src/snap.cpp
index 4da4b45..d99e5ef 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -109,38 +109,35 @@ void Snap::operator()(const Appointment& appointment,
auto sound = std::make_shared<uin::Sound>(uri, volume, loop);
// show a notification...
- const auto minutes = m_settings->alarm_duration.get();
+ const auto minutes = std::chrono::minutes(m_settings->alarm_duration.get());
const bool interactive = m_engine->supports_actions();
- uin::Builder notification_builder;
- notification_builder.set_body (appointment.summary);
- notification_builder.set_icon_name ("alarm-clock");
- notification_builder.add_hint (uin::Builder::HINT_SNAP);
- notification_builder.add_hint (uin::Builder::HINT_TINT);
+ uin::Builder b;
+ b.set_body (appointment.summary);
+ b.set_icon_name ("alarm-clock");
+ b.add_hint (uin::Builder::HINT_SNAP);
+ b.add_hint (uin::Builder::HINT_TINT);
const auto timestr = appointment.begin.format (_("%a, %X"));
auto title = g_strdup_printf (_("Alarm %s"), timestr.c_str());
- notification_builder.set_title (title);
+ b.set_title (title);
g_free (title);
- notification_builder.set_timeout (std::chrono::duration_cast<std::chrono::seconds>(std::chrono::minutes(minutes)));
+ b.set_timeout (std::chrono::duration_cast<std::chrono::seconds>(minutes));
if (interactive) {
- notification_builder.add_action ("show", _("Show"));
- notification_builder.add_action ("dismiss", _("Dismiss"));
+ b.add_action ("show", _("Show"));
+ b.add_action ("dismiss", _("Dismiss"));
}
// add the 'sound' and 'awake' objects to the capture so that
// they stay alive until the closed callback is called; i.e.,
// for the lifespan of the notficiation
- notification_builder.set_closed_callback([appointment,
- show,
- dismiss,
- sound,
- awake](const std::string& action){
+ b.set_closed_callback([appointment, show, dismiss, sound, awake]
+ (const std::string& action){
if (action == "show")
show(appointment);
else
dismiss(appointment);
});
- const auto key = m_engine->show (notification_builder);
+ const auto key = m_engine->show(b);
if (key)
m_notifications.insert (key);
else