[gnome-commander/get_rid_of_xml] noop: C++11 rework



commit 07a3153b00f960afdec7de3c83d641f98e2c6281
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Tue Jan 15 22:48:33 2019 +0100

    noop: C++11 rework

 src/gnome-cmd-user-actions.cc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index 67da2cea..3aa35243 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -569,11 +569,11 @@ gboolean GnomeCmdUserActions::handle_key_event(GnomeCmdMainWin *mw, GnomeCmdFile
 XML::xstream &operator << (XML::xstream &xml, GnomeCmdUserActions &usr)
 {
     xml << XML::tag("KeyBindings");
-    for (GnomeCmdUserActions::ACTIONS_COLL::const_iterator i=usr.action.begin(); i!=usr.action.end(); ++i)
-        if (!ascii_isupper (i->first))                                         // ignore lowercase keys as 
they duplicate uppercase ones
+    for (auto thisAction : usr.action)
+        if (!ascii_isupper (thisAction.first)) // ignore lowercase keys as they duplicate uppercase ones
         {
-            guint state = i->first.state;
-            guint key_val = i->first.keyval;
+            guint state = thisAction.first.state;
+            guint key_val = thisAction.first.keyval;
 
             xml << XML::tag("Key") << XML::attr("name");
             if (ascii_isalnum (key_val))
@@ -588,9 +588,9 @@ XML::xstream &operator << (XML::xstream &xml, GnomeCmdUserActions &usr)
             if (state & GDK_HYPER_MASK)    xml << XML::attr("hyper") << 1;
             if (state & GDK_META_MASK)     xml << XML::attr("meta") << 1;
 
-            xml << XML::attr("action") << usr.action_func[i->second.func];
-            if (!i->second.user_data.empty())
-                xml << XML::attr("options") << XML::escape(i->second.user_data);
+            xml << XML::attr("action") << usr.action_func[thisAction.second.func];
+            if (!thisAction.second.user_data.empty())
+                xml << XML::attr("options") << XML::escape(thisAction.second.user_data);
 
             xml << XML::endtag();
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]