CVS commit by charles: add a setIgnoreMaximumSize so that I can fix a bug in photobook (pending commit) This adds that function to both PreviewJob and KFileIconView. M +11 -0 kfile/kfileiconview.h 1.44 M +8 -0 kio/previewjob.cpp 1.43 M +8 -0 kio/previewjob.h 1.19 --- kdelibs/kio/kfile/kfileiconview.h #1.43:1.44 @@ -123,4 +123,13 @@ public: /** + * Disables the "Maximum file size" configuration option for previews + * + * Set this before calling showPreviews() + * + * @since 3.4 + **/ + void setIgnoreMaximumSize(bool ignoreSize=true); + + /** * @returns the current size used for icons. */ @@ -148,4 +157,6 @@ public slots: * Starts loading previews for all files shown and shows them. Switches * into 'large rows' mode, if that isn't the current mode yet. + * + * @sa setIgnoreMaximumSize */ void showPreviews(); --- kdelibs/kio/kio/previewjob.cpp #1.42:1.43 @@ -112,4 +112,5 @@ struct KIO::PreviewJobPrivate // Root of thumbnail cache QString thumbRoot; + bool ignoreMaximumSize; }; @@ -137,4 +138,5 @@ PreviewJob::PreviewJob( const KFileItemL d->currentItem.item = 0; d->thumbRoot = QDir::homeDirPath() + "/.thumbnails/"; + d->ignoreMaximumSize = false; // Return to event loop first, determineNextFile() might delete this; @@ -231,4 +233,9 @@ void PreviewJob::removeItem( const KFile } +void PreviewJob::setIgnoreMaximumSize(bool ignoreSize) +{ + d->ignoreMaximumSize = ignoreSize; +} + void PreviewJob::determineNextFile() { @@ -289,4 +296,5 @@ void PreviewJob::slotResult( KIO::Job *j { if ( filesize_t((*it).m_long) > d->maximumSize && + !d->ignoreMaximumSize && !d->currentItem.plugin->property("IgnoreMaximumSize").toBool() ) { --- kdelibs/kio/kio/previewjob.h #1.18:1.19 @@ -69,4 +69,12 @@ namespace KIO { /** + * If @p ignoreSize is true, then the preview is always + * generated regardless of the settings + * + * @since KDE 3.4 + **/ + void setIgnoreMaximumSize(bool ignoreSize = true); + + /** * Returns a list of all available preview plugins. The list * contains the basenames of the plugins' .desktop files (no path,