[mythtv] LastFM support in MythMusic

Willem Ligtenberg wligtenberg at gmail.com
Tue Feb 26 16:02:54 UTC 2008


uint8_t *c_string = (uint8_t*)string.ascii();

Also results in a core dump...

or
uint8_t *c_string = (uint8_t*)string.local8bit();

QString doesn't have the function local8bit().

So, it still doesn't work...
Thanks though,

Willem

On Tue, Feb 26, 2008 at 4:23 PM, Paul Harrison <mythtv at dsl.pipex.com> wrote:
> Willem Ligtenberg wrote:
>  > I have created an extra method:
>  > uint8_t *my_md5(QString string)
>  > {
>  >     uint8_t *md5val;
>  >     uint8_t *c_string = (uint8_t*)string.toUInt();
>  >     av_md5_sum(md5val, c_string, string.length());
>  >     return md5val;
>  > }
>  >
>  > And I call this method as follows:
>  > uint8_t *test = my_md5(authtoken.utf8());
>  > cout << *test << endl;
>  >
>  > Cheers,
>  >
>  > Willem
>  >
>
>  The problem is here:-
>
>
>  uint8_t *c_string = (uint8_t*)string.toUInt();
>
>  That converts the string to an unsigned integer what you want is a
>  pointer to the data that represents the string. Something like this:
>
>  uint8_t *c_string = (uint8_t*)string.ascii();
>  or
>  uint8_t *c_string = (uint8_t*)string.local8bit();
>
>  should work.
>
>
>
>  Paul H.
>
>
>
>  _______________________________________________
>  mythtv-dev mailing list
>  mythtv-dev at mythtv.org
>  http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>


More information about the mythtv-dev mailing list