From 5bae051d727588fec82f337c26629be48c6c47e1 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 23 Feb 2014 22:48:57 -0600 Subject: actually, why keep the local variable at all. Use g_menu_model_get_n_items() to see if we've reached MAX_APPTS yet. --- src/menu.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/menu.cpp') 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 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); -- cgit v1.2.3