Review Request: KIO : Remote preview

Peter Penz peter.penz at gmx.at
Wed Jul 14 22:06:15 BST 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/4627/#review6566
-----------------------------------------------------------

Ship it!


Thanks for the patch, looks fine! Yes, the maximum size for remote files should never get ignored and this must be fixed. I've added a small suggestion below for the code, but it's just a suggestion. Please commit to trunk and the 4.5 branch :-) (or let me know if I should commit the patch for you)


/trunk/KDE/kdelibs/kio/kio/previewjob.cpp
<http://reviewboard.kde.org/r/4627/#comment6324>

    Only a minor suggestion: I think the code might get slightly more readable when storing the entry.numberValue() first. Also I'd suggest to always initialize scalar types (even we know in this case, that it is initialized after the if for sure).
    
    bool skipCurrentItem = false;
    const KIO::filesize_t size = (KIO::filesize_t)entry.numberValue( KIO::UDSEntry::UDS_SIZE, 0 );
    if (d->currentItem.item.url().isLocalFile())
    {
        skipCurrentItem = !d->ignoreMaximumSize && size > d->maximumLocalSize
                          && !d->currentItem.plugin->property("IgnoreMaximumSize").toBool();
    }
    else
    {
        // If remote, ignore the "IgnoreMaximumSize" plugin property
        skipCurrentItem = !d->ignoreMaximumSize && size > d->maximumRemoteSize;
    }


- Peter


On 2010-07-14 14:30:11, Iamluc wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/4627/
> -----------------------------------------------------------
> 
> (Updated 2010-07-14 14:30:11)
> 
> 
> Review request for kdelibs and Peter Penz.
> 
> 
> Summary
> -------
> 
> Hi,
> 
> There is a size limit for remote previews in Dolphin. By default, the limit is set to 0, so there is no preview for remote files.
> But a ThumbCreator plugin can ignore this limit by setting "IgnoreMaximumSize=true" in the protocol .desktop file (like the ffmpegthumbnails creator).
> 
> This patch forces to ignore this property when using a remote protocol.
> 
> Luc.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdelibs/kio/kio/previewjob.cpp 1149793 
> 
> Diff: http://reviewboard.kde.org/r/4627/diff
> 
> 
> Testing
> -------
> 
> Tested with SFTP and FTP kio slaves. Files are not downloaded anymore. 
> 
> 
> Thanks,
> 
> Iamluc
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100714/711231e5/attachment.htm>


More information about the kde-core-devel mailing list