[prev in list] [next in list] [prev in thread] [next in thread] 

List:       taglib-devel
Subject:    Re: Creating FileRef object from QString
From:       Michael Pyne <mpyne () purinchu ! net>
Date:       2009-12-05 21:29:08
Message-ID: 200912051629.13732.mpyne () purinchu ! net
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Saturday 05 December 2009 15:25:13 Plasty Grove wrote:
> That makes sense, but even the following doesn't work:
> 
> QString qstr = "/home/mydir/music/song.mp3";
> QByteArray qbArray = qstr.toLocal8Bit();
> const char* str = qbArray.constData();
> TagLib::FileRef tagFile(str);
> 
> In this case, I've got a local object which stores the value returned by
> toLocal8Bit() and which is in scope when I'm using str. Does qbArray get
> destroyed whenever constData() is called on it? When I'm debugging, I can
> still see str holding a value when it goes to the next step.

Perhaps an encoding issue if you don't use straight US-ASCII for your file 
names? In that case if "local8Bit" is not the encoding Taglib is expecting 
you'll get weirdness.

The KDE JuK music manager uses taglib and has TString/QString conversion code 
(and I'm sure Amarok has the same thing) if you want to see how those projects 
do it.

If it's not encoding I'm not sure what to try other than stepping through 
FileRef in the debugger to see where the logic goes astray.

Regards,
 - Michael Pyne

["signature.asc" (application/pgp-signature)]

_______________________________________________
taglib-devel mailing list
taglib-devel@kde.org
https://mail.kde.org/mailman/listinfo/taglib-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic