aarnt / octopi

A powerful Pacman (Package Manager) front end using Qt libs
https://tintaescura.com/projects/octopi
GNU General Public License v2.0
599 stars 85 forks source link

Port to Qt6? #535

Closed demmm closed 1 year ago

demmm commented 1 year ago

Are there plans to port Octopi to Qt6? KaOS is getting ready to move to Plasma 6 by the end of the year, so would be nice to keep a fully working Octopi. On current Plasma 6 test ISOs, Octpoi (Qt5) is included, but can not use any kf5 integration.

To start the work, lxqt2-build-tools & qtermwidget6 have been build from their respective Qt6 porting branches. And I have started the port locally. Currently builds to about 30 %, all the needed Qt5 to Qt6 adjustments have been made in cmake. A couple of deprecated calls still work by adding qt6-5compat (QRegExp), some changes done for QActionGroup, QString. Some leftRef & midRef have been moved to just left & mid.

Current fail is:

octopi/src/model/packagemodel.cpp:332:15: error: no matching function for call to ‘QString::remove(QRegExp)’
  332 |   r = r.remove(QRegExp(QStringLiteral("&")));

No answer found for that one yet.

Let me know if there are plans to port, then I can commit what I have now (KaOS github), and you can see what you want to use.

aarnt commented 1 year ago

Hi @demmm

Problem is qtermwidget. LXQt has not been ported, AFAIK.

demmm commented 1 year ago

See my lines above, both are build from their Qt6 branches: https://kaosx.us/packages/view.php?name=kde-next/lxqt2-build-tools-0.13.0-1 https://kaosx.us/packages/packages.php?sortby=name&sortdir=&flagged=&page=&limit=&repo=kde-next&exact=&search=qterm

aarnt commented 1 year ago

Are there plans to port Octopi to Qt6? KaOS is getting ready to move to Plasma 6 by the end of the year, so would be nice to keep a fully working Octopi. On current Plasma 6 test ISOs, Octpoi (Qt5) is included, but can not use any kf5 integration.

To start the work, lxqt2-build-tools & qtermwidget6 have been build from their respective Qt6 porting branches. And I have started the port locally. Currently builds to about 30 %, all the needed Qt5 to Qt6 adjustments have been made in cmake. A couple of deprecated calls still work by adding qt6-5compat (QRegExp), some changes done for QActionGroup, QString. Some leftRef & midRef have been moved to just left & mid.

Current fail is:

octopi/src/model/packagemodel.cpp:332:15: error: no matching function for call to ‘QString::remove(QRegExp)’
  332 |   r = r.remove(QRegExp(QStringLiteral("&")));

No answer found for that one yet.

Let me know if there are plans to port, then I can commit what I have now (KaOS github), and you can see what you want to use.

Did you try to replace " r = r.remove(QRegExp(QStringLiteral("&")));" to " r = r.remove(QRegularExpression(QStringLiteral("&")));" ?

demmm commented 1 year ago

That fixed that one, fixed 2 more myself, now figuring a similar error in sudo.cpp (already at 60 % build).

demmm commented 1 year ago

Qt6 fork created, current status: https://github.com/KaOSx/octopi/commit/984a916a90961a5e08e28fa1d33448b20995e8eb

aarnt commented 1 year ago

Great!

demmm commented 1 year ago

Only a few more changes needed.....already builds and runs: Screenshot_20230725_224332

I can do a PR if you want, my suggestion would be to keep a separate Qt6 branch, so no ifdefs for Qt5/Qt6. Can't be used by many anyway, since hardly any will have qtermwidget6 or any kf6.

aarnt commented 1 year ago

Hi @demmm

Can you test upstream code with your qtermwidget libs?

demmm commented 1 year ago

Fails right away, sudo directory is not set for Qt6: https://github.com/aarnt/octopi/blob/master/sudo/CMakeLists.txt#L1 needs something like: https://github.com/KaOSx/octopi/blob/qt6/sudo/CMakeLists.txt#L1 might want to look at https://github.com/aarnt/octopi/compare/master...KaOSx:octopi:qt6 to check if all Qt5 > Qt6 are done

aarnt commented 1 year ago

@demmm Try upstream again with:

cmake -G "Unix Makefiles" .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QTERMWIDGET6=ON

demmm commented 1 year ago

Build fail from my previous comment is not addressed, thus fails right away again. Link again: https://github.com/aarnt/octopi/blob/master/sudo/CMakeLists.txt#L1 (still Qt5 only)

aarnt commented 1 year ago

@demmm Could you test again?

demmm commented 1 year ago

It now builds, thanks :) Just knotifier is not used right now, see what I did to make that work too (will need the ifdefs): https://github.com/KaOSx/octopi/commit/984a916a90961a5e08e28fa1d33448b20995e8eb#diff-5d834b3078bea1695ae8ee91618b1a88ab6e62a51f7c5ada944509bb6b99da9cL4

aarnt commented 1 year ago

Ok. Added KF5NOTIFICATIONS and KF6NOTIFICATIONS options in Notifier's CMakeLists.txt file.