This is a multi-part message in MIME format. --===============2794578958145561399== Content-Type: multipart/alternative; boundary="nextPart1655498.4JX5k9QRnF" Content-Transfer-Encoding: 7Bit This is a multi-part message in MIME format. --nextPart1655498.4JX5k9QRnF Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Friday 15 March 2013, 00:10, El boulangero wrote: > Hi again, > > > After that, I tried to hack in the writeConfig function, create a new > > QVariant with a simple string, and feed it to the > > KConfigGroup::writeEntry( QString, QVariant ) function. > > > > But then I got the following error from Amarok: > >> KConfigGroup::writeEntry: KConfigGroup::writeEntry - unhandled type > >> QVariantMap in group "Good Morning" > My bad, I messed up, I launched the wrong binary. > So, let me start again. > > If I hack the writeConfig, and do something like that: > > void AmarokScriptConfig::writeConfig( const QString &name, const > > QVariant &content, int dummy ) { > > > > QVariant v("yop"); > > KGlobal::config()->group( m_name ).writeEntry( name, v ); > > > > } > > It works just fine, I got the expected result. > > But if I let function as it is, ie: > > void AmarokScriptConfig::writeConfig( const QString &name, const > > QVariant &content, int dummy ) { > > > > KGlobal::config()->group( m_name ).writeEntry( name, content ); > > > > } > > I get the error: > > KConfigGroup::writeEntry: KConfigGroup::writeEntry - unhandled type > > QVariantMap in group "Good Morning" > I guess it means my javascript object is converted to a QVariantMap by > the binding. And KConfigGroup::writeEntry is unabled to interpret > that. > Am I correct ? > > Regards I think so, if you look at [1] you can see that there is no code path for QVariant::Map. Just restructure your config data so it can be properly (de)serialized. Lists are supported in KConfigGroup, so try to use them. Greets [1] http://api.kde.org/4.10-api/kdelibs-apidocs/kdecore/html/kconfiggroup_8cpp_source.html -- Kevin Funk --nextPart1655498.4JX5k9QRnF Content-Transfer-Encoding: 7Bit Content-Type: text/html; charset="us-ascii"

On Friday 15 March 2013, 00:10, El boulangero wrote:

> Hi again,

>

> > After that, I tried to hack in the writeConfig function, create a new

> > QVariant with a simple string, and feed it to the

> > KConfigGroup::writeEntry( QString, QVariant ) function.

> >

> > But then I got the following error from Amarok:

> >> KConfigGroup::writeEntry: KConfigGroup::writeEntry - unhandled type

> >> QVariantMap in group "Good Morning"

> My bad, I messed up, I launched the wrong binary.

> So, let me start again.

>

> If I hack the writeConfig, and do something like that:

> > void AmarokScriptConfig::writeConfig( const QString &name, const

> > QVariant &content, int dummy ) {

> >

> > QVariant v("yop");

> > KGlobal::config()->group( m_name ).writeEntry( name, v );

> >

> > }

>

> It works just fine, I got the expected result.

>

> But if I let function as it is, ie:

> > void AmarokScriptConfig::writeConfig( const QString &name, const

> > QVariant &content, int dummy ) {

> >

> > KGlobal::config()->group( m_name ).writeEntry( name, content );

> >

> > }

>

> I get the error:

> > KConfigGroup::writeEntry: KConfigGroup::writeEntry - unhandled type

> > QVariantMap in group "Good Morning"

> I guess it means my javascript object is converted to a QVariantMap by

> the binding. And KConfigGroup::writeEntry is unabled to interpret

> that.

> Am I correct ?

>

> Regards

 

I think so,

 

if you look at [1] you can see that there is no code path for QVariant::Map.

Just restructure your config data so it can be properly (de)serialized. Lists are supported in KConfigGroup, so try to use them.

 

Greets

 

[1] http://api.kde.org/4.10-api/kdelibs-apidocs/kdecore/html/kconfiggroup_8cpp_source.html

 

--

Kevin Funk

--nextPart1655498.4JX5k9QRnF-- --===============2794578958145561399== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Amarok mailing list Amarok@kde.org https://mail.kde.org/mailman/listinfo/amarok --===============2794578958145561399==--