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

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 20 Oct 2016 13:16:41 +0200

Hi Andrew,

welcome to this list! :-)

I'll just point out a few minor style issues:

ebb1a01c4893: HaikuDepot: Handling for communications with application server 
over multiple repositories

The commit title should not exceed 64 characters.

@@ -464,11 +465,18 @@ Model::AddDepot(const DepotInfo& depot)
 bool
 Model::HasDepot(const BString& name) const
 {
+       return NULL != DepotForName(name);

It's always "DepotForName(name) != NULL" for us.

@@ -827,6 +835,59 @@ Model::SetAuthorization(const BString& username, const 
BString& password,


 void
+Model::PopulateWebAppRepositoryCode(DepotInfo& depotInfo)
+{
+       if (depotInfo.BaseURL().Length() > 0) {
+
+               BMessage repositoriesEnvelope;

Stray blank line (here and at other places).

+               BMessage result;
+               double total;
+               StringList repositorySourceBaseURLs;
+
+               repositorySourceBaseURLs.Add(depotInfo.BaseURL());
+
+        // TODO; better API call handling around errors.

Indentation using spaces.

+               if (fWebAppInterface.RetrieveRepositoriesForSourceBaseURLs(
+                       repositorySourceBaseURLs, repositoriesEnvelope) == B_OK
+                       && repositoriesEnvelope.FindMessage("result", &result) 
== B_OK

The second line should be indented one more tab, as it's a different level than the '&&' on the next line.

+                       && result.FindDouble("total", &total) == B_OK) {
+
+                       if ((int64) total > 0) {

No space between cast and variable.

[...]
+               if (status == B_OK) {
+                       // Parse message
+       //              info.PrintToStream();

Dead debug output could be removed.

Bye,
   Axel.

Other related posts: