[haiku-commits] Re: haiku: hrev49418 - in src/apps/haikudepot: model ui

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 22 Jul 2015 14:28:09 +0200

Am 20.07.2015 um 09:06 schrieb Adrien Destugues:

+ if (value.Length()-1 == value.FindLast("/")) {
+ fprintf(stderr,"the url should be be terminated with a '/'\n");
+ return false;
+ }

That doesn't look right. Also, there is an BString::EndsWith() method.

There is a BUrl class which could do the whole URL parsing and normalization.
If there is a reason to not use it here, then the BUrl class should be
improved, rather than writing not easily reuseable code in each application.

The patch was created by Andrew, he doesn't yet have vast knowledge of which support classes would be available to him in the Haiku API. Just something to keep in mind, in general I completely agree with the advice.

I should take the blame for errors pointed out with the patch. I reviewed it on Trac and said it was fine, while at the same time suggesting I would be glad if someone could commit this for me, since I didn't have the time right then. I will try to follow up on the problems pointed out soon.

Best regards,

Other related posts: