lxqt / libqtxdg

Qt implementation of freedesktop.org xdg specs
https://lxqt.github.io
GNU Lesser General Public License v2.1
73 stars 35 forks source link

Fix XdgMimeType with Qt 5.14 #199

Closed yan12125 closed 4 years ago

yan12125 commented 4 years ago

Reverts lxqt/libqtxdg#197

Breaks building of lxqt-panel and lxqt-config with Qt 5.14 and GCC 9.2 on Arch Linux.

yan12125 commented 4 years ago

This commit https://github.com/qt/qtbase/commit/2ab3af564c7c8424b558c5902614d1a410850acf, which is included in Qt 5.14, seems the key change.

tsujan commented 4 years ago

qSwap is marked as "obsolete" (https://doc.qt.io/qt-5/qtalgorithms-obsolete.html) and yet, we can't replace it because of that Qt commit? Or, maybe, there's another way?

luis-pereira commented 4 years ago

@tsujan The updated code is in libqtxdg and it builds fine. Then the compilation fails in moc/ui generated code. I have some ideas of what might be triggering it. Until Jan 7, I won't be able to test my hypotheses.

@yan12125 Can you add #include <utility> next to #include<algorithm> in libqtxdg xdgmimetype.h and check for any changed ?

yan12125 commented 4 years ago

Can you add #include next to #include in libqtxdg xdgmimetype.h and check for any changed ?

The error remains.

Or, maybe, there's another way?

I managed to get it work on Qt 5.14 without reverting to deprecated qSwap(). The commit is force-pushed to this pull request.

tsujan commented 4 years ago

I managed to get it work on Qt 5.14 without reverting to deprecated qSwap().

Very nice!

yan12125 commented 4 years ago

Gonna merge as I'm relatively confident that this approach is equivalent to the old qSwap one and this has been broken for some time.