Gentoo Archives: gentoo-commits

From: "Jorge Manuel B. S. Vicetto (jmbsvicetto)" <jmbsvicetto@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-sound/amarok/files: amarok-2.3.2-fix-qt-regression.patch
Date: Mon, 27 Sep 2010 11:01:37
Message-Id: 20100927110134.0147F20054@flycatcher.gentoo.org
1 jmbsvicetto 10/09/27 11:01:33
2
3 Added: amarok-2.3.2-fix-qt-regression.patch
4 Log:
5 [media-sound/amarok-2.3.2-r1] Now that we finally have working patches for mariadb and mysql 5.1.50,
6 fixed the embedded deps and added embedded to IUSE defaults.
7 Added an upstream patch to fix issues with the collection scanning caused by a QT bug/regression -
8 https://bugs.kde.org/show_bug.cgi?id=251762#c10
9
10 (Portage version: 2.2_rc87/cvs/Linux x86_64)
11
12 Revision Changes Path
13 1.1 media-sound/amarok/files/amarok-2.3.2-fix-qt-regression.patch
14
15 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/amarok/files/amarok-2.3.2-fix-qt-regression.patch?rev=1.1&view=markup
16 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/amarok/files/amarok-2.3.2-fix-qt-regression.patch?rev=1.1&content-type=text/plain
17
18 Index: amarok-2.3.2-fix-qt-regression.patch
19 ===================================================================
20 From 79d86829294ac54132c01153660e70e30c15c378 Mon Sep 17 00:00:00 2001
21 From: Jeff Mitchell <mitchell@×××.org>
22 Date: Wed, 22 Sep 2010 18:15:17 -0400
23 Subject: [PATCH] Re-add some tests for unprintable but also invalid chars. Apparently Qt's XML classes don't properly check for invalid chars when writing XML, even if you tell them to.
24
25 Also switch to QXmlStreamWriter, as apparently going forward it is the more supported class.
26
27 BUG: 251762
28 ---
29 utilities/collectionscanner/CollectionScanner.cpp | 27 +++++++++++++-------
30 1 files changed, 17 insertions(+), 10 deletions(-)
31
32 diff --git a/utilities/collectionscanner/CollectionScanner.cpp b/utilities/collectionscanner/CollectionScanner.cpp
33 index 0a23a53..28c554b 100644
34 --- a/utilities/collectionscanner/CollectionScanner.cpp
35 +++ b/utilities/collectionscanner/CollectionScanner.cpp
36 @@ -37,13 +37,13 @@
37 #include <QByteArray>
38 #include <QDBusReply>
39 #include <QDir>
40 -#include <QDomDocument>
41 #include <QFile>
42 #include <QtDebug>
43 #include <QTextCodec>
44 #include <QTextStream>
45 #include <QTimer>
46 #include <QThread>
47 +#include <QXmlStreamWriter>
48
49 //Taglib:
50 #include <apetag.h>
51 @@ -814,8 +814,10 @@ CollectionScanner::readTags( const QString &path, TagLib::AudioProperties::ReadS
52 void
53 CollectionScanner::writeElement( const QString &name, const AttributeHash &attributes )
54 {
55 - QDomDocument doc; // A dummy. We don't really use DOM, but SAX2
56 - QDomElement element = doc.createElement( name );
57 + QString text;
58 + QXmlStreamWriter writer( &text );
59 +
60 + writer.writeStartElement( name );
61
62 QHashIterator<QString, QString> it( attributes );
63 while( it.hasNext() )
64 @@ -829,7 +831,15 @@ CollectionScanner::writeElement( const QString &name, const AttributeHash &attri
65 bool noCategory = false;
66 for( unsigned i = 0; i < len; i++ )
67 {
68 - if( data[i].category() == QChar::NoCategory )
69 + if( data[i].category() == QChar::NoCategory ||
70 + data[i].category() == QChar::Other_Surrogate ||
71 + (
72 + data[i].unicode() < 20 &&
73 + data[i].unicode() != 9 &&
74 + data[i].unicode() != 10 &&
75 + data[i].unicode() != 13
76 + )
77 + )
78 {
79 noCategory = true;
80 break;
81 @@ -838,15 +848,12 @@ CollectionScanner::writeElement( const QString &name, const AttributeHash &attri
82
83 if( noCategory )
84 continue;
85 -
86 - element.setAttribute( it.key(), it.value() );
87 + writer.writeAttribute( it.key(), it.value() );
88 }
89
90 - QString text;
91 - QTextStream stream( &text, QIODevice::WriteOnly );
92 - element.save( stream, 0 );
93 + writer.writeEndElement();
94
95 - std::cout << text.toUtf8().data() << std::endl;
96 + std::cout << text.toUtf8().data() << std::endl << std::endl;
97 }
98
99 // taken verbatim from Qt's sources, since it's stupidly in the QtGui module
100 --
101 1.7.0.4