~ubuntu-branches/ubuntu/intrepid/qt4-x11/intrepid-updates

« back to all changes in this revision

Viewing changes to debian/patches/0227-qdatastream-regression.diff

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-06-11 15:01:30 UTC
  • Revision ID: james.westby@ubuntu.com-20080611150130-alqmw2cex1zmd5tj
Tags: 4.4.0-3ubuntu1
* Merge with Debian, remaining changes:
 - remove ibase and firebird from debian/control and debian/rules
 - patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
qt-bugs@ issue : N211089
 
2
Trolltech task ID : 211301
 
3
bugs.kde.org number : None
 
4
applied: no
 
5
author: Dirk Mueller <mueller@kde.org>
 
6
 
 
7
when launching Qt3 applications under a KDE that runs with Qt 4.4,
 
8
all apps either hang, crash, or eat horrible amounts of memory.
 
9
 
 
10
--- a/src/gui/kernel/qpalette.cpp
 
11
+++ b/src/gui/kernel/qpalette.cpp
 
12
@@ -79,9 +79,9 @@
 
13
         int max = QPalette::NColorRoles;
 
14
         if (s.version() <= QDataStream::Qt_2_1)
 
15
             max = QPalette::HighlightedText + 1;
 
16
-        if (s.version() <= QDataStream::Qt_4_3)
 
17
+        else if (s.version() <= QDataStream::Qt_4_3)
 
18
             max = QPalette::AlternateBase + 1;
 
19
-        for(int r = 0 ; r < max ; r++)
 
20
+       for(int r = 0 ; r < max ; r++)
 
21
             s << g.brush((QPalette::ColorRole)r);
 
22
     }
 
23
     return s;
 
24
@@ -1021,7 +1021,7 @@
 
25
             int max = QPalette::ToolTipText + 1;
 
26
             if (s.version() <= QDataStream::Qt_2_1)
 
27
                 max = QPalette::HighlightedText + 1;
 
28
-            if (s.version() <= QDataStream::Qt_4_3)
 
29
+            else if (s.version() <= QDataStream::Qt_4_3)
 
30
                 max = QPalette::AlternateBase + 1;
 
31
             for (int r = 0; r < max; r++)
 
32
                 s << p.d->br[grp][r];
 
33
--- a/src/gui/painting/qbrush.cpp
 
34
+++ b/src/gui/painting/qbrush.cpp
 
35
@@ -924,12 +924,24 @@
 
36
 
 
37
 QDataStream &operator<<(QDataStream &s, const QBrush &b)
 
38
 {
 
39
-    s << (quint8)b.style() << b.color();
 
40
-    if (b.style() == Qt::TexturePattern) {
 
41
+    quint8 style = (quint8) b.style();
 
42
+
 
43
+    if (s.version() < QDataStream::Qt_4_0) {
 
44
+
 
45
+        if (style == Qt::LinearGradientPattern
 
46
+                || style == Qt::RadialGradientPattern
 
47
+                || style == Qt::ConicalGradientPattern)
 
48
+           style = Qt::NoBrush;
 
49
+    }
 
50
+
 
51
+    s << style << b.color();
 
52
+    if (b.style() == Qt::TexturePattern)
 
53
         s << b.texture();
 
54
-    } else if (b.style() == Qt::LinearGradientPattern
 
55
+
 
56
+    if (s.version() >= QDataStream::Qt_4_0 && (
 
57
+            b.style() == Qt::LinearGradientPattern
 
58
                || b.style() == Qt::RadialGradientPattern
 
59
-               || b.style() == Qt::ConicalGradientPattern) {
 
60
+               || b.style() == Qt::ConicalGradientPattern)) {
 
61
         const QGradient *gradient = b.gradient();
 
62
         int type_as_int = int(gradient->type());
 
63
         s << type_as_int;