diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-02-08 22:05:22 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-02-08 22:05:22 +0100 |
commit | b439ad041ff4478453f0bd4e00f55224d653c69b (patch) | |
tree | d04a05b67e5e7d325ca5f18a567906bcaefad6e1 /src/actions.cpp | |
parent | 4e9da1fb0791336cc25b323aed3bbbb20c1b9fb5 (diff) | |
parent | 91af5e2854d40d06515416b4b89eb66b346ebe56 (diff) | |
download | ayatana-indicator-datetime-b439ad041ff4478453f0bd4e00f55224d653c69b.tar.gz ayatana-indicator-datetime-b439ad041ff4478453f0bd4e00f55224d653c69b.tar.bz2 ayatana-indicator-datetime-b439ad041ff4478453f0bd4e00f55224d653c69b.zip |
Merge branch 'tari01-pr/fix-cppcheck-suppressions'
Attributes GH PR #86: https://github.com/AyatanaIndicators/ayatana-indicator-datetime/pull/86
Diffstat (limited to 'src/actions.cpp')
-rw-r--r-- | src/actions.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/actions.cpp b/src/actions.cpp index 315340a..c184aef 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -1,5 +1,6 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,11 +16,12 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #include <datetime/actions.h> #include <datetime/utils.h> // split_settings_location() - +#include <algorithm> #include <glib.h> #include <gio/gio.h> @@ -50,16 +52,18 @@ DateTime datetime_from_timet_variant(GVariant* v) bool lookup_appointment_by_uid(const std::shared_ptr<State>& state, const gchar* uid, Appointment& setme) { - for(const auto& appt : state->calendar_upcoming->appointments().get()) + bool bRet = false; + + std::for_each(state->calendar_upcoming->appointments().get().begin(), state->calendar_upcoming->appointments().get().end(), [uid, &setme, &bRet](const Appointment& appt) { if (appt.uid == uid) { setme = appt; - return true; + bRet = true; } - } + }); - return false; + return bRet; } void on_appointment_activated (GSimpleAction*, GVariant *vdata, gpointer gself) |