1
0
Fork 0

remove a few unused vars

menubar: cosmetics of the day
This commit is contained in:
mfranz 2005-12-15 20:07:14 +00:00
parent 98081d9243
commit f6225f5cb7
2 changed files with 15 additions and 11 deletions

View file

@ -525,7 +525,12 @@ FGDialog::makeObject (SGPropertyNode * props, int parentWidth, int parentHeight)
return obj;
} else if (type == "list") {
puList * obj = new puList(x, y, x + width, y + height);
vector<SGPropertyNode_ptr> value_nodes = props->getChildren("value");
char ** entries = make_char_array(value_nodes.size());
for (unsigned int i = 0; i < value_nodes.size(); i++)
entries[i] = strdup((char *)value_nodes[i]->getStringValue());
puList * obj = new puList(x, y, x + width, y + height, entries);
setupObject(obj, props);
setColor(obj, props);
return obj;
@ -590,10 +595,9 @@ FGDialog::makeObject (SGPropertyNode * props, int parentWidth, int parentHeight)
} else if (type == "combo") {
vector<SGPropertyNode_ptr> value_nodes = props->getChildren("value");
char ** entries = make_char_array(value_nodes.size());
for (unsigned int i = 0, j = value_nodes.size() - 1;
i < value_nodes.size();
i++, j--)
for (unsigned int i = 0; i < value_nodes.size(); i++)
entries[i] = strdup((char *)value_nodes[i]->getStringValue());
puComboBox * obj = new puComboBox(x, y, x + width, y + height, entries,
props->getBoolValue("editable", false));
setupObject(obj, props);
@ -650,10 +654,9 @@ FGDialog::makeObject (SGPropertyNode * props, int parentWidth, int parentHeight)
value_nodes.push_back(selection_node->getChild(q));
char ** entries = make_char_array(value_nodes.size());
for (unsigned int i = 0, j = value_nodes.size() - 1;
i < value_nodes.size();
i++, j--)
for (unsigned int i = 0; i < value_nodes.size(); i++)
entries[i] = strdup((char *)value_nodes[i]->getName());
puSelectBox * obj =
new puSelectBox(x, y, x + width, y + height, entries);
setupObject(obj, props);

View file

@ -423,12 +423,13 @@ FGMenuBar::add_enabled_listener(SGPropertyNode * node)
bool
FGMenuBar::enable_item(const SGPropertyNode * node, bool state)
{
if (!node || _objects.find(node->getPath()) == _objects.end()) {
SG_LOG(SG_GENERAL, SG_WARN, "Trying to enable/disable "
"non-existent menu item");
const char *path = node->getPath();
if (_objects.find(path) == _objects.end()) {
SG_LOG(SG_GENERAL, SG_ALERT, "Trying to enable/disable "
"non-existent menu item for node `" << path << '\'');
return false;
}
puObject *object = _objects[node->getPath()];
puObject *object = _objects[path];
if (state)
object->activate();
else