[vlc-devel] [PATCH 6/6] qt: using QMap as mutlimap is deprecated in Qt5.15

Pierre Lamot pierre at videolabs.io
Thu May 28 14:41:57 CEST 2020


---
 modules/gui/qt/dialogs/preferences/preferences_widgets.cpp | 4 ++--
 modules/gui/qt/util/navigation_history.cpp                 | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/dialogs/preferences/preferences_widgets.cpp b/modules/gui/qt/dialogs/preferences/preferences_widgets.cpp
index bce11569da..53c05171e0 100644
--- a/modules/gui/qt/dialogs/preferences/preferences_widgets.cpp
+++ b/modules/gui/qt/dialogs/preferences/preferences_widgets.cpp
@@ -1201,7 +1201,7 @@ void KeySelectorControl::finish()
 
     p_config = module_config_get (p_main, &confsize);
 
-    QMap<QString, QString> global_keys;
+    QMultiMap<QString, QString> global_keys;
     for (size_t i = 0; i < confsize; i++)
     {
         module_config_t *p_config_item = p_config + i;
@@ -1236,7 +1236,7 @@ void KeySelectorControl::finish()
          && !EMPTY_STR( p_config_item->psz_text )
          && !EMPTY_STR( p_config_item->value.psz ) )
         {
-            global_keys.insertMulti( qtr( p_config_item->psz_text ), qfu( p_config_item->value.psz ) );
+            global_keys.insert( qtr( p_config_item->psz_text ), qfu( p_config_item->value.psz ) );
         }
     }
 
diff --git a/modules/gui/qt/util/navigation_history.cpp b/modules/gui/qt/util/navigation_history.cpp
index 7952f7829b..a3cedb876f 100644
--- a/modules/gui/qt/util/navigation_history.cpp
+++ b/modules/gui/qt/util/navigation_history.cpp
@@ -55,7 +55,9 @@ static void pushListRec(QVariantMap& itemMap, QVariantList::const_iterator it, Q
     }
     else if ( it->canConvert<QVariantMap>() )
     {
-        itemMap.unite( it->toMap() );
+        QVariantMap varMap = it->toMap();
+        for (auto kv = varMap.constBegin(); kv != varMap.constEnd(); ++kv )
+            itemMap[kv.key()] = kv.value();
         pushListRec(itemMap, ++it, end);
     }
 }
-- 
2.25.1



More information about the vlc-devel mailing list