summaryrefslogblamecommitdiff
path: root/user/kio/cxx17.patch
blob: d73e93b65ed794ddda9b845c2e651ec43ed976f9 (plain) (tree)




















                                                                                                                                   
G++ does not have transform_reduce until C++20, despite being part of the
C++17 standard.  This reverts the only usage of Parallelism TR2 in KIO.

--- kio-5.94.0/src/filewidgets/kurlnavigator.cpp.old	2022-05-12 07:14:39.000000000 -0500
+++ kio-5.94.0/src/filewidgets/kurlnavigator.cpp	2022-06-03 01:42:48.541164895 -0500
@@ -729,11 +729,11 @@
         availableWidth -= m_protocols->width();
     }
 
-    auto MinWidth = [](const KUrlNavigatorButton *button) {
-        return button->minimumWidth();
-    };
     // Check whether buttons must be hidden at all...
-    const int requiredButtonWidth = std::transform_reduce(m_navButtons.cbegin(), m_navButtons.cend(), 0, std::plus<>(), MinWidth);
+    int requiredButtonWidth = 0;
+    for (const KUrlNavigatorButton *button : std::as_const(m_navButtons)) {
+        requiredButtonWidth += button->minimumWidth();
+    }
 
     if (requiredButtonWidth > availableWidth) {
         // At least one button must be hidden. This implies that the