diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-06-19 02:32:07 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-06-19 02:32:07 +0000 |
| commit | f164dc6009f644939ba5fb09503fe0e35f1d4aae (patch) | |
| tree | 281c32b52168c049ce35d0f459413c28aa92a7b1 /src/selection-describer.cpp | |
| parent | Add clip group option from Ponyscape (diff) | |
| parent | Fix make check (diff) | |
| download | inkscape-f164dc6009f644939ba5fb09503fe0e35f1d4aae.tar.gz inkscape-f164dc6009f644939ba5fb09503fe0e35f1d4aae.zip | |
Update to experimental r13404
(bzr r13090.1.84)
Diffstat (limited to 'src/selection-describer.cpp')
| -rw-r--r-- | src/selection-describer.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index 88450dfdf..1cb96fed0 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -56,6 +56,21 @@ char* collect_terms (GSList *items) return g_strdup(ss.str().c_str()); } +// Returns the number of terms in the list +static int count_terms (GSList *items) +{ + GSList *check = NULL; + int count=0; + for (GSList *i = (GSList *)items; i != NULL; i = i->next) { + const char *term = SP_ITEM(i->data)->displayName(); + if (term != NULL && g_slist_find (check, term) == NULL) { + check = g_slist_prepend (check, (void *) term); + count++; + } + } + return count; +} + // Returns the number of filtered items in the list static int count_filtered (GSList *items) { @@ -194,9 +209,12 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select } else { // multiple items int objcount = g_slist_length((GSList *)items); char *terms = collect_terms ((GSList *)items); - - gchar *objects_str = g_strdup_printf( - "<b>%i</b> objects selected of types %s", objcount, terms); + int n_terms = count_terms((GSList *)items); + + gchar *objects_str = g_strdup_printf(ngettext( + "<b>%i</b> objects selected of type %s", + "<b>%i</b> objects selected of types %s", n_terms), + objcount, terms); g_free(terms); |
