1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Using UTF-8 when reading files.

This commit is contained in:
nowrep 2012-07-08 21:17:10 +02:00
parent 0e12433c0e
commit b0f209b1da
3 changed files with 4 additions and 4 deletions

View File

@ -769,7 +769,7 @@ QUrl MainApplication::userStyleSheet(const QString &filePath) const
QFile file(filePath);
if (!filePath.isEmpty() && file.open(QFile::ReadOnly)) {
QString fileData = file.readAll();
QString fileData = QString::fromUtf8(file.readAll());
fileData.remove('\n');
userStyle.append(fileData);
file.close();

View File

@ -50,11 +50,11 @@ QPixmap qz_pixmapFromByteArray(const QByteArray &data)
return image;
}
QByteArray qz_readAllFileContents(const QString &filename)
QString qz_readAllFileContents(const QString &filename)
{
QFile file(filename);
if (file.open(QFile::ReadOnly)) {
QByteArray a = file.readAll();
QString a = QString::fromUtf8(file.readAll());
file.close();
return a;
}

View File

@ -32,7 +32,7 @@ class QUrl;
QByteArray QT_QUPZILLA_EXPORT qz_pixmapToByteArray(const QPixmap &pix);
QPixmap QT_QUPZILLA_EXPORT qz_pixmapFromByteArray(const QByteArray &data);
QByteArray QT_QUPZILLA_EXPORT qz_readAllFileContents(const QString &filename);
QString qz_readAllFileContents(const QString &filename);
void QT_QUPZILLA_EXPORT qz_centerWidgetOnScreen(QWidget* w);
void QT_QUPZILLA_EXPORT qz_centerWidgetToParent(QWidget* w, QWidget* parent);