DevHeads.net

Review Request 113298: KDirWatch code style: cleanup whitespace.

Review request for KDE Frameworks and kdelibs.

Repository: kdelibs

Description
KDirWatch code style: cleanup whitespace.

The KDirWatch code had *lots* of "( foo )" and inconsistent indentation and alignment, including a few tabs(!). This is a full cleanup of it.

I appreciate any feedback; if I "fixed" something that didn't need fixing, or if you see more whitespace errors that I didn't fix, or if I should push this to master too, or if I should leave the damn thing alone and discard the review :)

This file is also lacking braces for single-line conditionals and loops; I'll fix that in a separate commit for easier reviewing. It's also mixing 2-space and 4-space indentations, but changing everything to 4 spaces (as the kdelibs coding style says) seemed too intrusive.

Diffs
tier1/kcoreaddons/src/lib/io/kdirwatch.h 7f6ca8ce83426c81a6336514c247aa9d115ec59e
tier1/kcoreaddons/src/lib/io/kdirwatch.cpp e4f45441d5ed68e3e34ae2bd68e16fd3dc46656a
tier1/kcoreaddons/src/lib/io/kdirwatch_p.h 442d6497b704c179adc13dbb25e450554d31554d

Diff: <a href="http://git.reviewboard.kde.org/r/113298/diff/" title="http://git.reviewboard.kde.org/r/113298/diff/">http://git.reviewboard.kde.org/r/113298/diff/</a>

Testing
Still compiles :)

Thanks,

Nicolás Alvarez

Comments

Re: Review Request 113298: KDirWatch code style: cleanup whitesp

By =?UTF-8?Q?Nicol... at 10/16/2013 - 23:51

(Updated Oct. 17, 2013, 12:51 a.m.)

Review request for KDE Frameworks and kdelibs.

Repository: kdelibs

Description (updated)
KDirWatch code style: cleanup whitespace.

The KDirWatch code had *lots* of "( foo )" and inconsistent indentation and alignment, including a few tabs(!). This is a full cleanup of it.

I appreciate any feedback; if I "fixed" something that didn't need fixing, or if you see more whitespace errors that I didn't fix, or if I should push this to master too, or if I should leave the damn thing alone and discard the review :)

This file is also lacking braces for single-line conditionals and loops; I'll fix that in a separate commit for easier reviewing. It's also mixing 2-space and 4-space indentations, but changing everything to 4 spaces (as the kdelibs coding style says) seemed too intrusive. Perhaps I should change the few 4-space indentations into 2-space for consistency?

Diffs
tier1/kcoreaddons/src/lib/io/kdirwatch.h 7f6ca8ce83426c81a6336514c247aa9d115ec59e
tier1/kcoreaddons/src/lib/io/kdirwatch.cpp e4f45441d5ed68e3e34ae2bd68e16fd3dc46656a
tier1/kcoreaddons/src/lib/io/kdirwatch_p.h 442d6497b704c179adc13dbb25e450554d31554d

Diff: <a href="http://git.reviewboard.kde.org/r/113298/diff/" title="http://git.reviewboard.kde.org/r/113298/diff/">http://git.reviewboard.kde.org/r/113298/diff/</a>

Testing
Still compiles :)

Thanks,

Nicolás Alvarez

Re: Review Request 113298: KDirWatch code style: cleanup whitesp

By =?UTF-8?Q?Nicol... at 10/17/2013 - 15:00

(Updated Oct. 17, 2013, 4 p.m.)

Review request for KDE Frameworks and kdelibs.

Changes
Fix style for pointer declarations. Added parameter names to kdirwatch_p.h declarations. Addressed other comments.

Repository: kdelibs

Description
KDirWatch code style: cleanup whitespace.

The KDirWatch code had *lots* of "( foo )" and inconsistent indentation and alignment, including a few tabs(!). This is a full cleanup of it.

I appreciate any feedback; if I "fixed" something that didn't need fixing, or if you see more whitespace errors that I didn't fix, or if I should push this to master too, or if I should leave the damn thing alone and discard the review :)

This file is also lacking braces for single-line conditionals and loops; I'll fix that in a separate commit for easier reviewing. It's also mixing 2-space and 4-space indentations, but changing everything to 4 spaces (as the kdelibs coding style says) seemed too intrusive. Perhaps I should change the few 4-space indentations into 2-space for consistency?

Diffs (updated)
tier1/kcoreaddons/src/lib/io/kdirwatch.h 7f6ca8ce83426c81a6336514c247aa9d115ec59e
tier1/kcoreaddons/src/lib/io/kdirwatch.cpp e4f45441d5ed68e3e34ae2bd68e16fd3dc46656a
tier1/kcoreaddons/src/lib/io/kdirwatch_p.h 442d6497b704c179adc13dbb25e450554d31554d

Diff: <a href="http://git.reviewboard.kde.org/r/113298/diff/" title="http://git.reviewboard.kde.org/r/113298/diff/">http://git.reviewboard.kde.org/r/113298/diff/</a>

Testing
Still compiles :)

Thanks,

Nicolás Alvarez

Re: Review Request 113298: KDirWatch code style: cleanup whitesp

By =?UTF-8?Q?Nicol... at 10/17/2013 - 15:05

(Updated Oct. 17, 2013, 4:05 p.m.)

Review request for KDE Frameworks and kdelibs.

Changes
A few more I noticed later.

Repository: kdelibs

Description
KDirWatch code style: cleanup whitespace.

The KDirWatch code had *lots* of "( foo )" and inconsistent indentation and alignment, including a few tabs(!). This is a full cleanup of it.

I appreciate any feedback; if I "fixed" something that didn't need fixing, or if you see more whitespace errors that I didn't fix, or if I should push this to master too, or if I should leave the damn thing alone and discard the review :)

This file is also lacking braces for single-line conditionals and loops; I'll fix that in a separate commit for easier reviewing. It's also mixing 2-space and 4-space indentations, but changing everything to 4 spaces (as the kdelibs coding style says) seemed too intrusive. Perhaps I should change the few 4-space indentations into 2-space for consistency?

Diffs (updated)
tier1/kcoreaddons/src/lib/io/kdirwatch_p.h 442d6497b704c179adc13dbb25e450554d31554d
tier1/kcoreaddons/src/lib/io/kdirwatch.cpp e4f45441d5ed68e3e34ae2bd68e16fd3dc46656a
tier1/kcoreaddons/src/lib/io/kdirwatch.h 7f6ca8ce83426c81a6336514c247aa9d115ec59e

Diff: <a href="http://git.reviewboard.kde.org/r/113298/diff/" title="http://git.reviewboard.kde.org/r/113298/diff/">http://git.reviewboard.kde.org/r/113298/diff/</a>

Testing
Still compiles :)

Thanks,

Nicolás Alvarez

Re: Review Request 113298: KDirWatch code style: cleanup whitesp

By =?UTF-8?Q?Nicol... at 10/17/2013 - 15:53

(Updated Oct. 17, 2013, 4:53 p.m.)

Review request for KDE Frameworks and kdelibs.

Repository: kdelibs

Description
KDirWatch code style: cleanup whitespace.

The KDirWatch code had *lots* of "( foo )" and inconsistent indentation and alignment, including a few tabs(!). This is a full cleanup of it.

I appreciate any feedback; if I "fixed" something that didn't need fixing, or if you see more whitespace errors that I didn't fix, or if I should push this to master too, or if I should leave the damn thing alone and discard the review :)

This file is also lacking braces for single-line conditionals and loops; I'll fix that in a separate commit for easier reviewing. It's also mixing 2-space and 4-space indentations, but changing everything to 4 spaces (as the kdelibs coding style says) seemed too intrusive. Perhaps I should change the few 4-space indentations into 2-space for consistency?

Diffs (updated)
tier1/kcoreaddons/src/lib/io/kdirwatch.h 7f6ca8ce83426c81a6336514c247aa9d115ec59e
tier1/kcoreaddons/src/lib/io/kdirwatch.cpp e4f45441d5ed68e3e34ae2bd68e16fd3dc46656a
tier1/kcoreaddons/src/lib/io/kdirwatch_p.h 442d6497b704c179adc13dbb25e450554d31554d

Diff: <a href="http://git.reviewboard.kde.org/r/113298/diff/" title="http://git.reviewboard.kde.org/r/113298/diff/">http://git.reviewboard.kde.org/r/113298/diff/</a>

Testing
Still compiles :)

Thanks,

Nicolás Alvarez

Re: Review Request 113298: KDirWatch code style: cleanup whitesp

By =?UTF-8?Q?Nicol... at 10/21/2013 - 18:30

(Updated Oct. 21, 2013, 10:30 p.m.)

Status
This change has been marked as submitted.

Review request for KDE Frameworks and kdelibs.

Repository: kdelibs

Description
KDirWatch code style: cleanup whitespace.

The KDirWatch code had *lots* of "( foo )" and inconsistent indentation and alignment, including a few tabs(!). This is a full cleanup of it.

I appreciate any feedback; if I "fixed" something that didn't need fixing, or if you see more whitespace errors that I didn't fix, or if I should push this to master too, or if I should leave the damn thing alone and discard the review :)

This file is also lacking braces for single-line conditionals and loops; I'll fix that in a separate commit for easier reviewing. It's also mixing 2-space and 4-space indentations, but changing everything to 4 spaces (as the kdelibs coding style says) seemed too intrusive. Perhaps I should change the few 4-space indentations into 2-space for consistency?

Diffs
tier1/kcoreaddons/src/lib/io/kdirwatch.h 7f6ca8ce83426c81a6336514c247aa9d115ec59e
tier1/kcoreaddons/src/lib/io/kdirwatch.cpp e4f45441d5ed68e3e34ae2bd68e16fd3dc46656a
tier1/kcoreaddons/src/lib/io/kdirwatch_p.h 442d6497b704c179adc13dbb25e450554d31554d

Diff: <a href="http://git.reviewboard.kde.org/r/113298/diff/" title="http://git.reviewboard.kde.org/r/113298/diff/">http://git.reviewboard.kde.org/r/113298/diff/</a>

Testing
Still compiles :)

Thanks,

Nicolás Alvarez

Re: Review Request 113298: KDirWatch code style: cleanup whitesp

By Commit Hook at 10/21/2013 - 18:30

This review has been submitted with commit 11ee78a9c8139f236f37da27eaec15dbedfadcbf by Nicolás Alvarez to branch frameworks.

- Commit Hook

On Oct. 17, 2013, 7:53 p.m., Nicolás Alvarez wrote:

Re: Review Request 113298: KDirWatch code style: cleanup whitesp

By Kevin Ottens at 10/21/2013 - 07:35

Ship it!

Ship It!

- Kevin Ottens

On Oct. 17, 2013, 7:53 p.m., Nicolás Alvarez wrote:

Re: Review Request 113298: KDirWatch code style: cleanup whitesp

By Martin Klapetek at 10/17/2013 - 15:27

Good job! I think this can go in, but I'd like someone else approve

tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
<http://git.reviewboard.kde.org/r/113298/#comment30577>

I think this could be better as uncommenting the variable and using Q_UNUSED (and moving the * to the right too), but that's minor

tier1/kcoreaddons/src/lib/io/kdirwatch_p.h
<http://git.reviewboard.kde.org/r/113298/#comment30578>

why did you choose "_path" instead of just "path"?

- Martin Klapetek

On Oct. 17, 2013, 7:05 p.m., Nicolás Alvarez wrote:

Re: Review Request 113298: KDirWatch code style: cleanup whitesp

By Martin Klapetek at 10/17/2013 - 16:01

Ah, I didn't notice that. Yeah, ignore it for now

- Martin

On Oct. 17, 2013, 7:53 p.m., Nicolás Alvarez wrote:

Re: Review Request 113298: KDirWatch code style: cleanup whitesp

By =?UTF-8?Q?Nicol... at 10/17/2013 - 15:52

Sure, I can do that.

Because that's what the definition has in the .cpp:
KDirWatchPrivate::Entry* KDirWatchPrivate::entry(const QString &_path)

I could change them all to path, I don't know why it has an underscore. But that's for a separate commit.

- Nicolás

On Oct. 17, 2013, 4:05 p.m., Nicolás Alvarez wrote:

Re: Review Request 113298: KDirWatch code style: cleanup whitesp

By Martin Klapetek at 10/17/2013 - 03:46

There are couple issues still, I pointed only bunch of them as they repeat themselves, so you might want to keep an eye on those

Also, kdelibs coding style - <a href="http://techbase.kde.org/Policies/Kdelibs_Coding_Style" title="http://techbase.kde.org/Policies/Kdelibs_Coding_Style">http://techbase.kde.org/Policies/Kdelibs_Coding_Style</a>

tier1/kcoreaddons/src/lib/io/kdirwatch.h
<http://git.reviewboard.kde.org/r/113298/#comment30546>

As per the kdelibs coding style, there should be spaces around operators too, so eg. "notify = false" etc

tier1/kcoreaddons/src/lib/io/kdirwatch.h
<http://git.reviewboard.kde.org/r/113298/#comment30547>

The & sign should be aligned at the variable name, eg. "QString &path" (like you have below)

tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
<http://git.reviewboard.kde.org/r/113298/#comment30548>

Entry* e -> Entry *e

tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
<http://git.reviewboard.kde.org/r/113298/#comment30549>

There should be no spaces before ";", eg. "...!= end; ++it"

tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
<http://git.reviewboard.kde.org/r/113298/#comment30550>

Indent on 4 spaces

tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
<http://git.reviewboard.kde.org/r/113298/#comment30551>

Operator spaces:

if (res < 0) {

tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
<http://git.reviewboard.kde.org/r/113298/#comment30552>

Operator spaces as well

tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
<http://git.reviewboard.kde.org/r/113298/#comment30553>

This should probably be on separate lines

tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
<http://git.reviewboard.kde.org/r/113298/#comment30554>

Same as the block above

tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
<http://git.reviewboard.kde.org/r/113298/#comment30555>

Entry *e

tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
<http://git.reviewboard.kde.org/r/113298/#comment30556>

Indent one level more (should be 8 spaces at this level)....actually this whole file seems to have wrong indentation, so maybe fix all of that?

tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
<http://git.reviewboard.kde.org/r/113298/#comment30557>

Pointer signs to the variable -> KDirWatch *instance etc

tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
<http://git.reviewboard.kde.org/r/113298/#comment30558>

Should be at the "if" line, eg. "if () {"

tier1/kcoreaddons/src/lib/io/kdirwatch_p.h
<http://git.reviewboard.kde.org/r/113298/#comment30559>

Spaces inside -> "KDirWatch *, bool"

- Martin Klapetek

On Oct. 17, 2013, 3:51 a.m., Nicolás Alvarez wrote:

Re: Review Request 113298: KDirWatch code style: cleanup whitesp

By =?UTF-8?Q?Nicol... at 10/17/2013 - 15:00

I added the parameter names to kdirwatch_p.h too.

I'll probably fix indentation in a separate commit for easier reviewing.

- Nicolás

On Oct. 17, 2013, 4 p.m., Nicolás Alvarez wrote: