diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-04 23:09:37 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-04 23:09:45 -0400 |
commit | 17ace643e4edbec1e5bd7b446d039f8c94beef75 (patch) | |
tree | dfd1d426f61cdb8bb5dd7d0dc0114c8960b761e8 /libs/gtkmm2ext | |
parent | 9b3b1d945f72324a5ee38b7053a54e9d257c41db (diff) |
OMNIBUS COMMIT: prefer const XMLNode::property method (and provide a real one)
Diffstat (limited to 'libs/gtkmm2ext')
-rw-r--r-- | libs/gtkmm2ext/bindings.cc | 15 | ||||
-rw-r--r-- | libs/gtkmm2ext/keyboard.cc | 7 | ||||
-rw-r--r-- | libs/gtkmm2ext/tabbable.cc | 2 | ||||
-rw-r--r-- | libs/gtkmm2ext/tearoff.cc | 2 | ||||
-rw-r--r-- | libs/gtkmm2ext/window_proxy.cc | 20 |
5 files changed, 25 insertions, 21 deletions
diff --git a/libs/gtkmm2ext/bindings.cc b/libs/gtkmm2ext/bindings.cc index 7b52882f5f..deac345418 100644 --- a/libs/gtkmm2ext/bindings.cc +++ b/libs/gtkmm2ext/bindings.cc @@ -709,13 +709,14 @@ Bindings::load_operation (XMLNode const& node) for (XMLNodeList::const_iterator p = children.begin(); p != children.end(); ++p) { - XMLProperty* ap; - XMLProperty* kp; - XMLProperty* bp; - - ap = (*p)->property ("action"); - kp = (*p)->property ("key"); - bp = (*p)->property ("button"); + XMLProperty const * ap; + XMLProperty const * kp; + XMLProperty const * bp; + XMLNode const * child = *p; + + ap = child->property ("action"); + kp = child->property ("key"); + bp = child->property ("button"); if (!ap || (!kp && !bp)) { continue; diff --git a/libs/gtkmm2ext/keyboard.cc b/libs/gtkmm2ext/keyboard.cc index 7975fdebd7..983edbd0cf 100644 --- a/libs/gtkmm2ext/keyboard.cc +++ b/libs/gtkmm2ext/keyboard.cc @@ -215,7 +215,7 @@ Keyboard::get_state (void) int Keyboard::set_state (const XMLNode& node, int /*version*/) { - const XMLProperty* prop; + XMLProperty const * prop; if ((prop = node.property ("copy-modifier")) != 0) { sscanf (prop->value().c_str(), "%d", &CopyModifier); @@ -702,8 +702,9 @@ Keyboard::read_keybindings (string const & path) XMLNodeList const& children = tree.root()->children(); for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) { - if ((*i)->name() == X_("Bindings")) { - XMLProperty const* name = (*i)->property (X_("name")); + XMLNode const * child = *i; + if (child->name() == X_("Bindings")) { + XMLProperty const* name = child->property (X_("name")); if (!name) { warning << _("Keyboard binding found without a name") << endmsg; continue; diff --git a/libs/gtkmm2ext/tabbable.cc b/libs/gtkmm2ext/tabbable.cc index e0058c11f4..b84de2b10d 100644 --- a/libs/gtkmm2ext/tabbable.cc +++ b/libs/gtkmm2ext/tabbable.cc @@ -352,7 +352,7 @@ Tabbable::set_state (const XMLNode& node, int version) XMLNode* window_node = node.child ("Window"); if (window_node) { - const XMLProperty* prop = window_node->property (X_("tabbed")); + XMLProperty const * prop = window_node->property (X_("tabbed")); if (prop) { tab_requested_by_state = PBD::string_is_affirmative (prop->value()); } diff --git a/libs/gtkmm2ext/tearoff.cc b/libs/gtkmm2ext/tearoff.cc index dbe5c3dc5c..c107bd988a 100644 --- a/libs/gtkmm2ext/tearoff.cc +++ b/libs/gtkmm2ext/tearoff.cc @@ -286,7 +286,7 @@ void TearOff::set_state (const XMLNode& node) { Glib::RefPtr<Gdk::Window> win; - const XMLProperty* prop; + XMLProperty const * prop; if ((prop = node.property (X_("tornoff"))) == 0) { return; diff --git a/libs/gtkmm2ext/window_proxy.cc b/libs/gtkmm2ext/window_proxy.cc index d859c730c0..28ec4fb28d 100644 --- a/libs/gtkmm2ext/window_proxy.cc +++ b/libs/gtkmm2ext/window_proxy.cc @@ -84,12 +84,13 @@ int WindowProxy::set_state (const XMLNode& node, int /* version */) { XMLNodeList children = node.children (); - + XMLNode const * child; XMLNodeList::const_iterator i = children.begin (); while (i != children.end()) { - XMLProperty* prop = (*i)->property (X_("name")); - if ((*i)->name() == X_("Window") && prop && prop->value() == _name) { + child = *i; + XMLProperty const * prop = child->property (X_("name")); + if (child->name() == X_("Window") && prop && prop->value() == _name) { break; } @@ -98,22 +99,23 @@ WindowProxy::set_state (const XMLNode& node, int /* version */) if (i != children.end()) { - XMLProperty* prop; + XMLProperty const * prop; + child = *i; - if ((prop = (*i)->property (X_("visible"))) != 0) { + if ((prop = child->property (X_("visible"))) != 0) { _visible = PBD::string_is_affirmative (prop->value ()); } - if ((prop = (*i)->property (X_("x-off"))) != 0) { + if ((prop = child->property (X_("x-off"))) != 0) { _x_off = atoi (prop->value()); } - if ((prop = (*i)->property (X_("y-off"))) != 0) { + if ((prop = child->property (X_("y-off"))) != 0) { _y_off = atoi (prop->value()); } - if ((prop = (*i)->property (X_("x-size"))) != 0) { + if ((prop = child->property (X_("x-size"))) != 0) { _width = atoi (prop->value()); } - if ((prop = (*i)->property (X_("y-size"))) != 0) { + if ((prop = child->property (X_("y-size"))) != 0) { _height = atoi (prop->value()); } } |