diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-09-03 17:05:31 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-09-03 17:05:31 +0000 |
| commit | 756f51ca14832d8d3534da2e9ff77fc0362d5045 (patch) | |
| tree | 181d291ba155cb6491b679f6d1ad024c879de4b8 /src/plugins/Ui/skinned/skin.cpp | |
| parent | f536b76e44e084d68530ba103dffc12c347210e8 (diff) | |
| download | qmmp-756f51ca14832d8d3534da2e9ff77fc0362d5045.tar.gz qmmp-756f51ca14832d8d3534da2e9ff77fc0362d5045.tar.bz2 qmmp-756f51ca14832d8d3534da2e9ff77fc0362d5045.zip | |
skinned: fixed issue with UTF-16 encoded pledit.txt (#880)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6704 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Ui/skinned/skin.cpp')
| -rw-r--r-- | src/plugins/Ui/skinned/skin.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/plugins/Ui/skinned/skin.cpp b/src/plugins/Ui/skinned/skin.cpp index 773421f7b..c2f716587 100644 --- a/src/plugins/Ui/skinned/skin.cpp +++ b/src/plugins/Ui/skinned/skin.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2007-2015 by Ilya Kotov * + * Copyright (C) 2007-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * Based on Promoe, an XMMS2 Client * @@ -27,6 +27,8 @@ #include <QPolygon> #include <QImage> #include <QAction> +#include <QTextStream> +#include <QStringList> #include <qmmp/qmmp.h> #include "actionmanager.h" #include "skin.h" @@ -431,22 +433,27 @@ void Skin::loadPLEdit() QFile file(path); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) + { qFatal("Skin: unable to open %s", qPrintable(path)); + return; + } - while (!file.atEnd ()) + QTextStream stream(&file); + + while (!stream.atEnd ()) { - QByteArray line = file.readLine (); + QString line = stream.readLine (); line = line.trimmed (); line.replace("\"",""); if(line.contains("//")) line.truncate (line.indexOf ("//")); - QList<QByteArray> l = line.split ('='); + QStringList l = line.split ('='); if (l.count () == 2) { - key = l[0].toLower (); - value = l[1].trimmed(); + key = l[0].toLower().toLatin1(); + value = l[1].trimmed().toLatin1(); if(!value.startsWith("#") && key != "font") value.prepend("#"); //add # for color if needed |
