aboutsummaryrefslogtreecommitdiff
path: root/src/menu.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-02-23 22:48:57 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-02-23 22:48:57 -0600
commit5bae051d727588fec82f337c26629be48c6c47e1 (patch)
tree3d041a062edd9cded8a22cff1d358fbb58af8c61 /src/menu.cpp
parentce576453c6e8dbc38918600480c7cb4b68e37688 (diff)
downloadayatana-indicator-datetime-5bae051d727588fec82f337c26629be48c6c47e1.tar.gz
ayatana-indicator-datetime-5bae051d727588fec82f337c26629be48c6c47e1.tar.bz2
ayatana-indicator-datetime-5bae051d727588fec82f337c26629be48c6c47e1.zip
actually, why keep the local variable at all. Use g_menu_model_get_n_items() to see if we've reached MAX_APPTS yet.
Diffstat (limited to 'src/menu.cpp')
-rw-r--r--src/menu.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/menu.cpp b/src/menu.cpp
index a1cd18c..12ec3ef 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -261,7 +261,6 @@ private:
void add_appointments(GMenu* menu, Profile profile)
{
- int n = 0;
const int MAX_APPTS = 5;
std::set<std::string> added;
@@ -272,7 +271,7 @@ private:
continue;
// don't show too many
- if (n++ >= MAX_APPTS)
+ if (g_menu_model_get_n_items (G_MENU_MODEL(menu) >= MAX_APPTS))
break;
added.insert(appt.uid);