[pitivi] project: cast remaining uncasted restriction fields.



commit 7395094af937486a3f987ae5ca5baea2ccbae3c0
Author: Mathieu Duponchelle <mduponchelle1 gmail com>
Date:   Fri Jan 31 01:12:09 2014 +0100

    project: cast remaining uncasted restriction fields.
    
    Also check that value is not None before trying to cast it
    (for example the preset system tries to pass None to these functions)
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=720699

 pitivi/project.py |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/pitivi/project.py b/pitivi/project.py
index fd20db8..38f5f40 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -684,7 +684,7 @@ class Project(Loggable, GES.Project):
 
     @videowidth.setter
     def videowidth(self, value):
-        if self.set_video_restriction_value("width", int(value)):
+        if value and self.set_video_restriction_value("width", int(value)):
             self._emitChange("rendering-settings-changed", "width", value)
 
     @property
@@ -693,8 +693,7 @@ class Project(Loggable, GES.Project):
 
     @videoheight.setter
     def videoheight(self, value):
-        value = int(value)
-        if self.set_video_restriction_value("height", int(value)):
+        if value and self.set_video_restriction_value("height", int(value)):
             self._emitChange("rendering-settings-changed", "height", value)
 
     @property
@@ -720,7 +719,7 @@ class Project(Loggable, GES.Project):
 
     @audiochannels.setter
     def audiochannels(self, value):
-        if self.set_audio_restriction_value("channels", value):
+        if value and self.set_audio_restriction_value("channels", int(value)):
             self._emitChange("rendering-settings-changed", "channels", value)
 
     @property
@@ -732,7 +731,7 @@ class Project(Loggable, GES.Project):
 
     @audiorate.setter
     def audiorate(self, value):
-        if self.set_audio_restriction_value("rate", value):
+        if value and self.set_audio_restriction_value("rate", int(value)):
             self._emitChange("rendering-settings-changed", "rate", value)
 
     @property


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]