Use QFile::encodeName to encode a file name on Unix

This usually matches QString::toLocal8Bit, not toAscii.

Change-Id: I7b1c3e500be8265de0710cf36ca407c8b3f31edd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
bb10
Thiago Macieira 2012-05-02 14:46:10 +02:00 committed by Qt by Nokia
parent 7c717e56f5
commit 0ec1b9d162
2 changed files with 2 additions and 2 deletions

View File

@ -415,7 +415,7 @@ QStringList QBasicFontDatabase::addTTFile(const QByteArray &fontData, const QByt
QString family = QString::fromAscii(face->family_name);
FontFile *fontFile = new FontFile;
fontFile->fileName = QString::fromAscii(file);
fontFile->fileName = QFile::decodeName(file);
fontFile->indexValue = index;
QFont::Stretch stretch = QFont::Unstretched;

View File

@ -254,7 +254,7 @@ void qt_parseEtcLpPrinters(QList<QPrinterDescription> *printers)
QFileInfo printer = dirs.at(i);
if (printer.isDir()) {
tmp.sprintf("/etc/lp/printers/%s/configuration",
printer.fileName().toAscii().data());
QFile::encodeName(printer.fileName()).data());
QFile configuration(tmp);
char *line = new char[1025];
QString remote(QLatin1String("Remote:"));