[vlc-commits] qt: using QMap as multimap is deprecated in Qt5.15

Pierre Lamot git at videolan.org
Fri May 29 12:00:36 CEST 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu May 28 11:47:49 2020 +0200| [78708b273d07c5387c30772de365674dc690b5dc] | committer: Pierre Lamot

qt: using QMap as multimap is deprecated in Qt5.15

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=78708b273d07c5387c30772de365674dc690b5dc
---

 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);
     }
 }



More information about the vlc-commits mailing list