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)
void removeItem(const KUrl &url)
Removes an item from preview processing.
Definition: previewjob.cpp:381
When set, automatically overwrite the destination if it exists already.
Definition: jobclasses.h:67
static QStringList availablePlugins()
Returns a list of all available preview plugins.
Definition: previewjob.cpp:735
bool loadFromData(const uchar *data, int len, const char *format)
QString & append(QChar ch)
iterator insert(const Key &key, const T &value)
int width() const
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
void setOverlayIconSize(int size)
Sets the size of the MIME-type icon which overlays the preview.
Definition: previewjob.cpp:214
void setPrefix(const QString &prefix)
bool remove()
static KServiceTypeTrader * self()
bool save(const QString &fileName, const char *format, int quality) const
void setScaleType(ScaleType type)
Sets the scale type for the generated preview.
Definition: previewjob.cpp:238
Definition: netaccess.h:36
bool contains(const QString &str, Qt::CaseSensitivity cs) const
TransferJob * get(const KUrl &url, LoadType reload=NoReload, JobFlags flags=DefaultFlags)
Get (a.k.a.
Definition: job.cpp:1369
int rename(const QString &in, const QString &out)
StatJob * stat(const KUrl &url, JobFlags flags=DefaultFlags)
Find all details for one file or directory.
Definition: job.cpp:924
QPixmap fromImage(const QImage &image, QFlags< Qt::ImageConversionFlag > flags)
const_iterator constFind(const Key &key) const
A KIO job that retrieves information about a file or directory.
Definition: jobclasses.h:440
const_iterator constFind(const Key &key) const
bool isNull() const
QString & remove(int position, int n)
QImage copy(const QRect &rectangle) const
void setSuffix(const QString &suffix)
void chop(int n)
QString homePath()
The original size of the preview will be returned.
Definition: previewjob.h:51
KSharedConfigPtr config()
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
void setPath(const QString &path)
static bool makeDir(const QString &dir, int mode=0755)
Definition: kfileitem.h:48
void setText(const QString &key, const QString &text)
void setProtocol(const QString &proto)
QString number(int n, int base)
void append(const T &value)
QVariant property(const char *name) const
const_iterator constEnd() const
static KIO::filesize_t maximumFileSize()
Returns the default "maximum file size", in bytes, used by PreviewJob.
Definition: previewjob.cpp:783
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
int width() const
QString protocol() const
void setAutoRemove(bool b)
int toInt(bool *ok, int base) const
QString localPath() const
Returns the local path if isLocalFile() == true or the KIO item has a UDS_LOCAL_PATH atom...
Definition: kfileitem.cpp:602
bool isEmpty() const
int removeAll(const T &value)
QString trimmed() const
const_iterator constEnd() const
iterator begin()
List of KFileItems, which adds a few helper methods to QList.
Definition: kfileitem.h:674
void setPass(const QString &pass)
T & first()
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
static QString protocolClass(const QString &protocol)
QString scheme() const
QStringList mimeTypes(Mode mode=Writing)
Returns a list of MIME types for all KImageIO supported formats.
Definition: kimageio.cpp:64
iterator end()
const T value(const Key &key) const
QString fileName() const
QString & replace(int position, int n, QChar after)
KService::List query(const QString &servicetype, const QString &constraint=QString()) const
The preview will be scaled to the size specified when constructing the PreviewJob.
Definition: previewjob.h:62
void setIgnoreMaximumSize(bool ignoreSize=true)
If ignoreSize is true, then the preview is always generated regardless of the settings.
Definition: previewjob.cpp:408
void setOverlayIconAlpha(int alpha)
Sets the alpha-value for the MIME-type icon which overlays the preview.
Definition: previewjob.cpp:226
typedef ConstIterator
int height() const
Definition: job.h:29
const QList< KJob * > & subjobs() const
bool toBool() const
bool hasSubjobs()
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
int height() const
iterator insert(const Key &key, const T &value)
ScaleType
Specifies the type of scaling that is applied to the generated preview.
Definition: previewjob.h:46
QString url(AdjustPathOption trailing=LeaveTrailingSlash) const
void result(KJob *job)
iterator end()
const_iterator constEnd() const
The transfer job pumps data into and/or out of a Slave.
Definition: jobclasses.h:555
static QStringList supportedMimeTypes()
Returns a list of all supported MIME types.
Definition: previewjob.cpp:745
const_iterator constBegin() const
bool isLocalFile() const
KAction * save(const QObject *recvr, const char *slot, QObject *parent)
Definition: job_p.h:39
bool open()
T readEntry(const QString &key, const T &aDefault) const
iterator begin()
The preview will be scaled to the size specified when constructing the PreviewJob.
Definition: previewjob.h:56
QImage scaled(int width, int height, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformMode) const
QByteArray encodeName(const QString &fileName)
KUrl mostLocalUrl(bool &local) const
Tries to give a local URL for this file item if possible.
Definition: kfileitem.cpp:1470
A KFileItem is a generic class to handle a file, local or remote.
Definition: kfileitem.h:45
QString number(KIO::filesize_t size)
Converts a size to a string representation Not unlike QString::number(...)
Definition: global.cpp:63
singleShot
void setSequenceIndex(int index)
Sets the sequence index given to the thumb creators.
Definition: previewjob.cpp:400
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.