Fix multiple warnings
ClosedPublic

Authored by shubham on Dec 28 2019, 7:29 AM.

Diff Detail

Repository
R321 KStars
Branch
warnings
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 20341
Build 20359: arc lint + arc unit
shubham created this revision.Dec 28 2019, 7:29 AM
Restricted Application added a project: KDE Edu. · View Herald TranscriptDec 28 2019, 7:29 AM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
shubham requested review of this revision.Dec 28 2019, 7:29 AM
shubham updated this revision to Diff 72275.Dec 28 2019, 7:32 AM

Minor changes

Great work, please check the comment!

kstars/fitsviewer/fpackutil.c
1026 ↗(On Diff #72275)

The bracket style we follow is different. We use ANSI style. I suggest create ~/.astylerc file and add to it the following:

--style=allman
--align-reference=name
--indent-switches
--indent-modifiers
--indent-classes
--pad-oper
--indent-col1-comments
--lineend=linux

Of course, you need to install astyle on your system. in QtCreator, you can configure it so that it applies that style everything it saves the file.. this way it will always be in the same coding style used in the project.

kstars/hips/hipsmanager.cpp
390 ↗(On Diff #72275)

Can you check when this was introduced in Qt as well?

kstars/hips/hipsrenderer.cpp
167 ↗(On Diff #72275)

Same as above.

kstars/skyqpainter.cpp
913 ↗(On Diff #72275)

Same issue about Qt version check. I think by next year (around April/May), we can increase the requirement for KStars Qt version and then get rid of these #if s

Should I leave horizontalAdvance() and sizeInBytes() as it is?

kstars/hips/hipsmanager.cpp
390 ↗(On Diff #72275)

Introduced in Qt 5.10

kstars/skyqpainter.cpp
913 ↗(On Diff #72275)

Introduced in Qt 5.11

shubham added inline comments.Dec 28 2019, 8:03 AM
kstars/ekos/scheduler/scheduler.cpp
1161 ↗(On Diff #72275)

Introduced in Qt 5.13

shubham updated this revision to Diff 72283.Dec 28 2019, 8:16 AM

Do not depend upon relatively newer Qt functions

Btw, you don't have to remove your changes completely. You can enclose them in #if statements. For example

#if QT_VERSION >= QT_VERSION_CHECK(5,13,0)
jobs.swapItemsAt(currentRow, destinationRow);
#else
jobs.swap(currentRow, destinationRow);
#endif

This way we fix the warning on more recent Qt versions and also it is a reminder for us to remove this check once Qt 5.13 becomes the minimum supported version by KStars, so it's a double win. You can do this for all the changes you proposed above.

shubham updated this revision to Diff 72289.Dec 28 2019, 10:54 AM

Use #if #else

mutlaqja accepted this revision.Dec 28 2019, 11:57 AM

Congrats on the first PR!

This revision is now accepted and ready to land.Dec 28 2019, 11:57 AM
This revision was automatically updated to reflect the committed changes.

Congrats on the first PR!

Haha, i am an old player, I have a developer account already. By the way, thanks for committing.