On Monday 25 August 2008 08:14:19 Gerhard Gappmeier wrote: > If noticed that readNumberFromFile() and readStringFromFile() are using > fopen to access the file. > 1.) For passing the filename as character string, it uses > QString::toLatin1() > This will not work if the filename has any special characters that don't > fit into the local character set. > QString::toLocal8Bit() would do that job.
It should be QFile::encodeName(), since it is possible the filesystem uses a different encoding than the application. > 2.) Why using fopen at all? I think using QFile would be more consistent > to the rest of the Qt code. > But this would be more cosmetic change, becasue fopen should be portable > too. QFile would generally be better because it takes care of things like closing it once you are done with it (ie: the QFile goes out of scope). Alex -- Proud KDE hacker: http://www.kde.org Get KDE 4.1 - out now! Arch Linux: perfect for geeks like me - http://www.archlinux.org OpenSUSE: just works - http://www.opensuse.org
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel