Prepare Kalzium components (liscience and compound viewer) for compiling with -DQT_NO_CAST_FROM_ASCII
AbandonedPublic

Authored by yurchor on Dec 13 2018, 1:40 PM.

Details

Reviewers
None
Group Reviewers
KDE Edu
Summary

As we already have a Qt5 version of libavogadro (1.92) and Kalzium without kdelibs4support, the ability to compile with -DQT_NO_CAST_FROM_ASCII can be seen as a measure to ensure the sustainability of future versions of Kalzium. Please correct me if I'm wrong. Thanks in advance for your comments.

Test Plan

Compiles, can be run and seems working as expected.

Diff Detail

Repository
R326 Kalzium
Lint
Lint Skipped
Unit
Unit Tests Skipped
yurchor created this revision.Dec 13 2018, 1:40 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptDec 13 2018, 1:40 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
yurchor requested review of this revision.Dec 13 2018, 1:40 PM
aacid added a subscriber: aacid.Dec 15 2018, 10:36 AM

I really doubt QT_NO_CAST_FROM_ASCII will even be default even mandatory.

libscience/moleculeparser.cpp
251

i've a bit afraid of this one, you're not using QChar(int) instead of QChar(char) (i guess) that was being used before.

The actual proper port would be QChar::fromLatin1(char(nextchar())), no?

yurchor abandoned this revision.Dec 15 2018, 11:26 AM

I really doubt QT_NO_CAST_FROM_ASCII will even be default even mandatory.

Ok. Thanks.

I had started the final step of removing kdelibs4support with

include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

in CMakeLists.txt. Taking the wrong way, I decided to add QLatin1String() and Q_SLOT everywhere. Even tried to patch libavogadro:

https://github.com/OpenChemistry/avogadrolibs/pull/414

It appears that things are much simpler and porting was deadly easy. ;)

https://cgit.kde.org/kalzium.git/commit/?id=1c906b21a6b5d1f80a6a93b4cf384239d125ada4

https://cgit.kde.org/kalzium.git/commit/?id=c000bb62873bf5cdcd8ee3394e947336e6d859f2

Then I decided to do something with the patched parts... It's good to know they are actually not necessary. :)