mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
generic: trim the lines when reading files
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
2eb69197c9
commit
b6af68c97d
2 changed files with 3 additions and 3 deletions
|
@ -303,7 +303,7 @@ QStringList KMimeTypeRepository::parents(const QString& mime)
|
||||||
//kDebug(7021) << "Now parsing" << fileName;
|
//kDebug(7021) << "Now parsing" << fileName;
|
||||||
if (qfile.open(QIODevice::ReadOnly)) {
|
if (qfile.open(QIODevice::ReadOnly)) {
|
||||||
while (!qfile.atEnd()) {
|
while (!qfile.atEnd()) {
|
||||||
const QByteArray line = qfile.readLine();
|
const QByteArray line = qfile.readLine().trimmed();
|
||||||
if (line.isEmpty() || line[0] == '#')
|
if (line.isEmpty() || line[0] == '#')
|
||||||
continue;
|
continue;
|
||||||
const int pos = line.indexOf(' ');
|
const int pos = line.indexOf(' ');
|
||||||
|
@ -572,7 +572,7 @@ const KMimeTypeRepository::AliasesMap& KMimeTypeRepository::aliases()
|
||||||
//kDebug(7021) << "Now parsing" << fileName;
|
//kDebug(7021) << "Now parsing" << fileName;
|
||||||
if (qfile.open(QIODevice::ReadOnly)) {
|
if (qfile.open(QIODevice::ReadOnly)) {
|
||||||
while (!qfile.atEnd()) {
|
while (!qfile.atEnd()) {
|
||||||
const QByteArray line = qfile.readLine();
|
const QByteArray line = qfile.readLine().trimmed();
|
||||||
if (line.isEmpty() || line[0] == '#')
|
if (line.isEmpty() || line[0] == '#')
|
||||||
continue;
|
continue;
|
||||||
const int pos = line.indexOf(' ');
|
const int pos = line.indexOf(' ');
|
||||||
|
|
|
@ -309,7 +309,7 @@ void KIconLoaderGlobalData::parseGenericIconsFiles(const QString& fileName)
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
if (file.open(QIODevice::ReadOnly)) {
|
if (file.open(QIODevice::ReadOnly)) {
|
||||||
while (!file.atEnd()) {
|
while (!file.atEnd()) {
|
||||||
const QByteArray line = file.readLine();
|
const QByteArray line = file.readLine().trimmed();
|
||||||
if (line.isEmpty() || line[0] == '#')
|
if (line.isEmpty() || line[0] == '#')
|
||||||
continue;
|
continue;
|
||||||
const int pos = line.indexOf(':');
|
const int pos = line.indexOf(':');
|
||||||
|
|
Loading…
Add table
Reference in a new issue