[haiku-commits] Re: r40672 - in haiku/trunk/src: apps/devices apps/processcontroller preferences/touchpad

  • From: Siarzhuk Zharski <zharik@xxxxxx>
  • To: <haiku-commits@xxxxxxxxxxxxx>
  • Date: Fri, 25 Feb 2011 10:09:20 +0200

On Fri, 25 Feb 2011 09:35:29 +0200, Jorma Karvonen wrote:
my idea was that attribute names like "Manufacturer" are not localized
at all when setting attributes but localizing is done when attributes
are shown in Details tab (for example). Here I have enclosed a filter
that check if there are two duplicate "Manufacturer" attributes: one
with value "unknown" or "Unknown" and another some reasonable text
like "Intel Corporation".

The problem is that some string resources are coming from other parts of system: Value of Class Info, for example.

if (iter->first == "Manufacturer" && (iter->second == "Unknown" ||
                    iter->second == "unknown")) {
                    for (another = fAttributeMap.begin();
                        another != fAttributeMap.end(); another++) {
                        if ((another->first == "Manufacturer") &&
                            ((another->second != "unknown") ||
                            (another->second != "Unknown"))) {
                                str << another->first << " : ";
                                str << another->second << "\n";
                                getaway = true;
                                continue;
                        }
                    }
}

I found it a CPU resource consuming way. In my last changes some parts of this are handled by using B_TRANSLATE_MARK. This looks at least more compact. ;-)

--
Kind Regards,
   S.Zharski

Other related posts: