Bug 39778 - [Qt] CookieJarQt.cpp has coding-style errors
Summary: [Qt] CookieJarQt.cpp has coding-style errors
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P5 Normal
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2010-05-26 13:37 PDT by Anders Bakken
Modified: 2011-01-08 16:48 PST (History)
4 users (show)

See Also:


Attachments
Patch that fixes the coding style issues (1.84 KB, patch)
2010-05-26 14:46 PDT, Anders Bakken
no flags Details | Formatted Diff | Diff
Patch (1.93 KB, patch)
2010-06-04 20:22 PDT, Anders Bakken
no flags Details | Formatted Diff | Diff
Patch (2.12 KB, patch)
2011-01-07 12:12 PST, Benjamin Poulain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Bakken 2010-05-26 13:37:38 PDT
WebCore/platform/qt/CookieJarQt.cpp:37:  Alphabetical sorting problem.  [build/include_order] [4]
WebCore/platform/qt/CookieJarQt.cpp:38:  Alphabetical sorting problem.  [build/include_order] [4]
WebCore/platform/qt/CookieJarQt.cpp:48:  Declaration has space between type name and * in Frame *frame  [whitespace/declaration] [3]
WebCore/platform/qt/CookieJarQt.cpp:51:  Declaration has space between type name and * in FrameLoader *loader  [whitespace/declaration] [3]
WebCore/platform/qt/CookieJarQt.cpp:125:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 5 in 1 files
Comment 1 Anders Bakken 2010-05-26 14:46:34 PDT
Created attachment 57159 [details]
Patch that fixes the coding style issues
Comment 2 Petri Ojala 2010-05-26 21:52:16 PDT
Qt, QtTriaged
Comment 3 David Levin 2010-05-27 11:12:28 PDT
Comment on attachment 57159 [details]
Patch that fixes the coding style issues

>   No new tests. (OOPS!)
Ditto.
Comment 4 Anders Bakken 2010-06-04 20:22:41 PDT
Created attachment 57954 [details]
Patch
Comment 5 Eric Seidel (no email) 2010-06-04 22:11:26 PDT
Comment on attachment 57954 [details]
Patch

Seems silly to not just make this a one-line function call now:
     QNetworkCookieJar* jar = cookieJar(document);
125      return (jar != 0);
 125     return jar;

You could use !!cookieJar(document)
to make it clear that your'e returnign a bool if you like.
Comment 6 David Levin 2010-06-14 11:32:19 PDT
Comment on attachment 57954 [details]
Patch

Please consider Eric's comment.
Comment 7 Benjamin Poulain 2011-01-07 11:41:27 PST
Anders, what is the status of this?
Comment 8 Benjamin Poulain 2011-01-07 12:12:41 PST
Created attachment 78255 [details]
Patch
Comment 9 Kenneth Rohde Christiansen 2011-01-07 12:14:08 PST
Comment on attachment 78255 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=78255&action=review

> WebCore/platform/qt/CookieJarQt.cpp:117
> -    return networkAccessManager(document);
> +    return !!networkAccessManager(document);

It this in the coding style guide?
Comment 10 Andreas Kling 2011-01-07 12:15:35 PST
Comment on attachment 78255 [details]
Patch

Oh, let's answer Kenneth's question first.
Comment 11 Benjamin Poulain 2011-01-07 12:17:48 PST
(In reply to comment #9)
> > WebCore/platform/qt/CookieJarQt.cpp:117
> > -    return networkAccessManager(document);
> > +    return !!networkAccessManager(document);
> 
> It this in the coding style guide?

No, it was to address Eric Seidel comment (comment 5).
Comment 12 WebKit Commit Bot 2011-01-08 16:47:54 PST
Comment on attachment 78255 [details]
Patch

Clearing flags on attachment: 78255

Committed r75334: <http://trac.webkit.org/changeset/75334>
Comment 13 WebKit Commit Bot 2011-01-08 16:48:01 PST
All reviewed patches have been landed.  Closing bug.