File fix-building-with-qt-5.12.patch of Package kcm5-fcitx

Index: kcm-fcitx-0.5.6/src/impage.cpp
===================================================================
--- kcm-fcitx-0.5.6.orig/src/impage.cpp
+++ kcm-fcitx-0.5.6/src/impage.cpp
@@ -22,6 +22,7 @@
 #include <QStyledItemDelegate>
 #include <QPainter>
 #include <QCollator>
+#include <QtGlobal>
 
 // KDE
 #include <KStringHandler>
@@ -674,7 +675,11 @@ void IMPage::Private::moveDownIM()
         }
 
         if (curIMIdx >= 0 && nextIMIdx >= 0 && curIMIdx != nextIMIdx) {
+#if (QT_VERSION < QT_VERSION_CHECK(5,13,0))
+            m_list.swap(curIMIdx, nextIMIdx);
+#else
             m_list.swapItemsAt(curIMIdx, nextIMIdx);
+#endif
             std::stable_sort(m_list.begin(), m_list.end());
             emit updateIMList(m_list, curIndex.data(FcitxIMUniqueNameRole).toString());
             emit changed();
@@ -720,7 +725,11 @@ void IMPage::Private::moveUpIM()
         }
 
         if (curIMIdx >= 0 && nextIMIdx >= 0 && curIMIdx != nextIMIdx) {
+#if (QT_VERSION < QT_VERSION_CHECK(5,13,0))
+            m_list.swap(curIMIdx, nextIMIdx);
+#else
             m_list.swapItemsAt(curIMIdx, nextIMIdx);
+#endif
             std::stable_sort(m_list.begin(), m_list.end());
             emit updateIMList(m_list, curIndex.data(FcitxIMUniqueNameRole).toString());
             emit changed();
openSUSE Build Service is sponsored by