- int num_apt = _airports->size();
- _content = new char *[num_apt + 1];
-
- int n = 0;
- for (int i = 0; i < num_apt; i++) {
- const FGAirport *apt = _airports->getAirport(i);
- STD::string entry(apt->getName() + " (" + apt->getId() + ')');
-
- if (!_filter.empty() && entry.find(_filter) == STD::string::npos)
- continue;
-
- _content[n] = new char[entry.size() + 1];
- strcpy(_content[n], entry.c_str());
- n++;
- }
- _content[n] = 0;
- newList(_content);