kutils: remove redundant handle from KCModuleInfo

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2016-04-22 10:17:28 +00:00
parent b48a55f396
commit 29ca76c4d3
3 changed files with 3 additions and 20 deletions

View file

@ -129,10 +129,6 @@ void KCModuleInfo::Private::loadAll()
// read weight
QVariant tmp = service->property( "X-KDE-Weight", QVariant::Int );
weight = tmp.isValid() ? tmp.toInt() : 100;
// factory handle
handle = lib;
}
QString KCModuleInfo::fileName() const
@ -178,14 +174,6 @@ QString KCModuleInfo::docPath() const
return d->doc;
}
QString KCModuleInfo::handle() const
{
if (!d->allLoaded)
d->loadAll();
return d->handle;
}
int KCModuleInfo::weight() const
{
if (!d->allLoaded)

View file

@ -141,11 +141,6 @@ public:
*/
QString library() const;
/**
* @return a handle, same as the library name
*/
QString handle() const;
/**
* @return the weight of the module which determines the order of the pages in
* the KCMultiDialog. It's set by the X-KDE-Weight field.

View file

@ -80,7 +80,7 @@ void KCModuleProxyPrivate::loadModule()
topLayout = new QVBoxLayout( parent );
topLayout->setMargin( 0 );
QString name = modInfo.handle();
QString name = modInfo.library();
name.replace("-", "_"); //hyphen is not allowed in dbus, only [A-Z][a-z][0-9]_
dbusPath = QLatin1String("/internal/KSettingsWidget/") + name;
dbusService = QLatin1String("org.kde.internal.KSettingsWidget_") + name;
@ -89,7 +89,7 @@ void KCModuleProxyPrivate::loadModule()
if( QDBusConnection::sessionBus().registerService( dbusService ) || bogusOccupier )
{ /* We got the name we requested, because no one was before us,
* or, it was an random application which had picked that name */
kDebug(711) << "Module not already loaded, loading module " << modInfo.moduleName() << " from library " << modInfo.library() << " using symbol " << modInfo.handle();
kDebug(711) << "Module not already loaded, loading module " << modInfo.moduleName() << " from library " << modInfo.library();
kcm = KCModuleLoader::loadModule( modInfo, KCModuleLoader::Inline, parent, args );
@ -102,7 +102,7 @@ void KCModuleProxyPrivate::loadModule()
kcm->layout()->setMargin( 0 );
}
topLayout->addWidget( kcm );
if( !modInfo.handle().isEmpty() )
if( !modInfo.library().isEmpty() )
QDBusConnection::sessionBus().registerObject(dbusPath, new KSettingsWidgetAdaptor(parent), QDBusConnection::ExportAllSlots);
if ( !rootInfo && /* If it's not already done */