[2/5] testbot/web: Simplify the FeedBack page by using GetParam() to set suitable defaults.

Francois Gouget fgouget at codeweavers.com
Fri Jun 13 11:23:32 CDT 2014


---

GetParam() is a bit badly named. In fact it just thunks to CGI::param() 
which lacks the 'Get' because it can do both get and set depending on 
how it's called.

 testbot/web/Feedback.pl | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/testbot/web/Feedback.pl b/testbot/web/Feedback.pl
index f0ae921..5d3e2e6 100644
--- a/testbot/web/Feedback.pl
+++ b/testbot/web/Feedback.pl
@@ -42,27 +42,11 @@ sub _initialize($$$)
   my $Session = $self->GetCurrentSession();
   if (defined($Session))
   {
+    # Provide default values
     my $User = $Session->User;
-    $self->{Name} = $User->RealName;
-    $self->{EMail} = $User->EMail;
+    $self->GetParam("Name", $User->RealName) if (!defined $self->GetParam("Name"));
+    $self->GetParam("EMail", $User->EMail) if (!defined $self->GetParam("EMail"));
   }
-  else
-  {
-    $self->{Name} = undef;
-    $self->{EMail} = undef;
-  }
-}
-
-sub GetPropertyValue($$)
-{
-  my ($self, $PropertyDescriptor) = @_;
-
-  if (defined($self->{$PropertyDescriptor->GetName()}))
-  {
-    return $self->{$PropertyDescriptor->GetName()};
-  }
-
-  return $self->SUPER::GetPropertyValue($PropertyDescriptor);
 }
 
 sub GetTitle($)
-- 
2.0.0




More information about the wine-patches mailing list