KService
kmimeassociations.cpp
46 // make the list of possible filenames from the spec ($desktop-mimeapps.list, then mimeapps.list)
70 // list the dirs in the order of the spec (XDG_CONFIG_HOME, XDG_CONFIG_DIRS, XDG_DATA_HOME, XDG_DATA_DIRS)
71 return QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation) + QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation);
92 parseAddedAssociations(KConfigGroup(&profile, QStringLiteral("Added Associations")), file, basePreference);
96 parseAddedAssociations(KConfigGroup(&profile, QStringLiteral("Added KDE Service Associations")), file, basePreference);
97 parseRemovedAssociations(KConfigGroup(&profile, QStringLiteral("Removed KDE Service Associations")), file);
103 // 25 is arbitrary half of the allocated preference indices for the current parsed mimeapps.list file, defined line 86
104 parseAddedAssociations(KConfigGroup(&profile, QStringLiteral("Default Applications")), file, basePreference + 25);
107void KMimeAssociations::parseAddedAssociations(const KConfigGroup &group, const QString &file, int basePreference)
114 const QString resolvedMimeName = mimeName.startsWith(QLatin1String("x-scheme-handler/")) ? mimeName : db.mimeTypeForName(mimeName).name();
124 // qDebug() << "adding mime" << resolvedMimeName << "to service" << pService->entryPath() << "pref=" << pref;
144 // qDebug() << "removing mime" << mime << "from service" << pService.data() << pService->entryPath();
167 if (servOffer.service() == service) { // we can compare KService::Ptrs because they are from the memory hash
QString name() const
QStringList readXdgListEntry(const char *key, const QStringList &aDefault=QStringList()) const
QStringList keyList() const
SimpleConfig
void setPreference(int p)
The bigger this number is, the better is this service.
Definition kserviceoffer.cpp:78
int preference() const
The bigger this number is, the better is this service.
Definition kserviceoffer.cpp:73
KIOCORE_EXPORT QStringList list(const QString &fileClass)
void append(QList< T > &&value)
iterator begin()
const_reverse_iterator crbegin() const const
const_reverse_iterator crend() const const
iterator end()
iterator erase(const_iterator begin, const_iterator end)
QMimeType mimeTypeForName(const QString &nameOrAlias) const const
name
bool contains(const QSet< T > &other) const const
iterator insert(const T &value)
GenericConfigLocation
QStringList standardLocations(StandardLocation type)
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
QString fromLocal8Bit(QByteArrayView str)
bool isEmpty() const const
QStringList split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
SkipEmptyParts
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:06:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:06:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.