Plans for KUrl in kconfig_compiler [was: Plans for KUrl in KConfig?]

Adam Treat treat at kde.org
Mon Mar 12 18:31:18 GMT 2007


On Monday 12 March 2007, Andreas Pakulat wrote:
> On 12.03.07 14:26:05, Stephan Kulow wrote:
> > Am Montag 12 März 2007 schrieb Andreas Pakulat:
> > > void QMakeBuilderPreferences::load()
> > > {
> > >     KDevelop::ConfigModule::load();
> > >     m_prefsUi->qmakebin->setUrl(QMakeBuilderSettings::qmakebin());
> > >     connect(m_prefsUi->qmakebin, SIGNAL(textChanged(const QString&)),
> > > this, SLOT(changed())); connect(m_prefsUi->qmakebin,
> > > SIGNAL(returnPressed()), this, SLOT(changed()));
> > > connect(m_prefsUi->qmakebin,
> > > SIGNAL(urlSelected(const KUrl&)), this, SLOT(changed())); }
> > >
> > > void QMakeBuilderPreferences::save()
> > > {
> > >    
> > > QMakeBuilderSettings::setQmakebin(m_prefsUi->qmakebin->url().url());
> > > KDevelop::ConfigModule::save();
> > > }
> > >
> > > KDevelop::ConfigModule is a subclass of KCModule and doesn't override
> > > load or save methods. Similar code is duplicated whenever somebody
> > > wants to use a KUrlRequester with a KCModule (I guess thats a bit of
> > > information that was missing in my OP :)
> >
> > Well, I see no KConfig code used, so it looks weired that you want to
> > change KConfig.
>
> Uhm, right. I shouldn't write half asleep :) What I need to change (as
> far as I can see) is kconfig_compiler and possibly KConfigSkeleton and
> KCModule (haven't looked into these two in detail, so am not sure).
>
> Sorry for the confusion.

No, you need to change the KConfigDialogManager class to be aware of 
KUrlRequester and make sure that KUrlRequester has a USER property.  Then you 
need to modify the KConfigDialogManager propertyMap and changedMap so that 
KConfigDialogManager is aware of the signal KUrlRequester uses to let you 
know the USER property has changed state.

IOW, see KConfigDialogManager::initMaps() :)

http://websvn.kde.org/trunk/KDE/kdelibs/kdeui/dialogs/kconfigdialogmanager.cpp?revision=635550&view=markup

Cheers,

Adam




More information about the kde-core-devel mailing list