Runtime check for broken Qt lib

F@lk Brettschneider falk.brettschneider at gmx.de
Mon Jun 10 21:50:05 UTC 2002


Marcus Gruendler wrote:

>Hi all,
>
>Roland recently fixed the problem with empty new lines in the COutputWidget of 
>KDevelop 2.1.2 by checking the Qt version by adding #ifdef's. Since this is a 
>compile time check, the workaround will not work if KDevelop is compiled with 
>Qt-3.0.3 and installed on a Qt-3.0.4 system.
>
>I have provided a patch wich checks for the Qt-version during runtime, which 
>works around the buggy RichText view regardles of the compile time 
>Qt-version. I simply compare qVersion() with the string "3.0.4". Could 
>someone with a 3.0.4 version please check if it's okay? I don't have my 3.0.4 
>version anymore since I've updated my system to SuSE 8.0 ;-).
>
>Bye, Marcus.
>
>P.S.: I hope it's the last patch for the output view ;-P
>
The patch seems to be OK.
Marcus, can you please have a look to bring line wrap back to 2.1.2cvs? 
It's been broken since the latest patches.

>
>
>------------------------------------------------------------------------
>
>? runtime-check.patch
>? stamp-h1
>Index: AUTHORS
>===================================================================
>RCS file: /home/kde/kdevelop/AUTHORS,v
>retrieving revision 1.18.2.27.2.12.2.8
>diff -u -3 -p -r1.18.2.27.2.12.2.8 AUTHORS
>--- AUTHORS	4 Jun 2002 21:59:41 -0000	1.18.2.27.2.12.2.8
>+++ AUTHORS	10 Jun 2002 15:24:49 -0000
>@@ -98,6 +98,7 @@ KDevelop 1.4, 2.0: Michel Stol (aka Wimp
> -Adam Dingle <adam at medovina.org>
> -Tim Brodie <tbrodie at displayworksinc.com>
> -Kuba Ober <kuba at mareimbrium.org>
>+-Marcus Gruendler <gruendler at tamalin.de>
>
Ah...good, sorry, we forgot it. Anybody we forgot as well?

>
> 
> ****Gnome Template Application****
> 
>Index: kdevelop/coutputwidget.cpp
>===================================================================
>RCS file: /home/kde/kdevelop/kdevelop/coutputwidget.cpp,v
>retrieving revision 1.3.2.4.2.10.2.21
>diff -u -3 -p -r1.3.2.4.2.10.2.21 coutputwidget.cpp
>--- kdevelop/coutputwidget.cpp	7 Jun 2002 18:03:05 -0000	1.3.2.4.2.10.2.21
>+++ kdevelop/coutputwidget.cpp	10 Jun 2002 15:24:51 -0000
>@@ -141,15 +141,12 @@ void CMakeOutputWidget::insertAtEnd(cons
>         append(line);
>         break;
>       default:
>-//  (rokrau 05/31/02) nasty, nasty
>-#if QT_VERSION == 304
>-          if (line[0] != '\n') {
>-#endif
>-            line ="<font color=\"black\">" + line + "</font>";
>-            append(line);
>-#if QT_VERSION == 304
>-          }
>-#endif
>+        // Runtime check for broken Qt version. Don't add empty new lines.
>+        if (line[0]=='\n' && strncmp(qVersion(), "3.0.4", sizeof("3.0.4")) == 0)
>+          break;
>+          
>+        line ="<font color=\"black\">" + line + "</font>";
>+        append(line);
>         break;
>     }
> 
>
Cheers
F at lk







More information about the KDevelop-devel mailing list