[kde-solaris] C++ looking errors

Stefan Teleman steleman at nyc.rr.com
Tue May 18 01:50:42 CEST 2004


*sigh* ...

yes, cvs diff screwed up again. it created a 0 (zero) sized diff file 
for dcopref.h.

from now on i will make diff patches with xdelta. hopefully this one 
works. :-)

in this particular case, the patch has to be applied to 
kdelibs/dcop/dcopref.h:

diff -w dcopref.h dcopref.h.kde.orig 
27,28d26
< #include <qstringlist.h>
< 
63,90d60
<       return t;
<     }
<     operator const QStringList()
<     {
<         QStringList t;
<       if ( typeCheck( dcopTypeName(t), true ) )
<       {
<            QDataStream reply( data, IO_ReadOnly );
<            reply >> t;
<         }
<       else
<       {
<           dcopTypeInit(t);
<       }
<       return t;
<     }
<     operator const QString()
<     {
<         QString t;
<       if ( typeCheck( dcopTypeName(t), true ) )
<       {
<           QDataStream reply( data, IO_ReadOnly );
<           reply >> t;
<       }
<       else
<       {
<           dcopTypeInit(t);
<       }

And now the explanation:
the assignment operator considers the rvalue to be implicitly const.

This same problem occurs in several places throughout kde. However, 
because it mostly occurs for the conversion to either QString or 
QStringList, which is very prevalent throughout the code, it was 
easier to just patch dcopref, instead of relying on crazy nested 
casts (which is the alternative way of fixing this without changing a 
header file). For example, here's the diff fix with casts in 
kdepim-3.2.1/kontact/plugins/weather/summarywidget.cpp:

13:+  mWeatherMap[ station ].setIcon( 
const_cast<QPixmap>(static_cast<const QPixmap>(dcopCall.call( 
"currentIcon(QString)", station, true)) ) );

Not pretty.

Unfortunately, after applying the dcopref.h patch, you will probably 
have to rebuild kdelibs from scratch, because the change affects a 
header file which included by very many other files ...

--Stefan

-----

On Monday 17 May 2004 09:16, Alex Stade wrote:
> On Sunday 16 May 2004 11:42 pm, Stefan Teleman wrote:
> > Well, it looks like 'cvs diff' doesn't always diff what it's
> > supposed to diff ... because i had this patched and cvs diff
> > didn't pick it up.
>
> Could there be more stuff that the cvs diff didn't take care of? I
> just got this;
>
> /bin/bash ../libtool --silent --mode=compile
> --tag=CXX /opt/lang/workshop-8.0/SUNWspro/prod/bin/CC
> -DHAVE_CONFIG_H  -I. -I. -I.. -I../dcop -I../kio/kssl -I../kdefx
> -I../interfaces -I../dcop -I../libltdl -I../kdefx -I../kdecore
> -I../kdeui -I../kio -I../kio/kio -I../kio/kfile -I..
> -I/opt/kde/devel/qt/include  -I/opt/kde/devel/include
> -I/opt/kde/devel/extern/include -I/usr/sfw/include  -mt
> -DQT_THREAD_SUPPORT -I/opt/kde/devel/include     
> -I/opt/kde/devel/extern/include -I/opt/kde/devel/qt/include    
> -I/usr/sfw/include      -I/usr/dt/include -I/usr/openwin/include 
> -I/opt/kde/devel/include
> -I/opt/kde/devel/qt/include     -I/opt/kde/devel/extern/include
> -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4  
> -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT
> -DQT_NO_TRANSLATION  -c -o kactionclasses.lo `test -f
> 'kactionclasses.cpp' || echo
> './'`kactionclasses.cpp
> "../kdecore/kdebug.h", line 236: Warning: d hides kdbgstream::d.
> "kactionclasses.cpp", line 1938: Warning: window hides
> KToggleFullScreenAction::window.
> "../dcop/dcopref.h", line 57: Error: The operation "QDataStream>>
> const QStringList" is illegal.
> "kactionclasses.cpp", line 2191:     Where: While instantiating
> "DCOPReply::operator const QStringList<const QStringList>()".
> "kactionclasses.cpp", line 2191:     Where: Instantiated from
> non-template code.
> 1 Error(s) and 2 Warning(s) detected.
> *** Error code 1
> make: Fatal error: Command failed for target `kactionclasses.lo'
> Current working directory
> /home/troll/alex/KDE_Solaris_9/kdelibs-3.2.1/kdeui *** Error code 1
> make: Fatal error: Command failed for target `all-recursive'
> Current working directory
> /home/troll/alex/KDE_Solaris_9/kdelibs-3.2.1/kdeui *** Error code 1
> make: Fatal error: Command failed for target `all-recursive'
> Current working directory
> /home/troll/alex/KDE_Solaris_9/kdelibs-3.2.1 *** Error code 1
> make: Fatal error: Command failed for target `all'
>
> -Alex
> ___________________________________________________
> This message is from the kde-solaris mailing list.
> Account management: 
> https://mail.kde.org/mailman/listinfo/kde-solaris. Archives:
> http://lists.kde.org/.
> More info: http://www.kde.org/faq.html.

-- 
Stefan Teleman          'Nobody Expects the Spanish Inquisition'
steleman at nyc.rr.com                          -Monty Python



More information about the kde-solaris mailing list