KIO
previewjob.cpp
Go to the documentation of this file.
318 QHash<QString, QHash<QString, KService::Ptr> >::const_iterator it = protocolMap.constFind(item.item.url().protocol());
463 if (itemUrl.isLocalFile() || KProtocolInfo::protocolClass(itemUrl.protocol()) == QLatin1String(":local"))
488 bool pluginHandlesSequences = d->currentItem.plugin->property("HandleSequences", QVariant::Bool).toBool();
489 if ( !d->currentItem.plugin->property( "CacheThumbnail" ).toBool() || (d->sequenceIndex && pluginHandlesSequences) )
546 QString thumbnailerVersion = currentItem.plugin->property("ThumbnailerVersion", QVariant::String).toString();
548 if (!thumbnailerVersion.isEmpty() && thumb.text("Software", 0).startsWith("KDE Thumbnail Generator")) {
612 KIO::Job * job = KIO::file_copy( currentURL, localURL, -1, KIO::Overwrite | KIO::HideProgressInfo /* No GUI */ );
669 !currentItem.item.url().directory( KUrl::AppendTrailingSlash ).startsWith(thumbRoot)) && !sequenceIndex;
699 QString thumbnailerVersion = currentItem.plugin->property("ThumbnailerVersion", QVariant::String).toString();
729 pix = QPixmap::fromImage( thumb.scaled(QSize(width, height), Qt::KeepAspectRatio, Qt::SmoothTransformation) );
777 PreviewJob *KIO::filePreview(const KFileItemList &items, const QSize &size, const QStringList *enabledPlugins)
@ Overwrite
When set, automatically overwrite the destination if it exists already.
Definition: jobclasses.h:67
static QStringList supportedMimeTypes()
Returns a list of all supported MIME types.
Definition: previewjob.cpp:745
void setSequenceIndex(int index)
Sets the sequence index given to the thumb creators.
Definition: previewjob.cpp:400
void removeItem(const KUrl &url)
Removes an item from preview processing.
Definition: previewjob.cpp:381
KUrl mostLocalUrl(bool &local) const
Tries to give a local URL for this file item if possible.
Definition: kfileitem.cpp:1470
QString protocol() const
void result(KJob *job)
bool hasSubjobs()
void setOverlayIconSize(int size)
Sets the size of the MIME-type icon which overlays the preview.
Definition: previewjob.cpp:214
static QStringList availablePlugins()
Returns a list of all available preview plugins.
Definition: previewjob.cpp:735
List of KFileItems, which adds a few helper methods to QList<KFileItem>.
Definition: kfileitem.h:674
void addMetaData(const QString &key, const QString &value)
Add key/value pair to the meta data that is sent to the slave.
Definition: job.cpp:264
@ Scaled
The preview will be scaled to the size specified when constructing the PreviewJob.
Definition: previewjob.h:56
StatJob * stat(const KUrl &url, JobFlags flags=DefaultFlags)
Find all details for one file or directory.
Definition: job.cpp:924
bool kill(KillVerbosity verbosity=Quietly)
void setScaleType(ScaleType type)
Sets the scale type for the generated preview.
Definition: previewjob.cpp:238
QString localPath() const
Returns the local path if isLocalFile() == true or the KIO item has a UDS_LOCAL_PATH atom.
Definition: kfileitem.cpp:602
static bool makeDir(const QString &dir, int mode=0755)
const QList< KJob * > & subjobs() const
Definition: netaccess.h:36
QString toLocalFile(AdjustPathOption trailing=LeaveTrailingSlash) const
Definition: job_p.h:39
bool isLocalFile() const
QString number(KIO::filesize_t size)
Converts a size to a string representation Not unlike QString::number(...)
Definition: global.cpp:63
QString url(AdjustPathOption trailing=LeaveTrailingSlash) const
static KIO::filesize_t maximumFileSize()
Returns the default "maximum file size", in bytes, used by PreviewJob.
Definition: previewjob.cpp:783
PreviewJob(const KFileItemList &items, int width, int height, int iconSize, int iconAlpha, bool scale, bool save, const QStringList *enabledPlugins)
Creates a new PreviewJob.
Definition: previewjob.cpp:134
void setIgnoreMaximumSize(bool ignoreSize=true)
If ignoreSize is true, then the preview is always generated regardless of the settings.
Definition: previewjob.cpp:408
static KServiceTypeTrader * self()
KSharedConfigPtr config()
void setSuffix(const QString &suffix)
TransferJob * get(const KUrl &url, LoadType reload=NoReload, JobFlags flags=DefaultFlags)
Get (a.k.a.
Definition: job.cpp:1369
FileCopyJob * file_copy(const KUrl &src, const KUrl &dest, int permissions=-1, JobFlags flags=DefaultFlags)
Copy a single file.
Definition: job.cpp:2473
long long numberValue(uint field, long long defaultValue=0) const
Definition: udsentry.cpp:78
void setOverlayIconAlpha(int alpha)
Sets the alpha-value for the MIME-type icon which overlays the preview.
Definition: previewjob.cpp:226
AppendTrailingSlash
static Ptr mimeType(const QString &name, FindByNameOption options=ResolveAliases)
QStringList mimeTypes(Mode mode=Writing)
Returns a list of MIME types for all KImageIO supported formats.
Definition: kimageio.cpp:64
A KIO job that retrieves information about a file or directory.
Definition: jobclasses.h:440
int rename(const QString &in, const QString &out)
ScaleType
Specifies the type of scaling that is applied to the generated preview.
Definition: previewjob.h:46
PreviewJob * filePreview(const KFileItemList &items, int width, int height=0, int iconSize=0, int iconAlpha=70, bool scale=true, bool save=true, const QStringList *enabledPlugins=0)
Creates a PreviewJob to generate or retrieve a preview image for the given URL.
Definition: previewjob.cpp:755
void setPass(const QString &pass)
KService::List query(const QString &servicetype, const QString &constraint=QString()) const
void setProtocol(const QString &proto)
int error() const
void setPrefix(const QString &prefix)
A KFileItem is a generic class to handle a file, local or remote.
Definition: kfileitem.h:45
QString readEntry(const char *key, const char *aDefault=0) const
@ ScaledAndCached
The preview will be scaled to the size specified when constructing the PreviewJob.
Definition: previewjob.h:62
KAction * save(const QObject *recvr, const char *slot, QObject *parent)
void setPath(const QString &path)
static QString protocolClass(const QString &protocol)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Jan 19 2020 00:00:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Jan 19 2020 00:00:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.