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

List:       kde-devel
Subject:    Re: Storing images in KConfig keys
From:       Andreas Hartmetz <ahartmetz () gmail ! com>
Date:       2009-10-12 18:19:36
Message-ID: 200910122019.36246.hartmetz () physik ! hu-berlin ! de
[Download RAW message or body]

On Monday 12 October 2009 00:42:41 Michael Pyne wrote:
> On Sunday 11 October 2009 18:03:03 Stefan Majewsky wrote:
> > I don't think it's base64-encoded, because the following code works to
> > read a base64-encoded image from a hand-written config file:
> 
> I went and looked and binary data is encoded, at least for KConfigINI
>  backend (see kconfigini.cpp, writeEntries() and stringToPrintable())
> 
> It seems to me that it is possible to choose a superior text-encoding
>  method beforehand however (as bytes that require encoding will take up 4x
>  more space), which should reduce the space required in the config file.
> 
I've written the encoding and decoding code; the intended use case was a 
QByteArray containing ASCII or UTF-8 data. In any case we can't change it now, 
so I'd recommend to just use base64 encoding and decoding functions in the 
application.
That said, using KConfig for bulk data storage is both inefficient and 
somewhat ugly. How much image data is there? A few kilobytes should be okay.
> I'm going to assume that's there's no way to simply save out the binary
>  data to disk and store a reference to the file name in your KConfig? :)
> 
> Regards,
>  - Michael Pyne
> 
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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