24 #include <tqvariant.h>
26 #include <kdesktopfile.h>
28 #include <tdeglobal.h>
29 #include <kstandarddirs.h>
32 #include "tdecmoduleinfo.h"
34 class TDECModuleInfo::TDECModuleInfoPrivate
37 TDECModuleInfoPrivate() :
40 ~TDECModuleInfoPrivate()
51 d =
new TDECModuleInfoPrivate;
56 KService::Ptr
service = KService::serviceByStorageId(desktopFile);
57 if(!service)
setName(desktopFile);
68 d =
new TDECModuleInfoPrivate;
77 _keywords = rhs._keywords;
81 _handle = rhs._handle;
82 _fileName = rhs._fileName;
84 _comment = rhs._comment;
85 _needsRootPrivileges = rhs._needsRootPrivileges;
86 _isHiddenByDefault = rhs._isHiddenByDefault;
87 _allLoaded = rhs._allLoaded;
88 _service = rhs._service;
97 if( d->factoryName.isEmpty() )
99 d->factoryName = _service->property(
"X-TDE-FactoryName", TQVariant::String).toString();
100 if ( d->factoryName.isEmpty() )
104 return d->factoryName;
109 return ( ( _name == rhs._name ) && ( _lib == rhs._lib ) && ( _fileName == rhs._fileName ) );
122 void TDECModuleInfo::init(KService::Ptr s)
125 d =
new TDECModuleInfoPrivate;
131 kdDebug(712) <<
"Could not find the service." <<
endl;
140 _fileName = ( _service->desktopEntryPath() );
158 setHandle(_service->property(
"X-TDE-FactoryName", TQVariant::String).toString());
163 tmp = _service->property(
"X-TDE-Weight", TQVariant::Int );
164 setWeight( tmp.isValid() ? tmp.toInt() : 100 );
167 tmp = _service->property(
"X-TDE-RootOnly", TQVariant::Bool );
172 tmp = _service->property(
"X-TDE-IsHiddenByDefault", TQVariant::Bool );
176 setDocPath( _service->property(
"X-DocPath", TQVariant::String ).toString() );
178 tmp = _service->property(
"X-TDE-Test-Module", TQVariant::Bool );
197 if (_handle.isEmpty())
218 return _needsRootPrivileges;
227 return _isHiddenByDefault;
232 return d->testModule;