Apply KDE coding style, minor optimizations
AbandonedPublic

Authored by alex on Jan 20 2020, 8:09 PM.

Details

Summary

The affected files have been reformatted following the KDE coding style (this makes up most of the changes).
kcm.cpp: The config.setFirstRun method calls have been simplified (line 103) and the defaultFolders function is now inline.
filterfoldermodel.cpp: Use const references for the mount points (folderDisplayName method, line 204), simplify if statement in shouldShowMountPoint (line 223) and remove unnecessary return in data method.

Test Plan

Should work as before

Diff Detail

Repository
R119 Plasma Desktop
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 21420
Build 21438: arc lint + arc unit
alex created this revision.Jan 20 2020, 8:09 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 20 2020, 8:09 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
alex requested review of this revision.Jan 20 2020, 8:09 PM

Nice changes.

kcms/baloo/filteredfoldermodel.cpp
38

space ? I am not sure.

kcms/baloo/kcm.cpp
44–47

space ?

72

I did not know this formatting,, but I am not a specialist of kde policy.

alex updated this revision to Diff 73987.Jan 21 2020, 7:05 AM

Adjust formatting of lambdas

alex updated this revision to Diff 73988.Jan 21 2020, 7:09 AM

Add parentheses for parameter list

alex marked an inline comment as done.Jan 21 2020, 2:36 PM
alex added inline comments.
kcms/baloo/filteredfoldermodel.cpp
38

I am not sure too, because in the plasma-workspace project and even some qt files it is sometimes formatted like above but sometimes it is indented.

kcms/baloo/kcm.cpp
72

Now it should fit the policy. KDE does not specify their own style for lambdas but uses the one of Qt: https://wiki.qt.io/Coding_Conventions .

alex marked 2 inline comments as done.Jan 22 2020, 5:56 AM
davidedmundson accepted this revision.Jan 24 2020, 10:47 PM
davidedmundson added a subscriber: davidedmundson.

emit and Q_EMIT are the same thing, I wouldn't change any future instances

Q_EMIT has the advantage of not conflicting with some other libraries like emit sometimes can

This revision is now accepted and ready to land.Jan 24 2020, 10:47 PM
alex abandoned this revision.Mar 24 2020, 7:47 AM

Abandoning this, because there have been a few patches to the same kcm and this is mostly formatting.