KDED
kmimeassociations.cpp
Go to the documentation of this file.
55 // Using the "merged view" from KConfig is not enough since we -add- at every level, we don't replace.
56 const QStringList mimeappsFiles = KGlobal::dirs()->findAllResources("xdgdata-apps", "mimeapps.list");
79 parseAddedAssociations(KConfigGroup(&profile, "Added KDE Service Associations"), file, basePreference);
83 void KMimeAssociations::parseAddedAssociations(const KConfigGroup& group, const QString& file, int basePreference)
94 //kDebug(7021) << "adding mime" << resolvedMimeName << "to service" << pService->entryPath() << "pref=" << pref;
95 m_offerHash.addServiceOffer(resolvedMimeName, KServiceOffer(pService, pref, 0, pService->allowAsDefault()));
102 void KMimeAssociations::parseRemovedAssociations(const KConfigGroup& group, const QString& file)
111 //kDebug(7021) << "removing mime" << mime << "from service" << pService.data() << pService->entryPath();
121 //kDebug(7021) << "Adding" << service->entryPath() << "to" << serviceType << offer.preference();
134 if (sfit.next().service() == service) // we can compare KService::Ptrs because they are from the memory hash
bool parseAllMimeAppsList()
Definition: kmimeassociations.cpp:53
const T & previous()
void addServiceOffer(const QString &serviceType, const KServiceOffer &offer)
Definition: kmimeassociations.cpp:118
T & value()
KStandardDirs * dirs()
static KMimeTypeRepository * self()
const_iterator insert(const T &value)
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
bool allowAsDefault() const
KService::Ptr service() const
void append(const T &value)
KMimeAssociations(KOfferHash &offerHash)
Definition: kmimeassociations.cpp:31
Definition: kmimeassociations.h:37
void removeServiceOffer(const QString &serviceType, KService::Ptr service)
Definition: kmimeassociations.cpp:140
bool isEmpty() const
QStringList readXdgListEntry(const QString &pKey, const QStringList &aDefault=QStringList()) const
void toBack()
void remove()
QStringList keyList() const
iterator find(const Key &key)
void parseMimeAppsList(const QString &file, int basePreference)
Definition: kmimeassociations.cpp:72
QString name() const
bool hasNext() const
bool contains(const T &value) const
int preference() const
bool hasPrevious() const
bool remove(const T &value)
T & next()
QString storageId() const
bool hasRemovedOffer(const QString &serviceType, KService::Ptr service) const
Definition: kmimeassociations.cpp:152
QStringList findAllResources(const char *type, const QString &filter=QString(), SearchOptions options=NoSearchOptions) const
QSet< KService::Ptr > removedOffers
Definition: kmimeassociations.h:34
iterator end()
QString canonicalName(const QString &mime)
Definition: kmimeassociations.h:31
static Ptr serviceByStorageId(const QString &_storageId)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:26:11 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:26:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.