aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-02-05 16:30:11 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-02-05 16:30:11 -0600
commit5c91c53c1d56a356e091d6910b8c71e7c139f46a (patch)
treec72d14087101f88dc055a92b9ef5fa1ceccedd8a /src/main.cpp
parent613cbb1d468fe99767a5541956266191511ec9ef (diff)
downloadayatana-indicator-datetime-5c91c53c1d56a356e091d6910b8c71e7c139f46a.tar.gz
ayatana-indicator-datetime-5c91c53c1d56a356e091d6910b8c71e7c139f46a.tar.bz2
ayatana-indicator-datetime-5c91c53c1d56a356e091d6910b8c71e7c139f46a.zip
if an alarm doesn't have a URL associated with it, use 'appid://com.ubuntu.clock/clock/current-user-version' as a fallback url.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 5f5ee3c..2be727f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -70,7 +70,14 @@ main(int /*argc*/, char** /*argv*/)
Snap snap;
clock_watcher.alarm_reached().connect([&snap,&eds_planner](const Appointment& appt){
eds_planner->block_appointment(appt); // when we show a snap decision, take it out of the menu
- auto snap_show = [](const Appointment& a){url_dispatch_send(a.url.c_str(), nullptr, nullptr);};
+ auto snap_show = [](const Appointment& a){
+ const char* url;
+ if(!a.url.empty())
+ url = a.url.c_str();
+ else // alarm doesn't have a URl associated with it; use a fallback
+ url = "appid://com.ubuntu.clock/clock/current-user-version";
+ url_dispatch_send(url, nullptr, nullptr);
+ };
auto snap_dismiss = [](const Appointment&){};
snap(appt, snap_show, snap_dismiss);
});