[gnote] Depend on and use BOOST_FOREACH
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Depend on and use BOOST_FOREACH
- Date: Sun, 14 Jul 2013 18:39:35 +0000 (UTC)
commit 7be57bf21771d406ad9b0239cf0be3faf109f7f9
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun Jul 14 21:38:43 2013 +0300
Depend on and use BOOST_FOREACH
configure.ac | 1 +
src/notebooks/notebook.cpp | 11 ++++++-----
2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f352068..afd11ea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,6 +90,7 @@ PKG_CHECK_MODULES(LIBSECRET, [libsecret-1 >= $LIBSECRET_VERSION])
BOOST_REQUIRE([$BOOST_VERSION])
BOOST_BIND
BOOST_CONVERSION
+BOOST_FOREACH
BOOST_FORMAT
BOOST_TEST([s])
AC_CHECK_HEADER(tr1/memory,,[
diff --git a/src/notebooks/notebook.cpp b/src/notebooks/notebook.cpp
index 76cc065..0ed79a4 100644
--- a/src/notebooks/notebook.cpp
+++ b/src/notebooks/notebook.cpp
@@ -20,6 +20,7 @@
+#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <glibmm/i18n.h>
@@ -115,9 +116,9 @@ namespace notebooks {
}
std::list<Note*> notes;
template_tag->get_notes(notes);
- for (std::list<Note*>::iterator iter = notes.begin(); iter != notes.end(); ++iter) {
- if ((*iter)->contains_tag (notebook_tag)) {
- note = (*iter)->shared_from_this();
+ BOOST_FOREACH(Note *n, notes) {
+ if(n->contains_tag(notebook_tag)) {
+ note = n->shared_from_this();
break;
}
}
@@ -347,8 +348,8 @@ namespace notebooks {
// ignore template notes
Tag::Ptr template_tag =
ITagManager::obj().get_or_create_system_tag(ITagManager::TEMPLATE_NOTE_SYSTEM_TAG);
- for(std::set<Note::Ptr>::iterator iter = m_notes.begin(); iter != m_notes.end(); ++iter) {
- if(!(*iter)->contains_tag(template_tag)) {
+ BOOST_FOREACH(Note::Ptr note, m_notes) {
+ if(!note->contains_tag(template_tag)) {
return false;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]