[pitivi] effects: Make sure the displayed names are unique
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] effects: Make sure the displayed names are unique
- Date: Wed, 20 Jan 2016 19:18:51 +0000 (UTC)
commit 8f491f0d99dcec71e5840e400c2c725508547a41
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Thu Jan 14 14:22:42 2016 +0100
effects: Make sure the displayed names are unique
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D672
pitivi/effects.py | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/effects.py b/pitivi/effects.py
index 5cae000..d9571bc 100644
--- a/pitivi/effects.py
+++ b/pitivi/effects.py
@@ -180,6 +180,14 @@ class EffectsManager(object):
uselessRe = re.compile(" |".join(uselessWords))
factories = Gst.Registry.get().get_feature_list(Gst.ElementFactory)
+ longnames = set()
+ duplicate_longnames = set()
+ for factory in factories:
+ longname = factory.get_longname()
+ if longname in longnames:
+ duplicate_longnames.add(longname)
+ else:
+ longnames.add(longname)
for factory in factories:
klass = factory.get_klass()
name = factory.get_name()
@@ -198,7 +206,12 @@ class EffectsManager(object):
HIDDEN_EFFECTS.append(name)
continue
- human_name = uselessRe.sub("", factory.get_longname()).title()
+ longname = factory.get_longname()
+ if longname in duplicate_longnames:
+ # Workaround https://bugzilla.gnome.org/show_bug.cgi?id=760566
+ # Add name which identifies the element and is unique.
+ longname = "%s %s" % (longname, name)
+ human_name = uselessRe.sub("", longname).title()
effect = EffectInfo(name,
media_type,
categories=self._getEffectCategories(name),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]