This is an automatically generated e-mail. To reply, visit:

src/k7zip.cpp (line 2343)

    QObject::tr() is bad practice in Qt code (the context class name is then 
"QObject" instead of e.g. K7Zip).
    However I assume that our ts -> po tools don't really care about the 
context classname (since po doesn't have that), so maybe it doesn't matter. It 
still shows bad practice for people actually using lupdate.
    (BTW the solution for the fact that this isn't a QObject-derived class is 
to add Q_DECLARE_TR_FUNCTIONS to the class definition)

src/k7zip.cpp (line 2874)

    As previously discussed, I think this should (also) be a qWarning.
    API misuse => qWarning.
    Reasoning: if a bad programmer misuses the API *and* doesn't check 
errorString, he/she won't find out.
    And the tr() string might need adjustment, this is shown the user, but the 
"you" in the string isn't the user. I'd say
    setErrorString(tr("Application error: 7-Zip file not open before writing to 
it, please file a bug report at https://bugs.kde.org";))

src/k7zip.cpp (line 2879)

       .. BTW all this talk about "tar file" is wrong in this file (copy/paste 
errors). Should be "7-zip file"

src/k7zip.cpp (line 2915)


src/k7zip.cpp (line 2951)


src/k7zip.cpp (line 2956)


src/kar.cpp (line 63)

    In the tr() message: "for ar files"  (KAr is an internal implementation 
name, untranslatable and opaque to users)
    The qWarning() can mention KAr though.

src/karchive.cpp (line 193)

    4-spaces indentation

src/karchive.cpp (line 220)

    stat'ing is too technical. Maybe like this:
    tr("Failed accessing the file %1 for adding to the archive. The error was: 

src/karchive.cpp (line 356)

    tr("Writing failed: %1")

src/karchive_p.h (line 54)

    missing tr()

src/krcc.cpp (line 90)

    see KAr.
    And this should be a qWarning, it's definitely a programmer error to try 
and write to an rcc file.
    I'm not even sure I would set the error string, but ok, let's be consistent.
    Maybe just tr("Cannot write to a RCC file") in all methods, no point in 
having different error messages [to translate].

src/ktar.cpp (line 337)

    Adding %1 and the filename might be useful.
      ("which archive?")

src/ktar.cpp (line 376)

    typo: underlying
    But that's very probably a programmer error => qWarning.

src/ktar.cpp (line 585)

    coding style: missing { ... } even for single-line if statements.

src/ktar.cpp (line 730)

    qWarning + tr() that doesn't use "You", as above

src/ktar.cpp (line 735)


src/kzip.cpp (line 468)

    Maybe s/#1/Error code: 1/, otherwise user and translators might wonder what 
this #1 is.

src/kzip.cpp (line 786)

    Remove space after dot, so that this is the same string as the one before.

src/kzip.cpp (line 1043)

    qWarning + tr() without You
      same for all similar ones below

src/kzip.cpp (line 1207)

    Let's not have the "ouch" in the user-visible string ;)
    In fact, in general Qt/KF5 code doesn't test for out-of-memory errors, so 
this if() should just be removed (as well as the Q_ASSERT).

src/kzip.cpp (line 1273)

    This will overwrite the error string that was set by doPrepareWriting 
itself. I would suggest to remove this line completely. Same for the other two 

- David Faure

On Oct. 15, 2016, 3:08 a.m., Romário Rios wrote:
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/129170/
> -----------------------------------------------------------
> (Updated Oct. 15, 2016, 3:08 a.m.)
> Review request for KDE Frameworks.
> Repository: karchive
> Description
> -------
> This method is similar to `QIODevice::errorString()`. I added a public 
> `errorString()` method and a protected `setErrorString()` method, to allow 
> `KArchive`'s subclasses to implement their own error messages. I also 
> implemented most error messages from most subclasses.
> Diffs
> -----
>   autotests/karchivetest.cpp d0fbf41 
>   src/k7zip.cpp 692b1db 
>   src/kar.cpp 7204fb1 
>   src/karchive.h b528a4a 
>   src/karchive.cpp a1a160a 
>   src/karchive_p.h 256620d 
>   src/krcc.cpp 1947dd6 
>   src/ktar.cpp f70b155 
>   src/kzip.cpp 94d4276 
> Diff: https://git.reviewboard.kde.org/r/129170/diff/
> Testing
> -------
> I added `QVERIFY` calls after all errors in `karchivetests.cpp`. Perhaps 
> we'll need more tests, but I'm not sure how to make an archive to fail in 
> some specific way aside from the very basics ("file not found", etc.).
> Thanks,
> Romário Rios

Reply via email to