Compile with stricter compilation flags
ClosedPublic

Authored by mlaurent on Nov 29 2017, 12:57 PM.

Diff Detail

Repository
R263 KXmlGui
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mlaurent created this revision.Nov 29 2017, 12:57 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 29 2017, 12:57 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
mlaurent requested review of this revision.Nov 29 2017, 12:57 PM
apol added a subscriber: apol.Nov 29 2017, 1:33 PM
apol added inline comments.
autotests/kactioncollectiontest.cpp
235

I'd expect these to be Utf8.

src/ksendbugmail/smtp.cpp
227

Are you sure it shouldn't be fromUtf8 or fromLocal8Bit?

mlaurent added inline comments.Nov 29 2017, 2:44 PM
autotests/kactioncollectiontest.cpp
235

we use latin1 for kstandardaction::name no ? For me it seems that we didn"t add a no latin1 name for it.

src/ksendbugmail/smtp.cpp
227

Really no idea. It's the code where I don"t know if it's utf8 or not

dfaure added inline comments.Nov 30 2017, 6:28 AM
autotests/kactioncollectiontest.cpp
235

Yeah, standard action names are definitely latin1.

Actions defined by applications, however, can use utf8 (sometimes to transport a QString into the name, used in the slot connected to the action)

autotests/kxmlgui_unittest.cpp
298

I wouldn't bet my life on the fact that MSVC will like the ternary operator with a QStringLiteral and a QString which aren't the same type at all. fromLatin1 would be safer, especially since this is definitely not time-critical ;)

src/ksendbugmail/smtp.cpp
227

This is used to call processLine, so see implementation of processLine below...

327

Given the toLatin1 here, I think fromLatin1 is safe, but this also tells me that all of this should just be ported to QByteArray.

The commit log needs to have a one-line summary, like "Compile with stricter compilation flags".

mlaurent updated this revision to Diff 23199.Dec 1 2017, 6:39 AM
mlaurent marked 3 inline comments as done.
  • Port to QByteArray. Add missing const. Fix error found by David
mlaurent retitled this revision from Compile with: to Compile with stricter compilation flags.Dec 1 2017, 6:40 AM
mlaurent edited the summary of this revision. (Show Details)
dfaure accepted this revision.Dec 1 2017, 8:01 PM
This revision is now accepted and ready to land.Dec 1 2017, 8:01 PM
This revision was automatically updated to reflect the committed changes.