KService
kapplicationtrader.cpp
28 if (!mimeType.startsWith(QLatin1String("x-scheme-handler/"))) { // don't warn for unknown scheme handler mimetypes
38 if (!mimeType.startsWith(QLatin1String("x-scheme-handler/"))) { // don't warn for unknown scheme handler mimetypes
50static void applyFilter(KService::List &list, KApplicationTrader::FilterFunc filterFunc, bool mustShowInCurrentDesktop)
59 return (filterFunc && !filterFunc(serv)) || (mustShowInCurrentDesktop && !serv->showInCurrentDesktop());
76KService::List KApplicationTrader::queryByMimeType(const QString &mimeType, FilterFunc filterFunc)
96void KApplicationTrader::setPreferredService(const QString &mimeType, const KService::Ptr service)
101 KSharedConfig::Ptr profile = KSharedConfig::openConfig(QStringLiteral("mimeapps.list"), KConfig::NoGlobals, QStandardPaths::GenericConfigLocation);
116 KSharedConfig::Ptr fileTypesConfig = KSharedConfig::openConfig(QStringLiteral("filetypesrc"), KConfig::NoGlobals);
121bool KApplicationTrader::isSubsequence(const QString &pattern, const QString &text, Qt::CaseSensitivity cs)
QStringList readXdgListEntry(const char *key, const QStringList &aDefault=QStringList()) const
void writeXdgListEntry(const char *key, const QStringList &value, WriteConfigFlags pFlags=Normal)
NoGlobals
QExplicitlySharedDataPointer< KService > Ptr
A shared data pointer for KService.
Definition kservice.h:49
static KSycoca * self()
Get or create the only instance of KSycoca (read-only)
Definition ksycoca.cpp:357
KSERVICE_EXPORT void setPreferredService(const QString &mimeType, const KService::Ptr service)
Changes the preferred service for mimeType to service.
Definition kapplicationtrader.cpp:96
KSERVICE_EXPORT KService::List query(FilterFunc filterFunc)
This method returns a list of services (applications) that match a given filter.
Definition kapplicationtrader.cpp:64
std::function< bool(const KService::Ptr &)> FilterFunc
Filter function, used for filtering results of query and queryByMimeType.
Definition kapplicationtrader.h:39
KSERVICE_EXPORT KService::List queryByMimeType(const QString &mimeType, FilterFunc filterFunc={})
This method returns a list of services (applications) which are associated with a given MIME type.
Definition kapplicationtrader.cpp:76
KSERVICE_EXPORT KService::Ptr preferredService(const QString &mimeType)
Returns the preferred service for mimeType.
Definition kapplicationtrader.cpp:87
KSERVICE_EXPORT bool isSubsequence(const QString &pattern, const QString &text, Qt::CaseSensitivity cs=Qt::CaseSensitive)
Returns true if pattern matches a subsequence of the string text.
Definition kapplicationtrader.cpp:121
KCALUTILS_EXPORT QString mimeType()
KIOCORE_EXPORT QStringList list(const QString &fileClass)
const_reference at(qsizetype i) const const
iterator begin()
qsizetype count() const const
iterator end()
iterator erase(const_iterator begin, const_iterator end)
bool isEmpty() const const
void prepend(parameter_type value)
qsizetype removeAll(const AT &t)
QMimeType mimeTypeForName(const QString &nameOrAlias) const const
name
GenericConfigLocation
const_iterator cbegin() const const
const_iterator cend() const const
bool isEmpty() const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
CaseSensitivity
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.