From: Aleš Křenek Date: Thu, 6 Mar 2008 15:46:06 +0000 (+0000) Subject: fixed previous quick fix X-Git-Tag: glite-lb-client_R_3_1_4_1~3 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=b6974c9149403c0ffafb422f6a298498ec185814;p=jra1mw.git fixed previous quick fix --- diff --git a/org.glite.lb.client/project/ChangeLog b/org.glite.lb.client/project/ChangeLog index 6599f81..e2370e0 100644 --- a/org.glite.lb.client/project/ChangeLog +++ b/org.glite.lb.client/project/ChangeLog @@ -19,3 +19,7 @@ 3.1.3-1 (lb-1.7.5-1) - align attr_names[] (used in getAttrName methods) in Event and JobStatus to definitions in *.h from lb.client-interface + +3.1.4-1 +- do the previous quick fix thoroughly -- don't smash name_with_underscores + and nameWithUppercaseLetters diff --git a/org.glite.lb.client/src/Event.cpp.T b/org.glite.lb.client/src/Event.cpp.T index 5b15845..0c53fef 100644 --- a/org.glite.lb.client/src/Event.cpp.T +++ b/org.glite.lb.client/src/Event.cpp.T @@ -324,12 +324,15 @@ Event::name(void) const static std::string const attr_names[Event::ATTR_MAX] = { @@@{ -# for (sort {$a cmp $b} getAllFields $event) { -# gen "\t\"$_\",\n"; -# } + my %s; + + for (getAllFields $event) { + my $id = $_; + $id =~ s/([a-z])([A-Z])/$1_$2/g; + $s{uc($id)} = $_; + } for (@main::EventAttrNames) { - $_ = lc $_; - gen "\t\"$_\",\n"; + gen "\t\"$s{$_}\",\n"; } @@@} }; diff --git a/org.glite.lb.client/src/JobStatus.cpp.T b/org.glite.lb.client/src/JobStatus.cpp.T index 1ea969d..3403039 100644 --- a/org.glite.lb.client/src/JobStatus.cpp.T +++ b/org.glite.lb.client/src/JobStatus.cpp.T @@ -410,10 +410,15 @@ JobStatus::getValJobStatusList(Attr attr) const static std::string const attr_names[JobStatus::ATTR_MAX] = { @@@{ -# for (sort {$a cmp $b} getAllFields $status) { + my %s; + + for (getAllFields $status) { + my $id = $_; + $id =~ s/([a-z])([A-Z])/$1_$2/g; + $s{uc($id)} = $_; + } for (@main::StatusAttrNames) { - $_ = lc $_; - gen "\t\"$_\",\n"; + gen "\t\"$s{$_}\",\n"; } @@@} };