kuserprofile.cpp
80 if ( !type.isEmpty() /* && pref >= 0*/ ) // Don't test for pref here. We want those in the list, to mark them as forbidden
91 //kdDebug(7014) << "KServiceTypeProfile::initStatic adding service " << application << " to profile for " << type << "," << type2 << " with preference " << pref << endl;
110 KServiceTypeProfile::OfferList KServiceTypeProfile::offers( const TQString& _servicetype, const TQString& _genericServiceType )
114 //kdDebug(7014) << "KServiceTypeProfile::offers( " << _servicetype << "," << _genericServiceType << " )" << endl;
145 //kdDebug(7014) << "Found profile after switching: " << profile->offers().count() << " offers" << endl;
154 serviceList += (*itOffers).service()->desktopEntryPath(); // this should identify each service uniquely
159 // but it's also the case for any service that's neither App nor ReadOnlyPart, e.g. RenameDlg/Plugin
165 if (_genericServiceType.isEmpty() /*no constraint*/ || (*it)->hasServiceType( _genericServiceType ))
173 //kdDebug(7014) << "Appending offer " << (*it)->name() << " initial preference=" << (*it)->initialPreference() << " allow-as-default=" << allow << endl;
187 kdDebug(7014) << (*itOff).service()->name() << " allow-as-default=" << (*itOff).allowAsDefault() << endl;
194 KServiceTypeProfile::KServiceTypeProfile( const TQString& _servicetype, const TQString& _genericServiceType )
243 KServiceTypeProfile* KServiceTypeProfile::serviceTypeProfile( const TQString& _servicetype, const TQString& _genericServiceType )
248 const TQString &_genservicetype = ((!_genericServiceType.isEmpty()) ? _genericServiceType : app_str);
264 kdDebug(7014) << "KServiceTypeProfile::offers serviceType=" << m_strServiceType << " genericServiceType=" << m_strGenericServiceType << endl;
289 // We use 0 as the preference to ensure new apps don't take over existing apps (which default to 1)
299 //kdDebug(7014) << "KServiceTypeProfile::offers returning " << offers.count() << " offers" << endl;
303 KService::Ptr KServiceTypeProfile::preferredService( const TQString & _serviceType, const TQString & _genericServiceType )
This class holds the user-specific preferences of a service (whether it can be a default offer or not...
Definition: kuserprofile.h:41
bool operator<(const KServiceOffer &) const
A service is bigger that the other when it can be default (and the other is not) and its preference v...
Definition: kuserprofile.cpp:344
KServiceTypeProfile represents the user's preferences for services of a service type.
Definition: kuserprofile.h:118
static KServiceTypeProfile * serviceTypeProfile(const TQString &servicetype, const TQString &genericServiceType=TQString::null)
Returns the profile for the requested service type.
Definition: kuserprofile.cpp:243
int preference(const TQString &_service) const
Definition: kuserprofile.cpp:213
void addService(const TQString &_service, int _preference=1, bool _allow_as_default=true)
Add a service to this profile.
Definition: kuserprofile.cpp:206
KServiceTypeProfile(const TQString &serviceType, const TQString &genericServiceType=TQString::null)
Constructor is called when the user profile is read for the first time.
Definition: kuserprofile.cpp:194
static KService::Ptr preferredService(const TQString &serviceType, const TQString &genericServiceType)
Returns the preferred service for _serviceType and _genericServiceType ("Application",...
Definition: kuserprofile.cpp:303
bool allowAsDefault(const TQString &_service) const
Definition: kuserprofile.cpp:225
OfferList offers() const
Returns the list of all service offers for the service types that are represented by this profile.
Definition: kuserprofile.cpp:260
static KService::List offers(const TQString &_servicetype)
Returns all services supporting the given servicetype name.
Definition: kservicetype.cpp:248
static Ptr serviceByName(const TQString &_name)
Find a service by name, i.e.
Definition: kservice.cpp:668
static Ptr serviceByStorageId(const TQString &_storageId)
Find a service by its storage-id or desktop-file path.
Definition: kservice.cpp:694