D26250: Fix multiple warnings

Jasem Mutlaq noreply at phabricator.kde.org
Sat Dec 28 07:51:46 GMT 2019


mutlaqja added a comment.


  Great work, please check the comment!

INLINE COMMENTS

> fpackutil.c:1026
>  
> -        if (single)
> +        if (single) {
>              stat = -1;  /* special status flag to force output primary array */

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.

> hipsmanager.cpp:390
>  
> -  int cost = item->image->byteCount();
> +  int cost = item->image->sizeInBytes();
>    m_cache.add(key, item, cost);

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

> hipsrenderer.cpp:167
>        m_rendered++;
> -      m_size += image->byteCount();
> +      m_size += image->sizeInBytes();
>  

Same as above.

> skyqpainter.cpp:913
>                  const QString qMark = " ? ";
> -                double scaleFactor  = 0.8 * size / fontMetrics().width(qMark);
> +                double scaleFactor  = 0.8 * size / fontMetrics().horizontalAdvance(qMark);
>                  f.setPointSizeF(f.pointSizeF() * scaleFactor);

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

REPOSITORY
  R321 KStars

REVISION DETAIL
  https://phabricator.kde.org/D26250

To: shubham, mutlaqja
Cc: kde-edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20191228/e0249482/attachment.html>


More information about the kde-edu mailing list