mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kutils: remove redundant handle from KCModuleInfo
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
b48a55f396
commit
29ca76c4d3
3 changed files with 3 additions and 20 deletions
|
@ -129,10 +129,6 @@ void KCModuleInfo::Private::loadAll()
|
||||||
// read weight
|
// read weight
|
||||||
QVariant tmp = service->property( "X-KDE-Weight", QVariant::Int );
|
QVariant tmp = service->property( "X-KDE-Weight", QVariant::Int );
|
||||||
weight = tmp.isValid() ? tmp.toInt() : 100;
|
weight = tmp.isValid() ? tmp.toInt() : 100;
|
||||||
|
|
||||||
// factory handle
|
|
||||||
handle = lib;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString KCModuleInfo::fileName() const
|
QString KCModuleInfo::fileName() const
|
||||||
|
@ -178,14 +174,6 @@ QString KCModuleInfo::docPath() const
|
||||||
return d->doc;
|
return d->doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString KCModuleInfo::handle() const
|
|
||||||
{
|
|
||||||
if (!d->allLoaded)
|
|
||||||
d->loadAll();
|
|
||||||
|
|
||||||
return d->handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
int KCModuleInfo::weight() const
|
int KCModuleInfo::weight() const
|
||||||
{
|
{
|
||||||
if (!d->allLoaded)
|
if (!d->allLoaded)
|
||||||
|
|
|
@ -141,11 +141,6 @@ public:
|
||||||
*/
|
*/
|
||||||
QString library() const;
|
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
|
* @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.
|
* the KCMultiDialog. It's set by the X-KDE-Weight field.
|
||||||
|
|
|
@ -80,7 +80,7 @@ void KCModuleProxyPrivate::loadModule()
|
||||||
topLayout = new QVBoxLayout( parent );
|
topLayout = new QVBoxLayout( parent );
|
||||||
topLayout->setMargin( 0 );
|
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]_
|
name.replace("-", "_"); //hyphen is not allowed in dbus, only [A-Z][a-z][0-9]_
|
||||||
dbusPath = QLatin1String("/internal/KSettingsWidget/") + name;
|
dbusPath = QLatin1String("/internal/KSettingsWidget/") + name;
|
||||||
dbusService = QLatin1String("org.kde.internal.KSettingsWidget_") + name;
|
dbusService = QLatin1String("org.kde.internal.KSettingsWidget_") + name;
|
||||||
|
@ -89,7 +89,7 @@ void KCModuleProxyPrivate::loadModule()
|
||||||
if( QDBusConnection::sessionBus().registerService( dbusService ) || bogusOccupier )
|
if( QDBusConnection::sessionBus().registerService( dbusService ) || bogusOccupier )
|
||||||
{ /* We got the name we requested, because no one was before us,
|
{ /* We got the name we requested, because no one was before us,
|
||||||
* or, it was an random application which had picked that name */
|
* 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 );
|
kcm = KCModuleLoader::loadModule( modInfo, KCModuleLoader::Inline, parent, args );
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ void KCModuleProxyPrivate::loadModule()
|
||||||
kcm->layout()->setMargin( 0 );
|
kcm->layout()->setMargin( 0 );
|
||||||
}
|
}
|
||||||
topLayout->addWidget( kcm );
|
topLayout->addWidget( kcm );
|
||||||
if( !modInfo.handle().isEmpty() )
|
if( !modInfo.library().isEmpty() )
|
||||||
QDBusConnection::sessionBus().registerObject(dbusPath, new KSettingsWidgetAdaptor(parent), QDBusConnection::ExportAllSlots);
|
QDBusConnection::sessionBus().registerObject(dbusPath, new KSettingsWidgetAdaptor(parent), QDBusConnection::ExportAllSlots);
|
||||||
|
|
||||||
if ( !rootInfo && /* If it's not already done */
|
if ( !rootInfo && /* If it's not already done */
|
||||||
|
|
Loading…
Add table
Reference in a new issue