Francois Gouget : testbot/cgi: Improve the title for multi-word collection / item class names.

Alexandre Julliard julliard at winehq.org
Wed Mar 30 15:17:55 CDT 2022


Module: tools
Branch: master
Commit: 1c90fd56e778b654da080b3cf39047d805e4f1f3
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=1c90fd56e778b654da080b3cf39047d805e4f1f3

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Mar 30 19:05:07 2022 +0200

testbot/cgi: Improve the title for multi-word collection / item class names.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/lib/ObjectModel/CGI/CollectionPage.pm | 4 +++-
 testbot/lib/ObjectModel/CGI/ItemPage.pm       | 7 +++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/testbot/lib/ObjectModel/CGI/CollectionPage.pm b/testbot/lib/ObjectModel/CGI/CollectionPage.pm
index d59310b..ddbbd66 100644
--- a/testbot/lib/ObjectModel/CGI/CollectionPage.pm
+++ b/testbot/lib/ObjectModel/CGI/CollectionPage.pm
@@ -137,7 +137,9 @@ sub GetTitle($)
 {
   my ($self) = @_;
 
-  return ucfirst($self->{Collection}->GetCollectionName());
+  my $Title = ucfirst($self->{Collection}->GetCollectionName());
+  $Title =~ s/([a-z])([A-Z])/$1 $2/g;
+  return $Title;
 }
 
 sub GenerateTitle($)
diff --git a/testbot/lib/ObjectModel/CGI/ItemPage.pm b/testbot/lib/ObjectModel/CGI/ItemPage.pm
index 66fcab7..567a489 100644
--- a/testbot/lib/ObjectModel/CGI/ItemPage.pm
+++ b/testbot/lib/ObjectModel/CGI/ItemPage.pm
@@ -94,8 +94,11 @@ sub GetTitle($)
 {
   my ($self) = @_;
 
-  return $self->GetParam("Key") ? $self->GetParam("Key") :
-             "Add " . $self->{Collection}->GetItemName();
+  return $self->GetParam("Key") if ($self->GetParam("Key"));
+
+  my $Title = $self->{Collection}->GetItemName();
+  $Title =~ s/([a-z])([A-Z])/$1 $2/g;
+  return "Add $Title";
 }
 
 sub GenerateFormStart($)




More information about the wine-cvs mailing list