D12974: Workspace KCM Code Improvement

Vlad Zagorodniy noreply at phabricator.kde.org
Sat May 19 11:34:21 UTC 2018


zzag added a comment.


  Also, about coding style. Why are you using `/*` for one line comments?

INLINE COMMENTS

> workspaceoptions.cpp:29
>  #include <QtDBus/QDBusMessage>
>  #include <QtDBus/QDBusConnection>
>  

https://community.kde.org/Policies/Kdelibs_Coding_Style#Qt_Includes

> workspaceoptions.cpp:37
>        m_stateVisualFeedback(true),
>        m_stateSingleClick(true)
>  {

I think you could do something like this in the header file

  class ...  {
  ...
      m_stateToolTip = true;
      m_stateVisualFeedback = true;
      m_stateSingleClick = true;
  ...
  };

> workspaceoptions.cpp:180
>  
>  /*SingleClick functions*/
>  bool KCMWorkspaceOptions::getSingleClick() const

I would remove it. It doesn't add any useful information. I don't see any word about commets in the kdelibs coding style(I assume Plasma follows it) but as a rule of thumb: comment things that are not obvious.

For example, see https://google.github.io/styleguide/cppguide.html#Implementation_Comments

REPOSITORY
  R119 Plasma Desktop

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

To: furkantokac, ngraham, romangg, #plasma
Cc: zzag, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180519/828d8670/attachment.html>


More information about the Plasma-devel mailing list