aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-07-27 10:51:54 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-07-27 10:51:54 -0500
commit7271b2139a5c600a2c3cdb4e552e05ddb0f374dd (patch)
tree4e537b6864292c42a846ebfccee76bd04de309ba /src
parent31d63005e2937f7712a515f56645fe3c34628ca8 (diff)
downloadayatana-indicator-datetime-7271b2139a5c600a2c3cdb4e552e05ddb0f374dd.tar.gz
ayatana-indicator-datetime-7271b2139a5c600a2c3cdb4e552e05ddb0f374dd.tar.bz2
ayatana-indicator-datetime-7271b2139a5c600a2c3cdb4e552e05ddb0f374dd.zip
make close return void instead of bool, because after all what more can you do if the call fails? What's the point?
Diffstat (limited to 'src')
-rw-r--r--src/notifications.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/notifications.cpp b/src/notifications.cpp
index 486a910..6d993df 100644
--- a/src/notifications.cpp
+++ b/src/notifications.cpp
@@ -154,42 +154,32 @@ public:
return m_caps.count("actions") != 0;
}
- bool close_all ()
+ void close_all ()
{
- bool all_closed = true;
-
// close() removes the item from m_notifications,
// so increment the iterator before it gets invalidated
for (auto it=m_notifications.begin(), e=m_notifications.end(); it!=e; )
{
const int key = it->first;
++it;
- if (!close (key))
- all_closed = false;
+ close (key);
}
-
- return all_closed;
}
- bool close (int key)
+ void close (int key)
{
- bool is_closed = true;
-
// if we've got this one...
auto it = m_notifications.find(key);
if (it != m_notifications.end())
{
GError * error = nullptr;
- is_closed = notify_notification_close (it->second.nn.get(), &error);
- if (!is_closed)
+ if (!notify_notification_close (it->second.nn.get(), &error))
{
g_warning ("Unable to close notification %d: %s", key, error->message);
g_error_free (error);
}
on_closed (key);
}
-
- return is_closed;
}
int show (const Builder& builder)
@@ -339,16 +329,16 @@ Engine::show(const Builder& builder)
return impl->show(builder);
}
-bool
+void
Engine::close_all()
{
- return impl->close_all();
+ impl->close_all();
}
-bool
+void
Engine::close(int key)
{
- return impl->close(key);
+ impl->close(key);
}
const std::string&