KIO
mimetypefinderjob.cpp
127 KIO::StatJob *job = KIO::stat(m_url, KIO::StatJob::SourceSide, statFlags, KIO::HideProgressInfo);
221 qCWarning(KIO_CORE) << "KIO::get didn't emit a mimetype! Please fix the KIO worker for URL" << m_url;
227 QObject::connect(job, &KIO::TransferJob::mimeTypeFound, q, [=, this](KIO::Job *, const QString &mimetype) {
232 qCWarning(KIO_CORE) << "get() didn't emit a MIME type! Probably a KIO worker bug, please check the implementation of" << m_url.scheme();
238 const QMimeType mime = fixupMimeType(m_mimeTypeName, m_suggestedFileName.isEmpty() ? m_url.fileName() : m_suggestedFileName);
The base class for all jobs.
QString errorString() const override
Converts an error code and a non-i18n error message into an error message in the current language.
Definition job_error.cpp:26
QString queryMetaData(const QString &key)
Query meta data received from the worker.
Definition job.cpp:210
void addMetaData(const QString &key, const QString &value)
Add key/value pair to the meta data that is sent to the worker.
Definition job.cpp:221
MimeTypeFinderJob finds out the MIME type of a URL.
Definition mimetypefinderjob.h:29
QString suggestedFileName() const
Returns the suggested filename, either set by setSuggestedFileName or returned by the KIO::get job.
Definition mimetypefinderjob.cpp:82
void setSuggestedFileName(const QString &suggestedFileName)
Sets the file name to use in the case of downloading the file to a tempfile, in order to give it to a...
Definition mimetypefinderjob.cpp:77
MimeTypeFinderJob(const QUrl &url, QObject *parent=nullptr)
Creates an MimeTypeFinderJob for a URL.
Definition mimetypefinderjob.cpp:44
bool isAuthenticationPromptEnabled() const
Returns where authentication prompts are enabled or disabled.
Definition mimetypefinderjob.cpp:97
void setAuthenticationPromptEnabled(bool enable)
Enable/disable authentication prompt, if the URL requires one.
Definition mimetypefinderjob.cpp:92
void setFollowRedirections(bool b)
Sets whether the job should follow URL redirections.
Definition mimetypefinderjob.cpp:72
A KIO job that retrieves information about a file or directory.
The transfer job pumps data into and/or out of a KIO worker.
void mimeTypeFound(KIO::Job *job, const QString &mimeType)
MIME type determined.
Universal Directory Service.
@ UDS_LOCAL_PATH
A local file path if the KIO worker display files sitting on the local filesystem (but in another hie...
Definition udsentry.h:227
int error() const
void result(KJob *job)
void setCapabilities(Capabilities capabilities)
Killable
QString errorText() const
static bool supportsReading(const QUrl &url)
Returns whether the protocol can retrieve data from URLs.
Definition kprotocolmanager.cpp:209
static bool supportsListing(const QUrl &url)
Returns whether the protocol can list files/objects.
Definition kprotocolmanager.cpp:189
QString i18n(const char *text, const TYPE &arg...)
KIOCORE_EXPORT StatJob * stat(const QUrl &url, JobFlags flags=DefaultFlags)
Find all details for one file or directory.
Definition statjob.cpp:203
KIOCORE_EXPORT QString buildErrorString(int errorCode, const QString &errorText)
Returns a translated error message for errorCode using the additional error information provided by e...
Definition job_error.cpp:31
KIOCORE_EXPORT TransferJob * get(const QUrl &url, LoadType reload=NoReload, JobFlags flags=DefaultFlags)
Get (means: read).
Definition transferjob.cpp:385
KIOCORE_EXPORT MimetypeJob * mimetype(const QUrl &url, JobFlags flags=DefaultFlags)
Find MIME type for one file or directory.
Definition mimetypejob.cpp:82
MatchExtension
QMimeType mimeTypeForFile(const QFileInfo &fileInfo, MatchMode mode) const const
QMimeType mimeTypeForName(const QString &nameOrAlias) const const
isDefault
name
bool isValid() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool isEmpty() const const
singleShot
QUrl fromLocalFile(const QString &localFile)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.