lxqt / libqtxdg

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

[PATCH] Compatibility with Qt < 5.14 #230

Closed SchweinDeBurg closed 3 years ago

SchweinDeBurg commented 3 years ago

Commit e6c137115ae75857f9835355a08de8a2a704eb64 breaks compatibility with Qt < 5.14, so here is a simple patch:

diff -up libqtxdg-3.5.0-git/src/qtxdg/xdgdefaultapps.cpp.orig libqtxdg-3.5.0-git/src/qtxdg/xdgdefaultapps.cpp
--- libqtxdg-3.5.0-git/src/qtxdg/xdgdefaultapps.cpp.orig        2020-10-12 15:24:33.688233723 +0300
+++ libqtxdg-3.5.0-git/src/qtxdg/xdgdefaultapps.cpp     2020-10-12 16:00:39.800252834 +0300
@@ -57,11 +57,11 @@ static QList<XdgDesktopFile *> categoryA
 {
     XdgMimeApps db;
     QList<XdgDesktopFile *> apps = db.categoryApps(category);
-    const QSet<QString> protocolsSet = QSet<QString>(protocols.begin(), protocols.end());
+    const QSet<QString> protocolsSet = QSet<QString>::fromList(protocols);
     QList<XdgDesktopFile*>::iterator it = apps.begin();
     while (it != apps.end()) {
         const auto list = (*it)->mimeTypes();
-        const QSet<QString> appSupportsSet = QSet<QString>(list.begin(), list.end());
+        const QSet<QString> appSupportsSet = QSet<QString>::fromList(list);
         if (appSupportsSet.contains(protocolsSet) && (*it)->isShown()) {
             ++it;
         } else {
tsujan commented 3 years ago

Oh, this is important; we want to support 5.12. @luis-pereira, would you please take a look?

SchweinDeBurg commented 3 years ago

Hm-m-m... I am slightly confused. AFAIR LXQt Team currently declares Qt version 5.10 as a minimal requirement, not 5.12. Am I right?

tsujan commented 3 years ago

Will be 5.12 with in next release (soon).

SchweinDeBurg commented 3 years ago

Bad news for me. :-( I am not a LxQt user and often running my Fedora 27 just under runlevel 3, but when I'm using Openbox as a GUI some parts of LxQt are my everyday choice. QTerminal is a greatest terminal emulator ever and PCManFM-Qt is good to. And they still can be successfully built with stock Qt 5.9.

tsujan commented 3 years ago

And they still can be successfully built with stock Qt 5.9.

Still, compatibility with Qt 5.12 should be checked. 5.12 is the previous LTS. For various reasons, we can't support old Qt versions.

SchweinDeBurg commented 3 years ago

For various reasons, we can't support old Qt versions.

Of course, I am completely understand!

luis-pereira commented 3 years ago

@SchweinDeBurg Test availabe at #231