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 - http://techbase.kde.org/Policies/Kdelibs_Coding_Style
tier1/kcoreaddons/src/lib/io/kdirwatch.h
(Diff revision 1)
|
class KCOREADDONS_EXPORT KDirWatch : public QObject |
192 |
void startScan( bool notify=false, bool skippedToo=false ); |
192 |
void startScan(bool notify=false, bool skippedToo=false); |
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
(Diff revision 1)
|
class KCOREADDONS_EXPORT KDirWatch : public QObject |
213 |
bool contains( const QString& path ) const; |
213 |
bool contains(const QString& path) const; |
The & sign should be aligned at the variable name, eg. "QString &path" (like you have below)
There should be no spaces before ";", eg. "...!= end; ++it"
Operator spaces:
if (res < 0) {
This should probably be on separate lines
tier1/kcoreaddons/src/lib/io/kdirwatch.cpp
(Diff revision 1)
|
bool KDirWatchPrivate::useFAM(Entry* e) |
676 |
if (res<0) { |
676 |
if (res<0) { |
677 |
e->m_mode = UnknownMode; |
677 |
e->m_mode = UnknownMode; |
678 |
use_fam=false; |
678 |
use_fam=false; |
679 |
delete sn; sn = 0; |
679 |
delete sn; sn = 0; |
Same as the block above
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
(Diff revision 1)
|
bool KDirWatchPrivate::useQFSWatch(Entry* e) |
781 |
void KDirWatchPrivate::addEntry(KDirWatch* instance, const QString& _path, |
781 |
void KDirWatchPrivate::addEntry(KDirWatch* instance, const QString& _path, |
782 |
Entry* sub_entry, bool isDir, KDirWatch::WatchModes watchModes) |
782 |
Entry* sub_entry, bool isDir, KDirWatch::WatchModes watchModes) |
Pointer signs to the variable -> KDirWatch *instance etc
Should be at the "if" line, eg. "if () {"
Spaces inside -> "KDirWatch *, bool"
- Martin Klapetek
On October 17th, 2013, 3:51 a.m. UTC, Nicolás Alvarez wrote:
Review request for KDE Frameworks and kdelibs.
By Nicolás Alvarez.
Updated Oct. 17, 2013, 3:51 a.m.
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?
|
Testing
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)
View Diff
|