[pitivi] elements: Better names for fields
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] elements: Better names for fields
- Date: Mon, 11 Nov 2019 22:06:35 +0000 (UTC)
commit b849d21aee3f266a94d428485a07d51ae91cc7dc
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Tue Oct 29 16:36:18 2019 +0100
elements: Better names for fields
`_audioSource` suggests it's a GES source when it's actually a widget.
pitivi/editorperspective.py | 8 ++++----
pitivi/timeline/elements.py | 28 ++++++++++++++--------------
tests/test_timeline_timeline.py | 4 ++--
3 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/pitivi/editorperspective.py b/pitivi/editorperspective.py
index 020c8186..53c634d6 100644
--- a/pitivi/editorperspective.py
+++ b/pitivi/editorperspective.py
@@ -138,10 +138,10 @@ class EditorPerspective(Perspective, Loggable):
for ges_layer in ges_timeline.get_layers():
for ges_clip in ges_layer.get_clips():
if ges_clip.get_asset().props.id in changed_files_uris:
- if ges_clip.ui._audioSource:
- ges_clip.ui._audioSource.update_previewer()
- if ges_clip.ui._videoSource:
- ges_clip.ui._videoSource.update_previewer()
+ if ges_clip.ui.audio_widget:
+ ges_clip.ui.audio_widget.update_previewer()
+ if ges_clip.ui.video_widget:
+ ges_clip.ui.video_widget.update_previewer()
def _destroyedCb(self, unused_main_window):
"""Cleanup before destroying this window."""
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 7dca7d71..a58491c1 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -1097,8 +1097,8 @@ class Clip(Gtk.EventBox, Zoomable, Loggable):
self.ges_clip.ui = self
self.ges_clip.selected = Selected()
- self._audioSource = None
- self._videoSource = None
+ self.audio_widget = None
+ self.video_widget = None
self._setupWidget()
self.__force_position_update = True
@@ -1400,15 +1400,15 @@ class UriClip(SourceClip):
return
if ges_timeline_element.get_track_type() == GES.TrackType.AUDIO:
- self._audioSource = AudioUriSource(ges_timeline_element, self.timeline)
- ges_timeline_element.ui = self._audioSource
- self._elements_container.pack_end(self._audioSource, True, False, 0)
- self._audioSource.set_visible(True)
+ self.audio_widget = AudioUriSource(ges_timeline_element, self.timeline)
+ ges_timeline_element.ui = self.audio_widget
+ self._elements_container.pack_end(self.audio_widget, True, False, 0)
+ self.audio_widget.set_visible(True)
elif ges_timeline_element.get_track_type() == GES.TrackType.VIDEO:
- self._videoSource = VideoUriSource(ges_timeline_element, self.timeline)
- ges_timeline_element.ui = self._videoSource
- self._elements_container.pack_start(self._videoSource, True, False, 0)
- self._videoSource.set_visible(True)
+ self.video_widget = VideoUriSource(ges_timeline_element, self.timeline)
+ ges_timeline_element.ui = self.video_widget
+ self._elements_container.pack_start(self.video_widget, True, False, 0)
+ self.video_widget.set_visible(True)
class TitleClip(SourceClip):
@@ -1421,10 +1421,10 @@ class TitleClip(SourceClip):
return
if ges_timeline_element.get_track_type() == GES.TrackType.VIDEO:
- self._videoSource = TitleSource(ges_timeline_element, self.timeline)
- ges_timeline_element.ui = self._videoSource
- self._elements_container.pack_start(self._videoSource, True, False, 0)
- self._videoSource.set_visible(True)
+ self.video_widget = TitleSource(ges_timeline_element, self.timeline)
+ ges_timeline_element.ui = self.video_widget
+ self._elements_container.pack_start(self.video_widget, True, False, 0)
+ self.video_widget.set_visible(True)
class TransitionClip(Clip):
diff --git a/tests/test_timeline_timeline.py b/tests/test_timeline_timeline.py
index 3eec06b1..6927b924 100644
--- a/tests/test_timeline_timeline.py
+++ b/tests/test_timeline_timeline.py
@@ -459,8 +459,8 @@ class TestGrouping(BaseTestTimeline):
vclip = ges_clip0.ui
vtrackelem = bTrackElem0.ui
- self.assertEqual(aclip._audioSource, atrackelem)
- self.assertEqual(vclip._videoSource, vtrackelem)
+ self.assertEqual(aclip.audio_widget, atrackelem)
+ self.assertEqual(vclip.video_widget, vtrackelem)
def test_dragging_group_on_separator(self):
# Create two clips on different layers and group them.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]