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

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 (Diff revision 1)
void PreviewJob::slotResult( KJob *job )
353
            const KIO::filesize_t maximumSize = d->currentItem.item.url().isLocalFile()
353
            bool skipCurrentItem;
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 July 14th, 2010, 2:30 p.m., Iamluc wrote:

Review request for kdelibs and Peter Penz.
By Iamluc.

Updated 2010-07-14 14:30:11

Description

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.

Testing

Tested with SFTP and FTP kio slaves. Files are not downloaded anymore. 

Diffs

  • /trunk/KDE/kdelibs/kio/kio/previewjob.cpp (1149793)

View Diff