KDECore
kmimetype.cpp
Go to the documentation of this file.
176 if no glob matches, or if more than one glob matches, use default mimetype and mark as "can be refined".
231 KMimeType::Ptr mime = KMimeTypeRepository::self()->findFromContent(device, &magicAccuracy, beginning);
234 //kDebug(servicesDebugArea()) << "findFromContent said" << (mime?mime->name():QString()) << "with accuracy" << magicAccuracy;
244 //kDebug(servicesDebugArea()) << "sniffedMime=" << sniffedMime << "mimeFromPattern=" << mimeFromPattern->name();
627 kWarning() << "No file found for" << file << ", even though the file appeared in a directory listing.";
628 kWarning() << "Either it was just removed, or the directory doesn't have executable permission...";
QStringList languageList() const
Returns the language codes selected by user, ordered by decreasing priority.
Definition klocale.cpp:439
Definition kmimetype_p.h:25
virtual QVariant property(const QString &name) const
Definition kmimetype.cpp:436
virtual QString comment(const KUrl &=KUrl()) const
Definition kmimetype_p.h:42
virtual int serviceOffersOffset() const
Definition kmimetype.cpp:780
virtual QStringList propertyNames() const
Definition kmimetype.cpp:448
static bool matchFileName(const QString &filename, const QString &pattern)
Definition kmimetyperepository.cpp:98
Represent a mime type, like "text/plain", and the data that is associated with it.
Definition kmimetype.h:47
QStringList parentMimeTypes() const
If this mimetype is a subclass of one or more other mimetypes, return the list of those mimetypes.
Definition kmimetype.cpp:565
static Ptr findByContent(const QByteArray &data, int *accuracy=0)
Tries to find out the MIME type of a data chunk by looking for certain magic numbers and characterist...
Definition kmimetype.cpp:361
QString userSpecifiedIconName() const
Returns the user-specified icon for this mimetype.
Definition kmimetype.cpp:731
bool is(const QString &mimeTypeName) const
Do not use name()=="somename" anymore, to check for a given mimetype.
Definition kmimetype.cpp:556
static bool isBufferBinaryData(const QByteArray &data)
Returns whether a buffer has an internal format that is not human readable.
Definition kmimetype.cpp:74
static QString favIconForUrl(const KUrl &url)
Return the "favicon" (see http://www.favicon.com) for the given url, if available.
Definition kmimetype.cpp:488
static int sharedMimeInfoVersion()
Returns the version of the installed update-mime-database program (from freedesktop....
Definition kmimetype.cpp:738
static QString defaultMimeType()
Returns the name of the default mimetype.
Definition kmimetype.cpp:597
bool isDefault() const
Return true if this mimetype is the default mimetype.
Definition kmimetype.cpp:48
static Ptr findByNameAndContent(const QString &name, const QByteArray &data, mode_t mode=0, int *accuracy=0)
Tries to find out the MIME type of filename/url and a data chunk.
Definition kmimetype.cpp:337
static QString iconNameForUrl(const KUrl &url, mode_t mode=0)
Return the filename of the icon associated with the mimetype, for a given url.
Definition kmimetype.cpp:460
static Ptr findByFileContent(const QString &fileName, int *accuracy=0)
Tries to find out the MIME type of a file by looking for certain magic numbers and characteristic str...
Definition kmimetype.cpp:375
static Ptr mimeType(const QString &name, FindByNameOption options=ResolveAliases)
Retrieve a pointer to the mime type name.
Definition kmimetype.cpp:58
static bool matchFileName(const QString &filename, const QString &pattern)
Returns true if the given filename matches the given pattern.
Definition kmimetype.cpp:775
QString parentMimeType() const
If this mimetype is a subclass of another mimetype, return the name of the parent.
Definition kmimetype.cpp:532
static Ptr findByPath(const QString &path, mode_t mode=0, bool fast_mode=false, int *accuracy=0)
Finds a KMimeType with the given url.
Definition kmimetype.cpp:329
static QString extractKnownExtension(const QString &fileName)
Determines the extension from a filename (or full path) using the mimetype database.
Definition kmimetype.cpp:354
QStringList patterns() const
Retrieve the list of patterns associated with the MIME Type.
Definition kmimetype.cpp:610
static Ptr findByUrl(const KUrl &url, mode_t mode=0, bool is_local_file=false, bool fast_mode=false, int *accuracy=0)
Finds a KMimeType with the given url.
Definition kmimetype.cpp:316
QStringList allParentMimeTypes() const
Return all parent mimetypes of this mimetype, direct or indirect.
Definition kmimetype.cpp:586
QString mainExtension() const
Return the primary extension associated with this mimetype, if any.
Definition kmimetype.cpp:743
QString iconName(const KUrl &url=KUrl()) const
Return the filename of the icon associated with the mimetype.
Definition kmimetype.cpp:604
static bool isBinaryData(const QString &fileName)
Returns whether a file has an internal format that is not human readable.
Definition kmimetype.cpp:397
static KProtocolInfoFactory * self()
The instance of the KProtocolInfoFactory.
Definition kprotocolinfofactory.cpp:119
static bool determineMimetypeFromExtension(const QString &protocol)
Returns whether mimetypes can be determined based on extension for this protocol.
Definition kprotocolinfo.cpp:328
static QString icon(const QString &protocol)
Returns the name of the icon, associated with the specified protocol.
Definition kprotocolinfo.cpp:287
virtual QStringList propertyNames() const
Definition kservicetype.cpp:169
virtual QVariant property(const QString &name) const
Definition kservicetype.cpp:154
A service type is, well, a type of service, where a service is an application or plugin.
Definition kservicetype.h:44
QString comment() const
Returns the descriptive comment associated, if any.
Definition kservicetype.cpp:232
QStringList findAllResources(const char *type, const QString &filter=QString(), SearchOptions options=NoSearchOptions) const
Tries to find all resources with the specified type.
Definition kstandarddirs.cpp:900
QStringList resourceDirs(const char *type) const
This function is used internally by almost all other function as it serves and fills the directories ...
Definition kstandarddirs.cpp:1069
QString url(AdjustPathOption trailing=LeaveTrailingSlash) const
Returns the URL as string, with all escape sequences intact, encoded in a given charset.
Definition kurl.cpp:1035
QString protocol() const
Returns the protocol for the URL (i.e., file, http, etc.), lowercased.
Definition kurl.cpp:672
QString toLocalFile(AdjustPathOption trailing=LeaveTrailingSlash) const
Definition kurl.cpp:885
Definition kaboutdata.h:33
static KMimeType::Ptr findFromMode(const QString &path, mode_t mode, bool is_local_file)
Definition kmimetype.cpp:86
static void collectParentMimeTypes(const QString &mime, QStringList &allParents)
Definition kmimetype.cpp:571
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.