diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2015-01-14 23:50:25 +0100 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2015-01-14 23:50:25 +0100 |
| commit | 2309aac683cc44ff7bcffa98a8d5b12ff0991d22 (patch) | |
| tree | 074251726d6de4e3aaa26fe2f560dfe98ffccab6 /tests | |
| parent | c472fcc13a054e56e2eb2258c5bc8691e1513350 (diff) | |
DBusIndicators: rebuild entry only if priority has changed (don't keep track of index at this level)
(bzr r3899.2.8)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_indicator.cpp | 2 | ||||
| -rw-r--r-- | tests/test_service_panel.cpp | 16 |
2 files changed, 8 insertions, 10 deletions
diff --git a/tests/test_indicator.cpp b/tests/test_indicator.cpp index 47707d46d..855b27a49 100644 --- a/tests/test_indicator.cpp +++ b/tests/test_indicator.cpp @@ -57,7 +57,6 @@ TEST(TestIndicator, Construction) EXPECT_EQ(indicator.name(), "indicator-test"); EXPECT_FALSE(indicator.IsAppmenu()); EXPECT_EQ(indicator.GetEntry("test-entry"), nullptr); - EXPECT_EQ(indicator.EntryIndex("test-entry"), -1); EXPECT_TRUE(indicator.GetEntries().empty()); } @@ -110,7 +109,6 @@ TEST(TestIndicator, Syncing) indicator.Sync(sync_data); EXPECT_EQ(indicator.GetEntries().size(), 2); EXPECT_EQ(indicator.GetEntry("test-entry-2"), nullptr); - EXPECT_EQ(indicator.EntryIndex("test-entry-2"), -1); // Sync the indicator removing an entry and adding a new one entry = new Entry("test-entry-4", "name-hint", 0, "label", true, true, 0, "icon", diff --git a/tests/test_service_panel.cpp b/tests/test_service_panel.cpp index eca0ba7a5..ef8d70404 100644 --- a/tests/test_service_panel.cpp +++ b/tests/test_service_panel.cpp @@ -33,7 +33,7 @@ static const char * panel_interface = "</node>\n" ; -void add_entry_id(GVariantBuilder *b) +void add_entry_id(GVariantBuilder *b, gint priority) { g_variant_builder_add (b, ENTRY_SIGNATURE, "test_indicator_id", @@ -47,10 +47,10 @@ void add_entry_id(GVariantBuilder *b) "", /* image_data */ TRUE, /* image sensitive */ TRUE, /* image visible */ - 1 /* priority */); + priority); } -void add_entry_id_2(GVariantBuilder *b) +void add_entry_id_2(GVariantBuilder *b, gint priority) { g_variant_builder_add (b, ENTRY_SIGNATURE, "test_indicator_id", @@ -64,7 +64,7 @@ void add_entry_id_2(GVariantBuilder *b) "", /* image_data */ TRUE, /* image sensitive */ TRUE, /* image visible */ - 1 /* priority */); + priority); } } @@ -90,13 +90,13 @@ GVariant* Panel::OnMethodCall(std::string const& method, GVariant *parameters) if (sync_return_mode_ == 0) { - add_entry_id(&b); - add_entry_id_2(&b); + add_entry_id(&b, 1); + add_entry_id_2(&b, 2); } else if (sync_return_mode_ == 1) { - add_entry_id_2(&b); - add_entry_id(&b); + add_entry_id_2(&b, 1); + add_entry_id(&b, 2); } if (sync_return_mode_ == 1) |
